/*
 * AuraTrack.
 *
 * One stylesheet for two shells: the Tauri window and the same files served at
 * /track/ by the account server. Nothing here may depend on Tauri, because the
 * browser gets the same markup; the desktop-only pieces hang off `.desktop-app`
 * on the body, which app.js sets.
 *
 * The window's own caption, on the platforms that draw one, is merged into
 * `.topbar` (`data-ao-caption-host`). The shell stylesheet pads that row for
 * the buttons, so nothing here may set `padding-right` on it.
 */

:root {
  color-scheme: light;
  --ink: #101b43;
  --ink-soft: #475a85;
  --muted: #7286a8;
  --line: #e2e9f3;
  --line-soft: #eef2f8;
  --canvas: #f5f7fc;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --blue: #0875f7;
  --blue-dark: #065dcc;
  --blue-wash: #eaf2ff;
  --blue-soft: #a9c8f7;
  --teal: #13bfa4;
  --green: #0aad6c;
  --green-wash: #e4f7ee;
  --red: #e52653;
  --red-wash: #ffecf1;
  --amber: #e58a0b;
  --amber-wash: #fff3e0;
  --purple: #7447e8;
  --purple-wash: #f1ebff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 27, 67, .04), 0 8px 24px rgba(16, 27, 67, .06);
  --shadow-soft: 0 1px 2px rgba(16, 27, 67, .05);
  --rail-width: 232px;
  --detail-width: 380px;

  /* The top row is the caption host on the platforms that draw one, and the
     shell needs its padding to place the window buttons: they sit against the
     top of the window, not the top of this row's content box, so a row with
     6px above it would hold them 6px down and leave a strip of background
     above them that no native caption has. */
  --ao-caption-host-padding: 14px;
  --ao-caption-host-padding-top: 6px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eaf0fb;
  --ink-soft: #b3c1de;
  --muted: #8b9bbd;
  --line: #27334d;
  --line-soft: #1e2942;
  --canvas: #0d1526;
  --surface: #141d33;
  --surface-2: #18223a;
  --blue: #5aa2ff;
  --blue-dark: #78b4ff;
  --blue-wash: #1b2b4b;
  --blue-soft: #2f557f;
  --green-wash: #14332a;
  --red-wash: #3a1d2a;
  --amber-wash: #382a16;
  --purple-wash: #251f45;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--canvas); color: var(--ink); }
body { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; box-shadow: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- shell */

.app-shell {
  height: 100%;
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr) 0;
  transition: grid-template-columns .18s ease;
}
.app-shell.detail-open { grid-template-columns: var(--rail-width) minmax(0, 1fr) var(--detail-width); }
.app-shell { position: relative; }

/* Pane handles, as in shell/chrome.css, which this page does not load. They
   are 6px of hit area with a 1px line drawn inside, laid over the column edge. */
.pane-handle { position: absolute; top: 0; bottom: 0; width: 6px; z-index: 6; cursor: col-resize; touch-action: none; }
.pane-handle::before { content: ""; position: absolute; inset: 0 auto 0 50%; width: 1px; transform: translateX(-50%); background: transparent; }
.pane-handle:hover::before, .pane-handle:focus::before { background: var(--blue); width: 2px; }
.pane-handle:focus { outline: 2px solid var(--blue); outline-offset: -2px; }
#railHandle { left: calc(var(--rail-width) - 3px); }
#detailHandle { right: calc(var(--detail-width) - 3px); display: none; }
.app-shell.detail-open #detailHandle { display: block; }
.pane-resizing, .pane-resizing * { user-select: none !important; cursor: col-resize !important; }
.pane-resizing .app-shell { transition: none; }

.rail {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 12px 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.rail-top { height: 52px; display: flex; align-items: center; padding: 0 4px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; padding: 4px 6px; border-radius: var(--radius-sm); }
.brand img { width: 26px; height: 26px; border-radius: 8px; }
.brand strong { font-size: 17px; letter-spacing: -.03em; }

.rail-nav { display: grid; gap: 2px; }
.nav-item {
  border: 0; background: transparent; color: var(--ink-soft);
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  text-align: left; font-weight: 600; font-size: 14px;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--blue-wash); color: var(--blue); }
.nav-icon { width: 18px; text-align: center; font-size: 15px; }

.rail-boards { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.rail-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.rail-add { border: 0; background: transparent; color: var(--muted); font-size: 17px; line-height: 1; padding: 2px 4px; border-radius: 6px; }
.rail-add:hover { background: var(--surface-2); color: var(--blue); }
.board-list { min-height: 0; overflow-y: auto; display: grid; gap: 2px; }
.board-item { border: 0; background: transparent; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); text-align: left; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.board-item:hover { background: var(--surface-2); color: var(--ink); }
.board-item.active { background: var(--surface-2); color: var(--ink); }
.board-item i { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 3px; background: var(--blue); }
.board-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-item small { margin-left: auto; color: var(--muted); font-weight: 600; }

.dock-callout { flex: 0 0 auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface-2); display: none; grid-template-columns: 30px 1fr; gap: 10px; }
.desktop-app .dock-callout { display: grid; }
.dock-callout img { width: 30px; border-radius: 8px; }
.dock-callout strong { font-size: 13px; }
.dock-callout p { margin-top: 2px; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.dock-callout button { grid-column: 1 / -1; border: 0; border-radius: 8px; padding: 8px; background: var(--blue-wash); color: var(--blue); font-weight: 700; font-size: 12.5px; }

.account { flex: 0 0 auto; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; display: flex; gap: 10px; align-items: center; padding: 8px; text-align: left; }
.account:hover { background: var(--surface-2); }
.account-copy { min-width: 0; display: flex; flex-direction: column; }
.account-copy strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { color: var(--muted); font-size: 11px; }
.avatar { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--purple), #4f6bed); font-weight: 700; font-size: 12px; }
.avatar.small { flex-basis: 26px; width: 26px; height: 26px; font-size: 11px; }

/* --------------------------------------------------------------- topbar */

.main { min-width: 0; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--canvas); }

.topbar {
  min-height: 44px;
  display: flex; align-items: center; gap: 12px;
  padding: 6px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-left { min-width: 0; flex: 1; display: flex; align-items: center; gap: 8px; align-self: stretch; }
.crumb { font-size: 13px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.crumb-sep { color: var(--muted); }
.crumb-board { color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.rail-toggle { display: none; border: 0; background: transparent; font-size: 18px; padding: 2px 6px; border-radius: 6px; color: var(--ink-soft); }
.connection { margin-left: 6px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; font-size: 11.5px; white-space: nowrap; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: #9badc6; }
.connection.online { color: var(--green); }
.connection.online i { background: var(--green); }
.connection.error { color: var(--red); }
.connection.error i { background: var(--red); }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.search { width: min(320px, 26vw); height: 30px; border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; display: flex; gap: 8px; align-items: center; background: var(--surface-2); }
.search span { color: var(--muted); font-size: 15px; line-height: 1; }
.search input { border: 0; outline: 0; background: transparent; min-width: 0; width: 100%; font-size: 13px; }
.search input::placeholder { color: var(--muted); }
.icon-btn { position: relative; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); color: var(--ink-soft); display: grid; place-items: center; font-size: 14px; }
.icon-btn:hover { color: var(--blue); border-color: var(--blue); }
.icon-btn .dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.profile { height: 30px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); display: flex; align-items: center; gap: 8px; padding: 0 10px 0 2px; }
.profile:hover { border-color: var(--blue); }
.profile-copy { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.profile-copy strong { font-size: 12px; }
.profile-copy small { color: var(--muted); font-size: 10.5px; }
.undock-button { display: none; }

/* ------------------------------------------------------------ view frame */

.view-scroll { min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 18px 22px 28px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-titles h1 { font-size: 26px; }
.page-titles p { margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.view { display: grid; gap: 16px; }

.primary, .quiet { border-radius: var(--radius-sm); padding: 8px 14px; border: 1px solid transparent; font-weight: 650; font-size: 13px; }
.primary { color: white; background: var(--blue); }
.primary:hover { background: var(--blue-dark); }
.quiet { color: var(--ink-soft); border-color: var(--line); background: var(--surface); }
.quiet:hover { color: var(--blue); border-color: var(--blue); }
.destructive { background: var(--red); }
.destructive:hover { background: #c41f47; }
.segmented { border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 12.5px; }
.segmented small { margin-left: 5px; color: var(--muted); }
.segmented.active { background: var(--blue-wash); color: var(--blue); border-color: transparent; }
.segmented.active small { color: var(--blue); }
select.field { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 10px; background: var(--surface); font-size: 13px; font-weight: 600; }

/* ---------------------------------------------------------------- cards */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; }
.card-head .card-link { margin-left: auto; border: 0; background: transparent; color: var(--blue); font-size: 12.5px; font-weight: 650; }
.card-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--blue-wash); color: var(--blue); font-size: 13px; }
.card-note { color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 16px; align-items: start; }
.side-col { display: grid; gap: 16px; min-width: 0; }

/* ------------------------------------------------------------ dashboard */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 6px; box-shadow: var(--shadow-soft); }
.stat-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; }
.stat-icon.blue { background: var(--blue-wash); color: var(--blue); }
.stat-icon.green { background: var(--green-wash); color: var(--green); }
.stat-icon.amber { background: var(--amber-wash); color: var(--amber); }
.stat-icon.red { background: var(--red-wash); color: var(--red); }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.stat-foot { color: var(--muted); font-size: 11.5px; }
.stat-foot b { color: var(--green); font-weight: 700; }
.stat-foot b.down { color: var(--red); }

.ring-card { display: flex; align-items: center; gap: 14px; }
.ring { --value: 0; flex: 0 0 76px; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--blue) calc(var(--value) * 1%), var(--line-soft) 0); }
.ring i { width: 58px; height: 58px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 16px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px; font-size: 11.5px; font-weight: 650; background: var(--surface-2); color: var(--ink-soft); }
.pill.green { background: var(--green-wash); color: var(--green); }
.pill.red { background: var(--red-wash); color: var(--red); }
.pill.amber { background: var(--amber-wash); color: var(--amber); }
.pill.blue { background: var(--blue-wash); color: var(--blue); }
.pill.purple { background: var(--purple-wash); color: var(--purple); }

.trend { display: grid; gap: 10px; }
.trend-bars { height: 150px; display: flex; align-items: flex-end; gap: 3px; padding-top: 8px; border-bottom: 1px solid var(--line-soft); }
.bar-pair { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
/* Both the pair and the two bars in it have to be allowed below their content
   width, or thirty days of buckets push the card wider than the window. */
.bar-pair i { flex: 1 1 0; min-width: 0; max-width: 6px; border-radius: 3px 3px 0 0; background: var(--blue); min-height: 2px; }
.bar-pair i.created { background: var(--blue-soft); }
.trend-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 11.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 3px; background: var(--blue); }
.legend i.created { background: var(--blue-soft); }

.activity-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.activity-row:last-child { border-bottom: 0; }
.activity-row .kind { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--surface-2); color: var(--ink-soft); }
.activity-row .kind.completed { background: var(--green-wash); color: var(--green); }
.activity-row .kind.created { background: var(--blue-wash); color: var(--blue); }
.activity-row .kind.paused { background: var(--amber-wash); color: var(--amber); }
.activity-row p { font-size: 12.5px; line-height: 1.45; }
.activity-row p b { font-weight: 650; }
.activity-row small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.activity-row .title { color: var(--muted); }

.deadline { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.deadline:last-child { border-bottom: 0; }
.deadline-date { text-align: center; border-radius: 9px; background: var(--surface-2); padding: 4px 0; line-height: 1.1; }
.deadline-date b { display: block; font-size: 14px; }
.deadline-date small { color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; }
.deadline strong { font-size: 12.5px; font-weight: 650; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deadline small.where { color: var(--muted); font-size: 11px; }

.group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.group + .group { margin-top: 10px; }
.group-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.group-head h3 { font-size: 13.5px; }
.group-head .count { color: var(--muted); font-size: 12px; }
.group-bar { flex: 1; max-width: 260px; margin-left: auto; height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.group-bar i { display: block; height: 100%; background: var(--green); }
.group-percent { font-size: 12px; font-weight: 650; color: var(--ink-soft); min-width: 34px; text-align: right; }

.task-table { width: 100%; }
.task-line { display: grid; grid-template-columns: minmax(0, 1fr) 96px 120px 88px 72px; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.task-line:last-child { border-bottom: 0; }
.task-line:hover { background: var(--surface-2); cursor: pointer; }
.task-line .name { min-width: 0; display: flex; align-items: center; gap: 8px; }
.task-line .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-line .mini-bar { height: 5px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.task-line .mini-bar i { display: block; height: 100%; background: var(--blue); }
.task-line .due { color: var(--muted); font-size: 12px; }
.task-line .due.late { color: var(--red); font-weight: 650; }
.thead { display: grid; grid-template-columns: minmax(0, 1fr) 96px 120px 88px 72px; gap: 10px; padding: 8px 14px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* --------------------------------------------------------------- boards */

.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 272px; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding-bottom: 8px; align-items: start; }
.column { scroll-snap-align: start; }
.column { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: grid; gap: 8px; align-content: start; min-height: 160px; }
.column.drop { border-color: var(--blue); background: var(--blue-wash); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px; }
.column-head i { width: 9px; height: 9px; border-radius: 3px; }
.column-head h3 { font-size: 13px; }
.column-head .count { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 650; }
.add-card { border: 1px dashed var(--line); background: transparent; border-radius: var(--radius-sm); padding: 8px; color: var(--muted); font-size: 12.5px; font-weight: 650; }
.add-card:hover { color: var(--blue); border-color: var(--blue); }
.kanban-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 11px; display: grid; gap: 8px; box-shadow: var(--shadow-soft); cursor: grab; }
.kanban-card.selected { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-wash); }
.kanban-card.dragging { opacity: .5; }
.kanban-card h4 { font-size: 13px; font-weight: 650; line-height: 1.35; }
.kanban-card .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.kanban-card .meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11.5px; }
.kanban-card .meta .spacer { margin-left: auto; }
.kanban-card .mini-bar { height: 5px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.kanban-card .mini-bar i { display: block; height: 100%; background: var(--blue); }
.kanban-card .flag { color: var(--red); }

.member-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.member-row:last-child { border-bottom: 0; }
.member-row strong { font-size: 12.5px; }
.member-row small { color: var(--muted); font-size: 11px; display: block; }
.member-row .pill { margin-left: auto; }

/* ---------------------------------------------------------------- tasks */

.task-toolbar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.task-toolbar .spacer { flex: 1; }
.category-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.category-card + .category-card { margin-top: 10px; }
.category-head { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.category-dot { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: white; font-weight: 700; font-size: 12px; }
.category-head h2 { font-size: 14px; }
.category-head p { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.add-small { margin-left: auto; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 10px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.add-small:hover { color: var(--blue); border-color: var(--blue); }
.item-list { display: grid; }
.flat-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

.item-row { display: grid; grid-template-columns: 22px 26px minmax(0, 1fr) 110px 52px 30px; gap: 10px; align-items: center; padding: 8px 12px; padding-left: calc(12px + var(--depth, 0) * 18px); border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.item-row:last-child { border-bottom: 0; }
.item-row:hover { background: var(--surface-2); }
.item-row.selected { background: var(--blue-wash); }
.item-row.done .item-title { color: var(--muted); text-decoration: line-through; }
.item-row.flagged .item-title::after { content: " ⚑"; color: var(--red); }
.tree-toggle { border: 0; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; padding: 2px; border-radius: 5px; transition: transform .12s ease; }
.tree-toggle.expanded { transform: rotate(90deg); }
.tree-spacer { display: block; }
.check { width: 22px; height: 22px; border: 1.5px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--green); display: grid; place-items: center; font-size: 12px; }
.item-row.done .check { background: var(--green); border-color: var(--green); color: white; }
.item-copy { min-width: 0; display: flex; flex-direction: column; }
.item-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { color: var(--muted); font-size: 11px; }
.list-link { color: var(--purple); }
.bar { height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); }
.percent { color: var(--ink-soft); font-size: 11.5px; font-weight: 650; text-align: right; }
.more { border: 0; background: transparent; color: var(--muted); border-radius: 6px; }
.more:hover { background: var(--line-soft); color: var(--ink); }
.empty-board { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px 20px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.empty-board p { color: var(--muted); font-size: 13px; max-width: 46ch; }

/* -------------------------------------------------------------- detail */

.detail { min-width: 0; height: 100%; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line); display: none; }
.app-shell.detail-open .detail { display: block; }
.empty-detail { padding: 40px 24px; text-align: center; display: grid; gap: 8px; justify-items: center; color: var(--muted); }
.empty-detail img { width: 40px; opacity: .6; }
.empty-detail h2 { font-size: 15px; color: var(--ink); }
.empty-detail p { font-size: 12.5px; }
.detail-card { display: grid; }
.detail-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.detail-head h2 { font-size: 15px; line-height: 1.3; }
.detail-head p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.progress-ring { --value: 0; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: conic-gradient(var(--blue) calc(var(--value) * 1%), var(--line-soft) 0); position: relative; }
.progress-ring::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.icon-button { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.icon-button:hover { background: var(--line-soft); color: var(--ink); }
.detail-body { padding: 14px 16px; display: grid; gap: 12px; }
.edit-hint { color: var(--muted); font-size: 11.5px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field-grid label, .detail-body label { min-width: 0; display: grid; gap: 5px; font-size: 11.5px; font-weight: 650; color: var(--muted); }
.field-grid label.wide { grid-column: 1 / -1; }
.field-grid input, .field-grid select, .field-grid textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 8px 9px; background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink); }
.field-grid textarea { resize: vertical; }
.slider-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px; gap: 8px; align-items: center; }
.check-field { grid-column: 1 / -1; display: flex !important; align-items: center; gap: 8px; color: var(--ink-soft); }
.linked { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; background: var(--purple-wash); font-size: 12.5px; }
.linked span { display: grid; }
.linked small { color: var(--muted); font-size: 11px; }
.linked button { margin-left: auto; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.delete-button { color: var(--red); }
.delete-button:hover { border-color: var(--red); color: var(--red); }

/* ------------------------------------------------------------- timeline */

.day + .day { margin-top: 14px; }
.day-label { color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.event { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; position: relative; }
.event::before { content: ""; position: absolute; left: 14px; top: 34px; bottom: -10px; width: 1px; background: var(--line); }
.event:last-child::before { display: none; }
.event .kind { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-soft); font-size: 13px; z-index: 1; }
.event .kind.completed { background: var(--green-wash); color: var(--green); }
.event .kind.created { background: var(--blue-wash); color: var(--blue); }
.event .kind.paused { background: var(--amber-wash); color: var(--amber); }
.event strong { font-size: 13px; font-weight: 650; }
.event p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.event .quote { margin-top: 6px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12.5px; color: var(--ink-soft); }
.event small { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* ----------------------------------------------------------------- team */

.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 12px; box-shadow: var(--shadow-soft); }
.person-head { display: flex; align-items: center; gap: 11px; }
.person-head > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.person-head strong { font-size: 14px; }
.person-head small { color: var(--muted); font-size: 11.5px; }
.person-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.person-stats div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px; text-align: center; }
.person-stats b { display: block; font-size: 16px; }
.person-stats small { color: var(--muted); font-size: 10.5px; }

/* -------------------------------------------------------------- reports */

.dist-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 46px; gap: 10px; align-items: center; padding: 6px 0; font-size: 12.5px; }
.dist-row .mini-bar { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.dist-row .mini-bar i { display: block; height: 100%; background: var(--blue); }
.dist-row b { text-align: right; font-size: 12.5px; }
.report-note { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface-2); color: var(--ink-soft); font-size: 12.5px; line-height: 1.55; }

/* ------------------------------------------------------------- settings */

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 14px; align-items: start; }
.setting-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.setting-row:last-child { border-bottom: 0; }
.setting-copy { flex: 1 1 auto; min-width: 0; }
.setting-copy strong { display: block; font-size: 13px; font-weight: 650; }
.setting-copy small { color: var(--muted); font-size: 11.5px; }
.setting-row .control { flex: 0 0 auto; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.switch { width: 40px; height: 22px; border: 0; border-radius: 999px; background: var(--line); position: relative; flex: 0 0 40px; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; transition: left .14s ease; }
.switch[aria-pressed="true"] { background: var(--blue); }
.switch[aria-pressed="true"]::after { left: 21px; }
.choice { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.choice button { border: 0; background: var(--surface); color: var(--ink-soft); padding: 6px 11px; font-size: 12.5px; font-weight: 650; }
.choice button.active { background: var(--blue-wash); color: var(--blue); }

/* -------------------------------------------------------------- dialogs */

dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 20, 45, .45); }
dialog form { display: grid; gap: 12px; padding: 16px; }
dialog header { display: flex; align-items: flex-start; gap: 12px; }
dialog h2 { font-size: 16px; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 3px; }
dialog label { display: grid; gap: 5px; font-size: 12px; font-weight: 650; color: var(--muted); }
dialog label span { color: var(--muted); font-weight: 500; }
dialog input, dialog select, dialog textarea { border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink); }
dialog footer { display: flex; justify-content: flex-end; gap: 8px; }
.dialog-copy { color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.form-error { color: var(--red); font-size: 12px; min-height: 1em; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 16px); background: #0f1b38; color: white; border-radius: 999px; padding: 9px 18px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .16s ease, transform .16s ease; z-index: 30; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------- docked mode */

body.docked .rail, body.docked .detail, body.docked .page-actions, body.docked .tabbar { display: none; }
body.docked .app-shell { grid-template-columns: minmax(0, 1fr); }
body.docked .undock-button { display: grid; }
body.docked .search, body.docked .profile-copy, body.docked .crumb-sep, body.docked .crumb-board { display: none; }
body.docked .view-scroll { padding: 12px; }
body.docked .columns { grid-template-columns: minmax(0, 1fr); }
body.docked .page-titles h1 { font-size: 19px; }

/* ------------------------------------------------------------ narrow */

.tabbar { display: none; }
.rail-scrim { position: fixed; inset: 0; background: rgba(10, 20, 45, .4); z-index: 18; }

@media (max-width: 1100px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
  .app-shell.detail-open { grid-template-columns: var(--rail-width) minmax(0, 1fr) min(var(--detail-width), 40vw); }
  #detailHandle { right: calc(min(var(--detail-width), 40vw) - 3px); }
}

@media (max-width: 860px) {
  .app-shell, .app-shell.detail-open { grid-template-columns: minmax(0, 1fr); }
  .app-shell .pane-handle, .app-shell.detail-open #detailHandle { display: none; }
  .rail { position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; width: var(--rail-width); transform: translateX(-102%); transition: transform .18s ease; box-shadow: var(--shadow); }
  .app-shell.rail-open .rail { transform: none; }
  .rail-toggle { display: block; }
  .search { width: 150px; }
  .profile-copy { display: none; }
  .crumb-sep, .crumb-board, .connection { display: none; }
  .detail { position: fixed; z-index: 19; inset: 0; border-left: 0; }
  .view-scroll { padding: 14px 14px 76px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 17; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tab { flex: 1; border: 0; background: transparent; color: var(--muted); display: grid; justify-items: center; gap: 3px; font-size: 10.5px; font-weight: 650; padding: 4px 0; border-radius: 9px; }
  .tab span { font-size: 16px; }
  .tab.active { color: var(--blue); }
  .task-line, .thead { grid-template-columns: minmax(0, 1fr) 84px 64px; }
  .task-line .assignee, .task-line .tag, .thead .assignee, .thead .tag { display: none; }
  .item-row { grid-template-columns: 20px 24px minmax(0, 1fr) 46px; }
  .item-row .bar, .item-row .more { display: none; }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .page-titles h1 { font-size: 21px; }
  .kanban { grid-auto-columns: 250px; }
}

@media (max-width: 520px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { padding: 6px 10px; }
  :root { --ao-caption-host-padding: 10px; }
  .search { width: 110px; }
}

/* ------------------------------------------- the row every section carries */

.scope-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scope-spacer { flex: 1; }
.chip-set { display: flex; gap: 6px; flex-wrap: wrap; }
.sort-field { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.stat-foot b { color: var(--green); font-weight: 700; }
.stat-foot b.down { color: var(--red); }
.stat-foot b.up { color: var(--green); }
.card-note b.down { color: var(--red); }
.card-note b.up { color: var(--green); }

/* ------------------------------------------------------------- the donuts */

.donut-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut { flex: 0 0 104px; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; }
.donut i { width: 74px; height: 74px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-style: normal; line-height: 1.1; text-align: center; }
.donut i b { font-size: 19px; font-weight: 700; }
.donut i small { color: var(--muted); font-size: 10.5px; }
.donut-legend { flex: 1; min-width: 140px; display: grid; gap: 6px; }
.donut-legend span { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); }
.donut-legend span i { width: 9px; height: 9px; border-radius: 3px; }
.donut-legend span b { margin-left: auto; font-weight: 700; }
.donut-legend span small { color: var(--muted); width: 34px; text-align: right; }

/* ----------------------------------------------------------- the tables */

.thead.task-head { display: grid; grid-template-columns: minmax(0, 1fr) 104px 118px 56px 88px 84px 104px; }
.thead.task-head.wide { grid-template-columns: minmax(0, 1fr) 110px 104px 118px 56px 88px 84px 104px; }
.task-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px 118px 56px 88px 84px 104px; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.task-row.wide { grid-template-columns: minmax(0, 1fr) 110px 104px 118px 56px 88px 84px 104px; }
.task-row:last-of-type { border-bottom: 0; }
.task-row:hover { background: var(--surface-2); }
.task-row.selected { background: var(--blue-wash); }
.task-row .name { min-width: 0; display: flex; align-items: center; gap: 10px; }
.name-copy { min-width: 0; display: flex; flex-direction: column; }
.name-copy b { font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-copy small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-copy .flag { color: var(--red); font-style: normal; }
.progress-cell { display: flex; align-items: center; gap: 8px; }
.progress-cell .mini-bar { flex: 1; height: 5px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.progress-cell .mini-bar i { display: block; height: 100%; background: var(--blue); }
.progress-cell small { color: var(--muted); font-size: 11.5px; width: 32px; text-align: right; }
.table-foot { padding: 10px 14px; color: var(--muted); font-size: 11.5px; border-top: 1px solid var(--line-soft); }

.thead.team-head { display: grid; grid-template-columns: minmax(0, 1fr) 150px 60px 120px 92px 78px 88px; }
.team-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 60px 120px 92px 78px 88px; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.team-row:last-of-type { border-bottom: 0; }
.team-row .name { min-width: 0; display: flex; align-items: center; gap: 10px; }
.board-col { display: flex; gap: 4px; flex-wrap: wrap; min-width: 0; }

.thead.summary-head { display: grid; grid-template-columns: minmax(0, 1fr) 62px 96px 74px 62px 92px; padding-left: 0; padding-right: 0; }
.summary-row { display: grid; grid-template-columns: minmax(0, 1fr) 62px 96px 74px 62px 92px; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.summary-row:last-of-type { border-bottom: 0; }

/* ------------------------------------------------- charts and small parts */

.line-chart { width: 100%; height: 180px; display: block; }
.insight { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.insight:last-of-type { border-bottom: 0; }
.insight strong { display: block; font-size: 12.5px; font-weight: 650; }
.insight small { color: var(--muted); font-size: 11.5px; }
.event-right { display: flex; align-items: center; gap: 8px; }

@media (max-width: 1100px) {
  .thead.team-head, .team-row { grid-template-columns: minmax(0, 1fr) 60px 120px 92px; }
  .team-row .board-col, .thead.team-head .board-col, .team-row .tag:nth-of-type(n+2), .thead.team-head .tag:nth-of-type(n+2) { display: none; }
}

@media (max-width: 860px) {
  .thead.summary-head, .summary-row { grid-template-columns: minmax(0, 1fr) 54px 54px 62px; }
  .summary-row span:nth-child(4), .thead.summary-head span:nth-child(4) { display: none; }
  .donut { flex-basis: 84px; width: 84px; height: 84px; }
  .donut i { width: 60px; height: 60px; }
}

/* Shared elements from the desktop and phone layouts. */
.nav-icon svg, .tab svg, .card-icon svg, .stat-icon svg, .search svg, .alert-btn svg {
  display: block; width: 20px; height: 20px;
}
.rail { background: linear-gradient(150deg, var(--surface), var(--blue-wash)); }
.rail-top { height: 76px; }
.brand strong { font-size: 23px; }
.brand img { width: 32px; height: 32px; }
.rail-nav { gap: 6px; }
.nav-item { min-height: 40px; font-weight: 500; }
.rail-boards { margin-top: 12px; padding-top: 20px; }
.board-item { min-height: 42px; font-weight: 500; }
.search { border-radius: 9px; }
.card { box-shadow: 0 2px 8px rgba(16, 27, 67, .025); }
.stat { grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; row-gap: 5px; padding: 20px; }
.stat-icon { grid-column: 1; grid-row: 1 / 4; width: 42px; height: 42px; border-radius: 14px; }
.stat-icon svg { width: 24px; height: 24px; }
.stat-label, .stat-value, .stat-foot { grid-column: 2; }
.stat-label { color: var(--ink); font-weight: 500; }
.stat-value { font-size: 29px; }
.stat-foot { line-height: 1.65; }
.stat-foot b { display: block; }
.dashboard-stats { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(260px, 340px); }
.ring { width: 92px; height: 92px; flex-basis: 92px; background: conic-gradient(var(--blue) 0%, var(--teal) calc(var(--value) * 1%), var(--line-soft) 0); }
.ring i { width: 67px; height: 67px; font-size: 20px; }
.trend-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.trend-plot { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 6px; }
.trend-y { display: flex; flex-direction: column; justify-content: space-between; color: var(--muted); font-size: 11px; padding-bottom: 1px; }
.trend-bars { height: 170px; background: repeating-linear-gradient(to top, var(--line-soft) 0 1px, transparent 1px 25%); }
.bar-pair i { max-width: 16px; border-radius: 2px 2px 0 0; background: linear-gradient(to top, var(--blue), var(--blue-soft)); }
.bar-pair i.created { background: var(--blue-soft); opacity: .55; }
.trend-axis { padding-left: 36px; }
.focus-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 0 0 15px; }
.focus-tabs button { flex-shrink: 0; border: 1px solid var(--line); padding: 6px 13px; border-radius: 9px; background: var(--surface-2); color: var(--ink-soft); font-size: 12px; }
.focus-tabs button.active { border-color: var(--blue-soft); background: var(--blue-wash); color: var(--blue); }
.focus-card .group { border: 0; border-radius: 0; }
.focus-card .group-head { background: var(--surface-2); border: 1px solid var(--line-soft); padding: 10px; }
.focus-card .group-head > div { display: flex; gap: 16px; align-items: center; }
.task-line { min-height: 54px; }
.task-progress { display: flex; align-items: center; gap: 9px; }
.task-progress .mini-bar { flex: 1; }
.task-progress small { font-size: 11px; color: var(--ink-soft); }
.activity-row { grid-template-columns: 34px minmax(0, 1fr) auto; padding: 12px 0; }
.activity-avatar { position: relative; padding-top: 2px; }
.activity-avatar .avatar { width: 32px; height: 32px; }
.activity-avatar .kind { position: absolute; width: 17px; height: 17px; right: -4px; bottom: -3px; border: 2px solid var(--surface); font-size: 10px; }
.deadline-date { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.deadline-date small { color: var(--red); }
.deadline-date b { font-size: 20px; padding-top: 3px; }
.choice { padding: 4px; background: var(--surface-2); border-radius: 10px; }
.choice button { border-radius: 7px; padding: 9px 17px; }
.choice button.active { background: var(--blue); color: white; }
.scope-board { max-width: 220px; }
@media (max-width: 1300px) {
  .dashboard-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-stats .ring-card { grid-column: 1 / -1; }
  .stat { padding: 15px; gap: 7px; }
  .trend-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .stat-grid, .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 16px 12px; grid-template-columns: 38px minmax(0, 1fr); }
  .stat-icon { width: 36px; height: 36px; }
  .stat-value { font-size: 25px; }
  .stat-label { font-size: 11px; }
  .stat-foot { font-size: 10px; }
  .scope-board { flex: 1 0 100%; max-width: none; }
  .focus-card .group-head > div { display: block; }
  .ring-card { padding: 16px; }
}

[hidden] { display: none !important; }
.section-figures { margin-bottom: 16px; padding: 12px; background: var(--surface); border-radius: var(--radius); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section-figures .stat { padding: 14px; box-shadow: none; }
.section-figures .stat-value { grid-row: 1; }
.section-figures .stat-label { grid-row: 2; }
.section-figures .stat-foot { grid-row: 3; }
.team-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 14px; gap: 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.team-toolbar .search { max-width: 220px; }
.task-row .name { padding-left: calc(var(--depth, 0) * 18px); }
.task-row .tree-spacer, .task-row .tree-toggle { width: 14px; flex-shrink: 0; }
.task-row .check { width: 16px; height: 16px; flex-shrink: 0; border-radius: 4px; }
.task-row { min-height: 78px; }
.task-row .name-copy b, .task-row .name-copy small { white-space: normal; overflow: visible; }
.task-row .name-copy small { margin-top: 4px; line-height: 1.5; }
.thead { background: var(--surface-2); text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink-soft); }
body[data-view="reports"] .columns > div:first-child { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
body[data-view="reports"] .section-figures { grid-column: 1 / -1; margin: 0; }
body[data-view="reports"] .columns > div:first-child > .card:has(.summary-row),
body[data-view="reports"] .columns > div:first-child > .report-note { grid-column: 1 / -1; }
body[data-view="timeline"] .day { display: grid; grid-template-columns: 100px minmax(0, 1fr); column-gap: 20px; position: relative; }
body[data-view="timeline"] .day-label { grid-column: 1; grid-row: 1 / 100; font-size: 12px; color: var(--blue); }
body[data-view="timeline"] .event { grid-column: 2; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0 0 9px; }
body[data-view="timeline"] .day::before { content: ''; position: absolute; left: 108px; top: 18px; bottom: 0; width: 1px; background: var(--blue-soft); }
body[data-view="timeline"] .day::after { content: ''; position: absolute; left: 104px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.board-picker { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; }
.board-picker select { min-width: 180px; color: var(--ink); }
@media (max-width: 1300px) { .section-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  body[data-view="reports"] .columns > div:first-child { grid-template-columns: minmax(0, 1fr); }
  body[data-view="timeline"] .day { display: block; }
  body[data-view="timeline"] .day::before, body[data-view="timeline"] .day::after { display: none; }
  .section-figures { padding: 0; background: transparent; }
  .task-row { padding: 12px; }
}
.desktop-app .dock-callout { display: block; padding: 0; border: 0; background: transparent; }
.desktop-app .dock-callout > img, .desktop-app .dock-callout > div { display: none; }
.desktop-app .dock-callout button { width: 100%; }
.settings-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.settings-nav a { color: var(--blue); padding: 9px 18px; text-decoration: none; border-radius: 8px; font-size: 13px; }
.settings-nav a:hover, .settings-nav a:focus { background: var(--blue-wash); }
.settings-main { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; align-items: start; }
.settings-main > #settings-section-4 { grid-column: 1 / -1; }
.settings-columns .card { scroll-margin-top: 15px; }
.settings-columns .setting-row { align-items: flex-start; }
.settings-columns .setting-copy { min-width: 110px; }
.settings-columns .control { max-width: 55%; flex-wrap: wrap; }
@media(max-width:700px) { .settings-main { grid-template-columns: minmax(0,1fr); } .settings-nav a { padding: 8px; } }

/* Window controls span the workspace and remain at the window edge. */
.app-shell { grid-template-rows: auto minmax(0, 1fr); }
.rail { grid-column: 1; grid-row: 1 / -1; }
.app-shell > .topbar { grid-column: 2 / -1; grid-row: 1; min-width: 0; }
.main { grid-column: 2; grid-row: 2; grid-template-rows: minmax(0, 1fr) auto; }
.detail { grid-column: 3; grid-row: 2; }
body.docked .app-shell > .topbar, body.docked .main { grid-column: 1 / -1; }
@media(max-width: 860px) {
  .app-shell > .topbar, .main { grid-column: 1 / -1; }
  .app-shell.detail-open .detail { top: var(--ao-caption-height, 44px); height: calc(100% - var(--ao-caption-height, 44px)); }
}

/* Archived boards: listed under their own heading, opened read-only. */
.rail-subheading { margin: 14px 0 4px; }
.board-item.archived { color: var(--muted); }
.board-item.archived i { opacity: .45; }
.archived-banner { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-soft); font-size: 13px; }
.board-archived #newItemButton, .board-archived #newCategoryButton, .board-archived #createBoardHere, .board-archived #settingsNewCategory { display: none; }


/* ---------------------------------------------- the task list, narrowing

   The list answers to its own width, not the window's, because the rail and
   the details pane take room from it too. Columns leave in order of how much
   they are missed: category, then owner and board, then the progress bar,
   then status and priority fold to icons, and last priority moves beside the
   title and the due date goes. */
.flat-list { container-type: inline-size; container-name: tasks; }
.thead.task-head, .task-row { grid-template-columns: minmax(0, 1fr) 112px 118px 56px 88px 96px 104px; }
.thead.task-head.wide, .task-row.wide { grid-template-columns: minmax(0, 1fr) 110px 112px 118px 56px 88px 96px 104px; }
.pri-inline { display: none; }

@container tasks (max-width: 920px) {
  .thead.task-head, .task-row { grid-template-columns: minmax(0, 1fr) 112px 118px 56px 88px 96px; }
  .thead.task-head.wide, .task-row.wide { grid-template-columns: minmax(0, 1fr) 110px 112px 118px 56px 88px 96px; }
  .col-category { display: none; }
}
@container tasks (max-width: 800px) {
  .thead.task-head, .task-row, .thead.task-head.wide, .task-row.wide { grid-template-columns: minmax(0, 1fr) 112px 118px 88px 96px; }
  .task-row .assignee, .thead.task-head .assignee, .task-row .board-col, .thead.task-head .board-col { display: none; }
}
@container tasks (max-width: 690px) {
  .thead.task-head, .task-row, .thead.task-head.wide, .task-row.wide { grid-template-columns: minmax(0, 1fr) 112px 40px 88px 96px; }
  .progress-cell .mini-bar { display: none; }
  .progress-cell small { width: auto; }
  .thead.task-head .col-progress { font-size: 0; }
}
@container tasks (max-width: 590px) {
  .thead.task-head, .task-row, .thead.task-head.wide, .task-row.wide { grid-template-columns: minmax(0, 1fr) 30px 40px 72px 26px; }
  .status-text, .pri-text { display: none; }
  .status-pill { padding: 4px; }
  .thead.task-head .col-status, .thead.task-head .col-priority { font-size: 0; }
}
@container tasks (max-width: 470px) {
  .thead.task-head, .task-row, .thead.task-head.wide, .task-row.wide { grid-template-columns: minmax(0, 1fr) 30px 40px; }
  .col-due, .col-priority { display: none; }
  .pri-inline { display: inline-flex; margin-right: 5px; vertical-align: -2px; }
}

.pri { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; color: var(--muted); }
.pri svg, .status-pill svg { flex: 0 0 auto; }
.pri-highest { color: var(--red); }
.pri-high { color: var(--amber); }
.pri-normal { color: var(--muted); }
.pri-low { color: var(--blue); }
.pri-lowest { color: var(--muted); opacity: .75; }

/* The check is a button, so its own padding and line box went round the glyph
   and pushed the tick into the corner. It is drawn as an icon now, centred. */
.check { padding: 0; line-height: 0; flex: 0 0 auto; }
.check svg { width: 13px; height: 13px; }
.check.done { background: var(--green); border-color: var(--green); color: white; }

/* Drawn as one of the buttons beside it, and never squeezed: in a crowded row
   a shrinking label ran its words under the next button. */
.hide-done { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; font-weight: 650; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.hide-done:hover { border-color: var(--blue); }
.hide-done input { position: absolute; opacity: 0; width: 0; height: 0; }
/* The same switch as the settings page, driven by the checkbox under it. */
.hide-done input:checked + .switch { background: var(--blue); }
.hide-done input:checked + .switch::after { left: 21px; }
.hide-done input:focus-visible + .switch { outline: 2px solid var(--blue); outline-offset: 2px; }

/* About, as in shell/chrome.css, which this page does not load. */
.about-app { margin: 0 0 10px; font-size: 14px; font-weight: 650; }
.about-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0 0 14px; font-size: 12.5px; }
.about-facts dt { color: var(--muted); }
.about-facts dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.about-copy { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-soft); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; }
.about-copy:hover { border-color: var(--blue); color: var(--blue); }
