/* teegpt chat (teegpt branch of the teamwear.ai chat) — dark theme after the prototype (D:\teamwearai_prototype):
   the page scrolls, the composer is docked, the preview floats. */
:root {
  --bg: #0b0b0f;
  --surface: #14141b;
  --surface-2: #181822;
  --ink: #ececf2;
  --muted: #8b8ba3;
  --line: #26263a;
  --line-strong: #3d3d58;
  --field: #1c1c26;
  --accent: #FFC107;   /* teegpt amber (teamwear.ai is #00e0a4 green) */
  --accent-dim: #E0A800;
  --accent-ink: #1a1300;
  --user: #1b2b3a;
  --user-line: #243b52;
  --user-ink: #ececf2;
  --danger: #e5484d;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 40px rgba(0,0,0,.45);
  --wrap: 760px;
  /* theme-dependent bits that used to be hard-coded */
  --accent-text: var(--accent);          /* amber as text: fine on dark, too pale on white */
  --top-bg: rgba(11,11,15,.92);
  --fade-from: rgba(11,11,15,0);
  --zoom-bg: rgba(20,20,27,.9);
  --ring: rgba(255,255,255,.15);
  --ring-strong: rgba(255,255,255,.3);
  --chip-dot: #3a3a52;
  --bad-ink: #ff7b7b; --bad-line: #4a2626;
  --error-bg: #3a1416; --error-ink: #ffb4b4; --error-line: #5c2226;
  --mark-bg: #4a3a00; --mark-ink: #ffd966;
  --checker: #2a2a38;
  --stage-bg: #1a1a22;                   /* the 3D view's background (the viewer gets the same) */
  --stage-ink: #8b8ba3;
  color-scheme: dark;
}
/* light: the operating system's choice unless the switch in the header says otherwise
   (html[data-theme], set before first paint by the snippet in each page's head) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f6f8; --surface: #ffffff; --surface-2: #f0f0f4; --ink: #17171f; --muted: #66667c;
    --line: #e2e2ea; --line-strong: #c8c8d6; --field: #ffffff;
    --accent-dim: #d29d00; --accent-text: #8a6100;
    --user: #e6f0fa; --user-line: #c7dbef; --user-ink: #17171f;
    --shadow: 0 1px 2px rgba(0,0,0,.06), 0 12px 40px rgba(0,0,0,.08);
    --top-bg: rgba(246,246,248,.92); --fade-from: rgba(246,246,248,0); --zoom-bg: rgba(255,255,255,.92);
    --ring: rgba(0,0,0,.18); --ring-strong: rgba(0,0,0,.3); --chip-dot: #c8c8d6;
    --bad-ink: #c62828; --bad-line: #f1c4c4;
    --error-bg: #fdecec; --error-ink: #9b1c1c; --error-line: #f3c2c2;
    --mark-bg: #fff1b8; --mark-ink: #6b4e00;
    --checker: #e4e4ea;
    --stage-bg: #f2f2f2; --stage-ink: #666;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f6f8; --surface: #ffffff; --surface-2: #f0f0f4; --ink: #17171f; --muted: #66667c;
  --line: #e2e2ea; --line-strong: #c8c8d6; --field: #ffffff;
  --accent-dim: #d29d00; --accent-text: #8a6100;
  --user: #e6f0fa; --user-line: #c7dbef; --user-ink: #17171f;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 12px 40px rgba(0,0,0,.08);
  --top-bg: rgba(246,246,248,.92); --fade-from: rgba(246,246,248,0); --zoom-bg: rgba(255,255,255,.92);
  --ring: rgba(0,0,0,.18); --ring-strong: rgba(0,0,0,.3); --chip-dot: #c8c8d6;
  --bad-ink: #c62828; --bad-line: #f1c4c4;
  --error-bg: #fdecec; --error-ink: #9b1c1c; --error-line: #f3c2c2;
  --mark-bg: #fff1b8; --mark-ink: #6b4e00;
  --checker: #e4e4ea;
  --stage-bg: #f2f2f2; --stage-ink: #666;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* the hidden attribute must beat the display rules below */
html { scroll-behavior: auto; }   /* the auto-pin needs instant scrolls: a smooth one is still moving when the next chunk lands */
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; }
.muted { color: var(--muted); }

/* ---- header ---- */
.top { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--top-bg); backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; letter-spacing: .2px; }
.brand .ai { color: var(--accent-text); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.top-right { display: flex; gap: 10px; align-items: center; }
.status { font-size: 11px; color: var(--muted); border: 1px solid var(--line); padding: 2px 8px; border-radius: 99px; }
.model { font-size: 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 99px; padding: 4px 10px; max-width: 200px; cursor: pointer; }
.model:focus { outline: none; border-color: var(--accent-dim); }
.status.bad { color: var(--bad-ink); border-color: var(--bad-line); }

/* ---- the thread (document flow; bottom padding is set from the dock's height) ---- */
.thread { display: flex; flex-direction: column; gap: 14px; padding: 20px 16px 160px; }
.entries { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.entries .btn { font-size: 13px; padding: 7px 14px; color: var(--muted); }
.entries .btn:hover { color: var(--accent-text); }

.msg { max-width: 82%; display: flex; flex-direction: column; gap: 8px; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.assistant { align-self: flex-start; }
.bubble { padding: 10px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; }
.msg.assistant .bubble { border-bottom-left-radius: 5px; }
.msg.user .bubble { background: var(--user); border-color: var(--user-line); color: var(--user-ink); border-bottom-right-radius: 5px; }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin: 0; }
.bubble ul { margin: 4px 0; padding-left: 18px; }
.bubble a { color: var(--accent-text); }
/* the typewriter's caret: on the last line of whatever is being typed */
.bubble.typing-out > p:last-child::after, .bubble.typing-out > ul:last-child > li:last-child::after, .bubble.typing-out:empty::after { content: '▍'; color: var(--accent-text); margin-left: 1px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.thinking { font-size: 12px; color: var(--muted); display: none; }   /* the model's reasoning is noise for a customer; add ?debug=1 to the page to see it */
body.debug .thinking { display: block; }
.thinking summary { cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chip-dot); box-shadow: none; }
.chip.running .dot { background: var(--accent); box-shadow: 0 0 6px var(--accent); animation: pulse 1s infinite; }
.chip.ok .dot { background: var(--accent-dim); }
.chip.err .dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: .3; } }

/* ---- cards ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.card h4 { margin: 0 0 8px; font-size: 14px; color: var(--accent-text); }
.design-previews { display: flex; gap: 8px; }
.design-previews img { width: 100%; max-width: 260px; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.swatch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.swatch i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--ring); display: inline-block; }
.slots { margin-top: 8px; display: grid; gap: 6px; }
.slots label { font-size: 12px; color: var(--muted); display: grid; gap: 2px; }
.slots input { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--field); color: var(--ink); }

.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.option { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px; cursor: pointer; text-align: left; color: var(--ink); }
.option:hover { border-color: var(--accent); }
.option img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 10px; }
.option .name { font-weight: 600; font-size: 13px; margin-top: 6px; }
.option .sub { font-size: 12px; color: var(--muted); }

table.price { width: 100%; border-collapse: collapse; font-size: 14px; }
table.price td { padding: 4px 0; border-bottom: 1px solid var(--line); }
table.price tr:last-child td { border: 0; font-weight: 700; }
table.price td:last-child { text-align: right; }

/* ---- buttons ---- */
.btn { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.btn:hover { border-color: var(--accent); color: var(--accent-text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: var(--accent-ink); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.icon { width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }
.btn.link { display: inline-block; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---- the dock: replies + composer, fixed to the bottom ---- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; background: linear-gradient(to bottom, var(--fade-from), var(--bg) 22px); padding: 22px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
.replies { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 10px; }
.replies .btn { font-size: 13px; padding: 7px 12px; }
/* the composer: one rounded box, the text on top, tools left and send right underneath (as claude.ai) */
.composer { background: var(--field); border: 1px solid var(--line-strong); border-radius: 22px; padding: 12px 12px 10px 16px; box-shadow: 0 4px 24px rgba(0,0,0,.35); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--accent-dim); box-shadow: 0 4px 24px rgba(0,0,0,.35), 0 0 0 1px var(--accent-dim); }
.composer textarea { display: block; width: 100%; box-sizing: border-box; resize: none; padding: 4px 2px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.5; min-height: 28px; max-height: 200px; outline: none; }
.composer textarea::placeholder { color: var(--muted); }
.composer .bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.composer .tools { display: flex; gap: 4px; margin-left: -6px; }
.composer .btn.icon { width: 34px; height: 34px; font-size: 18px; border-color: transparent; color: var(--muted); }
.composer .btn.icon:hover { border-color: var(--line-strong); color: var(--ink); }
.composer .btn.send { width: 34px; height: 34px; padding: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.attachments { display: flex; gap: 8px; padding-bottom: 8px; }

/* ---- landing: a new conversation, everything centred (body.landing until the first message) ---- */
.landing-head { display: none; }
body.landing .landing-head { display: block; text-align: center; margin-bottom: 26px; }
.landing-head h1 { display: inline-flex; align-items: center; gap: 14px; margin: 0; font-size: clamp(26px, 4.2vw, 38px); font-weight: 500; letter-spacing: -.02em; }
.dot.big { width: 16px; height: 16px; box-shadow: 0 0 16px var(--accent); flex: none; }
body:not(.landing) .entries { display: none; }
body.landing .dock { top: 64px; bottom: 0; display: flex; flex-direction: column; justify-content: center; padding-top: 0; padding-bottom: 12vh; background: var(--bg); }
body.landing .dock > .wrap { max-width: 720px; }
body.landing .composer textarea { min-height: 56px; }
body.landing .legal { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
body.landing #messages { display: none; }
.dock, .dock > .wrap { transition: padding .25s ease; }
.attachments img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
/* a picture waiting in the composer: × takes it off before sending; dimmed while it uploads */
.attachments .att { position: relative; }
.attachments .att img { width: 56px; height: 56px; display: block; }
.attachments .att.uploading img { opacity: .45; }
.attachments .att .x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 13px; line-height: 1; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.composer.dropping { border-color: var(--accent); box-shadow: 0 4px 24px rgba(0,0,0,.35), 0 0 0 2px var(--accent); }

/* ---- colour picker (public/colourPicker.js) ---- */
.cp-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cp-sheet { width: min(720px, 100%); max-height: min(88vh, 820px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cp-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cp-head strong { color: var(--accent-text); }
.cp-slots { display: flex; gap: 8px; padding: 10px 14px 0; flex-wrap: wrap; }
.cp-slot { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--field); color: var(--ink); cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
.cp-slot.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cp-slot.cp-add { border-style: dashed; color: var(--muted); }
.cp-slot i.cp-none { display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700; color: var(--muted); }
.cp-slot span { display: flex; flex-direction: column; line-height: 1.25; }
.cp-slot i, .cp-chip i, .cp-current i, .cp-fam i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--ring-strong); flex: none; display: inline-block; }
.cp-slot i.cp-none { background: repeating-linear-gradient(45deg, transparent 0 4px, var(--ring) 4px 8px); }
.cp-slot em { font-style: normal; color: var(--muted); padding-left: 4px; }
.cp-tabs { display: flex; gap: 4px; padding: 10px 14px 0; }
.cp-tabs button { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); cursor: pointer; }
.cp-tabs button.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.cp-body { flex: 1; overflow: auto; padding: 10px 14px; min-height: 280px; }
.cp-search { width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--field); color: var(--ink); outline: none; }
.cp-search:focus { border-color: var(--accent-dim); }
.cp-fams { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.cp-fam { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 11.5px; padding: 3px 9px 3px 4px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.cp-fam i { width: 14px; height: 14px; }
.cp-fam.on { color: var(--ink); border-color: var(--accent-dim); }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 3px; }
.cp-sw { aspect-ratio: 1; border: 0; border-radius: 4px; cursor: pointer; padding: 0; outline: 1px solid var(--ring); }
.cp-sw:hover { transform: scale(1.25); position: relative; z-index: 1; outline-color: var(--ring-strong); }
.cp-sw.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.cp-loading { grid-column: 1 / -1; padding: 20px 0; text-align: center; }
.cp-sources { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cp-src { width: 44px; height: 44px; padding: 2px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; }
.cp-src.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cp-src img { width: 100%; height: 100%; object-fit: contain; }
.cp-dominant { margin-top: 10px; }
.cp-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-chip { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--field); color: var(--ink); cursor: pointer; }
.cp-chip:hover { border-color: var(--accent-dim); }
.cp-canvas-wrap { margin-top: 10px; max-height: 360px; overflow: auto; border-radius: 10px; border: 1px solid var(--line); background: repeating-conic-gradient(var(--checker) 0 25%, #22222a 0 50%) 0 0 / 16px 16px; }
.cp-canvas { display: block; cursor: crosshair; }
.cp-zoom { display: flex; gap: 4px; align-items: center; margin-top: 6px; font-size: 12px; }
.cp-zoom .muted { margin-left: 6px; }
.cp-sample { margin-top: 6px; font-size: 12.5px; }
.cp-sample .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -2px; border: 1px solid var(--ring-strong); }
.cp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }
.cp-current { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
/* the head, slots, tabs and foot keep their size; only the body scrolls */
.cp-head, .cp-slots, .cp-tabs, .cp-foot { flex: none; }
.cp-slots { align-items: flex-start; }
.cp-body { min-height: 0; }
.cp-slot { flex: none; height: auto; }
.cp-slot i, .cp-chip i, .cp-current i { align-self: center; height: 22px; width: 22px; }
.cp-canvas-wrap { max-height: 300px; }
@media (max-width: 600px) { .cp-overlay { padding: 0; } .cp-sheet { max-height: 100vh; height: 100%; border-radius: 0; } }
.panel-colours .swatch { background: none; border: 0; cursor: pointer; color: var(--ink); font-size: 12px; }

/* ---- the design stage: the shirt in live 3D, all the time ----
   Desktop: a column on the left, under the header, the chat beside it (the body is
   padded by the stage's width, so everything centred in the chat stays centred in
   what is left; the header spans the whole page). Narrow screens: a strip under the
   header and the chat below it. A blank white tee until there is a design. */
:root { --stage-w: clamp(340px, 46vw, 860px); --stage-h: 38dvh; }
.panel { position: fixed; z-index: 7; top: var(--header-h, 57px); left: 0; bottom: 0; width: var(--stage-w); display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); overflow: hidden; }
.panel-3d { position: relative; flex: 1 1 auto; min-height: 0; background: var(--stage-bg); overflow: hidden; }
.panel-3d iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; transition: opacity .35s ease; }
.panel-3d iframe.pending { opacity: 0; pointer-events: none; }   /* the next design, drawing behind the shown one */
.panel-3d-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--stage-ink); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; pointer-events: none; }
.panel-3d-status[hidden] { display: none; }
/* no 3D in this browser or for this design: the rendered front / back pictures instead */
.panel-3d-flat { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
.panel-3d-flat[hidden] { display: none; }
.panel-3d-flat img { max-width: 100%; max-height: 100%; object-fit: contain; transition: opacity .2s ease; }
.panel-3d-flat.loading img { opacity: .45; }
.panel-3d.flat iframe { visibility: hidden; }
.panel-3d .panel-3d-zoom { z-index: 2; }
.panel-3d:hover .panel-3d-zoom, .panel-3d .panel-3d-zoom:focus { opacity: 1; }
.panel-3d-zoom[hidden] { display: none; }
/* the 3D view at lightbox size: the same iframe grown in place (moving it would reload the viewer) */
.panel-3d.expanded { position: fixed; inset: 24px; z-index: 100; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.panel-3d.expanded::before { content: ''; position: fixed; inset: 0; background: rgba(5,5,8,.9); z-index: -1; cursor: zoom-out; }
.panel-3d-bar { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 2; }
.panel-3d-bar[hidden] { display: none; }
.panel-3d-bar .btn { background: var(--surface); }
body.preview-full .panel { z-index: 110; }
/* the bar under the shirt: name + Front / Back, then the colours and the studio link */
.panel-body { flex: 0 0 auto; padding: 10px 14px 12px; border-top: 1px solid var(--line); max-height: 34%; overflow: auto; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stage-label { font-size: 14px; color: var(--accent-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.stage-head .chips { flex: none; display: flex; gap: 6px; }

@media (min-width: 861px) {
  body.has-stage { padding-left: var(--stage-w); }
  body.has-stage .top { margin-left: calc(-1 * var(--stage-w)); }   /* the header still spans the page */
  body.has-stage .dock, body.has-stage.landing .legal { left: var(--stage-w); }
}
@media (max-width: 860px) {
  .panel { right: 0; bottom: auto; width: auto; height: var(--stage-h); border-right: 0; border-bottom: 1px solid var(--line); border-radius: 0 0 16px 16px; }
  .panel-body { padding: 6px 12px 8px; max-height: none; }
  .panel-colours, .panel-studio { display: none; }               /* the strip keeps just the shirt, its name and Front / Back */
  body.has-stage .thread { padding-top: calc(var(--stage-h) + 12px); }
  body.has-stage.landing .dock { top: calc(var(--header-h, 52px) + var(--stage-h)); padding-bottom: 4vh; }
  .panel-3d .panel-3d-zoom { opacity: 1; }                       /* no hover on touch: always show ⤢ */
}
@media (max-width: 600px) { .panel-3d.expanded { inset: 8px; } }

.roster { display: grid; gap: 6px; margin-top: 8px; }
.roster .r { display: grid; grid-template-columns: 1fr 70px 80px auto; gap: 6px; }
.roster input, .roster select { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--field); color: var(--ink); }
.error { background: var(--error-bg); color: var(--error-ink); border: 1px solid var(--error-line); padding: 10px 14px; border-radius: 12px; }

@media (max-width: 860px) {
  .thread { padding-left: 12px; padding-right: 12px; }
  .msg { max-width: 92%; }
}

.candidates .option img { aspect-ratio: 1; }
.swatches.big .swatch { font-size: 13px; color: var(--ink); }
.swatches.big .swatch i { width: 26px; height: 26px; }
.image-check img { width: 120px; height: 120px; object-fit: contain; background: #fff; border-radius: 8px; }
.crest img { width: 160px; height: 160px; object-fit: contain; background: #fff; border-radius: 10px; }
.tryon img { display: block; width: 100%; max-width: 420px; border-radius: 12px; border: 1px solid var(--line); }
.crest .variants { display: flex; flex-wrap: wrap; gap: 12px; }
.crest .variant { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.crest .variant img { display: block; margin: 0 auto 4px; }
.crest .variant.flawed img { outline: 2px dashed var(--danger); outline-offset: 2px; }
.crest .variant figcaption { font-weight: 600; }

/* ---- images open full size in a lightbox; every rendered image gets a zoom control ---- */
.zoomwrap { position: relative; display: inline-block; max-width: 100%; }
.zoomwrap > img { display: block; cursor: zoom-in; }
.zoom { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 999px; background: var(--zoom-bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; color: var(--ink); cursor: zoom-in; opacity: 0; transition: opacity .15s; user-select: none; }
.zoomwrap:hover .zoom, .zoom:focus { opacity: 1; }
@media (hover: none) { .zoom { opacity: 1; } }
.option .zoomwrap { display: block; }
.option .zoomwrap > img { width: 100%; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5,5,8,.9); display: flex; align-items: center; justify-content: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(96vw, 1400px); max-height: 92vh; object-fit: contain; background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.6); cursor: zoom-out; }
.lightbox .lb-close { position: absolute; top: 14px; right: 16px; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }

/* ---- sign-in page ---- */
.login { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 60px); padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 14px; }
.login-card h1 { margin: 0; font-size: 22px; font-weight: 600; }
.login-card p { margin: -6px 0 4px; }
.login-card label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.login-card input { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--field); color: var(--ink); font-size: 15px; }
.login-card input:focus { outline: none; border-color: var(--accent-dim); }
.login-card .btn.primary { height: 44px; border-radius: 12px; }

/* ---- legal links: a quiet line under the composer and on every standalone page ---- */
.legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; padding-top: 8px; font-size: 11px; color: var(--muted); opacity: .75; }
.legal a { color: inherit; text-decoration: none; }
.legal a:hover, .legal a:focus-visible { color: var(--ink); text-decoration: underline; }
.login-page .legal { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }

/* ---- standalone pages: about, terms, privacy ---- */
.top a.brand { color: inherit; text-decoration: none; }
.doc { padding: 32px 16px 24px; line-height: 1.65; }
.doc h1 { font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 4px; }
.doc h2 { font-size: 17px; font-weight: 600; margin: 32px 0 8px; }
.doc p, .doc ul { margin: 0 0 12px; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 4px; }
.doc a { color: var(--accent-text); }
.doc .updated { font-size: 13px; margin-bottom: 24px; }
.doc .lead { font-size: 18px; color: var(--ink); }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 16px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
.doc th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.doc code { font-size: 13px; background: var(--field); padding: 1px 6px; border-radius: 6px; }
.doc-foot { border-top: 1px solid var(--line); padding: 8px 16px 24px; }
/* details still to be filled in before launch: impossible to miss */
mark.fill { background: var(--mark-bg); color: var(--mark-ink); padding: 0 4px; border-radius: 4px; }
@media (max-width: 600px) { .doc table, .doc thead, .doc tbody, .doc tr, .doc th, .doc td { display: block; } .doc thead { display: none; } .doc tr { padding: 8px 0; border-bottom: 1px solid var(--line); } .doc td { border: 0; padding: 2px 0; } }

/* narrow screens: the header keeps the brand, the model and New chat; the service badge goes */
@media (max-width: 600px) {
  .top { padding: 10px 12px; }
  .status { display: none; }
  .model { max-width: 130px; }
  body:not(.account-page) #signOut { display: none; }
}


/* sign-in cards in the thread (a guest is asked at the moments that matter) and the provider buttons */
.sso { display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid #dadce0; background: #fff; color: #1f1f1f; font: 500 14px/1 "Segoe UI", Roboto, -apple-system, Helvetica, Arial, sans-serif; text-decoration: none; cursor: pointer; }
.sso:hover { background: #f4f4f4; }
.sso.apple { font-family: -apple-system, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 600; }
.signin-card { position: relative; border-color: var(--accent-dim); }
.signin-card .lead { margin: 0 28px 12px 0; }
.signin-card .sso-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* a plan limit in the conversation: one quiet line and a link to /plans, never the plans themselves */
.plan-note { margin: 6px 0 0; font-size: 13.5px; }
.plan-note a { color: var(--accent-text); text-decoration: none; font-weight: 500; white-space: nowrap; }
.plan-note a:hover { text-decoration: underline; }
.upgrade-card .plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.upgrade-card .plan { border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; }
.upgrade-card .plan strong { display: block; font-weight: 600; }
.upgrade-card .plan .price { color: var(--accent-text); font-size: 13.5px; }
.upgrade-card .plan ul { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.upgrade-card .soon { margin: 10px 0 0; font-size: 12.5px; }
.upgrade-card .plan .choose { margin-top: 10px; width: 100%; }
.account-card { position: relative; }
.account-card h4 { margin: 0 0 4px; }
.account-card h5 { margin: 14px 0 4px; font-size: 13.5px; }
.account-card .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.account-card .sums { font-size: 13.5px; }
.account-card .x { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; }
.signin-card .x { position: absolute; top: 8px; right: 10px; border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }

/* a painting on its way: a shimmering tee where the picture will land, with rotating tips */
.painting-card { display: flex; align-items: center; gap: 18px; }
.painting-card .canvas { position: relative; flex: none; width: 120px; height: 120px; border-radius: 12px; background: var(--field); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.painting-card .tee { width: 86px; height: 86px; fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 2; }
.painting-card .canvas::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 193, 7, .16) 50%, transparent 70%); transform: translateX(-100%); animation: paint-shimmer 1.8s ease-in-out infinite; }
@keyframes paint-shimmer { to { transform: translateX(100%); } }
.painting-card .words { min-width: 0; }
.painting-card strong { display: block; font-weight: 600; margin-bottom: 6px; }
.painting-card .tip { margin: 0; min-height: 2.6em; color: var(--muted); font-size: 13.5px; line-height: 1.45; opacity: 0; transition: opacity .25s ease; }
.painting-card .tip.show { opacity: 1; }
@media (max-width: 600px) { .painting-card .canvas { width: 84px; height: 84px; } .painting-card .tee { width: 60px; height: 60px; } }
@media (prefers-reduced-motion: reduce) { .painting-card .canvas::after { animation: none; display: none; } .painting-card .tip { transition: none; } }

/* ---- My account (account.html / account.js) ---- */
.acct { padding: 18px 16px 60px; max-width: 900px; }
.acct h1 { font-size: 24px; margin: 6px 0 14px; }
.acct .card { margin-bottom: 14px; }
.acct .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acct-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.acct-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 8px 12px; cursor: pointer; font-size: 15px; }
.acct-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.acct-flash { background: var(--surface-2); border: 1px solid var(--accent-dim); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.acct-flash.bad { border-color: var(--danger); }
.acct-who .avatar { width: 44px; height: 44px; border-radius: 50%; margin-right: 6px; }
.acct .plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 10px 0; }
.acct .plan { border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; }
.acct .plan.current { border-color: var(--accent); }
.acct .plan strong { font-weight: 600; }
.acct .plan .price { color: var(--accent-text); font-size: 13.5px; }
.acct .plan ul { margin: 8px 0 10px; padding-left: 18px; font-size: 13.5px; color: var(--muted); line-height: 1.5; flex: 1; }
.acct .plan .choose { width: 100%; }
.acct .pending { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.acct .pending p { margin: 0 0 8px; font-size: 14px; }
.acct .title-edit { background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--ink); font-size: 17px; font-weight: 600; padding: 3px 6px; margin-left: -6px; min-width: 0; flex: 1; }
.acct .title-edit.small { font-size: 14.5px; font-weight: 500; width: 100%; }
/* the line shoppers read under a design (Designs tab), edited in place like its name */
.acct .desc-edit { display: block; width: 100%; box-sizing: border-box; resize: none; background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--muted); font: inherit; font-size: 13px; line-height: 1.4; padding: 3px 6px; margin: 2px 0 4px -6px; }
.acct .desc-edit:hover, .acct .desc-edit:focus { border-color: var(--line-strong); outline: none; background: var(--field); color: var(--ink); }
.acct .desc-edit::placeholder { color: var(--muted); opacity: .7; }
.acct .tags-edit { margin: 2px 0 6px; --ti-bg: var(--surface, var(--bg, #fff)); --ti-fg: var(--ink, #222); color: var(--ink); }
.acct .tags-edit .tag-input { border-color: var(--line-strong, rgba(128,128,128,.45)); }
.acct .title-edit:hover, .acct .title-edit:focus { border-color: var(--line-strong); outline: none; background: var(--field); }
.acct .shop-head { display: flex; gap: 10px; align-items: center; }
.acct .shop.closed .shop-head .title-edit { color: var(--muted); }
.acct .shop-stats { font-size: 13.5px; margin: 4px 0 8px; }
.acct .shop-links { margin-bottom: 10px; }
.acct .shop-foot { justify-content: flex-end; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }   /* Delete shop, last in the card */
.acct .shop-delete { margin-top: 10px; }
.acct .switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.acct .switch input { accent-color: var(--accent); }
.acct .tag { font-size: 12px; color: var(--muted); }
.acct .items { display: flex; flex-direction: column; gap: 8px; }
.acct .item { display: flex; gap: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.acct .item img { width: 84px; height: 84px; object-fit: contain; background: var(--surface-2); border-radius: 10px; flex: none; }
.acct .item .body { flex: 1; min-width: 0; }
.acct .item .move { display: flex; flex-direction: column; gap: 4px; flex: none; }   /* ↑ / ↓: the order the shop shows its items in */
.acct .item .move .btn { padding: 2px 10px; min-width: 0; line-height: 1.4; }
.acct .item .move .btn:disabled { opacity: .3; }
.acct .item .meta { font-size: 12.5px; margin: 2px 0 6px; }
.acct .design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.acct .card.design.inactive .flip-card-inner { opacity: .45; filter: grayscale(.6); }
.acct .card.design.inactive .flip-card { position: relative; }
.acct .card.design.inactive .flip-card::after { content: "Private"; position: absolute; top: 8px; left: 8px; z-index: 2; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--text, #222); color: var(--bg, #fff); }
.acct .design { display: flex; flex-direction: column; margin: 0; }
.acct .design .flip-card { margin-bottom: 8px; }   /* the picture flips to the back like the Observer (flip rules below) */
.acct .design .meta { font-size: 12.5px; margin: 2px 0 8px; }
.acct .design .controls { margin-bottom: 8px; }
.acct .design .add-shop { align-self: flex-start; max-width: 100%; margin: 0 0 8px; }   /* Add to shop… (one of their shops) */
/* Shops › Add shop: a name and the button */
.acct .add-shop-form { margin: 4px 0 14px; }
.acct .add-shop-form input { flex: 1; min-width: 0; max-width: 320px; box-sizing: border-box; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--field, var(--surface)); color: var(--ink); font: inherit; font-size: 14px; }
.acct .add-shop-form input:focus { outline: none; border-color: var(--accent-dim, var(--line-strong)); }
.acct .sums { display: flex; flex-wrap: wrap; gap: 18px; }
.acct .sum { display: flex; flex-direction: column; }
.acct .sum strong { font-size: 22px; }
.acct .sums .hold { flex-basis: 100%; margin: 0; font-size: 13px; }
.acct .sales { width: 100%; border-collapse: collapse; font-size: 14px; }
.acct .sales td { padding: 6px 4px; border-top: 1px solid var(--line); }
.acct .sales td.a { text-align: right; white-space: nowrap; }
.acct .empty { color: var(--muted); }
@media (max-width: 560px) { .acct .item img { width: 64px; height: 64px; } .acct .sales td.k { display: none; } }

/* find_existing_designs: what already exists, before a new design is painted */
.card.existing { width: 100%; box-sizing: border-box; }
.msg.assistant:has(> .card.existing) { width: 82%; }   /* the message shrinks to its content otherwise */
.card.existing .existing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
@media (max-width: 600px) { .card.existing .existing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.existing-item { border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
:is(.existing-item, .acct .design) .flip-card { position: relative; width: 100%; aspect-ratio: 1; perspective: 900px; }
:is(.existing-item, .acct .design) .flip-card-inner { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.4, 0, .2, 1); transform-style: preserve-3d; }
:is(.existing-item, .acct .design) .flip-card:not(.no-back):hover .flip-card-inner, :is(.existing-item, .acct .design) .flip-card.flipped .flip-card-inner { transform: rotateY(180deg); }
:is(.existing-item, .acct .design) .flip-card-front, :is(.existing-item, .acct .design) .flip-card-back { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
:is(.existing-item, .acct .design) .flip-card-back { transform: rotateY(180deg); }
:is(.existing-item, .acct .design) .flip-card img { width: 100%; height: 100%; object-fit: contain; display: block; }
:is(.existing-item, .acct .design) .flip-toggle { position: absolute; right: 6px; bottom: 6px; z-index: 2; width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
@media (hover: none) { :is(.existing-item, .acct .design) .flip-card:hover .flip-card-inner { transform: none; } :is(.existing-item, .acct .design) .flip-card.flipped .flip-card-inner { transform: rotateY(180deg); } }
.existing-item .t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.existing-item .s { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.existing-item .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

/* the theme switch in the header (System → Light → Dark), sized like the small buttons beside it */
.top .btn.icon.theme-btn { width: 32px; height: 32px; color: var(--muted); }
.top .btn.icon.theme-btn:hover { color: var(--ink); }

/* the start screen's few lines on what teegpt is and how to buy (gone after the first message) */
.intro { max-width: 600px; margin: 22px auto 0; font-size: 13.5px; line-height: 1.6; color: var(--muted); text-align: center; }
body:not(.landing) .intro { display: none; }
@media (max-width: 600px) { .intro { font-size: 13px; margin-top: 16px; padding: 0 4px; } }
/* phones: under the shirt strip the start screen is taller than the room left, so it starts at
   the top of that room and scrolls, and the legal links follow the intro instead of covering it */
@media (max-width: 860px) {
  body.has-stage.landing .dock { justify-content: flex-start; padding-top: 18px; padding-bottom: 16px; overflow-y: auto; }
  body.has-stage.landing .legal { position: static; padding: 14px 0 0; }
}

/* ==== the studio chat's look (2026-10-12): teegpt.shop's chat is the studio's CHAT mode now, so these pages
   wear the same sky, the same translucent bubbles and the same dark pills (public/css/default/dt.css,
   body.dt-chat-mode). Only colours and surfaces change here; the layout above stays. The theme is these
   pages' own (localStorage 'tw_theme', light unless dark was chosen; theme.js), never the chat's. ==== */
:root:not([data-theme="dark"]) {
  --bg: #e9eef4;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-2: rgba(255, 255, 255, 0.5);
  --ink: #1d2733; --muted: rgba(29, 39, 51, 0.6);
  --line: rgba(29, 39, 51, 0.1); --line-strong: rgba(29, 39, 51, 0.18);
  --field: rgba(255, 255, 255, 0.72);
  --accent: #1c1f24; --accent-dim: #3a3f47; --accent-ink: #ffffff; --accent-text: #1d2733;
  --user: rgba(255, 255, 255, 0.45); --user-line: rgba(255, 255, 255, 0.6); --user-ink: #1d2733;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 40, 70, 0.06), 0 6px 24px rgba(20, 40, 70, 0.07);
  --top-bg: transparent;
  --ring: rgba(0, 0, 0, .18); --ring-strong: rgba(0, 0, 0, .3); --chip-dot: rgba(29, 39, 51, 0.25);
  --bad-ink: #b42318; --bad-line: rgba(180, 35, 24, .35);
  --error-bg: rgba(253, 236, 236, .85); --error-ink: #9b1c1c; --error-line: #f3c2c2;
  --mark-bg: #fff1b8; --mark-ink: #6b4e00;
  --danger: #c62828;
  --sky:
    radial-gradient(120% 80% at 18% 108%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(90% 70% at 80% 20%, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 60%),
    radial-gradient(70% 60% at 30% 25%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #5f8fc4 0%, #8fb2d8 38%, #c6d6e8 72%, #e9eef4 100%);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1b2b42;
  --surface: rgba(40, 48, 60, 0.78);
  --surface-2: rgba(255, 255, 255, 0.08);
  --ink: #e8edf3; --muted: rgba(232, 237, 243, 0.6);
  --line: rgba(255, 255, 255, 0.1); --line-strong: rgba(255, 255, 255, 0.18);
  --field: rgba(255, 255, 255, 0.08);
  --accent: #f2f4f7; --accent-dim: #d5d9df; --accent-ink: #111418; --accent-text: #e8edf3;
  --user: rgba(255, 255, 255, 0.12); --user-line: rgba(255, 255, 255, 0.08); --user-ink: #e8edf3;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  --ring: rgba(255, 255, 255, .15); --ring-strong: rgba(255, 255, 255, .3); --chip-dot: rgba(255, 255, 255, .25);
  --bad-ink: #ff8a80; --bad-line: rgba(255, 138, 128, .35);
  --error-bg: rgba(58, 20, 22, .8); --error-ink: #ffb4b4; --error-line: #5c2226;
  --mark-bg: #4a3a00; --mark-ink: #ffd966;
  --danger: #e5484d;
  --sky:
    radial-gradient(120% 80% at 18% 108%, rgba(120, 150, 190, 0.35) 0%, rgba(0, 0, 0, 0) 55%),
    radial-gradient(70% 60% at 30% 25%, rgba(90, 120, 170, 0.25) 0%, rgba(0, 0, 0, 0) 70%),
    linear-gradient(180deg, #0f1a2a 0%, #1b2b42 45%, #2a3b52 100%);
  color-scheme: dark;
}
body {
  background: var(--sky) fixed, var(--bg);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* the header floats on the sky: no bar, the links are pills */
.top { border-bottom: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 16px 20px; }
.brand { font-weight: 700; font-size: 17px; }
.dot { background: var(--accent); box-shadow: none; }
.top .btn.ghost { background: var(--surface); border: 1px solid var(--user-line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow); color: var(--ink); padding: 6px 12px; font-size: 13px; }
.top .btn.ghost:hover { opacity: .85; color: var(--ink); border-color: var(--user-line); }
.top .btn.icon.theme-btn { width: 32px; height: 32px; padding: 0; }
/* cards are the chat's bubbles */
.card, .acct-flash, .acct .pending {
  background: var(--surface); border: 1px solid var(--user-line); border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: var(--shadow);
}
.card { padding: 16px 18px; }
.card h4 { color: var(--ink); }
.acct-flash { border-color: var(--user-line); }
.acct-flash.bad { border-color: var(--bad-line); color: var(--bad-ink); }
/* buttons: quiet white pills, the main one dark (the chat's send / Chat-Studio pill) */
.btn { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.btn:hover { border-color: var(--line-strong); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: var(--accent-ink); }
.btn.danger:hover { color: #fff; opacity: .9; }
/* the tabs: the chat's Chat | Studio switch */
.acct-tabs {
  display: inline-flex; gap: 2px; padding: 3px; border: 0; border-radius: 999px; max-width: 100%;
  background: var(--user); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow);
}
.acct-tabs button { border: 0; border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.acct-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border: 0; }
.acct-tabs button:not([aria-selected="true"]):hover { color: var(--ink); }
.acct h1, .doc h1 { font-weight: 700; letter-spacing: -.02em; }
.acct .plan, .upgrade-card .plan { border-color: var(--line); background: var(--surface-2); border-radius: 14px; }
.acct .plan.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.acct .plan .price, .upgrade-card .plan .price { color: var(--muted); }
.acct .switch input { accent-color: var(--accent); }
.acct .item img, .acct .design .flip-card-front, .acct .design .flip-card-back { background: rgba(255, 255, 255, .6); }
:root[data-theme="dark"] .acct .item img, :root[data-theme="dark"] .acct .design .flip-card-front, :root[data-theme="dark"] .acct .design .flip-card-back { background: rgba(255, 255, 255, .08); }
/* the long pages (about, terms, privacy): one bubble of text on the sky */
.doc { margin-top: 8px; margin-bottom: 32px; padding: 28px 32px; background: var(--surface); border: 1px solid var(--user-line); border-radius: 22px; backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); box-shadow: var(--shadow); }
.doc a { color: var(--ink); text-underline-offset: 2px; }
.doc code { background: var(--surface-2); }
.doc-foot { border-top: 0; }
@media (max-width: 600px) { .doc { padding: 20px 18px; border-radius: 18px; margin-left: 10px; margin-right: 10px; width: auto; } .top { padding: 12px 14px; } }

/* the UNLIMITED plan (internal operatives) and STAFF on My account */
.acct .badge-unlimited { display: inline-block; padding: 4px 12px; border-radius: 999px; background: linear-gradient(90deg, #1d1f24, #4a3aff); color: #fff; font-size: 14px; font-weight: 700; letter-spacing: 0.12em; }

/* a failed change on My account: one quiet red line beside the control (no message box at the top) */
.acct .acct-error { margin: 6px 0 0; font-size: 13px; color: var(--bad-ink, #b42318); flex-basis: 100%; }

/* the shop address on a Shops card: a quiet link after the buttons */
.acct a.shop-url { font-size: 13px; text-decoration: none; overflow-wrap: anywhere; }
.acct a.shop-url:hover { text-decoration: underline; }

/* ==== /plans (2026-11-04): three glass cards on the sky, a Lucide icon each (public/teegpt/plans.js), big
   prices, readable lines with icons, the earning line in the film's amber; Creator featured ==== */
.acct.plans-page { max-width: 1080px; }
.plans-hero { text-align: center; max-width: 700px; margin: 14px auto 34px; }
.plans-hero .eyebrow { display: inline-block; margin: 0 0 14px; padding: 5px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--user-line); box-shadow: var(--shadow); font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.acct.plans-page .plans-hero h1 { font-size: clamp(32px, 5vw, 50px); line-height: 1.05; letter-spacing: -.035em; font-weight: 800; margin: 0 0 16px; text-wrap: balance; }
.plans-hero .lead { margin: 0; font-size: 18px; line-height: 1.6; color: var(--ink); text-wrap: pretty; }
.plans-status { text-align: center; margin: -14px 0 26px; }
.plans-status span { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 600; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; align-items: stretch; margin-top: 14px; }
.plan-card {
  position: relative; display: flex; flex-direction: column; padding: 28px 26px 24px; border-radius: 24px;
  background: var(--surface); border: 1px solid var(--user-line); box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  transition: transform .2s ease, box-shadow .2s ease;
}
.plan-card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(20, 40, 70, .08), 0 20px 48px rgba(20, 40, 70, .16); }
.plan-card.featured { border: 2px solid #FFC107; box-shadow: 0 0 0 5px rgba(255, 193, 7, .2), var(--shadow); }
.plan-card.current { border: 2px solid var(--accent); }
.plan-card .ribbon, .plan-card .mine { position: absolute; top: -13px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.plan-card .ribbon { left: 24px; background: #FFC107; color: #1a1300; }
.plan-card .mine { right: 24px; background: var(--accent); color: var(--accent-ink); }
.plan-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 18px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); }
.plan-icon svg { width: 28px; height: 28px; }
.plan-card.featured .plan-icon { background: linear-gradient(135deg, #FFD54F, #FFB300); border-color: transparent; color: #1a1300; }
.plan-card h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.plan-card .tagline { margin: 4px 0 20px; font-size: 15px; color: var(--muted); }
.plan-card .price { display: flex; align-items: baseline; gap: 6px; margin: 0 0 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.plan-card .price .amount { font-size: 46px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.plan-card .price .per { font-size: 16px; font-weight: 500; color: var(--muted); }
.plan-card ul { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 13px; align-content: start; flex: 1; }
.plan-card li { display: flex; align-items: center; gap: 12px; font-size: 16px; line-height: 1.35; color: var(--ink); }
.plan-card li svg { flex: none; width: 20px; height: 20px; opacity: .7; }
.plan-card li.earn { margin: 0 -10px 3px; padding: 9px 10px; border-radius: 12px; background: #FFC107; color: #1a1300; font-weight: 700; }
.plan-card li.earn svg { opacity: 1; }
.plan-card .choose { width: 100%; padding: 12px 16px; font-size: 15px; font-weight: 600; text-align: center; text-decoration: none; box-sizing: border-box; }
.plan-card.featured .btn.primary { background: #FFC107; border-color: #FFC107; color: #1a1300; }
.plan-card.featured .btn.primary:hover { background: #FFB300; border-color: #FFB300; color: #1a1300; }
.plans-soon { text-align: center; margin-top: 16px; }
.plans-notes { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.plans-notes li {
  display: flex; gap: 14px; padding: 18px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--user-line);
  box-shadow: var(--shadow); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.plans-notes svg { flex: none; width: 22px; height: 22px; margin-top: 1px; }
.plans-notes strong { display: block; margin-bottom: 4px; font-size: 15.5px; }
.plans-notes p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink); opacity: .82; }
.plans-notes a { color: inherit; text-underline-offset: 2px; font-weight: 600; }
@media (max-width: 600px) {
  .plans-hero { margin: 4px auto 26px; }
  .plans-hero .lead { font-size: 16.5px; }
  .plan-card { padding: 26px 20px 20px; }
  .plan-card .price .amount { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) { .plan-card { transition: none; } .plan-card:hover { transform: none; } }
