/* Weft — Metricito OS's look: the desktop's window colour for the frame, an
   inset content panel, Metricito blue accents, Open Sans; light and dark as the
   desktop's Metricito Light and Dark. */

@font-face {
  font-family: "Inter";
  src: url("/static/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --frame: #f7f8fa;
  --frame-2: #eceff3;
  --frame-3: #dde2e9;
  --frame-text: #1a1d21;
  --frame-muted: #5b6573;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f7f9;
  --surface-3: #eceff3;
  --border: #e3e7ec;
  --border-strong: #cfd5dd;
  --text: #1a1d21;
  --text-2: #3f4650;
  --muted: #5b6573;
  --accent: #106ebe;
  --accent-hover: #0d5ea3;
  --accent-soft: #e3eef8;
  --accent-text: #0d5ea3;
  --danger: #c42b1c;
  --danger-soft: #fbe9e7;
  --ok: #107c10;
  --ok-soft: #e6f4e6;
  --warn: #b35900;
  --warn-soft: #fdf0e3;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(26, 29, 33, .05), 0 2px 10px rgba(26, 29, 33, .04);
  --shadow-lg: 0 14px 40px rgba(26, 29, 33, .16);
  /* Focus categories: validated diverging pair (blue ↔ red) with a grey midpoint. */
  --cat-productive: #2a78d6;
  --cat-neutral: #8f8e88;
  --cat-distracting: #e34948;
  --cat-afk: #e4e7ec;
  /* Sequential single-hue ramp for magnitude. */
  --h0: #f2f4f7;
  --h1: #cde2fb;
  --h2: #9ec5f4;
  --h3: #6da7ec;
  --h4: #3987e5;
  --h5: #256abf;
  --h6: #184f95;
  --grid: #eceff3;
  --axis: #8a93a0;
  --cork: #c9a26b;
  --font: "Open Sans", "Noto Sans", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --frame: #121418;
    --frame-2: #1f2229;
    --frame-3: #2a2e36;
    --frame-text: #e6eaf0;
    --frame-muted: #9aa4b2;
    --bg: #1c1f25;
    --surface: #22252c;
    --surface-2: #282c34;
    --surface-3: #30343d;
    --border: #2c3038;
    --border-strong: #3b404a;
    --text: #e6eaf0;
    --text-2: #c3c9d2;
    --muted: #9aa4b2;
    --accent: #4ba3f0;
    --accent-hover: #6db5f3;
    --accent-soft: #1a2c3e;
    --accent-text: #7dbdf5;
    --danger: #ff8a80;
    --danger-soft: #3a2224;
    --ok: #5edb8c;
    --ok-soft: #17301f;
    --warn: #ffa37d;
    --warn-soft: #3a2a1f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 14px 40px rgba(0, 0, 0, .5);
    --cat-productive: #3987e5;
    --cat-neutral: #6b6a73;
    --cat-distracting: #e66767;
    --cat-afk: #2c3038;
    --h0: #24272e;
    --h1: #0d366b;
    --h2: #104281;
    --h3: #1c5cab;
    --h4: #2a78d6;
    --h5: #5598e7;
    --h6: #86b6ef;
    --grid: #2a2e36;
    --axis: #8a93a0;
    --cork: #6e5434;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --frame: #121418;
  --frame-2: #1f2229;
  --frame-3: #2a2e36;
  --frame-text: #e6eaf0;
  --frame-muted: #9aa4b2;
  --bg: #1c1f25;
  --surface: #22252c;
  --surface-2: #282c34;
  --surface-3: #30343d;
  --border: #2c3038;
  --border-strong: #3b404a;
  --text: #e6eaf0;
  --text-2: #c3c9d2;
  --muted: #9aa4b2;
  --accent: #4ba3f0;
  --accent-hover: #6db5f3;
  --accent-soft: #1a2c3e;
  --accent-text: #7dbdf5;
  --danger: #ff8a80;
  --danger-soft: #3a2224;
  --ok: #5edb8c;
  --ok-soft: #17301f;
  --warn: #ffa37d;
  --warn-soft: #3a2a1f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, .5);
  --cat-productive: #3987e5;
  --cat-neutral: #6b6a73;
  --cat-distracting: #e66767;
  --cat-afk: #2c3038;
  --h0: #24272e;
  --h1: #0d366b;
  --h2: #104281;
  --h3: #1c5cab;
  --h4: #2a78d6;
  --h5: #5598e7;
  --h6: #86b6ef;
  --grid: #2a2e36;
  --axis: #8a93a0;
  --cork: #6e5434;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  color: var(--text);
  background: var(--frame);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
code, pre, .kbd { font-family: var(--mono); font-size: .9em; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
pre { background: var(--surface-2); padding: 12px 14px; border-radius: var(--radius-sm); overflow-x: auto; white-space: pre-wrap; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.icon { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grow { flex: 1; }
.kbd { display: inline-block; padding: 0 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; font-size: 11px; color: var(--muted); background: var(--surface); }
.btn .kbd { margin-left: 8px; background: transparent; border-color: rgba(255, 255, 255, .35); color: inherit; opacity: .8; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 296px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  color: var(--frame-text);
  display: grid; grid-template-columns: 60px minmax(0, 1fr); overflow: hidden;
}
/* Space rail: My work, then each team (docs/TEAMS.md). */
.sb-rail { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 0 12px; border-right: 1px solid var(--frame-3); overflow-y: auto; scrollbar-width: none; }
.rail-item { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 12px; background: transparent; color: var(--frame-muted); cursor: pointer; }
.rail-item:hover { background: var(--frame-2); color: var(--frame-text); text-decoration: none; }
.rail-item::before { content: ""; position: absolute; left: -10px; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--frame-text); transform: translateY(-50%); transition: height .15s; }
.rail-item:hover::before { height: 14px; }
.rail-item.active::before { height: 28px; }
.rail-item:hover { background: transparent; }
.rail-me, .rail-team { display: grid; place-items: center; width: 40px; height: 40px; color: #fff; font-size: 14px; font-weight: 700; letter-spacing: -.01em; transition: border-radius .15s, transform .15s; }
.rail-me { border-radius: 50%; background: var(--accent); }
/* A team tile: its colour as a soft gradient, or a tinted tile behind its emoji. */
.rail-team { --c: var(--accent); border-radius: 14px; background: linear-gradient(150deg, color-mix(in srgb, var(--c) 78%, white), var(--c) 55%, color-mix(in srgb, var(--c) 75%, black)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(0, 0, 0, .25); text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.rail-team.emoji { background: color-mix(in srgb, var(--c) 22%, var(--frame-2)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent); font-size: 21px; text-shadow: none; }
.rail-item:hover .rail-team, .rail-item.active .rail-team { border-radius: 11px; }
.rail-item:active .rail-team { transform: translateY(1px); }
.rail-item.active .rail-team.emoji { background: color-mix(in srgb, var(--c) 34%, var(--frame-2)); box-shadow: inset 0 0 0 2px var(--c); }
.rail-badge { position: absolute; right: -3px; top: -3px; min-width: 18px; height: 18px; padding: 0 5px; border: 2px solid var(--frame); border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 14px; text-align: center; }
.rail-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border: 2.5px solid var(--frame); border-radius: 50%; background: var(--accent); }
.rail-tip { position: fixed; z-index: 60; padding: 5px 10px; border-radius: 6px; background: #111418; color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); transform: translateY(-50%); }
.rail-tip::before { content: ""; position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; background: inherit; transform: translateY(-50%) rotate(45deg); }
.sb-space { align-items: center; gap: 10px; }
.sb-space-mark { --c: var(--accent); display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(150deg, color-mix(in srgb, var(--c) 78%, white), var(--c) 55%, color-mix(in srgb, var(--c) 75%, black)); color: #fff; font-size: 11.5px; font-weight: 700; }
.sb-space-mark.emoji { background: color-mix(in srgb, var(--c) 22%, var(--frame-2)); font-size: 16px; }

/* Team settings: icon and colour pickers. */
.team-look { margin: 0; padding: 0; border: 0; }
.team-look legend { margin-bottom: 6px; padding: 0; font-weight: 600; font-size: 13px; }
.icon-picker, .color-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-choice, .color-choice { position: relative; cursor: pointer; }
.icon-choice input, .color-choice input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.icon-tile { --c: var(--accent); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: color-mix(in srgb, var(--c) 16%, var(--surface)); font-size: 20px; font-weight: 700; color: var(--text); transition: transform .1s; }
.icon-choice:hover .icon-tile { transform: translateY(-1px); }
.icon-choice input:checked + .icon-tile { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); background: color-mix(in srgb, var(--c) 28%, var(--surface)); }
.icon-choice input:focus-visible + .icon-tile, .color-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.color-choice span { display: block; width: 28px; height: 28px; border-radius: 50%; }
.color-choice input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text-2); }
.color-choice.custom input { width: 32px; height: 30px; padding: 0; border: 1px dashed var(--border-strong); border-radius: 50%; background: none; cursor: pointer; }
.rail-sep { width: 24px; height: 1px; flex: none; margin: 2px 0; background: var(--frame-3); }
.rail-add, .rail-manage { border: 1px dashed var(--frame-3); }
.rail-manage { margin-top: auto; border-style: solid; }
.rail-expand { display: none; }
.sb-panel {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 18px 12px 12px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--frame-3) transparent;
}
.sb-space { font-size: 16px; min-width: 0; }
.sb-space-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-empty { padding: 4px 12px; color: var(--frame-muted); font-size: 12.5px; }
.sb-top { padding: 0 8px 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--frame-text); font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.logo { width: 28px; height: 28px; }
.sb-tools { display: flex; gap: 6px; padding: 0 6px 14px; }
.sb-tool {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0;
  background: color-mix(in srgb, var(--frame-text) 7%, transparent); color: var(--frame-text); cursor: pointer;
}
.sb-tool:hover, .sb-tool.active { background: var(--frame-2); text-decoration: none; }
.sb-label { text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; color: var(--frame-muted); padding: 14px 10px 6px; font-weight: 600; }
.sb-nav { display: flex; flex-direction: column; gap: 1px; }
/* Each menu item has its own colour (--c): a straight 3px bar on the left and the icon. */
.sb-link {
  --c: var(--frame-muted);
  display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 9px;
  border-left: 3px solid color-mix(in srgb, var(--c) 70%, transparent);
  color: var(--frame-text); opacity: .86; font-weight: 500; white-space: nowrap; overflow: hidden;
}
.sb-link > .icon { color: var(--c); }
.sb-link span:last-child { overflow: hidden; text-overflow: ellipsis; }
.sb-link:hover { background: color-mix(in srgb, var(--c) 12%, transparent); border-left-color: var(--c); opacity: 1; text-decoration: none; }
.sb-link:focus-visible { outline: none; background: color-mix(in srgb, var(--c) 16%, transparent); border-left-color: var(--c); }
.sb-link.active { background: color-mix(in srgb, var(--c) 22%, transparent); border-left-color: var(--c); opacity: 1; font-weight: 600; }
.sb-avatar {
  display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%;
  font-size: 10px; font-weight: 700; color: var(--frame-text); background: var(--frame-3);
}
.sb-avatar .icon { width: 13px; height: 13px; }
.sb-avatar.user { width: 30px; height: 30px; background: var(--accent); color: #fff; font-size: 12px; }
.sb-scroll { display: flex; flex-direction: column; gap: 2px; }
.sb-label-row { display: flex; align-items: center; justify-content: space-between; padding-right: 4px; }
.sb-add { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; color: var(--frame-muted); }
.sb-add:hover { background: var(--frame-2); color: var(--frame-text); }
.sb-add .icon { width: 13px; height: 13px; }
.sb-hash { width: 14px; text-align: center; color: var(--c); font-weight: 700; }
.sb-actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 16px 4px 10px; }
.sb-btn {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0;
  background: color-mix(in srgb, var(--frame-text) 7%, transparent); color: var(--frame-text); font-weight: 500;
}
.sb-btn:hover { background: var(--frame-2); text-decoration: none; }
.sb-user { display: flex; align-items: center; gap: 8px; padding: 12px 6px 4px; }
.sb-user form { margin: 0; }
.sb-username { color: var(--frame-text); font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.shell.collapsed { grid-template-columns: 60px minmax(0, 1fr); }
.shell.collapsed .sidebar { grid-template-columns: 60px; }
.shell.collapsed .sb-panel { display: none; }
.shell.collapsed .rail-expand { display: grid; }

.shell.collapsed .sidebar .brand span, .shell.collapsed .sb-label, .shell.collapsed .sb-link span:last-child,
.shell.collapsed .sb-btn, .shell.collapsed .sb-username, .shell.collapsed .sb-tool:not([data-action="toggle-sidebar"]) { display: none; }
.shell.collapsed .sb-link { justify-content: center; padding: 9px 9px 9px 6px; }
.shell.collapsed .sb-user { flex-direction: column; }

.frame {
  margin: 10px 10px 10px 0; background: var(--bg); border-radius: 12px; min-width: 0;
  display: flex; flex-direction: column; height: calc(100vh - 20px); overflow: hidden;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--frame-text) 7%, transparent);
}
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 12px 22px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex: none;
}
.greeting { min-width: 0; }
.greet-1 { font-size: 12px; color: var(--muted); }
.greet-2 { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 26ch; }
.quick {
  flex: 1; display: flex; align-items: center; gap: 8px; max-width: 640px; margin: 0 auto;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; color: var(--muted);
}
.quick:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.quick input { flex: 1; border: 0; background: transparent; padding: 9px 0; font: inherit; color: var(--text); outline: none; min-width: 0; }
.top-right { display: flex; align-items: center; gap: 14px; }
.dateblock { display: flex; align-items: center; gap: 8px; color: var(--text); padding-right: 14px; border-right: 1px solid var(--border); }
.dateblock:hover { text-decoration: none; }
.db-day { font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.db-meta { display: flex; flex-direction: column; line-height: 1.2; }
.db-wd { font-size: 11.5px; color: var(--muted); }
.db-next { font-size: 12px; font-weight: 600; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer { display: flex; align-items: center; gap: 8px; margin: 0; }
.timer input { width: 150px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font: inherit; color: var(--text); }
.timer.running { background: var(--accent-soft); padding: 4px 6px 4px 12px; border-radius: 999px; }
.timer-label { color: var(--accent-text); font-weight: 600; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elapsed { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.timer form { margin: 0; }
.timer-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.timer-btn:hover { background: var(--accent-hover); }
.timer-btn .icon { width: 13px; height: 13px; fill: currentColor; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .5); } 70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.content { flex: 1; overflow-y: auto; padding: 22px 26px 60px; scroll-behavior: smooth; }
.mobile-only { display: none; }

/* ---------- primitives ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 550;
  cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.big { padding: 12px 20px; font-size: 15px; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .6; cursor: progress; }
.when-busy { display: none; }
.when-idle { display: inline-flex; align-items: center; gap: 6px; }
.htmx-request .when-idle, [disabled] .when-idle { display: none; }
.htmx-request .when-busy, [disabled] .when-busy { display: inline; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); text-decoration: none; }
.icon-btn.active { color: #d97706; }
.icon-btn.active .icon { fill: currentColor; }
.icon-btn.tiny { width: 22px; height: 22px; }
.icon-btn.tiny .icon { width: 12px; height: 12px; }
.link-sm { font-size: 12.5px; font-weight: 550; display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 0; color: var(--accent-text); cursor: pointer; font-family: inherit; }
.link-sm.danger { color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: 9px; padding: 8px 11px; font: inherit; outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.small { padding: 4px 8px; font-size: 13px; width: auto; }
.input.narrow { width: 90px; }
.input.color { width: 52px; padding: 3px; height: 38px; }
textarea.input { resize: vertical; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 550; font-size: 13px; color: var(--text-2); min-width: 0; }
.check-label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 0; }
legend { font-weight: 600; padding: 0 6px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack > ul, .stack > p { margin: 0; }
.row { display: flex; gap: 12px; align-items: flex-end; }
.row > label { flex: 1; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; align-items: center; }
.row.tight { gap: 6px; align-items: center; }
.inline { display: inline; margin: 0; }
.inline-form { display: flex; gap: 10px; margin: 12px 0; }
.pad { padding: 18px 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; line-height: 1.5;
}
a.chip:hover { text-decoration: none; border-color: var(--border-strong); }
.chip .icon { width: 12px; height: 12px; }
.chip.ghost { background: transparent; }
.chip.overdue { background: var(--danger-soft); color: var(--danger); border-color: transparent; font-weight: 600; }
.chip.due-today { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; font-weight: 600; }
.chip.due-soon { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.st-todo { background: var(--surface-3); color: var(--text-2); }
.st-doing, .st-active { background: #e0f2fe; color: #0369a1; }
.st-waiting, .st-paused { background: var(--warn-soft); color: var(--warn); }
.st-done { background: var(--ok-soft); color: var(--ok); }
.st-archived { background: var(--surface-3); color: var(--muted); }
:root[data-theme="dark"] .st-doing, :root[data-theme="dark"] .st-active { background: #0c2a3e; color: #7dd3fc; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .st-doing, :root:where(:not([data-theme="light"])) .st-active { background: #0c2a3e; color: #7dd3fc; } }
.pill.cat-productive { background: color-mix(in srgb, var(--cat-productive) 14%, transparent); color: var(--text); }
.pill.cat-neutral { background: color-mix(in srgb, var(--cat-neutral) 18%, transparent); color: var(--text); }
.pill.cat-distracting { background: color-mix(in srgb, var(--cat-distracting) 14%, transparent); color: var(--text); }
.pill.cat-productive::before, .pill.cat-neutral::before, .pill.cat-distracting::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.pill.cat-productive::before { background: var(--cat-productive); }
.pill.cat-neutral::before { background: var(--cat-neutral); }
.pill.cat-distracting::before { background: var(--cat-distracting); }
.badge { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-text); font-weight: 650; }
.badge.soft { background: var(--surface-3); color: var(--muted); }
.tag { font-size: 12px; color: var(--accent-text); background: var(--accent-soft); padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
.tag.active { background: var(--accent); color: #fff; }
.tag .count { opacity: .6; margin-left: 4px; }
.prio { display: inline-flex; color: var(--muted); }
.prio .icon { width: 13px; height: 13px; fill: currentColor; }
.prio.p3 { color: #dc2626; } .prio.p2 { color: #ea9a0c; } .prio.p1 { color: #3b82f6; }
.count { font-size: 11.5px; color: var(--muted); background: var(--surface-3); padding: 0 7px; border-radius: 999px; margin-left: auto; font-weight: 600; }
.empty { color: var(--muted); padding: 18px; text-align: center; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px dashed var(--border-strong); font-size: 13px; }
.callout { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.callout h3 { margin-bottom: 6px; }
.callout.soft { background: var(--surface); border-color: var(--border); }
.callout.success { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.copy-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.token { flex: 1; word-break: break-all; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); }

/* ---------- page furniture ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-sub { color: var(--muted); margin-top: 4px; font-size: 13px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-actions.left { margin-bottom: 12px; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.crumbs .icon { width: 13px; height: 13px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.tabs.compact { margin: 0; padding: 0; border: 0; }
.tab { padding: 6px 15px; border-radius: 8px; color: var(--text-2); font-weight: 550; font-size: 13.5px; }
.tab:hover { background: var(--surface-3); text-decoration: none; }
.tab.active { background: var(--accent); color: #fff; box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 35%, transparent); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card + .card, .card + .grid-2, .grid-2 + .card { margin-top: 16px; }
.grid-2 > *, .grid-2 > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 0; }
.card-head h3 { display: flex; align-items: center; gap: 6px; }
.card-actions { display: flex; gap: 8px; align-items: center; }
.card-body { padding: 12px 18px 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.split-main > * + * { margin-top: 16px; }
.subhead { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; margin: 16px 0 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi-label { font-size: 12.5px; color: var(--muted); }
.kpi-value { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; }
.kpi-value.small { font-size: 16px; }
.group { margin-top: 18px; }
.group-head { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13px; color: var(--text-2); margin: 10px 2px 8px; }
.group-head.overdue { color: var(--danger); }
.tab-body { min-height: 200px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tfoot th { border-top: 1px solid var(--border-strong); border-bottom: 0; color: var(--text); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.today { color: var(--accent-text); }
.cell-link { color: var(--text); background: var(--surface-2); padding: 1px 7px; border-radius: 5px; }
.error-page { max-width: 420px; margin: 15vh auto; text-align: center; background: var(--surface); padding: 32px; border-radius: 16px; }
.error-page h1 { font-size: 48px; color: var(--accent); }

/* ---------- properties panel ---------- */
.props { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; position: sticky; top: 0; box-shadow: var(--shadow); }
.props-title { font-size: 15px; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.props-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.prop-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 10px; padding: 6px 0; margin: 0; }
.prop-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.prop-label .icon { width: 15px; height: 15px; opacity: .8; }
.prop-value {
  background: var(--surface-2); border: 1px solid transparent; border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13.5px;
  color: var(--text); min-height: 32px; display: flex; align-items: center; gap: 6px; width: 100%; outline: none;
}
.prop-value:hover { border-color: var(--border-strong); }
.prop-value:focus { border-color: var(--accent); background: var(--surface); }
.prop-value.col { flex-direction: column; align-items: stretch; gap: 4px; background: transparent; padding: 0; }
.prop-value.color { padding: 2px; height: 32px; }
select.prop-value { appearance: auto; }
.pill-select { font-weight: 600; border-radius: 8px; }
.pill-select.st-active, .pill-select.st-doing { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.pill-select.st-paused, .pill-select.st-waiting { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.pill-select.st-done { background: #e0e7ff; color: #4338ca; border-color: #c7d2fe; }
.value-box { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-weight: 600; align-self: flex-start; }
.props-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ---------- cover (project overview) ---------- */
.cover { height: 150px; border-radius: var(--radius) var(--radius) 0 0; position: relative; overflow: hidden; }
.cover-pattern {
  position: absolute; inset: 0; opacity: .25;
  background-image: radial-gradient(circle at 20% 30%, #fff 0 2px, transparent 3px), radial-gradient(circle at 70% 60%, #fff 0 1.5px, transparent 2.5px);
  background-size: 48px 48px, 36px 36px;
}
.cover-head { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 8px 0 20px; position: relative; }
.split-main > .cover-head { margin-top: -40px; }
.split-main > .cover-title { margin-top: 12px; }
.cover-tile {
  display: grid; place-items: center; width: 76px; height: 76px; border-radius: 16px; color: #fff; font-weight: 800; font-size: 26px;
  border: 4px solid var(--bg); box-shadow: var(--shadow-lg); position: relative;
}
.cover-title { margin: 14px 0 6px; font-size: 26px; }
.cover + .cover-head + .cover-title { margin-top: 12px; }
.desc { color: var(--text-2); }
.tab-title { margin-bottom: 14px; }

/* ---------- tasks ---------- */
.task-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card .task-list, .task-list.compact { border: 0; border-radius: 0; background: transparent; }
.task-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: 0; }
.task-list.compact .task-row { padding: 8px 2px; }
.task-row:hover { background: var(--surface-2); }
.task-row form { margin: 0; }
.task-main { flex: 1; min-width: 0; }
.task-title { color: var(--text); font-weight: 500; }
.task-row.done .task-title { color: var(--muted); text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 4px; }
.task-meta:empty { display: none; }
.check {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; margin-top: 1px;
  border: 2px solid var(--border-strong); background: var(--surface); cursor: pointer; padding: 0; color: #fff; flex: none;
}
.check:hover { border-color: var(--accent); background: var(--accent-soft); }
.check.p3 { border-color: #ef4444; } .check.p2 { border-color: #f59e0b; } .check.p1 { border-color: #3b82f6; }
.task-row.done .check, .check:has(.icon) { background: var(--accent); border-color: var(--accent); }
.check .icon { width: 13px; height: 13px; stroke-width: 3; }
.check.ghost { border-style: dashed; cursor: default; background: transparent; }
.check.big { width: 28px; height: 28px; border-radius: 8px; }
.row-action { opacity: 0; transition: opacity .15s; }
.task-row:hover .row-action { opacity: 1; }
.task-quick { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); margin-bottom: 12px; }
.card .task-quick { padding: 6px 10px; }
.task-quick input { flex: 1; border: 0; background: transparent; font: inherit; color: var(--text); outline: none; padding: 4px 0; min-width: 0; }
.task-quick:focus-within { border-style: solid; border-color: var(--accent); }
.task-head { display: flex; align-items: center; gap: 14px; }
.task-head form { margin: 0; }
.task-h1 { font-size: 22px; }
.task-h1.done { text-decoration: line-through; color: var(--muted); }
.title-input { font-size: 20px; font-weight: 650; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text); padding: 4px 0; outline: none; width: 100%; font-family: inherit; }
.title-input:focus { border-bottom-color: var(--accent); }
.done-list { margin-top: 10px; }
.done-list summary { cursor: pointer; color: var(--muted); font-weight: 550; font-size: 13px; padding: 4px 0; }
.rendered summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.box { display: inline-block; width: 10px; height: 10px; border: 1.5px solid currentColor; border-radius: 3px; margin-right: 5px; vertical-align: -1px; opacity: .7; }
.done .box { background: currentColor; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface-2); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; min-height: 300px; border: 1px solid var(--border); }
.kcol.drag-over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.kcol-head { display: flex; align-items: center; gap: 8px; font-weight: 650; padding: 4px 4px 10px; }
.kdot { width: 10px; height: 10px; border-radius: 3px; }
.kdot.st-todo { background: #a8a3c2; } .kdot.st-doing { background: #0ea5e9; } .kdot.st-waiting { background: #f59e0b; } .kdot.st-done { background: #22c55e; }
.kcol-body { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); cursor: grab; }
.kcard:hover { border-color: var(--border-strong); }
.kcard.dragging { opacity: .5; }
.kcard-title { color: var(--text); font-weight: 550; display: block; }
.kcol-add input { width: 100%; margin-top: 8px; border: 1px dashed var(--border-strong); background: transparent; border-radius: 8px; padding: 7px 10px; font: inherit; color: var(--text); }
.kcol-add input:focus { outline: none; border-style: solid; border-color: var(--accent); background: var(--surface); }

/* progress */
.progress { display: flex; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; gap: 2px; margin: 8px 0; }
.progress .seg { height: 100%; border-radius: 999px; }
.seg.done { background: #22c55e; } .seg.doing { background: #0ea5e9; } .seg.waiting { background: #f59e0b; }

/* projects */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.project-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.project-card.dim { opacity: .65; }
.pc-cover { height: 70px; position: relative; }
.pc-tile { position: absolute; left: 16px; bottom: -18px; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; border: 3px solid var(--surface); }
.pc-body { padding: 26px 16px 14px; }
.pc-title { font-weight: 650; font-size: 15.5px; }
.pc-desc { color: var(--muted); font-size: 13px; min-height: 20px; }
.pc-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mini-list li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list li > a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.mini-list li > .muted { font-size: 12px; white-space: nowrap; }
.mini-list .icon { color: var(--muted); }
.mini-list.titles li { font-size: 13px; }

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.dash > * { margin: 0 !important; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.hero {
  border-radius: var(--radius); padding: 18px 20px; color: #fff; display: flex; flex-direction: column; gap: 10px;
  background: radial-gradient(circle at 85% 0%, rgba(255, 255, 255, .14), transparent 45%), linear-gradient(135deg, #0f5ea6 0%, #1a78c8 60%, #3d93de 100%);
  box-shadow: 0 6px 20px rgba(16, 110, 190, .22); position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; border: 28px solid rgba(255, 255, 255, .05); }
.hero-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; opacity: .92; }
.hero-link { color: #fff; display: inline-flex; gap: 4px; align-items: center; font-weight: 600; }
.hero-main { display: flex; align-items: flex-end; gap: 14px; }
.hero-figure { font-size: 60px; font-weight: 750; letter-spacing: -.04em; line-height: .95; }
.hero-of { font-size: 26px; opacity: .7; font-weight: 600; }
.hero-caption { font-size: 14px; font-weight: 600; padding-bottom: 6px; line-height: 1.3; }
.hero-caption span { font-weight: 450; opacity: .85; font-size: 12.5px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: rgba(255, 255, 255, .12); border-radius: 10px; padding: 8px; position: relative; z-index: 1; }
.hero-stats div { display: flex; flex-direction: column; align-items: center; }
.hero-stats strong { font-size: 16px; }
.hero-stats span { font-size: 11px; opacity: .85; }
.hero-next { color: #fff; display: flex; gap: 8px; align-items: center; font-size: 13px; background: rgba(0, 0, 0, .15); border-radius: 9px; padding: 7px 10px; position: relative; z-index: 1; }
.hero-next:hover { text-decoration: none; background: rgba(0, 0, 0, .25); }
.capture-form textarea { min-height: 64px; }
.capture-kinds { display: flex; gap: 6px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.capture-kinds .btn { margin-left: auto; }
.kind-chip { display: inline-flex; gap: 5px; align-items: center; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.kind-chip.active { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; font-weight: 600; }
.capture { display: flex; flex-direction: column; }
.capture .capture-form { padding: 10px 18px 0; }
.capture-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 18px 16px; margin-top: auto; }
.capture-actions form { margin: 0; display: contents; }
.cap-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; width: 100%;
}
.cap-btn:hover { text-decoration: none; background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.cap-btn .icon { width: 18px; height: 18px; }
.schedule { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.schedule li { display: grid; grid-template-columns: 92px 1fr; gap: 2px 10px; padding: 7px 10px; border-radius: 9px; background: var(--surface-2); border-left: 3px solid var(--ev); }
.schedule li.past { opacity: .55; }
.schedule li.current { background: var(--accent-soft); }
.sch-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.sch-title { color: var(--text); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sch-loc { grid-column: 2; font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.sch-loc .icon { width: 12px; height: 12px; }
.proj-row { display: block; color: var(--text); padding: 6px 0 2px; }
.proj-row:hover { text-decoration: none; }
.proj-row-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-weight: 550; }
.proj-row-head > span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.proj-row .progress { margin: 6px 0 4px; }
.streaks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.streaks li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.streaks li.hot { background: linear-gradient(90deg, #fff1e6, var(--surface-2)); }
:root[data-theme="dark"] .streaks li.hot { background: linear-gradient(90deg, #3a2414, var(--surface-2)); }
.streak-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface); color: var(--accent-text); }
.streaks li.hot .streak-icon { color: #ea580c; }
.streak-label { flex: 1; font-size: 13px; }
.hbar-row { display: grid; grid-template-columns: 90px 1fr 60px; gap: 8px; align-items: center; font-size: 12.5px; margin: 4px 0; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.hbar { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hbar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.memory { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 13px; }
.memory:hover { text-decoration: none; background: var(--accent-soft); }
.resurface-note { display: block; color: var(--text); padding: 12px 14px; border-radius: 10px; background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); }
.resurface-note:hover { text-decoration: none; }
.resurface-note p { margin: 6px 0; color: var(--text-2); font-size: 13px; }
.journal-quick textarea { min-height: 110px; }
.journal-quick .row { margin-top: 8px; }
.snapshot-card .card-head h3 .icon { color: #a855f7; }
.snapshot { font-size: 13.5px; }
.snapshot h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }
.snapshot.big { font-size: 15px; }
.day-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.day-head .page-actions { margin-left: auto; }

/* ---------- charts ---------- */
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.legend.inline { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend-label { color: var(--text-2); }
.legend-value { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend-pct { color: var(--muted); font-size: 12px; width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.legend.inline .legend-value { margin-left: 2px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.swatch.cat-productive { background: var(--cat-productive); }
.swatch.cat-neutral { background: var(--cat-neutral); }
.swatch.cat-distracting { background: var(--cat-distracting); }
.swatch.plan { background: repeating-linear-gradient(45deg, var(--accent), var(--accent) 3px, color-mix(in srgb, var(--accent) 55%, transparent) 3px, color-mix(in srgb, var(--accent) 55%, transparent) 6px); }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 132px; height: 132px; flex: none; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 14; }
.donut-track { stroke: var(--surface-3); }
.donut-seg { transition: stroke-width .15s; cursor: default; outline: none; }
.donut-seg:hover, .donut-seg:focus { stroke-width: 17; }
.donut-seg.cat-productive { stroke: var(--cat-productive); }
.donut-seg.cat-neutral { stroke: var(--cat-neutral); }
.donut-seg.cat-distracting { stroke: var(--cat-distracting); }
.donut text { transform: rotate(90deg); transform-origin: 60px 60px; fill: var(--text); }
.donut-value { font-size: 15px; font-weight: 700; }
.donut-label { font-size: 9px; fill: var(--muted) !important; }
.donut-wrap .legend { flex: 1; min-width: 170px; }
.legend li > .legend-label { white-space: nowrap; }
.chart-wrap { position: relative; }
.trend { width: 100%; height: auto; display: block; overflow: visible; }
.trend .grid { stroke: var(--grid); stroke-width: 1; }
.trend .axis { fill: var(--axis); font-size: 10px; font-family: var(--font); }
.trend .line { fill: none; stroke: var(--cat-productive); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend .area { fill: var(--cat-productive); opacity: .1; }
.trend .end-dot { fill: var(--cat-productive); stroke: var(--surface); stroke-width: 2; }
.trend .crosshair { stroke: var(--axis); stroke-width: 1; opacity: 0; }
.trend.hovering .crosshair { opacity: 1; }
.trend-end { position: absolute; right: 4px; top: -4px; font-size: 12px; color: var(--muted); }
.trend-end strong { color: var(--text); font-size: 14px; }
.heatmap { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; }
.hm-row { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; align-items: center; }
.hm-label { color: var(--muted); }
.hm-hour { color: var(--muted); text-align: left; font-variant-numeric: tabular-nums; }
.hm-cell { aspect-ratio: 1; border-radius: 3px; background: var(--h0); outline: none; max-height: 22px; }
.hm-cell:hover, .hm-cell:focus { box-shadow: 0 0 0 2px var(--text); }
.hm-cell.h1 { background: var(--h1); } .hm-cell.h2 { background: var(--h2); } .hm-cell.h3 { background: var(--h3); }
.hm-cell.h4 { background: var(--h4); } .hm-cell.h5 { background: var(--h5); } .hm-cell.h6 { background: var(--h6); }
.hm-scale { display: flex; gap: 3px; align-items: center; justify-content: flex-end; margin-top: 6px; }
.hm-scale .hm-cell { width: 12px; height: 12px; aspect-ratio: auto; }
.lane { position: relative; height: 26px; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.lane-seg { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; outline: none; background: var(--accent); }
.lane-seg:hover, .lane-seg:focus { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); z-index: 2; }
.lane-seg.cat-productive { background: var(--cat-productive); }
.lane-seg.cat-neutral { background: var(--cat-neutral); }
.lane-seg.cat-distracting { background: var(--cat-distracting); }
.lane-seg.cat-afk { background: transparent; }
.lane-seg.plan-task { opacity: .75; background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgba(255, 255, 255, .35) 4px 7px); }
.lane-seg.plan-timer { top: 15px; bottom: 3px; opacity: .55; }
.ruler { position: relative; height: 18px; font-size: 10.5px; color: var(--axis); font-variant-numeric: tabular-nums; }
.ruler span { position: absolute; transform: translateX(-50%); top: 2px; }
.ruler span:first-child { transform: none; }
.pva { display: flex; flex-direction: column; gap: 6px; }
.pva-row { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; }
.pva-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.pva-lane { position: relative; }
.pva-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #ef4444; border-radius: 2px; z-index: 3; }
.pva-foot { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: 12px; color: var(--text-2); }
.legend-plan { display: flex; gap: 8px; align-items: center; }
.columns-chart { display: grid; grid-template-columns: 30px 1fr; gap: 6px; height: 170px; }
.cc-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 10px; color: var(--axis); text-align: right; padding-bottom: 18px; }
.cc-plot { display: flex; gap: 4px; align-items: stretch; border-bottom: 1px solid var(--axis); background-image: linear-gradient(var(--grid) 1px, transparent 1px); background-size: 100% 50%; }
.cc-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; outline: none; padding-bottom: 0; }
.cc-stack { width: 100%; max-width: 22px; display: flex; flex-direction: column; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.cc-seg { flex-basis: 0; min-height: 2px; }
.cc-seg.cat-productive { background: var(--cat-productive); } .cc-seg.cat-neutral { background: var(--cat-neutral); } .cc-seg.cat-distracting { background: var(--cat-distracting); }
.cc-col:hover .cc-stack, .cc-col:focus .cc-stack { filter: brightness(1.12); }
.cc-label { position: absolute; bottom: -18px; font-size: 10px; color: var(--axis); }
#tooltip {
  position: fixed; z-index: 100; pointer-events: none; background: var(--text); color: var(--surface); padding: 6px 10px; border-radius: 8px;
  font-size: 12px; box-shadow: var(--shadow-lg); max-width: 300px; line-height: 1.4;
}
#tooltip strong { display: block; font-size: 13px; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-title { display: flex; align-items: center; gap: 6px; }
.cal-title h1 { margin: 0 8px; min-width: 9ch; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--border); gap: 1px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.month-wd { background: var(--surface); padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.mday { background: var(--surface); min-height: 118px; padding: 6px 7px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mday.weekend { background: color-mix(in srgb, var(--surface) 70%, var(--surface-2)); }
.mday.other { background: var(--surface-2); }
.mday.other .mday-num { color: var(--muted); }
.mday-head { display: flex; align-items: center; gap: 6px; }
.mday-num { font-weight: 650; font-size: 13px; color: var(--text); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.mday.today .mday-num { background: var(--accent); color: #fff; }
.mday-flags { display: flex; gap: 4px; align-items: center; font-size: 10.5px; color: var(--muted); }
.mday-flags .icon { width: 12px; height: 12px; color: var(--accent-text); }
.mday-add { margin-left: auto; opacity: 0; color: var(--muted); }
.mday:hover .mday-add { opacity: 1; }
.mday-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mday-items li a { display: block; font-size: 12px; padding: 1px 6px; border-radius: 5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mday-items li a:hover { text-decoration: none; filter: brightness(.97); }
.mday-items .ev a { background: color-mix(in srgb, var(--ev) 14%, transparent); border-left: 3px solid var(--ev); }
.mday-items .ev.allday a { background: var(--ev); color: #fff; border-left: 0; }
.ev-time { color: var(--muted); margin-right: 4px; font-variant-numeric: tabular-nums; }
.mday-items .due a { color: var(--text-2); }
.mday-items .due.done a { text-decoration: line-through; color: var(--muted); }
.mday-items .dnote a { color: var(--accent-text); }
.mday-items .dnote .icon { width: 11px; height: 11px; margin-right: 3px; }
.mday-items .more a { color: var(--muted); }
.week { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.week-head, .week-allday { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.wk-gutter { font-size: 10.5px; color: var(--muted); padding: 6px; text-align: right; }
.wk-day { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; color: var(--text); border-left: 1px solid var(--border); }
.wk-day:hover { text-decoration: none; background: var(--surface-2); }
.wk-wd { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.wk-num { font-size: 20px; font-weight: 650; }
.wk-day.today .wk-num { color: #fff; background: var(--accent); border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; }
.wk-tracked { font-size: 10.5px; color: var(--muted); }
.wk-allday-cell { border-left: 1px solid var(--border); padding: 4px; display: flex; flex-direction: column; gap: 2px; min-height: 30px; min-width: 0; }
.wk-chip { font-size: 11.5px; background: var(--ev, var(--accent)); color: #fff; padding: 1px 6px; border-radius: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-chip.task { background: var(--surface-2); color: var(--text-2); }
.wk-chip.task.done { text-decoration: line-through; opacity: .6; }
.week-body { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); height: 66vh; overflow-y: auto; position: relative; }
.wk-hours, .wk-col { height: 1152px; position: relative; }
.wk-hour { height: 48px; position: relative; }
.wk-hour span { position: absolute; top: -7px; right: 8px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wk-col { border-left: 1px solid var(--border); background-image: linear-gradient(var(--grid) 1px, transparent 1px); background-size: 100% 48px; cursor: copy; }
.wk-col.today { background-color: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.wk-actual { position: absolute; left: 1px; width: 4px; border-radius: 2px; opacity: .9; }
.wk-actual.cat-productive { background: var(--cat-productive); } .wk-actual.cat-neutral { background: var(--cat-neutral); } .wk-actual.cat-distracting { background: var(--cat-distracting); }
.wk-ev {
  position: absolute; border-radius: 6px; padding: 3px 6px; font-size: 11.5px; overflow: hidden; color: var(--text);
  background: color-mix(in srgb, var(--ev) 18%, var(--surface)); border-left: 3px solid var(--ev); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); cursor: pointer; z-index: 1;
  display: flex; flex-direction: column;
}
.wk-ev:hover { text-decoration: none; z-index: 2; box-shadow: var(--shadow-lg); }
.wk-ev.task { background: var(--surface); border: 1px dashed var(--ev); border-left: 3px solid var(--ev); }
.wk-ev.task.done { opacity: .5; text-decoration: line-through; }
.wk-ev > * { flex-shrink: 0; }
.wk-ev-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-ev-time { color: var(--muted); font-size: 10.5px; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: #ef4444; z-index: 3; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; }
.week-foot { display: flex; gap: 16px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.agenda { display: flex; flex-direction: column; gap: 10px; }
.agenda-day { display: grid; grid-template-columns: 80px 1fr; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.agenda-day.today { border-color: var(--accent); }
.agenda-date { display: flex; gap: 8px; align-items: center; color: var(--text); }
.ad-num { font-size: 26px; font-weight: 700; }
.ad-wd { font-size: 11.5px; color: var(--muted); line-height: 1.2; }
.agenda-items { display: flex; flex-direction: column; gap: 4px; }
.agenda-item { display: flex; gap: 10px; align-items: center; color: var(--text); padding: 4px 6px; border-radius: 6px; }
.agenda-item:hover { background: var(--surface-2); text-decoration: none; }
.agenda-item.done { color: var(--muted); text-decoration: line-through; }
.ai-time { width: 100px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---------- events ---------- */
.event-hero { display: flex; gap: 18px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; border-top: 4px solid var(--ev); }
.event-hero h1 { margin-bottom: 4px; }
.event-hero .small { margin-top: 4px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.event-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 64px; height: 68px; border-radius: 12px; background: color-mix(in srgb, var(--ev) 15%, var(--surface)); flex: none; }
.ed-month { font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--ev); }
.ed-day { font-size: 28px; font-weight: 750; line-height: 1; }
.event-form:has(input[name="all_day"]:checked) .time-input { display: none; }

/* ---------- notes (OneNote-style) ---------- */
.nb-workspace, .workspace { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-height: calc(100vh - 160px); overflow: hidden; }
.nb-tree, .ws-nav { background: var(--surface-2); border-right: 1px solid var(--border); padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.ws-label { text-transform: uppercase; letter-spacing: .07em; font-size: 10.5px; color: var(--muted); font-weight: 650; padding: 12px 8px 4px; }
.ws-label:first-child { padding-top: 2px; }
.ws-link { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; color: var(--text-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-link:hover { background: var(--surface-3); text-decoration: none; }
.ws-link.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.ws-link .count { margin-left: auto; }
.ws-add { margin: 4px 0; }
.ws-add .input { padding: 5px 8px; font-size: 12.5px; background: transparent; border-style: dashed; }
.nb-book summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; font-weight: 600; cursor: pointer; color: var(--text); font-size: 13.5px; }
.nb-book summary::-webkit-details-marker { display: none; }
.nb-book summary:hover { background: var(--surface-3); }
.nb-spine { width: 6px; height: 18px; border-radius: 2px; background: var(--nb); flex: none; }
.nb-sec { padding-left: 22px; }
.sec-dot { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 6px; }
.nb-main { display: flex; flex-direction: column; min-width: 0; }
.section-tabs { display: flex; align-items: flex-end; gap: 3px; padding: 10px 14px 0; border-bottom: 1px solid var(--border); background: var(--surface); overflow-x: auto; flex: none; }
.nb-name { font-weight: 700; padding: 6px 12px 8px 0; margin-right: 6px; border-right: 1px solid var(--border); white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.nb-name::before { content: ""; width: 6px; height: 18px; border-radius: 2px; background: var(--nb); }
.sec-tab {
  padding: 7px 16px 7px; border-radius: 9px 9px 0 0; background: color-mix(in srgb, var(--sec) 16%, var(--surface-2));
  color: var(--text-2); font-weight: 550; font-size: 13px; border-top: 3px solid var(--sec); white-space: nowrap; margin-bottom: -1px; border-bottom: 1px solid var(--border);
}
.sec-tab:hover { text-decoration: none; filter: brightness(.97); }
.sec-tab.active { background: var(--surface); color: var(--text); font-weight: 650; border-bottom-color: var(--surface); box-shadow: 0 -2px 6px rgba(0, 0, 0, .04); }
.sec-tab.add { background: transparent; border-top-color: transparent; padding: 0; }
.sec-tab.add input { width: 34px; border: 1px dashed var(--border-strong); border-radius: 8px 8px 0 0; padding: 6px 8px; background: transparent; font: inherit; text-align: center; color: var(--muted); transition: width .2s; }
.sec-tab.add input:focus { width: 150px; outline: none; border-color: var(--accent); text-align: left; color: var(--text); }
.nb-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); flex: 1; min-height: 0; }
.page-list { border-right: 1px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; max-height: calc(100vh - 220px); }
.page-list .btn { margin-bottom: 8px; }
.page-item { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); border-left: 3px solid transparent; }
.page-item:hover { background: var(--surface-2); text-decoration: none; }
.page-item.active { background: var(--accent-soft); border-left-color: var(--accent); }
.pi-title { font-weight: 550; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.pi-title .icon, .nc-title .icon { width: 12px; height: 12px; color: #d97706; fill: currentColor; }
.pi-meta { font-size: 11.5px; color: var(--muted); }
.page-pane { padding: 22px 30px 40px; min-width: 0; overflow-y: auto; max-height: calc(100vh - 220px); }
.page-empty { text-align: center; padding: 70px 20px; color: var(--text-2); max-width: 520px; margin: 0 auto; }
.pe-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 14px; }
.pe-icon .icon { width: 26px; height: 26px; }
.page-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.page-path { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.page-path .icon { width: 12px; height: 12px; }
.page-title { font-size: 28px; margin-bottom: 4px; }
.page-dates { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.note-props { background: var(--surface-2); border-radius: 10px; padding: 6px 12px; margin-bottom: 16px; }
.note-props .prop-value { background: var(--surface); color: var(--text); }
.page-body { min-height: 120px; }
.page-extras { margin-top: 28px; }
.note-editor { display: flex; flex-direction: column; gap: 12px; }
.editor-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.editor-meta label { flex-direction: row; align-items: center; gap: 6px; color: var(--muted); }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.note-grid.small { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.note-card { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; color: var(--text); min-height: 110px; }
.card .note-card { background: var(--surface-2); border-color: transparent; }
.note-card:hover { text-decoration: none; border-color: var(--accent); }
.nc-title { font-weight: 600; display: flex; gap: 5px; align-items: center; }
.nc-excerpt { color: var(--text-2); font-size: 12.5px; flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.nc-meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.md-editor { border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.md-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.md-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 12px; }
.md-toggle { flex-direction: row; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; }
.md-panes { display: grid; grid-template-columns: 1fr; }
.md-editor.previewing .md-panes { grid-template-columns: 1fr 1fr; }
.md-input { border: 0; padding: 14px 16px; font: 14px/1.6 var(--mono); color: var(--text); background: transparent; resize: vertical; outline: none; min-height: 160px; width: 100%; }
.md-preview { display: none; padding: 14px 18px; border-left: 1px solid var(--border); overflow-y: auto; max-height: 70vh; }
.md-editor.previewing .md-preview { display: block; }
.md-input.uploading { opacity: .6; }
.data-view .muted { font-size: 12.5px; }

/* ---------- IDE-style project workroom ---------- */
.split.split-ade { display:block; }
.split-ade > .props { display:none; }
.split-ade > .split-main { width:100%; min-width:0; }
.ade-workspace { display:flex; flex-direction:column; gap:10px; min-width:0; }
.ade-topline { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:2px 2px 4px; }
.ade-title h2 { margin:2px 0 2px; font-size:19px; }
.ade-title p { margin:0; }
.kicker { display:block; color:var(--muted); font-size:10px; font-weight:750; letter-spacing:.1em; }
.ade-top-actions { display:flex; gap:8px; }
.editor-heading { display:flex; align-items:center; gap:12px; min-width:0; padding:7px 10px; border:1px solid var(--border); border-bottom:0; border-radius:9px 9px 0 0; background:var(--surface-2); }
.editor-heading h3 { margin:2px 0 0; font-size:14px; }
.editor-repo { flex:1; min-width:0; overflow:hidden; color:var(--muted); font:11px ui-monospace,monospace; text-overflow:ellipsis; white-space:nowrap; }
.ade-settings { position:relative; }
.ade-settings summary { color:var(--accent-text); font-size:11px; font-weight:650; cursor:pointer; }
.ade-settings[open] { z-index:5; }
.ade-settings form { position:absolute; right:0; min-width:min(420px, 80vw); margin-top:8px; padding:12px; border:1px solid var(--border); border-radius:8px; background:var(--surface); box-shadow:var(--shadow-lg); }
.builtin-editor { display:flex; flex-direction:column; flex:1 1 0; height:100%; min-height:0; overflow:hidden; background:#171a20; color:#d7dce5; color-scheme:dark; }
.editor-files { min-width:0; overflow:auto; border-right:1px solid #343943; background:#1b1e25; }
.editor-pane-title, .editor-toolbar, .editor-tabs { display:flex; align-items:center; justify-content:space-between; gap:8px; height:38px; padding:0 10px; border-bottom:1px solid #343943; font-size:11px; letter-spacing:.06em; }
.editor-tree { display:flex; flex-direction:column; padding:5px; }
.editor-entry { display:block; width:100%; padding:5px 7px; border:0; border-radius:4px; background:transparent; color:inherit; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; font:12px/1.4 "Inter",sans-serif; }
.editor-entry:hover { background:#2a2e38; }
.editor-entry.is-directory { color:#9bc9ff; }
.editor-up { color:var(--muted); }
.editor-main { display:grid; grid-template-rows:38px 38px minmax(0,1fr); min-width:0; min-height:0; }
.editor-tabs { justify-content:flex-start; overflow:auto; padding:0 8px; }
.editor-tab { height:100%; padding:0 12px; border:0; border-bottom:2px solid transparent; background:transparent; color:#9aa4b2; cursor:pointer; white-space:nowrap; }
.editor-tab.is-dirty::after { content:"●"; margin-left:6px; font-size:9px; color:#e2c08d; }
.editor-tab.active { border-bottom-color:#4aa8f5; color:#fff; background:#20242c; }
.editor-toolbar { justify-content:flex-end; letter-spacing:0; }
.editor-toolbar [data-editor-status] { margin-right:auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.editor-workbench { position:relative; min-height:0; overflow:hidden; background:#171a20; font:13px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; tab-size:2; }
.editor-workbench .cm-editor { height:100%; color:#d7dce5; background:#171a20; font:inherit; }
.editor-workbench .cm-editor.cm-focused { outline:none; }
.editor-workbench .cm-scroller { font:inherit; line-height:inherit; }
.editor-workbench .cm-content { padding:10px 0; caret-color:#fff; }
.editor-workbench .cm-cursor { border-left-color:#fff; }
.editor-workbench .cm-gutters { background:#171a20; color:#5f6b7a; border-right:1px solid #262b33; }
.editor-workbench .cm-activeLine { background:#1e232b; }
.editor-workbench .cm-activeLineGutter { background:#1e232b; color:#c3cad5; }
.editor-workbench .cm-selectionBackground, .editor-workbench .cm-focused .cm-selectionBackground, .editor-workbench .cm-content ::selection { background:#3e5a83 !important; }
.editor-workbench .cm-selectionMatch { background:#2f3d52; }
.editor-workbench .cm-matchingBracket { background:#33404f; outline:1px solid #56657a; }
.editor-workbench .cm-foldPlaceholder { background:#262b33; border:0; color:#9aa5b4; }
.editor-workbench .cm-panels { background:#1e232b; color:#d7dce5; border-color:#262b33; }
.editor-workbench .cm-panels input, .editor-workbench .cm-panels button { font:12px system-ui, sans-serif; }
.editor-workbench .cm-tooltip { background:#1e232b; color:#d7dce5; border:1px solid #333a45; }
.editor-workbench .cm-tooltip-autocomplete ul li[aria-selected] { background:#2a4a75; color:#fff; }
.editor-empty { position:absolute; inset:0; display:grid; place-items:center; }
.tok-string { color:#ce9178; }.tok-string2 { color:#d16969; }.tok-comment { color:#788693; font-style:italic; }.tok-keyword { color:#c586c0; }.tok-number, .tok-bool, .tok-atom { color:#b5cea8; }
.tok-typeName, .tok-className, .tok-namespace { color:#4ec9b0; }.tok-propertyName { color:#9cdcfe; }.tok-definition { color:#dcdcaa; }.tok-macroName, .tok-meta { color:#569cd6; }
.tok-heading { color:#569cd6; font-weight:700; }.tok-link, .tok-url { color:#4fc1ff; text-decoration:underline; }.tok-emphasis { font-style:italic; }.tok-strong { font-weight:700; }.tok-invalid { color:#f44747; }
.ide-panel-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:5px; font-size:12px; }
.builtin-editor .context-task { padding:8px 0; border-top:1px solid #343943; }
.builtin-editor .context-task-title { color:#e5e9ef; font-size:11px; }
.builtin-editor .context-task-meta { color:#9ba5b4; }
.ide-project-health { display:flex; align-items:center; gap:10px; padding:9px; border:1px solid #343943; border-radius:7px; background:#20242c; font-size:11px; }
.ide-project-health .progress { width:58px; min-width:58px; }
.ide-project-health strong,.ide-project-health span { display:block; }
.context-document { display:flex; gap:9px; padding:9px 0; border-top:1px solid #343943; color:inherit; }
.context-document > span { color:#70b8fa; }
.context-document strong { display:block; font-size:11px; }
.context-document p { margin:3px 0 0; }
.ide-chat-context { display:flex; gap:9px; align-items:flex-start; }
.ide-chat-context strong { display:block; font-size:12px; }
.ide-chat-context p { margin:3px 0 0; line-height:1.45; }
.ide-context-icon { display:grid; place-items:center; width:27px; height:27px; flex:0 0 27px; border-radius:7px; color:#fff; background:#6650b8; }
.ide-chat-suggestions { display:flex; flex-wrap:wrap; gap:5px; }
.ide-chat-suggestions button { padding:5px 8px; border:1px solid #3a404b; border-radius:14px; background:#242933; color:#c5d8ee; font-size:10px; cursor:pointer; }
.ide-chat-suggestions button:hover { border-color:#4aa8f5; color:#fff; }
.builtin-editor .ade-examples summary { color:#92cafa; font-size:10px; cursor:pointer; }
.builtin-editor .ade-examples p { margin:6px 0 0; line-height:1.55; }
.ide-chat-compose { margin-top:auto; padding-top:8px; border-top:1px solid #343943; }
.ide-chat-compose textarea { width:100%; min-height:76px; resize:vertical; background:#242933; color:#edf1f7; border-color:#3a404b; }
.ide-compose-footer { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-top:6px; }
.ide-compose-footer .small { color:#9ca6b4; }
.builtin-editor .ade-idea-capture { margin-top:8px; border-top:1px solid #343943; padding-top:8px; }
.builtin-editor .ade-idea-capture summary { color:#92cafa; font-size:11px; cursor:pointer; }
.builtin-editor .ade-idea-capture form { margin:8px 0; gap:6px; }
.builtin-editor .ade-idea-row { display:flex; align-items:center; justify-content:space-between; gap:6px; padding:6px 0; border-top:1px solid #343943; font-size:11px; }
.ide-timer-card { display:flex; flex-direction:column; gap:8px; padding:10px; border:1px solid #343943; border-radius:8px; background:#20242c; }
.ide-timer-card.is-running { border-color:#26795f; background:#1a2b29; }
.ide-timer-card .kicker { color:#9ba5b4; }
.ide-timer-card strong { font-size:12px; }
.ide-timer-card form.stack { gap:7px; }
.ide-timer-card .input { background:#242933; color:#e6ebf2; border-color:#3a404b; }
.ide-agent-list h4 { margin:14px 0 5px; font-size:12px; }
.agent-queue-task { padding:8px 0; border-top:1px solid #343943; }
.agent-queue-task > a { display:block; margin-bottom:6px; color:#e5e9ef; font-size:11px; font-weight:600; }
.agent-run { display:grid; grid-template-columns:auto 1fr; gap:5px 8px; align-items:center; padding:9px 0; border-top:1px solid #343943; }
.agent-run > a { overflow:hidden; color:#e5e9ef; font-size:11px; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
.agent-run > span.small, .agent-run > p, .agent-run > .link-sm { grid-column:1/-1; margin:0; color:#a5afbd; }
.builtin-editor .approval-request { flex-wrap:wrap; background:#242933; border-color:#414956; }
.builtin-editor .approval-request span { min-width:0; }
.plan-stat { display:flex; justify-content:space-between; margin:7px 0; font-size:11px; }
.ide-sharing { display:flex; flex-direction:column; gap:8px; padding-top:8px; border-top:1px solid #343943; }
.ide-statusbar { flex:none; display:flex; min-height:24px; align-items:center; gap:16px; padding:0 10px; background:#315d91; color:#fff; font-size:10px; }
.ide-statusbar span:last-child { margin-left:auto; }
.run-state { padding: 3px 8px; border-radius: 99px; background: var(--surface-3); font-size: 11px; font-weight: 650; text-transform: capitalize; }
.state-running { color: #087f5b; background: #d1fae5; }
.state-waiting_approval { color: #9a6700; background: #fff3bf; }
.state-failed, .state-cancelled { color: #b42318; background: #fee4e2; }
.approval-request { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.approval-request span { flex: 1; min-width: 160px; font-size: 12px; color: var(--text-2); }

/* Project navigation belongs to the app chrome; the Workroom is the workspace itself. */
.topbar:has(.project-tab-slot) { gap:12px; padding:8px 14px; }
/* Project tabs keep their width; Quick add and the date give way first. */
.project-tab-slot { flex:0 0 auto; min-width:0; overflow-x:auto; scrollbar-width:none; }
.project-tab-slot::-webkit-scrollbar { display:none; }
.project-tab-slot .tabs { flex-wrap:nowrap; width:max-content; gap:2px; margin:0; padding:0; border:0; }
.project-tab-slot .tab { flex:0 0 auto; padding:7px 10px; border-radius:6px; font-size:12px; }
.project-tab-slot .tab.active { color:var(--accent-text); background:var(--accent-soft); }
.topbar:has(.project-tab-slot) .quick { min-width:40px; max-width:480px; }
@media (max-width:1850px) { .topbar:has(.project-tab-slot) .dateblock { display:none; } }
.content:has(.split-ade) { display:flex; flex:1 1 0; height:0; min-height:0; overflow:hidden; padding:0; }
.split-ade { display:flex; flex:1 1 0; width:100%; height:100%; min-width:0; min-height:0; overflow:hidden; }
.split-ade > .split-main { display:flex; flex:1; flex-direction:column; width:100%; height:100%; min-width:0; min-height:0; overflow:hidden; }
.ade-workspace { display:flex; flex:1 1 0; flex-direction:column; min-width:0; min-height:0; height:100%; gap:0; }
.editor-heading { flex:none; padding:6px 12px; border:0; border-bottom:1px solid #343943; border-radius:0; }
.editor-heading .kicker { display:none; }
.editor-heading h3 { margin:0; }
.ide-agent-config { padding:9px 0 12px; border-bottom:1px solid #343943; }
.ide-agent-config summary { color:#8fcaff; font-size:12px; font-weight:650; cursor:pointer; }
.ide-agent-config p { margin:7px 0; line-height:1.45; }
.ide-agent-config form { display:flex; flex-direction:column; gap:8px; }
.ide-agent-config label { display:flex; flex-direction:column; gap:4px; color:#aab4c2; font-size:11px; }
.ide-agent-config .input { width:100%; min-width:0; background:#242933; color:#edf1f7; border-color:#3a404b; }
@media (max-width:1100px) {
  .topbar:has(.project-tab-slot) { flex-wrap:wrap; }
  .project-tab-slot { order:3; flex-basis:100%; max-width:100%; }
  .topbar:has(.project-tab-slot) .quick { max-width:none; }
  .content:has(.split-ade) { overflow:auto; }
  .split-ade,.split-ade > .split-main,.ade-workspace { min-height:650px; }
}
@media (max-width: 900px) {
  .ade-topline,.editor-heading { align-items:flex-start; flex-direction:column; }
}
@media (max-width: 600px) { .editor-workbench { font-size:12px; } }

/* Dockable, user-arranged project workbench. */
.ide-layout-menu { position:relative; margin-left:auto; }
.ide-layout-menu > summary { width:28px; height:28px; list-style:none; }
.ide-layout-menu > summary::-webkit-details-marker { display:none; }
.ide-layout-menu[open] > summary { background:var(--surface-3); color:var(--text); }
.ide-layout-pop { position:absolute; z-index:12; top:34px; right:0; display:flex; flex-direction:column; gap:10px; width:max-content; padding:12px; border:1px solid var(--border); border-radius:8px; background:var(--surface); box-shadow:var(--shadow-lg); font-size:12px; }
.ide-layout-pop .link-sm { align-self:flex-start; }
.ide-layout-options { display:grid; gap:6px; }
.ide-layout-option { display:grid; grid-template-columns:72px auto; align-items:center; gap:10px; color:var(--text-2); }
.ide-layout-choices { display:inline-flex; border:1px solid var(--border-strong); border-radius:6px; overflow:hidden; }
.ide-layout-choices button { padding:3px 9px; border:0; border-left:1px solid var(--border); background:var(--surface); color:var(--muted); font:inherit; font-size:11px; cursor:pointer; }
.ide-layout-choices button:first-child { border-left:0; }
.ide-layout-choices button:hover { background:var(--surface-2); color:var(--text); }
.ide-layout-choices button[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent-text); font-weight:600; }
.ide-workbench-grid { display:grid; flex:1 1 0; grid-template-columns:220px 6px minmax(280px,1fr) 6px 320px; min-width:0; min-height:0; overflow:hidden; background:#171a20; }
.ide-dock-group { display:grid; grid-template-rows:34px minmax(0,1fr); min-width:0; min-height:0; overflow:hidden; background:#1b1e25; color:#d7dce5; }
.ide-workbench-grid > [hidden], .ide-pane-stash[hidden] { display:none !important; }
.ide-dock-empty { margin:0; padding:16px; }
.ide-dock-tabs { display:flex; align-items:stretch; gap:2px; min-width:0; overflow:auto; border-bottom:1px solid #343943; scrollbar-width:thin; }
.ide-dock-tab { flex:0 0 auto; padding:0 10px; border:0; border-bottom:2px solid transparent; background:transparent; color:#a6afbd; font-size:11px; cursor:pointer; }
.ide-dock-tab:hover { color:white; background:#252a33; }
.ide-dock-tab.active { color:white; border-bottom-color:#4aa8f5; background:#20242c; }
.ide-dock-stack { position:relative; min-width:0; min-height:0; overflow:hidden; }
.ide-pane { width:100%; height:100%; min-width:0; min-height:0; overflow:hidden; }
.ide-pane[hidden] { display:none !important; }
.ide-pane-body { width:100%; height:100%; min-width:0; min-height:0; overflow:hidden; }
.ide-pane-body > .editor-files { width:100%; height:100%; min-height:0; border-right:0; }
.ide-pane-body > .editor-main { width:100%; height:100%; min-height:0; }
.ide-pane-body > [data-ide-panel] { display:flex; flex-direction:column; gap:11px; width:100%; height:100%; min-width:0; min-height:0; overflow:auto; padding:12px; color:#d7dce5; }
.ide-dock-divider { position:relative; z-index:2; width:6px; padding:0; border:0; border-left:1px solid #343943; border-right:1px solid #343943; background:#20242c; cursor:col-resize; touch-action:none; }
.ide-dock-divider:hover,.ide-dock-divider:active { background:#4aa8f5; }
.ide-git-pane { display:flex; flex-direction:column; width:100%; height:100%; min-height:0; color:#d7dce5; }
.ide-git-toolbar { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px; border-bottom:1px solid #343943; color:#aeb8c6; font-size:11px; }
.ide-git-files { flex:0 0 auto; max-height:38%; overflow:auto; }
.ide-git-file { display:flex; align-items:center; gap:8px; width:100%; padding:6px 9px; border:0; border-bottom:1px solid #303641; background:transparent; color:#d7dce5; text-align:left; cursor:pointer; }
.ide-git-file:hover { background:#252a33; }
.ide-git-file code { min-width:28px; padding:0; background:transparent; color:#f0bd72; font-size:10px; }
.ide-git-file span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ide-git-diff { flex:1; min-height:0; margin:0; padding:10px; overflow:auto; border:0; background:#171a20; color:#c6ced9; font:11px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; white-space:pre-wrap; overflow-wrap:anywhere; }
@media (max-width:900px) {
  .ide-workbench-grid { min-width:760px; }
  .builtin-editor { overflow:auto; }
}

/* prose (rendered markdown) */
.prose { line-height: 1.65; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: 22px; margin: 22px 0 10px; }
.prose h2 { font-size: 18px; margin: 20px 0 8px; }
.prose h3 { font-size: 15.5px; margin: 16px 0 6px; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 3px 0; }
.prose li:has(> input[type="checkbox"]) { list-style: none; margin-left: -20px; }
.prose input[type="checkbox"] { margin-right: 6px; accent-color: var(--accent); }
.prose blockquote { border-left: 3px solid var(--accent); padding: 4px 14px; color: var(--text-2); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.prose img { border-radius: 10px; box-shadow: var(--shadow); }
.prose .embed { display: inline-block; }
.prose details { background: var(--surface-2); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.prose summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.wikilink { background: var(--accent-soft); padding: 0 4px; border-radius: 4px; }
.wikilink.missing { background: transparent; color: var(--muted); border-bottom: 1px dashed var(--muted); border-radius: 0; }

/* journal */
.journal-strip { display: grid; grid-template-columns: repeat(28, minmax(0, 1fr)); gap: 4px; margin-bottom: 18px; }
.jday { aspect-ratio: 1; display: grid; place-items: center; border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; }
.jday.has { background: var(--accent); color: #fff; }
.jday.today { box-shadow: 0 0 0 2px var(--accent); }
.jday:hover { text-decoration: none; filter: brightness(.95); }
.journal-list { display: flex; flex-direction: column; gap: 10px; }
.journal-entry { display: grid; grid-template-columns: 90px 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--text); }
.journal-entry:hover { text-decoration: none; border-color: var(--accent); }
.je-date { display: flex; flex-direction: column; }
.je-day { font-size: 28px; font-weight: 750; line-height: 1; }
.je-month, .je-wd { font-size: 12px; color: var(--muted); }
.je-body { color: var(--text-2); }
.journal-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

/* links & files */
.links-panel ul.related { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 2px; }
.related li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13.5px; min-width: 0; }
.related li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.kind-icon { color: var(--muted); display: inline-flex; }
.link-add summary { cursor: pointer; color: var(--accent-text); font-weight: 550; font-size: 13px; display: flex; gap: 6px; align-items: center; list-style: none; }
.link-add summary::-webkit-details-marker { display: none; }
.link-add .input { margin-top: 8px; }
.pick-results { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.pick-row button { width: 100%; display: flex; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 7px; border: 0; background: transparent; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.pick-row button:hover { background: var(--accent-soft); }
.pick-row button span:nth-child(2) { flex: 1; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 10px; }
.file-grid.large { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.file-tile { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); color: var(--text); }
.file-tile:hover { text-decoration: none; border-color: var(--accent); }
.file-tile img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: var(--surface-2); }
.file-icon { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; align-content: center; gap: 4px; }
.file-icon .icon { width: 26px; height: 26px; }
.file-name { font-size: 12px; padding: 6px 8px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.file-meta { font-size: 11px; color: var(--muted); padding: 0 8px 6px; }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: 10px; padding: 0; margin: 0; transition: background .15s; }
.dropzone label { flex-direction: row; align-items: center; justify-content: center; gap: 8px; padding: 14px; cursor: pointer; color: var(--muted); font-weight: 500; }
.dropzone.big label { padding: 26px; }
.dropzone input[type="file"] { display: none; }
.dropzone.drag-over { background: var(--accent-soft); border-color: var(--accent); }
.file-preview { padding: 10px; text-align: center; }
.file-preview img { max-height: 70vh; border-radius: 8px; }
.file-preview iframe { width: 100%; height: 75vh; border: 0; border-radius: 8px; }
pre.ocr { max-height: 300px; overflow: auto; font-size: 12.5px; }
.folder-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.folder-chip { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 10px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); font-weight: 550; }
.folder-chip:hover { text-decoration: none; border-color: var(--accent); }
.folder-chip .icon { color: #eab308; }
.ws-main { padding: 18px 22px; min-width: 0; }
.ws-main .dropzone { margin-bottom: 16px; }
.search-inline .input { width: 240px; }

/* search */
.search-big { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; padding: 4px 16px; margin-bottom: 18px; color: var(--muted); }
.search-big:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-big input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 16px; padding: 10px 0; outline: none; color: var(--text); }
.result-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.result { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.result:last-child { border-bottom: 0; }
.result:hover { background: var(--surface-2); text-decoration: none; }
.result-title { font-weight: 550; }
.result-sub { color: var(--muted); font-size: 12.5px; }

/* time */
.entry-list { display: flex; flex-direction: column; gap: 6px; }
.entry-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.card .entry-row { background: var(--surface-2); border-color: transparent; }
.entry-row.running { border-color: var(--accent); background: var(--accent-soft); }
.entry-bar { width: 4px; align-self: stretch; border-radius: 2px; }
.entry-main { flex: 1; min-width: 0; }
.entry-desc { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-time { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; font-variant-numeric: tabular-nums; }
.entry-time strong { font-size: 14px; }
.entry-actions { display: flex; gap: 2px; }
.entry-actions form { margin: 0; }
.timesheet td:first-child { white-space: nowrap; }
.timesheet .dot { margin-right: 6px; }

/* snapshots */
.snapshot-list { display: flex; flex-direction: column; gap: 10px; }
.snapshot-item { display: grid; grid-template-columns: 70px 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--text); }
.snapshot-item:hover { text-decoration: none; border-color: var(--accent); }
.si-date { display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); border-radius: 12px; }
.si-day { font-size: 24px; font-weight: 750; line-height: 1; }
.si-month, .si-wd { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.si-headline { font-weight: 650; }
.si-text { color: var(--text-2); font-size: 13px; margin: 4px 0; }
.shared-data { margin-top: 16px; }
.shared-data summary { cursor: pointer; font-weight: 600; }
pre.prompt { font-size: 12px; max-height: 400px; overflow: auto; }

/* settings */
.settings-body { max-width: 860px; display: flex; flex-direction: column; gap: 16px; }
.settings-body .card + .card { margin-top: 0; }
.radio-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.radio-card { border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px; cursor: pointer; flex-direction: column; gap: 3px; position: relative; }
.radio-card input { position: absolute; right: 10px; top: 12px; accent-color: var(--accent); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card strong { color: var(--text); }

/* ---------- boards ---------- */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.board-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); box-shadow: var(--shadow); }
.board-card:hover { text-decoration: none; border-color: var(--accent); }
.bc-preview { height: 120px; position: relative; overflow: hidden; }
.bc-sticky { position: absolute; width: 46px; height: 38px; box-shadow: 0 3px 6px rgba(0, 0, 0, .18); }
.bc-sticky.s1 { left: 16%; top: 18%; background: #fde68a; transform: rotate(-4deg); }
.bc-sticky.s2 { left: 64%; top: 22%; background: #fbcfe8; transform: rotate(3deg); }
.bc-sticky.s3 { left: 34%; top: 60%; background: #bae6fd; transform: rotate(-2deg); }
.bc-string { position: absolute; inset: 0; width: 100%; height: 100%; }
.bc-string path { fill: none; stroke: #c0392b; stroke-width: 1.4; }
.bc-body { padding: 12px 14px; }
.bc-title { font-weight: 650; margin-bottom: 4px; }
.bg-cork { background-color: var(--cork); background-image: radial-gradient(rgba(0, 0, 0, .14) 1px, transparent 1.5px), radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1.5px); background-size: 9px 9px, 13px 13px; background-position: 0 0, 4px 6px; }
.bg-dots { background-color: var(--surface-2); background-image: radial-gradient(var(--border-strong) 1.2px, transparent 1.4px); background-size: 22px 22px; }
.bg-plain { background: var(--surface-2); }
.bg-dark { background-color: #23302a; background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1.5px); background-size: 14px 14px; }
.board-page { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 480px; }
.board-toolbar { display: flex; align-items: center; gap: 12px; padding: 0 0 12px; flex-wrap: wrap; }
.board-title { flex: 1; min-width: 160px; margin: 0; }
.title-inline { font-size: 20px; font-weight: 700; border: 0; background: transparent; color: var(--text); width: 100%; font-family: inherit; padding: 4px 6px; border-radius: 6px; }
.title-inline:hover, .title-inline:focus { background: var(--surface); outline: none; }
.tb-group { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px 6px; }
.tb-group .btn { border: 0; }
label.btn { flex-direction: row; font-size: 13px; color: var(--text); }
.tb-group form { margin: 0; }
.zoom-level { font-size: 12px; color: var(--muted); width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.sticky-colors { display: flex; gap: 3px; padding: 0 4px; }
.swatch-btn { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .15); cursor: pointer; padding: 0; }
.swatch-btn.selected { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.sc-yellow { background: #fde68a; } .sc-pink { background: #fbcfe8; } .sc-blue { background: #bae6fd; } .sc-green { background: #bbf7d0; }
.sc-orange { background: #fed7aa; } .sc-purple { background: #ddd6fe; } .sc-white { background: #ffffff; }
.board-viewport { flex: 1; position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border); cursor: grab; outline: none; touch-action: none; user-select: none; }
.board-viewport.panning { cursor: grabbing; }
.board-viewport:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.board-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.board-edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; z-index: 0; }
.board-edges .edge { fill: none; stroke-width: 2.4; stroke-linecap: round; filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, .35)); }
.board-edges .edge-hit { fill: none; stroke: transparent; stroke-width: 16; pointer-events: stroke; cursor: pointer; }
.board-edges .edge.selected { stroke-width: 4; }
.board-edges .edge-label-bg { fill: #fffdf5; stroke: rgba(0, 0, 0, .15); }
.board-edges .edge-label { font: 600 12px var(--font); fill: #3b2a1a; }
.board-edges .edge-temp { fill: none; stroke: #c0392b; stroke-width: 2.4; stroke-dasharray: 6 5; }
.bcard {
  position: absolute; border-radius: 3px; box-shadow: 0 6px 14px rgba(0, 0, 0, .22), 0 1px 2px rgba(0, 0, 0, .2);
  display: flex; flex-direction: column; color: #2b2116; cursor: move; z-index: 1;
}
.bcard.selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.bcard.connect-target { outline: 3px dashed #c0392b; outline-offset: 3px; }
.bcard-pin {
  position: absolute; left: 50%; top: -9px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; cursor: crosshair; z-index: 2;
  background: radial-gradient(circle at 35% 35%, #ff8a80, #c0392b 55%, #7f1d1d); box-shadow: 0 2px 3px rgba(0, 0, 0, .45);
}
.bcard-pin:hover { transform: scale(1.2); }
.bcard-body { flex: 1; padding: 16px 14px 10px; overflow: hidden; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.bcard-body[contenteditable="true"] { cursor: text; outline: none; background: rgba(255, 255, 255, .35); }
.bcard-tools { position: absolute; right: 4px; top: 4px; display: none; gap: 2px; z-index: 3; }
.bcard:hover .bcard-tools, .bcard.selected .bcard-tools { display: flex; }
.bcard-tools button, .bcard-tools a { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; border: 0; background: rgba(255, 255, 255, .85); color: #333; cursor: pointer; font-size: 12px; padding: 0; }
.bcard-tools button:hover, .bcard-tools a:hover { background: #fff; text-decoration: none; }
.bcard-tools .icon { width: 12px; height: 12px; }
.bcard-resize { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, .25) 50%); border-radius: 0 0 3px 0; }
.bcard.sticky { font-family: "Segoe Print", "Comic Neue", "Bradley Hand", var(--font); }
.bcard.c-yellow { background: #fef08a; } .bcard.c-pink { background: #fbcfe8; } .bcard.c-blue { background: #bae6fd; } .bcard.c-green { background: #bbf7d0; }
.bcard.c-orange { background: #fed7aa; } .bcard.c-purple { background: #ddd6fe; } .bcard.c-white { background: #fffdf8; }
.bcard.ref { background: #fffdf8; border-top: 6px solid var(--ref, #7c3aed); }
.bcard.ref .bcard-body { white-space: normal; }
.bref-kind { font: 700 10px var(--font); text-transform: uppercase; letter-spacing: .08em; color: #8a7a66; display: flex; gap: 4px; align-items: center; }
.bref-kind .icon { width: 11px; height: 11px; }
.bref-title { font: 650 14.5px/1.3 var(--font); color: #1f1a14; margin: 4px 0; display: block; }
.bref-title.done { text-decoration: line-through; color: #8a7a66; }
.bref-sub { font: 12.5px/1.45 var(--font); color: #5c5146; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.bcard.file .bcard-body { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.bcard.file img { width: 100%; flex: 1; min-height: 0; object-fit: cover; border-radius: 2px; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.bcard.file .bref-sub { font-size: 11.5px; }
.bcard.label { background: transparent; box-shadow: none; color: inherit; }
.bcard.label .bcard-body { font: 800 22px/1.2 var(--font); color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, .45); padding: 6px; }
.bg-dots .bcard.label .bcard-body, .bg-plain .bcard.label .bcard-body { color: var(--text); text-shadow: none; }
.bcard.label .bcard-pin { display: none; }
.bcard.label .bcard-resize { opacity: 0; }
.bcard.label:hover .bcard-resize, .bcard.label.selected .bcard-resize { opacity: 1; }
.bcard.missing { opacity: .6; }
.board-empty { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); text-align: center; background: rgba(255, 255, 255, .9); color: #2b2116; padding: 20px 26px; border-radius: 14px; max-width: 420px; box-shadow: var(--shadow-lg); pointer-events: none; }
.board-picker { position: absolute; z-index: 50; width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 10px; }
.board-page { position: relative; }
.picker-results { display: flex; flex-direction: column; margin-top: 6px; max-height: 320px; overflow-y: auto; }
.picker-results button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 8px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); }
.picker-results button:hover, .picker-results button.active { background: var(--accent-soft); }
.picker-results .muted { font-size: 12px; }
.board-hint { font-size: 11.5px; color: var(--muted); padding: 8px 2px 0; }
.edge-editor { position: absolute; z-index: 60; display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px; box-shadow: var(--shadow-lg); }
.edge-editor input { width: 180px; }

/* ---------- snips ---------- */
.snip-tool { display: flex; flex-direction: column; gap: 14px; }
.snip-stage { position: relative; background: var(--surface); border: 2px dashed var(--border-strong); border-radius: var(--radius); min-height: 340px; display: grid; place-items: center; overflow: auto; }
.snip-stage.has-image { border-style: solid; display: block; padding: 0; background: #111; }
.snip-start { text-align: center; padding: 40px; }
.snip-stage canvas { display: block; max-width: 100%; height: auto; cursor: crosshair; }
.snip-crop { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); pointer-events: none; outline: 1px dashed #000; }
.snip-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.snip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.snip-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.snip-img img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: var(--surface-2); }
.snip-meta { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px 4px; font-size: 13px; align-items: center; }
.snip-meta a { display: flex; gap: 5px; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.snip-ocr { padding: 0 12px 10px; font-size: 12px; color: var(--muted); font-family: var(--mono); }

/* ---------- collaboration ---------- */
.section-h { margin: 22px 0 12px; font-size: 16px; }
.space-card + .space-card { margin-top: 12px; }
.space-head { display: flex; align-items: center; gap: 12px; }
.space-head .kind-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
.members { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
.members li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.sb-avatar.member { background: color-mix(in srgb, var(--accent) 75%, var(--frame-3)); color: #fff; }
.shared-pill { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); white-space: nowrap; }
.shared-pill:hover { text-decoration: none; filter: brightness(.97); }
.nb-share { margin-right: 8px; display: inline-flex; align-items: center; padding-bottom: 6px; }
.danger-callout { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }

.ext-account { border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.ext-account .table-wrap { margin-top: 4px; }

/* ---------- auth & toast ---------- */
body.bare { background: var(--frame); min-height: 100vh; }
.bare-main { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 18px; padding: 32px; box-shadow: var(--shadow-lg); }
.auth-card h1 { margin: 18px 0 4px; }
.auth-card .stack { margin-top: 18px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.auth-error { margin-top: 12px; padding: 10px 12px; background: var(--danger-soft); color: var(--danger); border-radius: 9px; font-weight: 550; }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 200; transition: all .25s; pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast div { background: var(--text); color: var(--surface); padding: 10px 18px; border-radius: 10px; font-weight: 550; box-shadow: var(--shadow-lg); }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .span-3, .span-4, .span-5 { grid-column: span 6; }
  .span-8 { grid-column: span 12; }
  .split { grid-template-columns: 1fr; }
  .props { position: static; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 90; width: 260px; transform: translateX(-100%); transition: transform .2s; background: var(--frame); box-shadow: var(--shadow-lg); }
  .shell.drawer .sidebar { transform: none; }
  .frame { margin: 0; border-radius: 0; height: 100vh; }
  .mobile-only { display: inline-grid; }
  .greeting, .dateblock { display: none; }
  .topbar { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .top-right { width: 100%; justify-content: flex-end; order: 3; }
  .content { padding: 16px; }
  .dash > * { grid-column: span 12 !important; }
  .grid-2, .kanban { grid-template-columns: 1fr; }
  .nb-workspace, .workspace, .nb-body { grid-template-columns: 1fr; }
  .nb-tree, .ws-nav, .page-list { border-right: 0; border-bottom: 1px solid var(--border); max-height: 240px; }
  .page-pane { max-height: none; padding: 16px; }
  .month { font-size: 11px; }
  .mday { min-height: 80px; padding: 4px; }
  .mday-items li a { padding: 0 3px; }
  .radio-cards { grid-template-columns: 1fr; }
  .hm-row { grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 1px; }
  .journal-strip { grid-template-columns: repeat(14, minmax(0, 1fr)); }
  .board-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Teams and the manager dashboard */
.kpi-value.warn { color: var(--danger); }
.team-channels { display: flex; flex-direction: column; }
.team-channel { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(80px, 1fr); grid-template-rows: auto auto; gap: 4px 14px; align-items: center; padding: 9px 4px; border-top: 1px solid var(--border); color: var(--text); }
.team-channel:first-child { border-top: 0; }
.team-channel:hover { background: var(--surface-2); text-decoration: none; }
.team-channel-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-channel .progress { grid-column: 2; grid-row: 1; }
.team-channel-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.channel-hash { margin-right: 5px; font-weight: 700; }
.overdue { color: var(--danger); font-weight: 600; }
.team-dot { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 3px; }
.workload { display: flex; flex-direction: column; gap: 8px; }
.workload-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.workload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workload-bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.workload-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.workload-n { color: var(--muted); font-size: 12px; white-space: nowrap; }
.team-member { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.member-row:first-child { border-top: 0; }
.member-row .input.small { width: auto; }
textarea.mono { font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.feed { display: flex; flex-direction: column; }
.feed-row { display: flex; gap: 12px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.feed-row:first-child { border-top: 0; }
.feed-time { flex: none; width: 42px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Workroom start: open a folder, clone, or chat (workroom.rs). */
.wr-welcome { flex: 1; display: flex; justify-content: center; overflow: auto; padding: 48px 24px; background: var(--surface); }
.wr-start { display: flex; flex-direction: column; gap: 8px; width: min(560px, 100%); }
.wr-start h2 { margin: 0 0 8px; font-size: 22px; }
.wr-start h3 { margin: 22px 0 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wr-open { margin: 0; }
.wr-action { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; list-style: none; }
.wr-action::-webkit-details-marker { display: none; }
.wr-action:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.wr-action > .icon, .wr-spark { flex: none; width: 20px; height: 20px; color: var(--accent); font-size: 18px; text-align: center; }
.wr-action div { display: flex; flex-direction: column; gap: 2px; }
.wr-action span { color: var(--muted); font-size: 12.5px; }
.wr-action-details[open] > .wr-action { border-radius: 10px 10px 0 0; border-color: var(--accent); }
.wr-clone { padding: 14px; border: 1px solid var(--accent); border-top: 0; border-radius: 0 0 10px 10px; }
.wr-clone .row { align-items: flex-end; }
.wr-recent { margin: 0; }
.wr-recent button { display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.wr-recent button:hover { background: var(--surface-2); }
.wr-recent .mono { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.editor-heading .grow { flex: 1; }

.wr-folder-menu { position: relative; flex: 1; min-width: 0; }
.wr-folder-menu > summary { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 8px; border-radius: 6px; cursor: pointer; list-style: none; }
.wr-folder-menu > summary::-webkit-details-marker { display: none; }
.wr-folder-menu > summary:hover, .wr-folder-menu[open] > summary { background: var(--surface-3); }
.wr-folder-menu > summary .icon { flex: none; width: 15px; height: 15px; color: var(--muted); }
.wr-folder-menu > summary strong { flex: none; font-size: 14px; }
.wr-menu { position: absolute; z-index: 14; top: 34px; left: 0; display: flex; flex-direction: column; min-width: 300px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-lg); font-size: 13px; }
.wr-menu form { margin: 0; }
.wr-menu > form > button, .wr-menu > a, .wr-menu details > summary { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.wr-menu > form > button:hover, .wr-menu > a:hover, .wr-menu details > summary:hover { background: var(--surface-2); text-decoration: none; }
.wr-menu details > summary { list-style: none; }
.wr-menu details > summary::-webkit-details-marker { display: none; }
.wr-menu .wr-clone { border: 0; padding: 6px 10px 10px; }
.wr-menu-label { padding: 8px 10px 2px; color: var(--muted); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }

.folder-dialog { width: min(620px, 92vw); padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.folder-dialog::backdrop { background: rgba(10, 12, 16, .45); }
.folder-dialog form { display: flex; flex-direction: column; margin: 0; }
.fd-head, .fd-path, .fd-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; }
.fd-head { justify-content: space-between; border-bottom: 1px solid var(--border); }
.fd-path .input { flex: 1; font-size: 12.5px; }
.fd-list { display: flex; flex-direction: column; height: 340px; overflow: auto; padding: 4px 8px; border-block: 1px solid var(--border); }
.fd-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.fd-item::before { content: "📁"; font-size: 13px; }
.fd-item:hover { background: var(--surface-2); }
.fd-git { margin-left: auto; padding: 1px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-text); font-size: 10.5px; }
.fd-foot .grow { flex: 1; }
.fd-foot label { display: flex; align-items: center; gap: 6px; }

/* Chat: a pane in the Workroom (dark) or a page of its own. */
.wr-chat { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; }
.wr-chat.full { flex: 1; max-width: 860px; margin: 0 auto; padding: 0 16px 16px; background: var(--surface); }
.ade-workspace:has(.wr-chat.full) { background: var(--surface); }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; padding: 14px 4px; }
.chat-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: auto; max-width: 340px; text-align: center; }
.chat-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 18px; }
.chat-msg { max-width: 100%; }
.chat-msg.user { align-self: flex-end; max-width: 85%; padding: 8px 12px; border-radius: 12px 12px 4px 12px; background: var(--accent); color: #fff; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg.pending { opacity: .6; }
.chat-msg.assistant .chat-body { font-size: 14px; }
.chat-msg.assistant .prose pre { max-width: 100%; overflow: auto; }
.chat-meta { margin-top: 2px; color: var(--muted); font-size: 11px; }
.chat-compose { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.chat-compose textarea { resize: vertical; min-height: 60px; }
.chat-actions { display: flex; align-items: center; gap: 10px; }
.chat-actions [data-chat-status] { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.builtin-editor .wr-chat { padding: 0 10px 10px; color: #d7dce5; }
.builtin-editor .chat-compose { border-color: #343943; }
.builtin-editor .chat-compose .input { background: #242933; color: #edf1f7; border-color: #3a404b; }
.builtin-editor .chat-icon { background: #23324a; color: #8fcaff; }
.builtin-editor .chat-msg.user { background: #2a5c96; }
.builtin-editor .chat-meta, .builtin-editor .chat-empty .muted { color: #8b95a4; }
.builtin-editor .chat-msg.assistant .prose code { background: #262b33; color: #e6ebf2; }
.builtin-editor .chat-msg.assistant .prose pre { background: #171a20; border: 1px solid #2c323c; }

/* Bottom dock (Terminal by default) and the terminal itself. */
.ide-workbench-grid > :not([data-dock-divider="bottom"]):not([data-dock-group="bottom"]) { grid-row: 1; }
.ide-workbench-grid > [data-dock-divider="bottom"] { grid-row: 2; grid-column: 1 / -1; }
.ide-workbench-grid > [data-dock-group="bottom"] { grid-row: 3; grid-column: 1 / -1; border-top: 1px solid #343943; }
.ide-dock-divider.horizontal { width: auto; height: 6px; border: 0; border-top: 1px solid #343943; border-bottom: 1px solid #343943; cursor: row-resize; }
.wr-terminal { width: 100%; height: 100%; padding: 4px 0 0 8px; background: #171a20; }
.wr-terminal .xterm { height: 100%; }
.wr-terminal .xterm-viewport { scrollbar-width: thin; scrollbar-color: #3a404b transparent; }
.wr-terminal-off { padding: 14px; color: #9aa5b4; }

/* Chat steps: tool calls, their output, and approvals. */
.chat-tool { display: flex; align-items: center; gap: 6px; margin: 4px 0; padding: 5px 9px; border-left: 3px solid var(--accent); border-radius: 4px; background: var(--surface-2); font-size: 12.5px; overflow-wrap: anywhere; }
.chat-tool code { background: none; font-size: 12px; }
.chat-output { margin: -4px 0 2px; font-size: 12px; }
.chat-output summary { color: var(--muted); cursor: pointer; }
.chat-output.error summary { color: var(--danger); }
.chat-output pre { max-height: 260px; margin: 4px 0 0; padding: 8px; overflow: auto; border-radius: 6px; background: var(--surface-2); font-size: 11.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-approvals { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--warn); border-radius: 10px; background: var(--warn-soft); }
.chat-approval pre { max-height: 220px; margin: 6px 0; padding: 8px; overflow: auto; border-radius: 6px; background: var(--surface); font-size: 11.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-approval .row { flex-wrap: wrap; gap: 6px; }
.chat-approval button.chosen { outline: 2px solid var(--accent); }
.builtin-editor .chat-tool, .builtin-editor .chat-output pre { background: #20242c; }
.builtin-editor .chat-approvals { border-color: #8a6a2a; background: #2a2418; }
.builtin-editor .chat-approval pre { background: #171a20; color: #d7dce5; }

/* Agent run page. */
.run-log { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; font-size: 13px; }
.run-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.run-line.tool { padding: 3px 8px; border-left: 3px solid var(--accent); background: var(--surface-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.run-line.err { color: var(--danger); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.run-diff { max-height: 70vh; margin: 0; padding: 10px; overflow: auto; border-radius: 8px; background: #171a20; color: #c6ced9; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.run-diff .add { color: #7ee2a8; }
.run-diff .del { color: #f39a9a; }
.run-diff .meta { color: #8fcaff; }

/* Settings → Agents */
.agent-auth .row { align-items: center; gap: 8px; flex-wrap: wrap; }
.agent-auth h3 { margin: 0; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; font-weight: 600; }
.agent-term { height: 260px; border-radius: 8px; overflow: hidden; }

/* Agent sessions (sessions.rs): list | live transcript | changes. */
.wr-views { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--surface-3); }
.wr-view { padding: 4px 12px; border-radius: 6px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.wr-view:hover { text-decoration: none; color: var(--text); }
.wr-view.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.ss-view { flex: 1; display: grid; grid-template-columns: 240px minmax(0, 1fr) 360px; min-height: 0; background: var(--surface); }
.ss-list { display: flex; flex-direction: column; gap: 2px; padding: 10px; overflow: auto; border-right: 1px solid var(--border); background: var(--surface-2); }
.ss-new { margin: 0 0 8px; }
.ss-item { display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 8px; border-radius: 8px; color: var(--text); }
.ss-item:hover { background: var(--surface-3); text-decoration: none; }
.ss-item.active { background: var(--accent-soft); }
.ss-item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.ss-item-meta { grid-column: 2; color: var(--muted); font-size: 11.5px; }
.ss-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.ss-dot.running { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: ss-pulse 1.2s infinite; }
.ss-dot.waiting { background: var(--warn); }
.ss-dot.merged { background: var(--ok); }
@keyframes ss-pulse { 50% { opacity: .35; } }
.ss-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ss-main.ss-empty { align-items: center; justify-content: center; padding: 24px; }
.ss-main.ss-empty > div { width: min(560px, 100%); display: flex; flex-direction: column; gap: 10px; }
.ss-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.ss-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-status { padding: 2px 8px; border-radius: 10px; background: var(--surface-3); font-size: 11.5px; font-weight: 600; }
.ss-status.running { background: var(--accent-soft); color: var(--accent-text); }
.ss-status.waiting { background: var(--warn-soft); color: var(--warn); }
.ss-status.merged { background: var(--ok-soft); color: var(--ok); }
.ss-branch { font-size: 11.5px; color: var(--muted); }
.ss-head .grow { flex: 1; }
.ss-log { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; padding: 16px 20px; }
.ss-hint { margin: auto; text-align: center; }
.ss-you { align-self: flex-end; max-width: 80%; padding: 8px 12px; border-radius: 12px 12px 4px 12px; background: var(--accent); color: #fff; white-space: pre-wrap; overflow-wrap: anywhere; }
.ss-text { max-width: 100%; }
.ss-note { align-self: center; color: var(--muted); font-size: 12px; }
.ss-err { padding: 8px 10px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 13px; white-space: pre-wrap; }
.ss-tool { border-left: 3px solid var(--accent); border-radius: 6px; background: var(--surface-2); font-size: 13px; }
.ss-tool[data-name="Bash"] { border-left-color: #7c3aed; }
.ss-tool[data-name="Read"], .ss-tool[data-name="Grep"], .ss-tool[data-name="Glob"] { border-left-color: var(--border-strong); }
.ss-tool-head, .ss-tool-head-d > summary { display: flex; align-items: center; gap: 8px; padding: 6px 10px; overflow-wrap: anywhere; }
.ss-tool-head-d > summary { cursor: pointer; list-style: none; }
.ss-tool-head-d > summary::-webkit-details-marker { display: none; }
.ss-tool code { background: none; font-size: 12.5px; }
.ss-tool-sub { padding: 0 10px 6px 34px; color: var(--muted); font-size: 12px; }
.ss-icon { width: 16px; flex: none; color: var(--muted); text-align: center; font-family: ui-monospace, monospace; }
.ss-count { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.ss-diff { margin: 0; padding: 8px 10px; overflow: auto; max-height: 360px; background: #171a20; color: #c6ced9; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.ss-diff .add { color: #7ee2a8; } .ss-diff .del { color: #f39a9a; } .ss-diff .meta { color: #8b95a4; } .ss-diff .hunk { color: #8fcaff; }
.ss-out { margin: -4px 0 0 14px; font-size: 12px; }
.ss-out summary { color: var(--muted); cursor: pointer; }
.ss-out.error summary { color: var(--danger); }
.ss-out pre { max-height: 300px; margin: 4px 0 0; padding: 8px; overflow: auto; border-radius: 6px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11.5px; }
.ss-plan { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 13px; }
.ss-plan-head { margin-bottom: 4px; color: var(--muted); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.ss-todo { display: flex; gap: 8px; padding: 2px 0; }
.ss-todo.completed { color: var(--muted); text-decoration: line-through; }
.ss-todo.in_progress { font-weight: 600; }
.ss-result { align-self: flex-start; padding: 3px 10px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 600; }
.ss-result.error { background: var(--danger-soft); color: var(--danger); }
.ss-approvals { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--warn); border-radius: 10px; background: var(--warn-soft); }
.ss-approvals-head { font-weight: 600; }
.ss-working { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.ss-spinner { width: 12px; height: 12px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: ss-spin .8s linear infinite; }
@keyframes ss-spin { to { transform: rotate(360deg); } }
.ss-compose { display: flex; flex-direction: column; gap: 6px; padding: 10px 16px 14px; border-top: 1px solid var(--border); }
.ss-compose .grow { flex: 1; }
.ss-changes { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--border); background: var(--surface-2); }
.ss-changes-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ss-files { display: flex; flex-direction: column; max-height: 40%; overflow: auto; padding: 6px; }
.ss-file { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; }
.ss-file.active { background: var(--accent-soft); }
.ss-file-name { overflow: hidden; border: 0; background: none; color: var(--text); font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.ss-file-counts { font-size: 11.5px; }
.ss-file-counts .add { color: var(--ok); } .ss-file-counts .del { color: var(--danger); }
.ss-file-diff { flex: 1; max-height: none; min-height: 0; margin: 0 6px; border-radius: 6px; }
.ss-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--border); }
.ss-actions .row { gap: 6px; }
@media (max-width: 1200px) { .ss-view { grid-template-columns: 200px minmax(0, 1fr) 300px; } }
.ss-status, .ss-cost { flex: none; white-space: nowrap; }
.ss-branch { min-width: 0; max-width: 32%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- team overview: channels first ---------- */
.sb-count { margin-left: auto; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--surface-3); color: var(--muted); font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; }
.sb-count.warn { background: var(--danger); color: #fff; }
.shell.collapsed .sb-count { display: none; }
.team-channel-meta .good { color: var(--ok); }
.team-channel-meta .tc-next { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; overflow: hidden; white-space: nowrap; }
.team-channel-meta .tc-last { margin-left: auto; }
.team-channel-meta svg { width: 12px; height: 12px; vertical-align: -2px; }
.attention { display: flex; flex-direction: column; }
.attn { display: flex; gap: 12px; align-items: flex-start; padding: 9px 6px; border-top: 1px solid var(--border); color: var(--text); border-left: 3px solid transparent; }
.attn:first-child { border-top: 0; }
.attn:hover { background: var(--surface-2); text-decoration: none; }
.attn[data-level="3"] { border-left-color: var(--danger); }
.attn[data-level="2"] { border-left-color: var(--warn); }
.attn[data-level="1"] { border-left-color: var(--border-strong); }
.attn-icon { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: var(--surface-2); color: var(--muted); }
.attn[data-level="3"] .attn-icon { color: var(--danger); }
.attn-icon svg { width: 14px; height: 14px; }
.attn-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.attn-text { font-weight: 600; font-size: 13px; }
.attn-detail { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
form.raise { display: flex; gap: 8px; margin-bottom: 10px; }
form.raise .input { flex: 1; min-width: 0; }
.address-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.address-list li { display: flex; align-items: flex-start; gap: 10px; padding: 7px 2px; border-top: 1px solid var(--border); font-size: 13px; }
.address-list li:first-child { border-top: 0; }
.address-list form.inline { display: contents; }
.address-list button.check { flex: none; width: 16px; height: 16px; margin-top: 1px; border: 1.5px solid var(--border-strong); border-radius: 4px; background: transparent; cursor: pointer; padding: 0; }
.address-list button.check:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.snapshot-excerpt { max-height: 220px; overflow: hidden; mask-image: linear-gradient(#000 75%, transparent); margin-bottom: 8px; }
.channel-group { margin-bottom: 10px; }
.channel-group-head { display: flex; align-items: center; gap: 6px; padding: 4px 2px; font-weight: 600; font-size: 13px; color: var(--text); }
.channel-group-head .count { color: var(--muted); font-weight: 500; }

/* ---------- diagrams (draw.io) ---------- */
.diagram-page { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 128px); min-height: 520px; }
.diagram-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.diagram-bar .crumbs { margin: 0; }
.diagram-title .input { font-weight: 600; min-width: 260px; }
.diagram-status { margin-left: auto; }
.diagram-editor { flex: 1; min-height: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.diagram-editor iframe { display: block; width: 100%; height: 100%; border: 0; }
.diagram-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 14px; }
.diagram-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); color: var(--text); }
.diagram-card:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow); }
.diagram-thumb { height: 150px; display: grid; place-items: center; background: #fff; border-bottom: 1px solid var(--border); color: #64748b; font-size: 12px; }
.diagram-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 10px; box-sizing: border-box; }
.diagram-thumb svg { width: 16px; height: 16px; vertical-align: -3px; }
.diagram-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; }
.diagram-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawio-install { max-width: 680px; margin-bottom: 14px; }
.drawio-install h3 { display: flex; align-items: center; gap: 8px; margin-top: 0; }

/* Tabs with icons (channel tabs) */
.icon-tabs .tab { display: inline-flex; align-items: center; gap: 6px; }
.icon-tabs .tab .icon, .icon-tabs .tab svg { width: 14px; height: 14px; flex: none; color: var(--c, currentColor); }
.icon-tabs .tab:not(.active) .icon, .icon-tabs .tab:not(.active) svg { opacity: .85; }
/* A straight underline: square bottom corners so the line never curves. */
.icon-tabs .tab { border-bottom: 2px solid transparent; }
.icon-tabs .tab.active, .project-tab-slot .icon-tabs .tab.active { box-shadow: none; border-radius: 6px 6px 0 0; border-bottom-color: var(--c, var(--accent)); }
.topbar:has(.project-tab-slot) .greeting { white-space: nowrap; flex: none; }
.project-tab-slot .icon-tabs .tab { padding: 7px 9px; gap: 5px; }
/* Narrow windows: inactive tabs show just their icon (the name is in the tooltip). */
@media (max-width: 1500px) {
  .project-tab-slot .icon-tabs .tab:not(.active) span { display: none; }
}
.topbar:has(.project-tab-slot) .quick { min-width: 200px; }

/* ---------- architecture, live views, history ---------- */
.arch-card { margin: 0 0 14px; overflow: hidden; }
.arch-card .card-head h3 { display: flex; align-items: center; gap: 8px; }
.arch-card .card-head h3 svg { width: 16px; height: 16px; color: #22d3ee; }
.arch-card .card-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.arch-live { display: block; width: 100%; height: 420px; border: 0; border-top: 1px solid var(--border); background: #fff; }
.arch-live.small { height: 260px; }
.diagram-live { width: 100%; height: 100%; border: 0; pointer-events: none; background: #fff; }
.arch-empty { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.chip.agent { background: color-mix(in srgb, #60a5fa 18%, transparent); color: #60a5fa; }
.chip.agent svg { width: 11px; height: 11px; vertical-align: -1px; }
.arch-chip { background: color-mix(in srgb, #22d3ee 18%, transparent); color: #0891b2; }
.diagram-change { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; }
.diagram-note { overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.diagram-lastchange { font-size: 12px; color: var(--muted); margin-top: -4px; }
.diagram-card-note { padding: 0 11px 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diagram-history { position: relative; }
.diagram-history > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.diagram-history > summary::-webkit-details-marker { display: none; }
.diagram-history .count { background: var(--surface-3); border-radius: 8px; padding: 0 6px; font-size: 11px; }
.history-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 380px; max-height: 60vh; overflow: auto; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li { padding: 8px 0; border-top: 1px solid var(--border); }
.history-list li:first-child { border-top: 0; }
.history-line { display: flex; align-items: center; gap: 8px; }
.history-line form { margin-left: auto; }
.history-note { margin-top: 4px; font-size: 12.5px; color: var(--text-2); }
.kickoff-card textarea { width: 100%; min-height: 70px; margin: 8px 0; }
.kickoff-card ul { margin: 6px 0 10px; padding-left: 18px; color: var(--text-2); font-size: 13px; }

/* ---------- administration; Monday-style grouped tables ---------- */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table td { padding: 8px 6px; border-top: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:first-child td { border-top: 0; }
.admin-table td.num, .board-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.admin-table code { font-size: 12px; }
.bulk-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.bulk-bar [data-bulk-count] { margin-right: auto; }
.bulk-bar.has-selection { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.board-group { margin-bottom: 22px; }
.board-group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.board-group-head .check-label { display: inline-flex; align-items: center; gap: 8px; }
.board-group-name { color: var(--g, var(--accent)); font-weight: 700; font-size: 15px; }
.board-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--g, var(--accent)); border-radius: 0; }
.board-table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.board-table td { padding: 0 10px; height: 38px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); }
.board-table td:first-child, .board-table th:first-child { border-left: 0; }
.board-table tbody tr:last-child td { border-bottom: 0; }
.board-table tbody tr:hover td { background: var(--surface-2); }
.board-table .sel { width: 34px; text-align: center; }
.board-table .folder code { font-size: 11.5px; }
/* Status cells fill the cell, Monday style. */
.board-table td:has(> .status-cell) { padding: 0; }
.status-cell { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 38px; padding: 0 10px; font-size: 12.5px; font-weight: 600; color: #fff; text-transform: capitalize; background: #c4c4c4; }
.admin-table .status-cell { display: inline-flex; min-height: 0; height: auto; padding: 4px 10px; text-transform: none; }
.status-cell.ok, .status-cell.sc-active, .status-cell.sc-merged, .status-cell.sc-done, .status-cell.sc-succeeded { background: #00c875; color: #fff; }
.status-cell.warn, .status-cell.sc-paused, .status-cell.sc-waiting, .status-cell.sc-queued { background: #fdab3d; color: #fff; }
.status-cell.sc-idle { background: #579bfc; color: #fff; }
.status-cell.sc-archived, .status-cell.sc-discarded, .status-cell.sc-cancelled { background: #a1a1a1; color: #fff; }
.status-cell.sc-running { background: #9d50dd; color: #fff; }
.status-cell.sc-failed { background: #e2445c; color: #fff; }
:root[data-theme="dark"] .board-table th { background: color-mix(in srgb, var(--surface-2) 70%, #000); }

/* ---------- Monday-style task board (channel Tasks tab) ---------- */
.mb-board { display: flex; flex-direction: column; gap: 30px; }
.mb-group-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 8px; }
.mb-group-rename { display: contents; }
.mb-group-name { font: inherit; font-size: 18px; font-weight: 700; color: var(--g); background: transparent; border: 1px solid transparent; padding: 2px 6px; margin-left: -7px; min-width: 6ch; }
.mb-group-name:hover { border-color: var(--border); }
.mb-group-name:focus { outline: none; border-color: var(--g); background: var(--surface); }
.mb-count { color: var(--muted); font-size: 13px; }
.mb-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--g); font-size: 13.5px; }
.mb-table th { height: 36px; padding: 0 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); text-align: center; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); background: var(--surface); }
.mb-table th:last-child, .mb-table td:last-child { border-right: 0; }
.mb-table th.mb-title-h { text-align: left; padding-left: 14px; }
.mb-table td { height: 40px; padding: 0 8px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-table tbody tr:not(.mb-add):hover td { background: var(--surface-2); }
.mb-table tbody tr:not(.mb-add):hover td.mb-cell { background: transparent; }
.mb-owner-h, .mb-owner { width: 72px; }
.mb-status-h { width: 150px; } .mb-prio-h { width: 120px; } .mb-due-h { width: 140px; }
.mb-agent-h { width: 120px; } .mb-est-h { width: 92px; } .mb-upd-h { width: 104px; }
.mb-title { text-align: left !important; padding-left: 14px !important; }
.mb-title a { color: var(--text); font-weight: 500; }
.mb-title a:hover { color: var(--accent); text-decoration: none; }
tr.done .mb-title a { color: var(--muted); }
.mb-subs, .mb-has-notes { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; color: var(--muted); font-size: 12px; }
.mb-subs svg, .mb-has-notes svg { width: 13px; height: 13px; }
.mb-cell { padding: 0 !important; }
.mb-cell form { height: 100%; }
.mb-pill { display: flex; align-items: center; justify-content: center; width: 100%; height: 40px; margin: 0; padding: 0 8px; border: 0; border-radius: 0; appearance: none; -webkit-appearance: none; font: inherit; font-weight: 600; font-size: 13px; color: #fff; text-align: center; text-align-last: center; cursor: pointer; background: #c4c4c4; text-transform: none; }
a.mb-pill:hover { text-decoration: none; }
.mb-pill:hover { filter: brightness(1.06); }
.mb-pill:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.mb-pill option { color: var(--text); background: var(--surface); font-weight: 500; }
.mb-pill.s-todo { background: #c4c4c4; } .mb-pill.s-doing { background: #fdab3d; } .mb-pill.s-waiting { background: #e2445c; } .mb-pill.s-done { background: #00c875; }
.mb-pill.p-0 { background: var(--surface-2); color: var(--muted); } .mb-pill.p-1 { background: #579bfc; } .mb-pill.p-2 { background: #5559df; } .mb-pill.p-3 { background: #401694; }
.mb-pill.a-running { background: #9d50dd; } .mb-pill.a-queued { background: #fdab3d; } .mb-pill.a-done, .mb-pill.a-succeeded, .mb-pill.a-completed { background: #00c875; }
.mb-pill.a-failed { background: #e2445c; } .mb-pill.a-cancelled, .mb-pill.a-discarded { background: #a1a1a1; }
.mb-due input { width: 100%; height: 38px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; text-align: center; cursor: pointer; }
.mb-due input:focus { outline: none; background: var(--surface-2); }
.mb-due.overdue input { color: var(--danger); font-weight: 600; }
.mb-avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }
.mb-avatar.agent { background: #9d50dd; }
.mb-avatar.agent svg { width: 14px; height: 14px; }
.mb-avatar.empty { background: transparent; border: 1.5px dashed var(--border-strong); }
.mb-run { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.mb-run:hover { border-color: #9d50dd; color: #9d50dd; }
.mb-run svg { width: 12px; height: 12px; }
.mb-est, .mb-upd { color: var(--muted); font-size: 12.5px; }
.mb-add td { text-align: left; padding: 0 0 0 14px; border-right: 0; }
.mb-add input { width: 100%; height: 38px; border: 0; background: transparent; color: var(--text); font: inherit; }
.mb-add input:focus { outline: none; }
.mb-summary { display: flex; gap: 1px; height: 10px; margin: 6px 0 0 6px; background: var(--surface-2); }
.mb-summary span { display: block; height: 100%; }
.mb-summary .s-todo { background: #c4c4c4; } .mb-summary .s-doing { background: #fdab3d; } .mb-summary .s-waiting { background: #e2445c; } .mb-summary .s-done { background: #00c875; }
.mb-new-group { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px dashed var(--border-strong); color: var(--muted); }
.mb-new-group .input { flex: 1; min-width: 0; }
.mb-new-group svg { width: 16px; height: 16px; }
/* The board takes the page's full width; it scrolls sideways rather than crush task names. */
.split.split-board { display: block; }
.split-board > .props { display: none; }
.mb-group { overflow-x: auto; }
.mb-table { min-width: 1080px; }
.mb-table th.mb-title-h { width: auto; min-width: 300px; }
.mb-due input:not([value]):not(:focus)::-webkit-datetime-edit { color: transparent; }
.mb-due input:not([value]):not(:focus) { color: transparent; }
