/* Claude GUI PWA — the desktop app's look (UI/Theme.swift): warm canvas, terracotta accent, sidebar + toolbar +
   floating composer on a computer (html.wide, ≥ 900 px); the same palette and components adapted to the phone. */

:root {
  --accent: #c6613f;
  --accent-strong: #b0512f;
  --accent-soft: rgba(198, 97, 63, 0.10);
  --accent-grad: linear-gradient(180deg, #d0714f, #b9542f);
  --on-accent: #ffffff;
  --canvas: #fcfbf9;
  --bg: var(--canvas);
  --sidebar: #f3f1ed;
  --surface: #ffffff;
  --card: var(--surface);
  --raised: #ffffff;
  --sunken: #f4f2ee;
  --card2: #f7f6f3;
  --bubble: #f1eee8;
  --fill: rgba(0, 0, 0, 0.045);
  --fill2: rgba(0, 0, 0, 0.03);
  --fill-strong: rgba(0, 0, 0, 0.08);
  --hairline: rgba(0, 0, 0, 0.08);
  --sep: rgba(0, 0, 0, 0.08);
  --border: rgba(0, 0, 0, 0.12);
  --text: #1d1b19;
  --text2: rgba(29, 27, 25, 0.62);
  --text3: rgba(29, 27, 25, 0.38);
  --code-bg: #f6f5f2;
  --code-text: #ad4a2b;
  --code-fill: rgba(0, 0, 0, 0.05);
  --green: #2f8f5b; --green-soft: rgba(47, 143, 91, 0.12);
  --red: #c4392d; --red-soft: rgba(196, 57, 45, 0.10);
  --orange: #b8761a; --orange-soft: rgba(184, 118, 26, 0.13);
  --blue: #2f6fc0; --blue-soft: rgba(47, 111, 192, 0.11);
  --purple: #7b4fc4; --purple-soft: rgba(123, 79, 196, 0.12);
  --teal: #1f8a8a; --teal-soft: rgba(31, 138, 138, 0.12);
  --add-bg: rgba(47, 143, 91, 0.11); --add-text: #1e6b40;
  --del-bg: rgba(196, 57, 45, 0.09); --del-text: #9c2b20;
  --glass: rgba(255, 255, 255, 0.78);
  --bar: rgba(252, 251, 249, 0.82);
  --shadow: 0 3px 10px rgba(0, 0, 0, 0.07);
  --shadow-pop: 0 6px 18px rgba(0, 0, 0, 0.12);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --sb-w: 272px;
  --fs: 15px;
  --fs-chat: 16px;
  --fs-sub: 13px;
  --col: 760px;
  color-scheme: light;
}
.wide { --fs: 13px; --fs-chat: 13.5px; --fs-sub: 11.5px; --col: 840px; }
@media (min-width: 1400px) { .wide { --col: 920px; } }
@media (min-width: 1900px) { .wide { --col: 1040px; } }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #e08a6b; --accent-strong: #ec9c7e; --accent-soft: rgba(224, 138, 107, 0.16); --accent-grad: linear-gradient(180deg, #e8967a, #d3775a); --on-accent: #1a0e09;
    --canvas: #1b1a19; --sidebar: #242321; --surface: #252422; --raised: #2c2b28; --sunken: #161514; --card2: #2a2927; --bubble: #33312d;
    --fill: rgba(255, 255, 255, 0.06); --fill2: rgba(255, 255, 255, 0.04); --fill-strong: rgba(255, 255, 255, 0.10);
    --hairline: rgba(255, 255, 255, 0.08); --sep: rgba(255, 255, 255, 0.08); --border: rgba(255, 255, 255, 0.13);
    --text: #f2efea; --text2: rgba(242, 239, 234, 0.62); --text3: rgba(242, 239, 234, 0.36);
    --code-bg: #161514; --code-text: #efa387; --code-fill: rgba(255, 255, 255, 0.07);
    --green: #5fcb8e; --green-soft: rgba(95, 203, 142, 0.14); --red: #f2766b; --red-soft: rgba(242, 118, 107, 0.14);
    --orange: #f0b54a; --orange-soft: rgba(240, 181, 74, 0.15); --blue: #77a9ec; --blue-soft: rgba(119, 169, 236, 0.15);
    --purple: #b294f0; --purple-soft: rgba(178, 148, 240, 0.15); --teal: #5cc7c4; --teal-soft: rgba(92, 199, 196, 0.15);
    --add-bg: rgba(95, 203, 142, 0.13); --add-text: #8fe0b0; --del-bg: rgba(242, 118, 107, 0.13); --del-text: #f5a39c;
    --glass: rgba(44, 43, 40, 0.78); --bar: rgba(27, 26, 25, 0.82);
    --shadow: 0 3px 10px rgba(0, 0, 0, 0.35); --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #e08a6b; --accent-strong: #ec9c7e; --accent-soft: rgba(224, 138, 107, 0.16); --accent-grad: linear-gradient(180deg, #e8967a, #d3775a); --on-accent: #1a0e09;
  --canvas: #1b1a19; --sidebar: #242321; --surface: #252422; --raised: #2c2b28; --sunken: #161514; --card2: #2a2927; --bubble: #33312d;
  --fill: rgba(255, 255, 255, 0.06); --fill2: rgba(255, 255, 255, 0.04); --fill-strong: rgba(255, 255, 255, 0.10);
  --hairline: rgba(255, 255, 255, 0.08); --sep: rgba(255, 255, 255, 0.08); --border: rgba(255, 255, 255, 0.13);
  --text: #f2efea; --text2: rgba(242, 239, 234, 0.62); --text3: rgba(242, 239, 234, 0.36);
  --code-bg: #161514; --code-text: #efa387; --code-fill: rgba(255, 255, 255, 0.07);
  --green: #5fcb8e; --green-soft: rgba(95, 203, 142, 0.14); --red: #f2766b; --red-soft: rgba(242, 118, 107, 0.14);
  --orange: #f0b54a; --orange-soft: rgba(240, 181, 74, 0.15); --blue: #77a9ec; --blue-soft: rgba(119, 169, 236, 0.15);
  --purple: #b294f0; --purple-soft: rgba(178, 148, 240, 0.15); --teal: #5cc7c4; --teal-soft: rgba(92, 199, 196, 0.15);
  --add-bg: rgba(95, 203, 142, 0.13); --add-text: #8fe0b0; --del-bg: rgba(242, 118, 107, 0.13); --del-text: #f5a39c;
  --glass: rgba(44, 43, 40, 0.78); --bar: rgba(27, 26, 25, 0.82);
  --shadow: 0 3px 10px rgba(0, 0, 0, 0.35); --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--canvas); }
body {
  margin: 0; min-height: 100dvh; background: var(--canvas); color: var(--text);
  font: var(--fs)/1.4 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
input, textarea { font: inherit; color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.noscript { padding: 40px; text-align: center; }
::selection { background: var(--accent-soft); }

.ic { display: inline-flex; width: 1.25em; height: 1.25em; flex-shrink: 0; align-items: center; justify-content: center; }
.ic svg { width: 100%; height: 100%; }
.ic.big { width: 40px; height: 40px; color: var(--text3); }
.mark { color: var(--accent); }
.mark svg { stroke-width: 2.4; }
.mark.spin svg { animation: spin 2.4s linear infinite; }
.muted { color: var(--text2); }
.small { font-size: 12.5px; }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pad { padding: 12px 16px; }
.pad-x { padding: 0 16px; }
.grow { flex: 1; min-height: 50vh; justify-content: center; }
.accent { color: var(--accent) !important; }
.warn-text { color: var(--orange) !important; }
.keycap {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 4px; background: var(--fill); border: 0.5px solid var(--hairline); font: 500 11px/1 var(--font); color: var(--text2);
}

/* ---------- desktop shell ---------- */
#sidebar { position: fixed; z-index: 25; top: 0; left: 0; bottom: 0; width: var(--sb-w); background: var(--sidebar); border-right: 0.5px solid var(--hairline); display: flex; }
body.with-sidebar #view { margin-left: var(--sb-w); }
body.with-sidebar { --left: var(--sb-w); }
body { --left: 0px; }

/* ---------- toolbar / nav bar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: minmax(64px, 1fr) minmax(0, 3fr) minmax(64px, 1fr); align-items: center;
  min-height: calc(44px + var(--safe-top)); padding: var(--safe-top) 6px 0;
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--hairline);
}
.navbar.large { border-bottom-color: transparent; background: var(--canvas); transition: background .2s, border-color .2s; }
.navbar.large .nb-center { opacity: 0; transition: opacity .15s; }
.navbar.large.scrolled { background: var(--bar); border-bottom-color: var(--hairline); }
.navbar.large.scrolled .nb-center { opacity: 1; }
.nb-side { display: flex; align-items: center; min-width: 0; }
.nb-side.right { justify-content: flex-end; gap: 2px; }
.nb-center { text-align: center; min-width: 0; padding: 4px 0; cursor: default; }
.nb-title { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-sub { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-sub.running { color: var(--accent); }
.nb-sub.waiting { color: var(--orange); }
.nb-btn {
  display: inline-flex; align-items: center; gap: 2px; min-width: 44px; min-height: 44px; justify-content: center;
  border: 0; background: none; color: var(--accent); font-size: 17px; padding: 0 8px; border-radius: 10px;
}
.nb-btn .ic { width: 23px; height: 23px; }
.nb-btn.back { padding-left: 2px; }
.nb-btn.back .ic { width: 26px; height: 26px; }
.nb-btn:active { opacity: .5; }
.nb-btn.on { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 360px) { .nb-back-label { display: none; } }
.large-title { padding: 2px 16px 8px; }
.large-title h1 { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -0.01em; }
.tb-group { display: flex; align-items: center; gap: 2px; }
.tb-pill { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 14px; color: var(--text2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tb-pill .ic { width: 16px; height: 16px; }
.tb-pill .ok { color: var(--green); } .tb-pill .mid { color: var(--orange); } .tb-pill .low { color: var(--red); }
.tb-pill-label { letter-spacing: .02em; }
.tb-stop { color: var(--text) !important; }

.wide .navbar {
  display: flex; gap: 10px; min-height: 52px; padding: 0 12px 0 22px; background: var(--bar);
  border-bottom: 0.5px solid var(--hairline);
}
.wide .navbar.large .nb-center { opacity: 1; }
.wide .navbar .nb-side.left { display: none; }
.wide .navbar .nb-center { flex: 1; text-align: left; padding: 6px 0; }
.wide .nb-title { font-size: 15px; font-weight: 600; }
.wide .nb-sub { font-size: 11.5px; margin-top: 1px; }
.wide .nb-side.right { gap: 6px; }
.wide .tb-group { background: var(--fill); border-radius: 16px; padding: 2px; }
.wide .nb-btn { min-width: 32px; min-height: 28px; padding: 0 7px; border-radius: 14px; color: var(--text2); font-size: 13px; }
.wide .nb-btn .ic { width: 18px; height: 18px; }
.wide .nb-btn:hover, .wide .tb-pill:hover { background: var(--fill-strong); color: var(--text); }
.wide .nb-btn.on { color: var(--accent); background: var(--accent-soft); }
.wide .large-title { display: none; }

.content { max-width: var(--col); margin: 0 auto; padding-bottom: calc(28px + var(--safe-bottom)); }
.wide .content { padding: 18px 32px 40px; max-width: calc(var(--col) + 64px); }
.wide .content.wide-content { max-width: 1184px; }

/* ---------- sections & lists ---------- */
.section { margin-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-title { margin: 0; padding: 0 28px 7px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text3); }
.wide .section-title { padding: 0 4px 8px; font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text); }
.list.inset { margin: 0 16px; background: var(--surface); border-radius: 12px; overflow: hidden; border: 0.5px solid var(--hairline); }
.wide .list.inset { margin: 0; }
.list.inset + .list.inset { margin-top: 10px; }
.row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px;
  padding: 10px 14px 10px 16px; border: 0; background: none; color: var(--text); text-align: left; text-decoration: none;
}
.wide .row { min-height: 40px; padding: 8px 12px; gap: 10px; }
.row + .row::before, .row + .bd-row::before, .bd-row + .bd-row::before {
  content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 0.5px; background: var(--sep);
}
.list .row:has(> .row-icon) + .row::before, .list .row:has(> .row-ic) + .row::before, .list .row:has(> .tile) + .row::before, .list .row:has(> .sdot-wrap) + .row::before { left: 50px; }
a.row:active, button.row:active { background: var(--fill); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: var(--fs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-title.wrap, .row-sub.wrap { white-space: normal; }
.row-sub { font-size: var(--fs-sub); color: var(--text2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-trail { display: flex; align-items: center; gap: 6px; flex-shrink: 0; max-width: 45%; }
.row-chev { width: 14px; height: 14px; color: var(--text3); }
.row-ic { width: 22px; height: 22px; color: var(--accent); }
.wide .row-ic { width: 18px; height: 18px; }
.row-value { color: var(--text2); font-size: var(--fs); white-space: nowrap; }
.row.danger, .row.danger .row-ic { color: var(--red); }
.row.as-row.selected .row-title { font-weight: 600; }
.row-check { color: var(--accent); width: 20px; height: 20px; }
.row-action { color: var(--accent); font-size: var(--fs-sub); font-weight: 500; }
.row-icon { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wide .row-icon { width: 24px; height: 24px; border-radius: 6px; }
.row-icon .ic { width: 17px; height: 17px; }
.wide .row-icon .ic { width: 14px; height: 14px; }
.row-icon.folder { background: var(--accent-soft); color: var(--accent); }
.row-icon.cloud { background: var(--blue-soft); color: var(--blue); }
.row-icon.hist { background: var(--fill); color: var(--text2); }
.muted-row { color: var(--text2); font-size: var(--fs); }
.session-row.unread .row-title { font-weight: 600; }
.link-btn { display: block; border: 0; background: none; color: var(--accent); font-size: var(--fs-sub); font-weight: 500; padding: 10px 28px; text-align: left; }
.wide .link-btn { padding: 8px 4px; }
.link-btn:hover { text-decoration: underline; }
.link-row { margin-top: 18px !important; }

/* icon tiles (System Settings style) */
.tile { width: 29px; height: 29px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.wide .tile { width: 22px; height: 22px; border-radius: 6px; }
.tile .ic { width: 17px; height: 17px; }
.wide .tile .ic { width: 14px; height: 14px; }
.tile.t-accent { background: var(--accent-grad); } .tile.t-blue { background: linear-gradient(180deg, #4f8fe0, #2f6fc0); }
.tile.t-green { background: linear-gradient(180deg, #45b077, #2f8f5b); } .tile.t-red { background: linear-gradient(180deg, #e0574a, #c4392d); }
.tile.t-orange { background: linear-gradient(180deg, #f0a03c, #d4801a); } .tile.t-gray { background: linear-gradient(180deg, #9a9893, #7a7873); }
.tile.t-purple { background: linear-gradient(180deg, #9a72de, #7b4fc4); }

/* ---------- status dots, badges, chips ---------- */
.sdot-wrap { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sdot-wrap .mark { width: 15px; height: 15px; }
.sdot { width: 9px; height: 9px; border-radius: 50%; background: var(--text3); flex-shrink: 0; display: inline-block; }
.sdot.waiting { background: var(--orange); }
.sdot.unread { background: var(--accent); }
.sdot.ok, .sdot.okdot { width: 7px; height: 7px; background: var(--green); opacity: .75; }
.sdot.okdot { opacity: 1; width: 9px; height: 9px; }
.sdot.idle { width: 7px; height: 7px; }
.sdot.error { width: 7px; height: 7px; background: var(--red); }
.sdot.ring { width: 7px; height: 7px; background: none; border: 1.3px solid var(--text3); }
.sdot.hist { width: 6px; height: 6px; background: none; border: 1.2px solid var(--text3); opacity: .55; }
.att-glyph { width: 18px; height: 18px; border-radius: 50%; background: var(--orange); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.att-glyph .ic { width: 11px; height: 11px; }
.att-glyph .ic svg { stroke-width: 2.6; }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--orange); color: #fff; font-size: 10.5px; font-weight: 700; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.badge { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 9px; background: var(--fill); color: var(--text2); white-space: nowrap; }
.badge.att-permission, .badge.att-question, .badge.att-plan { background: var(--orange-soft); color: var(--orange); }
.badge.att-done { background: var(--accent-soft); color: var(--accent); }
.badge.err { background: var(--red-soft); color: var(--red); }
.badge.open { background: var(--green-soft); color: var(--green); font-weight: 500; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 10px; background: var(--fill); color: var(--text2); }
.dev-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text2); background: var(--fill); border-radius: 6px; padding: 1px 6px; white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.dev-chip .ic { width: 12px; height: 12px; }
.dev-chip.off { opacity: .55; }
.dev-tag { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 500; color: var(--text2); background: var(--fill); border-radius: 5px; padding: 0 5px; margin-right: 5px; vertical-align: 1px; line-height: 16px; }
.dev-tag .ic { width: 11px; height: 11px; }
.dev-tag.off { opacity: .55; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--text2); background: var(--fill); border-radius: 6px; padding: 2px 7px; }
.tag .ic { width: 13px; height: 13px; }
.tag.warn { color: var(--orange); background: var(--orange-soft); }
.chips { display: flex; gap: 6px; }
.chips.wrap { flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 0; background: var(--fill-strong); color: var(--text); border-radius: 14px; padding: 6px 12px; font-size: 14px; white-space: nowrap; }
.wide .chip { font-size: 12.5px; padding: 4px 10px; }
.chip.on { background: var(--accent); color: var(--on-accent); }
.chip.small { padding: 4px 10px; font-size: 12.5px; }
.chip.icon-only { padding: 4px 8px; }
.chip .ic { width: 15px; height: 15px; }
.chip:active, .cchip:active { opacity: .6; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  border: 0.5px solid var(--border); border-radius: 12px; padding: 9px 16px; background: var(--surface); color: var(--text); font-size: 15px; font-weight: 500; text-align: center;
}
.wide .btn { min-height: 30px; padding: 5px 13px; border-radius: 8px; font-size: 13px; }
.btn.primary { background: var(--accent-grad); border-color: transparent; color: var(--on-accent); font-weight: 600; }
.btn.danger { background: var(--red); border-color: transparent; color: #fff; }
.btn.danger-text { color: var(--red); }
.btn.wide { width: 100%; }
.btn.big { min-height: 50px; flex-direction: column; gap: 0; line-height: 1.2; }
.btn.small { min-height: 32px; padding: 4px 12px; font-size: 14px; }
.wide .btn.small { min-height: 26px; font-size: 12.5px; }
.btn:disabled { opacity: .45; }
.btn:not(:disabled):active { filter: brightness(.94); transform: scale(.985); }
.btn:not(:disabled):hover { filter: brightness(.97); }
.btn .ic { width: 18px; height: 18px; }
.wide .btn .ic { width: 15px; height: 15px; }
.btn .keycap { background: rgba(255, 255, 255, 0.2); border-color: transparent; color: inherit; }
.btn-sub { font-size: 11.5px; font-weight: 400; opacity: .8; }
.btn-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.btn-row .btn { flex: 1; }
.wide .btn-row .btn { flex: 0 0 auto; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; background: none; color: var(--text2); border-radius: 9px; flex-shrink: 0; }
.wide .icon-btn { width: 26px; height: 26px; border-radius: 7px; }
.icon-btn .ic { width: 20px; height: 20px; }
.wide .icon-btn .ic { width: 16px; height: 16px; }
.icon-btn.run { color: var(--accent); }
.icon-btn:active, .icon-btn:hover { background: var(--fill); }

/* forms */
.field {
  display: block; width: 100%; font-size: 16px; padding: 11px 13px; border-radius: 10px;
  border: 0.5px solid var(--border); background: var(--surface); color: var(--text); outline: none; resize: vertical;
}
.wide .field { font-size: 13px; padding: 7px 10px; border-radius: 8px; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-label { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--text3); margin: 18px 4px 7px; letter-spacing: 0.04em; }
.seg { display: flex; background: var(--fill-strong); border-radius: 9px; padding: 2px; gap: 2px; }
.seg-item { flex: 1; border: 0; background: none; border-radius: 7px; padding: 6px 8px; font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 30px; }
.wide .seg-item { font-size: 12.5px; padding: 3px 10px; min-height: 24px; }
.seg-item.on { background: var(--raised); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); font-weight: 600; }
.row .seg { flex: 0 0 auto; min-width: 140px; }

/* spinner */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--fill-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; flex-shrink: 0; }
.spinner.small { width: 16px; height: 16px; border-width: 2px; }
.spinner.tiny { width: 12px; height: 12px; border-width: 1.8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 44px 32px; color: var(--text2); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-top: 6px; }
.empty-text { font-size: var(--fs-sub); max-width: 360px; }
.empty .btn { margin-top: 12px; }
.small-empty { padding: 28px 16px; }

/* ---------- banner, toasts ---------- */
#banner {
  position: fixed; z-index: 60; top: calc(var(--safe-top) + 50px); left: calc(50% + var(--left) / 2); transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 6px 14px; border-radius: 16px; font-size: 13px; font-weight: 500;
  background: rgba(40, 38, 36, 0.92); color: #fff; box-shadow: var(--shadow-pop); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.wide #banner { top: 60px; }
#toasts { position: fixed; z-index: 300; top: calc(var(--safe-top) + 8px); left: var(--left); right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 12px; }
.wide #toasts { top: 60px; }
.toast {
  pointer-events: auto; max-width: 480px; width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 11px 15px; border-radius: 14px; background: rgba(36, 34, 32, 0.94); color: #fff; box-shadow: var(--shadow-pop); font-size: 14px;
  transform: translateY(-16px); opacity: 0; transition: transform .22s ease, opacity .22s ease;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.wide .toast { font-size: 13px; padding: 9px 14px; width: auto; min-width: 280px; }
.toast.show { transform: none; opacity: 1; }
.toast.error { background: rgba(170, 40, 30, 0.95); }
.toast-text { flex: 1; min-width: 0; }
.toast-action { border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 600; border-radius: 9px; padding: 5px 11px; }

/* ---------- sheets (phone: bottom sheets; computer: centered dialogs) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.32); opacity: 0; transition: opacity .25s; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 640px; max-height: calc(100dvh - var(--safe-top) - 24px);
  display: flex; flex-direction: column; background: var(--canvas); border-radius: 16px 16px 0 0; padding-bottom: var(--safe-bottom);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
}
.sheet.full { height: calc(100dvh - var(--safe-top) - 24px); }
.sheet-wrap.open .sheet { transform: none; }
.sheet-grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--text3); margin: 6px auto 0; flex-shrink: 0; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 18px; flex-shrink: 0; }
.sheet-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-close { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--fill-strong); color: var(--text2); display: inline-flex; align-items: center; justify-content: center; }
.sheet-close .ic { width: 15px; height: 15px; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 0 16px; flex: 1; }
.sheet-msg { margin: 0 16px 4px; color: var(--text2); font-size: 14px; }
.sheet .list.inset { margin: 0 16px; }
.sheet .list.inset + .list.inset { margin-top: 10px; }
.sheet.actions .sheet-body { padding-top: 10px; }
.as-head { text-align: center; padding: 2px 24px 12px; }
.as-title { font-size: 15px; font-weight: 600; }
.as-msg { font-size: 13px; color: var(--text2); margin-top: 4px; white-space: pre-wrap; }
.as-cancel .row-title { text-align: center; font-weight: 600; color: var(--accent); }

.wide .sheet {
  left: calc(50% + var(--left) / 2); right: auto; bottom: auto; top: 50%; width: min(560px, calc(100vw - var(--left) - 48px)); max-height: min(760px, calc(100dvh - 80px));
  border-radius: 14px; padding-bottom: 0; transform: translate(-50%, -48%) scale(.98); opacity: 0;
  transition: transform .18s ease, opacity .18s ease; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); border: 0.5px solid var(--border); background: var(--canvas);
}
.wide .sheet.full { height: min(860px, calc(100dvh - 60px)); width: min(980px, calc(100vw - var(--left) - 48px)); }
.wide .sheet.actions { width: 380px; }
.wide .sheet-wrap.open .sheet { transform: translate(-50%, -50%); opacity: 1; }
.wide .sheet-grabber { display: none; }
.wide .sheet-head { padding: 12px 12px 8px 18px; }
.wide .sheet-title { font-size: 14px; }
.wide .sheet-close { width: 24px; height: 24px; }
.wide .sheet-close .ic { width: 12px; height: 12px; }
.wide .sheet-body { padding: 4px 0 14px; }
.wide .sheet.actions .row { min-height: 36px; }
.wide .as-row .row-ic { width: 16px; height: 16px; }

.ns { padding: 0 16px 8px; }
.ns-where { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 0.5px solid var(--hairline); border-radius: 12px; padding: 12px 14px; }
.ns-where > .ic { width: 26px; height: 26px; color: var(--accent); }
.ns-name { font-weight: 600; font-size: 15px; }
.ns .btn.big { margin-top: 22px; }
.wide .ns .btn.big { min-height: 36px; }
.row.picker { background: var(--surface); border: 0.5px solid var(--hairline); border-radius: 12px; }

.info-card { margin: 0 16px 14px; background: var(--surface); border: 0.5px solid var(--hairline); border-radius: 12px; padding: 2px 14px; }
.ic-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: var(--fs); color: var(--text); }
.ic-col + .ic-row, .ic-row + .ic-row, .ic-row + .ic-col, .ic-col + .ic-col { border-top: 0.5px solid var(--sep); }
.ic-col { padding-bottom: 10px; }
.ic-val { display: inline-flex; align-items: center; gap: 4px; }

/* image viewer */
.iv { position: fixed; inset: 0; z-index: 200; background: #000; opacity: 0; transition: opacity .18s; touch-action: pan-x pan-y pinch-zoom; }
.iv.open { opacity: 1; }
.iv-bar { position: absolute; z-index: 2; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-top) + 8px) 12px 8px; background: linear-gradient(rgba(0, 0, 0, 0.55), transparent); }
.iv-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.iv-btn .ic { width: 20px; height: 20px; }
.iv-count { color: #fff; font-size: 14px; }
.iv-stage { position: absolute; inset: 0; overflow: auto; display: flex; align-items: center; justify-content: center; }
.iv-img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-select: none; }
.iv.zoomed .iv-stage { display: block; }
.iv.zoomed .iv-img { max-width: none; max-height: none; width: 250%; }
.iv .spinner { position: absolute; border-color: rgba(255, 255, 255, 0.2); border-top-color: #fff; }
.iv-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.iv-nav.prev { left: 12px; } .iv-nav.next { right: 12px; }
@media (pointer: coarse) { .iv-nav { display: none; } }

/* file viewer */
.fv-meta { font-size: 12px; color: var(--text2); padding: 0 18px 10px; font-family: var(--mono); word-break: break-all; }
.fv-code { margin: 0 12px; background: var(--code-bg); border: 0.5px solid var(--hairline); border-radius: 10px; padding: 10px 0; overflow: auto; font: 12px/1.5 var(--mono); }
.fv-code code { display: block; min-width: max-content; }
.ln { display: block; padding-right: 14px; }
.ln-n { display: inline-block; width: 3.4em; padding-right: 12px; text-align: right; color: var(--text3); user-select: none; -webkit-user-select: none; }
.ln-t { white-space: pre; }
.fv-image { padding: 0 12px; text-align: center; }
.fv-image img { max-width: 100%; border-radius: 10px; background: var(--fill); }
.fv-md { padding: 0 18px; }
.fv-tools { padding: 0 16px 10px; }

/* ---------- login ---------- */
.login { max-width: 400px; margin: 0 auto; padding: calc(var(--safe-top) + 56px) 20px 40px; }
.wide .login { padding-top: 12vh; }
.login-hero { text-align: center; margin-bottom: 26px; }
.login-logo { width: 80px; height: 80px; border-radius: 19px; box-shadow: var(--shadow-pop); }
.login-hero h1 { margin: 16px 0 4px; font-size: 26px; }
.login-hero p { margin: 0; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.list.inset.fields { margin: 0; }
.list.inset.fields .field { border: 0; border-radius: 0; background: none; box-shadow: none; font-size: 16px; padding: 12px 14px; }
.list.inset.fields .field + .field { border-top: 0.5px solid var(--sep); }
.wide .login-form .btn.big { min-height: 40px; }
.invite { display: flex; flex-direction: column; gap: 6px; }
.invite .muted { padding: 0 6px; }
.form-error { color: var(--red); font-size: 14px; min-height: 1em; padding: 0 4px; }
.login > p { margin-top: 26px; padding: 0 12px; }

/* ---------- sidebar ---------- */
.sidebar { display: flex; flex-direction: column; width: 100%; min-width: 0; }
#sidebar .sidebar { height: 100%; }
.sb-toolbar { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 10px 0 16px; flex-shrink: 0; }
.sb-brand { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-weight: 600; font-size: 14px; }
.sb-brand .mark { width: 18px; height: 18px; }
.tb-btn { width: 30px; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--text2); display: inline-flex; align-items: center; justify-content: center; }
.tb-btn .ic { width: 18px; height: 18px; }
.tb-btn:hover { background: var(--fill-strong); color: var(--text); }
.sb-top { padding: 0 10px 6px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.sb-search { display: flex; align-items: center; gap: 5px; height: 28px; padding: 0 8px; background: var(--fill-strong); border-radius: 7px; color: var(--text3); }
.sb-search .ic { width: 14px; height: 14px; }
.sb-search-input { flex: 1; min-width: 0; border: 0; background: none; font-size: 13px; outline: none; padding: 0; -webkit-appearance: none; appearance: none; }
.sb-search:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }
.sb-seg { display: flex; background: var(--fill-strong); border-radius: 7px; padding: 2px; gap: 2px; margin: 0 22px; }
.sb-seg-item { flex: 1; border: 0; background: none; border-radius: 5px; padding: 2px 8px; font-size: 12.5px; font-weight: 500; color: var(--text); min-height: 22px; }
.sb-seg-item.on { background: var(--raised); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14); }
.sb-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 2px 10px 10px; min-height: 0; }
.sb-section { font-size: 11px; font-weight: 600; color: var(--text3); padding: 12px 8px 4px; }
.sb-row {
  position: relative; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 28px; padding: 3px 8px; border: 0; border-radius: 7px;
  background: none; color: var(--text); text-align: left; font-size: 13px; text-decoration: none;
}
.sb-row:hover { background: var(--fill); }
.sb-row.selected { background: var(--fill-strong); }
.sb-ic { width: 16px; height: 16px; color: var(--text2); }
.sb-main { flex: 1; min-width: 0; }
.sb-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-sess { align-items: center; padding-top: 4px; padding-bottom: 4px; }
.sb-sess .sb-title { display: block; }
.sb-sess.unread .sb-title { font-weight: 600; }
.sb-sub { font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0; }
.sb-sub.warn { color: var(--orange); }
.sb-hist .sb-title { color: var(--text2); }
.sb-overview .sb-title { font-weight: 500; }
.sb-run { width: 14px; height: 14px; }
.sb-proj { padding-left: 2px; gap: 4px; }
.sb-chev { width: 18px; height: 20px; border: 0; background: none; padding: 0; color: var(--text3); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sb-chev .ic { width: 11px; height: 11px; transition: transform .15s; }
.sb-chev .ic svg { stroke-width: 3; }
.sb-chev.open .ic { transform: rotate(90deg); }
.sb-proj-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--text); }
.sb-proj.active-proj .sb-title { font-weight: 600; }
.sb-ind { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sb-todo, .sb-count { display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; color: var(--text3); font-variant-numeric: tabular-nums; }
.sb-todo .ic { width: 11px; height: 11px; }
.sb-hover { display: none; gap: 2px; flex-shrink: 0; }
.sb-mini { width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--fill-strong); color: var(--text2); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.sb-mini .ic { width: 12px; height: 12px; }
.sb-mini:hover { color: var(--accent); }
@media (hover: hover) {
  .sb-proj:hover .sb-hover { display: inline-flex; }
  .sb-proj:hover .sb-ind { display: none; }
}
.sb-children { padding-left: 16px; }
.sb-more { color: var(--text2); font-size: 12px; padding-left: 32px; }
.sb-children .sb-more { padding-left: 32px; }
.sb-none { color: var(--text3); font-size: 12px; padding-left: 32px; }
.sb-none:hover { background: none; }
.sb-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 16px; text-align: center; color: var(--text2); font-size: 12.5px; }
.sb-empty-title { font-weight: 600; color: var(--text); }
.sb-bottom { flex-shrink: 0; padding: 6px 10px calc(10px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 6px; }
.sb-limits { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; background: var(--glass); border: 0.5px solid var(--hairline); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.sb-limits:hover { border-color: var(--border); }
.sbl-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; font-weight: 600; }
.sbl-val { font-variant-numeric: tabular-nums; }
.sbl-sub { font-size: 10px; color: var(--text3); margin-top: 3px; }
.sb-links { display: flex; flex-direction: column; }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.conn-dot.off { background: var(--text3); }
.ok { color: var(--green); } .mid { color: var(--orange); } .low { color: var(--red); }

/* the sidebar as the phone's root screen */
.sidebar.as-screen .sb-top { padding: 0 16px 8px; gap: 10px; }
.sidebar.as-screen .sb-search { height: 38px; border-radius: 10px; padding: 0 10px; }
.sidebar.as-screen .sb-search .ic { width: 17px; height: 17px; }
.sidebar.as-screen .sb-search-input { font-size: 16px; }
.sidebar.as-screen .sb-seg { margin: 0; border-radius: 9px; }
.sidebar.as-screen .sb-seg-item { font-size: 13.5px; min-height: 30px; border-radius: 7px; }
.sidebar.as-screen .sb-list { overflow: visible; padding: 0 8px; }
.sidebar.as-screen .sb-row { font-size: 16px; min-height: 44px; padding: 6px 10px; border-radius: 10px; gap: 10px; }
.sidebar.as-screen .sb-row:active { background: var(--fill-strong); }
.sidebar.as-screen .sb-overview { background: var(--surface); border: 0.5px solid var(--hairline); }
.sidebar.as-screen .sb-sub { font-size: 13px; }
.sidebar.as-screen .sb-section { font-size: 12.5px; padding: 16px 10px 4px; }
.sidebar.as-screen .sb-ic { width: 20px; height: 20px; }
.sidebar.as-screen .sdot-wrap { width: 18px; }
.sidebar.as-screen .sb-proj { padding-left: 2px; gap: 6px; }
.sidebar.as-screen .sb-chev { width: 26px; height: 32px; }
.sidebar.as-screen .sb-chev .ic { width: 13px; height: 13px; }
.sidebar.as-screen .sb-children { padding-left: 22px; }
.sidebar.as-screen .sb-more, .sidebar.as-screen .sb-none { font-size: 14px; padding-left: 38px; }
.sidebar.as-screen .sb-todo, .sidebar.as-screen .sb-count { font-size: 12.5px; }
.sidebar.as-screen .att-glyph { width: 22px; height: 22px; }
.sidebar.as-screen .att-glyph .ic { width: 13px; height: 13px; }
.sidebar.as-screen .sb-bottom { padding: 18px 16px 8px; gap: 10px; }
.sidebar.as-screen .sb-limits { padding: 14px; border-radius: 14px; background: var(--surface); flex-direction: row; gap: 16px; }
.sidebar.as-screen .sbl { flex: 1; min-width: 0; }
.sidebar.as-screen .sbl-top { font-size: 13px; }
.sidebar.as-screen .sbl-sub { font-size: 11.5px; }
.sidebar.as-screen .sb-links { background: var(--surface); border: 0.5px solid var(--hairline); border-radius: 14px; padding: 4px; }

/* ---------- overview ---------- */
.overview { padding: 4px 16px 0; }
.wide .overview { padding: 10px 0 0; }
.ov-sec { margin-top: 26px; }
.ov-sec:first-child { margin-top: 8px; }
.ov-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 4px 10px; }
.ov-h { margin: 0; font-size: 15px; font-weight: 600; }
.wide .ov-h { font-size: 14px; }
.ov-link { font-size: 13px; font-weight: 500; }
.ov-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.wide .ov-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.wide .ov-grid.wide-cards { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.wide .ov-grid.proj-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ov-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface); border: 0.5px solid var(--hairline); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); }
.ov-card:hover { border-color: var(--border); box-shadow: var(--shadow); }
.ov-card.waiting { border-color: color-mix(in srgb, var(--orange) 40%, transparent); }
.ov-card .sdot-wrap { margin-top: 2px; }
.ov-main { flex: 1; min-width: 0; }
.ov-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-sub { font-size: var(--fs-sub); color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-text { font-size: var(--fs-sub); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list.inset.card-list { margin: 0; }
.proj-card { position: relative; display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; background: var(--surface); border: 0.5px solid var(--hairline); }
.proj-card:hover { border-color: var(--border); box-shadow: var(--shadow); }
.pc-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--text); }
.pc-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pc-icon .ic { width: 20px; height: 20px; }
.pc-main { min-width: 0; }
.pc-name { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.pc-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-path { font-size: var(--fs-sub); color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-detail { font-size: 11px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-add { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; }
.pc-add .ic { width: 15px; height: 15px; }
.pc-add .ic svg { stroke-width: 2.6; }
.pc-add:disabled { opacity: .4; }
.welcome { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 30px 12px 8px; gap: 6px; }
.welcome-mark .mark { width: 60px; height: 60px; filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent)); }
.welcome h1 { margin: 10px 0 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.welcome p { margin: 0; max-width: 420px; font-size: 14px; }
.welcome-actions { margin-top: 14px; }
.tips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin: 34px 0 10px; color: var(--text2); font-size: 12.5px; }
.tip { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- limits ---------- */
.limit-grid { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 0 16px; }
.overview .limit-grid { padding: 0; }
.wide .limit-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); padding: 0; }
.limit-card { background: var(--surface); border: 0.5px solid var(--hairline); border-radius: 12px; padding: 13px 15px; }
.lc-head { display: flex; align-items: baseline; gap: 8px; }
.lc-title { flex: 1; min-width: 0; font-weight: 600; }
.lc-left { font-size: 12px; color: var(--text2); }
.lc-pct { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.limit-card .meter { margin: 8px 0 7px; height: 6px; }
.lc-reset { font-size: 12px; color: var(--text3); }
.lc-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text2); margin-top: 8px; }
.lc-foot.col { flex-direction: column; gap: 3px; }
.meter { height: 6px; border-radius: 3px; background: var(--fill-strong); overflow: hidden; margin-top: 6px; }
.meter.thin { height: 4px; margin-top: 5px; }
.meter.big { height: 8px; border-radius: 4px; }
.meter-fill { height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s; }
.meter-fill.ok { background: var(--green); }
.meter-fill.mid { background: var(--orange); }
.meter-fill.low { background: var(--red); }

/* ---------- project ---------- */
.proj-content { padding-top: 6px; }
.proj-head { margin: 6px 16px 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; }
.wide .proj-head { margin: 4px 0 0; grid-template-columns: auto 1fr auto; }
.ph-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.ph-icon .ic { width: 24px; height: 24px; }
.ph-main { min-width: 0; }
.ph-name { font-size: 20px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-sub { font-size: 12px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ph-tags:empty { display: none; }
.proj-head > .btn { grid-column: 1 / -1; margin-top: 12px; }
.wide .proj-head > .btn { grid-column: auto; margin-top: 0; }
.cap-tabs-wrap { margin: 18px 0 14px; overflow-x: auto; scrollbar-width: none; padding: 0 16px; }
.wide .cap-tabs-wrap { padding: 0; }
.cap-tabs-wrap::-webkit-scrollbar { display: none; }
.cap-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 17px; background: var(--fill); }
.cap-tab { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border: 0.5px solid transparent; border-radius: 15px; background: none; color: var(--text2); font-size: 14px; font-weight: 500; white-space: nowrap; }
.wide .cap-tab { height: 26px; padding: 0 11px; font-size: 12.5px; }
.cap-tab:hover { color: var(--text); }
.cap-tab.on { background: var(--raised); color: var(--text); border-color: var(--hairline); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.cap-count { font-size: 11px; color: var(--text3); font-variant-numeric: tabular-nums; }
.proj-pane { padding: 0 16px; }
.wide .proj-pane { padding: 0; }
.todo-add { gap: 10px; }
.todo-add-ic { color: var(--accent); width: 20px; height: 20px; }
.todo-input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; padding: 6px 0; }
.wide .todo-input { font-size: 13px; }
.todo-row { padding-top: 8px; padding-bottom: 8px; gap: 10px; align-items: center; }
.todo-row .row-main { cursor: pointer; }
.todo-row .row-title { white-space: normal; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--text3); background: none; color: transparent; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; }
.wide .check { width: 17px; height: 17px; }
.check .ic { width: 14px; height: 14px; }
.wide .check .ic { width: 11px; height: 11px; }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }
.check.half { border-color: var(--accent); }
.todo-row.done .row-title { color: var(--text3); text-decoration: line-through; }
.prio { color: var(--red); font-weight: 700; margin-right: 4px; }

/* ---------- session screen ---------- */
body[data-screen="session"] { overflow: hidden; }
.session-screen { position: fixed; top: 0; left: var(--left); right: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--canvas); }
.session-screen .navbar { position: relative; flex-shrink: 0; }
.session-screen .nb-center { cursor: pointer; }
.wide .session-screen .nb-center { cursor: default; }
.session-screen .navbar:not(.wide *) { grid-template-columns: 48px minmax(0, 1fr) 48px; }
.session-body { flex: 1; min-height: 0; display: flex; }
.session-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.feed-wrap { position: relative; flex: 1; min-height: 0; }
.feed { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 14px 0 8px; }
.feed-inner { max-width: var(--col); margin: 0 auto; padding: 0 14px; display: flex; flex-direction: column; gap: 10px; }
.wide .feed-inner { padding: 0 32px; }
@media (max-width: 1100px) { .wide .feed-inner { padding: 0 22px; } }
.feed-tail { max-width: var(--col); margin: 0 auto; padding: 8px 14px 4px; }
.wide .feed-tail { padding: 8px 32px 4px; }
.earlier { margin: 0 auto 8px; text-align: center; }
.jump { position: absolute; right: 16px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0.5px solid var(--border); background: var(--glass); color: var(--text); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.jump .ic { width: 18px; height: 18px; }

.live-line { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text2); }
.wide .live-line { font-size: 12.5px; }
.live-line .mark { width: 16px; height: 16px; }
.ll-text { color: var(--accent); font-weight: 500; }
.ll-time { color: var(--text3); font-variant-numeric: tabular-nums; }
.ll-hint { display: inline-flex; align-items: center; gap: 5px; color: var(--text3); margin-left: 4px; }
.ll-hand { width: 16px; height: 16px; color: var(--orange); }

/* messages */
.msg.user { align-self: flex-end; max-width: 86%; display: flex; flex-direction: column; align-items: flex-end; margin-top: 14px; }
.wide .msg.user { max-width: calc(100% - 96px); margin-top: 16px; margin-bottom: 4px; }
.feed-inner > .msg.user:first-child { margin-top: 0; }
.bubble { background: var(--bubble); border-radius: 18px; padding: 9px 14px; font-size: var(--fs-chat); line-height: 1.45; }
.bubble-text { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.msg.user.queued { opacity: .62; }
.msg.user.queued .bubble { background: transparent; border: 1px dashed var(--text3); }
.queued-bar { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 6px; }
.q-label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text2); margin-right: 2px; }
.q-label .ic { width: 14px; height: 14px; }
.msg-time { font-size: 10.5px; color: var(--text3); margin-top: 3px; padding-right: 4px; }
.msg.assistant { font-size: var(--fs-chat); line-height: 1.55; overflow-wrap: anywhere; }
.msg.assistant.streaming .md > :last-child::after { content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--accent); border-radius: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.msg.error { display: flex; gap: 8px; align-items: flex-start; background: var(--red-soft); color: var(--red); border-radius: 11px; padding: 12px; font-size: var(--fs); }
.msg.error .md p:last-child { margin-bottom: 0; }
.notice { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 12px; color: var(--text2); }
.notice .ic { width: 14px; height: 14px; color: var(--text3); }
.notice.compact { display: flex; width: 100%; align-self: stretch; justify-content: center; gap: 10px; color: var(--text3); }
.notice.compact::before, .notice.compact::after { content: ""; flex: 1; height: 0.5px; background: var(--hairline); }

.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 0.7em; }
.md .md-h { margin: 1em 0 0.45em; line-height: 1.25; }
.md .md-h1 { font-size: 1.45em; font-weight: 700; } .md .md-h2 { font-size: 1.25em; font-weight: 700; } .md .md-h3 { font-size: 1.12em; font-weight: 600; } .md .md-h4 { font-size: 1em; font-weight: 600; }
.md ul, .md ol { margin: 0 0 0.7em; padding-left: 1.4em; }
.md ul > li::marker { color: var(--accent); font-weight: 700; }
.md li { margin: 0.2em 0; }
.md li.task { list-style: none; margin-left: -1.3em; }
.md-check { display: inline-block; width: 14px; height: 14px; border: 1.5px solid var(--text3); border-radius: 4px; margin-right: 7px; vertical-align: -2px; }
.md-check.on { background: var(--accent); border-color: var(--accent); }
.md code { font-family: var(--mono); font-size: 0.88em; color: var(--code-text); background: var(--code-fill); border-radius: 5px; padding: 0.1em 0.35em; }
.md-code { position: relative; margin: 0 0 0.8em; background: var(--code-bg); border: 0.5px solid var(--hairline); border-radius: 10px; overflow: hidden; }
.md-code-head { display: flex; align-items: center; justify-content: space-between; min-height: 26px; padding: 4px 8px 0 12px; }
.md-lang { font: 11px var(--mono); color: var(--text3); }
.md-copy { border: 0; background: var(--fill-strong); color: var(--text2); font-size: 11px; border-radius: 6px; padding: 2px 8px; opacity: 0; transition: opacity .15s; }
.md-code:hover .md-copy, .md-copy:focus-visible { opacity: 1; }
@media (hover: none) { .md-copy { opacity: 1; background: none; } }
.md-code pre { margin: 0; padding: 4px 12px 12px; overflow-x: auto; font: 0.9em/1.5 var(--mono); }
.md-code code { background: none; padding: 0; font-size: inherit; color: var(--text); }
.md blockquote { margin: 0 0 0.7em; padding: 0 0 0 12px; border-left: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); color: var(--text2); }
.md hr { border: 0; border-top: 0.5px solid var(--hairline); margin: 1em 0; }
.md-table { overflow-x: auto; margin: 0 0 0.8em; border: 0.5px solid var(--hairline); border-radius: 8px; width: fit-content; max-width: 100%; }
.md table { border-collapse: collapse; font-size: 0.93em; }
.md th, .md td { padding: 6px 12px; text-align: left; vertical-align: top; }
.md td { border-top: 0.5px solid var(--hairline); }
.md tr:nth-child(even) td { background: var(--fill2); }
.md th { font-weight: 600; background: var(--fill); }
.md .ar { text-align: right; } .md .ac { text-align: center; }
.md a { word-break: break-word; }

.evidence { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ev { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; border-radius: 9px; padding: 2px 9px 2px 7px; }
.ev .ic { width: 13px; height: 13px; }
.ev.ok { background: var(--green-soft); color: var(--green); }
.ev.fail { background: var(--red-soft); color: var(--red); }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.file-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 260px; padding: 4px 10px; border-radius: 8px; border: 0.5px solid var(--border); background: var(--surface); color: var(--text); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip:hover { border-color: var(--accent); }
.file-chip .ic { width: 14px; height: 14px; color: var(--accent); }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.thumbs.in-bubble { margin: 0 0 6px; justify-content: flex-end; }
.thumb { width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 0.5px solid var(--hairline); padding: 0; background: var(--fill); display: inline-flex; align-items: center; justify-content: center; color: var(--text3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; }
.thumb.loaded img { opacity: 1; }
.thumb.failed img { display: none; }
.thumbs .thumb:only-child { width: min(260px, 70vw); height: 160px; }
.tool-thumbs { padding: 0 10px 10px; margin-top: 0; }

/* thinking */
.thinking { font-size: 12px; color: var(--text3); }
.wide .thinking { font-size: 11px; }
.th-head { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; padding: 2px 0; color: var(--text3); text-align: left; }
.th-head .ic { width: 12px; height: 12px; }
.th-head .th-chev { width: 10px; height: 10px; }
.th-label { font-weight: 500; flex-shrink: 0; }
.th-preview { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thinking.streaming .th-label, .thinking.streaming .th-head > .ic:first-child { color: var(--accent); }
.th-body { margin: 6px 0 2px 5px; padding-left: 11px; border-left: 2px solid var(--hairline); font-size: calc(var(--fs-chat) * 0.92); line-height: 1.5; color: var(--text2); }

/* tool groups and rows (ActivityGroup / ToolViews) */
.tools-card, .agent-card { background: var(--fill); border-radius: 11px; overflow: hidden; border: 0.5px solid transparent; }
.tools-card.open, .agent-card.open { border-color: var(--hairline); background: var(--fill2); }
.tools-card.has-err { border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.tools-head, .tool-head, .agent-head { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 7px 10px; text-align: left; color: var(--text); min-height: 36px; }
.tools-head:hover, .tool-head:hover, .agent-head:hover { background: var(--fill); }
.t-ic { width: 16px; height: 16px; color: var(--text2); }
.t-ic.err { color: var(--red); }
.t-spin { margin: 0 2px; }
.tools-sum { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wide .tools-sum { font-size: 12.5px; }
.tools-count { font-size: 11px; font-weight: 600; color: var(--text2); background: var(--fill-strong); border-radius: 8px; padding: 0 6px; line-height: 17px; font-variant-numeric: tabular-nums; }
.th-chev { width: 11px; height: 11px; color: var(--text3); transition: transform .15s; }
.th-chev.open { transform: rotate(90deg); }
.tool-live { display: flex; gap: 8px; padding: 0 12px 9px 34px; margin-top: -3px; font-size: 12px; min-width: 0; }
.tool-live .t-title { color: var(--accent); }
.tool-list { border-top: 0.5px solid var(--hairline); padding: 4px; }
.tool { border-radius: 7px; }
.tool-list .tool-head { min-height: 28px; padding: 4px 6px; border-radius: 7px; }
.t-title { font-size: 12.5px; font-weight: 500; flex-shrink: 0; max-width: 45%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub { flex: 1; min-width: 0; font: 11.5px var(--mono); color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-status { flex-shrink: 0; font-size: 11px; color: var(--text3); display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }
.t-status .ic { width: 13px; height: 13px; }
.t-status.ok .ic { color: var(--green); }
.t-status.err { color: var(--red); }
.tool.error .t-title { color: var(--red); }
.tool.cat-edit .t-ic { color: var(--blue); } .tool.cat-agent .t-ic { color: var(--accent); } .tool.cat-todo .t-ic { color: var(--green); }
.tool.cat-web .t-ic { color: var(--teal); } .tool.cat-mcp .t-ic { color: var(--purple); }
.tools-card.single.running .t-title { color: var(--accent); }
.tool-detail { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 2px 10px 10px 32px; }
.tool-detail > * { max-width: 100%; }
pre.code { margin: 0; width: 100%; background: var(--code-bg); border-radius: 8px; padding: 8px 10px; font: 11.5px/1.5 var(--mono); overflow: auto; max-height: 320px; white-space: pre; color: var(--text); border: 0.5px solid var(--hairline); }
pre.code.cmd { color: var(--text); }
pre.code.cmd::first-letter { color: var(--accent); }
pre.code.result.error { color: var(--red); }
.diff { width: 100%; background: var(--code-bg); border-radius: 8px; font: 11.5px/1.55 var(--mono); overflow: auto; max-height: 360px; border: 0.5px solid var(--hairline); padding: 4px 0; }
.dl { display: flex; white-space: pre; min-width: max-content; padding-right: 10px; }
.dl.add { background: var(--add-bg); color: var(--add-text); }
.dl.del { background: var(--del-bg); color: var(--del-text); }
.dl-n { width: 3.2em; flex-shrink: 0; text-align: right; color: var(--text3); padding-right: 6px; user-select: none; -webkit-user-select: none; }
.dl-k { width: 1.5em; flex-shrink: 0; text-align: center; }

/* agents in the feed */
.agent-head { align-items: flex-start; }
.agent-ic { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.agent-ic .ic { width: 15px; height: 15px; }
.agent-main { flex: 1; min-width: 0; }
.agent-title { font-size: 13px; font-weight: 600; }
.agent-desc { font-size: 12.5px; color: var(--text2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.agent-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }
.agent-body { padding: 0 12px 12px 44px; display: flex; flex-direction: column; gap: 8px; }
.agent-children { display: flex; flex-direction: column; gap: 4px; }
.ac-row { display: flex; align-items: center; gap: 6px; font: 11.5px var(--mono); color: var(--text2); min-width: 0; }
.ac-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-ic { width: 13px; height: 13px; color: var(--text3); }
.agent-summary { font-size: 13px; }
.st-pill { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; height: 18px; font-size: 10.5px; font-weight: 600; border-radius: 9px; padding: 0 8px; background: var(--fill-strong); color: var(--text2); white-space: nowrap; }
.st-pill.running, .st-pill.active { background: var(--accent-soft); color: var(--accent); }
.st-pill.done, .st-pill.completed { background: var(--green-soft); color: var(--green); }
.st-pill.error, .st-pill.failed { background: var(--red-soft); color: var(--red); }
.phases { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.phase { font-size: 11px; border-radius: 6px; padding: 1px 7px; background: var(--fill-strong); color: var(--text2); }
.phase.done { background: var(--green-soft); color: var(--green); }
.phase.running, .phase.active { background: var(--accent-soft); color: var(--accent); }
.wf-agent { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.wf-label { font-weight: 500; font-family: var(--mono); font-size: 12px; }

/* ---------- dock above the composer: progress strip, recovery, interactions ---------- */
.dock { position: relative; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; padding: 6px 10px calc(8px + var(--safe-bottom)); }
.dock::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 22px; background: linear-gradient(to bottom, transparent, var(--canvas)); pointer-events: none; }
.dock > * { width: 100%; max-width: calc(var(--col) + 24px); margin-left: auto; margin-right: auto; }
.wide .dock { padding: 4px 16px 12px; }
.progress-strip {
  flex-shrink: 0; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 14px 8px 16px; border: 0; text-align: left; color: var(--text);
  background: var(--bar); border-bottom: 0.5px solid var(--hairline); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.wide .progress-strip { min-height: 40px; padding: 6px 12px; border-radius: 16px; border: 0.5px solid var(--hairline); background: var(--glass); box-shadow: var(--shadow); }
.ps-ring { --p: 0; width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; position: relative; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--fill-strong) 0); }
.ps-ring::after { content: ""; position: absolute; inset: 3.5px; border-radius: 50%; background: var(--canvas); }
.wide .ps-ring::after { background: var(--raised); }
.ps-main { flex: 1; min-width: 0; }
.ps-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wide .ps-title { font-size: 12.5px; }
.ps-sub { font-size: 11.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-pct { font-size: 12px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.ps-agents { display: flex; gap: 2px; align-items: flex-end; height: 16px; flex-shrink: 0; }
.ps-agent { --p: 0; width: 4px; height: 16px; border-radius: 2px; background: linear-gradient(to top, var(--accent) calc(var(--p) * 1%), var(--fill-strong) 0); }
.ps-agent.done { background: var(--green); }
.ps-agent.failed { background: var(--red); }
.ps-agent.waiting { background: linear-gradient(to top, var(--orange) calc(var(--p) * 1%), var(--fill-strong) 0); }

.recovery-note { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--orange-soft); border: 0.5px solid color-mix(in srgb, var(--orange) 35%, transparent); }
.rn-main { flex: 1; min-width: 0; }
.rn-title { font-size: 13.5px; font-weight: 600; color: var(--orange); }
.rn-sub { font-size: 12px; color: var(--text2); font-variant-numeric: tabular-nums; }
.rn-hint { font-size: 12px; color: var(--text2); margin-top: 2px; }
.rn-actions { display: flex; gap: 6px; flex-shrink: 0; }
.rn-btn { border: 0.5px solid var(--border); border-radius: 8px; padding: 5px 10px; font-size: 12.5px; background: var(--surface); color: var(--text); }
.rn-btn.primary { background: var(--accent-grad); color: var(--on-accent); border-color: transparent; }
.rn-btn:disabled { opacity: .5; }
.offline-note { text-align: center; font-size: 12.5px; color: var(--orange); background: var(--orange-soft); padding: 6px 12px; border-radius: 10px; }

/* interaction cards (InteractionViews.swift) */
.ia-panel { padding: 8px 10px 14px; margin: -8px -10px -14px; max-height: 62dvh; overflow-y: auto; overscroll-behavior: contain; }
.ia-panel:not(.has) { display: none; }
.ia-card {
  --kind: var(--accent);
  background: var(--raised); border-radius: 18px; padding: 14px; border: 1px solid color-mix(in srgb, var(--kind) 45%, transparent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); transition: opacity .2s; animation: slideUp .22s ease;
}
.ia-card.question { --kind: var(--blue); }
.ia-card.plan { --kind: var(--green); }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } }
.ia-card.sending { opacity: .5; pointer-events: none; }
.ia-card.collapsed .ia-body { display: none; }
.ia-card.collapsed .ia-head .icon-btn { transform: rotate(180deg); }
.ia-head { display: flex; align-items: center; gap: 10px; }
.ia-ic { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(180deg, color-mix(in srgb, var(--kind) 82%, #fff), var(--kind)); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ia-ic .ic { width: 17px; height: 17px; }
.ia-titles { flex: 1; min-width: 0; }
.ia-title { font-size: 15px; font-weight: 600; }
.wide .ia-title { font-size: 14px; }
.ia-subtitle { font-size: 12.5px; color: var(--text2); }
.wide .ia-subtitle { font-size: 12px; }
.ia-body { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.ia-desc { font-size: var(--fs); color: var(--text2); }
.ia-preview { max-height: 160px; }
.ia-plan { max-height: 34vh; overflow-y: auto; font-size: var(--fs-chat); padding: 10px 12px; border-radius: 10px; background: var(--fill); }
.ia-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ia-spacer { display: none; }
.ia-actions.perm .allow { order: -2; }
.ia-actions.perm .deny { order: -1; }
.ia-actions.perm .always { grid-column: 1 / -1; flex-direction: column; gap: 1px; }
.ia-actions.plan { grid-template-columns: 1fr; }
.ia-actions.plan .approve { order: -2; } .ia-actions.plan .ask { order: -1; }
.ia-actions.single { grid-template-columns: 1fr; }
.ia-actions .btn .keycap { display: none; }
.btn-sub { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ia-actions .always .btn-sub { font-family: var(--mono); font-size: 11px; }
.wide .ia-actions { display: flex; align-items: center; gap: 8px; }
.wide .ia-spacer { display: block; flex: 1; }
.wide .ia-actions .btn { order: 0 !important; }
.wide .ia-actions .btn .keycap { display: inline-flex; }
.wide .ia-actions.perm .always { flex-direction: row; max-width: 46%; }
.wide .ia-actions.perm .always .btn-sub { display: none; }
.deny-box { display: flex; flex-direction: column; gap: 4px; }
.q-block { display: flex; flex-direction: column; gap: 7px; }
.q-header { align-self: flex-start; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--blue); background: var(--blue-soft); border-radius: 6px; padding: 2px 7px; }
.q-question { font-size: calc(var(--fs) + 0.5px); font-weight: 500; }
.q-opts { display: grid; grid-template-columns: 1fr; gap: 6px; }
.wide .q-opts { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.q-opt { display: flex; align-items: flex-start; gap: 9px; width: 100%; text-align: left; padding: 10px; border-radius: 10px; border: 1px solid transparent; background: var(--fill); color: var(--text); min-height: 44px; }
.wide .q-opt { min-height: 0; }
.q-opt:hover { background: var(--fill-strong); }
.q-opt.on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); }
.q-mark { width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid var(--text3); flex-shrink: 0; margin-top: 1px; position: relative; }
.q-opt.multi .q-mark { border-radius: 5px; }
.q-opt.on .q-mark { border-color: var(--accent); background: var(--accent); }
.q-opt.on .q-mark::after { content: ""; position: absolute; left: 4.5px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.q-text { display: flex; flex-direction: column; min-width: 0; }
.q-opt .q-label { font-size: var(--fs); font-weight: 500; color: var(--text); margin: 0; }
.q-desc { font-size: 12px; color: var(--text2); }
.q-other { font-size: 16px; }

/* ---------- composer (Composer.swift) ---------- */
.composer { position: relative; }
.composer-box {
  border-radius: 20px; background: var(--glass); border: 0.5px solid var(--border); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); padding: 9px 8px 6px 10px;
  transition: border-color .15s, box-shadow .15s;
}
.wide .composer-box { padding: 11px 10px 8px; }
.composer-box:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.composer-box.drop { border: 2px dashed var(--accent); }
.composer.disabled .composer-box { opacity: .55; }
.composer-input {
  display: block; width: 100%; min-width: 0; font-size: 16px; line-height: 1.4; padding: 2px 4px 6px; max-height: 180px; resize: none;
  border: 0; background: none; color: var(--text); outline: none;
}
.wide .composer-input { font-size: 14px; }
.composer-input::placeholder { color: var(--text3); }
.composer-controls { display: flex; align-items: center; gap: 2px; min-width: 0; }
.cc-chips { flex: 1; min-width: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.cc-chips::-webkit-scrollbar { display: none; }
.cchip { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; height: 28px; border: 0; border-radius: 14px; padding: 0 9px; font-size: 13px; font-weight: 500; background: none; color: var(--text2); white-space: nowrap; }
.wide .cchip { height: 26px; padding: 0 8px; font-size: 12px; }
.cchip:hover { background: var(--fill-strong); color: var(--text); }
.cchip .ic { width: 14px; height: 14px; }
.wide .cchip .ic { width: 13px; height: 13px; }
.cchip.mode-plan { color: var(--blue); background: var(--blue-soft); }
.cchip.mode-acceptEdits { color: var(--green); background: var(--green-soft); }
.cchip.mode-bypassPermissions, .cchip.mode-dontAsk { color: var(--red); background: var(--red-soft); }
.cchip.mode-auto { color: var(--accent); background: var(--accent-soft); }
.c-queued { font-size: 11.5px; color: var(--orange); white-space: nowrap; padding: 0 4px; }
.c-ctx { display: inline-flex; align-items: center; gap: 4px; height: 28px; border: 0; background: none; color: var(--text3); font-size: 11.5px; font-variant-numeric: tabular-nums; padding: 0 6px; border-radius: 14px; flex-shrink: 0; }
.c-ctx:hover { background: var(--fill-strong); color: var(--text2); }
.ctx-ring { --p: 0; width: 15px; height: 15px; border-radius: 50%; position: relative; background: conic-gradient(var(--text2) calc(var(--p) * 1%), var(--fill-strong) 0); }
.ctx-ring::after { content: ""; position: absolute; inset: 2.5px; border-radius: 50%; background: var(--raised); }
.ctx-ring.warn { background: conic-gradient(var(--orange) calc(var(--p) * 1%), var(--fill-strong) 0); }
.c-btn { width: 30px; height: 30px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: none; color: var(--text2); padding: 0; }
.wide .c-btn { width: 28px; height: 28px; }
.c-btn .ic { width: 18px; height: 18px; }
.c-btn.attach:hover { background: var(--fill-strong); color: var(--text); }
.c-btn.send { background: var(--fill-strong); color: var(--text3); margin-left: 2px; }
.c-btn.send.ready { background: var(--accent-grad); color: #fff; }
.c-btn.send .ic svg { stroke-width: 2.6; }
.c-btn.stop { background: color-mix(in srgb, var(--text) 85%, transparent); color: var(--canvas); margin-left: 2px; }
.c-btn.stop .ic { width: 14px; height: 14px; }
.c-btn:active { transform: scale(.94); }
.att-previews { display: flex; gap: 8px; padding: 4px 2px 8px; overflow-x: auto; }
.att-item { position: relative; width: 60px; height: 60px; flex-shrink: 0; }
.att-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.att-x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--raised); background: rgba(0, 0, 0, 0.7); color: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.att-x .ic { width: 11px; height: 11px; }
.cmd-suggest { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 5; background: var(--raised); border: 0.5px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 5px 14px rgba(0, 0, 0, 0.12); padding: 4px; }
.cmd-section { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text3); padding: 4px 8px 2px; }
.cmd { display: flex; align-items: baseline; gap: 8px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 7px; text-align: left; color: var(--text); }
.wide .cmd { padding: 5px 8px; }
.cmd:hover, .cmd:first-of-type { background: var(--accent-soft); }
.cmd-name { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.cmd-arg { font-family: var(--mono); font-size: 11.5px; color: var(--text3); }
.cmd-desc { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-foot { display: flex; align-items: center; gap: 5px; padding: 6px 8px 3px; font-size: 11px; color: var(--text3); border-top: 0.5px solid var(--hairline); margin-top: 4px; }

/* ---------- inspector (computer) ---------- */
.inspector { width: 330px; flex-shrink: 0; display: flex; flex-direction: column; border-left: 0.5px solid var(--hairline); background: var(--sunken); min-height: 0; }
@media (min-width: 1500px) { .inspector { width: 360px; } }
@media (max-width: 1180px) {
  .inspector { position: absolute; z-index: 15; top: 60px; right: 10px; bottom: 120px; width: min(340px, calc(100% - 48px)); border: 0.5px solid var(--border); border-radius: 18px;
    background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); box-shadow: var(--shadow-pop); overflow: hidden; }
}
.insp-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px 12px; }
.insp-tabs { flex: 1; display: flex; background: var(--fill-strong); border-radius: 7px; padding: 2px; gap: 2px; }
.insp-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 24px; border: 0; border-radius: 5px; background: none; color: var(--text2); font-size: 12px; font-weight: 500; }
.insp-tab .ic { width: 13px; height: 13px; }
.insp-tab.on { background: var(--raised); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14); }
.insp-body { flex: 1; overflow-y: auto; padding: 8px 14px 18px; }
.insp-body .info-card, .insp-body .list.inset { margin-left: 0; margin-right: 0; }
.insp-body .dash { padding: 0; }
.insp-body .field-label { margin-left: 2px; }

/* progress dashboard */
.dash { padding: 0 16px; }
.dash-title { font-size: 17px; font-weight: 700; }
.wide .dash-title { font-size: 15px; }
.dash-summary { font-size: var(--fs); color: var(--text2); margin: 6px 0 12px; }
.stages { display: flex; flex-direction: column; gap: 2px; margin: 14px 0; }
.stage { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; }
.stage-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--text3); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.stage-dot .ic { width: 11px; height: 11px; }
.stage.done .stage-dot { background: var(--green); border-color: var(--green); color: #fff; }
.stage.active .stage-dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.stage.pending .stage-title { color: var(--text2); }
.stage-title { font-size: var(--fs); font-weight: 500; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 12px 0; }
.metric { background: var(--surface); border: 0.5px solid var(--hairline); border-radius: 10px; padding: 10px 12px; }
.metric-val { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric-label { font-size: 11.5px; color: var(--text2); }
.risks .field-label { margin-left: 0; }
.risk { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs); padding: 4px 0; }
.risk .ic { color: var(--orange); width: 16px; height: 16px; }
.sheet .field-label { margin-left: 20px; }
.todos-block .todo-meter { margin: 0 0 10px; }
.sheet .todos-block .todo-meter { margin: 0 16px 10px; }
.todo-row.completed .check, .todo-row .check.on { cursor: default; }
.agents { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.dash-agent { background: var(--surface); border: 0.5px solid var(--hairline); border-radius: 13px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.035); }
.ac-head { display: flex; align-items: center; gap: 8px; }
.ac-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.dash-agent.done .ac-dot { background: var(--green); }
.dash-agent.failed .ac-dot { background: var(--red); }
.dash-agent.waiting .ac-dot { background: var(--orange); }
.dash-agent.queued .ac-dot, .dash-agent.stopped .ac-dot { background: var(--text3); }
.ac-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-pct { font-size: 12px; color: var(--accent); font-variant-numeric: tabular-nums; }
.dash-agent.done .ac-pct { color: var(--green); }
.ac-now { color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- analytics ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 0 16px; }
.wide .stats { padding: 0; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.stat { background: var(--surface); border: 0.5px solid var(--hairline); border-radius: 10px; padding: 12px; }
.stat-val { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--text2); }
.chart-card { margin: 0 16px; background: var(--surface); border: 0.5px solid var(--hairline); border-radius: 12px; padding: 12px 12px 28px; }
.wide .chart-card { margin: 0; }
.chart-tip { font-size: 12.5px; color: var(--text2); min-height: 18px; margin: 0 4px 10px; }
.chart { display: flex; align-items: stretch; gap: 6px; height: 150px; border-bottom: 0.5px solid var(--border); }
.wide .chart { height: 180px; gap: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; border: 0; background: none; padding: 0; min-width: 0; }
.chart-bar-wrap { flex: 1; display: flex; align-items: flex-end; }
.chart-bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .3s; }
.chart-col:hover .chart-bar, .chart-col:focus .chart-bar { filter: brightness(1.12); }
.chart-x { font-size: 11px; color: var(--text2); text-align: center; padding-top: 4px; transform: translateY(16px); height: 0; }
.bd { padding: 2px 0; }
.bd-row { position: relative; padding: 10px 16px; }
.wide .bd-row { padding: 8px 14px; }
.bd-top { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs); }
.bd-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.bd-bar { height: 5px; border-radius: 3px; background: var(--fill-strong); margin: 6px 0 4px; overflow: hidden; }
.bd-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.bd-sub { font-size: 11.5px; color: var(--text2); }
.wide .screen-analytics .content > div:last-child { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0 24px; align-items: start; }
.wide .screen-analytics .section:first-child, .wide .screen-analytics .content > div:last-child > .muted { grid-column: 1 / -1; }

/* install hint */
.install { padding: 0 20px 8px; font-size: 15px; }
.install p { margin: 4px 0 12px; }
.steps { list-style: none; padding: 0; margin: 0 0 12px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.step-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-ic .ic { width: 20px; height: 20px; }

/* settings & limits pages on a computer: centered grouped form */
.wide .screen-settings .content, .wide .screen-limits .content { max-width: 720px; }
.wide .screen-settings .section, .wide .screen-limits .section { margin-top: 20px; }

@media (hover: hover) {
  a.row:hover, button.row:hover { background: var(--fill2); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
html:not(.wide) .row:has(> .seg) { flex-wrap: wrap; }
html:not(.wide) .row:has(> .seg) > .seg { flex: 1 1 100%; margin-left: 41px; }
.dock > .ia-panel { width: auto; max-width: none; margin: -8px max(-10px, calc((100% - var(--col) - 44px) / 2)) -14px; }

/* fleet console «Парк» (js/screens/fleet.js, docs/FLEET.md) */
.danger-text { color: var(--red) !important; }
.dev-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dev-tag .dev-dot { width: 7px; height: 7px; margin-right: 2px; }
.sb-fleet-bad { display: inline-flex; color: var(--red); }
.sb-fleet-bad .ic { width: 13px; height: 13px; }
.fleet { padding: 4px 16px 32px; }
.wide .fleet { padding: 0 0 32px; }
.fl-summary { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 8px 4px 0; font-size: 14px; color: var(--text2); }
.fl-sum { display: inline-flex; align-items: center; gap: 4px; }
.fl-sum b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.fl-sum.warn-text b, .fl-sum.accent b, .fl-sum.danger-text b { color: inherit; }
.fl-run { width: 14px; height: 14px; }
.fl-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.wide .fl-grid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.fl-card {
  position: relative; display: flex; flex-direction: column; gap: 9px; padding: 13px 14px 12px; border-radius: 12px; background: var(--surface);
  border: 0.5px solid var(--hairline); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); overflow: hidden; min-width: 0;
}
.fl-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--fl-color, var(--accent)); }
.fl-card.offline { opacity: .62; }
.fl-card.h-error { border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.fl-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.fl-swatch { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.fl-swatch.big { width: 12px; height: 12px; }
.fl-title-box { flex: 1; min-width: 0; }
.fl-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-sub { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-health { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 9px; white-space: nowrap; flex-shrink: 0; }
.fl-health .ic { width: 12px; height: 12px; }
.fl-health.ok { background: var(--green-soft); color: var(--green); }
.fl-health.warn { background: var(--orange-soft); color: var(--orange); }
.fl-health.error { background: var(--red-soft); color: var(--red); }
.fl-health.offline { background: var(--fill); color: var(--text2); }
.fl-edit { width: 30px; height: 30px; margin: -4px -6px -4px 0; }
.fl-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.fl-tags .tag { font-size: 11px; padding: 1px 6px; }
.fl-stats { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.fl-stat-n { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.fl-stat-l { font-size: 11.5px; color: var(--text2); }
.fl-stat.warn .fl-stat-n { color: var(--orange); }
.fl-stat.accent .fl-stat-n { color: var(--accent); }
.fl-paused { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 12px; font-weight: 600; color: var(--orange); background: var(--orange-soft); border-radius: 8px; padding: 2px 8px; }
.fl-paused .ic { width: 11px; height: 11px; }
.fl-facts { font-size: 12px; color: var(--text2); overflow-wrap: anywhere; }
.fl-issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.fl-issues li { display: flex; gap: 6px; align-items: baseline; }
.fl-issues li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; transform: translateY(-1px); background: var(--text3); }
.fl-issues li.error { color: var(--red); } .fl-issues li.error::before { background: var(--red); }
.fl-issues li.warn { color: var(--orange); } .fl-issues li.warn::before { background: var(--orange); }
.fl-issues li.info { color: var(--text2); }
.fl-sessions { display: flex; flex-direction: column; border-top: 0.5px solid var(--sep); margin: 2px -4px 0; padding-top: 5px; }
.fl-sess { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 7px; color: var(--text); min-width: 0; }
a.fl-sess:hover { background: var(--fill); }
.fl-sess-main { flex: 1; min-width: 0; }
.fl-sess-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-sess-sub { font-size: 11.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-more { font-size: 11.5px; color: var(--text3); padding: 2px 4px 0 25px; }
.fl-acc-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.wide .fl-acc-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.fl-acc { background: var(--surface); border: 0.5px solid var(--hairline); border-radius: 12px; padding: 13px 15px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fl-acc-head { display: flex; flex-direction: column; gap: 6px; }
.fl-acc-title { font-weight: 600; }
.fl-acc-members, .fl-spent { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--text2); }
.fl-member, .fl-spent-item { display: inline-flex; align-items: center; gap: 5px; }
.fl-spent b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.fl-limits { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 16px; }
.fl-limit-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.fl-limit-top .ok { color: var(--green); } .fl-limit-top .mid { color: var(--orange); } .fl-limit-top .low { color: var(--red); }
.fl-limit-top span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.fl-limit-sub, .fl-acc-foot { font-size: 11.5px; color: var(--text3); margin-top: 3px; }
.fl-form .field-label:first-child { margin-top: 4px; }
.fl-palette { display: flex; flex-wrap: wrap; gap: 8px; }
.fl-pick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 2px var(--surface); padding: 0; }
.fl-pick.on { border-color: var(--text); }
.fl-stepper { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fl-step-val { min-width: 28px; text-align: center; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fl-save { margin-top: 20px; }

/* «Входящие» of the fleet (docs/FLEET.md, stage 1) */
.inbox { padding: 4px 16px 32px; max-width: 860px; }
.wide .inbox { padding: 0 0 32px; }
.ib-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 8px 4px 14px; font-size: 13.5px; color: var(--text2); }
.ib-keys { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.ib-keys span { display: inline-flex; align-items: center; gap: 4px; }
.ib-list { display: flex; flex-direction: column; gap: 14px; }
.ib-entry { border-radius: 20px; padding: 2px; outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .15s; }
.ib-entry.sel { outline-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.ib-meta { display: flex; align-items: center; gap: 7px; margin: 0 6px 6px; font-size: 12.5px; color: var(--text2); min-width: 0; }
.ib-meta .ib-inst { font-weight: 600; color: var(--text); white-space: nowrap; }
.ib-meta .ib-sess { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ib-meta .ib-age { margin-left: auto; white-space: nowrap; color: var(--text3); }
.ib-meta a { color: var(--accent); white-space: nowrap; }
.ib-entry .ia-card { animation: none; box-shadow: none; }
.ib-batch { margin: 8px 6px 0; }
.sb-inbox[hidden] { display: none; }
a.fl-sum { color: inherit; text-decoration: none; }
a.fl-sum:hover { text-decoration: underline; }
