/* VITON13 ONE: a full-screen frame with a moving indigo and cyan field. */

:root {
  --ink: #020306;
  --deep: #0b1230;
  --ice: #bfe4ff;
  --lavender: #b3a6ff;
  --paper: #ffffff;
  --mist: #c5cdea;
  --pane: rgba(209, 225, 240, 0.86);
  --pane-ink: #0b1230;
  --pane-muted: #46517a;
  --glass: rgba(255, 255, 255, 0.06);
  --soft: rgba(255, 255, 255, 0.09);
  --soft-hover: rgba(255, 255, 255, 0.16);
  --tint: rgba(255, 255, 255, 0.09);
  --tint-hover: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.11);
  --warn: #ffe0a6;
  --bad: #ffcfc6;
  --good: #b9f5d6;
  --font: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --control: 36px;
  --control-bar: 32px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--paper);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
::selection { background: rgba(140, 200, 255, 0.4); }

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 8px;
}
main:focus, h1:focus { outline: none; }

.visuallyHidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 50;
  padding: 9px 16px;
  border-radius: 999px;
  background: #fff;
  color: var(--deep);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.quiet { color: var(--mist); font-size: 13px; }
.lead { color: var(--mist); font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.icon { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------- the moving field */

.frame {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ink);
}

.frameLight {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: #010101;
}

.frameLight i {
  position: absolute;
  display: block;
  border-radius: 50%;
  will-change: transform;
}
/* Deep blue, rising on the left. */
.frameLight i:nth-child(1) {
  left: -28%;
  top: 10%;
  width: 86%;
  height: 130%;
  background: radial-gradient(closest-side, rgba(46, 78, 224, 0.98), rgba(50, 84, 222, 0.56) 50%, rgba(58, 92, 226, 0));
  animation: lightA 19s ease-in-out infinite alternate;
}
/* Clear blue, through the middle and right. */
.frameLight i:nth-child(2) {
  right: -20%;
  top: 14%;
  width: 96%;
  height: 128%;
  background: radial-gradient(closest-side, rgba(58, 138, 236, 0.98), rgba(58, 128, 232, 0.56) 50%, rgba(58, 110, 226, 0));
  animation: lightB 23s ease-in-out infinite alternate;
}
/* The wide soft light: clear cyan that crosses the centre and the lower field
   and back, so the screen passes from deep blue to cyan as it goes by. */
.frameLight i:nth-child(3) {
  left: -20%;
  top: 40%;
  width: 140%;
  height: 92%;
  background: radial-gradient(closest-side, rgba(168, 236, 255, 0.98), rgba(132, 218, 252, 0.86) 30%, rgba(104, 196, 246, 0.5) 54%, rgba(82, 160, 224, 0.16) 78%, rgba(82, 160, 224, 0));
  animation: lightC 12s ease-in-out infinite alternate;
}
/* A second, slower wash drifts the other way and lets the colour itself move
   between royal blue and aqua. It only moves and breathes slowly: no flash. */
.frameLight::before {
  content: "";
  position: absolute;
  inset: 36% -30% -20%;
  z-index: 1;
  background: radial-gradient(46% 62% at 28% 58%, rgba(120, 230, 255, 0.6), rgba(120, 230, 255, 0) 72%), radial-gradient(44% 60% at 76% 46%, rgba(78, 128, 255, 0.55), rgba(78, 128, 255, 0) 74%);
  animation: lightDrift 17s ease-in-out infinite alternate;
  will-change: transform, opacity;
}
/* The milky glow that travels along the lower edge. */
.frameLight i:nth-child(4) {
  left: 4%;
  bottom: -46%;
  width: 92%;
  height: 86%;
  background: radial-gradient(closest-side, rgba(250, 251, 255, 0.98), rgba(222, 236, 250, 0.74) 46%, rgba(209, 225, 240, 0));
  animation: lightD 21s ease-in-out infinite alternate;
}
/* A soft lower glow on the home screen and a darker reading surface on tool pages. */
.frameLight::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  height: 44%;
  background: linear-gradient(
    0deg,
    rgba(250, 251, 255, 0.98) 0%,
    rgba(236, 244, 252, 0.84) 18%,
    rgba(229, 240, 251, 0.56) 36%,
    rgba(221, 235, 250, 0.27) 55%,
    rgba(214, 230, 245, 0.08) 72%,
    rgba(209, 225, 240, 0.02) 88%,
    transparent 100%
  );
}
.frame:has(main[data-view]:not([data-view="home"])) .frameLight::after {
  inset: 0;
  height: 100%;
  background: rgba(2, 5, 24, 0.52);
}

/* Only transforms move, at one constant brightness: nothing blinks, and the
   interface above the light does not move with it. */
@keyframes lightA {
  from { transform: translate3d(-10%, 8%, 0) scale(0.92); }
  to { transform: translate3d(26%, -10%, 0) scale(1.14); }
}
@keyframes lightB {
  from { transform: translate3d(12%, 6%, 0) scale(1.06); }
  to { transform: translate3d(-24%, -8%, 0) scale(0.9); }
}
@keyframes lightC {
  from { transform: translate3d(-46%, 5%, 0) scale(0.9); }
  to { transform: translate3d(46%, -4%, 0) scale(1.1); }
}
@keyframes lightDrift {
  from { transform: translate3d(16%, 3%, 0) scale(1.04); opacity: 0.5; }
  to { transform: translate3d(-16%, -4%, 0) scale(1.12); opacity: 1; }
}
@keyframes lightD {
  from { transform: translate3d(-18%, 4%, 0) scale(0.94); }
  to { transform: translate3d(18%, -6%, 0) scale(1.1); }
}

/* ------------------------------------------------------------------ bar */

.bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 0 max(22px, env(safe-area-inset-left));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  justify-self: start;
  min-height: 44px;
  text-decoration: none;
}
/* The official mark is black artwork on transparency; on the dark frame it is inverted. */
.brandMark { display: block; flex: none; width: 24px; height: 24px; filter: invert(1) brightness(1.08); }
.brandName { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.vitonWord { display: inline-flex; align-items: flex-start; font-size: 15px; font-weight: 700; letter-spacing: -0.045em; line-height: 1; }
.vitonWord sup { margin: -0.15em 0 0 0.1em; font-size: 0.55em; font-weight: 700; letter-spacing: -0.04em; line-height: 1; vertical-align: baseline; }
.brandOne { font-size: 13px; font-weight: 500; letter-spacing: 0.26em; }

/* Plans, language, service status and sign-in: one quiet group, four controls
   of one height and one shape. */
.barEnd {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}
.plansLink, .statusButton, .languageButton, .themeButton, .accountButton {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: var(--control-bar);
  min-height: var(--control-bar);
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--mist);
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.plansLink:hover, .statusButton:hover, .languageButton:hover, .themeButton:hover, .accountButton:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.plansLink[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.14); }
.languageButton { font-weight: 500; letter-spacing: 0.04em; }
.statusButton { padding: 0; }
/* The theme switch: a dot of the colour it switches to. */
.themeButton { padding: 0; }
.themeDot { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85); }
.themeDot.is-blue { background: linear-gradient(135deg, #52a0e0, #2e4ee0); }
.themeDot.is-orange { background: linear-gradient(135deg, #ffb35c, #e2531c); }
.accountButton { max-width: 170px; background: rgba(255, 255, 255, 0.12); color: #fff; }
.accountButton:hover { background: rgba(255, 255, 255, 0.2); }
.accountButton span { overflow: hidden; text-overflow: ellipsis; }
/* The status is the icon alone, with no coloured mark. Its state is in the
   button's accessible name and in the dialog it opens. */

/* ----------------------------------------------------------------- main */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 22px max(26px, env(safe-area-inset-bottom));
}

/* The centre of the first screen (title, photographs, prompt) sits lower as one
   block: --drop is 46px on a desktop and less on a phone (see the sizes below). */
.hero { --drop: 46px; padding-top: calc(clamp(18px, 5.4vh, 54px) + var(--drop)); text-align: center; }
.wordmark {
  padding-left: 0.52em;
  color: var(--mist);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.52em;
  line-height: 1;
}
.hero h1 {
  margin-top: 14px;
  font-size: clamp(20px, 2.3vw, 30px);
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.22;
  text-wrap: balance;
}

/* The caption stands on the pale lower edge, in dark type. */
.core { margin-top: auto; padding-top: clamp(26px, 5vh, 52px); color: #1c2a5c; font-size: 12px; font-weight: 500; letter-spacing: 0.02em; text-align: center; }

.sectionHead { padding-top: clamp(20px, 4.4vh, 44px); text-align: center; }
.sectionHead h1 { font-size: clamp(21px, 2.2vw, 26px); font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.sectionHead .lead { max-width: 36em; margin: 8px auto 0; }
.sectionHead.isCompact { padding-top: 10px; }
.sectionHead.isCompact h1 { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--mist); }

/* ------------------------------------------------------------- composer */

.desk { width: 100%; max-width: 620px; margin: clamp(22px, 4.6vh, 40px) auto 0; }
.desk.isDocked {
  position: sticky;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 10;
  margin-top: auto;
  padding-top: 18px;
}

/* A pale pane with dark type: inside it the controls are tinted dark. */
.composer {
  --soft: rgba(11, 18, 48, 0.07);
  --soft-hover: rgba(11, 18, 48, 0.13);
  --mist: var(--pane-muted);
  border-radius: 18px;
  background: var(--pane);
  color: var(--pane-ink);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34), 0 30px 80px -24px rgba(96, 176, 255, 0.6), 0 18px 46px -22px rgba(6, 14, 70, 0.55);
  transition: box-shadow 0.25s ease, background-color 0.2s ease;
}
.composer:focus-within {
  background: rgba(236, 243, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 34px 96px -22px rgba(120, 196, 255, 0.82), 0 18px 46px -22px rgba(6, 14, 70, 0.55);
}

.prompt {
  display: block;
  width: 100%;
  min-height: 78px;
  max-height: 40vh;
  padding: 15px 17px 6px;
  border: 0;
  background: none;
  font-size: 16px;
  line-height: 1.5;
  resize: none;
  outline: none;
}
.prompt::placeholder { color: var(--pane-muted); opacity: 1; }
.isDocked .prompt { min-height: 0; padding: 12px 17px 2px; }
.isDocked .shortcut { display: none; }
.composer :focus-visible { outline-color: var(--pane-ink); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 9px 9px; }
.toolbarEnd { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.count { color: var(--mist); font-size: 12px; white-space: nowrap; }
/* The shortcut is told by the button's title; a line of text here would wrap the toolbar. */
.shortcut { display: none; }

.modes, .segmented {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: var(--soft);
}
.mode, .segment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: calc(var(--control) - 4px);
  padding: 0 12px 0 9px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--mist);
  font-size: 13px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.segment { padding: 0 13px; }
.mode:hover { color: var(--pane-ink); }
.segment:hover { color: #fff; }
.mode[aria-checked="true"] { background: #fff; color: var(--pane-ink); font-weight: 600; box-shadow: 0 1px 3px rgba(11, 18, 48, 0.16); }
.segment[aria-pressed="true"] { background: #fff; color: var(--deep); font-weight: 600; }

.modelButton, .option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--control);
  max-width: 100%;
  padding: 0 10px 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--soft);
  font-size: 13px;
  transition: background-color 0.15s ease;
}
.modelButton:hover, .option:hover { background-color: var(--soft-hover); }
.modelCaption { color: var(--mist); font-size: 12px; }
.modelName { max-width: 16ch; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* In the pale pane the model selector is a small white field with a fine edge. */
.composer .modelButton { gap: 7px; padding: 0 8px 0 12px; background: rgba(255, 255, 255, 0.58); box-shadow: inset 0 0 0 1px rgba(11, 18, 48, 0.09), 0 1px 2px rgba(11, 18, 48, 0.06); }
.composer .modelButton:hover { background: rgba(255, 255, 255, 0.82); }
.composer .modelButton .icon { color: var(--pane-muted); }

.options { display: flex; flex-wrap: wrap; gap: 6px; }
.options:empty { display: none; }
.optionWrap { display: inline-flex; align-items: center; gap: 8px; }
.optionLabel { color: var(--mist); font-size: 13px; }
.options .optionLabel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
select.option {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c5cdea' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 8px center / 15px;
  text-overflow: ellipsis;
}
.composer select.option { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2346517a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E"); }
select.option option { background: #0e1228; color: #fff; }
.toggle { display: inline-flex; align-items: center; gap: 7px; min-height: var(--control); padding: 0 10px; font-size: 13px; }
.toggle input { width: 17px; height: 17px; accent-color: var(--pane-ink); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--deep);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
.button:hover:not(:disabled) { background: #e6eeff; }
.button:disabled { background: rgba(255, 255, 255, 0.16); color: var(--mist); cursor: not-allowed; }
.button.isQuiet { background: var(--soft); color: #fff; }
.button.isQuiet:hover:not(:disabled) { background: var(--soft-hover); }

/* The one dark control in the pale pane. */
.generate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: var(--control);
  padding: 0 15px 0 11px;
  border: 0;
  border-radius: 999px;
  background: var(--pane-ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
.generate:hover:not(:disabled) { background: #1a2450; }
.generate:disabled { background: rgba(11, 18, 48, 0.13); color: var(--pane-muted); cursor: not-allowed; }
.generate.isStop { background: var(--soft-hover); color: var(--pane-ink); }

/* The note under the prompt may land on the bright part of the frame, so it
   carries its own pale ground. */
.composerNote {
  width: fit-content;
  max-width: 100%;
  margin: 8px auto 0;
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--pane);
  color: var(--pane-ink);
  font-size: 13px;
  text-align: center;
  text-wrap: pretty;
}
.composerNote.isError { background: #ffe9e4; color: #7a1418; }
.composerNote:empty { display: none; }

.templates { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.chip {
  min-height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: rgba(229, 238, 255, 0.72);
  color: var(--pane-ink);
  font-size: 13px;
  transition: background-color 0.15s ease;
}
.chip:hover { background: #fff; }

/* ------------------------------------------------------------- the tools */

/* Four small square photographs with short names under them: light, quiet,
   nothing drawn over the pictures. Each frame has a fine milky edge and a soft
   shadow. The row stays close to the prompt and clearly narrower than it. */
.tools { margin: clamp(16px, 3.2vh, 28px) auto 0; }
.tools + .desk { margin-top: clamp(14px, 2.6vh, 22px); }
.tools:first-child { margin-top: 12px; }
.toolRow { display: grid; grid-template-columns: repeat(4, 70px); justify-content: center; gap: 10px; }
.toolRow > li { display: flex; justify-content: center; min-width: 0; }
.tool {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 100%;
  border-radius: 16px;
  color: #e3e9fb;
  text-decoration: none;
}
/* The frame. Its pale ground shows only while a photograph loads, or behind
   the icon that stands in when a file is missing. */
.toolIcon {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 15px;
  overflow: hidden;
  background: #f1efea;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.72), 0 10px 22px -12px rgba(2, 8, 40, 0.75);
  color: var(--deep);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
/* The photograph fills the frame, edge to edge. */
.toolPicture { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tool:hover .toolIcon { transform: translateY(-2px); box-shadow: 0 0 0 1px #fff, 0 14px 26px -12px rgba(2, 8, 40, 0.8); }
.toolName { max-width: 100%; font-size: 11px; font-weight: 500; line-height: 1.2; white-space: nowrap; text-shadow: 0 1px 3px rgba(2, 6, 30, 0.7); }
/* The open tool: a clear white ring round its photograph. */
.tool[aria-current="page"] { color: #fff; }
.tool[aria-current="page"] .toolIcon { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(255, 255, 255, 0.26), 0 12px 24px -12px rgba(2, 8, 40, 0.8); }
.tool[aria-current="page"] .toolName { font-weight: 600; }

.stateText { font-size: 13px; }
.stateText.is-running { color: var(--ice); }
.stateText.is-failed { color: var(--bad); }

/* --------------------------------------------------------------- thread */

.thread { max-width: 720px; margin: 16px auto 0; padding-bottom: 28px; }
.threadHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }

.msg { margin-top: 22px; }
.msg.isUser { display: flex; justify-content: flex-end; }
.msg.isUser p {
  max-width: min(86%, 60ch);
  padding: 10px 14px;
  border-radius: 18px 18px 6px 18px;
  background: var(--soft-hover);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.prose { font-size: 16px; line-height: 1.62; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 0.85em; }
.prose h2, .prose h3, .prose h4 { margin-top: 1.4em; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.prose h2 { font-size: 20px; }
.prose h3 { font-size: 18px; }
.prose h4 { font-size: 16px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose li + li { margin-top: 0.3em; }
.prose a { color: var(--ice); text-underline-offset: 3px; }
.prose code { padding: 0.12em 0.36em; border-radius: 6px; background: rgba(255, 255, 255, 0.13); font: 0.88em var(--mono); }
.prose pre { padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); overflow: auto; }
.prose pre code { padding: 0; background: none; font-size: 13px; line-height: 1.55; }
.prose blockquote { margin-left: 0; margin-right: 0; padding-left: 14px; border-left: 2px solid var(--lavender); }
.prose hr { border: 0; border-top: 1px solid var(--line); }
.tableWrap { overflow: auto; }
.prose table { border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-weight: 600; white-space: nowrap; }

.writing { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--mist); font-size: 13px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; transform: scale(0.7); } }

.actions, .cardActions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.modelUsed { margin-left: auto; font-size: 12px; }
.action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: var(--tint);
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
.action:hover { background: var(--tint-hover); }
.action.isDanger { background: rgba(255, 150, 130, 0.22); color: var(--bad); }
.confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.confirmText { color: var(--mist); font-size: 13px; }

.errorBox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(120, 28, 40, 0.42);
  color: var(--bad);
  font-size: 14px;
  text-align: left;
}
.errorBox p { flex: 1 1 240px; }

.mediaCard { margin-top: 4px; }
.mediaPrompt { font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.stage {
  display: grid;
  place-items: center;
  margin-top: 14px;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  background: var(--glass);
  overflow: hidden;
}
.stage.is-image { aspect-ratio: 1 / 1; max-height: 64vh; margin-inline: auto; }
.stage.hasMedia { background: #000; }
.stage.hasMedia.is-image { display: block; width: fit-content; max-width: 100%; aspect-ratio: auto; max-height: none; background: none; }
.stage img, .stage video { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: contain; }
.stage.is-image img { width: auto; max-width: 100%; }
.stageState { width: min(100%, 400px); padding: 20px; text-align: center; }
.stageState .errorBox { margin-top: 0; }
.stateName { font-size: 16px; font-weight: 500; }
.stageState .quiet { margin-top: 8px; }

.progress { height: 3px; margin-top: 14px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--ice), var(--lavender)); transition: width 0.4s ease; }
.progress.isIndeterminate span { width: 38%; animation: slide 1.7s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-110%); } to { transform: translateX(280%); } }

/* -------------------------------------------------------------- library */

.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; margin-top: 24px; }
.newProject { display: inline-flex; gap: 6px; }
.newProject .field { width: 170px; min-height: var(--control); border-radius: 999px; font-size: 13px; }
.storage { max-width: 280px; margin: 18px auto 0; text-align: center; }
.storage .progress { margin-top: 0; }
.storage .quiet { margin-top: 7px; font-size: 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 24px; }
.card { display: flex; flex-direction: column; border-radius: 18px; background: var(--glass); overflow: hidden; }
.thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; background: rgba(255, 255, 255, 0.04); color: var(--mist); text-decoration: none; overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-text { place-items: start; }
.excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 7; line-clamp: 7; padding: 14px; font-size: 12px; line-height: 1.5; overflow: hidden; }
.cardBody { padding: 11px 13px 13px; }
.cardTitle { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cardBody .quiet { margin-top: 3px; font-size: 12px; }
.cardBody .stateText { font-size: 12px; }
.cardActions { margin-top: 10px; }
.cardActions .option { min-height: 32px; max-width: 140px; }

.empty { max-width: 420px; margin: 44px auto 0; text-align: center; }
.empty .button { margin-top: 16px; }
.empty > p + p { margin-top: 8px; }

/* ---------------------------------------------------------------- plans */

/* One black sheet with white type over the moving field, closed from its corner. */
.plansSheet {
  --mist: rgba(255, 255, 255, 0.66);
  --soft: rgba(255, 255, 255, 0.1);
  --soft-hover: rgba(255, 255, 255, 0.18);
  position: relative;
  width: min(100%, 820px);
  margin: 24px auto 0;
  padding: 6px 28px 26px;
  border-radius: 24px;
  background: #000;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 40px 100px -40px rgba(0, 0, 0, 0.9);
}
.plansClose { position: absolute; top: 14px; right: 14px; }
.plansSheet .sectionHead { padding: 26px 40px 0; }
.plans { margin: 24px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.12); border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.plan {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) 0.9fr 1fr 2fr;
  align-items: center;
  gap: 4px 16px;
  padding: 13px 16px;
}
.plan + .plan { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.plan h2 { font-size: 15px; font-weight: 600; }
.planPrice { font-size: 13px; }
.planTopUp { display: block; }
.planTopUp + .planTopUp { margin-top: 3px; }
.planRequest { display: grid; justify-items: center; gap: 8px; margin-top: 14px; text-align: center; }

/* -------------------------------------------------------------- dialogs */

.dialog {
  width: min(420px, calc(100vw - 24px));
  max-height: min(86vh, 700px);
  padding: 18px;
  border: 0;
  border-radius: 22px;
  background: #0e1228;
  color: #fff;
  box-shadow: 0 40px 120px -30px rgba(3, 5, 40, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: auto;
}
.dialog.isWide { width: min(520px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(4, 6, 20, 0.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.dialogHead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dialogHead h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.dialog .lead { font-size: 14px; }
.dialog .lead + .quiet { margin-top: 6px; }
.textLink { display: inline-block; padding: 7px 0; color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.4); text-underline-offset: 3px; }
.textLink:hover { text-decoration-color: currentColor; }
button.textLink { min-height: 32px; padding: 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.dialogActions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.iconButton { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--soft); color: #fff; }
.iconButton:hover { background: var(--soft-hover); }

.fieldLabel { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--mist); }
.field {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--soft);
  outline-offset: 0;
}
.field:focus-visible { border-color: #fff; border-radius: 12px; outline: none; }
.field::placeholder { color: #c3ccf5; opacity: 1; }
.dialog .composerNote { margin: 8px 0 0; text-align: left; }

.rows .row { display: grid; grid-template-columns: 118px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.rows dt { color: var(--mist); }
.rows .isGood { color: var(--good); }
.rows .isWarn { color: var(--warn); }

.search { position: relative; display: block; margin-bottom: 8px; }
.search .icon { position: absolute; top: 12px; left: 12px; color: var(--mist); pointer-events: none; }
.search .field { padding-left: 38px; }
.modelList { display: grid; gap: 2px; max-height: 46vh; margin: 0 -6px; padding: 2px 6px; overflow: auto; }
.modelOption {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1px 10px;
  width: 100%;
  min-height: 48px;
  padding: 7px 11px;
  border: 0;
  border-radius: 12px;
  background: none;
  text-align: left;
}
.modelOption:hover { background: var(--soft); }
.modelOption.isStatic, .modelOption.isStatic:hover { background: var(--soft-hover); }
.modelOption.isStatic .quiet { white-space: normal; }
.modelNote { margin-bottom: 10px; }
.modelOption[aria-checked="true"] { background: var(--soft-hover); }
.modelOptionName { font-size: 14px; font-weight: 500; }
.modelOption .quiet { grid-column: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modelOption .icon { grid-column: 2; grid-row: 1 / span 2; }
.dialog .modelList + .quiet { margin-top: 10px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  color: var(--deep);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.toast.isShown { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- sizes */

/* Fingers get taller targets than pointers do. */
/* --------------------------------------------------------- orange theme */

/* The same frame in warm light: black above, red-orange rising on the left,
   bright orange on the right, an amber pass through the middle and a milky
   glow along the lower edge. Only colours change; the layers keep their
   shapes and movement, and reduced motion still stops them. The switch is the
   dot in the bar (theme.js, app.js). */
:root[data-theme="orange"] {
  --deep: #2b1207;
  --ice: #ffd6ad;
  --lavender: #ffb27a;
  --mist: #ecd8cb;
  --pane: rgba(250, 232, 214, 0.88);
  --pane-ink: #2b1207;
  --pane-muted: #7a4a30;
}
:root[data-theme="orange"] ::selection { background: rgba(255, 170, 100, 0.4); }
:root[data-theme="orange"] .frameLight i:nth-child(1) {
  background: radial-gradient(closest-side, rgba(214, 64, 22, 0.98), rgba(220, 76, 28, 0.56) 50%, rgba(226, 88, 34, 0));
}
:root[data-theme="orange"] .frameLight i:nth-child(2) {
  background: radial-gradient(closest-side, rgba(255, 128, 36, 0.98), rgba(252, 118, 34, 0.56) 50%, rgba(246, 104, 30, 0));
}
:root[data-theme="orange"] .frameLight i:nth-child(3) {
  background: radial-gradient(closest-side, rgba(255, 226, 168, 0.98), rgba(255, 204, 132, 0.86) 30%, rgba(255, 176, 96, 0.5) 54%, rgba(240, 132, 60, 0.16) 78%, rgba(240, 132, 60, 0));
}
:root[data-theme="orange"] .frameLight::before {
  background: radial-gradient(46% 62% at 28% 58%, rgba(255, 196, 120, 0.6), rgba(255, 196, 120, 0) 72%), radial-gradient(44% 60% at 76% 46%, rgba(255, 98, 40, 0.55), rgba(255, 98, 40, 0) 74%);
}
:root[data-theme="orange"] .frameLight i:nth-child(4) {
  background: radial-gradient(closest-side, rgba(255, 251, 246, 0.98), rgba(252, 236, 222, 0.74) 46%, rgba(246, 226, 208, 0));
}
:root[data-theme="orange"] .frameLight::after {
  background: linear-gradient(
    0deg,
    rgba(255, 251, 246, 0.98) 0%,
    rgba(252, 240, 228, 0.84) 18%,
    rgba(250, 234, 218, 0.56) 36%,
    rgba(248, 228, 210, 0.27) 55%,
    rgba(246, 224, 204, 0.08) 72%,
    rgba(246, 226, 208, 0.02) 88%,
    transparent 100%
  );
}
:root[data-theme="orange"] .frame:has(main[data-view]:not([data-view="home"])) .frameLight::after { background: rgba(24, 8, 2, 0.52); }
:root[data-theme="orange"] .core { color: #4a1e08; }
:root[data-theme="orange"] .composer {
  --soft: rgba(43, 18, 7, 0.07);
  --soft-hover: rgba(43, 18, 7, 0.13);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34), 0 30px 80px -24px rgba(255, 140, 60, 0.6), 0 18px 46px -22px rgba(60, 16, 0, 0.55);
}
:root[data-theme="orange"] .composer:focus-within {
  background: rgba(255, 243, 232, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 34px 96px -22px rgba(255, 160, 84, 0.82), 0 18px 46px -22px rgba(60, 16, 0, 0.55);
}
:root[data-theme="orange"] .mode[aria-checked="true"] { box-shadow: 0 1px 3px rgba(43, 18, 7, 0.16); }
:root[data-theme="orange"] .composer .modelButton { box-shadow: inset 0 0 0 1px rgba(43, 18, 7, 0.09), 0 1px 2px rgba(43, 18, 7, 0.06); }
:root[data-theme="orange"] .generate:hover:not(:disabled) { background: #4a1e08; }
:root[data-theme="orange"] .generate:disabled { background: rgba(43, 18, 7, 0.13); }
:root[data-theme="orange"] .chip { background: rgba(255, 240, 228, 0.72); }
:root[data-theme="orange"] .toolIcon { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.72), 0 10px 22px -12px rgba(40, 12, 0, 0.75); }
:root[data-theme="orange"] .tool:hover .toolIcon { box-shadow: 0 0 0 1px #fff, 0 14px 26px -12px rgba(40, 12, 0, 0.8); }
:root[data-theme="orange"] .tool[aria-current="page"] .toolIcon { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(255, 255, 255, 0.26), 0 12px 24px -12px rgba(40, 12, 0, 0.8); }
:root[data-theme="orange"] .toolName { text-shadow: 0 1px 3px rgba(30, 8, 0, 0.7); }
:root[data-theme="orange"] .dialog { background: #17100c; box-shadow: 0 40px 120px -30px rgba(30, 10, 0, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
:root[data-theme="orange"] .dialog::backdrop { background: rgba(20, 8, 2, 0.62); }
:root[data-theme="orange"] select.option option { background: #17100c; }
:root[data-theme="orange"] .field::placeholder { color: #f0d2bf; }

@media (pointer: coarse) {
  :root { --control: 42px; }
  .chip, .action { min-height: 40px; }
  :root { --control-bar: 40px; }
  .iconButton { width: 44px; height: 44px; }
  .modelOption { min-height: 52px; }
  .mode, .segment { min-height: 40px; }
}

@media (max-width: 900px) {
  .plan { grid-template-columns: 1fr auto; }
  .plan h2 { grid-column: 1; }
  .plan .planPrice { grid-column: 2; grid-row: 1; }
  .plan .planDetails { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .bar {
    gap: 8px;
    padding: max(6px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  }
  main { padding: 0 12px max(18px, env(safe-area-inset-bottom)); }
  .hero { --drop: 22px; }
  .plansLink, .languageButton, .accountButton { padding-inline: 9px; }
  .accountButton { max-width: 104px; }
  .plansSheet { margin-top: 18px; padding: 4px 16px 20px; border-radius: 20px; }
  .plansClose { top: 8px; right: 8px; }
  .plansSheet .sectionHead { padding-inline: 36px; }
  .plan { padding-inline: 2px; }
  .shortcut { display: none; }
  .mode span { display: none; }
  .mode { padding: 0 11px; }
  .mode[aria-checked="true"] span { display: inline; }
  .templates { flex-wrap: nowrap; justify-content: flex-start; margin-inline: -12px; padding-inline: 12px; overflow-x: auto; scrollbar-width: none; }
  .templates::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .modelUsed { width: 100%; margin-left: 0; }
  .filters { justify-content: flex-start; }
  .newProject { width: 100%; }
  /* min-width: 0 lets the field give way, so the button beside it stays on screen. */
  .newProject .field { flex: 1; width: auto; min-width: 0; }
  .rows .row { grid-template-columns: 1fr; gap: 2px; }
  /* A tall narrow frame: the lights keep to its lower part, under the prompt. */
  .frameLight i:nth-child(1) { left: -50%; top: 40%; width: 130%; height: 70%; }
  .frameLight i:nth-child(2) { right: -40%; top: 42%; width: 150%; height: 70%; }
  .frameLight i:nth-child(3) { left: -80%; top: 48%; width: 260%; height: 56%; }
  .frameLight::before { inset: 44% -60% -10%; }
  .frameLight i:nth-child(4) { left: -20%; bottom: -30%; width: 140%; height: 56%; }
  .frameLight::after { height: 35%; }
}

/* A phone's bar holds the brand mark and wordmark and the five controls: the
   "ONE" lettering steps aside first. Below 350px the theme switch leaves the
   bar too; it stays in the service status dialog at every width. */
@media (max-width: 420px) {
  .brandOne { display: none; }
}
@media (max-width: 350px) {
  .themeButton { display: none; }
}

@media (max-width: 380px) {
  .hero { --drop: 16px; }
  .plansLink, .languageButton, .accountButton { padding-inline: 7px; }
  .brandOne { display: none; }
  .bar { gap: 6px; padding-inline: max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-right)); }
  .barEnd { gap: 0; padding: 2px; }
  /* Signed in, the account is its icon here; its name stays in the accessible label. */
  .accountButton .icon + span { display: none; }
  .accountButton { max-width: 76px; }
  .generate span { display: none; }
  .generate { padding: 0 12px; }
  .generate.isStop span { display: inline; }
  .toolRow { grid-template-columns: repeat(4, 60px); gap: 4px; }
  .toolIcon { width: 52px; height: 52px; border-radius: 14px; }
  .toolName { font-size: 10px; letter-spacing: -0.01em; }
}

/* Still, the same frame: the lights stay where their animations start. */
@media (prefers-reduced-motion: reduce) {
  /* :nth-child(n) gives this the weight of the rules that start each animation. */
  .frameLight i:nth-child(n), .frameLight::before, .pulse, .progress.isIndeterminate span { animation: none; }
  .progress.isIndeterminate span { width: 100%; opacity: 0.55; }
  * { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media (prefers-contrast: more) {
  :root { --mist: #ffffff; --line: rgba(255, 255, 255, 0.4); --pane: #f1f6ff; --pane-muted: #26305a; }
  :root[data-theme="orange"] { --mist: #ffffff; --pane: #fff6ee; --pane-muted: #5a2a10; }
  .frameLight i:nth-child(n) { opacity: 0.7; }
}

@media (forced-colors: active) {
  .frameLight { display: none; }
  .frame, .composer, .toolIcon, .card, .dialog, .action, .chip, .plansSheet { border: 1px solid CanvasText; }
  .mode[aria-checked="true"], .segment[aria-pressed="true"] { outline: 2px solid Highlight; }
}
