/* opendev — tokens in DESIGN.md. Phone first; desktop at the bottom. */
@font-face { font-family: "Bricolage Grotesque"; src: url(/fonts/bricolage-latin.woff2) format("woff2"); font-weight: 500 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Instrument Sans"; src: url(/fonts/instrument-sans-latin.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; src: url(/fonts/instrument-sans-latin-ext.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Noto Sans Hebrew"; src: url(/fonts/noto-sans-hebrew-hebrew.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/plex-mono-latin.woff2) format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #ffffff; --surface: #f4f5f6; --surface-2: #e9ebed; --line: #dde0e3;
  --text: #14171a; --text-2: #474e55; --muted: #636b73; --faint: #a3aab1;
  --accent: #c2410c; --accent-text: #ffffff; --accent-wash: #fdeee7;
  --ok: #1d7a52; --danger: #b42318; --on-danger: #ffffff; --code-bg: #f4f5f6;
  --sans: "Instrument Sans", "Noto Sans Hebrew", "Helvetica Neue", Arial, sans-serif;
  --display: "Bricolage Grotesque", "Instrument Sans", "Noto Sans Hebrew", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-sheet: 16px; --r-card: 12px; --r-btn: 10px; --r-chip: 6px;
  --fast: 160ms ease-out; --slide: 220ms ease-out;
  --float: 0 8px 32px rgb(0 0 0 / .18);
  --head-h: 56px; --seg-h: 52px;
  --win-edge: #d3d7db; --win-hi: transparent;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1012; --surface: #171a1d; --surface-2: #212529; --line: #2b3035;
    --text: #eceef0; --text-2: #b5bcc3; --muted: #8a929a; --faint: #4d545b;
    --accent: #ff8f66; --accent-text: #1a0b05; --accent-wash: #2a1810;
    --ok: #4cc38a; --danger: #f0705f; --on-danger: #0e1012; --code-bg: #090a0b;
    --float: 0 8px 32px rgb(0 0 0 / .5);
    --win-edge: #3b4249; --win-hi: rgb(255 255 255 / .05);
    color-scheme: dark;
  }
}
/* Settings > Theme (desktop, 2026-12-01): a chosen theme wins over the system's */
:root[data-theme="dark"] {
    --bg: #0e1012; --surface: #171a1d; --surface-2: #212529; --line: #2b3035;
    --text: #eceef0; --text-2: #b5bcc3; --muted: #8a929a; --faint: #4d545b;
    --accent: #ff8f66; --accent-text: #1a0b05; --accent-wash: #2a1810;
    --ok: #4cc38a; --danger: #f0705f; --on-danger: #0e1012; --code-bg: #090a0b;
    --float: 0 8px 32px rgb(0 0 0 / .5);
    --win-edge: #3b4249; --win-hi: rgb(255 255 255 / .05);
    color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.45 var(--sans); -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- header ---- */
.head { position: sticky; top: 0; z-index: 20; height: calc(var(--head-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--s4) 0; display: flex; align-items: center; gap: var(--s3); background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: var(--s2); text-decoration: none; min-height: 44px; }
.brand img { width: 28px; height: 28px; }
.brand b { font: 600 19px/1 var(--display); letter-spacing: -0.01em; }
.head .grow { flex: 1; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4); border-radius: var(--r-btn); border: 1px solid transparent; background: var(--accent); color: var(--accent-text); font-weight: 600; font-size: 15px; text-decoration: none; transition: background-color var(--fast), opacity var(--fast); }
.btn:active { opacity: .85; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:active { background: var(--surface); }
.btn.quiet { background: transparent; color: var(--text-2); border-color: transparent; padding: 0 var(--s3); }
.btn.danger { background: var(--danger); color: var(--on-danger); }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--r-btn); background: transparent; color: var(--text-2); }
.icon-btn:active { background: var(--surface); }
.icon-btn svg { width: 22px; height: 22px; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; flex: none; }
@media (prefers-reduced-motion: no-preference) { .spin { animation: spin .8s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- status dot ---- */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); }
.dot.work { background: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .dot.work { animation: pulse 1.2s ease-out infinite; } }
@keyframes pulse { 50% { opacity: .35; } }

/* ---- banner (busy / resting / paused) ---- */
.banner { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r-card); background: var(--accent-wash); color: var(--text); font-size: 15px; }
.banner .dot { margin-top: 7px; background: var(--accent); }
.banner p { margin: 0; }
.banner small { display: block; color: var(--text-2); font-size: 13px; margin-top: 2px; }

/* =================== landing =================== */
.land { max-width: 1120px; margin: 0 auto; padding: var(--s5) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom)); display: grid; gap: var(--s6); }
.land-hero { display: grid; gap: var(--s5); align-content: start; }
.land h1 { margin: 0; font: 600 34px/1.1 var(--display); letter-spacing: -0.02em; text-wrap: balance; }
.land .lede { margin: 0; color: var(--text-2); font-size: 17px; max-width: 34ch; }
.start { width: 100%; min-height: 64px; border-radius: var(--r-sheet); font-size: 19px; gap: var(--s3); }
.start svg { width: 24px; height: 24px; }
.ideas-h { margin: 0 0 var(--s2); font-size: 15px; font-weight: 600; color: var(--text-2); display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.seemade { font-weight: 500; font-size: 14px; color: var(--accent); min-height: 32px; display: inline-flex; align-items: center; }
.ideas { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.idea { width: 100%; min-height: 64px; display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: var(--r-card); border: 1px solid var(--line); background: var(--bg); text-align: start; font-size: 15px; font-weight: 500; line-height: 1.25; transition: background-color var(--fast), border-color var(--fast); }
.idea:disabled:not([aria-busy="true"]) { opacity: .5; cursor: default; }
.idea:active, .idea[aria-busy="true"] { background: var(--accent-wash); border-color: var(--accent); }
.idea .glyph { width: 36px; height: 36px; flex: none; border-radius: var(--r-btn); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); }
.idea .glyph svg { width: 20px; height: 20px; }
/* six ideas: an even 2 x 3 grid on a phone, 3 x 2 on desktop (no full-width last item) */
.fine { margin: 0; color: var(--muted); font-size: 13px; }
.fine a { color: var(--text-2); }
.footlinks { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.footlinks a { min-height: 32px; display: inline-flex; align-items: center; }
.again { border: 1px solid var(--accent); display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-card); background: var(--surface); text-decoration: none; min-height: 56px; }
.again b { font-weight: 600; }
.again span { color: var(--text-2); font-size: 13px; display: block; }
.again .grow { flex: 1; min-width: 0; }

/* the looping video, with a drawn stand-in until the video exists */
.film { margin: 0; display: grid; gap: var(--s2); width: min(100%, 320px); justify-self: center; }
.film .frame { position: relative; border-radius: var(--r-sheet); overflow: hidden; background: var(--surface); aspect-ratio: 780 / 1688; border: 1px solid var(--line); }
.film video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--surface); }
.film figcaption { font-size: 13px; color: var(--muted); text-align: center; }
.mock { position: absolute; inset: 0; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3); }
.mock .mbar { height: 28px; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.mock .mbar i { width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--text); position: relative; }
.mock .mb { align-self: flex-end; max-width: 75%; background: var(--accent); color: var(--accent-text); border-radius: var(--r-card); padding: 6px 10px; font-size: 12px; }
.mock .ms { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.mock .game { width: 100%; aspect-ratio: 1; border-radius: var(--r-card); background: var(--bg); border: 1px solid var(--line); display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(12, 1fr); gap: 2px; padding: 8px; }
.mock .game i { border-radius: 2px; }
.mock .game i.s { background: var(--ok); }
.mock .game i.f { background: var(--accent); border-radius: 50%; }

/* =================== computer screen =================== */
.shell-now { position: fixed; inset: 0; z-index: 60; background: var(--bg); }
.app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.app .head { position: relative; flex: none; }
.who { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3); border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--bg); font-size: 14px; font-weight: 500; max-width: 60vw; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { flex: none; display: flex; gap: 2px; margin: var(--s2) var(--s4); padding: 3px; border-radius: var(--r-btn); background: var(--surface-2); }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background-color var(--fast), color var(--fast); position: relative; }
.seg button[aria-selected="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.seg .news { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.panes { flex: 1; min-height: 0; display: flex; position: relative; }
.pane { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pane[hidden] { display: none !important; }

/* ---- chat ---- */
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s3) var(--s4) var(--s4); display: flex; flex-direction: column; gap: var(--s3); overscroll-behavior: contain; }
.msgs > * { flex: none; } /* a long chat must not squash cards (the mini preview has overflow: hidden) */
.msg { max-width: 100%; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; max-width: 86%; background: var(--accent); color: var(--accent-text); padding: 10px 14px; border-radius: var(--r-card) var(--r-card) 4px var(--r-card); white-space: pre-wrap; font-size: 15px; }
.msg.user[data-pending="1"] { opacity: .75; }
.msg.user .state { display: block; font-size: 12px; opacity: .85; margin-top: 2px; }
.msg.user.failed { background: var(--surface); color: var(--text); border: 1px solid var(--danger); }
.msg.agent { align-self: stretch; font-size: 15px; line-height: 1.5; }
.msg.agent > :first-child { margin-top: 0; } .msg.agent > :last-child { margin-bottom: 0; }
.msg.agent p { margin: 0 0 var(--s2); }
.msg.agent ul, .msg.agent ol { margin: 0 0 var(--s2); padding-inline-start: 22px; }
.msg.agent code { font: 13px/1.4 var(--mono); background: var(--code-bg); padding: 1px 4px; border-radius: 4px; }
.msg.agent pre { background: var(--code-bg); border-radius: var(--r-chip); padding: var(--s3); font: 13px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; } /* od3 M2: wrap, no hidden sideways scroll on a phone */
.msg.agent pre code { background: none; padding: 0; }
.msg.agent a { color: var(--accent); }
.msg.note { align-self: center; color: var(--muted); font-size: 13px; text-align: center; max-width: 90%; }
.steps { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.step { display: flex; align-items: center; gap: var(--s2); min-height: 28px; color: var(--text-2); font-size: 13px; }
.step::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; margin-inline: 1px 3px; }
.step details { min-width: 0; }
.step summary { list-style: none; cursor: pointer; }
.step summary::-webkit-details-marker { display: none; }
.step pre { margin: var(--s1) 0 0; white-space: pre-wrap; font: 12px/1.4 var(--mono); color: var(--muted); max-height: 200px; overflow: auto; }
.steps.fold > .step:not(:nth-last-child(-n+3)) { display: none; }
.morebtn { align-self: flex-start; min-height: 32px; border: 0; background: none; color: var(--muted); font-size: 13px; padding: 0 0 0 16px; text-decoration: underline; }
.choices { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s2); }
.choice { min-height: 44px; padding: var(--s2) var(--s3); border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--bg); text-align: start; font-size: 15px; transition: background-color var(--fast), border-color var(--fast); }
.choice:active { background: var(--accent-wash); border-color: var(--accent); }
.choices.answered .choice { opacity: .5; pointer-events: none; }
.working { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-card); background: var(--surface); min-height: 48px; }
.working .what { flex: 1; min-width: 0; font-size: 14px; color: var(--text); }
.working .what small { display: block; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.seecard { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s2) var(--s2) var(--s3); border-radius: var(--r-card); border: 1px solid var(--line); }
.seecard p { margin: 0; flex: 1; font-size: 14px; }
.empty { margin: auto; text-align: center; color: var(--text-2); max-width: 30ch; display: grid; gap: var(--s3); justify-items: center; padding: var(--s5) 0; }
.empty h2 { margin: 0; font: 600 20px/1.2 var(--display); color: var(--text); }
.empty p { margin: 0; }
.composer { flex: none; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s2) var(--s4) calc(var(--s2) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.composer .row { display: flex; gap: var(--s2); align-items: flex-end; }
.composer textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 160px; resize: none; border: 1px solid var(--line); border-radius: var(--r-btn); padding: 10px 12px; font-size: 16px; line-height: 1.4; background: var(--bg); }
.composer textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.composer textarea:disabled { background: var(--surface); }
.composer .hint { margin: 0; font-size: 13px; color: var(--muted); }
.composer .hint.warn { color: var(--text); background: var(--accent-wash); padding: var(--s2) var(--s3); border-radius: var(--r-btn); }
.attach-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: var(--s2); max-width: 100%; min-height: 32px; padding-inline-start: var(--s3); border-radius: var(--r-chip); background: var(--surface); font-size: 13px; }
.attach-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip button { width: 32px; height: 32px; border: 0; background: none; color: var(--muted); font-size: 18px; }
.card { padding: var(--s4); border-radius: var(--r-card); border: 1px solid var(--line); display: grid; gap: var(--s3); }
.card p { margin: 0; }
.card h3 { margin: 0; font-size: 17px; }

/* ---- the live mini preview in the chat (phone) ---- */
.minipv { position: relative; align-self: stretch; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; background: var(--surface); }
.minipv-frame { height: 240px; overflow: hidden; position: relative; background: #fff; }
.minipv-frame iframe { width: 200%; height: 200%; border: 0; transform: scale(.5); transform-origin: 0 0; pointer-events: none; }
.minipv-bar { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s3); min-height: 60px; border-top: 1px solid var(--line); font-size: 14px; }
.minipv-bar .t { flex: 1; }
.minipv-bar .minipv-play { min-height: 44px; padding: 0 var(--s5); }
.minipv-open { position: absolute; inset: 0; z-index: 1; border: 0; background: transparent; }
/* ---- preview ---- */
.bar { flex: none; display: flex; align-items: center; gap: var(--s1); padding: 0 var(--s2) 0 var(--s4); min-height: 48px; border-bottom: 1px solid var(--line); }
.bar .title { flex: 1; min-width: 0; font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#prevwrap { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
#prevbody { flex: 1; min-height: 0; position: relative; display: flex; background: var(--surface); }
#prevbody iframe { flex: 1; width: 100%; border: 0; background: #fff; }
#prevbody iframe.loadingframe { position: absolute; inset: 0; visibility: hidden; }
.prevempty { margin: auto; padding: var(--s5); }
.updating { position: absolute; top: var(--s3); left: 50%; transform: translateX(-50%); z-index: 3; display: inline-flex; align-items: center; gap: var(--s2); padding: 6px 12px; border-radius: var(--r-btn); background: var(--text); color: var(--bg); font-size: 13px; box-shadow: var(--float); pointer-events: none; }

/* ---- files ---- */
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; font-size: 14px; }
.crumbs button { min-height: 40px; border: 0; background: none; padding: 0 6px; color: var(--text-2); border-radius: 8px; }
.crumbs button:last-child { color: var(--text); font-weight: 600; }
.crumbs i { color: var(--faint); font-style: normal; }
.files { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 0 0 calc(var(--s7) + env(safe-area-inset-bottom)); list-style: none; }
.frow { position: relative; display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: 0 var(--s1) 0 var(--s4); border-bottom: 1px solid var(--line); }
.frow:active { background: var(--surface); }
.frow .open { position: static; flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s3); border: 0; background: none; text-align: start; padding: var(--s2) 0; min-height: 56px; }
.frow .open::after { content: ""; position: absolute; inset: 0; }
.frow .ficon { width: 32px; height: 32px; border-radius: 8px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex: none; }
.frow .ficon svg { width: 18px; height: 18px; }
.frow.dir .ficon { background: var(--accent-wash); color: var(--accent); }
.frow .fname { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .fmeta { display: block; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.frow .fbody { min-width: 0; }
.frow .more { position: relative; z-index: 1; }
.factions { flex: none; display: flex; gap: var(--s2); padding: var(--s2) var(--s4) calc(var(--s2) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.factions .btn { flex: 1; padding: 0 var(--s2); }
.viewer { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.viewer textarea { flex: 1; min-height: 0; width: 100%; border: 0; resize: none; padding: var(--s3) var(--s4); font: 13px/1.5 var(--mono); background: var(--code-bg); color: var(--text); tab-size: 2; white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; }
.viewer textarea:focus { outline: none; }
.viewer .imgbox { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: var(--surface); padding: var(--s4); overflow: auto; }
.viewer .imgbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-chip); }
.saved { font-size: 13px; color: var(--muted); padding: 0 var(--s2); white-space: nowrap; }
.saved.ok { color: var(--ok); }

/* ---- terminal ---- */
#termwrap { flex: 1; min-height: 0; display: flex; background: #1e1e1e; }
#termwrap { position: relative; }
#termwrap iframe { flex: 1; border: 0; }
.termstate { position: absolute; inset: 0; display: flex; background: var(--bg); padding: var(--s4); }

/* ---- bottom sheet ---- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / .36); opacity: 0; transition: opacity var(--slide); }
.scrim.on { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 88dvh; overflow-y: auto; background: var(--bg); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--float); padding: var(--s2) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform var(--slide); }
.sheet.on { transform: none; }
@media (prefers-reduced-motion: reduce) { .sheet, .scrim { transition: none; } }
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto var(--s3); }
.sheet h2 { margin: 0 0 var(--s1); font: 600 20px/1.2 var(--display); }
.sheet .sub { margin: 0 0 var(--s3); color: var(--text-2); font-size: 14px; }
.sheet .group { margin: var(--s2) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.sheet .opt { width: 100%; display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: var(--s2) 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: start; }
.sheet .opt b { display: block; font-weight: 600; font-size: 15px; }
.sheet .opt span { display: block; color: var(--text-2); font-size: 13px; }
.sheet .opt.danger b { color: var(--danger); }
.sheet .opt .grow { flex: 1; min-width: 0; }
.sheet .opt .val { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.sheet .field { display: grid; gap: var(--s1); margin: var(--s3) 0; }
.sheet .field input { min-height: 48px; border: 1px solid var(--line); border-radius: var(--r-btn); padding: 0 var(--s3); font-size: 16px; background: var(--bg); width: 100%; }
.sheet .field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.sheet .acts { display: flex; gap: var(--s2); margin-top: var(--s3); }
.sheet .acts .btn { flex: 1; }
.keylink { width: 100%; min-height: 56px; display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-btn); background: var(--surface); color: var(--text); font: 13px/1.4 var(--mono); text-align: start; }
.keylink span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.keylink svg { width: 20px; height: 20px; flex: none; color: var(--text-2); }
.sharebox { min-height: 24px; }
.bar .btn.ghost { padding: 0 var(--s3); font-size: 14px; }
.err { color: var(--danger); font-size: 13px; margin: var(--s2) 0 0; }

/* ---- toast ---- */
.sheet-open .toast { bottom: auto; top: calc(env(safe-area-inset-top) + 12px); }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; max-width: calc(100% - 32px); padding: var(--s2) var(--s4); border-radius: var(--r-btn); background: var(--text); color: var(--bg); font-size: 14px; box-shadow: var(--float); }

/* ---- Build mode / Mark (vendored linbox build.js + mark.js; their class names, our tokens) ---- */
.markov { position: absolute; inset: 0; z-index: 4; background: var(--bg); }
.markov canvas { position: absolute; touch-action: none; cursor: crosshair; }
.markhint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: var(--r-btn); background: var(--text); color: var(--bg); font-size: 13px; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.markbar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.markbar .btn[data-a="use"] { margin-left: auto; }
#prevwrap.building { position: fixed; inset: 0; z-index: 25; height: 100dvh; background: var(--bg); display: flex !important; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
#prevwrap.building #prevbody { padding-bottom: env(safe-area-inset-bottom); }
#prevwrap.building > .bar { display: none; }
.bld-ink { position: absolute; z-index: 3; touch-action: none; cursor: crosshair; }
.bld-ink.passive { pointer-events: none; }
.bld-flash { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 4; margin: 0; padding: 6px 12px; border-radius: var(--r-btn); background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 600; pointer-events: none; }
.bld-drawer { border-top: 1px solid var(--line); background: var(--bg); padding: 4px 12px calc(8px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 4px; }
#prevwrap.building .bld-drawer { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; border-radius: var(--r-sheet) var(--r-sheet) 0 0; border: 1px solid var(--line); border-bottom: 0; box-shadow: var(--float); }
.bld-head { display: flex; align-items: center; gap: 4px; }
.bld-peek { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 44px; min-width: 0; border: 0; background: transparent; color: var(--text-2); font-size: 13px; text-align: start; padding: 0; }
.bld-peek .bld-line { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bld-peek svg { width: 16px; height: 16px; flex: none; transition: transform var(--fast); }
.bld-peek[aria-expanded="true"] svg { transform: rotate(180deg); }
.bld-glyph { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.bld-drawer.bld-busy .bld-glyph { background: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .bld-drawer.bld-busy .bld-glyph { animation: pulse 1.2s ease-out infinite; } }
.bld-hide { flex: none; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 22px; }
.bld-log { max-height: 34dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }
.bld-msg { margin: 0; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.bld-msg.you { align-self: flex-end; max-width: 85%; background: var(--accent); color: var(--accent-text); border-radius: var(--r-card); padding: 8px 12px; }
.bld-msg.you.pending { opacity: .7; }
.bld-msg.working, .bld-msg.note { color: var(--text-2); font-size: 13px; }
.bld-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.bld-opts .bld-opt { min-height: 44px; text-align: start; }
.bld-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.bld-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; max-width: 200px; min-height: 32px; padding-inline-start: 4px; border: 1px solid var(--line); border-radius: var(--r-chip); background: var(--surface); font-size: 13px; }
.bld-chip b { flex: none; width: 20px; height: 20px; border-radius: 4px; background: var(--accent); color: var(--accent-text); font-size: 12px; line-height: 20px; text-align: center; }
.bld-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bld-chip img { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; flex: none; border: 1px solid var(--line); }
.bld-chip button { flex: none; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); font-size: 18px; }
.bld-chip .inkdot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--danger); flex: none; }
.bld-row { display: flex; align-items: flex-end; gap: 8px; }
.bld-row textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 120px; resize: none; border: 1px solid var(--line); border-radius: var(--r-btn); padding: 10px 12px; font-size: 16px; line-height: 1.4; background: var(--bg); }
.bld-row textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.bld-fab { position: absolute; z-index: 7; width: 52px; height: 52px; border-radius: var(--r-sheet); border: 0; background: var(--accent); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--float); touch-action: none; }
.bld-fab svg { width: 24px; height: 24px; }
.bld-fab.news::after { content: ""; position: absolute; top: 4px; inset-inline-end: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg); }
.bld-pill { position: absolute; bottom: 8px; inset-inline: 8px; z-index: 6; display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: var(--r-card); background: var(--bg); border: 1px solid var(--line); box-shadow: var(--float); font-size: 13px; color: var(--text-2); }
.bld-pill > span { flex: 1; min-width: 0; }
.bld-pill .btn { padding: 0 12px; font-size: 14px; }
.bld-note, .prevhint { position: absolute; top: 8px; inset-inline: 8px; z-index: 6; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px; box-shadow: var(--float); }
.bld-exit { position: absolute; top: calc(env(safe-area-inset-top) + 8px); inset-inline-end: 8px; z-index: 8; background: var(--text); color: var(--bg); box-shadow: var(--float); padding: 0 var(--s4); }
#prevwrap.fabdrag iframe, #prevwrap.fabdrag .bld-ink { pointer-events: none; }

.rightseg { display: none !important; flex: none; margin: var(--s2) var(--s4); }
/* =================== desktop =================== */
@media (min-width: 900px) {
  .land { grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s7); padding-top: var(--s7); align-items: start; }
  .land h1 { font-size: 48px; }
  .land .lede { font-size: 19px; }
  .start { max-width: 420px; }
  .ideas { grid-template-columns: 1fr 1fr 1fr; }
  .film { width: 280px; justify-self: end; }
}
@media (min-width: 1024px) {
  .app .seg { display: none; }
  .panes { gap: 0; }
  #pane-chat { flex: 0 0 440px; border-right: 1px solid var(--line); display: flex !important; }
  .rightseg { display: flex !important; }
  .msgs { padding-inline: var(--s5); }
}
.side { flex: 1; min-width: 0; display: flex; flex-direction: column; }
@media (max-width: 1023px) { .side { display: contents; } }

/* ================= Desktop (od2, 2026-12-01; DESIGN.md "Desktop") ================= */
.viewtoggle { min-height: 36px; padding: 0 var(--s3); margin-right: var(--s2); }
body.desk-on .app > .seg, body.desk-on .app > .panes { display: none; }
.desk { flex: 1; min-height: 0; position: relative; overflow: hidden; isolation: isolate; user-select: none; -webkit-user-select: none; }
.desk-wall, .wall-tile .desk-wall { position: absolute; inset: 0; z-index: -1; background: var(--bg); }
.desk-wall[data-wall="grid"] { background: radial-gradient(circle, var(--line) 1.2px, transparent 1.4px) 0 0 / 24px 24px, var(--bg); }
.desk-wall[data-wall="paper"] { background: var(--surface); }
.desk-wall[data-wall="ember"] { background: radial-gradient(120% 90% at 100% 100%, var(--accent-wash) 0%, transparent 60%), var(--bg); }
.desk-wall[data-wall="lines"] { background: repeating-linear-gradient(135deg, var(--line) 0 1px, transparent 1px 18px), var(--bg); }
.tile { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); color: var(--text); flex: none; }
.tile svg { width: 24px; height: 24px; }
.tile img { width: 28px; height: 28px; object-fit: contain; }
.tile .emoji { font-size: 24px; line-height: 1; }
/* desktop icons */
.desk-icons { position: absolute; inset: var(--s4) auto 92px var(--s4); display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 104px); grid-auto-columns: 88px; gap: var(--s2); align-content: start; }
.desk-icons.drop-on { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: var(--r-card); }
.desk-icon { all: unset; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 4px; border-radius: var(--r-card); cursor: default; width: 88px; }
.desk-icon .tile { width: 52px; height: 52px; background: var(--bg); }
.desk-icon .label { font-size: 13px; line-height: 1.25; text-align: center; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; padding: 1px 4px; border-radius: var(--r-chip); background: color-mix(in srgb, var(--bg) 80%, transparent); }
.desk-icon:hover .tile { border-color: var(--faint); }
.desk-icon.sel .tile, .desk-icon.sel .label { background: var(--accent-wash); }
.desk-icon:focus-visible { outline: 2px solid var(--accent); }
.desk-icon.fresh .tile { box-shadow: 0 0 0 3px var(--accent); }
/* windows */
.desk-wins { position: absolute; inset: 0; pointer-events: none; }
.win { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--float); overflow: hidden; pointer-events: auto; will-change: transform; min-width: 300px; min-height: 220px; transition: opacity 120ms ease-out, scale 120ms ease-out; user-select: text; -webkit-user-select: text; }
.win.opening { opacity: 0; scale: .98; }
.win[data-state="min"] { display: none; }
.win[data-state="max"], .win[data-snap] :is(.x) { border-radius: 0; }
.win[data-state="max"] { border-width: 0 0 1px; }
.win[data-snap="left"] { border-radius: 0 var(--r-card) var(--r-card) 0; border-left: 0; border-top: 0; }
.win[data-snap="right"] { border-radius: var(--r-card) 0 0 var(--r-card); border-right: 0; border-top: 0; }
.win[data-snap=""] { }
.win.dragging { transition: none; }
.desk-dragging .win iframe { pointer-events: none; } /* the pointer must not vanish into a frame mid-drag */
.win-bar { flex: none; display: flex; align-items: center; gap: var(--s2); height: 40px; padding: 0 4px 0 var(--s3); background: var(--surface); border-bottom: 1px solid var(--line); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.win.focused .win-bar { background: var(--bg); }
.win-glyph { display: grid; place-items: center; width: 20px; height: 20px; color: var(--muted); }
.win-glyph svg { width: 18px; height: 18px; }
.win-glyph img { width: 18px; height: 18px; }
.win-glyph .emoji { font-size: 16px; }
.win-name { font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.win.focused .win-name { color: var(--text); }
.win-btn { all: unset; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-chip); color: var(--muted); cursor: pointer; }
.win-btn svg { width: 16px; height: 16px; }
.win-btn:hover { background: var(--surface-2); color: var(--text); }
.win-btn[data-od="win-close"]:hover { background: var(--danger); color: var(--on-danger); }
.win-btn:focus-visible { outline: 2px solid var(--accent); }
.win-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.win-body > .pane { flex: 1; min-height: 0; display: flex; flex-direction: column; width: auto; max-width: none; border: 0; }
.win-resize { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 55%, var(--faint) 55% 62%, transparent 62% 72%, var(--faint) 72% 79%, transparent 79%); }
.win[data-state="max"] .win-resize, .win[data-snap="left"] .win-resize, .win[data-snap="right"] .win-resize { display: none; }
.desk-snap { position: absolute; top: 8px; bottom: 84px; width: calc(50% - 12px); border-radius: var(--r-card); background: color-mix(in srgb, var(--accent-wash) 70%, transparent); outline: 2px solid var(--accent); pointer-events: none; z-index: 9000; }
.desk-snap[data-side="left"] { left: 8px; } .desk-snap[data-side="right"] { right: 8px; }
.desk-snap[data-side="max"] { left: 8px; right: 8px; width: auto; }
/* apps inside windows */
.app-frame { flex: 1; width: 100%; border: 0; background: var(--bg); color-scheme: normal; }
.app-frame.loading { visibility: hidden; } /* no white flash in dark mode before the page paints (od3) */
.browser-strip { flex: none; display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s2) 6px var(--s3); border-bottom: 1px solid var(--line); background: var(--surface); }
.browser-url { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 6px var(--s3); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-btn); }
.btn.quiet { min-height: 34px; padding: 0 var(--s3); font-size: 13px; }
.imgbox { flex: 1; display: grid; place-items: center; overflow: auto; background: repeating-conic-gradient(var(--surface) 0 25%, var(--bg) 0 50%) 0 0 / 20px 20px; }
.imgbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ed-bar { flex: none; display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s2) 6px var(--s3); border-bottom: 1px solid var(--line); }
.ed-path { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-bar .saved { font-size: 13px; color: var(--muted); } .ed-bar .saved.ok { color: var(--ok); }
.ed-bar .btn { min-height: 34px; padding: 0 var(--s4); }
.ed-area { flex: 1; min-height: 0; position: relative; }
.hled { position: absolute; inset: 0; background: var(--code-bg); }
.hled pre, .hled textarea { position: absolute; inset: 0; margin: 0; padding: var(--s3) var(--s4); font: 14px/1.55 var(--mono); tab-size: 2; white-space: pre; overflow: auto; border: 0; box-sizing: border-box; }
.hled pre { color: var(--text); pointer-events: none; }
.hled textarea { color: transparent; caret-color: var(--text); background: transparent; resize: none; outline: none; -webkit-text-fill-color: transparent; }
.hled textarea::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); -webkit-text-fill-color: transparent; }
.hled i { font-style: normal; }
.hled .k { color: var(--accent); } .hled .s { color: var(--ok); } .hled .c { color: var(--muted); } .hled .n { color: var(--danger); } .hled .t { color: var(--text-2); font-weight: 600; } .hled .a { color: var(--text-2); }
.set, .about { padding: var(--s4); overflow: auto; display: flex; flex-direction: column; gap: var(--s5); user-select: none; }
.set-row { display: flex; flex-direction: column; gap: var(--s2); font-size: 13px; color: var(--muted); }
.set-row input { font: 16px var(--sans); color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-btn); padding: 10px var(--s3); }
.set-row input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.walls { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.wall-tile { all: unset; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); text-align: center; cursor: pointer; }
.wall-tile .desk-wall { position: relative; inset: auto; z-index: 0; display: block; height: 56px; border-radius: var(--r-btn); border: 1px solid var(--line); }
.wall-tile[aria-pressed="true"] .desk-wall { outline: 2px solid var(--accent); outline-offset: 2px; }
.wall-tile:focus-visible .desk-wall { outline: 2px solid var(--accent); }
.set-seg { margin: 0; } .set-seg button { flex: 1; }
.about-head { display: flex; align-items: center; gap: var(--s3); }
.about-head b { display: block; font: 600 17px var(--display); color: var(--text); }
.tile.big { width: 56px; height: 56px; } .tile.big svg { width: 30px; height: 30px; }
.about dl { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s4); margin: 0; font-size: 15px; }
.about dt { color: var(--muted); } .about dd { margin: 0; color: var(--text); font-variant-numeric: tabular-nums; }
.about code { font: 13px var(--mono); }
.about .acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
/* dock */
.desk-dock { position: absolute; left: 50%; bottom: 12px; translate: -50% 0; z-index: 8000; display: flex; align-items: center; gap: 6px; padding: var(--s2); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sheet); box-shadow: var(--float); max-width: calc(100% - 24px); overflow-x: auto; }
.dock-item { all: unset; position: relative; display: grid; place-items: center; padding-bottom: 6px; cursor: pointer; border-radius: var(--r-card); }
.dock-item .tile { transition: translate var(--fast); }
.dock-item:hover .tile { translate: 0 -2px; border-color: var(--faint); }
.dock-item:focus-visible .tile { outline: 2px solid var(--accent); }
.dock-item .run { position: absolute; bottom: 0; left: 50%; translate: -50% 0; width: 4px; height: 4px; border-radius: 2px; background: var(--accent); opacity: 0; transition: width var(--fast); }
.dock-item[data-running] .run { opacity: 1; }
.dock-item.active .run { width: 12px; }
.dock-sep { width: 1px; height: 28px; background: var(--line); margin: 0 2px 6px; }
/* launcher */
.launcher-scrim { position: fixed; inset: 0; z-index: 9500; background: rgb(0 0 0 / .25); display: grid; justify-items: center; align-items: start; padding: 12vh var(--s4) var(--s4); }
.launcher { width: min(560px, 100%); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sheet); box-shadow: var(--float); overflow: hidden; }
.launcher-field { display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s4); height: 52px; border-bottom: 1px solid var(--line); color: var(--muted); }
.launcher-field svg { width: 20px; height: 20px; flex: none; }
.launcher-field input { flex: 1; border: 0; outline: 0; background: transparent; font: 16px var(--sans); color: var(--text); height: 100%; }
.launcher-list { list-style: none; margin: 0; padding: var(--s2); max-height: 55vh; overflow: auto; }
.launcher-item { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: var(--s3); padding: 6px var(--s2); border-radius: var(--r-btn); cursor: pointer; }
.launcher-item .tile { width: 36px; height: 36px; } .launcher-item .tile svg { width: 20px; height: 20px; }
.launcher-item b { display: block; font-weight: 600; font-size: 15px; color: var(--text); }
.launcher-item span span { display: block; font-size: 13px; color: var(--muted); }
.launcher-item.on, .launcher-item:hover { background: var(--surface); }
/* phone home screen */
.desk.phone .desk-wins { inset: 0; }
.desk.phone .win { position: absolute; inset: 0; width: auto !important; height: auto !important; transform: none !important; border: 0; border-radius: 0; box-shadow: none; min-width: 0; min-height: 0; }
.desk.phone .win[hidden] { display: none; }
.desk.phone .win-bar { height: 52px; cursor: default; }
.desk.phone .win-btn[data-od="win-max"], .desk.phone .win-resize { display: none; }
.desk.phone .win-btn { width: 44px; height: 44px; }
.desk.phone .win-body { padding-bottom: 22px; }
.desk-home { position: absolute; inset: 0; display: flex; flex-direction: column; padding: var(--s5) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom)); gap: var(--s5); }
.home-top b { display: block; font: 600 22px var(--display); color: var(--text); }
.home-top span { font-size: 13px; color: var(--muted); }
.home-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4) var(--s2); align-content: start; flex: 1; }
.home-app { all: unset; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.home-app .tile { width: 60px; height: 60px; background: var(--bg); } .home-app .tile svg { width: 28px; height: 28px; } .home-app .tile .emoji { font-size: 28px; }
.home-app:active .tile { background: var(--surface-2); }
.home-app .label { font-size: 12px; text-align: center; color: var(--text); line-height: 1.2; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-ask { display: flex; gap: var(--s2); padding: var(--s2); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sheet); box-shadow: var(--float); }
.home-ask input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 16px var(--sans); color: var(--text); padding: 0 var(--s2); }
.desk-handle { position: absolute; left: 50%; bottom: 0; translate: -50% 0; z-index: 8500; all: unset; position: absolute; left: 50%; bottom: 0; translate: -50% 0; width: 140px; height: 22px; display: grid; place-items: center; cursor: pointer; touch-action: none; padding-bottom: env(safe-area-inset-bottom); z-index: 8500; }
.desk-handle[hidden] { display: none; }
.desk-handle i { width: 120px; height: 5px; border-radius: 3px; background: var(--faint); }
.switcher { position: absolute; inset: 0; z-index: 9200; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(8px); display: flex; flex-direction: column; justify-content: flex-end; gap: var(--s4); padding: var(--s5) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); }
.switcher-cards { display: flex; flex-direction: column; gap: var(--s2); overflow: auto; }
.switcher-card { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--float); }
.sw-open { all: unset; flex: 1; display: flex; align-items: center; gap: var(--s3); padding: var(--s3); cursor: pointer; min-width: 0; }
.sw-open b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-close { all: unset; display: grid; place-items: center; width: 48px; height: 48px; color: var(--muted); cursor: pointer; }
.sw-close svg { width: 18px; height: 18px; }
.sw-home { align-self: center; }
.files .drop-on, .frow.drop-on { background: var(--accent-wash); }
@media (prefers-reduced-motion: reduce) { .win { transition: none; } .win.opening { opacity: 1; scale: 1; } .dock-item .tile { transition: none; } }

.win-body > .pane, .win-body > #pane-chat { flex: 1 1 auto !important; border: 0; }
.win-bar .grow, .launcher-item .grow { flex: 1; min-width: 0; }
.win .seg.set-seg { display: flex; margin: 0; }
.viewtoggle { white-space: nowrap; flex: none; }
.head .who { min-width: 0; } #whotext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.win-home { display: none; }
.desk.phone .win-home { display: grid; margin-left: -8px; }
.desk.phone .win-btn[data-od="win-min"] { display: none; }
.win .ideas { grid-template-columns: 1fr 1fr; }
.win .start-empty, .win .card { max-width: 100%; }
.desk-icon .label { word-break: normal; overflow-wrap: anywhere; }

/* ---- desktop review 1 (2026-12-01) ---- */
.ed-area.hled { position: relative; inset: auto; } /* blocker: the editor filled its window over the Save bar */
.win { border-color: var(--win-edge); box-shadow: var(--float), inset 0 1px 0 var(--win-hi); }
.win.focused .win-bar { box-shadow: inset 0 2px 0 var(--accent); }
.win:not(.focused) .win-body { filter: saturate(.9); }
@media (pointer: coarse) { .win-btn { width: 44px; height: 44px; } .win-bar { height: 48px; } }
body.desk-on.desk-phone .head { display: none; }
.home-top { display: flex; align-items: flex-start; gap: var(--s3); }
.home-top .grow { flex: 1; min-width: 0; }
.home-state { all: unset; display: block; font-size: 13px; color: var(--muted); cursor: pointer; min-height: 24px; }
.home-chat { min-height: 40px; flex: none; }
.home-files { display: flex; flex-direction: column; gap: var(--s2); }
.home-files .home-grid { flex: none; }
.home-label { margin: 0; font-size: 13px; color: var(--muted); }
.desk-home { overflow-y: auto; }
.launcher-item { list-style: none; }

/* ---- desktop Files (review 1, desktop-grade Files) ---- */
.df { flex: 1; min-height: 0; display: flex; outline: none; user-select: none; -webkit-user-select: none; }
.df-side { flex: none; width: 168px; display: flex; flex-direction: column; gap: 2px; padding: var(--s2); border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.df-place { all: unset; display: flex; align-items: center; gap: var(--s2); padding: 7px var(--s2); border-radius: var(--r-chip); font-size: 14px; color: var(--text-2); cursor: pointer; }
.df-place svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.df-place:hover { background: var(--surface-2); }
.df-place.on { background: var(--accent-wash); color: var(--text); font-weight: 600; } .df-place.on svg { color: var(--accent); }
.df-place:focus-visible, .df-crumb:focus-visible { outline: 2px solid var(--accent); }
.df-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.df-bar { flex: none; display: flex; align-items: center; gap: 2px; padding: 4px var(--s2); border-bottom: 1px solid var(--line); }
.df-bar .win-btn:disabled { opacity: .35; cursor: default; background: none; }
.df-fwd svg { transform: scaleX(-1); } .df-up svg { transform: rotate(90deg); }
.df-crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; overflow: hidden; white-space: nowrap; font-size: 14px; color: var(--muted); }
.df-crumb { all: unset; padding: 4px 6px; border-radius: var(--r-chip); color: var(--text-2); cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
.df-crumb:last-child { color: var(--text); font-weight: 600; } .df-crumb:hover { background: var(--surface-2); }
.df-filter { width: 128px; font: 14px var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-chip); padding: 5px 8px; margin: 0 4px; }
.df-filter:focus { outline: 2px solid var(--accent); border-color: transparent; }
.df-items { flex: 1; min-height: 0; overflow: auto; padding: var(--s3); outline: none; align-content: start; }
.df-items[data-view="grid"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--s2); }
.df-items[data-view="list"] { display: flex; flex-direction: column; padding: 0 0 var(--s2); }
.df-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--s2) 4px; border-radius: var(--r-btn); cursor: default; outline: none; }
.df-item:hover { background: var(--surface); }
.df-item.sel { background: var(--accent-wash); }
.df-item:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.df-ico { width: 52px; height: 52px; display: grid; place-items: center; color: var(--text-2); overflow: hidden; border-radius: var(--r-chip); }
.df-ico svg { width: 40px; height: 40px; stroke-width: 1.5; }
.df-item[data-type="dir"] .df-ico svg { color: var(--accent); }
.df-ico img { width: 100%; height: 100%; object-fit: cover; border: 1px solid var(--line); border-radius: var(--r-chip); }
.df-name { font-size: 13px; line-height: 1.25; text-align: center; color: var(--text); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; }
.df-items[data-view="list"] .df-item, .df-head { display: grid; grid-template-columns: 28px 1fr 80px 120px; align-items: center; gap: var(--s3); padding: 6px var(--s4); border-radius: 0; }
.df-head { position: sticky; top: 0; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); z-index: 1; }
.df-head span:first-child { grid-column: 2; }
.df-items[data-view="list"] .df-ico { width: 24px; height: 24px; } .df-items[data-view="list"] .df-ico svg { width: 20px; height: 20px; }
.df-items[data-view="list"] .df-name { text-align: left; -webkit-line-clamp: 1; font-size: 14px; }
.df-size, .df-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.df-items.drop-on, .df .drop-on { background: var(--accent-wash); box-shadow: inset 0 0 0 2px var(--accent); }
.df-empty { grid-column: 1 / -1; display: grid; place-items: center; gap: var(--s3); padding: var(--s6) var(--s4); color: var(--muted); font-size: 15px; text-align: center; }
.df-status { flex: none; padding: 4px var(--s4); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.df-rename { font: 13px var(--sans); color: var(--text); background: var(--bg); border: 1px solid var(--accent); border-radius: 4px; padding: 2px 4px; width: 100%; box-sizing: border-box; text-align: center; }
.df-drag { position: fixed; top: -100px; left: 0; padding: 6px 10px; background: var(--accent); color: var(--accent-text); border-radius: var(--r-chip); font: 600 13px var(--sans); }
.df-menu { position: fixed; z-index: 9800; min-width: 200px; padding: 4px; background: var(--bg); border: 1px solid var(--win-edge); border-radius: var(--r-btn); box-shadow: var(--float), inset 0 1px 0 var(--win-hi); display: flex; flex-direction: column; }
.df-menu button { all: unset; padding: 7px var(--s3); border-radius: var(--r-chip); font-size: 14px; color: var(--text); cursor: pointer; }
.df-menu button:hover, .df-menu button:focus-visible { background: var(--surface); }
.df-menu button.danger { color: var(--danger); }
@media (max-width: 760px) { .df-side { display: none; } }
.df-menu { width: max-content; max-width: 280px; }

/* ---- desktop step 3: Browser, app arrives, phone switcher ---- */
.br-bar { flex: none; display: flex; align-items: center; gap: 2px; padding: 4px var(--s2); border-bottom: 1px solid var(--line); }
.br-bar .win-btn:disabled { opacity: .35; cursor: default; background: none; }
.br-addr { flex: 1; min-width: 0; display: flex; align-items: center; height: 34px; margin: 0 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-btn); overflow: hidden; }
.br-addr:focus-within { border-color: var(--accent); }
.br-where { all: unset; display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 var(--s2) 0 var(--s3); font-size: 13px; font-weight: 600; color: var(--text); border-right: 1px solid var(--line); cursor: pointer; white-space: nowrap; max-width: 45%; }
.br-where span:not(.br-glyph) { overflow: hidden; text-overflow: ellipsis; }
.br-where:hover, .br-where:focus-visible { background: var(--surface-2); }
.br-where > svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.br-glyph { display: grid; place-items: center; width: 18px; height: 18px; color: var(--muted); flex: none; }
.br-glyph svg { width: 16px; height: 16px; } .br-glyph .emoji { font-size: 14px; } .br-glyph img { width: 16px; height: 16px; }
.br-path { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: 14px var(--sans); color: var(--text-2); padding: 0 var(--s3); }
.br-body { flex: 1; min-height: 0; display: flex; position: relative; }
.br-menu button { display: flex; flex-direction: column; gap: 2px; }
.br-menu button b { font-weight: 600; font-size: 14px; } .br-menu button span { font-size: 12px; color: var(--muted); }
.win.updated .win-bar::after { content: "Updated"; margin-left: var(--s2); padding: 2px 8px; border-radius: var(--r-chip); background: var(--accent-wash); color: var(--text-2); font-size: 12px; order: 3; }
.win-bar { position: relative; }
@keyframes od-arrive { 0% { transform: translateY(-14px) scale(.6); opacity: 0; } 55% { transform: translateY(2px) scale(1.06); opacity: 1; } 100% { transform: none; } }
@keyframes od-ring { 0% { box-shadow: 0 0 0 0 var(--accent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.desk-icon.arrive .tile { animation: od-arrive 520ms cubic-bezier(.2,.8,.2,1) both, od-ring 900ms 420ms ease-out 1; }
.card.app-ready { display: flex; align-items: center; gap: var(--s3); }
.card.app-ready .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card.app-ready b { font-size: 15px; }
.switcher { justify-content: flex-start; padding-top: var(--s6); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: none; }
.sw-hint { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.switcher-cards { flex: 1; flex-direction: row; gap: var(--s3); overflow-x: auto; overflow-y: visible; scroll-snap-type: x mandatory; padding: var(--s2) 12%; align-items: center; }
.switcher-card { flex: none; width: 76%; height: min(62vh, 520px); flex-direction: column; align-items: stretch; scroll-snap-align: center; touch-action: pan-x; transition: transform var(--fast), opacity var(--fast); overflow: hidden; border-color: var(--win-edge); box-shadow: var(--float), inset 0 1px 0 var(--win-hi); }
.switcher-card[data-swiped] { transition: none; }
.sw-head { display: flex; align-items: center; gap: var(--s2); padding: 0 4px 0 var(--s3); height: 48px; border-bottom: 1px solid var(--line); background: var(--surface); }
.sw-head b { flex: 1; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switcher-card .sw-open { flex: 1; display: grid; place-items: center; padding: 0; background: var(--bg); }
.switcher-card .sw-open .tile.big { width: 88px; height: 88px; } .switcher-card .sw-open .tile.big svg { width: 44px; height: 44px; } .switcher-card .sw-open .tile.big .emoji { font-size: 44px; }
@media (prefers-reduced-motion: reduce) { .desk-icon.arrive .tile { animation: none; box-shadow: 0 0 0 3px var(--accent); } .switcher-card { transition: none; } }
.switcher { background: var(--surface); }
.switcher-card .sw-open { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s3); background: var(--surface); padding: var(--s5); text-align: center; }
.sw-name { font: 600 17px var(--display); color: var(--text); }
.sw-desc { font-size: 13px; color: var(--muted); max-width: 26ch; }

/* ---- landing: the Desktop section (od3's clips, 2026-12-01) ---- */
.land-desk { display: grid; gap: var(--s4); border-top: 1px solid var(--line); padding-top: var(--s6); }
.land-desk h2 { margin: 0; font: 600 26px/1.15 var(--display); letter-spacing: -0.01em; text-wrap: balance; }
.land-desk .lede { max-width: 52ch; }
.desk-clips { display: grid; gap: var(--s5); margin-top: var(--s2); }
.clip { margin: 0; display: grid; gap: var(--s2); align-content: start; }
.clip .cframe { position: relative; border-radius: var(--r-card); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.clip.wide .cframe { aspect-ratio: 1280 / 800; }
.clip.tall { order: -1; width: min(100%, 300px); justify-self: center; }
.clip.tall .cframe { aspect-ratio: 780 / 1688; border-radius: var(--r-sheet); }
.clip video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--surface); }
.clip figcaption { font-size: 13px; color: var(--muted); }
.clip.tall figcaption { text-align: center; }
.clip.noclip { display: none; }
.desk-cta { justify-self: start; min-height: 48px; padding: 0 var(--s5); }
@media (min-width: 900px) {
  .land-desk { grid-column: 1 / -1; }
  .land-desk h2 { font-size: 34px; }
  .desk-clips { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 200px; align-items: start; }
  .clip.tall { order: 0; width: 100%; }
}
.br-bar .win-btn[hidden] { display: none; }

/* Voice (2026-12-01, DESIGN.md "Voice"): mic button, live line, step line, highlight */
.mic[data-state="listening"], .mic[data-state="arming"] { background: var(--accent); color: var(--accent-text); }
.mic[data-state="working"] { color: var(--accent); }
.mic[data-state="working"] svg { animation: pulse 1.2s ease-in-out infinite; }
.mic[data-state="error"] { color: var(--danger); }
.mic:disabled { opacity: .45; }
.mic-live { margin: 0; display: flex; align-items: center; gap: var(--s2); min-height: 32px; font-size: 15px; color: var(--text); overflow-wrap: anywhere; }
.mic-live .dim { color: var(--muted); }
.mic-live.off { font-size: 13px; color: var(--muted); }
.mic-live.error { font-size: 14px; flex-wrap: wrap; }
.mic-live.error .btn { min-height: 32px; padding: 0 var(--s2); text-decoration: underline; }
.ml-bars { display: inline-flex; align-items: center; gap: 2px; height: 18px; flex: none; }
.ml-bars i { width: 3px; height: 18px; border-radius: 2px; background: var(--accent); transform: scaleY(.15); transition: transform 80ms linear; }
.mic-live.working .ml-bars i { animation: pulse 1.2s ease-in-out infinite; transform: scaleY(.4); }
.launcher-live { padding: 0 var(--s4); }
.launcher-live:not([hidden]) { padding-top: var(--s2); }
.launcher-field .icon-btn { flex: none; width: 40px; height: 40px; }
.home-live { margin: 0 0 var(--s2); padding: var(--s2) var(--s3); background: var(--bg); border-radius: var(--r-card); }
.home-mic { flex: none; }
.voice-step { position: fixed; z-index: 70; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: var(--s3); max-width: calc(100% - 32px); padding: var(--s1) var(--s2) var(--s1) var(--s4); min-height: 44px; border-radius: var(--r-btn); background: var(--text); color: var(--bg); font-size: 14px; box-shadow: var(--float); }
.voice-step .vs-undo { color: var(--bg); min-height: 36px; text-decoration: underline; }
.voice-step.in { animation: vs-in var(--fast); }
@keyframes vs-in { from { opacity: 0; transform: translate(-50%, 6px); } }
[data-od-hl] { outline: 3px solid var(--accent); outline-offset: 2px; animation: od-hl 1.1s ease-out; }
[data-od-hl].od-hl-still { animation: none; }
@keyframes od-hl { 0% { outline-color: transparent; } 15% { outline-color: var(--accent); } 70% { outline-color: var(--accent); } 100% { outline-color: transparent; } }
.msg.note.ui { font-size: 12px; }
.msg.note.ui::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.msg.note.ui.failed::before { background: var(--faint); }
@media (prefers-reduced-motion: reduce) { .voice-step.in, [data-od-hl], .mic[data-state="working"] svg, .mic-live.working .ml-bars i { animation: none; } .ml-bars i { transition: none; } }

/* My computers (2026-12-01, DESIGN.md "My computers"): sheet rows, cap message, home name as a button */
.home-top .home-name { display: block; padding: 0; border: 0; background: none; text-align: start; font: 600 22px var(--display); color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 32px; }
.sheet .comps .opt.comp { gap: var(--s3); }
.comp-tile { flex: none; width: 40px; height: 40px; display: inline-flex !important; align-items: center; justify-content: center; border-radius: var(--r-btn); background: var(--surface); color: var(--text-2) !important; font-size: 22px !important; }
.comp-tile svg { width: 22px; height: 22px; }
.sheet .opt[data-current] b { color: var(--text); }
.comp-check { flex: none; width: 22px; height: 22px; color: var(--accent); }
.sheet .opt .spin { flex: none; }
.comp-cap { margin-top: var(--s4); }
.comp-cap > p { margin: 0; padding: var(--s3); border-radius: var(--r-btn); background: var(--accent-wash); color: var(--text); font-size: 14px; }
.dock-item .emoji { font-size: 22px; line-height: 1; }

/* wide screens: sheets stay a readable column at the bottom centre (My computers from the dock, 2026-12-01) */
@media (min-width: 700px) { .sheet { left: 50%; right: auto; width: min(520px, calc(100% - 32px)); margin-left: max(-260px, calc(-50% + 16px)); padding-left: var(--s5); padding-right: var(--s5); } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.sheet-open .voice-step { visibility: hidden; }

/* Publish (2026-12-01) */
.br-pub, .win-pub { min-height: 32px; padding: 0 var(--s3); font-size: 14px; flex: none; }
.win-pub { margin-right: var(--s1); }
.pubbox { margin: var(--s2) 0 var(--s3); min-height: 48px; display: flex; align-items: center; }
.pubbox .keylink { width: 100%; }
.pubacts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.pubacts .btn { flex: 1 1 auto; justify-content: center; }
.pubmore { margin-top: var(--s4) !important; }
.pubacts[hidden], .pubmore[hidden] { display: none !important; }
