/* Crea con BitPull: the app in a browser, made for a phone first.
   Light by default, dark when the system is dark. Airy: one big prompt card, few elements,
   and BitPull's own aurora (blue, cyan, aqua, indigo, a touch of violet, a warm spark) behind it. */
@font-face { font-family: "Epilogue"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/fonts/epilogue-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD }
@font-face { font-family: "Epilogue"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/fonts/epilogue-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF }

/* ---- colours: light (default) ---- */
:root {
  /* The BitPull palette. */
  --c-blue: #2f6bff; --c-cyan: #22d3ee; --c-aqua: #2ee6d6; --c-indigo: #3b2bd9; --c-violet: #7c5cff; --c-warm: #ffb38a;
  --grad: linear-gradient(135deg, #2f6bff 0%, #3b5bff 45%, #3b2bd9 100%);
  --grad-soft: linear-gradient(135deg, #2f6bff14, #22d3ee14 60%, #7c5cff10);

  --bg: #f7f8fb; --bg2: #eef1f7; --surface: #ffffff; --surface2: #f2f4f9; --surface3: #e7ebf3;
  --ink: #0b1220; --muted: #4a5468; --faint: #646d80; --line: #0b122014; --line2: #0b122024;
  --accent: #2f6bff; --accent2: #1f56e0; --accent-ink: #ffffff; --tint: #2f6bff12; --tint2: #2f6bff24;
  --live: #0b7f99; --live-bg: #22d3ee1f; --bad: #c0362c; --bad-bg: #c0362c0f; --bad-line: #c0362c38; --ok: #11805a; --ok-bg: #11805a14;
  --send: var(--grad); --send-ink: #ffffff;
  --card-shadow: 0 1px 2px #0b12200a, 0 10px 32px -14px #0b122030;
  --big-shadow: 0 1px 2px #0b12200d, 0 24px 60px -24px #1b2a6b40, 0 0 0 1px #0b12200d;
  --bar-bg: color-mix(in srgb, var(--bg) 78%, transparent);
  --scrim: #0b122052;
  --toast-bg: #0b1220; --toast-ink: #f4f6fb;
  --aurora-o: .72; --grain-o: .05;
  --r-xl: 28px; --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --ease: cubic-bezier(.2,.7,.2,1); --enter: cubic-bezier(.16,1,.3,1);
  --font: "Epilogue", system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sat: env(safe-area-inset-top); --sab: env(safe-area-inset-bottom); --sal: env(safe-area-inset-left); --sar: env(safe-area-inset-right);
  color-scheme: light;
}
/* ---- colours: dark (when the system is dark) ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #070b18; --bg2: #0a1020; --surface: #0f1628; --surface2: #151d33; --surface3: #1d2742;
    --ink: #eef1f8; --muted: #a3abbf; --faint: #8189a0; --line: #eef1f814; --line2: #eef1f826;
    --accent: #5b8cff; --accent2: #8aaeff; --accent-ink: #ffffff; --tint: #5b8cff1a; --tint2: #5b8cff33;
    --live: #2ee6d6; --live-bg: #2ee6d61a; --bad: #ff8a80; --bad-bg: #ff8a8014; --bad-line: #ff8a8040; --ok: #4ade9b; --ok-bg: #4ade9b1f;
    --grad-soft: linear-gradient(135deg, #2f6bff26, #22d3ee14 60%, #7c5cff1f);
    --card-shadow: 0 0 0 1px #eef1f812, 0 16px 40px -20px #000c;
    --big-shadow: 0 0 0 1px #eef1f817, 0 30px 70px -30px #000, 0 0 80px -30px #2f6bff55;
    --scrim: #02040bb3;
    --toast-bg: #eef1f8; --toast-ink: #070b18;
    --aurora-o: 1; --grain-o: .07;
    color-scheme: dark;
  }
}
/* Dark chosen in Account › Appearance, whatever the system says (theme.js sets data-theme). */
:root[data-theme=dark] {
  --bg: #070b18; --bg2: #0a1020; --surface: #0f1628; --surface2: #151d33; --surface3: #1d2742;
  --ink: #eef1f8; --muted: #a3abbf; --faint: #8189a0; --line: #eef1f814; --line2: #eef1f826;
  --accent: #5b8cff; --accent2: #8aaeff; --accent-ink: #ffffff; --tint: #5b8cff1a; --tint2: #5b8cff33;
  --live: #2ee6d6; --live-bg: #2ee6d61a; --bad: #ff8a80; --bad-bg: #ff8a8014; --bad-line: #ff8a8040; --ok: #4ade9b; --ok-bg: #4ade9b1f;
  --grad-soft: linear-gradient(135deg, #2f6bff26, #22d3ee14 60%, #7c5cff1f);
  --card-shadow: 0 0 0 1px #eef1f812, 0 16px 40px -20px #000c;
  --big-shadow: 0 0 0 1px #eef1f817, 0 30px 70px -30px #000, 0 0 80px -30px #2f6bff55;
  --scrim: #02040bb3;
  --toast-bg: #eef1f8; --toast-ink: #070b18;
  --aurora-o: 1; --grain-o: .07;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body { overscroll-behavior-y: none; }
[hidden] { display: none !important; }
svg.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 12px; }
::selection { background: #2f6bff33; }
input, select, textarea { accent-color: var(--accent); }

/* ---- the aurora: layered colour light behind the home, chats and welcome ---- */
.welcome, .home { position: relative; isolation: isolate; }
.welcome::before, .home::before {
  content: ""; position: fixed; z-index: -2; left: -20vw; right: -20vw; bottom: -16vh; height: 72vh; pointer-events: none;
  background:
    radial-gradient(38% 46% at 16% 66%, #2f6bff 0%, #2f6bffb0 30%, #2f6bff00 72%),
    radial-gradient(34% 44% at 42% 84%, #22d3ee 0%, #22d3eeb0 30%, #22d3ee00 72%),
    radial-gradient(30% 40% at 64% 64%, #7c5cff 0%, #7c5cffa0 30%, #7c5cff00 72%),
    radial-gradient(28% 34% at 80% 90%, #2ee6d6 0%, #2ee6d6a0 30%, #2ee6d600 72%),
    radial-gradient(16% 20% at 30% 100%, #ffb38a 0%, #ffb38a00 72%),
    radial-gradient(44% 44% at 94% 66%, #3b2bd9 0%, #3b2bd900 72%),
    radial-gradient(40% 44% at 2% 96%, #3b2bd9 0%, #3b2bd900 72%);
  filter: blur(56px) saturate(125%); opacity: var(--aurora-o);
  transform-origin: 50% 80%; will-change: transform; animation: drift 38s ease-in-out infinite alternate;
}
/* A very fine grain over the light, so it reads as painted rather than flat. */
.welcome::after, .home::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--grain-o);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .welcome::after, :root:not([data-theme=light]) .home::after { filter: invert(1); } }
:root[data-theme=dark] .welcome::after, :root[data-theme=dark] .home::after { filter: invert(1); }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50% { transform: translate3d(-3vw, -2vh, 0) scale(1.06) rotate(2deg); }
  100% { transform: translate3d(3vw, 1vh, 0) scale(1.03) rotate(-2deg); }
}

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; touch-action: manipulation; transition: transform 90ms var(--ease), background 150ms var(--ease), box-shadow 150ms, opacity 150ms; white-space: nowrap; }
.btn:hover { background: var(--surface2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; transform: none; cursor: default; }
.btn-primary, .btn-primary:hover { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 22px -10px #2f6bffaa, inset 0 1px 0 #ffffff30; }
.btn-primary:hover { box-shadow: 0 10px 28px -10px #2f6bffcc, inset 0 1px 0 #ffffff30; }
.btn-ghost, .btn-ghost:hover { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--tint); }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 17px; }
.btn-small { min-height: 40px; padding: 0 15px; font-size: 14.5px; }
.btn.wide { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); flex: none; text-decoration: none; transition: background 150ms, transform 90ms var(--ease); }
.icon-btn:hover { background: var(--tint); }
.icon-btn:active { background: var(--tint2); transform: scale(.95); }
.icon-btn.small { width: 40px; height: 40px; }
.icon-btn.small svg.ic { width: 18px; height: 18px; }
.link { color: var(--muted); text-decoration: none; font-weight: 600; padding: 10px 6px; min-height: 44px; display: inline-flex; align-items: center; }
.link:hover { color: var(--ink); }

/* ---- bars ---- */
.view { min-height: 100%; }
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; min-height: calc(60px + var(--sat)); padding: calc(8px + var(--sat)) calc(12px + var(--sar)) 8px calc(12px + var(--sal)); background: var(--bar-bg); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); border-bottom: 1px solid var(--line); }
.home .bar, .bar-clear { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.bar-clear { position: relative; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 17px; letter-spacing: -.02em; flex: 1; min-width: 0; padding-inline-start: 4px; }
.brand img { width: 30px; height: 30px; border-radius: 9px; box-shadow: 0 4px 12px -4px #2f6bff66; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 80%, transparent); font-weight: 600; font-size: 14.5px; font-variant-numeric: tabular-nums; box-shadow: var(--card-shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pill svg.ic { width: 16px; height: 16px; color: var(--accent); }

/* ---- welcome ---- */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; }
.w-body { flex: 1; display: grid; gap: 36px; align-content: center; width: 100%; max-width: 1120px; margin: 0 auto; padding: 12px calc(22px + var(--sar)) calc(32px + var(--sab)) calc(22px + var(--sal)); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 7px 14px 7px 11px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px solid var(--line); color: var(--accent2); font-size: 14px; font-weight: 600; box-shadow: var(--card-shadow); }
.eyebrow svg.ic { width: 16px; height: 16px; }
.welcome h1 { font-size: clamp(40px, 8vw + 8px, 72px); line-height: 1; letter-spacing: -.05em; font-weight: 600; margin: 0 0 18px; text-wrap: balance; }
.welcome .lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; max-width: 34em; text-wrap: pretty; }
.w-cta { display: flex; flex-direction: column; gap: 10px; }
.w-cta .btn-ghost { background: color-mix(in srgb, var(--surface) 70%, transparent); border-color: var(--line); color: var(--ink); }
.w-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.w-points li { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 15.5px; }
.w-points svg.ic { color: var(--accent); width: 18px; height: 18px; }
.w-scene { display: grid; place-items: center; }
.phone { width: min(300px, 78vw); aspect-ratio: 9 / 17; border-radius: 40px; padding: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--big-shadow), 0 0 0 7px color-mix(in srgb, var(--surface) 60%, transparent); position: relative; overflow: hidden; }
.ph-chat { position: absolute; inset: 12px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 14px; animation: chatOut 9s var(--ease) infinite; }
.ph-msg { max-width: 85%; padding: 10px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.35; }
.ph-msg.me { align-self: flex-end; background: var(--grad); color: #fff; border-end-end-radius: 5px; }
.ph-msg.ai { align-self: flex-start; background: var(--surface3); border-end-start-radius: 5px; opacity: 0; animation: aiIn 9s var(--ease) infinite; }
.typing { display: inline-block; overflow: hidden; white-space: nowrap; max-width: 0; vertical-align: bottom; animation: type 9s steps(28, end) infinite; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
.ph-site { position: absolute; inset: 12px; border-radius: 30px; overflow: hidden; background: #f7f4ee; opacity: 0; transform: translateY(24px) scale(.98); animation: siteIn 9s var(--enter) infinite; padding: 16px; display: grid; gap: 12px; align-content: start; }
.ph-hero { height: 52%; border-radius: 18px; background: linear-gradient(135deg, #2f6bff, #22d3ee); padding: 18px; display: flex; flex-direction: column; gap: 8px; justify-content: flex-end; }
.ph-hero b { width: 70%; height: 16px; border-radius: 4px; background: #fff; }
.ph-hero i { width: 85%; height: 7px; border-radius: 4px; background: #ffffffaa; } .ph-hero i.s { width: 55%; }
.ph-hero span { width: 42%; height: 24px; border-radius: 999px; background: #0b1220; margin-top: 6px; }
.ph-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ph-cards i { aspect-ratio: 1; border-radius: 12px; background: #e7e2d8; }
@keyframes type { 0% { max-width: 0 } 22%, 100% { max-width: 100% } }
@keyframes aiIn { 0%, 24% { opacity: 0; transform: translateY(6px) } 28%, 46% { opacity: 1; transform: none } 50%, 100% { opacity: 0 } }
@keyframes siteIn { 0%, 48% { opacity: 0; transform: translateY(24px) scale(.98) } 56%, 92% { opacity: 1; transform: none } 100% { opacity: 0 } }
@keyframes chatOut { 0%, 48% { opacity: 1 } 54%, 96% { opacity: 0 } 100% { opacity: 1 } }
@keyframes blink { 0%, 100% { opacity: .3 } 50% { opacity: 1 } }
@media (min-width: 860px) {
  .w-body { grid-template-columns: 1.1fr .9fr; gap: 56px; }
  .w-cta { flex-direction: row; }
}

/* ---- signed out (2026-12-06, like Lovable): the prompt box first, then what it does, then the way in ---- */
.signed-in #v-welcome { display: none; }
.lw-bar { gap: 6px; }
.lw-bar .brand { text-decoration: none; color: var(--ink); }
.btn-dark, .btn-dark:hover { background: var(--ink); color: var(--bg); border-color: transparent; }
.btn-dark:hover { opacity: .88; }
.lw-main { flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: clamp(28px, 9vh, 110px) calc(18px + var(--sar)) 40px calc(18px + var(--sal)); display: flex; flex-direction: column; align-items: center; text-align: center; }
.lw-main .eyebrow { margin-bottom: 20px; }
.lw-title { font-size: clamp(38px, 6.4vw + 12px, 68px); line-height: 1.02; letter-spacing: -.05em; font-weight: 600; margin: 0 0 14px; text-wrap: balance; max-width: 13em; }
.lw-lead { margin: 0 0 28px; max-width: 32em; color: var(--muted); font-size: 17px; text-wrap: balance; }
.lw-main .composer { width: 100%; text-align: start; }
.lw-note { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--faint); font-size: 13px; line-height: 1.3; }
.lw-note svg.ic { width: 15px; height: 15px; }
.lw-main > .chips { width: 100%; }
@media (min-width: 700px) { .lw-main > .chips { flex-wrap: wrap; justify-content: center; overflow: visible; -webkit-mask-image: none; mask-image: none; } }
.lw-feats { list-style: none; margin: 56px 0 0; padding: 0; width: 100%; display: grid; grid-template-columns: 1fr; gap: 12px; text-align: start; }
@media (min-width: 640px) { .lw-feats { grid-template-columns: 1fr 1fr; } }
.lw-feats li { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 2px; align-items: start; padding: 16px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--line); box-shadow: var(--card-shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.lw-feats b { font-weight: 600; font-size: 16px; letter-spacing: -.01em; align-self: center; }
.lw-feats li > span:last-child { grid-column: 2; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.lw-ic { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft), var(--surface2); color: var(--accent2); }
.lw-again { margin: 56px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.lw-again h2 { margin: 0 0 8px; font-size: clamp(24px, 3vw + 12px, 34px); letter-spacing: -.04em; font-weight: 600; text-wrap: balance; }
.lw-again .btn { width: min(100%, 340px); }
.lw-again .btn-ghost { background: color-mix(in srgb, var(--surface) 70%, transparent); border-color: var(--line); color: var(--ink); }
.lw-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; padding: 18px calc(18px + var(--sar)) calc(22px + var(--sab)) calc(18px + var(--sal)); color: var(--faint); font-size: 13.5px; }
.lw-foot span, .lw-foot a { padding: 8px 8px; min-height: 36px; display: inline-flex; align-items: center; }
.lw-foot a { color: var(--muted); text-decoration: none; border-radius: 999px; }
.lw-foot a:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 70%, transparent); }

/* ---- home and chats: a big headline, a short line, one prompt card ---- */
.home { min-height: 100dvh; }
.h-main { position: relative; max-width: 760px; margin: 0 auto; padding: clamp(18px, 7vh, 88px) calc(18px + var(--sar)) calc(40px + var(--sab)) calc(18px + var(--sal)); }
.h-title { font-size: clamp(36px, 6vw + 14px, 60px); line-height: 1.02; letter-spacing: -.05em; font-weight: 600; margin: 8px auto 12px; text-align: center; text-wrap: balance; max-width: 14em; }
.h-sub { margin: 0 auto 26px; max-width: 30em; text-align: center; color: var(--muted); font-size: 16.5px; text-wrap: balance; }
.composer { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 12px 10px 16px; box-shadow: var(--card-shadow); transition: border-color 150ms, box-shadow 200ms; }
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 0 0 4px var(--tint), var(--card-shadow); }
.composer textarea { display: block; width: 100%; resize: none; border: 0; outline: 0; background: transparent; font-size: 17px; line-height: 1.45; padding: 4px 0; max-height: 40dvh; }
.composer textarea::placeholder { color: var(--faint); }
.composer.big { border-radius: var(--r-xl); padding: 18px 14px 12px 20px; box-shadow: var(--big-shadow); border-color: transparent; }
.composer.big:focus-within { box-shadow: 0 0 0 4px var(--tint), var(--big-shadow); border-color: transparent; }
.composer.big textarea { min-height: 96px; font-size: 17.5px; }
.c-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; min-width: 0; }
.c-row .send { margin-inline-start: auto; }
.send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--send); color: var(--send-ink); display: grid; place-items: center; flex: none; box-shadow: 0 8px 20px -8px #2f6bffb0, inset 0 1px 0 #ffffff38; transition: transform 120ms var(--ease), opacity 150ms, box-shadow 150ms; }
.send:hover { box-shadow: 0 10px 26px -8px #2f6bffd0, inset 0 1px 0 #ffffff38; }
.send:active { transform: scale(.92); }
.send:disabled { opacity: .35; box-shadow: none; }
.send svg.ic { stroke-width: 2.3; }
.icon-btn.mic { background: var(--surface2); }
.icon-btn.mic:hover { background: var(--surface3); }
.seg { display: inline-flex; min-width: 0; padding: 3px; border-radius: 999px; background: var(--surface2); }
.seg button { display: inline-flex; align-items: center; gap: 6px; min-width: 0; min-height: 38px; border: 0; background: transparent; color: var(--muted); padding: 0 13px; border-radius: 999px; font-size: 14px; font-weight: 600; transition: background 150ms, color 150ms; }
.seg button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg button svg.ic { width: 16px; height: 16px; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--accent2); box-shadow: 0 1px 2px #0b122014, 0 0 0 1px var(--tint2); }
@media (max-width: 400px) { .seg button svg.ic { display: none; } .seg button { padding: 0 11px; font-size: 13.5px; } }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 18px 2px 6px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
[dir="rtl"] .chips { -webkit-mask-image: linear-gradient(270deg, #000 90%, transparent); mask-image: linear-gradient(270deg, #000 90%, transparent); }
@media (min-width: 700px) { .h-main > .chips { flex-wrap: wrap; justify-content: center; overflow: visible; -webkit-mask-image: none; mask-image: none; } }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 78%, transparent); color: var(--ink); padding: 8px 15px; border-radius: 999px; font-size: 14.5px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background 150ms, border-color 150ms, transform 90ms var(--ease); }
.chip:hover { border-color: var(--tint2); background: var(--surface); }
.chip:active { transform: scale(.97); }
.h-head { display: flex; align-items: center; margin: 40px 4px 12px; }
.h-head h2 { font-size: 18px; letter-spacing: -.02em; color: var(--ink); font-weight: 600; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; text-align: start; border: 0; background: var(--surface); border-radius: var(--r-lg); padding: 10px 10px 14px; box-shadow: var(--card-shadow); transition: box-shadow 200ms var(--ease), transform 150ms var(--ease); }
.card:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--tint2), var(--card-shadow); }
.card:active { transform: scale(.985); }
.card > .t, .card > .m { padding: 0 6px; }
.thumb { aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--bg2); position: relative; }
.thumb iframe { position: absolute; top: 0; left: 0; width: 400%; height: 400%; transform: scale(.25); transform-origin: 0 0; border: 0; pointer-events: none; background: #fff; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; text-shadow: 0 2px 12px #0b122040; }
.card .t { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .m { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13.5px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--surface2); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tag.live { background: var(--live-bg); color: var(--live); }
.tag.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c-aqua); box-shadow: 0 0 0 3px #2ee6d640; }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; }
.h-foot { margin-top: 36px; display: flex; justify-content: center; }
.h-foot a { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: 14.5px; padding: 10px 16px; border-radius: 999px; }
.h-foot a:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 70%, transparent); }

/* ---- the invitation to the desktop app ---- */
.invite { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; margin-top: 20px; padding: 14px; border-radius: var(--r-lg); background: var(--grad-soft), var(--surface); box-shadow: var(--card-shadow); overflow: hidden; position: relative; animation: rise 400ms var(--enter); }
.invite::after { content: ""; position: absolute; inset: -40% -10% auto auto; width: 180px; height: 180px; background: radial-gradient(circle, #22d3ee30, transparent 70%); pointer-events: none; }
.inv-art { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--grad); color: #fff; }
.inv-text { display: flex; flex-direction: column; min-width: 0; font-size: 14px; color: var(--muted); line-height: 1.35; }
.inv-text b { color: var(--ink); font-size: 15px; margin-bottom: 2px; }
.invite .btn { position: relative; z-index: 1; }
.invite.inline { grid-template-columns: auto 1fr; margin-top: 20px; }
.invite.inline .btn { grid-column: 1 / -1; }
@media (max-width: 520px) { .invite { grid-template-columns: auto 1fr auto; } .invite .btn { grid-column: 1 / -1; order: 5; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) } }

/* ---- project ---- */
.project { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.p-name { flex: 1; min-width: 0; min-height: 44px; text-align: start; border: 0; background: transparent; font-weight: 600; font-size: 17px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 6px; border-radius: 12px; display: flex; align-items: center; }
button.p-name { display: block; line-height: 28px; }
button.p-name:hover { background: var(--tint); }
.tabs { display: flex; gap: 4px; margin: 8px calc(12px + var(--sar)) 4px calc(12px + var(--sal)); padding: 4px; border-radius: 999px; background: var(--surface2); }
.tabs button { flex: 1; position: relative; min-height: 38px; border: 0; background: transparent; color: var(--muted); font-weight: 600; padding: 0 12px; border-radius: 999px; font-size: 15px; transition: background 150ms, color 150ms; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px #0b122014, 0 2px 8px -4px #0b122026; }
.badge { position: absolute; top: 8px; width: 8px; height: 8px; margin-inline-start: 6px; border-radius: 50%; background: var(--c-aqua); box-shadow: 0 0 0 3px #2ee6d640; }
.p-body { flex: 1; min-height: 0; display: grid; }
.p-chat, .p-preview { min-height: 0; display: flex; flex-direction: column; }
.p-files { min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.p-body[data-tab="chat"] .p-preview, .p-body[data-tab="chat"] .p-files, .p-body[data-tab="preview"] .p-chat, .p-body[data-tab="preview"] .p-files, .p-body[data-tab="files"] .p-chat, .p-body[data-tab="files"] .p-preview { display: none; }
@media (min-width: 900px) {
  /* Wide screens: the chat on the left; on the right the preview or the files. */
  .tabs { margin-inline-start: calc(440px + 14px); align-self: flex-start; }
  .tabs [data-tab="chat"] { display: none; }
  .tabs button { flex: 0 0 auto; padding: 0 18px; }
  .p-body { grid-template-columns: minmax(360px, 440px) 1fr; }
  .p-body .p-chat { display: flex !important; }
  .p-body[data-tab="chat"] .p-preview { display: flex !important; }
  .p-chat { border-inline-end: 1px solid var(--line); }
}
.msgs { flex: 1; overflow-y: auto; padding: 18px calc(16px + var(--sar)) 12px calc(16px + var(--sal)); display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.msg { max-width: 92%; animation: rise 260ms var(--enter); }
.msg.me { align-self: flex-end; background: var(--surface); box-shadow: var(--card-shadow); padding: 10px 15px; border-radius: 20px 20px 6px 20px; white-space: pre-wrap; word-wrap: break-word; }
[dir="rtl"] .msg.me { border-radius: 20px 20px 20px 6px; }
.msg.me img { display: block; max-width: 160px; border-radius: 12px; margin-top: 6px; }
.msg.ai { align-self: flex-start; }
.msg.ai .who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.msg.ai .who img { width: 20px; height: 20px; border-radius: 6px; }
.msg.ai .txt { white-space: pre-wrap; word-wrap: break-word; line-height: 1.6; }
.msg.err .txt { color: var(--bad); }
/* Credits ran out during the work: the card with "Buy credits" and "Resume" (create.js, 2026-12-06). */
.msg.ai.credits-out { box-shadow: inset 3px 0 0 #f59e0b; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.step { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 12px; padding: 4px 9px; border-radius: 999px; background: var(--surface2); color: var(--muted); }
.step svg.ic { width: 13px; height: 13px; color: var(--ok); }
.step.del { text-decoration: line-through; }
.cost { margin-top: 8px; font-size: 12.5px; color: var(--faint); }
.msg .act { margin-top: 10px; }
.working { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14.5px; }
.orb { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(from 0deg, var(--c-blue), var(--c-cyan), var(--c-violet), var(--c-blue)); animation: spin 1.1s linear infinite; -webkit-mask: radial-gradient(circle, transparent 6px, #000 7px); mask: radial-gradient(circle, transparent 6px, #000 7px); }
@keyframes spin { to { transform: rotate(360deg) } }
.p-chat .composer { margin: 0 calc(12px + var(--sar)) calc(12px + var(--sab)) calc(12px + var(--sal)); padding: 10px 8px 8px 16px; border-radius: 24px; box-shadow: var(--big-shadow); border-color: transparent; }
.p-chat .composer textarea { font-size: 16px; min-height: 26px; }
.p-chat .c-row { margin-top: 4px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 58%; min-height: 38px; border: 0; background: var(--surface2); color: var(--muted); border-radius: 999px; padding: 0 13px; font-size: 13.5px; font-weight: 600; transition: background 150ms, color 150ms; }
.chip-btn:hover { background: var(--surface3); color: var(--ink); }
.chip-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-btn svg.ic { width: 16px; height: 16px; color: var(--accent); }
.att { display: flex; gap: 8px; padding: 4px 0 6px; overflow-x: auto; }
.att .a { position: relative; flex: none; }
.att img { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line2); display: block; }
.att button { position: absolute; top: -6px; inset-inline-end: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); display: grid; place-items: center; padding: 0; }
.att button svg.ic { width: 12px; height: 12px; stroke-width: 2.6; }
.p-preview { background: var(--bg); }
.pv-bar { display: flex; gap: 6px; align-items: center; padding: 8px calc(12px + var(--sar)) 8px calc(12px + var(--sal)); }
.pv-bar select { flex: 1; min-width: 0; height: 40px; border-radius: 999px; border: 0; background: var(--surface2); padding: 0 12px; font-size: 14px; }
.pv-frame { flex: 1; min-height: 0; position: relative; margin: 0 calc(12px + var(--sar)) calc(12px + var(--sab)) calc(12px + var(--sal)); border-radius: var(--r-lg); overflow: hidden; background: #fff; box-shadow: var(--big-shadow); }
.pv-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
/* A grid, also at full size: in a plain block some Chrome versions left the sandboxed page unpainted. */
.pv-frame { display: grid; }
.pv-frame > iframe { grid-area: 1 / 1; min-height: 0; }
/* A device's screen: the page at that size, scaled down to fit, on a quiet stage. */
.pv-frame.dev { background: var(--bg2); display: grid; place-items: center; overflow: hidden; }
.pv-frame.dev iframe { position: absolute; left: 50%; top: 50%; flex: none; transform-origin: center center; border-radius: 18px; box-shadow: 0 0 0 8px #0b1220, 0 0 0 9px var(--line2), 0 20px 60px #0b122055; }
.pv-frame.dev.desk iframe { border-radius: 8px; box-shadow: 0 0 0 1px var(--line2), 0 20px 60px #0b122040; }
.pv-device { flex: 0 1 auto !important; max-width: 46%; }
.pv-live-badge { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 3; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: #0b1220cc; color: #fff; font-size: 12.5px; backdrop-filter: blur(6px); pointer-events: none; }
.pv-live-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-cyan); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.msg.ai.live .txt { margin-top: 8px; }
.live-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.stop-btn svg.ic { width: 14px; height: 14px; }
.step.now { color: var(--ink); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--tint); }
.step .spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.msg.me.queued { opacity: .75; border: 1px dashed var(--line2); box-shadow: none; }
.q-tag { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.q-act { display: flex; gap: 12px; margin-top: 6px; white-space: normal; }
.pv-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); text-align: center; padding: 24px; isolation: isolate; overflow: hidden;
  background: radial-gradient(60% 50% at 30% 80%, #2f6bff1f, transparent 70%), radial-gradient(50% 45% at 75% 85%, #22d3ee1f, transparent 70%), radial-gradient(40% 40% at 60% 20%, #7c5cff14, transparent 70%), var(--surface); }
.pv-empty svg.ic { width: 30px; height: 30px; color: var(--accent); }
.pv-note { margin: -4px calc(14px + var(--sar)) calc(10px + var(--sab)); font-size: 13px; color: var(--muted); }

/* ---- sheets ---- */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade 200ms; }
.sheet { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; max-height: 88dvh; overflow-y: auto; background: var(--surface); border: 0; border-radius: 28px 28px 0 0; padding: 8px calc(20px + var(--sar)) calc(22px + var(--sab)) calc(20px + var(--sal)); animation: up 340ms var(--enter); box-shadow: 0 -20px 60px -20px #0b122055, 0 0 0 1px var(--line); }
@media (min-width: 700px) { .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 480px; transform: translate(-50%, -50%); border-radius: 28px; animation: pop 240ms var(--enter); padding-top: 16px; box-shadow: 0 30px 80px -30px #0b122066, 0 0 0 1px var(--line); } .s-grab { display: none; } }
.s-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line2); margin: 2px auto 12px; }
.s-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.s-head h3 { margin: 0; font-size: 22px; letter-spacing: -.03em; font-weight: 600; }
.s-head .icon-btn { background: var(--surface2); }
.s-label { margin: 22px 4px 6px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.s-list { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.s-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 10px 10px; border-radius: 16px; border: 0; background: transparent; text-decoration: none; text-align: start; transition: background 150ms; }
.s-item:hover { background: var(--surface2); }
.s-item > span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.s-item b { font-weight: 600; }
.s-item small { color: var(--muted); font-size: 13.5px; }
.s-item > svg.ic { box-sizing: content-box; padding: 10px; border-radius: 12px; background: var(--surface2); color: var(--accent2); }
.s-item:hover > svg.ic { background: var(--surface); }
.s-item select { background: var(--surface2); border: 0; border-radius: 999px; height: 40px; padding: 0 12px; }
.s-item.on { background: var(--tint); box-shadow: 0 0 0 1.5px var(--accent) inset; }
.s-item.on > svg.ic { background: var(--grad); color: #fff; }
.s-item.danger, .s-item.danger svg.ic { color: var(--bad); }
.s-item.danger > svg.ic { background: var(--bad-bg); }
.s-item .price { color: var(--muted); font-size: 13px; text-align: end; flex: none; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.fine { color: var(--faint); font-size: 13px; margin: 12px 2px 0; }
.balance { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 18px; border-radius: 22px; position: relative; overflow: hidden; isolation: isolate; color: #fff;
  background: radial-gradient(80% 120% at 0% 100%, #22d3ee 0%, transparent 60%), radial-gradient(70% 120% at 100% 0%, #7c5cff 0%, transparent 60%), linear-gradient(135deg, #2f6bff, #3b2bd9); box-shadow: 0 14px 36px -16px #2f6bffaa; }
.balance .muted { color: #ffffffd9; }
.balance > div { display: flex; flex-direction: column; }
.balance b { font-size: 32px; letter-spacing: -.03em; font-weight: 600; font-variant-numeric: tabular-nums; }
.balance .tag { background: #ffffff2e; color: #fff; }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.amounts button { min-height: 56px; border-radius: 16px; border: 0; background: var(--surface2); font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; transition: background 150ms, box-shadow 150ms; }
.amounts button:hover { box-shadow: 0 0 0 1.5px var(--accent) inset; background: var(--tint); }
.amounts button small { color: var(--muted); font-weight: 500; font-size: 12px; }
.amounts button:active { background: var(--tint2); }
.live-url { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 14px 16px; border-radius: 18px; background: var(--live-bg); color: var(--live); word-break: break-all; }
.live-url a { color: var(--ink); text-decoration: none; font-weight: 600; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.row3 .btn { padding: 0 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.risk-lead { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); margin: 14px 0 6px; }
.risk-lead svg.ic { color: var(--bad); margin-top: 2px; }
.risks { margin: 0; padding: 0; padding-inline-start: 4px; list-style: none; display: grid; gap: 6px; }
.risks li { padding: 10px 12px; border-radius: 14px; background: var(--bad-bg); border: 1px solid var(--bad-line); font-size: 14.5px; }
.risks code { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
#s-ask input { width: 100%; margin-top: 14px; height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line2); background: var(--surface2); font-size: 16px; }
.files { margin-top: 12px; display: grid; gap: 4px; max-height: 40dvh; overflow-y: auto; }
.files div { display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding: 7px 10px; border-radius: 10px; background: var(--surface2); }
@keyframes up { from { transform: translateY(100%) } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.98) } }
@keyframes fade { from { opacity: 0 } }

/* ---- toast ---- */
#toast { position: fixed; z-index: 60; left: 50%; bottom: calc(18px + var(--sab)); transform: translateX(-50%); max-width: min(92vw, 480px); margin: 0; padding: 12px 18px; border-radius: 999px; background: var(--toast-bg); color: var(--toast-ink); font-weight: 500; font-size: 15px; box-shadow: 0 16px 40px -12px #0b122066; animation: rise 220ms var(--enter); }
#toast:empty { display: none; }
#toast.error { background: var(--surface); color: var(--bad); box-shadow: 0 0 0 1px var(--bad-line), 0 16px 40px -12px #0b122055; border-radius: 18px; }
#toast a { color: inherit; font-weight: 700; margin-inline-start: 8px; }

/* ---- the bar at the bottom (Create · Chat · Account): a floating pill ---- */
.tabbar { position: fixed; z-index: 30; left: calc(12px + var(--sal)); right: calc(12px + var(--sar)); bottom: calc(10px + var(--sab)); display: grid; grid-template-columns: repeat(3, 1fr); padding: 5px; border-radius: 24px; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(160%) blur(20px); -webkit-backdrop-filter: saturate(160%) blur(20px); box-shadow: 0 0 0 1px var(--line), 0 18px 40px -18px #0b122066; }
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border: 0; background: transparent; color: var(--faint); font-size: 12px; font-weight: 600; padding: 4px 0; border-radius: 19px; transition: color 150ms, background 150ms; }
.tabbar button:hover { color: var(--ink); }
.tabbar button svg.ic { width: 22px; height: 22px; }
.tabbar button.on { color: var(--ink); background: var(--tint); }
.tabbar button.on svg.ic { color: var(--accent); }
body.has-tabbar .h-main { padding-bottom: calc(110px + var(--sab)); }
body.has-tabbar #toast { bottom: calc(92px + var(--sab)); }
@media (min-width: 900px) {
  .tabbar { left: 50%; right: auto; bottom: 18px; transform: translateX(-50%); width: 340px; }
}

/* ---- after an answer: suggestions, undo, cost ---- */
.sugs { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 4px; animation: rise 260ms var(--enter); }
.sugs .chip { font-size: 14px; padding: 8px 14px; background: var(--surface); box-shadow: var(--card-shadow); border-color: transparent; }
.msg .foot { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; margin-top: 8px; }
.msg .foot .cost { margin: 0; }
.link-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; padding: 4px 0; }
.link-btn svg.ic { width: 15px; height: 15px; }
.link-btn:hover { color: var(--accent2); }
.elapsed { margin-inline-start: auto; font-variant-numeric: tabular-nums; color: var(--faint); font-size: 13px; }
.working { width: 100%; }
#p-slow { margin: 6px 0 0; }

/* ---- the model sheet: recommended first, then all with a search ---- */
.all-models { margin-top: 14px; }
.all-models summary { cursor: pointer; list-style: none; min-height: 48px; display: grid; place-items: center; padding: 10px 12px; border-radius: 999px; background: var(--surface2); color: var(--ink); font-weight: 600; text-align: center; transition: background 150ms; }
.all-models summary:hover { background: var(--surface3); }
.all-models summary::-webkit-details-marker { display: none; }
.all-models[open] summary { margin-bottom: 10px; }
.all-models input { width: 100%; height: 46px; border-radius: 999px; border: 1px solid var(--line2); background: var(--surface2); padding: 0 16px; font-size: 16px; }

/* ---- chats ---- */
.list { display: flex; flex-direction: column; gap: 8px; }
.row-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; text-align: start; padding: 12px 14px; border-radius: 18px; border: 0; background: var(--surface); box-shadow: var(--card-shadow); transition: transform 120ms var(--ease), box-shadow 200ms; }
.row-item:hover { box-shadow: 0 0 0 1px var(--tint2), var(--card-shadow); }
.row-item:active { transform: scale(.99); }
.ri-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--grad-soft), var(--surface2); color: var(--accent2); flex: none; }
.ri-t { display: flex; flex-direction: column; min-width: 0; }
.ri-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ri-t small { color: var(--muted); font-size: 13px; }
.p-body.chat-only { grid-template-columns: 1fr; }
.p-body.chat-only .p-chat { display: flex !important; max-width: 820px; width: 100%; margin: 0 auto; border: 0; }
.icon-btn.mic.on, .icon-btn.talk.on { background: var(--bad-bg); color: var(--bad); animation: micPulse 1.4s var(--ease) infinite; }
@keyframes micPulse { 50% { box-shadow: 0 0 0 7px var(--bad-bg); } }
.md { line-height: 1.6; word-wrap: break-word; }
.md p { margin: 0 0 10px; white-space: pre-wrap; }
.md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0 0 10px; padding-inline-start: 22px; }
.md li { margin: 3px 0; }
.md h4 { margin: 12px 0 6px; font-size: 16px; }
.md code { font-family: var(--mono); font-size: 13px; background: var(--surface2); padding: 1px 6px; border-radius: 6px; }
.md pre { background: var(--surface); box-shadow: 0 0 0 1px var(--line); border-radius: 14px; padding: 12px; overflow-x: auto; margin: 0 0 10px; }
.md pre code { background: none; padding: 0; }
.md a { color: var(--accent2); }

/* ---- the spoken conversation ---- */
.talk-screen { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: calc(20px + var(--sat)) 24px calc(28px + var(--sab)); background: radial-gradient(60% 45% at 30% 75%, #2f6bff40, transparent 70%), radial-gradient(50% 40% at 75% 80%, #22d3ee33, transparent 70%), radial-gradient(40% 35% at 60% 25%, #7c5cff26, transparent 70%), var(--bg); animation: fade 220ms; text-align: center; }
.talk-top { position: absolute; top: calc(10px + var(--sat)); left: 16px; right: 10px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 14px; font-weight: 600; }
.talk-orb { width: 180px; height: 180px; border-radius: 50%; border: 0; padding: 0; background: transparent; position: relative; display: grid; place-items: center; }
.talk-orb span { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #9db8ff, #2f6bff 45%, #3b2bd9 78%); box-shadow: 0 0 60px -6px #2f6bff99, inset 0 -12px 30px #1a1470; transition: transform 300ms var(--ease); }
.talk-screen[data-state="listening"] .talk-orb span { animation: breathe 1.8s ease-in-out infinite; }
.talk-screen[data-state="thinking"] .talk-orb span { animation: think 1.2s linear infinite; background: conic-gradient(from 0deg, #2f6bff, #22d3ee, #7c5cff, #2f6bff); -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%); mask: radial-gradient(circle, transparent 54%, #000 56%); }
.talk-screen[data-state="speaking"] .talk-orb span { animation: speakPulse .5s ease-in-out infinite alternate; background: radial-gradient(circle at 35% 30%, #a8fff6, #22d3ee 45%, #0f6e8a 78%); box-shadow: 0 0 70px -4px #22d3eeaa; }
@keyframes breathe { 50% { transform: scale(1.06); } }
@keyframes think { to { transform: rotate(360deg); } }
@keyframes speakPulse { from { transform: scale(.97); } to { transform: scale(1.05); } }
.talk-state { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.talk-said { margin: 0; max-width: 520px; color: var(--muted); font-size: 16px; min-height: 3em; }
.parts { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface2); font-size: 12.5px; color: var(--muted); }
.part b { color: var(--ink); font-weight: 600; }
.s-item.auto { background: var(--grad-soft); }
.s-item.auto > svg.ic { background: var(--grad); color: #fff; }
.s-item.auto.on { box-shadow: 0 0 0 1.5px var(--accent) inset; }
/* On a phone the projects are rows: a small coloured tile, the name, the state. */
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .card { display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 4px; align-items: center; padding: 10px; border-radius: 18px; }
  .card:hover { transform: none; }
  .card > .t, .card > .m { padding: 0; }
  .card .thumb { grid-row: 1 / span 2; aspect-ratio: 1; border-radius: 14px; }
  .card .thumb .ph { font-size: 22px !important; }
  .card .t { font-size: 15.5px; }
}

/* ---- Edit and Draw on the preview ---- */
.pv-tool { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 13px; border-radius: 999px; border: 0; background: var(--surface2); font-size: 14px; font-weight: 600; flex: none; transition: background 150ms; }
.pv-tool:hover { background: var(--surface3); }
.pv-tool svg.ic { width: 17px; height: 17px; }
.pv-tool.on { background: var(--live-bg); color: var(--live); box-shadow: 0 0 0 1.5px var(--live) inset; }
.marks { margin: 0 calc(12px + var(--sar)) calc(12px + var(--sab)) calc(12px + var(--sal)); padding: 12px 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--card-shadow); max-height: 34dvh; overflow-y: auto; }
.marks-hint { margin: 0; font-size: 13px; color: var(--muted); }
.marks ol { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.marks li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: start; font-size: 14px; }
.marks li .n { width: 22px; height: 22px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.marks li .k { font-weight: 600; }
.marks li button { border: 0; background: transparent; color: var(--muted); padding: 2px; }
.marks li button svg.ic { width: 16px; height: 16px; }
.marks-msg { margin: 8px 0 0; font-size: 13px; color: var(--live); }
.marks-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.pv-bar { flex-wrap: wrap; }
/* Voice picker: each voice can be tried before choosing it. */
.s-item.voice { cursor: pointer; }
.s-item.voice .try { flex: none; }
.s-item.voice .try.on { color: var(--accent2); background: var(--tint); }
.v-rate { display: flex; align-items: center; gap: 12px; margin-top: 18px; min-height: 44px; font-size: 14px; color: var(--muted); }
.v-rate input { flex: 1; accent-color: var(--accent); }
.v-rate b { min-width: 3.2em; text-align: end; color: var(--ink); font-variant-numeric: tabular-nums; }
.talk-tools { display: flex; align-items: center; gap: 6px; }
.talk-tools .chip-btn { max-width: 46vw; }
.talk-tools .chip-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The files: a list, and the editor (full screen on a phone). */
.fl-bar { display: flex; gap: 6px; align-items: center; padding: 8px calc(12px + var(--sar)) 4px calc(12px + var(--sal)); }
.fl-bar input { flex: 1; min-width: 0; height: 40px; border-radius: 999px; border: 0; background: var(--surface2); padding: 0 14px; font-size: 15px; color: var(--ink); }
.fl-lead { padding: 4px calc(16px + var(--sar)) 4px calc(16px + var(--sal)); margin: 0; }
.fl-list { flex: 1; min-height: 0; overflow: auto; padding: 4px calc(8px + var(--sar)) calc(12px + var(--sab)) calc(8px + var(--sal)); }
.fl-dir { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 4px; }
.fl-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; text-align: start; border: 0; background: transparent; color: var(--ink); padding: 10px; border-radius: 12px; font-size: 15px; }
.fl-row:hover, .fl-row:focus-visible { background: var(--surface2); }
.fl-row .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 14px; }
.fl-row small { color: var(--muted); font-size: 12px; }
.fl-row svg.ic { color: var(--accent); flex: none; }
.fl-edit { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--surface); z-index: 4; }
.p-files { position: relative; }
.fl-ebar { display: flex; align-items: center; gap: 6px; padding: 8px calc(8px + var(--sar)) 8px calc(8px + var(--sal)); border-bottom: 1px solid var(--line); }
.fl-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 13.5px; }
.fl-dirty { width: 8px; height: 8px; border-radius: 50%; background: var(--c-cyan); flex: none; }
.fl-find { display: flex; align-items: center; gap: 6px; padding: 6px calc(8px + var(--sar)) 6px calc(8px + var(--sal)); border-bottom: 1px solid var(--line); }
.fl-find input { flex: 1; min-width: 0; height: 38px; border-radius: 999px; border: 0; background: var(--surface2); padding: 0 14px; color: var(--ink); font-size: 15px; }
.fl-note { margin: 0; padding: 8px 14px; font-size: 13px; color: var(--muted); background: var(--surface2); border-bottom: 1px solid var(--line); }
#fl-text { flex: 1; min-height: 0; width: 100%; resize: none; border: 0; outline: 0; background: var(--surface); color: var(--ink); font-family: var(--mono); font-size: 13.5px; line-height: 1.6; padding: 12px calc(14px + var(--sar)) calc(14px + var(--sab)) calc(14px + var(--sal)); tab-size: 2; white-space: pre; overflow: auto; }
#fl-text.wrap { white-space: pre-wrap; word-break: break-word; }
@media (max-width: 899px) { #fl-text { font-size: 14px; } }
.fl-img { flex: 1; display: grid; place-items: center; padding: 16px; overflow: auto; }
.fl-img img { max-width: 100%; max-height: 100%; border-radius: 12px; background: repeating-conic-gradient(#8881 0 25%, transparent 0 50%) 0 0 / 16px 16px; }

/* Lists of projects and chats: search, groups, pins, choosing several. */
.h-head { gap: 10px; flex-wrap: wrap; }
.h-head h2 { flex: 1; }
.lt-tools { display: flex; gap: 6px; align-items: center; }
.lt-search { width: 170px; max-width: 46vw; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 85%, transparent); padding: 0 14px; color: var(--ink); font-size: 15px; }
.lt-tools .chip-btn { background: color-mix(in srgb, var(--surface) 85%, transparent); box-shadow: 0 0 0 1px var(--line) inset; }
.lt-group { margin: 20px 4px 8px; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.lt-group svg.ic { width: 15px; height: 15px; }
.lt-item { position: relative; display: grid; }
.lt-item > .card, .lt-item > .row-item { width: 100%; min-width: 0; }
.lt-item > .card .t { padding-inline-end: 40px; }
.lt-item > .lt-more { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 2; background: color-mix(in srgb, var(--surface) 88%, transparent); border-radius: 50%; }
.list .lt-item > .lt-more { top: 50%; transform: translateY(-50%); background: transparent; }
.lt-item .lt-check { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2; width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line2); background: var(--surface); display: grid; place-items: center; pointer-events: none; }
.list .lt-item .lt-check { top: 50%; transform: translateY(-50%); }
.lt-item.sel .lt-check { background: var(--grad); border-color: transparent; }
.lt-item.sel .lt-check::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.lt-item.sel > .card, .lt-item.sel > .row-item { box-shadow: 0 0 0 2px var(--accent), var(--card-shadow); }
.selecting .lt-item .card, .selecting .lt-item .row-item { padding-inline-start: 46px; }
.selecting .lt-more { display: none; }
.lt-pin { color: var(--accent); }
.selbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--sab)); z-index: 30; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 18px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 18px 44px -14px #0b122066; max-width: calc(100vw - 20px); }
.selbar #sel-n { font-weight: 600; white-space: nowrap; }
.danger-btn { color: var(--bad); }
.row-item { padding-inline-end: 52px; }

.v-toggle { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; cursor: pointer; }
.v-toggle input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.v-toggle span { display: flex; flex-direction: column; gap: 2px; }
.v-toggle small { color: var(--muted); font-size: 13px; }
.talk-said.ai { color: var(--ink); }
/* Hearing a sentence (the recorder caught a voice), and waiting for a tap on phones that need one to listen. */
.talk-screen[data-state="hearing"] .talk-orb span { animation: speakPulse .35s ease-in-out infinite alternate; }
.talk-screen[data-state="tap"] .talk-orb span { opacity: .55; filter: saturate(.6); }
.talk-screen[data-state="tap"] .talk-orb::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--c-cyan); animation: tapRing 1.4s ease-out infinite; pointer-events: none; }
.talk-screen[data-state="tap"] .talk-state { color: var(--ink); font-weight: 600; }
@keyframes tapRing { from { transform: scale(.92); opacity: .9; } to { transform: scale(1.12); opacity: 0; } }

/* The model sheet: what can be spent on paid models, and every model grouped by maker. */
.m-credits { margin: 8px 0 10px; padding: 12px 14px; border-radius: 16px; background: var(--grad-soft), var(--surface2); color: var(--ink); font-size: 14.5px; }
.m-credits:empty { display: none; }
.s-label.small { font-size: 12px; margin: 14px 4px 4px; }

/* ---- the site's own domain ---- */
.dm-cta { margin-top: 10px; }
.dm-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 14px 0; border-radius: 999px; background: var(--surface2); }
.dm-seg button { border: 0; background: transparent; border-radius: 999px; min-height: 42px; font-weight: 600; color: var(--muted); transition: background 150ms, color 150ms; }
.dm-seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px #0b122014, 0 2px 8px -4px #0b122026; }
.dm-form { display: flex; gap: 8px; margin: 12px 0; }
.dm-form input, .dm-contact input:not([type=checkbox]) { flex: 1; min-width: 0; min-height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line2); background: var(--surface2); color: var(--ink); font-size: 16px; transition: border-color 150ms, box-shadow 150ms; }
.dm-form input:focus, .dm-contact input:not([type=checkbox]):focus, #s-ask input:focus, .all-models input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--tint); }
.dm-contact { display: grid; gap: 8px; margin-top: 12px; }
.dm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dm-accept { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.dm-accept input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.dm-chosen { margin: 0; font-weight: 600; }
.dm-soon { padding: 12px 14px; border-radius: 16px; background: var(--grad-soft), var(--surface2); font-size: 14.5px; }
.dm-card { padding: 14px; border-radius: 18px; background: var(--surface2); margin: 10px 0; display: grid; gap: 8px; }
.dm-card .dm-head { display: flex; align-items: center; gap: 10px; }
.dm-card .dm-head b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dm-state { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--surface); color: var(--muted); white-space: nowrap; }
.dm-state.ok { background: var(--ok-bg); color: var(--ok); }
.dm-state.bad { background: var(--bad-bg); color: var(--bad); }
.dm-rec { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; font-size: 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface); }
.dm-rec code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.dm-rec small { color: var(--faint); }
.dm-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 14.5px; }
.dm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.muted.small { font-size: 13.5px; margin: 0; }
.dm-notices { display: grid; gap: 8px; margin: 0 0 18px; }
.dm-notice { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: start; padding: 12px 14px; border-radius: 18px; background: var(--grad-soft), var(--surface); box-shadow: var(--card-shadow); font-size: 14.5px; }
.dm-notice .dm-actions { grid-column: 2; }

/* Projects from the person's computers (encrypted cloud copies). */
.cc-lead { margin: -4px 4px 12px; }
.cc-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.cc-tag svg.ic { width: 14px; height: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
  .welcome::before, .home::before { animation: none !important; transform: none; }
  .ph-site { opacity: 1; transform: none; } .ph-chat { opacity: 0; } .typing { max-width: 100%; }
}
/* Live cost while the AI works, and "Stop and send" next to Send. */
.live-cost:not(:empty)::before { content: " · "; }
#ch-live-cost::before { content: none; }
.stop-send { color: var(--bad); }
@media (max-width: 480px) { .stop-send span { display: none; } }

/* ---- the bar of the main screens: the workspace on the left, the account's avatar on the right ---- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.ws-pill { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: calc(100% - 64px); min-height: 44px; padding: 4px 12px 4px 5px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 80%, transparent); box-shadow: var(--card-shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-weight: 600; font-size: 15px; transition: background 150ms; }
.ws-pill:hover { background: var(--surface); }
.ws-pill .ws-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-pill svg.ic { width: 16px; height: 16px; color: var(--muted); }
.av, .avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 600; text-transform: uppercase; }
.av { width: 32px; height: 32px; font-size: 14.5px; }
.av.small { width: 24px; height: 24px; font-size: 12px; margin-inline-start: auto; }
.avatar { position: relative; width: 42px; height: 42px; border: 0; margin-inline-start: auto; font-size: 17px; box-shadow: 0 6px 18px -8px #2f6bffaa, inset 0 1px 0 #ffffff30; transition: transform 90ms var(--ease); }
.avatar:active { transform: scale(.95); }
.avatar.big { width: 48px; height: 48px; font-size: 20px; margin: 0; }
.av-dot { position: absolute; top: 0; inset-inline-end: 0; width: 11px; height: 11px; border-radius: 50%; background: #ff4d4f; box-shadow: 0 0 0 2px var(--bg); }

/* A small menu next to its button. */
.pop { position: fixed; z-index: 45; padding: 6px; border-radius: 20px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 24px 60px -20px #0b122066; animation: popIn 160ms var(--enter); }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98) } }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 8px 12px; border: 0; border-radius: 14px; background: transparent; text-align: start; text-decoration: none; font-size: 15px; }
.pop-item:hover, .pop-item:focus-visible { background: var(--surface2); }
.pop-item > span:not(.av) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-item svg.ic { color: var(--muted); }
.pop-item.on svg.ic { color: var(--accent); }
.pop-item .av.small { order: -1; margin: 0; }
.pop-label { margin: 8px 12px 2px; font-size: 12.5px; color: var(--faint); font-weight: 600; }
.pop-credits { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-bottom: 4px; border-radius: 14px; background: var(--grad-soft), var(--surface2); font-weight: 600; font-size: 14.5px; }
.pop-credits > span { display: flex; align-items: center; gap: 8px; }
.pop-credits svg.ic { width: 16px; height: 16px; color: var(--accent); }
.pop-add { border: 0; background: var(--surface); color: var(--accent2); font-weight: 600; font-size: 13.5px; min-height: 34px; padding: 0 12px; border-radius: 999px; box-shadow: 0 0 0 1px var(--line); }
.s-sep { border: 0; height: 1px; background: var(--line); margin: 6px 8px; }

/* ---- the bottom bar: three icons in a floating glass pill ---- */
.tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 216px; grid-template-columns: repeat(3, 1fr); border-radius: 999px; padding: 6px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.tabbar button { min-height: 50px; border-radius: 999px; }
.tabbar button svg.ic { width: 23px; height: 23px; }
@media (min-width: 700px) { .tabbar { width: 216px; bottom: 18px; } }

/* ---- Projects ---- */
.pj-main { padding-top: clamp(10px, 3vh, 36px); }
.pj-top { display: flex; align-items: center; gap: 8px; margin: 0 2px 6px; }
.pj-title { flex: 1; margin: 0; font-size: clamp(32px, 5vw + 16px, 44px); letter-spacing: -.045em; font-weight: 600; line-height: 1.1; }
.icon-btn.round { background: color-mix(in srgb, var(--surface) 85%, transparent); box-shadow: 0 0 0 1px var(--line) inset, var(--card-shadow); }
.icon-btn.round[aria-expanded="true"] { background: var(--tint2); color: var(--accent2); }
.pj-searchrow { margin: 10px 0 4px; }
.pj-searchrow .lt-search { width: 100%; max-width: none; height: 46px; }
.pj-now { margin: 4px 4px 6px; color: var(--muted); font-size: 14px; }
.pj-empty { text-align: center; padding: 40px 12px; color: var(--muted); display: grid; justify-items: center; gap: 14px; }
.pj-empty p { margin: 0; }
#h-cloud.off { display: none; }
body.has-tabbar .pj-main { padding-bottom: calc(170px + var(--sab)); }
.new-fab { position: fixed; z-index: 29; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--sab)); display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--grad); color: #fff; font-weight: 600; box-shadow: 0 12px 30px -10px #2f6bffaa, inset 0 1px 0 #ffffff30; }
.new-fab:active { transform: translateX(-50%) scale(.97); }
@media (min-width: 700px) { .new-fab { bottom: 94px; } }
body:has(.selbar:not([hidden])) .new-fab { display: none; }

/* A project as a row: picture, name, date. */
.p-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 8px 52px 8px 8px; text-align: start; border: 0; border-radius: 20px; background: transparent; transition: background 150ms; }
.p-row:hover { background: color-mix(in srgb, var(--surface) 75%, transparent); }
.p-row:active { background: var(--surface); }
.p-row .thumb { width: 84px; height: 62px; aspect-ratio: auto; flex: none; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); }
.p-row .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.p-row .thumb .ph { font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.p-row .thumb .ph svg.ic { width: 24px; height: 24px; }
.pr-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pr-t b { font-size: 18px; font-weight: 600; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-t small { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.pr-t .tag { font-size: 12px; padding: 2px 9px; }
.p-row.small { min-height: 60px; padding-inline-end: 8px; }
.p-row.small .thumb { width: 60px; height: 44px; border-radius: 11px; }
.p-row.small .pr-t b { font-size: 16px; }
.list .lt-item > .lt-more { inset-inline-end: 6px; width: 40px; height: 40px; background: color-mix(in srgb, var(--surface) 85%, transparent); box-shadow: 0 0 0 1px var(--line) inset; }
.selecting .lt-item .p-row { padding-inline-start: 46px; }
.lt-item.sel > .p-row { background: var(--tint); box-shadow: 0 0 0 2px var(--accent) inset; }
.see-all { margin-inline-start: auto; color: var(--accent2); font-weight: 600; text-decoration: none; font-size: 14.5px; padding: 8px 10px; border-radius: 999px; }
.see-all:hover { background: var(--tint); }
#h-recent .h-head { margin-top: 32px; }

/* ---- the account menu, and its pages ---- */
.acc-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.acc-id { display: flex; flex-direction: column; min-width: 0; }
.acc-id .muted { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-list.menu { margin-top: 16px; }
.s-list.menu .s-item { min-height: 52px; padding-block: 6px; color: var(--ink); }
.s-item svg.chev { box-sizing: border-box; padding: 0; background: none; width: 18px; height: 18px; color: var(--faint); }
[dir="rtl"] .s-item svg.chev, [dir="rtl"] .ic.flip { transform: scaleX(-1); }
.s-item.static { cursor: default; }
.s-item.static:hover { background: transparent; }
.s-item .count { font-style: normal; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #ff4d4f; color: #fff; font-size: 12.5px; font-weight: 600; display: inline-grid; place-items: center; }
.s-item .dot { width: 9px; height: 9px; border-radius: 50%; background: #ff4d4f; }
.seg.mini { padding: 3px; }
.seg.mini button { min-height: 34px; padding: 0 10px; }
.seg.mini button svg.ic { display: inline; width: 17px; height: 17px; }
.acc-sub { animation: slideIn 260ms var(--enter); }
[dir="rtl"] .acc-sub { animation-name: slideInRtl; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px) } }
@keyframes slideInRtl { from { opacity: 0; transform: translateX(-24px) } }
.acc-sub .s-head h3 { flex: 1; outline: none; }
.sub-lead { margin: 14px 4px 4px; color: var(--muted); font-size: 15px; }
.sub-fine { margin: 6px 4px 0; }
.sub-actions { margin-top: 12px; }
.sub-actions .btn { min-width: 0; white-space: normal; text-align: center; line-height: 1.2; }
.sub-notices { display: grid; gap: 8px; margin-top: 14px; }
.sub-notices .dm-notice svg.ic { color: var(--accent2); }
.sub-empty { display: grid; justify-items: center; gap: 6px; padding: 40px 12px; color: var(--muted); text-align: center; }
.sub-empty svg.ic { width: 30px; height: 30px; color: var(--faint); }
.news { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.news li { display: grid; gap: 2px; padding: 12px 10px; border-radius: 16px; }
.news li + li { border-top: 1px solid var(--line); border-radius: 0; }
.news time { color: var(--faint); font-size: 12.5px; font-weight: 600; }
.news b { font-weight: 600; }
.news span { color: var(--muted); font-size: 14.5px; }

/* ---- backgrounds (Account › Appearance): BitPull's aurora, ocean, dawn or none; theme.js sets data-bg ---- */
:root {
  --bg-aurora:
    radial-gradient(38% 46% at 16% 66%, #2f6bff 0%, #2f6bffb0 30%, #2f6bff00 72%),
    radial-gradient(34% 44% at 42% 84%, #22d3ee 0%, #22d3eeb0 30%, #22d3ee00 72%),
    radial-gradient(30% 40% at 64% 64%, #7c5cff 0%, #7c5cffa0 30%, #7c5cff00 72%),
    radial-gradient(28% 34% at 80% 90%, #2ee6d6 0%, #2ee6d6a0 30%, #2ee6d600 72%),
    radial-gradient(16% 20% at 30% 100%, #ffb38a 0%, #ffb38a00 72%),
    radial-gradient(44% 44% at 94% 66%, #3b2bd9 0%, #3b2bd900 72%),
    radial-gradient(40% 44% at 2% 96%, #3b2bd9 0%, #3b2bd900 72%);
  --bg-ocean:
    radial-gradient(42% 50% at 14% 74%, #0b3b8f 0%, #0b3b8fb0 30%, #0b3b8f00 72%),
    radial-gradient(36% 46% at 44% 86%, #0e7490 0%, #0e7490b0 30%, #0e749000 72%),
    radial-gradient(32% 42% at 70% 70%, #14b8a6 0%, #14b8a6a0 30%, #14b8a600 72%),
    radial-gradient(30% 36% at 88% 92%, #1d4ed8 0%, #1d4ed8a0 30%, #1d4ed800 72%),
    radial-gradient(46% 46% at 96% 60%, #0f2a6b 0%, #0f2a6b00 72%);
  --bg-dawn:
    radial-gradient(40% 48% at 14% 72%, #22d3ee 0%, #22d3eeb0 30%, #22d3ee00 72%),
    radial-gradient(34% 44% at 42% 88%, #7dd3fc 0%, #7dd3fcb0 30%, #7dd3fc00 72%),
    radial-gradient(34% 42% at 68% 72%, #fdba74 0%, #fdba74b0 30%, #fdba7400 72%),
    radial-gradient(30% 38% at 88% 90%, #fda4af 0%, #fda4afa0 30%, #fda4af00 72%),
    radial-gradient(40% 40% at 96% 60%, #fcd34d 0%, #fcd34d00 72%);
  --page-bg: var(--bg-aurora);
}
:root[data-bg="ocean"] { --page-bg: var(--bg-ocean); }
:root[data-bg="dawn"] { --page-bg: var(--bg-dawn); }
.welcome::before, .home::before { background: var(--page-bg); }
:root[data-bg="none"] .home::before, :root[data-bg="none"] .welcome::before { display: none; }

.pick-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 4px; }
.pick-card { display: flex; flex-direction: column; gap: 8px; align-items: stretch; padding: 8px 8px 10px; border: 0; border-radius: 18px; background: var(--surface2); font-weight: 600; font-size: 14px; text-align: center; transition: box-shadow 150ms, background 150ms; }
.pick-card:hover { background: var(--surface3); }
.pick-card[aria-checked="true"] { background: var(--tint); box-shadow: 0 0 0 2px var(--accent) inset; }
.th-prev, .bg-prev { display: grid; place-items: center; height: 64px; border-radius: 12px; overflow: hidden; position: relative; box-shadow: 0 0 0 1px var(--line); }
.th-auto { background: linear-gradient(90deg, #f7f8fb 50%, #070b18 50%); color: #5b8cff; }
.th-light { background: #f7f8fb; color: #1f56e0; }
.th-dark { background: #070b18; color: #8aaeff; }
.th-prev svg.ic { width: 24px; height: 24px; padding: 6px; box-sizing: content-box; border-radius: 50%; background: color-mix(in srgb, #fff 70%, transparent); color: #1f56e0; }
.bg-prev { background: var(--bg); }
.bg-prev::before { content: ""; position: absolute; inset: -20% -30% -40%; filter: blur(10px) saturate(125%); opacity: var(--aurora-o); }
.bg-prev[data-bgp="aurora"]::before { background: var(--bg-aurora); }
.bg-prev[data-bgp="ocean"]::before { background: var(--bg-ocean); }
.bg-prev[data-bgp="dawn"]::before { background: var(--bg-dawn); }
.bg-prev[data-bgp="none"]::before { display: none; }

/* ---- account settings: a full screen ---- */
.sheet.full { top: 0; max-height: none; border-radius: 0; padding-top: calc(10px + var(--sat)); animation: up 300ms var(--enter); }
@media (min-width: 700px) { .sheet.full { top: 50%; width: 560px; height: min(760px, 92dvh); border-radius: 28px; padding-top: 16px; } }
.st-search { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; padding: 0 14px; height: 48px; border-radius: 999px; background: var(--surface2); color: var(--muted); }
.st-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 16px; color: var(--ink); }
.st-group { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 18px 0 2px; padding: 8px 10px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border-radius: 12px; }
.st-group:hover { color: var(--ink); }
.st-group svg.chev { width: 16px; height: 16px; transform: rotate(90deg); transition: transform 150ms; }
.st-group[aria-expanded="false"] svg.chev { transform: none; }
[dir="rtl"] .st-group[aria-expanded="false"] svg.chev { transform: scaleX(-1); }
.st-ws { margin-top: 22px; }
.st-text, .st-input { width: 100%; border: 1px solid var(--line2); border-radius: 16px; background: var(--surface2); color: var(--ink); padding: 12px 14px; font-size: 16px; }
.st-text { min-height: 180px; resize: vertical; margin-top: 10px; }
.st-input { height: 48px; border-radius: 999px; margin-top: 10px; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.st-row .st-input { margin-top: 0; flex: 1; }
.st-close a { color: var(--bad); font-weight: 600; }
.s-item b.mem { font-weight: 500; overflow-wrap: anywhere; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.code-line { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--surface2); }
.code-line code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 14px; overflow-x: auto; white-space: nowrap; }

/* ---- shared workspaces (workspaces.js, 2026-12-05): the space's settings sheet ---------------------------------- */
.wsp .muted.small { margin: 6px 2px 0; }
.wsp-members { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.wsp-member { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 6px; border-radius: 16px; }
.wsp-member:hover { background: var(--surface2); }
.wsp-who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wsp-who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsp-who small { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.wsp-role { flex: none; height: 36px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 999px; background: var(--surface2); color: var(--ink); font-size: 14px; font-weight: 600; }
.icon-btn.danger { color: var(--bad); }
.wsp-invite { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.wsp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wsp-row .wsp-input { flex: 1; min-width: 180px; }
.wsp-input { height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--surface2); color: var(--ink); font-size: 15px; min-width: 0; }
.wsp-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.wsp-link { display: flex; gap: 8px; align-items: center; }
.wsp-link .wsp-input { flex: 1; font-family: var(--mono); font-size: 13px; }
.wsp-pending { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 12px; border-radius: 14px; background: var(--surface2); color: var(--muted); font-size: 13.5px; }
.wsp-credits { margin-top: 8px; }
.wsp-balance { display: flex; align-items: baseline; gap: 8px; padding: 14px 16px; border-radius: 18px; background: var(--grad-soft), var(--surface2); }
.wsp-balance b { font-size: 28px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pop-item .av.small.ws-av { background: linear-gradient(135deg, var(--c-aqua, #22d3ee), var(--accent, #2f6bff)); }

/* ---- layout guards (2026-12-05): long names, words and links never push a row or a screen past the edge ---------- */
/* Grid and flex children keep their min-content width unless told otherwise: a long name then widened the whole row. */
.p-body { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .p-body { grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); } }
.p-body.chat-only { grid-template-columns: minmax(0, 1fr); }
.lt-item { grid-template-columns: minmax(0, 1fr); }
.lt-item > * { min-width: 0; }
.pr-t, .ri-t { flex: 1; }
/* What people and the AI write: long words and addresses wrap inside the bubble. */
.msg { min-width: 0; }
.msg.me, .msg.ai .txt, .md, .md p, .md li, .talk-said, .live-url, .risks li, .dm-notice, .news span, .sub-lead { overflow-wrap: anywhere; }
.md pre, .md table { max-width: 100%; }
.md img, .msg img { max-width: 100%; height: auto; }
.msg.ai .who { min-width: 0; }
.msg.ai .who > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step { max-width: 100%; overflow-wrap: anywhere; border-radius: 12px; }
.sugs .chip { max-width: 100%; overflow-wrap: anywhere; }
/* Choosing several: on a phone the bar fits the screen; Delete keeps only its icon there. */
.selbar { max-width: calc(100vw - 20px - var(--sal) - var(--sar)); }
.selbar .btn { min-width: 0; flex-shrink: 1; }
.selbar .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .selbar { padding-inline-start: 14px; gap: 6px; } #sel-delete span { display: none; } #sel-delete { padding: 0 12px; } }
/* Toasts: a long message wraps (as a rounded card) instead of running out of its pill. */
#toast { overflow-wrap: anywhere; width: max-content; }
/* The preview's device list: its whole name when there is no page list beside it. */
#pv-page[hidden] + .pv-device { max-width: 100%; }
.st-search input { align-self: stretch; }
/* Names in a bar end with "…" (a flex box would just cut them). */
.p-name { display: block; line-height: 28px; }
/* A sheet's title: a long name (a project's, a file's) takes at most two lines and never pushes the close button out. */
.s-head h3 { min-width: 0; overflow-wrap: anywhere; }
#mo-title, #si-title, #sf-title, #d-title, #st-title, #a-sub-title, #st-sub-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Buttons side by side: a long word (German, Russian…) wraps inside its button instead of widening the row. */
.row2 > *, .amounts > * { min-width: 0; }
.row2 .btn { white-space: normal; line-height: 1.2; text-align: center; overflow-wrap: break-word; }
/* Open · Copy · Share: each as wide as its word; on a narrow screen they go on two lines rather than cut a word. */
.row3 { display: flex; flex-wrap: wrap; }
.row3 > .btn { flex: 1 1 auto; }
/* Centred with left: 50%, these shrank to half the screen: their own width, up to the screen's. */
.new-fab { white-space: nowrap; max-width: calc(100vw - 24px); }
.selbar { width: max-content; }
/* A name in another script (Arabic in an Italian list, or the reverse) starts on its own side and is cut at its end. */
.pr-t b, .ri-t b, .p-name, .ws-pill .ws-name, .card .t, .wsp-who b { unicode-bidi: plaintext; text-align: match-parent; }
/* The room kept for the round ⋯ button is on the button's side, also right to left (it overlapped the name in Arabic). */
.p-row { padding: 8px; padding-inline-end: 52px; }
.p-row.small { padding-inline-end: 8px; }
.acc-id .muted { unicode-bidi: plaintext; text-align: match-parent; }
/* Code reads left to right also on an Arabic page ("body{}" showed as "{}body"). */
.md pre, .md code, #fl-text, .fl-edit pre, .fl-edit textarea, .risks code, .dm-rec code { direction: ltr; unicode-bidi: isolate; }
.md pre, #fl-text, .fl-edit pre, .fl-edit textarea { text-align: left; }

/* Touch targets at least ~40px tall (layout review 2026-12-05): the voice speed slider and checkboxes in sheets. */
.v-rate input[type="range"] { min-height: 40px; }
.sheet input[type="checkbox"], .pt-sheet input[type="checkbox"] { width: 24px; height: 24px; margin: 8px; }

/* ---- iPhone zooms into a field whose text is under 16px (2026-12-06): on touch screens and small windows every field
   is at least 16px, in every sheet and tool of /app (zooming by hand stays allowed). The code editor (codeview.js)
   copies the textarea's size to its coloured copy, so both stay aligned. Larger fields keep their size. ---- */
@media (pointer: coarse), (max-width: 760px) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]), select, textarea { font-size: 16px !important; }
  .composer textarea { font-size: 17px !important; }
  .composer.big textarea { font-size: 17.5px !important; }
  .p-chat .composer textarea { font-size: 16px !important; }
}

/* Composer row (2026-12-06, owner's phone screenshot: the send button went past the screen edge once the
   connector button joined the row). The model chip takes the space that is left and is cut with "…";
   the round buttons and Send never shrink. */
.c-row > * { flex-shrink: 0; }
.c-row > .chip-btn:not(.stop-send) { flex: 0 1 auto; min-width: 0; max-width: none; }
.c-row > .chip-btn:not(.stop-send) span { min-width: 0; }
@media (max-width: 430px) {
  .c-row { gap: 4px; }
  .c-row .icon-btn { width: 40px; min-width: 40px; }
}
