/* Studio app v1: the design system's CSS (P2-DS1, 24 Oct 2026).
   Every value comes from site/assets/site.css (line numbers in system.html) or, for the frames, from the connector
   window (studio/connector/window.html). No new colours, no new fonts. Light only, like the website.
   Engineer D lifts this file into studio/app/ as it is; screens add layout, never new tokens. */

/* ---------- tokens ---------- */
:root {
  /* the website's own tokens, same names and values (site.css 4-35) */
  --ground: #f5f1ea;
  --ground-2: #efe9df;
  --ink: #17120e;
  --red: #e8302c;
  --red-text: #c7261f;
  --text-2: #3f3730;
  --text-3: #4a423a;
  --muted: #5a5148;
  --muted-2: #6b6157;
  --muted-3: #6f665c;
  --cream: #fdfbf7;
  --card: #ffffff;
  --field: #fbf9f5;
  --line: rgba(23, 18, 14, 0.12);
  --line-soft: rgba(23, 18, 14, 0.08);
  --line-strong: rgba(23, 18, 14, 0.2);
  --green: #1f6b45;
  --green-dot: #2f8f5f;
  --green-bg: #e3f3ea;
  --amber: #8a5a12;
  --amber-bg: #fff3dc;
  --shadow-card: 0 40px 90px rgba(60, 40, 20, 0.12);
  --shadow-soft: 0 24px 60px rgba(60, 40, 20, 0.08);
  --f-head: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --f-text: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --f-hi: 'Noto Sans Devanagari', 'Hanken Grotesk', sans-serif;

  /* site colours the website writes inline; named here so screens never retype them */
  --ink-hover: #2c241d;          /* site.css 78  .btn-dark:hover */
  --alert-bg: #fff4ef;           /* site.css 329 .alert */
  --alert-line: rgba(232, 48, 44, 0.25); /* site.css 329 .alert */
  --alert-ink: #7a1d18;          /* site.css 330 .alert-text */
  --bad-ink: #a3261d;            /* site.css 422 .signup-msg.is-bad */
  --now-bg: #fff7e8;             /* site.css 374 .check-list li.is-now */
  --gold: #e3b062;               /* site.css 374 .is-now border, 466 .sw-gold */
  --gold-ink: #b8862f;           /* site.css 375 .is-now spinner */
  --maroon: #7a1f2b;             /* site.css 465 .sw-maroon */
  --media: #1b1612;              /* site.css 272 behind every picture and video */
  --stripe: #e9e2d6;             /* site.css 277 .socket-empty */
  --on-dark-2: #d6cdc1;          /* site.css 186 .wcard-label: second line on ink */
  --on-dark-line: rgba(255, 255, 255, 0.24); /* site.css 386 .pv-wm: lines on ink */
  --field-line: rgba(23, 18, 14, 0.14);      /* site.css 317 textarea border */
  --field-focus: rgba(23, 18, 14, 0.45);     /* site.css 318 textarea focus */
  --chip-line: rgba(23, 18, 14, 0.18);       /* site.css 71 .chip */
  --ring: rgba(232, 48, 44, 0.35);           /* site.css 418 .code input focus ring */

  /* spacing: the steps site.css uses (gap 4/8/12/16/24/32/48) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  /* radii: site.css 208 (10), 84 (14), 383 (16), 272 (18), 91 (22) */
  --r-sm: 10px; --r-md: 14px; --r-frame: 16px; --r-lg: 18px; --r-card: 22px; --r-pill: 999px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--f-text); font-size: 16px; line-height: 1.5; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:lang(hi), .hi { font-family: var(--f-hi); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.dot { color: var(--red); }
.muted { color: var(--muted-2); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- type (sizes as the site uses them) ---------- */
.wm { font-family: var(--f-head); font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
.wm-sub { font-family: var(--f-head); font-weight: 800; letter-spacing: -0.035em; }  /* as the website: the name reads as one (23 Oct) */
.h-screen { margin: 0; font-family: var(--f-head); font-weight: 700; font-size: 48px; line-height: 0.98; letter-spacing: -0.032em; text-wrap: balance; }
.h-card { margin: 0; font-family: var(--f-head); font-weight: 700; font-size: 24px; line-height: 1.15; letter-spacing: -0.02em; }
.h-sub { margin: 0; font-family: var(--f-head); font-weight: 700; font-size: 20px; line-height: 1.2; letter-spacing: -0.015em; }
.price { font-family: var(--f-head); font-weight: 700; font-size: 32px; line-height: 1.1; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.eyebrow { margin: 0; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-3); font-weight: 600; }
.t-body { font-size: 16px; }
.t-small { font-size: 15.5px; color: var(--muted-2); }
.t-tiny { font-size: 14px; color: var(--muted-3); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 18px; border-radius: var(--r-pill); border: 1px solid transparent; font-size: 16px; font-weight: 600; line-height: 1.2; white-space: nowrap; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.btn-dark { background: var(--ink); color: var(--cream); }
.btn-dark:hover { background: var(--ink-hover); }
.btn-line { background: var(--card); border-color: var(--line-strong); color: var(--ink); font-weight: 400; }
.btn-line:hover { border-color: var(--ink); }
.btn-lg { min-height: 52px; padding: 16px 24px; font-size: 17px; }
.btn-block { width: 100%; border-radius: var(--r-md); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.link-btn { background: none; border: 0; padding: 0 0 3px; font-size: 15.5px; color: var(--text-2); cursor: pointer; border-bottom: 1px solid rgba(23, 18, 14, 0.3); text-decoration: none; }
.btn-row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
/* on an ink card */
.card-dark .btn-dark { background: var(--cream); color: var(--ink); }
.card-dark .btn-dark:hover { background: var(--card); }
.card-dark .btn-line { background: transparent; color: var(--cream); border-color: var(--on-dark-line); }
.card-dark .btn-line:hover { border-color: var(--cream); }
.card-dark .link-btn { color: var(--on-dark-2); border-bottom-color: var(--on-dark-line); }

/* chips: format pickers, choices, answers (site.css 71) */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 15px; border-radius: var(--r-pill); border: 1px solid var(--chip-line); background: var(--card); color: var(--text-2); font-size: 15.5px; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.chip.is-locked { color: var(--muted-3); border-style: dashed; }
.chip.is-locked:hover { border-color: var(--chip-line); }
.lock-tag { font-size: 13.5px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--ground-2); color: var(--muted-2); }

/* ---------- status labels: one shape, four meanings (design audit T12), in the connector window's words
   ("Preview · finishing…", "Ready ✓"): nothing a customer sees describes the method (craft private, 15 Oct) ---------- */
.label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.label::before { font-size: 12px; line-height: 1; }
.l-preview { background: var(--amber-bg); color: var(--amber); }
.l-preview::before { content: "◐"; }
.l-finishing { background: var(--now-bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--gold); }
.l-finishing::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(227, 176, 98, 0.35); border-top-color: var(--gold-ink); animation: spin 0.9s linear infinite; }
.l-ready { background: var(--green-bg); color: var(--green); }
.l-ready::before { content: "✓"; }
.l-attention { background: var(--alert-bg); color: var(--alert-ink); box-shadow: inset 0 0 0 1px var(--alert-line); }
.l-attention::before { content: "!"; font-weight: 800; }
/* order states (Ads list, top bar): the same shape */
.l-plain { background: var(--ground-2); color: var(--text-2); }
.l-wait { background: var(--amber-bg); color: var(--amber); }
.l-make { background: var(--now-bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--gold); }
.l-done { background: var(--green-bg); color: var(--green); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-card); padding: var(--s5); box-shadow: var(--shadow-soft); display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.card-flat { box-shadow: none; }
.card-tight { border-radius: var(--r-lg); padding: 18px; gap: var(--s3); box-shadow: none; animation: rise .35s ease both; }
.card-dark { background: var(--ink); color: var(--cream); border-color: var(--ink); box-shadow: none; }
.card-dark .t-small, .card-dark .t-tiny, .card-dark .muted { color: var(--on-dark-2); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }

/* the price card (chat): what, the price, the balance after, the yes */
.price-card .what { font-size: 15.5px; color: var(--on-dark-2); }
.price-card .after { font-size: 15.5px; color: var(--on-dark-2); font-variant-numeric: tabular-nums; }
.price-card .price small { display: block; font-family: var(--f-text); font-size: 13.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-dark-2); margin-bottom: 4px; }
.price-card .short { font-size: 15.5px; color: var(--gold); font-variant-numeric: tabular-nums; }

/* the question card (chat): a question from the order, answers as chips */
.q-card { border-color: var(--line); }
.q-card .q { font-size: 16.5px; font-weight: 600; }
/* the correction card: 0 credits, said before anything runs */
.fix-card { border-color: var(--green-bg); box-shadow: inset 0 3px 0 var(--green-dot); }

/* plain notes (site.css 329-333) */
.alert { border-radius: var(--r-md); background: var(--alert-bg); border: 1px solid var(--alert-line); padding: 12px 14px; color: var(--alert-ink); font-size: 15.5px; display: flex; flex-direction: column; gap: 10px; }
.note-warn { border-radius: var(--r-md); background: var(--amber-bg); color: var(--amber); padding: 10px 14px; font-size: 15.5px; }

/* key and value lines (site.css 337-344, the plan) */
.kv { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.kv li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.kv li:last-child { border-bottom: 0; }
.kv .k { font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-3); padding-top: 3px; }
.kv .v { font-size: 17px; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kv .v .hi { font-size: 20px; font-weight: 700; }
.kv .v small { display: block; font-size: 15px; color: var(--muted-2); margin-top: 2px; }

/* fields */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 14px; color: var(--muted-3); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.input { width: 100%; min-height: 52px; background: var(--field); border: 1px solid var(--field-line); border-radius: var(--r-md); padding: 14px 16px; font-size: 17px; color: var(--ink); outline: none; }
.input:focus { border-color: var(--field-focus); }
textarea.input { resize: vertical; line-height: 1.5; }
.code { display: flex; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.code input { width: 48px; height: 56px; border-radius: var(--r-sm); border: 1px solid var(--field-line); background: var(--field); text-align: center; font-family: var(--f-head); font-size: 22px; font-weight: 700; padding: 0; min-width: 0; }
.code input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--ring); }
.msg-bad { margin: 0; font-size: 15.5px; color: var(--bad-ink); }
.select { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 14px; border-radius: var(--r-md); border: 1px solid var(--chip-line); background: var(--card); font-size: 15.5px; cursor: pointer; }
.select .sw { width: 18px; height: 18px; border-radius: 5px; background: var(--maroon); flex: none; }
.select::after { content: "▾"; color: var(--muted-2); font-size: 13px; }
.addfiles { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 14px 8px 8px; border-radius: var(--r-md); border: 1px dashed var(--line-strong); font-size: 15.5px; color: var(--text-3); background: none; cursor: pointer; }
.addfiles .plus { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--ground); font-size: 18px; }

/* the New ad card: fields full width; brand and files left of the one main step (a grid, so the step can stay on
   screen on a phone while the card scrolls) */
.newad-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; }
.newad-card > * { grid-column: 1 / -1; }
.newad-card > .newad-tools { grid-column: 1; }
.newad-card > .cta-row { grid-column: 2; }

/* ---------- the chat ---------- */
.log { display: flex; flex-direction: column; gap: var(--s3); }
.me { align-self: flex-end; max-width: 86%; background: var(--ink); color: var(--cream); border-radius: 18px 18px 6px 18px; padding: 11px 15px; font-size: 16px; line-height: 1.45; animation: rise .35s ease both; }
.step { display: flex; gap: 10px; align-items: flex-start; font-size: 15.5px; line-height: 1.4; color: var(--text-2); animation: rise .35s ease both; }
.step .ic { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; margin-top: -1px; }
.step.ok .ic { background: var(--green-dot); color: #fff; }
.step.run .ic { border: 2.5px solid rgba(227, 176, 98, 0.35); border-top-color: var(--gold-ink); animation: spin 0.9s linear infinite; }
.step.bad .ic { background: var(--alert-bg); color: var(--alert-ink); box-shadow: inset 0 0 0 1px var(--alert-line); }
.step.plain .ic { background: var(--ground-2); color: var(--muted-2); }
.step b { color: var(--ink); font-weight: 600; }
.step .clock { margin-left: auto; color: var(--muted-3); font-variant-numeric: tabular-nums; font-size: 14px; }
.say { font-size: 16px; line-height: 1.5; animation: rise .35s ease both; }
.day { align-self: center; font-size: 13.5px; color: var(--muted-3); }

/* ---------- frames (the connector window's frame, in the site's look) ---------- */
.frames { display: flex; gap: var(--s5); align-items: flex-start; flex-wrap: wrap; }
.frame { display: flex; flex-direction: column; gap: 10px; width: 380px; max-width: 100%; min-width: 0; }
.frame.is-story { width: 236px; }
.frame-box { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-frame); overflow: hidden; background: var(--media); }
.is-story .frame-box { aspect-ratio: 9 / 16; }
.frame-box.is-empty { background: repeating-linear-gradient(135deg, var(--stripe) 0 10px, var(--ground-2) 10px 20px); display: grid; place-items: center; color: var(--muted-2); font-size: 15px; }
.frame-box.is-drawing::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.24) 50%, transparent 70%); background-size: 220% 100%; animation: shine 1.6s linear infinite; }
.frame-box.is-missing { background: var(--ground-2); border: 1px dashed var(--line-strong); display: grid; place-items: center; text-align: center; color: var(--muted-2); font-size: 15px; padding: 12px; }
.frame-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.frame-name { font-size: 15.5px; font-weight: 600; }
.frame-name small { display: block; font-weight: 400; font-size: 14px; color: var(--muted-3); }
.frame-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.frame-acts .btn { min-height: 40px; padding: 8px 13px; font-size: 15px; }
.wmark { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; overflow: hidden; z-index: 2; }
.wmark span { font-family: var(--f-head); font-size: 22px; font-weight: 800; color: rgba(255, 255, 255, 0.24); transform: rotate(-20deg); white-space: nowrap; }

/* the concept poster, drawn in CSS for the prototype only (the concept brand's colours, site.css 465-466) */
.art { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center; padding: 10% 8% 8%; color: var(--cream);
  background: radial-gradient(55% 40% at 50% 50%, rgba(227, 176, 98, 0.35) 0%, rgba(227, 176, 98, 0) 70%), radial-gradient(120% 90% at 50% 40%, var(--maroon) 0%, var(--media) 100%); }
.art .b { white-space: nowrap; font-family: var(--f-head); font-weight: 700; font-size: 10px; letter-spacing: 0.28em; color: var(--gold); }
.art .sweets { display: flex; gap: 7%; justify-content: center; width: 100%; }
.art .sweets i { width: 17%; aspect-ratio: 1; background: linear-gradient(135deg, var(--cream), var(--gold)); transform: rotate(45deg); border-radius: 3px; }
.art .h { font-family: var(--f-hi); font-weight: 700; font-size: 17px; line-height: 1.35; }
.art .o { white-space: nowrap; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; border-top: 1px solid rgba(227, 176, 98, 0.35); padding-top: 6px; color: var(--gold); }
.art .o.is-wrong { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 3px; }
.is-story .art { padding: 22% 8% 18%; }
.is-story .art .h { font-size: 14px; }

/* ---------- motion (site.css 503-505; shine and fade from the connector window) ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ======================================================================================================
   The app frame: rail (bottom navigation on a phone), top bar, banner, then the screen.
   ====================================================================================================== */
/* --vvh: the visual viewport's height, set by the app from window.visualViewport on phones (P5-DS1), so the frame ends
   at the top of the keyboard; unset, the frame is the window */
.app { display: flex; height: 100vh; height: var(--vvh, 100dvh); overflow: hidden; background: var(--ground); }
.rail { width: 96px; flex: none; background: var(--card); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 8px 18px; }
.rail .wm { font-size: 24px; margin-bottom: 18px; text-decoration: none; color: var(--ink); }
.nav-item { width: 78px; min-height: 62px; border: 0; border-radius: var(--r-md); background: none; color: var(--muted-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 13.5px; text-decoration: none; cursor: pointer; }
.nav-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: var(--ground); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--ink); color: var(--cream); }
.rail-bal { margin-top: auto; text-align: center; font-size: 13.5px; color: var(--muted-2); line-height: 1.3; }
.rail-bal b { display: block; font-family: var(--f-head); font-size: 20px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: var(--s3); min-height: 64px; padding: 10px var(--s5); background: var(--card); border-bottom: 1px solid var(--line-soft); }
.topbar .title { margin: 0; font-size: 17px; font-weight: 600; min-width: 0; display: flex; align-items: center; gap: 10px; }
.topbar .title .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .back { display: none; }
.topbar .grow { flex: 1; }
.tag { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--card); color: var(--text-2); font-size: 14px; white-space: nowrap; text-decoration: none; }
.tag .sw { width: 12px; height: 12px; border-radius: 4px; background: var(--maroon); }
.tag-plan { background: var(--ground); border-color: transparent; color: var(--ink); }
.tag-plan b { font-variant-numeric: tabular-nums; }
.tag-off { background: var(--amber-bg); border-color: transparent; color: var(--amber); }

.banner { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 10px var(--s5); font-size: 15.5px; border-bottom: 1px solid var(--line-soft); }
.banner .btn { margin-left: auto; min-height: 40px; padding: 8px 16px; font-size: 15px; }
.banner.is-warn { background: var(--amber-bg); color: var(--amber); }
.banner.is-bad { background: var(--alert-bg); color: var(--alert-ink); }
.banner.is-ok { background: var(--green-bg); color: var(--green); }

.screen { flex: 1; min-height: 0; overflow: auto; padding: 40px var(--s6) var(--s7); }
.page { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s5); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; }

/* ---------- the order: chat left, work right ---------- */
.switch { display: none; }
.order { flex: 1; min-height: 0; display: flex; }
.chat { width: 400px; flex: none; display: flex; flex-direction: column; min-height: 0; background: var(--field); border-right: 1px solid var(--line-soft); }
.chat .log { flex: 1; min-height: 0; overflow: auto; padding: var(--s5) 20px; }
.composer { display: flex; gap: var(--s2); align-items: flex-end; padding: var(--s3); background: var(--card); border-top: 1px solid var(--line-soft); }
.composer textarea { flex: 1; min-width: 0; height: 48px; max-height: 160px; resize: none; border: 1px solid var(--field-line); border-radius: var(--r-md); background: var(--field); padding: 12px 14px; font-size: 16px; line-height: 1.4; outline: none; }
.composer textarea:focus { border-color: var(--field-focus); }
.send { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--ink); color: var(--cream); display: grid; place-items: center; font-size: 20px; cursor: pointer; }
.send:hover { background: var(--ink-hover); }
.work { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.work-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 12px var(--s5); background: var(--card); border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.work-body { flex: 1; min-height: 0; overflow: auto; padding: 28px var(--s6) var(--s7); }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--ground-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { text-decoration: none; border: 0; background: transparent; border-radius: var(--r-pill); padding: 8px 16px; min-height: 38px; font-size: 15px; color: var(--muted-2); cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-soft); }
.tab .new { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-left: 6px; vertical-align: 2px; }

/* lists (Ads, files, payments) */
.list { display: flex; flex-direction: column; gap: 10px; }
.row-item { display: flex; align-items: center; gap: var(--s4); padding: 14px 16px; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-lg); text-decoration: none; color: inherit; }
a.row-item:hover { border-color: var(--line-strong); }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .t { display: block; font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .m { display: block; font-size: 15px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .cr { font-size: 15px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.thumb { position: relative; width: 48px; height: 60px; flex: none; border-radius: 10px; overflow: hidden; background: var(--media); }
.thumb .art > * { display: none; }
.thumb.t-green { background: radial-gradient(120% 90% at 50% 30%, var(--green) 0%, var(--media) 100%); }
.thumb.t-gold { background: radial-gradient(120% 90% at 50% 30%, var(--gold) 0%, var(--maroon) 100%); }
.thumb.t-empty { background: repeating-linear-gradient(135deg, var(--stripe) 0 6px, var(--ground-2) 6px 12px); }
.badge-sq { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-family: var(--f-head); font-weight: 800; flex: none; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--s4); align-items: start; }
.bar { height: 8px; border-radius: 99px; background: var(--ground-2); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--green-dot); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl th { font-size: 13.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-3); font-weight: 600; white-space: nowrap; }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-lg); }

/* the stand-in for Razorpay's own Checkout (the app draws no payment form of its own) */
.scrim { position: fixed; inset: 0; background: rgba(11, 9, 7, 0.6); display: grid; place-items: center; padding: 16px; z-index: 20; }

/* ---------- phases 3 and 4 (P3-DS1, P4-DS1): Plan and credits, Account, Brands, the staff page. Existing tokens
   only; no new colours ---------- */
.btn-sm { min-height: 40px; padding: 8px 13px; font-size: 15px; }
.link-row { gap: var(--s5); }
/* the extra-credits card when an order sent the customer here: ringed, its Buy dark */
.card.is-picked { box-shadow: inset 0 0 0 2px var(--ink); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted-2) 50%), linear-gradient(135deg, var(--muted-2) 50%, transparent 50%); background-position: right 20px center, right 14px center; background-size: 6px 6px; background-repeat: no-repeat; }
.input[disabled], textarea.input[disabled] { opacity: 0.6; }
.input[aria-invalid="true"] { border-color: var(--bad-ink); }
/* storage: used (green), set aside for approved orders (gold), the plan's limit (the track) */
.bar-split { display: flex; }
.bar-split .aside { background: var(--gold); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--green-dot); }
.legend i.aside { background: var(--gold); }
/* a brand page */
.brand-head { display: flex; align-items: center; gap: var(--s4); min-width: 0; }
.brand-head .h-screen { min-width: 0; overflow-wrap: anywhere; }
.logo-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.logo-tile { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.logo-tile span { aspect-ratio: 16 / 10; border-radius: var(--r-md); display: grid; place-items: center; font-family: var(--f-head); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; text-align: center; padding: 8px; }
.logo-tile.on-light span { background: var(--cream); color: var(--maroon); box-shadow: inset 0 0 0 1px var(--line); }
.logo-tile.on-dark span { background: var(--ink); color: var(--gold); }
.logo-tile figcaption { font-size: 14px; color: var(--muted-3); }
.swatch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); }
.swatch-list li { display: grid; grid-template-columns: 32px auto; column-gap: 10px; align-items: center; font-size: 15.5px; }
.swatch-list small { grid-column: 2; font-size: 13.5px; color: var(--muted-3); font-variant-numeric: tabular-nums; }
.swatch { grid-row: span 2; width: 32px; height: 32px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); }
.facts { display: flex; flex-direction: column; }
.fact-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 15.5px; }
.fact-row:last-child { border-bottom: 0; }
.fact-row .grow { flex: 1 1 160px; min-width: 0; }
.page-tag { font-size: 13.5px; color: var(--muted-2); background: var(--ground-2); border-radius: var(--r-pill); padding: 2px 8px; white-space: nowrap; }
.row-item.is-skipped { border-style: dashed; background: none; }
.row-item.is-skipped .m { color: var(--alert-ink); }
/* the staff page: plain forms in a row, ids under a payment */
.inline-form { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.inline-form .field-label { flex-basis: 100%; }
.inline-form .input { width: auto; flex: 1 1 200px; min-height: 44px; padding: 10px 14px; font-size: 15.5px; }
.inline-form .input-n { flex: 0 1 140px; }
.tbl .ids { display: block; font-size: 13px; color: var(--muted-3); }
.staff .tbl td .btn-row { flex-wrap: nowrap; }
.staff .tbl td:first-child { white-space: nowrap; }
.staff .topbar { flex-wrap: wrap; }
.staff .tbl { min-width: 780px; }
.chip[disabled] { opacity: 0.45; cursor: not-allowed; }
.chip[disabled]:hover { border-color: var(--chip-line); }
/* Account: the GST details left, sign-in and invoices right; one column from the tablet down */
.acct-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "gst signin" "gst inv"; gap: var(--s4); align-items: start; }
.acct-grid .a-signin { grid-area: signin; }
.acct-grid .a-gst { grid-area: gst; }
.acct-grid .a-inv { grid-area: inv; }
@media (max-width: 900px) { .acct-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "signin" "gst" "inv"; } }

/* ======================================================================================================
   Widths: 1440 (desktop), 768 (tablet), 390 and 320 (phones). Breakpoints as the site's: 1180, 900, 760.
   ====================================================================================================== */
@media (max-width: 1180px) {
  .chat { width: 340px; }
  .work-body { padding: var(--s5); }
  .frame { width: 260px; }
  .frame.is-story { width: 164px; }
}
@media (max-width: 900px) {
  .rail { width: 84px; }
  .nav-item { width: 70px; }
  .chat { width: 300px; }
  .topbar .t-brand { display: none; }
  .screen { padding: var(--s6) var(--s5) var(--s7); }
  .h-screen { font-size: 40px; }
  .frame { width: 200px; }
  .frame.is-story { width: 126px; }
  .work-head { padding: 10px var(--s4); }
  .work-body { padding: 20px var(--s4); }
  .frames { gap: var(--s4); }
  .work-head .hide-tablet { display: none; }
  .art .h { font-size: 13px; }
  .is-story .art .h { font-size: 11px; }
  .is-story .art .b, .is-story .art .o { font-size: 7.5px; letter-spacing: 0.04em; }
  .kv li { grid-template-columns: 100px minmax(0, 1fr); gap: 12px; }
}
/* phones: bottom navigation, Chat / Work switch, composer above the keyboard */
@media (max-width: 760px) {
  .app { flex-direction: column-reverse; }
  .rail { width: auto; flex-direction: row; justify-content: space-around; align-items: stretch; gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--line-soft); }
  .rail .wm, .rail-bal { display: none; }
  .nav-item { width: auto; flex: 1; min-height: 56px; border-radius: 12px; font-size: 12.5px; gap: 3px; }
  .nav-item:hover { background: none; }
  .nav-item[aria-current="page"] { background: none; color: var(--ink); font-weight: 600; }
  .nav-item[aria-current="page"] svg { stroke-width: 2.3; }
  .nav-item[aria-current="page"]::after { content: ""; width: 18px; height: 3px; border-radius: 3px; background: var(--red); }
  .main { min-height: 0; flex: 1; }
  .topbar { min-height: 56px; padding: 8px var(--s4); padding-top: calc(8px + env(safe-area-inset-top, 0px)); gap: 10px; }
  .topbar .title { font-size: 16.5px; }
  .topbar .back { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -10px; border: 0; background: none; font-size: 22px; color: var(--ink); text-decoration: none; flex: none; }
  .topbar .t-state { display: none; }
  .tag { min-height: 32px; padding: 4px 10px; font-size: 13.5px; }
  .banner { padding: 10px var(--s4); font-size: 15px; }
  .banner .btn { margin-left: 0; }
  .screen { padding: var(--s5) var(--s4) var(--s6); }
  .h-screen { font-size: 36px; }
  .switch { display: flex; padding: 6px var(--s4); background: var(--card); border-bottom: 1px solid var(--line-soft); }
  .switch .tabs { width: 100%; }
  .switch .tab { flex: 1; min-height: 40px; }
  .order .chat, .order .work { display: none; width: 100%; border-right: 0; }
  .order.v-chat .chat, .order.v-work .work { display: flex; }
  .chat .log { padding: var(--s4); }
  .work-head { padding: 10px var(--s4); }
  .work-body { padding: var(--s4) var(--s4) var(--s5); }
  /* frames swipe one at a time, as in the connector window under 520 px */
  .frames { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin-right: calc(-1 * var(--s4)); padding-right: var(--s4); scrollbar-width: none; }
  .frames::-webkit-scrollbar { display: none; }
  .frame { flex: none; width: 64%; scroll-snap-align: start; }
  .frame.is-story { width: 44%; }
  .art .h { font-size: 15px; }
  .is-story .art .h { font-size: 12px; }
  .kv li { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 0; }
  .card { padding: 18px; border-radius: var(--r-lg); }
  .row-item { padding: 12px; gap: 12px; }
  .row-item .act { display: none; }
  .card-dark .btn-row .btn, .q-card .btn-row .btn, .fix-card .btn-row .btn { flex: 1 1 auto; }
  .hide-phone { display: none !important; }
  /* New ad: the format chips swipe in one row; the main step stays on screen above the navigation */
  .chips.swipe { flex-wrap: nowrap; overflow-x: auto; margin-right: -18px; padding-right: 18px; scrollbar-width: none; }
  .chips.swipe::-webkit-scrollbar { display: none; }
  .chips.swipe .chip { flex: none; }
  .newad-card { grid-template-columns: minmax(0, 1fr); }
  .newad-card > .newad-tools, .newad-card > .cta-row { grid-column: 1; }
  .cta-row { position: sticky; bottom: 0; z-index: 3; background: var(--ground); border-top: 1px solid var(--line); padding: 12px 18px; margin: 0 -18px -18px; border-radius: 0 0 var(--r-lg) var(--r-lg); }
  /* room under the bar, so every field (and a line scrolled into view) can sit clear of it. Chrome keeps a sticky bar
     inside the scroller's padding, so the room is a spacer, not padding: the bar stays flush with the navigation */
  .screen.has-cta { padding-bottom: 0; scroll-padding-bottom: 96px; }
  .screen.has-cta > .page::after { content: ""; display: block; height: 72px; }
  .cta-row .btn { width: 100%; }
  /* Ads rows: the state goes under the name */
  .list-ads .row-item { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 12px; row-gap: 6px; }
  .list-ads .row-item > .thumb { grid-row: span 2; }
  .list-ads .row-item > .label { grid-column: 2; justify-self: start; }
  /* phases 3-4: buttons in a card's head and the staff forms stay at hand */
  .link-row { flex-direction: column; align-items: flex-start; gap: var(--s4); }
  .inline-form .input, .inline-form .input-n { flex: 1 1 100%; }
  .inline-form .btn { width: 100%; }
  /* the keyboard is open: the bottom navigation steps aside so the composer sits right above the keys */
  .app.kb .rail { display: none; }

  /* phase 5 (P5-DS1): every tap target at least 44 by 44 px on a phone */
  .topbar { padding-top: calc(6px + env(safe-area-inset-top, 0px)); padding-bottom: 6px; }
  .topbar .back { width: 44px; height: 44px; margin-left: -12px; }
  a.tag { min-height: 44px; }
  .tab, .switch .tab { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .btn-sm, .frame-acts .btn, .banner .btn { min-height: 44px; }
  .link-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border-bottom: 0; text-decoration: underline; text-decoration-color: rgba(23, 18, 14, 0.3); text-underline-offset: 4px; }
  .card-dark .link-btn { text-decoration-color: var(--on-dark-line); }
  .link-row { gap: 0; }
  /* a link inside a note or an alert drops to its own line, at full height */
  .note-warn a, .alert a { display: flex; align-items: center; width: fit-content; min-height: 44px; margin-bottom: -8px; }
  /* a form's buttons stick to the foot of the screen while the form is on it, as New ad's main step does: the refund
     card, the GST details. Fields scroll clear of the bar */
  .screen { scroll-padding-bottom: 96px; padding-bottom: 0; }
  .screen > .page::after { content: ""; display: block; height: var(--s2); }
  .card > .cta-row { display: flex; gap: var(--s2); flex-wrap: wrap; }
  .card > .cta-row .btn { flex: 1 1 auto; width: auto; }
  /* the staff page stays plain: its tables keep one line a cell and move sideways in their own box */
  .staff .tbl td { white-space: nowrap; }
}
@media (max-width: 360px) {
  .h-screen { font-size: 32px; }
  .code input { width: 100%; flex: 1 1 0; height: 50px; }
  .nav-item { font-size: 11.5px; }
  .frame { width: 60%; }
  .frame.is-story { width: 42%; }
  .art .h { font-size: 13px; }
  .tag-plan .t-plan { display: none; }
  .logo-tile span { font-size: 15px; }
}
@media (min-width: 761px) { .show-phone { display: none !important; } }
