:root {
  --bg: #f7f7f5; --panel: #ffffff; --side: #f1f0ec; --ink: #1c1c1a; --muted: #6b6a64; --line: #e4e2dc;
  --accent: #c96442; --accent-hover: #b4563a; --accent-ink: #ffffff; --accent-soft: #f6e8e1; --accent-text: #a54a2c;
  --user: #ece9e1; --err: #b3261e; --ok: #2e7d4f; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #1f1e1d; --panel: #2a2927; --side: #181716; --ink: #ecebe6; --muted: #a09f97; --line: #3a3835;
          --accent: #d97757; --accent-hover: #e48a6c; --accent-ink: #1a0f0a; --accent-soft: #3a2a23; --accent-text: #e9967a;
          --user: #34322f; --err: #ff8a80; --ok: #6bd68f; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); color-scheme: dark; }
}
/* the person chose a theme in Settings (data-theme is set on the page; "System" leaves it off and follows the device) */
:root[data-theme="dark"] { --bg: #1f1e1d; --panel: #2a2927; --side: #181716; --ink: #ecebe6; --muted: #a09f97; --line: #3a3835;
          --accent: #d97757; --accent-hover: #e48a6c; --accent-ink: #1a0f0a; --accent-soft: #3a2a23; --accent-text: #e9967a;
          --user: #34322f; --err: #ff8a80; --ok: #6bd68f; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-text="larger"] { font-size: 112.5%; }
:root[data-text="larger"] body { font-size: 17.4px; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15.5px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.nomatch { display: none !important; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.error { color: var(--err); min-height: 1.4em; margin: .5rem 0 0; font-size: .9rem; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* buttons */
.btn, button.primary { font-size: .88rem; font-weight: 500; padding: .45rem .9rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; white-space: nowrap; }
.btn.ghost:hover { background: var(--side); }
.btn.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover, button.primary:hover:not(:disabled) { background: var(--accent-hover); }
button.wide { width: 100%; padding: .7rem; font-size: 1rem; margin-top: .5rem; }
.icon-btn { background: transparent; border: 0; padding: .4rem; border-radius: 8px; color: var(--muted); display: inline-flex; }
.icon-btn:hover { background: var(--line); color: var(--ink); }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 1rem; }
.login-card { width: 100%; max-width: 390px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 2rem 1.75rem; box-shadow: var(--shadow); }
.login-card h1 { font-size: 1.45rem; margin: .75rem 0 .25rem; }
.login-card .muted { margin: 0 0 1rem; font-size: .93rem; }
label { display: block; margin: .8rem 0 0; font-size: .85rem; font-weight: 500; }
label input { margin-top: .3rem; }
input, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .65rem .75rem; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 1.25rem; }
.logo.sm { width: 24px; height: 24px; border-radius: 8px; font-size: .8rem; display: inline-grid; vertical-align: middle; }
.logo.has-img { background: transparent; width: auto; height: 40px; border-radius: 0; display: flex; justify-content: flex-start; align-items: center; }
.logo.sm.has-img { width: auto; border-radius: 0; display: inline-flex; height: 24px; margin-right: .35rem; }
.logo.big.has-img { width: auto; border-radius: 0; height: 56px; justify-content: center; margin: 0 auto 1rem; }
.logo > svg { width: 64%; height: 64%; display: block; }
.logo.sm > svg { width: 76%; height: 76%; }
.msg.assistant .avatar-a > svg { width: 70%; height: 70%; display: block; }
.logo > img { height: 100%; width: auto; max-width: 220px; object-fit: contain; display: block; }
.logo.big { width: 52px; height: 52px; border-radius: 16px; font-size: 1.6rem; margin: 0 auto 1rem; }

/* layout */
#app { display: grid; grid-template-columns: 272px minmax(0, 1fr); height: 100vh; height: 100dvh; }
#sidebar { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 1rem .75rem; gap: .5rem; min-height: 0; }
.brand { font-weight: 650; padding: .25rem .5rem .75rem; display: flex; gap: .5rem; align-items: center; }
.new { display: flex; gap: .5rem; align-items: center; justify-content: center; padding: .6rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-weight: 500; }
.new:hover { border-color: var(--accent); }
.section-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .9rem .5rem .2rem; }
#session-list { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; }
#session-list button { width: 100%; text-align: left; background: transparent; border: 0; padding: .55rem .6rem; border-radius: 8px; display: flex; gap: .55rem; align-items: center; min-width: 0; }
#session-list button:hover { background: var(--line); }
#session-list li.active button { background: var(--panel); box-shadow: 0 0 0 1px var(--line); }
#session-list .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex: none; }
.dot.working { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.dot.review { background: var(--ok); }
.dot.failed { background: var(--err); }
.dot.news { background: var(--accent); }
.dot.attn { background: var(--warn); }
.rstat { margin-left: auto; flex: none; font-size: .68rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 .4rem; white-space: nowrap; }
.rstat.working { color: var(--accent-text); border-color: var(--accent); }
.rstat.attn { color: var(--warn); border-color: var(--warn); }
.user-row { display: flex; align-items: center; gap: .6rem; padding: .6rem .5rem 0; border-top: 1px solid var(--line); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: 650; font-size: .8rem; text-transform: uppercase; }
#whoami { flex: 1; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }

#chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.topbar { display: flex; flex-wrap: wrap; row-gap: .4rem; align-items: center; gap: .6rem; padding: .7rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--bg); }
.topbar h2 { margin: 0; font-size: 1rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 8rem; max-width: 100%; }
.pill { font-size: .75rem; padding: .15rem .55rem; border-radius: 999px; background: var(--user); color: var(--muted); white-space: nowrap; }
.pill.working { background: var(--accent-soft); color: var(--accent-text); }
.pill.review { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.banner { margin: .75rem auto 0; width: calc(100% - 2.5rem); max-width: 760px; padding: .65rem .9rem; border-radius: 12px; background: color-mix(in srgb, var(--ok) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line)); font-size: .92rem; }
.banner a { color: var(--ok); font-weight: 600; }

#scroller { flex: 1; overflow-y: auto; min-height: 0; }
#thread { max-width: 760px; margin: 0 auto; padding: 1.5rem 1.25rem 1rem; min-height: 100%; display: flex; flex-direction: column; }
#messages { display: flex; flex-direction: column; gap: 1.25rem; }
.jump { position: absolute; left: 50%; transform: translateX(-50%); bottom: 150px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .9rem; font-size: .82rem; box-shadow: var(--shadow); }

/* empty state */
.empty { text-align: center; margin: auto; padding: 2rem 0; max-width: 520px; }
.empty h3 { font-size: 1.5rem; margin: 0 0 .4rem; font-weight: 650; }
.empty .muted { margin: 0 0 1.25rem; }
#empty-start { margin: 0 0 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.chip { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem; font-size: .84rem; color: var(--muted); }
.chip:hover { border-color: var(--accent-text); color: var(--accent-text); }

/* messages */
.msg { display: flex; gap: .75rem; }
.msg.user { justify-content: flex-end; }
.msg.user .body { background: var(--user); border-radius: 18px 18px 4px 18px; padding: .6rem 1rem; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.assistant .avatar-a { flex: none; width: 28px; height: 28px; margin-top: 2px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: .8rem; }
.msg.assistant .body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.body p { margin: 0 0 .7em; } .body p:last-child { margin-bottom: 0; }
.body h3, .body h4 { margin: 1em 0 .35em; font-size: 1.02rem; }
.body ul, .body ol { margin: 0 0 .7em; padding-left: 1.4rem; } .body li { margin: .15em 0; }
.body a { color: var(--accent-text); text-underline-offset: 2px; }
.body strong { font-weight: 650; }

/* steps (what the assistant is doing) */
.steps { margin-left: 2.5rem; display: flex; flex-direction: column; gap: .3rem; }
.step { display: flex; align-items: center; gap: .55rem; font-size: .88rem; color: var(--muted); padding: .3rem .65rem; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; width: fit-content; max-width: 100%; }
.step .ico { width: 14px; height: 14px; flex: none; display: grid; place-items: center; font-size: .8rem; line-height: 1; }
.step.running .ico { border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.step.done .ico { color: var(--ok); } .step.done .ico::before { content: "✓"; }
.step.failed .ico { color: var(--err); } .step.failed .ico::before { content: "✕"; }
.step.running { color: var(--ink); }

.typing { margin-left: 2.5rem; display: flex; gap: 4px; padding: .3rem 0; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }

/* composer */
.dock { max-width: 760px; width: 100%; margin: 0 auto; padding: .5rem 1.25rem calc(.75rem + env(safe-area-inset-bottom)); }
.composer { display: flex; flex-direction: column; gap: .15rem; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: .6rem .6rem .5rem 1rem; box-shadow: var(--shadow); }
.composer-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .35rem; margin-left: -.35rem; }
.composer:focus-within { border-color: var(--accent); }
.composer textarea { padding-right: .5rem; border: 0; background: transparent; resize: none; padding: .45rem 0; max-height: 200px; outline: none !important; }
.send { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.send:hover:not(:disabled) { background: var(--accent-hover); }
.send.stop { background: var(--ink); color: var(--bg); }
.hint { margin: .4rem .5rem 0; font-size: .75rem; color: var(--muted); text-align: center; }
#count { color: var(--err); margin-right: .6rem; }
.notice { margin-bottom: .5rem; padding: .55rem .85rem; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: .9rem; }
.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 12px; font-size: .9rem; box-shadow: var(--shadow); max-width: 90vw; z-index: 30; }

.only-mobile { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 19; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }

@media (max-width: 800px) {
  #app { grid-template-columns: 1fr; }
  #sidebar { position: fixed; inset: 0 auto 0 0; width: 82vw; max-width: 320px; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  #app.menu-open #sidebar { transform: none; }
  .only-mobile { display: inline-flex; }
  .topbar { padding: .6rem .75rem; }
  .topbar .btn.ghost { display: none; }
  #thread, .dock { padding-left: .9rem; padding-right: .9rem; }
  .steps, .typing { margin-left: 2.25rem; }
}

/* attachments */
.attach-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: .1rem 0 .4rem; }
.file-chip { display: inline-flex; align-items: center; gap: .4rem; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .25rem .35rem .25rem .6rem; font-size: .82rem; max-width: 100%; }
.file-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.file-chip.up { opacity: .6; }
.file-chip button { border: 0; background: transparent; color: var(--muted); padding: 0 .25rem; font-size: .9rem; }
.drop { position: fixed; inset: 0; z-index: 25; background: color-mix(in srgb, var(--accent) 14%, transparent); border: 3px dashed var(--accent); display: grid; place-items: center; font-size: 1.3rem; font-weight: 600; color: var(--accent); pointer-events: none; }

/* model picker */
.model-wrap { position: relative; min-width: 0; }
.model-btn { background: transparent; border: 1px solid transparent; border-radius: 10px; padding: .3rem .55rem; font-size: .82rem; color: var(--muted); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-btn:hover { background: var(--bg); border-color: var(--line); color: var(--ink); }
.menu { position: absolute; bottom: calc(100% + 8px); left: 0; width: min(360px, 86vw); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: .5rem; z-index: 15; }
.menu input[type=search] { margin-bottom: .4rem; padding: .45rem .6rem; font-size: .88rem; }
#model-list { max-height: 280px; overflow-y: auto; }
.m-group { display: flex; align-items: center; gap: .4rem; width: 100%; border: 0; background: transparent; text-align: left; font-size: .78rem; font-weight: 600; color: var(--ink); padding: .45rem .5rem; border-radius: 8px; margin-top: .15rem; }
.m-group:hover { background: var(--bg); }
.m-group.locked { color: var(--muted); }
.m-group .chev { width: 1em; color: var(--muted); }
.m-group .gname { flex: 1; }
.m-group .gcount { font-weight: 400; color: var(--muted); font-size: .72rem; }
.m-item { padding-left: 1.6rem; }
.m-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: .4rem .5rem; border-radius: 8px; font-size: .88rem; }
.m-item:hover { background: var(--bg); }
.m-item.sel { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.effort { border-top: 1px solid var(--line); margin-top: .4rem; padding-top: .5rem; font-size: .82rem; }
.effort { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.effort.hidden { display: none; }
.eff-label { color: var(--muted); }
.eff-chips { display: flex; gap: .25rem; flex-wrap: wrap; }
.eff-chip { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: .2rem .65rem; font-size: .8rem; }
.eff-chip:hover { background: var(--bg); color: var(--ink); }
.eff-chip.on { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; font-weight: 600; }
/* mode menu (like Claude Code: a name, what it does, its key, a tick on the current one) */
.mode-menu { width: min(320px, 86vw); padding: .4rem; }
.menu-title { font-size: .75rem; color: var(--muted); padding: .3rem .6rem .2rem; }
.mode-item { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; border: 0; background: transparent; padding: .5rem .6rem; border-radius: 10px; color: var(--ink); }
.mode-item:hover, .mode-item:focus-visible { background: var(--bg); }
.mode-item .mi-text { flex: 1; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.mode-item b { font-size: .92rem; font-weight: 600; }
.mode-item small { color: var(--muted); font-size: .78rem; }
.mode-item kbd { font: inherit; font-size: .75rem; color: var(--muted); }
.mode-item .mi-check { width: 1em; color: var(--accent-text); visibility: hidden; }
.mode-item[aria-checked="true"] .mi-check { visibility: visible; }
.mode-btn { color: var(--ink); font-weight: 600; }
.mode-btn.plan, .mode-btn.ask, .mode-btn.team { color: var(--ok); }

/* accounts dialog */
.dialog { max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--ink); width: min(560px, 94vw); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow: auto; overscroll-behavior: contain; padding: 1.25rem; box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog h3 { margin: 0; font-size: 1.15rem; }
.small { font-size: .88rem; }
.prov { border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem; margin-top: .6rem; }
.prov-head { display: flex; align-items: center; gap: .6rem; }
.prov-head strong { flex: 1; }
.badge { font-size: .72rem; padding: .1rem .5rem; border-radius: 999px; background: color-mix(in srgb, var(--ok) 15%, transparent); color: color-mix(in srgb, var(--ok) 65%, var(--ink)); }
.prov-body { margin-top: .6rem; display: flex; flex-direction: column; gap: .5rem; }
.prov-body .row { display: flex; gap: .5rem; }
.prov-body select { width: 100%; padding: .55rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; }
.note { font-size: .85rem; color: var(--muted); }
.m-item.locked { color: var(--muted); }
.m-more { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--accent-text); padding: .35rem .5rem; font-size: .82rem; border-radius: 8px; }
.m-more:hover { background: var(--bg); }

/* mode switch */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: .28rem .6rem; font-size: .8rem; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-checked="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.seg.plan button[aria-checked="true"], .seg.ask button[aria-checked="true"], .seg.team button[aria-checked="true"] { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }

/* usage */
.usage { border: 1px solid transparent; background: transparent; border-radius: 10px; padding: .25rem .5rem; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.usage:hover { background: var(--bg); border-color: var(--line); color: var(--ink); }
.usage-wrap .menu { left: auto; right: 0; width: min(300px, 86vw); padding: .75rem; }
.u-row { display: flex; justify-content: space-between; font-size: .85rem; padding: .15rem 0; }
.u-row span:first-child { color: var(--muted); }
.u-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: .35rem 0 .15rem; }
.u-bar i { display: block; height: 100%; background: var(--accent); }
.u-bar i.high { background: var(--err); }
#compact-btn { margin-top: .6rem; width: 100%; justify-content: center; font-size: .8rem; }

/* model list extras */
.m-item { display: flex; justify-content: space-between; gap: .5rem; }
.m-item .via { color: var(--muted); font-size: .72rem; white-space: nowrap; align-self: center; }
.skill-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: .45rem .55rem; border-radius: 8px; }
.skill-item:hover, .skill-item.active { background: var(--bg); }
.skill-item small { display: block; color: var(--muted); font-size: .76rem; line-height: 1.3; }
.file-chip.skill { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }

.agent-select { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: .28rem .4rem; font-size: .8rem; max-width: 9rem; }
.skill-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .4rem .55rem .1rem; }

.steer { font-size: .78rem; padding: .3rem .65rem; }
.qtag { display: block; font-size: .7rem; color: var(--muted); margin-top: .15rem; text-align: right; }
.msg.user.queued .body { opacity: .65; }
a.new { text-decoration: none; color: inherit; }

.project-select { font: inherit; font-size: .85rem; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: .25rem .5rem; max-width: 14rem; }

.list-tools { display: flex; flex-direction: column; gap: .15rem; padding: .25rem .5rem; }
.link { background: transparent; border: 0; color: var(--muted); font-size: .78rem; text-align: left; padding: .15rem 0; text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--ink); }
#session-list li { position: relative; }
#session-list li button.arch { width: auto; display: inline-block; text-align: center; position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); opacity: 0; border: 0; background: var(--line); color: var(--muted); border-radius: 6px; padding: .1rem .4rem; font-size: .72rem; }
#session-list li:hover .arch, #session-list li:focus-within .arch, #session-list .arch:focus-visible { opacity: 1; }
@media (hover: hover) { #session-list li:hover .dot, #session-list li:hover .rstat { visibility: hidden; } }
@media (hover: none) { #session-list .arch { opacity: 1; } }
.empty-list { padding: .5rem; font-size: .85rem; color: var(--muted); }

/* call to action: send the changes for review */
.cta { margin-left: 2.5rem; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 14px; padding: .8rem 1rem; display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; }
.cta-text { flex: 1 1 260px; font-size: .92rem; }
.cta-actions { display: flex; gap: .5rem; }
.cta .btn.primary { font-size: .9rem; padding: .5rem 1rem; }
#review-btn.attention { animation: ring 1.8s ease-in-out infinite; }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
@media (max-width: 800px) { .cta { margin-left: 2.25rem; } }

/* attachment previews */
.thumb { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; display: block; }
.thumb-big { max-width: 220px; max-height: 160px; border-radius: 10px; display: block; margin-top: .4rem; border: 1px solid var(--line); }
.filelabel { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.attach-warn { flex-basis: 100%; font-size: .82rem; color: var(--err); padding: .1rem 0 .2rem; }

.step.folded { display: none; }
.step { flex-wrap: wrap; cursor: pointer; }
.step-more { flex-basis: 100%; padding-left: 1.45rem; font-size: .8rem; line-height: 1.45; color: var(--muted); }
.steps-summary { align-self: flex-start; border: 0; background: transparent; color: var(--muted); font-size: .8rem; text-decoration: underline; text-underline-offset: 2px; padding: .1rem .2rem; }
.steps-summary:hover { color: var(--ink); }

.list-filter { font: inherit; font-size: .85rem; margin: .1rem .5rem .3rem; width: calc(100% - 1rem); padding: .35rem .5rem; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; }
#session-list .group-head { font-size: .7rem; font-weight: 600; color: var(--muted); padding: .6rem .5rem .15rem; text-transform: uppercase; letter-spacing: .04em; list-style: none; }
#session-list .group-head:first-child { padding-top: .2rem; }
.chat-search { margin: .15rem .5rem .35rem; width: calc(100% - 1rem); padding: .4rem .6rem; font-size: .85rem; }
#chat-title { cursor: text; }

.typing { align-items: center; }
.typing-time { font-style: normal; font-size: .78rem; color: var(--muted); margin-inline-start: .5rem; }

.device-code { display: flex; align-items: center; gap: .75rem; background: var(--accent-soft); border-radius: 12px; padding: .6rem .9rem; margin: .4rem 0; }
.dc-label { font-size: .8rem; color: var(--muted); }
.dc-value { font-size: 1.4rem; letter-spacing: .12em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; flex: 1; }

/* requests: the form and the header chip */
.dialog.wide { width: min(680px, 96vw); overflow: auto; }
#intake-form label { display: block; margin-top: .75rem; font-size: .88rem; font-weight: 600; }
#intake-form label input, #intake-form label select, #intake-form label textarea { display: block; width: 100%; margin-top: .25rem; font: inherit; font-weight: 400; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
#intake-form label textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.in-drop { margin-top: .85rem; padding: .7rem .8rem; border: 1.5px dashed var(--line); border-radius: 12px; display: flex; align-items: center; gap: .6rem .75rem; flex-wrap: wrap; }
.in-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.in-drop .attach-chips { flex-basis: 100%; padding: 0; }
.in-drop .attach-chips:empty { display: none; }
.dialog-actions { display: flex; align-items: center; gap: .75rem; margin-top: 1rem; position: sticky; bottom: -1.25rem; background: var(--panel); padding: .6rem 0 calc(.6rem + env(safe-area-inset-bottom)); }
.req-chip { font: inherit; font-size: .78rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; border: 1px solid var(--line); background: var(--accent-soft); color: var(--ink); cursor: pointer; }
.req-chip:hover { border-color: var(--accent); }
.req-chip .st { margin-left: .4rem; color: var(--muted); font-weight: 500; }
.rd-meta { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 .25rem; }
.rd-meta span { font-size: .78rem; padding: .1rem .55rem; border-radius: 999px; background: var(--accent-soft); }
#rd-body h4 { margin: 1rem 0 .25rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
#rd-body p, #rd-body ul { margin: .15rem 0; }
#rd-body ul { padding-left: 1.2rem; }

/* phones and tablets */
@media (max-width: 800px) {
  .topbar { flex-wrap: wrap; row-gap: .4rem; padding-top: max(.6rem, env(safe-area-inset-top)); padding-left: max(.75rem, env(safe-area-inset-left)); padding-right: max(.75rem, env(safe-area-inset-right)); }
  .topbar h2 { flex: 1 1 0; min-width: 6rem; }
  .topbar .spacer { display: none; }
  .topbar .btn.ghost { display: inline-flex; } /* Undo, Archive and the live link stay reachable on a phone */
  .topbar .btn, .pill, .req-chip { flex: none; }
  .topbar #review-btn { margin-left: auto; }
  #sidebar { visibility: hidden; transition: transform .2s, visibility 0s .2s; padding-bottom: calc(1rem + env(safe-area-inset-bottom)); padding-left: max(.75rem, env(safe-area-inset-left)); }
  #app.menu-open #sidebar { visibility: visible; transition: transform .2s; }
  input, textarea, select { font-size: 16px !important; } /* iOS zooms into smaller fields */
  .jump { bottom: calc(8rem + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(7rem + env(safe-area-inset-bottom)); }
  .admin h2 { flex-wrap: wrap; }
  .table-wrap table { min-width: 640px; }
  .table-wrap td .btn { white-space: nowrap; }
}
@media (max-width: 560px) {
  .composer { position: relative; }
  .composer .model-wrap { position: static; }
  .composer .menu { left: .5rem; right: .5rem; width: auto; bottom: calc(100% + 6px); }
  .model-btn { max-width: 34vw; }
  .composer-bar .send, .composer-bar .steer { margin-left: auto; }
  .composer-bar .steer ~ .send { margin-left: 0; }
  #skill-btn { font-size: 0; padding: .3rem .6rem; }
  #skill-btn::before { content: "/"; font-size: .9rem; }
  .agent-select { max-width: 6.5rem; }
  .dock { padding-left: max(.9rem, env(safe-area-inset-left)); padding-right: max(.9rem, env(safe-area-inset-right)); }
}
@media (pointer: coarse) {
  .icon-btn { min-width: 44px; min-height: 44px; justify-content: center; }
  .mode-item, .model-btn, .usage, .req-chip, .topbar .btn, .link { min-height: 40px; }
  #session-list li button.arch { min-height: 32px; padding: .3rem .65rem; }
  .hint { display: none; }
  #session-list .t { margin-right: 3.4rem; }
}

.support { margin: .5rem .5rem 0; font-size: .78rem; color: var(--muted); }
.support a { color: inherit; }

.rename { flex: none; color: var(--muted); }
.rename:hover { color: var(--ink); }
.title-edit { flex: 1 1 12rem; min-width: 0; font: inherit; font-weight: 600; padding: .25rem .5rem; }

#session-list li button.arch.del { right: 4.6rem; color: var(--err); }

.dev-note { margin-top: .35rem; font-size: .88rem; padding: .4rem .6rem; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 6px; white-space: pre-wrap; }

#preview-banner { display: flex; align-items: flex-start; gap: .5rem; }
#preview-banner.hidden { display: none; }
#preview-banner .banner-text { flex: 1; min-width: 0; }
.banner-close { flex: none; border: 0; background: transparent; color: var(--muted); font-size: 1rem; line-height: 1; padding: .25rem .4rem; border-radius: 8px; cursor: pointer; }
.banner-close:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink); }
@media (pointer: coarse) { .banner-close { min-width: 40px; min-height: 40px; } }

/* the agent's own task list, inside the conversation */
.tasks-card { margin: .4rem 0 .4rem 2.25rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-size: .88rem; max-width: 34rem; }
.tasks-card summary { cursor: pointer; padding: .45rem .8rem; font-weight: 600; color: var(--muted); list-style: none; }
.tasks-card summary::-webkit-details-marker { display: none; }
.tasks-card summary::before { content: "▸ "; } .tasks-card[open] summary::before { content: "▾ "; }
.tasks-card ul { list-style: none; margin: 0; padding: 0 .8rem .55rem; }
.task { display: flex; gap: .5rem; padding: .12rem 0; align-items: baseline; }
.task .tk-ico { flex: none; width: 1.1em; color: var(--muted); text-align: center; }
.task.done { color: var(--muted); } .task.done .tk-text { text-decoration: line-through; }
.task.running { font-weight: 600; } .task.running .tk-ico { color: var(--accent-text); }
.task.cancelled { color: var(--muted); opacity: .7; }
.files-layout { display: grid; grid-template-columns: 13rem 1fr; gap: 1rem; margin-top: .5rem; min-height: 14rem; }
@media (max-width: 640px) { .files-layout { grid-template-columns: 1fr; } }
.files-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.files-list button { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: .45rem .6rem; font: inherit; font-size: .88rem; overflow-wrap: anywhere; }
.files-list button.sel { border-color: var(--accent); background: var(--accent-soft); }
.files-view { min-width: 0; }
.doc-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.doc-body { max-height: 55dvh; overflow: auto; padding-right: .25rem; }
.doc-pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; margin: 0; }
.doc-scroll { overflow: auto; }
.doc-table { border-collapse: collapse; font-size: .85rem; }
.doc-table th, .doc-table td { border: 1px solid var(--line); padding: .25rem .5rem; text-align: left; vertical-align: top; }
.doc-table th { background: var(--bg); }

.progress-chip { border: 0; cursor: pointer; flex: none; max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
.pill.working { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 800px) { .progress-chip { max-width: 12rem; } }

/* the drop-down panels under the top bar's chips (helpers, goal, progress) */
.menu.down { bottom: auto; top: calc(100% + 6px); left: auto; right: 0; width: 220px; display: flex; flex-direction: column; gap: .15rem; }
.menu.down .skill-item.hidden { display: none; }

/* the assistant's question: tappable choices */
.qcard { margin-left: 2.5rem; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 14px; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .6rem; }
.qcard.answered { opacity: .8; border-style: dashed; }
.q-head { font-weight: 600; font-size: .92rem; }
.q-item { display: flex; flex-direction: column; gap: .4rem; }
.q-title { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.q-text { font-size: .95rem; }
.q-options { display: flex; flex-wrap: wrap; gap: .4rem; }
.q-opt.chosen { background: var(--accent); color: #fff; border-color: var(--accent); }
.q-other { max-width: 28rem; }
@media (max-width: 800px) { .qcard { margin-left: 0; } }

/* "Undo from here" on the person's own messages, and what an undo hides */
.msg.user { position: relative; }
.undo-here { display: block; margin: .2rem 0 0 auto; border: 0; background: transparent; color: var(--muted); font-size: .76rem; padding: .1rem .3rem; border-radius: 6px; opacity: 0; transition: opacity .15s; cursor: pointer; }
.msg.user:hover .undo-here, .undo-here:focus-visible { opacity: 1; }
#app.per-change .undo-here { display: none; } /* with drafts, each saved change has its own Undo in the Changes tab */
@media (hover: none) { .undo-here { opacity: .7; } }
.msg.queued .undo-here { display: none; }
#messages .undone { display: none; }

.q-ctl { display: flex; gap: .6rem; justify-content: flex-end; font-size: .8rem; margin-top: .2rem; }

/* where the request is: a short line of steps */
.stepper { list-style: none; margin: 0; padding: .35rem 1.25rem; display: flex; gap: .35rem; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--bg); font-size: .78rem; scrollbar-width: none; }
.stepper li { flex: none; padding: .15rem .6rem; border-radius: 999px; color: var(--muted); border: 1px solid transparent; white-space: nowrap; }
.stepper li.done { color: var(--accent-text); }
.stepper li.next { border: 1px dashed var(--line); }
.done-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin: 0 auto; max-width: 52rem; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); font-size: .92rem; }
.files-list .files-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .6rem .4rem .2rem; list-style: none; }
.files-list .files-group.sub { text-transform: none; letter-spacing: 0; font-weight: 600; padding-top: .4rem; }
.verify-list { margin: .3rem 0 0 1rem; padding: 0; font-size: .9em; }
.cta.verify.failed { border-color: var(--err); }
.stepper li.active { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
@media (max-width: 800px) { .stepper { padding: .3rem .75rem; } }

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

/* the side panel beside the chat: Preview | Changes | Deployments (a drawer on a tablet, a full-screen sheet on a phone) */
:root { --warn: #8a5600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --warn: #f2b45a; } }
:root[data-theme="dark"] { --warn: #f2b45a; }
@media (min-width: 1101px) { #app.with-pane { grid-template-columns: 272px minmax(0, 1fr) minmax(380px, 44%); } }
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); background: var(--panel); }
/* every action of the conversation (Artefacts, What changed?, Undo, goal, done, archive) is this one group of icons, in the top bar beside Publish */
.pane-acts { display: flex; flex-wrap: nowrap; align-items: center; gap: .35rem; }
.pane-acts .btn { min-height: 34px; }
.pane-bar { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: 0 .5rem 0 .6rem; border-bottom: 1px solid var(--line); }
.panel-tabs { display: flex; gap: .15rem; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.panel-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: .92rem; font-weight: 500; padding: .8rem .65rem .7rem; margin-bottom: -1px; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; cursor: pointer; }
.panel-tab:hover { color: var(--ink); }
.panel-tab[aria-selected="true"] { color: var(--ink); font-weight: 650; border-bottom-color: var(--accent); }
.tab-count { font-size: .72rem; font-weight: 650; min-width: 1.25rem; padding: 0 .35rem; line-height: 1.35; border-radius: 999px; text-align: center; background: color-mix(in srgb, var(--warn) 16%, var(--panel)); color: var(--warn); }
.tab-count.bad { background: color-mix(in srgb, var(--err) 14%, var(--panel)); color: var(--err); }
.pane-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .4rem; padding: .45rem .75rem; border-bottom: 1px solid var(--line); }
.pane-tools b { font-size: .85rem; font-weight: 600; color: var(--muted); }
.pane-actions { display: flex; flex-wrap: wrap; gap: .3rem; }
#bell-btn.on { color: var(--accent); }
.panel-preview { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.panel-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: .75rem; background: var(--bg); display: flex; flex-direction: column; gap: .75rem; align-content: flex-start; }
.pane-stage { position: relative; flex: 1; display: flex; min-height: 0; }
.pane iframe { flex: 1; width: 100%; border: 0; background: #fff; }
/* the live preview's status (starting, asleep, could not start) covers the frame until the app answers */
.pane-state { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 1.5rem; text-align: center; background: var(--panel); }
.pane-state p { margin: 0; max-width: 22rem; }
.pane-state .spin { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.pane-state .row { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.pane-foot { display: none; }
.pane-note { margin: 0; padding: .35rem .75rem; border-top: 1px solid var(--line); }
@media (max-width: 1100px) {
  .pane { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 94vw); z-index: 18; box-shadow: var(--shadow); }
}
@media (max-width: 700px) {
  .pane { left: 0; width: 100%; border-left: 0; box-shadow: none; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .pane-bar { padding-left: max(.6rem, env(safe-area-inset-left)); padding-right: max(.5rem, env(safe-area-inset-right)); }
  .pane-acts > .btn { flex: none; }
  .panel-scroll { padding: .6rem max(.6rem, env(safe-area-inset-right)) 1rem max(.6rem, env(safe-area-inset-left)); }
  .pane-foot:not(.hidden) { display: flex; flex: none; padding: .6rem max(.75rem, env(safe-area-inset-right)) .6rem max(.75rem, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: var(--panel); }
  .pane-foot .btn { flex: 1; min-height: 44px; justify-content: center; text-align: center; }
}

/* the cards in the Changes and Deployments tabs */
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem; display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.pc-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.pc-title { margin: 0; font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.pc-side { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: right; overflow-wrap: anywhere; }
.pcard .row { display: flex; flex-wrap: wrap; gap: .5rem; }
.pcard .row.two { display: grid; grid-template-columns: 1fr 1fr; }
.pcard .row.two .btn, .btn.wide { justify-content: center; white-space: normal; text-align: center; }
.btn.wide { width: 100%; }
.pcard > .btn { justify-content: center; align-self: stretch; }
.btn.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, var(--line)); }
.pc-note, .pc-more, .pc-count { margin: 0; }
.pc-count { font-weight: 600; }
.wc-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.wc-who { min-width: 0; }
.wc-who b { display: block; font-size: 1.05rem; font-weight: 650; overflow-wrap: anywhere; }
.wc-who small { display: block; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.wc-select { font: inherit; font-size: .9rem; padding: .45rem .6rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); max-width: 100%; }
.nc-form { display: flex; flex-direction: column; gap: .4rem; }
.nc-form label { font-size: .85rem; font-weight: 600; }
.pc-err { margin: 0; font-size: .85rem; color: var(--err); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.stat { background: var(--bg); border-radius: 12px; padding: .55rem .7rem; display: flex; flex-direction: column; gap: .05rem; min-width: 0; }
.stat b { font-size: 1.5rem; line-height: 1.25; font-weight: 650; }
.stat span { font-size: .8rem; color: color-mix(in srgb, var(--ink) 72%, var(--panel)); }
.stat.warn { background: color-mix(in srgb, var(--warn) 12%, var(--panel)); }
.stat.warn b { color: var(--warn); }
.pc-pub, .pc-msg, .pc-wait { margin: 0; padding: .55rem .75rem; border-radius: 10px; font-size: .88rem; border-left: 3px solid var(--muted); background: var(--bg); color: var(--ink); }
.pc-pub.hold, .pc-pub.wait, .pc-msg.conflict { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 11%, var(--panel)); }
.pc-pub.ok, .pc-msg.ok { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 11%, var(--panel)); }
.pc-pub.bad, .pc-msg.error { border-left-color: var(--err); background: color-mix(in srgb, var(--err) 10%, var(--panel)); }
.pc-wait { background: var(--accent-soft); border-left-color: var(--accent); }
.pc-msg { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
.flist, .slist, .dlist { list-style: none; margin: 0; padding: 0; }
.frow { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; border-top: 1px solid var(--line); min-width: 0; }
.frow:first-child { border-top: 0; }
.fname { min-width: 0; overflow-wrap: anywhere; font-size: .92rem; }
.mk { flex: none; width: 1.4rem; height: 1.4rem; border-radius: 6px; display: grid; place-items: center; font-size: .7rem; font-weight: 700; color: var(--ink); background: var(--side); }
.mk.m { background: color-mix(in srgb, var(--warn) 28%, var(--panel)); }
.mk.a { background: color-mix(in srgb, var(--ok) 28%, var(--panel)); }
.mk.d { background: color-mix(in srgb, var(--err) 26%, var(--panel)); }
.srow { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: .6rem; padding: .4rem 0; border-top: 1px solid var(--line); font-size: .92rem; }
.srow:first-child { border-top: 0; }
.srow .what { overflow-wrap: anywhere; }
.when { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.panel-empty { margin: 0; padding: 1rem .25rem; color: var(--muted); }
.panel-empty.err { color: var(--err); }
.dep-now { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.dep-now .spin { width: 16px; height: 16px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.dep-last { margin: 0; display: flex; gap: .55rem; align-items: baseline; font-weight: 600; }
.dep-ico { flex: none; width: 1rem; text-align: center; font-weight: 700; }
.ok > .dep-ico, .drow.ok .dep-ico { color: var(--ok); }
.bad > .dep-ico, .drow.bad .dep-ico { color: var(--err); }
.dep-detail { display: block; margin: 0; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.dep-detail.warn { color: var(--warn); }
.drow { display: grid; grid-template-columns: 1rem minmax(0, 1fr) auto; gap: .55rem; align-items: baseline; padding: .5rem 0; border-top: 1px solid var(--line); font-size: .92rem; }
.drow:first-child { border-top: 0; }
.dbody { display: flex; flex-direction: column; gap: .1rem; min-width: 0; align-items: flex-start; }
.dsum { overflow-wrap: anywhere; }
/* a button that cannot be pressed right now keeps its words readable, in light and dark (a dimmed label on a quiet background: never a faded empty box) */
.pane .btn:disabled, .pane button.btn:disabled, .pane .btn.primary:disabled { opacity: 1; color: var(--muted); background: var(--side); border-color: var(--line); border-style: dashed; cursor: not-allowed; }
.pane .btn.danger:disabled { color: var(--muted); }
.pane select:disabled, .pane input:disabled { opacity: 1; color: var(--muted); cursor: not-allowed; }

/* the flow in "Sync with the sandbox": main -> sandbox -> my copy -> sandbox */
.flow { list-style: none; margin: 0; padding: 0; counter-reset: flow; display: flex; flex-direction: column; gap: .5rem; }
.flow-step { counter-increment: flow; display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .6rem; padding: .65rem .7rem; background: var(--bg); border-radius: 12px; }
.flow-step::before { content: counter(flow); width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--side); color: var(--ink); display: grid; place-items: center; font-size: .78rem; font-weight: 700; }
.flow-body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; align-items: stretch; }
.flow-title { font-size: .95rem; font-weight: 650; }
.flow-count { font-size: .88rem; color: color-mix(in srgb, var(--ink) 80%, var(--bg)); }
.flow-count.warn { color: var(--warn); font-weight: 600; }
.flow-note { margin: 0; }
.flow-step .btn.wide { margin-top: .2rem; padding: .55rem .8rem; font-size: .9rem; }

/* "This conversation": its saved changes, and What changed? / Undo last change */
.crow { align-items: start; }
.cbody { min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.cmeta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cbadge { font-size: .72rem; font-weight: 650; padding: .05rem .55rem; border-radius: 999px; white-space: nowrap; }
.cbadge.on { background: color-mix(in srgb, var(--ok) 14%, var(--panel)); color: color-mix(in srgb, var(--ok) 70%, var(--ink)); }
.cbadge.off { background: color-mix(in srgb, var(--warn) 14%, var(--panel)); color: color-mix(in srgb, var(--warn) 80%, var(--ink)); }
.cid { font: .75rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.conv-acts .btn { flex: 1 1 9rem; justify-content: center; white-space: normal; text-align: center; }
.conv-sum { border-top: 1px solid var(--line); padding-top: .65rem; display: flex; flex-direction: column; gap: .55rem; }
.conv-sum-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.conv-sum-text { margin: 0; }
.conv-sum.loading { flex-direction: row; align-items: center; }
.conv-sum .tour { background: var(--bg); }
.conv-sum .tour-nav { align-items: center; }
.conv-sum > .spin { display: inline-block; width: 14px; height: 14px; margin-right: .5rem; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }

/* the chips in the top bar that open the panel */
.helpers-chip.copy-chip { display: inline-block; max-width: 24rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.copy-chip::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: .45rem; border-radius: 50%; background: var(--ok); vertical-align: middle; }
.copy-chip.warn::before { background: var(--warn); }
.copy-chip.bad::before { background: var(--err); }
.copy-chip.working::before { display: none; }
.copy-chip .spin, .pc-pub .spin { display: inline-block; width: 10px; height: 10px; margin-right: .45rem; vertical-align: middle; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.copy-chip.bad { background: color-mix(in srgb, var(--err) 10%, var(--panel)); border-color: color-mix(in srgb, var(--err) 40%, var(--line)); }
.copy-chip.good { background: color-mix(in srgb, var(--ok) 12%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
@media (max-width: 800px) { .helpers-chip.copy-chip { max-width: 14rem; } }

/* the top bar's actions: Publish and Send for review (the next step of the work) and the side panel's button; every other action is in the panel's action bar */
.actions-scroll { display: contents; }
/* on a wide screen the actions are one group that never breaks apart (a long title shortens with "…" first), in the order of the work:
   Publish, then Send for review, then the side panel's button */
@media (min-width: 801px) {
  .actions { display: flex; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .5rem; margin-left: auto; min-width: 0; max-width: 100%; }
  .actions #pane-acts { order: -1; } /* the other actions come first, then Publish, then Send for review */
  .actions #review-btn { order: 1; }
  .actions #panel-btn { order: 3; } /* the side panel's button is always the last, on the right */
  .topbar h2 { flex: 0 1 auto; min-width: 6rem; }
}
@media (max-width: 800px) {
  .actions { display: flex; flex: 1 0 100%; order: 9; align-items: center; gap: .5rem; min-width: 0; }
  .actions-scroll { display: flex; flex: 1 1 0; min-width: 0; align-items: center; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding: 2px; }
  .actions-scroll > * { flex: none; }
  .actions-scroll #preview-btn { order: -2; } /* the next step first: it must not be the one scrolled out of sight */
  .actions-scroll #pane-acts { order: -1; } /* then the other actions, scrolling sideways with it */
  .actions #review-btn { flex: none; }
  .actions #panel-btn { order: 3; }
  .topbar #review-btn { margin-left: 0; }
}
/* placeholders while a conversation loads */
.skeleton { display: grid; gap: .7rem; padding: 1.2rem 1.25rem; }
.skeleton i { display: block; height: 1rem; border-radius: 8px; background: linear-gradient(90deg, var(--line) 25%, var(--side) 37%, var(--line) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.skeleton i:nth-child(1) { width: 40%; margin-left: auto; height: 2.2rem; } .skeleton i:nth-child(2) { width: 85%; } .skeleton i:nth-child(3) { width: 70%; } .skeleton i:nth-child(4) { width: 55%; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skeleton i { animation: none; } }

/* help */
#help-btn { position: relative; font-weight: 700; }
.help-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.help-steps { padding-left: 1.2rem; display: grid; gap: .5rem; }
.help-news { padding-left: 1.2rem; display: grid; gap: .3rem; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 .35rem; font: inherit; font-size: .85em; background: var(--panel); }

/* helpers (sub-agents): a chip in the top bar, a panel with each helper's progress */
.helpers-wrap { position: relative; flex: none; }
.helpers-chip { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; padding: .15rem .65rem; border-radius: 999px; border: 1px solid var(--line); background: var(--accent-soft); color: var(--ink); cursor: pointer; }
.helpers-chip .spin { width: 10px; height: 10px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.helpers-chip.idle .spin { display: none; }
.helpers-pop.menu.down { left: 0; right: auto; width: min(26rem, 92vw); max-height: 60vh; overflow: auto; gap: .35rem; padding: .6rem; }
.helpers-pop h3 { margin: 0 0 .1rem; font-size: .85rem; color: var(--muted); font-weight: 600; }
.helper { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: .85rem; }
.helper > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem; padding: .4rem .6rem; }
.helper > summary::-webkit-details-marker { display: none; }
.helper .h-ico { width: 14px; height: 14px; flex: none; display: grid; place-items: center; font-size: .8rem; line-height: 1; }
.helper.running .h-ico { border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.helper.done .h-ico { color: var(--ok); } .helper.done .h-ico::before { content: "✓"; }
.helper.failed .h-ico { color: var(--err); } .helper.failed .h-ico::before { content: "✕"; }
.helper .h-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.helper .h-kind { flex: none; color: var(--muted); font-size: .76rem; }
.helper .h-body { padding: 0 .6rem .5rem 1.9rem; display: flex; flex-direction: column; gap: .2rem; color: var(--muted); }
.helper .h-step.running { color: var(--ink); } .helper .h-step.failed { color: var(--err); }
.helper .h-sum { color: var(--ink); margin: .2rem 0 0; }
/* goal: what done means, checked after each turn */
.goal-chip.met { background: color-mix(in srgb, var(--ok) 14%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.goal-chip.attn { background: color-mix(in srgb, #c77d00 14%, var(--panel)); border-color: color-mix(in srgb, #c77d00 40%, var(--line)); }
.goal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; font-size: .86rem; }
.goal-list li { display: grid; grid-template-columns: 1.1rem 1fr; gap: .1rem .4rem; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.goal-list .g-ico { font-weight: 700; color: var(--muted); }
.goal-list li.met .g-ico { color: var(--ok); }
.goal-list .g-note { grid-column: 2; color: var(--muted); font-size: .8rem; }
.goal-state { margin: .2rem 0 0; font-size: .85rem; font-weight: 600; }
.goal-pop .note { margin: .1rem 0; font-size: .82rem; }
.goal-edit { width: 100%; font: inherit; font-size: .9rem; padding: .5rem .6rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); resize: vertical; }
.goal-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; }
@media (max-width: 800px) { .helpers-pop.menu.down { position: fixed; left: .5rem; right: .5rem; top: 3.6rem; width: auto; } }

.progress-pop ul { list-style: none; margin: 0 0 .4rem; padding: 0; font-size: .85rem; display: flex; flex-direction: column; gap: .15rem; }
.progress-pop li { overflow-wrap: anywhere; }
.progress-pop .note { font-size: .82rem; color: var(--muted); margin: 0 0 .4rem; }

/* "What changed?" tour: the summary, then the step, then its buttons, one under the other */
.summary-card .cta-text, .summary-card .tour, .summary-card .tour-nav { flex: 1 1 100%; }
.tour { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; font-size: .92rem; }
.tour p { margin: .25rem 0 0; }
.tour-count { color: var(--muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.tour-title { display: block; margin-top: .1rem; }
.tour-nav { display: flex; flex-wrap: wrap; gap: .4rem; }
/* the goal panel opens toward the page, never past its right edge */
.goal-pop.menu.down { left: auto; right: 0; }
@media (max-width: 800px) { .goal-pop.menu.down { left: .5rem; right: .5rem; } }

/* the bottom of the sidebar has more buttons now (install, bell, settings, help, sign out): they may use a second line */
.user-row { flex-wrap: wrap; row-gap: .25rem; column-gap: .3rem; }
#whoami { flex: 1 1 4rem; min-width: 0; white-space: nowrap; }

/* the Settings window: a list of sections on the left (a row of chips on a phone), one section at a time */
.dialog.settings { width: min(900px, 96vw); height: min(680px, calc(100vh - 2rem)); height: min(680px, calc(100dvh - 2rem)); padding: 0; overflow: hidden; }
.settings[open] { display: flex; flex-direction: column; }
.settings .dialog-head { padding: 1rem 1.25rem .5rem; }
.settings-search { flex: none; margin: 0 1.25rem .85rem; width: calc(100% - 2.5rem); }
.settings-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr); border-top: 1px solid var(--line); }
.settings-nav { display: flex; flex-direction: column; gap: .15rem; padding: .75rem; overflow-y: auto; border-right: 1px solid var(--line); background: var(--side); }
.set-tab { text-align: left; border: 0; background: transparent; padding: .5rem .7rem; border-radius: 8px; font-size: .92rem; color: var(--ink); }
.set-tab:hover { background: var(--line); }
.set-tab.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.settings-pages { overflow-y: auto; overscroll-behavior: contain; min-width: 0; padding: 1rem 1.5rem 1.75rem; }
.set-section h4 { margin: 0 0 .25rem; font-size: 1.05rem; }
.set-section { margin-bottom: 1.5rem; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.set-block { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.set-block > b { display: block; margin-bottom: .2rem; }
.set-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; flex: 1; }
.set-text b { font-weight: 600; font-size: .95rem; }
.set-text small { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.set-value { color: var(--muted); overflow-wrap: anywhere; }
.set-row select { flex: none; width: min(18rem, 100%); max-width: 100%; padding: .5rem .6rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: .9rem; }
.set-section > .prov:first-of-type { margin-top: .4rem; }
#security-body .prov { margin-top: .8rem; }
#security-body .prov-body input { width: 100%; }
.seg { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: .4rem .85rem; font-size: .88rem; color: var(--ink); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--side); }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.switch { position: relative; display: inline-block; flex: none; width: 44px; height: 26px; margin: 0; }
.switch input { appearance: none; -webkit-appearance: none; position: absolute; inset: 0; width: 44px; height: 26px; margin: 0; padding: 0; border-radius: 999px; border: 1px solid var(--muted); background: var(--bg); cursor: pointer; }
.switch .knob { position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; pointer-events: none; }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .knob { transform: translateX(18px); background: var(--accent-ink); }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled { opacity: .5; cursor: default; }
@media (prefers-reduced-motion: reduce) { .switch .knob { transition: none; } }

@media (max-width: 700px) {
  .dialog.settings { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; border: 0; inset: 0; margin: 0; }
  .settings .dialog-head { padding: .8rem .9rem .4rem; }
  .settings-search { margin: 0 .9rem .6rem; width: calc(100% - 1.8rem); }
  .settings-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .settings-nav { flex-direction: row; flex-wrap: wrap; gap: .35rem; padding: .6rem .9rem; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .set-tab { border: 1px solid var(--line); border-radius: 999px; padding: .3rem .75rem; font-size: .85rem; background: var(--panel); }
  .set-tab.on { border-color: var(--accent); }
  .settings-pages { padding: .6rem .9rem 1.5rem; }
  .set-row { flex-wrap: wrap; }
  .set-row select { width: 100%; }
}

/* Settings -> Skills */
.skill-row { flex-wrap: wrap; }
.skill-ctl { display: flex; align-items: center; gap: .6rem; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.skill-acts { display: flex; gap: .4rem; flex-wrap: wrap; }
.skill-tag { align-self: flex-start; margin: .1rem 0 .15rem; padding: .05rem .5rem; border-radius: 999px; font-size: .74rem; background: var(--side); color: var(--muted); border: 1px solid var(--line); }
.skill-tag.wait { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.skill-tag.off { color: var(--err); }
.skill-why { color: var(--muted); }
.skill-text { flex-basis: 100%; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--side); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; font-size: .88rem; }
.skill-form { display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; }
.skill-form label { font-weight: 600; font-size: .9rem; margin-top: .35rem; }
.skill-form input, .skill-form textarea { width: 100%; padding: .5rem .6rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: .9rem; }
.skill-form textarea { resize: vertical; min-height: 7rem; }
.skill-reasons { margin: .4rem 0 0; padding: .6rem .8rem; border-radius: 10px; border: 1px solid var(--err); color: var(--err); font-size: .88rem; }
.skill-reasons p { margin: 0 0 .25rem; font-weight: 600; }
.skill-reasons ul { margin: 0; padding-left: 1.2rem; }
.skill-form-actions { display: flex; gap: .5rem; margin-top: .5rem; }

/* tables in the assistant's answers: readable on a phone (the table scrolls sideways inside its box, never the page) */
.md-table { max-width: 100%; overflow-x: auto; margin: .6rem 0; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.md-table:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.md-table table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.md-table th, .md-table td { padding: .5rem .7rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); min-width: 6rem; }
.md-table th { background: var(--bg); font-weight: 650; white-space: nowrap; }
.md-table tr:last-child td { border-bottom: 0; }
.md-table td:first-child, .md-table th:first-child { min-width: 2rem; }

/* the person's other copies, each with Remove */
.wc-more { margin-top: .6rem; }
.wc-more summary { cursor: pointer; color: var(--muted); font-size: .88rem; padding: .2rem 0; }
.wc-list { list-style: none; margin: .4rem 0 0; padding: 0; }
.wc-list li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .35rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.btn.small { padding: .25rem .6rem; font-size: .82rem; min-height: 32px; }

/* the next-step note under an answer (its action is in the top bar), and Publish while the build is checked or fixed */
.cta.note { padding: .7rem .9rem; }
.cta.note .cta-text { margin: 0; }
.btn.pending { opacity: 1; color: var(--muted); }
.btn.pending::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .45em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -.1em; animation: spin 1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .btn.pending::before { animation: none; } }

/* with the side panel open beside the chat, its Preview tab has the link to the live site: the top bar does not repeat it */

/* Settings -> Security, Data, Branding, Integrations (admins only) */
.set-nav-label { margin: .8rem .7rem .2rem; font-size: .74rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.set-ctl { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.set-input { padding: .45rem .6rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: .9rem; min-width: 0; width: 9rem; }
.set-input[type="number"] { width: 6rem; }
.set-input[type="color"] { width: 2.6rem; height: 2.3rem; padding: .15rem; }
.set-ctl select { width: min(16rem, 100%); padding: .45rem .6rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: .9rem; }
.set-msg { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.set-msg.good { color: var(--ok); }
.set-msg.problem { color: var(--err); }
.status { display: inline-flex; align-items: center; gap: .45rem; }
.status .dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--muted); flex: none; }
.status .dot.ok { background: var(--ok); }
.status .dot.bad { background: var(--err); }
.lock-list { list-style: none; margin: .4rem 0 0; padding: 0; }
.lock-list li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; padding: .4rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.logo-ctl { justify-content: flex-end; }
.logo-preview { max-width: 8rem; max-height: 3rem; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: .25rem; background: var(--panel); }
.logo-ctl input[type="file"] { max-width: 100%; font-size: .85rem; }
.int-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.int-status { font-size: .78rem; font-weight: 600; padding: .05rem .55rem; border-radius: 999px; border: 1px solid var(--line); color: var(--warn); }
.int-status.ok { color: var(--ok); }
.int-status.off { color: var(--muted); }
.int-card .int-line { margin: .15rem 0; font-size: .88rem; overflow-wrap: anywhere; }
.int-card .set-ctl { justify-content: flex-start; margin-top: .5rem; }
@media (max-width: 700px) {
  .set-nav-label { flex-basis: 100%; margin: .2rem 0 0; }
  .set-ctl { justify-content: flex-start; width: 100%; }
  .set-input { flex: 1 1 8rem; width: auto; }
  .set-input[type="number"] { flex: 0 0 6rem; }
  .logo-preview { max-width: 6rem; }
}
.set-ctl select { flex: 1 1 12rem; }
.logo-ctl input[type="file"] { width: auto; flex: 1 1 10rem; }

/* "Test connection" in AI accounts */
.prov-test { margin: .4rem 0 0; }
.prov-test.ok { color: var(--ok); }
.prov-test.bad { color: var(--err); }
.dep-setup { margin: .4rem 0 .6rem; padding-left: 1.2rem; display: grid; gap: .35rem; font-size: .9rem; }

/* a message that got no answer: marked, with a button that sends it again */
.msg.user.failed .body { border: 1px dashed color-mix(in srgb, var(--err) 55%, var(--line)); }
.fail-row { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; margin-top: .3rem; font-size: .8rem; color: var(--err); }
.retry-btn { font: inherit; font-size: .8rem; font-weight: 600; color: var(--accent); background: none; border: 1px solid var(--line); border-radius: 999px; padding: .2rem .65rem; min-height: 32px; cursor: pointer; }
.retry-btn:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.msg.user.failed { flex-direction: column; align-items: flex-end; }
.msg.user.failed .body { max-width: 85%; }
.msg.user.failed .undo-here { display: none; } /* (nothing was changed: no answer came) */

/* the side panel's button in the top bar */
.topbar .panel-btn { flex: none; width: auto; height: auto; min-width: 44px; min-height: 40px; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); }
.topbar .panel-btn.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ---- Suggested for you (the chat's empty state) ---- */
.suggested { text-align: left; margin: 0 0 1.25rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: .6rem .9rem; }
.suggested h4 { margin: 0 0 .3rem; font-size: .95rem; }
.suggested-item { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; justify-content: space-between; padding: .5rem 0; border-top: 1px solid var(--line); }
.suggested-item:first-of-type { border-top: 0; }
.suggested-text { flex: 1 1 14rem; min-width: 0; }
.suggested-text b, .suggested-text span { display: block; overflow-wrap: anywhere; }
.suggested-text span { color: var(--muted); font-size: .85rem; }
.suggested-acts { display: flex; gap: .4rem; }

/* the code reviewer's line */
.review-line { margin-top: .5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; font-size: .9rem; }
.review-line .review-text { flex: 1 1 14rem; min-width: 0; }
.review-line .review-acts { display: flex; flex-wrap: wrap; gap: .4rem; }
.review-line .btn.small { padding: .3rem .6rem; font-size: .85rem; min-height: 2.25rem; text-decoration: none; display: inline-flex; align-items: center; }
.review-findings { flex-basis: 100%; }
.review-findings summary { cursor: pointer; font-weight: 600; }
.review-finding { padding: .35rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.review-finding .sev { display: inline-block; margin-right: .4rem; padding: 0 .4rem; border-radius: 6px; font-size: .75rem; font-weight: 700; text-transform: uppercase; background: var(--accent-soft); color: var(--ink); }
.review-finding .sev-high { background: color-mix(in srgb, var(--bad, #c0392b) 22%, var(--panel)); }
.review-finding .sev-medium { background: color-mix(in srgb, var(--warn, #b7791f) 22%, var(--panel)); }
.review-finding code { overflow-wrap: anywhere; }

/* ---- scheduled tasks (Settings -> Schedules) ---- */
.sched-mark { flex: none; margin-left: .3rem; font-size: .8rem; color: var(--muted); }
.sch-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: .6rem 0; }
.sch-list { display: flex; flex-direction: column; gap: .7rem; }
.sch-card { border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; background: var(--panel); display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.sch-top { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.sch-title { font-size: 1rem; overflow-wrap: anywhere; }
.sch-chip { font-size: .72rem; padding: .05rem .5rem; border-radius: 999px; background: var(--user); color: var(--muted); }
.sch-state { margin-left: auto; display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--muted); }
.sch-when { font-size: .9rem; }
.sch-line { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.sch-line b { color: var(--ink); font-weight: 600; }
.sch-sum { margin-top: .15rem; color: var(--ink); font-size: .85rem; overflow-wrap: anywhere; }
.sch-st { display: inline-block; font-size: .75rem; font-weight: 650; padding: .05rem .5rem; border-radius: 999px; background: var(--user); color: var(--ink); }
.sch-st.ok { background: color-mix(in srgb, var(--ok) 16%, var(--panel)); color: color-mix(in srgb, var(--ok) 75%, var(--ink)); }
.sch-st.failed { background: color-mix(in srgb, var(--err) 16%, var(--panel)); color: color-mix(in srgb, var(--err) 75%, var(--ink)); }
.sch-st.running { background: var(--accent-soft); color: var(--accent-text); }
.sch-acts { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .3rem; }
.sch-history { border-top: 1px solid var(--line); margin-top: .4rem; padding-top: .5rem; display: flex; flex-direction: column; gap: .5rem; }
.sch-run { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .65rem; display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.sch-run-top { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; }
.sch-form { display: flex; flex-direction: column; gap: .8rem; margin-top: .6rem; max-width: 40rem; }
.sch-form h5 { margin: 0; font-size: 1rem; }
.sch-field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.sch-label { font-size: .85rem; font-weight: 600; }
.sch-input, .sch-form select.sch-input { width: 100%; max-width: 100%; }
.sch-form input[type="time"].sch-input, .sch-form input[type="date"].sch-input, .sch-form input[type="number"].sch-input { width: auto; min-width: 7rem; }
.sch-prompt { width: 100%; box-sizing: border-box; padding: .55rem .65rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: .9rem; resize: vertical; }
.sch-cron { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sch-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.sch-chipbtn { font-size: .8rem; padding: .3rem .65rem; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.sch-chipbtn:hover { background: var(--side); }
.sch-days { display: flex; flex-wrap: wrap; gap: .35rem; }
.sch-day { min-width: 2.9rem; padding: .4rem .5rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; font-size: .85rem; }
.sch-day[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.sch-sched { display: flex; flex-direction: column; gap: .4rem; }
.sch-times { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.sch-time { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.sch-preview { border-radius: 10px; padding: .55rem .7rem; font-size: .88rem; background: var(--side); border: 1px solid var(--line); overflow-wrap: anywhere; }
.sch-preview.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.sch-preview.bad { border-color: color-mix(in srgb, var(--err) 55%, var(--line)); color: color-mix(in srgb, var(--err) 70%, var(--ink)); }
.sch-msg { margin: 0; min-height: 1.1em; color: color-mix(in srgb, var(--err) 70%, var(--ink)); font-size: .88rem; }
@media (max-width: 700px) {
  .sch-acts .btn { flex: 1 1 8rem; justify-content: center; min-height: 40px; }
  .sch-state { margin-left: 0; }
  .sch-time { width: 100%; }
}

/* the Git tab (developers and admins): header, changes, history with a graph, compare, diffs */
:root { --git-info: #1a5fb4; --git-add: color-mix(in srgb, var(--ok) 13%, var(--panel)); --git-del: color-mix(in srgb, var(--err) 11%, var(--panel)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --git-info: #8ab4f8; } }
:root[data-theme="dark"] { --git-info: #8ab4f8; }
#panel-git { gap: .6rem; }
.git-head { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.git-bar { display: flex; align-items: center; gap: .5rem; min-width: 0; flex-wrap: wrap; }
.git-branch { display: inline-flex; align-items: center; gap: .4rem; max-width: 100%; min-width: 0; padding: .4rem .65rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font-size: .92rem; font-weight: 600; min-height: 38px; }
.git-branch:hover { background: var(--side); }
.git-branch .gi { flex: none; color: var(--accent-text); }
.git-bname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.git-badges { display: inline-flex; gap: .3rem; }
.git-badge { display: inline-flex; align-items: center; gap: .15rem; font-size: .78rem; font-weight: 600; padding: .05rem .45rem; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.git-badge.ok { color: var(--ok); }
.git-badge.behind { color: var(--warn); }
.git-sub, .git-viewing { margin: 0; font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.git-viewing b { color: var(--ink); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent-text); text-decoration: underline; font-size: inherit; }
.git-refresh.spin .gi { animation: spin .8s linear infinite; }
.pc-msg.wait { border-left-color: var(--accent); }
.git-seg { display: flex; gap: .25rem; padding: .2rem; border-radius: 12px; background: var(--side); }
.git-segb { flex: 1; border: 0; background: transparent; padding: .4rem .5rem; border-radius: 9px; font-size: .88rem; color: var(--muted); font-weight: 500; min-height: 36px; white-space: nowrap; }
.git-segb[aria-selected="true"] { background: var(--panel); color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.git-body { display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.git-tools { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.git-tools .git-filter { flex: 1; min-width: 0; }
.git-q { font: inherit; font-size: .9rem; padding: .45rem .65rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; min-height: 38px; }
.git-size { width: auto; }
.git-sum { margin: 0; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .3rem; align-items: baseline; }
.git-h4 { margin: .4rem 0 0; font-size: .85rem; font-weight: 650; color: var(--muted); text-transform: none; }
.git-list, .git-changes, .git-history, .git-compare, .git-diff { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.git-group { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-width: 0; }
.git-gh { display: flex; align-items: center; gap: .4rem; width: 100%; padding: .5rem .65rem; border: 0; background: transparent; text-align: left; font-size: .88rem; min-height: 38px; }
.git-gh:hover { background: var(--side); }
.git-gt { font-weight: 650; }
.git-count { color: var(--muted); font-size: .8rem; }
.git-gh .git-stats { margin-left: auto; }
.git-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.git-rows > li { min-width: 0; }
.git-change, .git-dir, .git-cf, .git-fh { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .4rem .65rem; border: 0; background: transparent; text-align: left; font-size: .88rem; min-height: 38px; min-width: 0; color: var(--ink); }
.git-change:hover, .git-dir:hover, .git-cf:hover, .git-fh:hover, .git-crow:hover { background: var(--side); }
.git-dn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.git-letter { flex: none; width: 1.1rem; text-align: center; font-weight: 700; font-size: .8rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.l-m { color: var(--warn); } .l-a { color: var(--ok); } .l-d { color: var(--err); } .l-r, .l-u { color: var(--git-info); } .l-x { color: var(--err); }
.gp { display: flex; min-width: 0; flex: 1; overflow: hidden; align-items: baseline; }
.gp-dir { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; unicode-bidi: plaintext; color: var(--muted); }
.gp-name { flex: none; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.gp-name.only { flex: 0 1 auto; min-width: 0; }
.git-stats { flex: none; font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.git-stats .p { color: var(--ok); } .git-stats .n { color: var(--err); } .git-stats .sl { color: var(--muted); margin: 0 .1rem; }
.git-bin { flex: none; font-size: .75rem; color: var(--muted); }
.git-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2rem 1rem; gap: .35rem; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.git-et { margin: .5rem 0 0; font-weight: 650; color: var(--ink); }
.git-ed { margin: 0 0 .5rem; font-size: .88rem; }
.git-err { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.git-note { margin: 0; padding: .55rem .75rem; font-size: .85rem; color: var(--muted); }
.git-cut { padding: .3rem .75rem; }
/* the draft picker */
.git-picker { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: .5rem; display: flex; flex-direction: column; gap: .4rem; max-height: min(60vh, 28rem); min-width: 0; }
.git-plist { overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.git-ph { font-size: .75rem; font-weight: 650; color: var(--muted); padding: .4rem .5rem .15rem; text-transform: uppercase; letter-spacing: .03em; }
.git-pe { font-size: .85rem; color: var(--muted); padding: .3rem .5rem; margin: 0; }
.git-pe.err { color: var(--err); }
.git-pi { display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem; border: 0; background: transparent; border-radius: 8px; text-align: left; font-size: .9rem; min-height: 40px; width: 100%; min-width: 0; color: var(--ink); }
.git-pi:hover, .git-pi:focus-visible { background: var(--side); }
.git-pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.git-psub { color: var(--muted); font-size: .75rem; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.git-cur { font-size: .75rem; color: var(--accent-text); font-weight: 650; }
.git-act-hint { font-size: .75rem; color: var(--muted); }
/* history */
.git-commits { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.git-commit { border-top: 1px solid var(--line); min-width: 0; }
.git-commit:first-child { border-top: 0; }
.git-chead { display: flex; align-items: center; min-width: 0; }
.git-crow { display: flex; align-items: center; gap: .55rem; flex: 1; min-width: 0; min-height: 52px; padding: 0 .4rem 0 .65rem; border: 0; background: transparent; text-align: left; color: var(--ink); }
.git-cdot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.git-cmain { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.git-csub { font-size: .9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.git-cmeta { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.git-cmeta code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.git-ref { display: inline-block; font-size: .7rem; font-weight: 650; padding: 0 .35rem; margin-right: .3rem; border-radius: 5px; background: var(--side); color: var(--ink); vertical-align: 1px; }
.git-ref.head { background: var(--accent); color: var(--accent-ink); }
.git-ref.tag { background: color-mix(in srgb, var(--warn) 22%, var(--panel)); }
.git-copy { flex: none; margin-right: .2rem; min-width: 36px; min-height: 36px; justify-content: center; align-items: center; }
.git-cfiles { padding: .2rem .4rem .5rem 1.4rem; display: flex; flex-direction: column; gap: .1rem; background: var(--bg); border-top: 1px solid var(--line); min-width: 0; }
.git-cfiles.flat { padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.git-more { display: flex; justify-content: center; }
.git-graph { flex: none; display: block; margin-left: -.3rem; }
.gl { stroke: var(--muted); } .gdot { fill: var(--muted); stroke: var(--panel); stroke-width: 2; }
.gl.c0, .gdot.c0 { stroke: var(--accent); fill: var(--accent); } .gl.c1 { stroke: var(--git-info); } .gdot.c1 { fill: var(--git-info); }
.gl.c2 { stroke: var(--ok); } .gdot.c2 { fill: var(--ok); } .gl.c3 { stroke: var(--warn); } .gdot.c3 { fill: var(--warn); }
.gl.c4 { stroke: var(--err); } .gdot.c4 { fill: var(--err); } .gl.c5 { stroke: var(--muted); } .gdot.c5 { fill: var(--muted); }
.gdot { stroke: var(--panel); }
/* compare */
.git-pick { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .4rem; align-items: center; }
.git-cb { flex-wrap: wrap; row-gap: 0; }
.git-cb .git-cl { flex-basis: 100%; font-weight: 500; color: var(--muted); font-size: .72rem; }
.git-cb .git-bname { flex: 1; text-align: left; }
/* diffs */
.git-dbar { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.git-dtitle { font-weight: 650; font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; unicode-bidi: plaintext; }
.git-file { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-width: 0; }
.git-fh.single { border-bottom: 1px solid var(--line); }
.git-fh .btn { margin-left: auto; flex: none; }
.gd-box { overflow-x: auto; max-width: 100%; border-top: 1px solid var(--line); font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--panel); }
.git-fh + .gd-box { border-top: 0; }
.gd-hunk { display: inline-block; min-width: 100%; }
.gd-h { padding: .15rem .6rem; color: var(--muted); background: var(--side); white-space: pre; position: sticky; left: 0; }
.gd-l { display: flex; white-space: pre; min-width: max-content; }
.gd-l.add { background: var(--git-add); } .gd-l.del { background: var(--git-del); } .gd-l.meta { color: var(--muted); font-style: italic; }
.gd-n { flex: none; width: 3.4em; text-align: right; padding-right: .5em; color: var(--muted); user-select: none; }
.gd-m { flex: none; width: 1.2em; text-align: center; color: var(--muted); user-select: none; }
.gd-l.add .gd-m { color: var(--ok); } .gd-l.del .gd-m { color: var(--err); }
.gd-t { padding-right: 1em; }
.git-pr .git-prline { margin: 0; }
.git-prstate { font-size: .78rem; font-weight: 650; padding: .05rem .5rem; border-radius: 999px; border: 1px solid var(--line); }
.git-prstate.s-open { color: var(--ok); } .git-prstate.s-closed { color: var(--err); } .git-prstate.s-merged { color: var(--git-info); }
@media (max-width: 700px) {
  .git-pick { grid-template-columns: 1fr; }
  .git-pick .icon-btn { justify-self: center; transform: rotate(90deg); }
  .git-change, .git-dir, .git-cf, .git-fh, .git-gh { min-height: 44px; }
  .git-segb { min-height: 44px; }
}
.sch-form > *, .sch-field > * { flex: none; }
.sch-field { margin: 0; }
.sch-field input, .sch-field select { margin-top: 0; }

/* one saved change in "This conversation": what it did (in plain words) and taking it back */
.cacts { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.cacts .btn.small { min-height: 32px; }
.cexp { margin: .45rem 0 0; padding: .55rem .7rem; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: .9rem; line-height: 1.45; }
.cexp.loading { display: flex; align-items: center; gap: .5rem; color: var(--muted); background: var(--bg); }
.cexp.loading .spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.cexp.pc-err { background: color-mix(in srgb, var(--err) 10%, var(--panel)); }
@media (max-width: 700px) { .cacts .btn.small { min-height: 40px; } }

/* icon buttons (ibtn.js): the picture on the button, the name in a tooltip */
.btn.ibtn { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 0; width: 38px; min-width: 38px; height: 38px; min-height: 38px; }
.btn.ibtn .ico { display: block; }
.btn.small.ibtn { width: 38px; min-height: 38px; }
.ibadge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 650; line-height: 17px; text-align: center; }
.ibtn-tip { position: fixed; z-index: 60; max-width: min(280px, calc(100vw - 16px)); padding: .35rem .6rem; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: .8rem; font-weight: 500; line-height: 1.35; pointer-events: none; box-shadow: var(--shadow); }
.ibtn-tip.hidden { display: none; }
@media (max-width: 700px), (hover: none) { .btn.ibtn, .btn.small.ibtn { width: 44px; min-width: 44px; height: 44px; min-height: 44px; } .pane-acts > .btn.ibtn, .cacts .btn.ibtn { width: 44px; min-height: 44px; } }
.pane-acts { gap: .4rem; }
.cacts { gap: .4rem; }

/* the one-line summary under a finished reply, and its steps */
.work-line { margin: .15rem 0 .25rem 2.4rem; font-size: .8rem; color: var(--muted); }
.work-sum { background: none; border: 0; padding: .1rem 0; font: inherit; color: var(--muted); cursor: pointer; text-align: left; }
.work-sum::after { content: " ›"; }
.work-sum[aria-expanded="true"]::after { content: " ⌃"; }
.work-sum:hover, .work-sum:focus-visible { color: var(--ink); text-decoration: underline; }
.work-steps { list-style: none; margin: .25rem 0 0; padding: 0 0 0 .2rem; display: grid; gap: .1rem; }
.work-steps li::before { content: "✓ "; color: var(--ok); }
.work-steps li.failed::before { content: "✕ "; color: var(--err); }

/* files attached to an answer on a question card */
.q-files { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 0; }
.q-files:empty { display: none; }
.q-clip { font-size: .85rem; }
/* the check boxes in a scheduled task's form: the box beside its words, not stretched above them */
.sch-form label.chk { display: flex; align-items: flex-start; gap: .55rem; margin: .4rem 0; font-size: .9rem; }
.sch-form label.chk input[type="checkbox"] { width: auto; min-height: 0; flex: none; margin: .25rem 0 0; }
/* the goal in the request form: its own block, with a Skip */
.in-goal { margin: .85rem 0 0; padding: .7rem .8rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--accent-soft); }
.in-goal legend { padding: 0 .35rem; font-weight: 600; }
.in-goal p { margin: .1rem 0 .4rem; }
.in-goal textarea { background: var(--bg); }

/* the request's spec, plan and tasks, and the project's knowledge base */
.spec-tabs { margin: .25rem 0 .5rem; }
.spec-tabs .panel-tab.has::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: .35rem; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.spec-body { max-height: min(52vh, 28rem); overflow: auto; padding: .25rem .1rem; }
.spec-body h4 { margin: .9rem 0 .25rem; }
.spec-by { margin-top: 1rem; }
.spec-edit { width: 100%; min-height: 14rem; font: .88rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.spec-actions { flex-wrap: wrap; align-items: center; gap: .5rem; }
.spec-versions select { max-width: min(100%, 24rem); font: inherit; font-size: .85rem; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.spec-tasks { display: grid; gap: .4rem; }
.spec-tasks .spec-h { font-weight: 600; margin-top: .5rem; }
.spec-tasks .task { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.spec-tasks .task input { width: 1.1rem; height: 1.1rem; margin-top: .15rem; flex: none; accent-color: var(--accent); }
.spec-tasks .task.done span { color: var(--muted); text-decoration: line-through; }
.kb-q { width: 100%; margin: .25rem 0 .6rem; }
.kb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; max-height: min(56vh, 30rem); overflow: auto; }
.kb-item { padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.kb-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.kb-title { background: transparent; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.kb-sum { margin: .25rem 0; color: var(--muted); font-size: .88rem; }
.kb-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
