@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap; src: url(/static/fonts/figtree-latin.woff2) format('woff2'); }
:root {
  --bg: #1d1c1a; --panel: #1a1917; --surface: #2a2926; --surface-2: #33322e; --line: #34332f; --line-2: #45433e;
  --ink: #ece9e1; --ink-2: #b9b5ac; --ink-3: #85817a;
  --accent: #4fb8a8; --accent-ink: #0d1716; --accent-soft: #23403b;
  --user: #2f2e2a; --warn: #e9b062; --warn-soft: #3b2f1b; --bad: #ef8a7e; --bad-soft: #3d2320;
  --ok: #6cc795; --ok-soft: #1d3324; --blue: #93b4ee; --blue-soft: #222c3d;
  --radius: 16px; --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.25);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
#app { height: 100dvh; display: flex; overflow: hidden; }

/* ---------- sidebar */
.side { width: 260px; flex: none; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px; gap: 6px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.side .list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.side .sec { font-size: 12px; color: var(--ink-3); padding: 10px 10px 4px; text-transform: uppercase; letter-spacing: .06em; }
.pitem { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; color: var(--ink);
  text-decoration: none; border: 0; background: none; text-align: left; width: 100%; }
.pitem:hover { background: var(--user); }
.pitem.on { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.pitem .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem .c { font-size: 12px; color: var(--ink-3); }
.btn { border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 7px 12px; }
.btn:hover { border-color: var(--ink-3); }
.btn.pri { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.ghost { background: none; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--user); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.side .foot { display: flex; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }

/* ---------- main */
.main { flex: 1; display: flex; min-width: 0; }
.col { display: flex; flex-direction: column; min-width: 0; }
.chat { flex: 1; }
.rpanel { width: 400px; flex: none; border-left: 1px solid var(--line); background: var(--panel); }
.rpanel.wide { width: min(620px, 48vw); }
.head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); min-height: 58px; }
.head h1 { font-size: 16px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head h1 small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.model { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 999px;
  padding: 2px 4px 2px 10px; font-size: 12px; color: var(--ink-2); background: var(--surface); }
.model input { border: 0; background: none; width: 150px; padding: 3px 4px; font-family: var(--mono); font-size: 12px; outline: none; }
.iconbtn { border: 0; background: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.iconbtn:hover { background: var(--user); }
.iconbtn svg { width: 19px; height: 19px; }

.feed { flex: 1; overflow: auto; padding: 20px 18px 8px; display: flex; flex-direction: column; gap: 14px; }
.feed .inner { max-width: 760px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; flex-direction: column; gap: 4px; }
.msg .who { font-size: 12px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.msg .who b { color: var(--ink-2); font-weight: 600; }
.msg.me { align-items: flex-end; }
.msg.me .body { background: var(--user); border-radius: 16px 16px 4px 16px; padding: 9px 14px; max-width: 85%; white-space: pre-wrap; }
.msg.bot .body { max-width: 100%; }
.msg.coord .body { padding-left: 0; }
.msg.err .body { background: var(--bad-soft); color: var(--bad); padding: 8px 12px; border-radius: 10px; }
.msg.relay .body { background: var(--blue-soft); padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.body p { margin: 0 0 .6em; } .body p:last-child { margin-bottom: 0; }
.body ul, .body ol { margin: .2em 0 .6em; padding-left: 1.4em; }
.body h1, .body h2, .body h3 { font-size: 1.05em; margin: .8em 0 .3em; }
.body code { overflow-wrap: anywhere; font-family: var(--mono); font-size: .88em; background: var(--user); padding: 1px 5px; border-radius: 5px; }
.body pre { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow: auto; font-size: 13px; }
.body pre code { background: none; padding: 0; }
.body table { border-collapse: collapse; margin: .4em 0; font-size: 14px; display: block; overflow: auto; }
.body td, .body th { border: 1px solid var(--line); padding: 4px 8px; }
.body blockquote { margin: .4em 0; padding-left: 10px; border-left: 3px solid var(--line-2); color: var(--ink-2); }

.steps { display: flex; flex-direction: column; gap: 4px; }
details.step { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13px; }
details.step summary { list-style: none; padding: 6px 10px; display: flex; gap: 8px; align-items: center; cursor: pointer; color: var(--ink-2); }
details.step summary::-webkit-details-marker { display: none; }
details.step summary .nm { font-weight: 600; color: var(--ink); font-family: var(--mono); font-size: 12px; }
details.step summary .arg { font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
details.step pre { margin: 0; padding: 8px 10px; border-top: 1px solid var(--line); font: 12px/1.45 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }
details.step .lbl { padding: 6px 10px 0; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: sp 0.8s linear infinite; flex: none; }
@keyframes sp { to { transform: rotate(360deg); } }
.typing { display: flex; gap: 8px; align-items: center; color: var(--ink-3); font-size: 13px; }

.tcard { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 10px 12px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); max-width: 520px; cursor: pointer; }
.tcard:hover { border-color: var(--accent); }
.tcard .t { flex: 1; min-width: 0; }
.tcard .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard .t span { font-size: 12px; color: var(--ink-3); }
.tlink { display: inline-flex; align-items: center; gap: 5px; background: var(--accent-soft); color: var(--ink); text-decoration: none;
  padding: 0 8px; border-radius: 6px; font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-3); }
.dot.working { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 1.6s ease-in-out infinite; }
.dot.blocked { background: var(--warn); } .dot.review { background: var(--blue); } .dot.done { background: var(--ok); } .dot.failed { background: var(--bad); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600; text-transform: capitalize; background: var(--user); color: var(--ink-2); }
.pill.working { background: var(--accent-soft); color: var(--accent); } .pill.blocked { background: var(--warn-soft); color: var(--warn); }
.pill.review { background: var(--blue-soft); color: var(--blue); } .pill.done { background: var(--ok-soft); color: var(--ok); } .pill.failed { background: var(--bad-soft); color: var(--bad); }

.composer { padding: 10px 18px calc(14px + env(safe-area-inset-bottom)); }
.composer .box { max-width: 760px; margin: 0 auto; border: 1px solid var(--line-2); background: var(--surface); border-radius: 18px;
  display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px 6px 14px; box-shadow: var(--shadow); }
.composer textarea { flex: 1; border: 0; outline: none; background: none; resize: none; padding: 8px 0; max-height: 220px; min-height: 24px; line-height: 1.45; }
.send { width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.send:disabled { opacity: .4; }
.send.stop { background: var(--ink); color: var(--bg); }
.send svg { width: 18px; height: 18px; }

/* ---------- right panel */
.tabs { display: flex; gap: 2px; padding: 10px 12px 0; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--ink-2); font-weight: 500; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.pbody { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.trow { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.trow:hover { border-color: var(--line-2); }
.trow .dot { margin-top: 7px; }
.trow .t { flex: 1; min-width: 0; }
.trow .t b { display: block; font-weight: 600; }
.trow .t span { font-size: 12px; color: var(--ink-3); }
.grp { font-size: 12px; color: var(--ink-3); margin: 8px 2px 0; display: flex; justify-content: space-between; }
.empty { color: var(--ink-3); font-size: 14px; text-align: center; padding: 30px 10px; }
.check { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.check .hd { font-weight: 600; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.check .ln { display: flex; gap: 8px; padding: 2px 0; }
.check .ln i { font-style: normal; width: 16px; text-align: center; flex: none; }
.check .ln.done { color: var(--ink-3); } .check .ln.done i { color: var(--ok); }
.check .ln.doing i { color: var(--accent); } .check .ln.doing { font-weight: 500; }
.mem { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.mem .hd { display: flex; align-items: center; gap: 6px; font-weight: 600; font-family: var(--mono); font-size: 13px; }
.mem .hd span { flex: 1; }
.mem pre { white-space: pre-wrap; margin: 6px 0 0; font: 13px/1.45 system-ui, sans-serif; color: var(--ink-2); max-height: 220px; overflow: auto; }
.mem textarea, .field textarea, .field input { width: 100%; border: 1px solid var(--line-2); background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.mem textarea { min-height: 140px; margin-top: 6px; font: 13px/1.45 var(--mono); }
.frow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.frow a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; font-family: var(--mono); font-size: 13px; }
.frow span { color: var(--ink-3); font-size: 12px; }
.drop { border: 2px dashed var(--line-2); border-radius: 12px; padding: 16px; text-align: center; color: var(--ink-3); font-size: 14px; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; font-weight: 600; }
.field small { color: var(--ink-3); font-size: 12px; }
.field textarea { min-height: 150px; }
.row { display: flex; gap: 8px; align-items: center; }

/* ---------- home / login */
.home { flex: 1; overflow: auto; padding: 40px 24px; }
.home .wrap { max-width: 880px; margin: 0 auto; }
.home h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 4px; }
.home p.sub { color: var(--ink-2); margin: 0 0 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.pcard { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 16px; cursor: pointer; box-shadow: var(--shadow); text-align: left; }
.pcard:hover { border-color: var(--accent); }
.pcard b { display: block; font-size: 16px; margin-bottom: 4px; }
.pcard span { color: var(--ink-3); font-size: 13px; }
.login { margin: auto; width: min(360px, 100% - 32px); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login img { width: 64px; height: 64px; margin: 0 auto; border-radius: 16px; }
.login input { border: 1px solid var(--line-2); background: var(--surface); border-radius: 12px; padding: 12px 14px; }
.login .err { color: var(--bad); font-size: 14px; min-height: 20px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border-radius: 16px; padding: 20px; width: min(480px, 100%); display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.modal h3 { margin: 0; }
.modal input, .modal textarea { border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 9px 12px; width: 100%; }
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 10px; font-size: 14px; z-index: 60; }

.mnav, .mback, .mhead { display: none; }
@media (max-width: 860px) {
  .side { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; width: 280px; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 39; }
  .main { flex-direction: column; }
  .rpanel, .rpanel.wide { width: 100%; border-left: 0; flex: 1; min-height: 0; }
  .main[data-view="chat"] .rpanel { display: none; }
  .main:not([data-view="chat"]) .chat { display: none; }
  .mnav { display: flex; border-top: 1px solid var(--line); background: var(--panel); padding-bottom: env(safe-area-inset-bottom); flex: none; }
  .mnav button { flex: 1; border: 0; background: none; padding: 9px 0 8px; font-size: 12px; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .mnav button.on { color: var(--accent); font-weight: 600; }
  .mnav svg { width: 20px; height: 20px; }
  .mback { display: grid; }
  .mhead { display: flex !important; }
  .rpanel.thread .head { flex-wrap: wrap; row-gap: 6px; }
  .rpanel.thread .head h1 { white-space: normal; }
  .rpanel.thread .head .model { order: 5; flex: 1 1 100%; }
  .rpanel.thread .head .model input { width: 100%; }
  .tabs { display: none; }
  .rpanel.thread .tabs { display: none; }
  .head { padding: 10px 10px; }
  .model input { width: 110px; }
  .feed { padding: 14px 12px 6px; }
  .composer { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  .mainwrap { display: flex; flex-direction: column; flex: 1; min-width: 0; }
  .main[data-view="thread"] ~ .mnav, .hide-mnav .mnav { display: none; }
}
@media (min-width: 861px) { .mainwrap { display: flex; flex: 1; min-width: 0; } .menu-btn { display: none !important; } }

/* ---------- app-style restyle */
.head.ch { justify-content: center; border-bottom: 0; }
.head.ch .hsp { flex: 1; }
.ctitle { display: flex; flex-direction: column; align-items: center; min-width: 0; max-width: 70%; text-align: center; }
.ctitle b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ctitle span { font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
#tl { position: relative; }
.badge { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.main.nopanel .rpanel:not(.thread) { display: none; }
.msg.me .body { background: var(--surface-2); border-radius: 18px; padding: 10px 15px; }
.msg.bot .who b { color: var(--ink-3); font-weight: 500; }
.body { font-size: 15.5px; line-height: 1.6; }
.tlink { border-radius: 999px; padding: 1px 10px 1px 8px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 14px; }
.tlink:hover { border-color: var(--accent); }
.tcard { border-radius: 999px; padding: 8px 14px; box-shadow: none; background: var(--surface); }
.tcard .t { display: flex; align-items: baseline; gap: 8px; }
.tcard .t b { font-weight: 500; }
.composer .box { flex-direction: column; align-items: stretch; gap: 2px; border-radius: 26px; padding: 10px 10px 8px 16px; background: var(--surface); border-color: var(--line-2); }
.composer textarea { padding: 6px 2px; font-size: 16px; }
.ctools { display: flex; align-items: center; gap: 4px; margin-left: -8px; }
.cbtn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: none; color: var(--ink-2); display: grid; place-items: center; flex: none; }
.cbtn svg { width: 18px; height: 18px; }
.cbtn:hover { background: var(--surface-2); }
.cbtn.rec { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.cbtn.busy { animation: wbpulse 1s ease-in-out infinite; }
@keyframes wbpulse { 50% { opacity: .4; } }
.ctools .cbtn#cmic, .ctools .cbtn#tmic { border: 0; }
.mchip { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; height: 36px; padding: 0 12px; }
.mchip input { border: 0; outline: none; background: none; font-size: 13px; color: var(--ink-2); padding: 0; min-width: 6ch; }
.send { width: 36px; height: 36px; border-radius: 50%; }
.composer { padding-top: 6px; }
details.step { background: transparent; border-color: var(--line); }
.trow, .mem, .frow, .check { background: var(--surface); }
.pcard { background: var(--surface); }
.side { background: var(--panel); }
.rpanel { background: var(--panel); }
@media (max-width: 860px) {
  .rpanel .tabs { display: flex; overflow-x: auto; }
  .rpanel.thread .tabs { display: none; }
  .ctitle { max-width: 64%; }
}
.tcard .t span { white-space: nowrap; flex: none; }
@media (max-width: 860px) { .tcard .t span { display: none; } }
.mchip input { field-sizing: content; width: auto !important; max-width: 26ch; }

/* ---------- exact spec (phone app look) */
:root { --bg: #1a1a1a; --panel: #1a1a1a; --surface: #222222; --surface-2: #2b2b2b; --line: #2e2e2e; --line-2: #333333;
  --ink: #f2f2f0; --ink-2: #b5b5b2; --ink-3: #8a8a87; --rust: #a0533f; --navy: #1e2a3a; --link: #7aa7ff; }
html, body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.head.ch { min-height: 60px; padding: 10px 12px; }
.ctitle.row1 { flex-direction: row; gap: 10px; align-items: center; }
.ctitle.row1 b { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.tile { width: 32px; height: 32px; border-radius: 9px; background: #2a2a2a; display: grid; place-items: center; flex: none; }
.tile img { width: 20px; height: 20px; border-radius: 5px; }
.head .iconbtn svg { width: 22px; height: 22px; }
.head .iconbtn { color: var(--ink); }
#tl { position: relative; }
.bdot { position: absolute; top: 6px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: #4c8dff; box-shadow: 0 0 0 2px var(--bg); }
.feed { padding: 12px 20px 8px; }
.feed .inner { gap: 28px; }
.body { font-size: 17.5px; line-height: 1.55; }
.msg.bot .body { color: var(--ink); }
.msg.me .body { background: #2b2b2b; border-radius: 24px; padding: 12px 18px; max-width: 85%; font-size: 17.5px; line-height: 1.5; }
.msg.relay .body { background: #2b2b2b; border-radius: 18px; font-size: 15.5px; }
.tlink { display: inline-flex; align-items: center; gap: 6px; background: var(--navy); color: var(--link); border: 0; border-radius: 999px;
  padding: 2px 12px 2px 10px; font-weight: 500; font-size: .92em; line-height: 1.5; vertical-align: baseline; text-decoration: none; }
.tlink svg { width: 15px; height: 15px; flex: none; }
.tlink:hover { filter: brightness(1.15); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.composer { padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); }
.composer .box { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; background: #222; border: 1px solid #333;
  border-radius: 28px; padding: 8px; box-shadow: none; }
.composer textarea { flex: 1 1 0; min-width: 0; font-size: 17px; padding: 8px 4px; color: var(--ink); }
.composer textarea::placeholder { color: #8a8a87; }
.cbtn { width: 40px; height: 40px; border: 0; background: #2f2f2f; color: var(--ink); }
.cbtn:hover { background: #383838; }
.cbtn svg { width: 20px; height: 20px; }
.send { width: 40px; height: 40px; border-radius: 50%; background: var(--rust); color: #fff; }
.send.stop { background: #e8e6e1; color: #1a1a1a; }
.mchip, .cspace { display: none; }
.composer .box.open { flex-direction: row; padding: 10px 8px 8px; }
.composer .box.open textarea { order: 0; flex: 1 1 100%; padding: 6px 10px 4px; }
.composer .box.open .plus { order: 1; }
.composer .box.open .mchip { display: inline-flex; order: 2; height: 40px; border: 0; background: #2f2f2f; border-radius: 999px; padding: 0 14px; }
.composer .box.open .mchip input { color: var(--ink); font-size: 14px; font-weight: 500; }
.composer .box.open .cspace { display: block; order: 3; flex: 1; }
.composer .box.open .mic { order: 4; }
.composer .box.open .send { order: 5; }
.check, .trow, .mem, .frow { background: #222; border-color: #2e2e2e; }
details.step { border-color: #2e2e2e; }
@media (min-width: 861px) { .menu-btn { display: grid !important; } }

/* ---------- pixel match to the reference screenshots */
:root { --bg: #161616; --panel: #161616; --navy: #1b2638; --link: #79aaf7; }
html, body { font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); }
.head.ch { position: relative; z-index: 2; min-height: 64px; padding: 12px 14px 8px; background: linear-gradient(var(--bg) 70%, transparent); }
.head .iconbtn { width: 40px; height: 40px; color: #d8d8d4; }
.head .iconbtn svg { width: 24px; height: 24px; }
.ctitle.row1 { gap: 10px; }
.ctitle.row1 b { font-size: 21px; font-weight: 500; letter-spacing: -.005em; color: #ecebe8; }
.tile { width: 34px; height: 34px; border-radius: 10px; background: #262626; color: #c9c9c5; }
.tile svg { width: 20px; height: 20px; }
.bdot { top: 4px; right: 3px; width: 9px; height: 9px; background: #3f8cff; box-shadow: none; }
.feed { padding: 4px 16px 8px; margin-top: -12px; }
.feed .inner { gap: 34px; padding-top: 18px; }
.body { font-size: 19.5px; line-height: 1.6; letter-spacing: -.003em; }
.msg.bot .body { padding: 0 16px; color: #efeee9; }
.msg.me .body { background: #262626; border-radius: 26px; padding: 14px 18px; font-size: 19.5px; line-height: 1.55; max-width: 85%; color: #efeee9; }
.tlink { gap: 8px; background: var(--navy); color: var(--link); border-radius: 999px; padding: 1px 14px 1px 10px; font-size: 1em; font-weight: 400; line-height: 1.5; }
.tlink svg { width: 20px; height: 20px; }
.pills { padding: 0 0; }
.composer { padding: 6px 16px calc(14px + env(safe-area-inset-bottom)); }
.composer .box { background: #1e1e1e; border: 1px solid #2f2f2f; border-radius: 30px; padding: 7px; gap: 8px; }
.composer textarea { font-size: 19.5px; padding: 6px 4px; }
.composer textarea::placeholder { color: #7d7d79; }
.cbtn { width: 40px; height: 40px; background: #2a2a2a; color: #d8d8d4; }
.cbtn svg { width: 21px; height: 21px; stroke-width: 1.7; }
.send { width: 40px; height: 40px; background: #b0583f; color: #fff; }
.send.empty:not(.stop) { background: #6e3a2d; color: #c7a39a; }
.composer .box.open { padding: 14px 8px 8px; border-radius: 26px; }
.composer .box.open textarea { padding: 2px 10px 12px; }
.mchip { cursor: pointer; }
.mchip input { display: none; }
.mchip.edit .lbl { display: none; }
.mchip.edit input { display: inline-block; min-width: 14ch; }
.composer .box.open .mchip { background: #2a2a2a; padding: 0 18px; height: 40px; }
.mchip .lbl { font-size: 17px; color: #ecebe8; white-space: nowrap; }
.mchip input { font-size: 15px !important; }
.composer .send, .composer .cbtn { flex: none; padding: 0; width: 40px; height: 40px; min-height: 0; aspect-ratio: 1; align-self: center; border-radius: 50%; }
.composer .send svg { width: 20px; height: 20px; }
.composer .box { min-height: 56px; }
.mbody { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); margin-top: 6px; }
.mbody p { margin: 0 0 .4em; }
.mlink { color: var(--link); text-decoration: none; border-bottom: 1px dashed var(--link); }
.mem.flash { outline: 2px solid var(--link); }
.sdesc { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.sdesc code { font-family: var(--mono); font-size: 12px; background: #2a2a2a; padding: 1px 5px; border-radius: 5px; }
.sdesc .tlink { font-size: 12px; padding: 0 8px 0 6px; }
.sdesc .tlink svg { width: 12px; height: 12px; }
.sw { position: relative; width: 38px; height: 22px; flex: none; }
.sw input { opacity: 0; position: absolute; inset: 0; }
.sw i { position: absolute; inset: 0; background: #3a3a3a; border-radius: 11px; transition: .15s; }
.sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #ddd; transition: .15s; }
.sw input:checked + i { background: var(--accent); }
.sw input:checked + i::after { left: 19px; background: #fff; }
.tabs { scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
.tabs button { white-space: nowrap; }
.modal select { width: 100%; }
.mainwrap, .main, .col, .feed { min-height: 0; }
.mainwrap { height: 100dvh; }
.main { height: 100%; }
img.media, video.media { display: block; max-width: 100%; max-height: 70vh; border-radius: 14px; margin: 8px 0; background: #111; }
img.zoom { cursor: zoom-in; }
.msg.me img.att { max-width: 70%; max-height: 260px; border-radius: 18px; margin-bottom: 6px; object-fit: cover; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.94); display: grid; place-items: center; }
.lightbox img { max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.lightbox .lbx { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; color: #fff; }
.attstrip { flex: 1 1 100%; order: -1; display: flex; gap: 8px; overflow-x: auto; padding: 2px 4px 6px; }
.attchip { position: relative; flex: none; background: #2a2a2a; border-radius: 12px; overflow: hidden; display: grid; place-items: center; min-width: 56px; height: 56px; padding: 0; }
.attchip img { width: 56px; height: 56px; object-fit: cover; }
.attchip b { font-size: 12px; padding: 0 8px; font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attchip button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; font-size: 13px; line-height: 1; padding: 0; }
.composer .box.open .mchip { flex: 0 1 auto; min-width: 0; max-width: calc(100% - 156px); overflow: hidden; }
.mchip .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; min-width: 0; }
.mchip.edit input { min-width: 0 !important; width: 100% !important; max-width: none; }
.composer .box.open .cspace { min-width: 0; }
.composer .box.open .plus, .composer .box.open .mic, .composer .box.open .send { flex: none; }
.composer textarea { overflow-y: hidden; scrollbar-width: none; resize: none; -webkit-appearance: none; appearance: none; background: transparent; border: 0; outline: 0; box-shadow: none; }
.composer textarea::-webkit-scrollbar { display: none; }
.composer .box:not(.open) .attstrip, .composer .box:not(.open) .mchip, .composer .box:not(.open) .cspace { display: none !important; }
.tile { width: 36px; height: 36px; border-radius: 11px; background: #2c2c2c; color: #f0efea; }
.tile svg { width: 21px; height: 21px; }
.ctitle .tile { color: #f0efea; }
.composer .box { padding: 9px; }
.composer .box.open { padding: 14px 9px 9px; }
.ctitle .tile { display: grid; place-items: center; width: 36px; height: 36px; font-size: 0; }
.ctitle .tile svg { width: 23px !important; height: 23px !important; }
/* lock the page: only the message lists scroll */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; width: 100%; }
#app { height: 100%; }
.mainwrap { height: 100%; }
.feed { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.chat, .rpanel { height: 100%; }
.composer { flex: none; }
.lightbox { background: #000; padding: calc(56px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); box-sizing: border-box; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }
.feed .inner > .msg:first-child img.media { margin-top: 12px; }
img.media, video.media { margin: 12px 0; }
.sheet-bg { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; animation: fadein .15s; }
.sheet-bg.out { opacity: 0; transition: opacity .15s; }
@keyframes fadein { from { opacity: 0; } }
@keyframes slideup { from { transform: translateY(40px); } }
.sheet { width: min(640px, 100%); height: min(78dvh, 720px); background: #1d1d1d; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: slideup .18s ease-out; padding-bottom: env(safe-area-inset-bottom); }
.grab { width: 40px; height: 5px; border-radius: 3px; background: #444; margin: 10px auto 6px; }
.sh-top { padding: 4px 16px 8px; }
.sh-q { width: 100%; background: #2a2a2a; border: 0; outline: none; border-radius: 14px; padding: 12px 14px; font-size: 16px; color: var(--ink); }
.sh-tabs { display: flex; gap: 6px; padding: 0 16px 8px; }
.sh-tabs button { border: 0; background: #262626; color: var(--ink-2); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.sh-tabs button.on { background: #ecebe8; color: #161616; }
.sh-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 12px; }
.sh-sec { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding: 12px 10px 4px; }
.sh-row { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; border: 0; background: none; text-align: left; padding: 10px; border-radius: 12px; color: var(--ink); }
.sh-row:hover, .sh-row:active { background: #262626; }
.sh-row.cur { background: #23302e; }
.sh-row.free { border: 1px dashed #3a3a3a; margin-bottom: 4px; }
.sh-name { font-size: 16px; font-weight: 500; }
.sh-name i { font-style: normal; color: var(--accent); }
.sh-id { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.sh-meta { font-size: 12.5px; color: var(--ink-2); }

/* ---------- drawer sidebar (reference: near-black, serif wordmark, pill rows) */
.side { width: 300px; background: #141414 !important; border-right: 0 !important; padding: 0; gap: 0; display: flex; flex-direction: column; }
.sd-top { display: flex; align-items: center; justify-content: space-between; padding: calc(18px + env(safe-area-inset-top)) 14px 14px 22px; }
.wordmark { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 500; letter-spacing: -.01em; color: #f1efe9; }
.sd-top .iconbtn { color: #d8d6d0; width: 42px; height: 42px; }
.sd-top .iconbtn svg { width: 24px; height: 24px; }
.sd-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.sd-row { display: flex; align-items: center; gap: 16px; height: 48px; padding: 0 16px; border: 0; background: none; border-radius: 24px; color: #ecebe6; font-size: 18px; text-align: left; width: 100%; }
.sd-row svg { width: 22px; height: 22px; flex: none; color: #d8d6d0; }
.sd-row.on { background: #3a3a3a; }
.sd-row:active { background: #2c2c2c; }
.sd-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 90px; }
.sd-div { height: 1px; background: #2a2a2a; margin: 12px 14px 6px; }
.sd-sec { font-size: 15px; color: #8d8b86; padding: 14px 16px 6px; }
.sd-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 44px; padding: 0 16px; border: 0; background: none; border-radius: 22px; color: #ecebe6; font-size: 16.5px; text-align: left; }
.sd-item svg { width: 19px; height: 19px; flex: none; color: #bdbbb5; }
.sd-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-item em { font-style: normal; font-size: 12px; color: #8d8b86; }
.sd-item .dot { flex: none; }
.sd-item.on { background: #2a2a2a; }
.sd-item:active { background: #262626; }
.sd-empty { color: #8d8b86; font-size: 14px; padding: 6px 16px; }
.sd-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, #141414 35%); }
.side { position: relative; }
.sd-avatar { width: 48px; height: 48px; border-radius: 50%; border: 0; background: #7c5cd6; color: #fff; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.sd-avatar svg { width: 24px; height: 24px; }
.sd-new { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 20px 0 16px; border: 0; border-radius: 24px; background: #f1efe9; color: #161616; font-size: 16.5px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.sd-new svg { width: 20px; height: 20px; }
@media (max-width: 860px) {
  .side { position: fixed !important; inset: 0 auto 0 0; width: 88vw; max-width: 380px; z-index: 60; transform: translateX(-100%); transition: transform .22s ease-out; box-shadow: none; }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 59; }
}
/* home page in the same style */
.home { background: var(--bg); }
.home h2 { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-weight: 500; font-size: 30px; }
.pcard { background: #1e1e1e; border: 1px solid #2a2a2a; box-shadow: none; border-radius: 18px; color: var(--ink); }
.pcard span { color: #8d8b86; }
.ctitle .eng { font-size: 11px; color: #8d8b86; margin-left: 8px; padding: 1px 8px; border: 1px solid #333; border-radius: 999px; cursor: pointer; }
/* thread state colors: clearly different at a glance */
.dot { background: #6b6a66; }
.dot.working { background: #4c8dff; box-shadow: 0 0 0 3px rgba(76,141,255,.25); animation: pulse 1.4s ease-in-out infinite; }
.dot.blocked { background: #f0a43a; }
.dot.review { background: #ecebe8; }
.dot.done { background: #5c5b57; box-shadow: none; animation: none; }
.dot.failed { background: #ef6a5a; }
.trow .t span { color: #8d8b86; }
.msg.treply { border-left: 2px solid #2f3a4f; padding-left: 14px; margin-left: 2px; }
.msg.treply .trw { font-size: 13px; color: #8d8b86; margin-left: 6px; }
.msg.treply .body { font-size: 16px; color: #d6d4ce; margin-top: 6px; }
.msg.treply .trh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg.treply .trh .tlink { font-size: 15px; }
.msg.treply .trw { margin-left: 0; }
.msg.treply .body { font-size: 16.5px; }
.msg.me .attwrap { position: relative; display: inline-block; max-width: 75%; margin-bottom: 6px; }
.msg.me .attwrap img.att, .msg.me .attwrap video.att { display: block; max-width: 100%; max-height: 260px; border-radius: 18px; object-fit: cover; background: #222; }
.msg .attfile { display: inline-block; background: #262626; border-radius: 14px; padding: 10px 14px; font-size: 14px; }
a.attfile { color: inherit; text-decoration: none; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.upov { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.6); border-radius: 10px; padding: 6px 10px; }
.upov em { font-style: normal; font-size: 12px; color: #fff; min-width: 34px; text-align: right; }
.upov.bad { background: rgba(160,40,30,.85); justify-content: center; }
.prog { flex: 1; height: 4px; background: rgba(255,255,255,.25); border-radius: 2px; overflow: hidden; display: block; }
.prog s { display: block; height: 100%; background: #fff; text-decoration: none; transition: width .2s; }
.attchip .prog { position: absolute; left: 6px; right: 6px; bottom: 6px; }
.attchip.bad { outline: 2px solid #ef6a5a; }
.attchip .state { position: absolute; inset: 0; display: grid; place-items: center; color: #ef6a5a; font-style: normal; font-weight: 700; }
.attchip video { width: 56px; height: 56px; object-fit: cover; }
.msg.me .mstate { font-size: 12.5px; color: #8d8b86; margin-top: 4px; text-align: right; }
.msg.me.failed .mstate { color: #ef8a7e; }
.msg.me.failed .body { opacity: .7; }
/* no will-change here: a compositing layer per message left stale copies of old messages on screen on Android when the keyboard resized the page (14.11) */
.feed .msg[data-k] { position: relative; }
.feed .msg.swipe-ready::before { content: "↩"; position: absolute; left: -34px; top: 50%; transform: translateY(-50%); color: #9db4e8; font-size: 20px; }
.replyq { flex: 1 1 100%; order: -2; display: flex; align-items: center; gap: 10px; background: #262626; border-radius: 14px; padding: 8px 8px 8px 0; margin-bottom: 4px; overflow: hidden; }
.rq-bar { width: 3px; align-self: stretch; background: #79aaf7; border-radius: 2px; margin-left: 10px; flex: none; }
.rq-t { flex: 1; min-width: 0; font-size: 14px; color: #c9c7c1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rq-x { border: 0; background: #333; color: #ddd; width: 26px; height: 26px; border-radius: 50%; flex: none; font-size: 16px; line-height: 1; }
.msg.me .uq { display: block; border-left: 3px solid #79aaf7; padding: 2px 0 2px 10px; margin-bottom: 8px; color: #b9b7b1; font-size: .85em; white-space: pre-wrap; }
/* top bars: solid, with breathing room below; status + engine on one line */
.head.ch { background: var(--bg) !important; padding-bottom: 12px; margin-bottom: 4px; box-shadow: 0 10px 12px -8px var(--bg); }
.feed { margin-top: 0 !important; }
.feed .inner { padding-top: 10px !important; }
.ctitle #tstat { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ctitle .eng { display: inline-block; margin-left: 0; padding: 0 7px; font-size: 10.5px; line-height: 16px; }
.rpanel.thread .ctitle > span:last-child { margin-top: 2px; }
.ctitle .tsub { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- small fixes (11.11.2026): tabs fit, keyboard focus, reduced motion */
.tabs { gap: 0; padding: 10px 6px 0; }
.tabs button { flex: 1 1 auto; min-width: 0; padding: 8px 6px; font-size: 14px; text-align: center; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 8px; }
.composer textarea:focus-visible, .sh-q:focus-visible { outline: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; } }

/* ---- threads + artifacts, Claude-projects style (14.11.2026) ---- */
.tcard { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; padding: 13px 14px; border: 1px solid var(--line-2);
  border-radius: 16px; background: transparent; color: var(--ink); text-decoration: none; font-size: 16px; min-width: 0; }
.tcard:hover { border-color: var(--ink-3); }
.tcard .tct { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.tcard .dot { margin: 0; }
.tcard .dot.working { background: #4c8dff; } .tcard .dot.done { background: var(--ok); box-shadow: none; animation: none; }
.tcard .dot.review, .tcard .dot.blocked { background: var(--warn); } .tcard .dot.failed { background: var(--bad); }
.artbadge { display: inline-flex; align-items: center; gap: 5px; flex: none; font-size: 13px; color: var(--ink-2); background: var(--surface-2);
  border-radius: 999px; padding: 3px 10px 3px 8px; }
.artbadge svg { width: 14px; height: 14px; }
.artcard { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; margin-top: 8px; padding: 10px 12px; border: 0;
  border-radius: 16px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; font: inherit; min-width: 0; }
.artcard:hover { background: var(--surface-2); }
.arttile { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); }
.arttile svg { width: 20px; height: 20px; }
.artmeta { display: flex; flex-direction: column; min-width: 0; }
.artmeta b { font-weight: 500; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artmeta small { font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.msg.treply .body { color: var(--ink-2); font-size: 15.5px; margin-top: 10px; }
.msg.treply { border-left: 0 !important; padding-left: 0 !important; }
.viewthr { display: flex; align-items: center; justify-content: flex-end; gap: 2px; margin-top: 6px; font-size: 14px; text-decoration: none; }
.viewthr .vl { color: var(--link, #79aaf7); } .viewthr .vn { color: var(--ink-3); white-space: pre; }
.viewthr svg { width: 15px; height: 15px; color: var(--ink-3); }
.tlink { max-width: 100%; vertical-align: bottom; }
.tlink .tlt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.psec { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin: 4px 2px 6px; }
.artlist { margin-bottom: 16px; } .artlist .artcard:first-child { margin-top: 0; }
.artview { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.55); display: flex; }
.avbox { flex: 1; display: flex; flex-direction: column; background: var(--bg); min-width: 0; }
.avhead { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 10px 10px 14px; border-bottom: 1px solid var(--line); }
.avhead .arttile { width: 34px; height: 34px; }
.avt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.avt b { font-weight: 500; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avt small { font-size: 12px; color: var(--ink-3); }
.avbody { flex: 1; min-height: 0; overflow: auto; }
.avbody iframe { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.avpad { padding: 16px; display: grid; place-items: center; min-height: 100%; box-sizing: border-box; }
.avpad img, .avpad video { max-width: 100%; max-height: 80dvh; border-radius: 12px; }
.avdoc { padding: 16px 18px calc(24px + env(safe-area-inset-bottom)); }
.avdoc pre { white-space: pre-wrap; font-family: var(--mono); font-size: 13px; }
@media (min-width: 900px) {
  .artview { padding: 4vh 6vw; }
  .avbox { border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow); }
}
.msg.treply .tcard { max-width: none; }

/* ---- controls matched to the Claude projects phone screenshot (14.11.2026) ---- */
.composer { position: relative; }
.composer .box { border-radius: 28px; background: #262626; border: 1px solid #333; }
.composer textarea { font-size: 17px !important; }
.composer textarea::placeholder { color: #8d8b86; }
.composer .box.open { gap: 8px; }
.composer .cbtn.plus { width: 36px; height: 36px; background: #333; color: #fff; }
.composer .cbtn.plus svg { width: 20px; height: 20px; }
.composer .mchip { height: 36px; min-height: 36px; box-sizing: border-box; border-radius: 999px; background: #333; padding: 0 14px; display: inline-flex; align-items: center; }
.composer .mchip .lbl { font-size: 16px; font-weight: 400; color: #fff; }
.composer .box.open .mchip { max-width: calc(100% - 140px); }
.composer .cbtn.mic { width: 38px; height: 38px; background: #333; color: #e8e8e6; }
.composer .cbtn.mic svg { width: 20px; height: 20px; }
.composer .send { width: 40px; height: 40px; background: #D97757; color: #fff; }
.composer .send svg { width: 20px; height: 20px; stroke-width: 2.6; }
.composer .send.empty:not(.stop) { background: #3a3a3a; color: #8d8b86; }
.composer .send.stop { background: #e8e6e1; color: #1a1a1a; }
.tobottom { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); width: 40px; height: 40px; border-radius: 50%;
  background: #1f1f1f; border: 1px solid #333; color: #e8e8e6; display: none; place-items: center; padding: 0; z-index: 5; cursor: pointer; }
.tobottom.on { display: grid; }
.tobottom svg { width: 20px; height: 20px; }
.head .menu-btn { background: none; }
.ctitle .tile { width: 28px; height: 28px; border-radius: 8px; background: #2a2a2a; }
.ctitle .tile svg { width: 18px !important; height: 18px !important; }
.ctitle.row1 b { font-size: 20px; font-weight: 500; color: #fff; }
.tcard { min-height: 60px; padding: 0 16px; border-color: #3a3a3a; }
.tcard .tct { font-size: 17px; }
.artbadge { background: #2a2a2a; font-size: 15px; color: #9a9893; padding: 4px 12px 4px 10px; }
.artcard { min-height: 72px; background: #141414; }
.artcard:hover { background: #1a1a1a; }
.artcard .arttile, .avhead .arttile { width: 44px; height: 44px; border-radius: 10px; background: #1f1f1f; }
.artmeta b { font-size: 17px; color: #fff; }
.artmeta small { font-size: 14px; color: #8d8b86; }
.tlink { background: rgba(106,167,248,.15) !important; color: #6AA7F8 !important; }
.msg.me .body { background: #303030 !important; border-radius: 24px !important; }
.viewthr .vl { color: #6AA7F8; } .viewthr .vn, .viewthr svg { color: #8d8b86; }
.composer .box { border-radius: 28px !important; }
.composer .box .mchip { height: 36px !important; min-height: 36px !important; background: #333 !important; }
.head .ctitle.row1 b { font-size: 20px !important; font-weight: 500 !important; color: #fff !important; }

/* launched threads: hook line + compact chip under the coordinator's acknowledgement */
.launch { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 0 16px; min-width: 0; }
.launch + .launch { margin-top: 2px; }
.launch .hook { flex: none; width: 22px; height: 20px; margin-top: -6px; border-left: 1.5px solid #4a4a48; border-bottom: 1.5px solid #4a4a48; border-bottom-left-radius: 14px; }
.lchip { display: inline-flex; align-items: center; gap: 9px; min-width: 0; max-width: min(100%, 420px); padding: 4px 10px 4px 8px; margin-top: 2px; border-radius: 10px;
  color: #b5b5b2; text-decoration: none; font-size: 15px; line-height: 1.4; transition: background .15s; }
.lchip:hover, .lchip:focus-visible { background: #262626; color: #ecebe8; }
.lchip .lic { flex: none; display: flex; color: #8d8b86; }
.lchip .lic svg { width: 18px; height: 18px; }
.lchip .lct { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lchip .lst { flex: none; font-size: 12.5px; padding: 1px 8px; border-radius: 999px; background: #2a2a2a; color: #9a9893; }
.lchip .lst.done { color: var(--ok); background: rgba(108,199,149,.12); }
.lchip .lst.blocked { color: #f0a43a; background: rgba(240,164,58,.13); }
.lchip .lst.review { color: #6AA7F8; background: rgba(106,167,248,.13); }
.lchip .lst.failed { color: #ef6a5a; background: rgba(239,106,90,.13); }

/* typing indicator: three dots in a row with a staggered pulse (flex + fixed px, robust on iOS WebKit) */
.typing { padding: 2px 16px; }
.tybub { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 36px; border-radius: 18px; background: #2b2b2b; flex: none; overflow: visible; }
.tydots { display: inline-flex; align-items: center; justify-content: center; gap: 5px; width: auto; height: 12px; flex: none; }
.tydots i { display: block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #b3b1ab; opacity: .35;
  -webkit-animation: tyb 1.2s ease-in-out infinite both; animation: tyb 1.2s ease-in-out infinite both; will-change: transform, opacity; }
.tydots i:nth-child(2) { -webkit-animation-delay: .16s; animation-delay: .16s; }
.tydots i:nth-child(3) { -webkit-animation-delay: .32s; animation-delay: .32s; }
.tydots.sm { gap: 3px; height: 10px; }
.tydots.sm i { width: 5px; height: 5px; }
@-webkit-keyframes tyb { 0%, 60%, 100% { opacity: .35; -webkit-transform: translateY(0); transform: translateY(0); } 30% { opacity: 1; -webkit-transform: translateY(-3px); transform: translateY(-3px); } }
@keyframes tyb { 0%, 60%, 100% { opacity: .35; -webkit-transform: translateY(0); transform: translateY(0); } 30% { opacity: 1; -webkit-transform: translateY(-3px); transform: translateY(-3px); } }
/* with Reduce Motion on (common on iPhones) the dots still fade in turn, without moving; beats the global reduced-motion rule */
@-webkit-keyframes tyfade { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
@keyframes tyfade { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tydots i { -webkit-animation: tyfade 1.2s ease-in-out infinite both !important; animation: tyfade 1.2s ease-in-out infinite both !important; }
  .tydots i:nth-child(2) { -webkit-animation-delay: .16s !important; animation-delay: .16s !important; }
  .tydots i:nth-child(3) { -webkit-animation-delay: .32s !important; animation-delay: .32s !important; } }
/* spoken replies toggle (next to the mic) */
.composer .cbtn.spk { width: 38px; height: 38px; background: #333; color: #8d8b86; flex: none; }
.composer .cbtn.spk svg { width: 19px; height: 19px; }
.composer .cbtn.spk.on { color: #D97757; }
.composer .box.open .spk { order: 4; }
.composer .box.open .mchip { max-width: calc(100% - 190px); }
/* mic states: recording = red with a stop square and a pulsing ring, transcribing = spinner */
.composer .cbtn.mic.rec { background: #e5484d; color: #fff; animation: micring 1.2s ease-out infinite; }
.composer .cbtn.mic.rec svg { width: 16px; height: 16px; }
.composer .cbtn.mic.busy { background: #333; animation: none; }
.composer .cbtn.mic .spin { width: 18px; height: 18px; border: 2.5px solid #5a5a5a; border-top-color: #e8e8e6; border-radius: 50%; animation: sp .8s linear infinite; display: block; }
@keyframes micring { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); } 100% { box-shadow: 0 0 0 12px rgba(229, 72, 77, 0); } }
.composer .box:has(.mic.rec, .mic.busy) .send.empty { background: #D97757; color: #fff; }
/* recording bar: while recording the whole box becomes  [✕] · · · · · ·  [■] [↑] */
.composer .rcx, .composer .rwave { display: none; }
.composer .box.recmode { flex-direction: row !important; flex-wrap: nowrap !important; align-items: center; padding: 7px !important; gap: 8px; }
.composer .box.recmode > :not(.rcx):not(.rwave):not(.mic):not(.send) { display: none !important; }
.composer .box.recmode .rcx { display: grid; place-items: center; order: 0; flex: none; width: 40px; height: 40px; border-radius: 50%; background: #333; color: #e8e8e6; border: 0; }
.composer .box.recmode .rcx svg { width: 18px; height: 18px; }
.composer .box.recmode .rwave { display: flex; order: 1; flex: 1 1 auto; min-width: 0; height: 40px; align-items: center; justify-content: space-between; gap: 3px; padding: 0 6px; overflow: hidden; }
.composer .rwave i { flex: none; width: 4px; height: 4px; border-radius: 2px; background: #8d8b86; transition: height .07s linear; }
.composer .box.recmode .mic { order: 2; flex: none; }
.composer .box.recmode .send { order: 3; flex: none; }
.composer .box.recmode .cbtn.mic.rec { width: 40px; height: 40px; background: #333; color: #fff; animation: none; }
.composer .box.recmode .cbtn.mic.rec svg { width: 15px; height: 15px; }

/* thread reports in the project chat: compact chip header (no banner), text folded to ~4 lines until tapped */
.rchip { display: inline-flex; align-items: center; gap: 9px; max-width: 100%; min-width: 0; padding: 4px 10px 4px 8px; margin-left: 6px; border-radius: 10px;
  color: #b5b5b2; text-decoration: none; font-size: 15px; line-height: 1.4; align-self: flex-start; }
.rchip:hover, .rchip:focus-visible { background: #262626; color: #ecebe8; }
.rchip .lic { flex: none; display: flex; color: #8d8b86; } .rchip .lic svg { width: 18px; height: 18px; }
.rchip .lct { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rchip .lst { flex: none; font-size: 12.5px; padding: 1px 8px; border-radius: 999px; background: #2a2a2a; color: #9a9893; }
.rchip .lst.done { color: var(--ok); background: rgba(108,199,149,.12); } .rchip .lst.blocked { color: #f0a43a; background: rgba(240,164,58,.13); }
.rchip .lst.review { color: #6AA7F8; background: rgba(106,167,248,.13); } .rchip .lst.failed { color: #ef6a5a; background: rgba(239,106,90,.13); }
.msg.treply { display: flex; flex-direction: column; }
.msg.treply .body { margin-top: 4px !important; }
.msg.treply .body.clamp.long { max-height: 6.4em; overflow: hidden; cursor: pointer; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.msg.treply .body.clamp.long.open { max-height: none; -webkit-mask-image: none; mask-image: none; }
/* the scroll-to-latest button: solid, with a ring, so it never reads as part of the text under it */
.tobottom { background: #2a2a2a !important; border-color: #444 !important; box-shadow: 0 0 0 6px #1a1a1a, 0 4px 14px rgba(0,0,0,.5); }
.feed .inner { padding-bottom: 24px; }
.artmore { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.artmore button { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; padding: 3px 10px 3px 8px; border: 0; border-radius: 999px;
  background: #262626; color: #9a9893; font: inherit; font-size: 13px; cursor: pointer; }
.artmore button:hover { color: #ecebe8; }
.artmore svg { width: 14px; height: 14px; flex: none; }
.artmore span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- decision list (v73): glanceable cards, one tap to decide */
.head .iconbtn { position: relative; }
.dcount { position: absolute; top: 3px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  font: 700 11px/17px system-ui, sans-serif; text-align: center; }
.dcount.urgent { background: var(--warn); }
.dcount[hidden], .dbusy[hidden] { display: none; }
.dhead { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.dhead b { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.dbusy { display: inline-flex; align-items: center; }
.dcard { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dcard.p1 { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.dq { display: flex; align-items: flex-start; gap: 8px; }
.dq b { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; line-height: 1.35; padding-top: 3px; overflow-wrap: anywhere; }
.dq .urg { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-top: 9px; }
.dq .dmorebtn { width: 30px; height: 30px; margin: -2px -6px 0 0; color: var(--ink-3); }
.dq .dmorebtn svg { width: 18px; height: 18px; }
.dctx { margin: -2px 0 0; font-size: 13px; color: var(--ink-3); line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dopts { display: flex; flex-wrap: wrap; gap: 6px; }
.dopt { border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); border-radius: 99px; padding: 5px 12px; min-height: 36px; font-size: 14px; font-weight: 500; }
.dopt:hover { border-color: var(--ink-3); }
.dopt.rec { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.dmore { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.dmore p, .dmore ul { margin: 0; }
.dmore b { color: var(--ink); font-weight: 600; }
.ddet { padding-left: 16px; display: flex; flex-direction: column; gap: 2px; }
.dsub { font-size: 12px; color: var(--ink-3); }
.dact { display: flex; gap: 16px; flex-wrap: wrap; }
.dlink { border: 0; background: none; padding: 2px 0; color: var(--accent); font-size: 13px; min-height: 28px; }
.dlink.dim { color: var(--ink-3); }
.dsend { display: flex; flex-direction: column; gap: 6px; }
.dsend textarea { width: 100%; resize: vertical; border: 1px solid var(--line-2); background: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 15px; }
.dsend .drow { display: flex; gap: 8px; }
.dfbs { display: flex; flex-direction: column; gap: 4px; }
.dfb { display: flex; flex-direction: column; gap: 3px; }
.dfb p { margin: 0; }
.dfb .you { align-self: flex-end; background: var(--user); border-radius: 10px; padding: 4px 9px; max-width: 90%; color: var(--ink); }
.dfb .re { background: var(--surface-2); border-radius: 10px; padding: 4px 9px; max-width: 95%; }
.dfb .re.wait { color: var(--ink-3); font-style: italic; }
.dcard.slim { padding: 8px 12px; gap: 2px; background: none; }
.dcard.slim .dq b { font-weight: 500; font-size: 14px; color: var(--ink-2); padding: 0; }
.dres { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dchose { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-size: 13px; font-weight: 600; }
.dchose svg { width: 14px; height: 14px; }
.dchose.dim { color: var(--ink-3); }
.dfold > summary { cursor: pointer; color: var(--ink-3); font-size: 13px; padding: 6px 0; }
.dfold[open] { display: flex; flex-direction: column; gap: 6px; }

/* ---- native feel (14.11): no browser tap flash, instant pressed states, short view transitions, bigger touch targets */
html { -webkit-tap-highlight-color: transparent; }
button, a, summary, label, .trow, .pcard, .lchip, .rchip, .tlink, .sd-item, .sd-row, .sh-row, [data-art] { touch-action: manipulation; }
button, summary, label.mchip, .trow, .pcard, .lchip, .rchip, .tlink, .sd-item, .sd-row, .sh-row, .tabs, .head, .sd-nav, .composer .cbtn, .composer .send { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img, svg { -webkit-user-drag: none; -webkit-touch-callout: none; }
button, .trow, .pcard, .lchip, .rchip, .tlink, .sd-item, .sd-row, .sh-row, summary { transition: transform .14s ease-out, background-color .14s ease-out, opacity .14s ease-out, filter .14s ease-out; }
.pressed { transition-duration: 0s !important; }
.iconbtn.pressed, .cbtn.pressed { background: rgba(255,255,255,.12) !important; transform: scale(.92); }
.composer .send.pressed { transform: scale(.9); filter: brightness(1.15); }
.btn.pressed, .dopt.pressed, .dbar.pressed, .dsend.pressed { transform: scale(.97); filter: brightness(1.2); }
.trow.pressed, .pcard.pressed, .sd-item.pressed, .sd-row.pressed, .sh-row.pressed, .lchip.pressed, .rchip.pressed { background: #2a2a2a !important; transform: scale(.985); }
.tlink.pressed { filter: brightness(1.35); transform: scale(.97); }
.tabs button.pressed { color: var(--ink); background: rgba(255,255,255,.06); }
summary.pressed { background: rgba(255,255,255,.06); }
/* touch targets: header buttons 44px, composer buttons and chips keep their look but take taps from a 44px area */
.head .iconbtn { width: 44px; height: 44px; }
.composer .cbtn, .composer .send, .lchip, .rchip, .tlink { position: relative; }
.composer .cbtn::before, .composer .send::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; }
.lchip::before, .rchip::before { content: ""; position: absolute; inset: -7px 0; }
.tlink::before { content: ""; position: absolute; inset: -9px 0; }
/* (screen-to-screen slides run from applyView with element.animate) */
@keyframes vin-fade { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 860px) { .main.vt-in .chat { animation: vin-fade .2s ease-out; } }
.pbody.vt-tab > * { animation: vin-fade .16s ease-out; }
.modal-bg { animation: fadein .15s; }
.modal { animation: modalin .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes modalin { from { transform: translateY(14px) scale(.97); opacity: 0; } }
/* placeholder rows while a panel tab loads for the first time */
.skel { height: 58px; border-radius: 12px; background: linear-gradient(90deg, #1e1e1e 0, #262626 40%, #1e1e1e 80%) 0 0 / 300% 100%; animation: skel 1.1s linear infinite; margin-bottom: 8px; }
@keyframes skel { to { background-position: -150% 0; } }
/* long feeds: skip layout and paint for messages far off screen (opening a thread and going back to the chat re-laid out every message) */
.feed .inner > .msg { content-visibility: auto; contain-intrinsic-size: auto 90px; }

/* code blocks: copy button top right (always visible), long lines wrap at phone width */
.cblock { position: relative; margin: 8px 0; }
.cblock pre { margin: 0; padding-right: 48px; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; -webkit-user-select: text; user-select: text; }
.cblock .cpy { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border: 0; border-radius: 9px; background: rgba(40,40,40,.92); color: #c9c7c2; display: grid; place-items: center; z-index: 1; }
.cblock .cpy::before { content: ""; position: absolute; inset: -4px; }
.cblock .cpy svg { width: 18px; height: 18px; }
.cblock .cpy.done { color: var(--ok); }
.cblock .cpy.pressed { background: #3a3a3a; transform: scale(.92); }
/* decision cards inside the project chat (v79) */
.msg.dmsg { width: 100%; max-width: 620px; }
.msg.dmsg .dcard { background: var(--surface); }
.msg.dmsg .dcard.slim { background: none; border-style: dashed; padding: 6px 12px; }
/* picture options and mini apps on decision cards (v80) */
.dimgs { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -12px; padding: 2px 12px 4px; scrollbar-width: none; overscroll-behavior-x: contain; }
.dimgs::-webkit-scrollbar { display: none; }
.dimg { position: relative; flex: 0 0 auto; width: min(62%, 220px); scroll-snap-align: start; padding: 0; border: 2px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; text-align: left; }
.dimg img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); pointer-events: none; }
.dimg .noimg { display: block; width: 100%; aspect-ratio: 4 / 3; background: var(--surface-2); }
.dimg .dil { padding: 6px 10px; font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dimg .dil b { color: var(--accent); }
.dimg.rec { border-color: var(--accent); }
.dimg.rec .dil { background: var(--accent-soft); }
.dimg .dzoom { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; }
.dimg .dzoom svg { width: 15px; height: 15px; }
.dapp { display: block; width: 100%; height: 300px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
/* confidence + Decided tab (v81) */
.dq .dconf { flex: none; font-size: 12px; color: var(--ink-3); padding-top: 5px; font-variant-numeric: tabular-nums; }
.hhead { font-size: 13px; color: var(--ink-3); line-height: 1.6; }
.hhead input { width: 56px; padding: 2px 6px; margin: 0 2px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; text-align: center; }
.hrow { border-bottom: 1px solid var(--line); padding: 8px 2px; display: flex; flex-direction: column; gap: 4px; }
.hrow .hq { font-size: 14px; color: var(--ink); }
.hmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.hchoice { color: var(--ok); font-weight: 600; }
.hwas { color: var(--ink-3); }
.hby { font-size: 12px; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 99px; padding: 0 7px; }
.hby.auto { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.hago { font-size: 12px; color: var(--ink-3); }
.hrow .dlink { min-height: 24px; }
#dhist { align-self: flex-start; }
.tabs button { flex: none; }

/* queued sends + stop next to the working dots (Send never turns into Stop) */
.msg.me .mstate .qd { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #8d8b86; }
.msg.me .mstate .qd::before { content: ''; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid currentColor; box-sizing: border-box; animation: qdp 1.6s ease-in-out infinite; }
@keyframes qdp { 50% { opacity: .35; } }
.typing .tystop { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #3a3a3a; background: transparent; color: #a3a19c; display: grid; place-items: center; padding: 0; position: relative; }
.typing .tystop::after { content: ''; position: absolute; inset: -7px; }
.typing .tystop svg { width: 13px; height: 13px; }
.typing .tystop:active, .typing .tystop.pressed { background: rgba(255,255,255,.08); }
.typing .tystop:disabled { opacity: .4; }
/* pictures on cards: thumbnails the card talks about, and one row of picks per item (v82) */
.dmedia { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
.dmedia::-webkit-scrollbar { display: none; }
.dthumb { position: relative; flex: none; width: 96px; border-radius: 8px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.dthumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.dthumb i { position: absolute; left: 0; right: 0; bottom: 0; font: 600 11px/1.6 system-ui, sans-serif; font-style: normal; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); padding: 6px 5px 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dpart { display: flex; flex-direction: column; gap: 4px; }
.dpl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.dpl span { font-weight: 400; color: var(--ink-3); }
.dimgs.sm .dptile { width: min(40%, 150px); }
.dptile { position: relative; flex: 0 0 auto; scroll-snap-align: start; padding: 0; border: 2px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; text-align: left; opacity: .6; }
.dptile.on { border-color: var(--accent); opacity: 1; }
.dptile img, .dptile .noimg { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); pointer-events: none; }
.dptile .dil { padding: 3px 8px; font-size: 12px; font-weight: 600; color: var(--ink); }
.dptile.rec .dil::after { content: " ★"; color: var(--accent); }
.dptile .dtick { position: absolute; top: 5px; left: 5px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.dptile .dtick svg { width: 14px; height: 14px; }
.dptile .dzoom { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; }
.dptile .dzoom svg { width: 13px; height: 13px; }
.dcard .drow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dcard .drow .dsub { flex: 1; min-width: 0; }
/* ---- projects list (15.11): copy of the Claude mobile app's Projects screen */
.home.pl { padding: 0; display: flex; flex-direction: column; background: #161616; font-family: -apple-system, system-ui, "Inter", "Segoe UI", Roboto, sans-serif; color: #fff; }
.pl-bar { position: sticky; top: 0; z-index: 5; height: 56px; flex: none; display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; padding: env(safe-area-inset-top, 0px) 4px 0; background: #161616; }
.pl-bar h1 { margin: 0; text-align: center; font-size: 21px; font-weight: 600; letter-spacing: -.01em; color: #fff; }
.pl-ib { width: 48px; height: 48px; display: grid; place-items: center; border: 0; background: none; color: #e8e8e8; border-radius: 50%; cursor: pointer; padding: 0; }
.pl-ib svg { width: 24px; height: 24px; }
#plf svg { width: 22px; height: 22px; }
.pl-ib.on { color: #fff; background: rgba(255,255,255,.1); }
.pl-search { display: flex; align-items: center; gap: 8px; margin: 2px 16px 6px; padding: 0 4px 0 14px; height: 44px; border-radius: 12px; background: #222; border: 1px solid #333; color: #8a8a8a; }
.pl-search[hidden] { display: none; }
.pl-search > span svg { width: 18px; height: 18px; display: block; }
.pl-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: #fff; font: inherit; font-size: 16px; }
.pl-search .pl-ib { width: 36px; height: 36px; }
.pl-search .pl-ib svg { width: 18px; height: 18px; }
.pl-list { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 6px 0 calc(110px + env(safe-area-inset-bottom, 0px)); }
.home.pl .pcard.pl-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 80px; padding: 16px 24px; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: none; text-align: left; color: #fff; font: inherit; }
.home.pl .pcard.pl-row:hover { background: rgba(255,255,255,.03); }
.home.pl .pcard.pl-row.pressed { background: #222 !important; transform: none; }
.pl-tile { flex: none; width: 40px; height: 40px; border-radius: 10px; background: #262626; color: #bdbdbd; display: grid; place-items: center; }
.pl-tile svg { width: 20px; height: 20px; }
.pl-tile.purple { background: rgba(124,108,255,.15); color: #8f80ff; }
.pl-tile.orange { background: rgba(232,98,52,.16); color: #f0703f; }
.pl-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pl-l1 { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.home.pl .pl-name { flex: 1 1 auto; min-width: 0; display: block; margin: 0; font-size: 20px; font-weight: 450; line-height: 1.25; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home.pl .pl-time, .home.pl .pl-meta { color: #8a8a8a; font-size: 16px; line-height: 1.25; }
.pl-time { flex: none; margin-left: auto; white-space: nowrap; }
.pl-empty { padding: 40px 20px; text-align: center; color: #8a8a8a; font-size: 16px; }
.pl-fab { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; padding: 0 16px calc(18px + env(safe-area-inset-bottom, 0px)); pointer-events: none; max-width: 800px; margin: 0 auto; }
.pl-fab > * { pointer-events: auto; }
.pl-sbtn { width: 52px; height: 52px; border-radius: 50%; background: #1f1f1f; border: 1px solid #333; color: #fff; display: grid; place-items: center; padding: 0; cursor: pointer; }
.pl-sbtn svg { width: 24px; height: 24px; }
.pl-new { height: 52px; padding: 0 22px; border-radius: 999px; background: #fff; color: #000; border: 0; display: flex; align-items: center; gap: 8px; font: inherit; font-size: 17px; font-weight: 500; cursor: pointer; box-shadow: 0 4px 18px rgba(0,0,0,.4); }
.pl-new svg { width: 20px; height: 20px; }
.pl-sbtn.pressed, .pl-new.pressed { transform: scale(.95); filter: brightness(.9); }
/* server-health pill sits under the top bar on this screen instead of over the title */
body:has(.home.pl) #wbh { top: calc(env(safe-area-inset-top, 0px) + 58px); }
body:has(#wbh.warn) .pl-bar, body:has(#wbh.crit) .pl-bar { margin-bottom: 40px; }
.pl-search input::-webkit-search-cancel-button { display: none; }
@media (min-width: 861px) { .pl-fab { left: 260px; } }
/* ---- end projects list */

/* press-and-hold project menu */
.sheet.mini { height: auto; }
.sheet.mini .sh-list { padding-bottom: 16px; }
.sh-row.danger .sh-name { color: var(--bad); }
/* server-wide cards on the Projects page (v85) */
.gdec { display: flex; flex-direction: column; gap: 8px; padding: 0 16px; max-width: 760px; width: 100%; margin: 0 auto 8px; box-sizing: border-box; }
.gdec:empty { display: none; }
.gdh { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); padding-top: 4px; }
/* ---- keyboard (15.11): page follows the visible area (iOS lays the keyboard over the page), inputs >= 16px so iOS doesn't zoom */
/* only while the keyboard is up: otherwise the fixed full-screen body follows Safari's toolbar by itself
   (sizing to visualViewport.height all the time left a toolbar-high gap under the composer on iOS) */
html.kb body { top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100%); }
html.kb .pl-fab { display: none; }
/* keyboard covers the home-indicator area: drop the safe-area inset under the composer (it left a ~50px gap above the keyboard bar) */
html.kb .composer { padding-bottom: 6px; }
/* full-screen overlays are fixed to the layout viewport, so they follow the visible area too */
html.kb .modal-bg, html.kb .sheet-bg, html.kb .artview { top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100%); }
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), textarea, select { font-size: 16px !important; }
  .composer textarea { font-size: 17px !important; }
}
/* ---- end keyboard */
/* composer placeholder: never wraps or clips (ellipsis if even the short wording does not fit) */
.composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* reply-in-own-words icon + dictation on cards (v90) */
.dq .dmorebtn + .dmorebtn { margin-left: -4px; }
.dmic { width: 34px; height: 34px; color: var(--ink-2); }
.dmic svg { width: 18px; height: 18px; }
.dmic.rec { color: #fff; background: var(--bad); border-radius: 50%; }
.dmic.busy { opacity: .5; }
/* ---- older messages loading at the top of a chat (15.11) */
.feedmore { display: flex; justify-content: center; padding: 14px 0 6px; min-height: 40px; }
.feedmore .spin { width: 18px; height: 18px; }
/* ---- end older messages */
/* press-and-hold on your own bubble opens the delete menu: no text-selection callout fighting it on phones */
@media (pointer: coarse) { .feed .msg.me .body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }
/* spoken-replies toggle lives in the sidebar footer (15.11); the composer keeps only + / text / mic / send */
.composer .cbtn.spk { display: none !important; }
.composer .box.open .mchip { max-width: calc(100% - 140px); }
.sd-foot .sd-voice { margin-left: 6px; color: #b9b7b1; }
.sh-row.vtoggle { position: relative; padding-right: 64px; }
.sh-row.vtoggle .sw { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 40px; height: 24px; border-radius: 12px; background: #444; transition: background .15s; }
.sh-row.vtoggle .sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.sh-row.vtoggle .sw.on { background: #D97757; }
.sh-row.vtoggle .sw.on::after { left: 19px; }
.vstop { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; border: 0; background: #333; color: #fff; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.vstop svg { width: 16px; height: 16px; }

/* decision-card video thumbnails + failed-load fallback */
.dvwrap { position: relative; display: block; pointer-events: none; }
.dvwrap .dposter { display: block; width: 100%; object-fit: cover; background: #111; }
.dthumb .dposter, .dptile .dposter { aspect-ratio: 16 / 9; }
.dimg .dposter { aspect-ratio: 4 / 3; }
.dthumb .dplay { top: 7px; left: 50%; width: 22px; height: 22px; margin: 0 0 0 -11px; }
.dthumb .dplay::after { left: 8px; top: 6px; border-width: 5px 0 5px 8px; }
.dthumb video, .dimg video, .dptile video { display: block; width: 100%; object-fit: cover; background: #111; pointer-events: none; }
.dthumb video, .dptile video { aspect-ratio: 16 / 9; }
.dimg video { aspect-ratio: 4 / 3; }
.dplay { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: rgba(0,0,0,.55); pointer-events: none; }
.dplay::after { content: ""; position: absolute; left: 13px; top: 10px; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #fff; }
.noimg.dfail { display: grid !important; place-items: center; width: 100%; aspect-ratio: 16 / 9; background: var(--surface-2); color: var(--ink-3, #888); font: 500 11px/1.2 system-ui, sans-serif; font-style: normal; text-align: center; padding: 4px; box-sizing: border-box; }
.dimg .noimg.dfail { aspect-ratio: 4 / 3; }
.lightbox video { max-width: 100%; max-height: 100%; border-radius: 12px; background: #000; }
/* "+" sheet: big attach tiles + voice replies switch */
.plus-sheet { padding: 0 14px calc(14px + env(safe-area-inset-bottom)); }
.plus-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 6px 0 12px; }
.plus-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; border: 1px solid #2c2c2c; border-radius: 16px; background: #262626; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; padding: 10px 4px; cursor: pointer; }
.plus-tile svg { width: 26px; height: 26px; color: var(--accent); }
.plus-tile:active { background: #2f2f2f; transform: scale(.97); }
.plus-voice { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; border: 1px solid #2c2c2c; border-radius: 16px; background: #262626; color: var(--ink); font: inherit; text-align: left; padding: 10px 14px; cursor: pointer; }
.plus-voice:active { background: #2f2f2f; }
.plus-voice .pv-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #333; color: var(--ink-2); flex: none; }
.plus-voice .pv-ic svg { width: 20px; height: 20px; }
.plus-voice[aria-checked="true"] .pv-ic { background: var(--accent-soft); color: var(--accent); }
.plus-voice .pv-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plus-voice .pv-txt b { font-size: 16px; font-weight: 600; }
.plus-voice .pv-txt small { font-size: 13px; color: var(--ink-3); }
.plus-voice .pv-state { font-size: 14px; font-weight: 600; color: var(--ink-3); }
.plus-voice[aria-checked="true"] .pv-state { color: var(--accent); }
.plus-voice .sw { position: relative; width: 46px; height: 28px; border-radius: 14px; background: #444; flex: none; transition: background .15s; }
.plus-voice .sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s; }
.plus-voice .sw.on { background: var(--accent); }
.plus-voice .sw.on::after { left: 21px; }
@media (max-width: 340px) { .plus-grid { grid-template-columns: repeat(2, 1fr); } .plus-voice .pv-state { display: none; } }
/* working dots double as the run menu (tap -> Stop) */
button.tybub { border: 0; padding: 0; color: inherit; cursor: pointer; position: relative; }
button.tybub::after { content: ''; position: absolute; inset: -6px; }
button.tybub:active { background: #343434; transform: scale(.96); }
button.tybub:disabled { opacity: .5; }
.dthumb .noimg.dfail { position: static; background: var(--surface-2); color: var(--ink-3, #888); padding: 4px; }
/* chat load errors (retry instead of an endless spinner) */
.loaderr { text-align: center; color: var(--muted, #888); font-size: 14px; padding: 12px 8px; }
.linkbtn { background: none; border: 0; padding: 4px 6px; color: var(--accent, #2a6df4); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.loadfail { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; }
.loadfail > .iconbtn { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 10px; }
