/* Keystone — Aster Operations objectives.
   Product chrome: white canvas, compact top bar, app-style left nav,
   dense goals table. Brand indigo is the only accent; gold lives in the mark. */

:root {
  --brand: #1C1844;
  --brand-accent: #E0B143;
  --brand-ink: #1C1844;
  --indigo: var(--brand);
  --indigo-deep: #120f2e;
  --indigo-soft: #ecebf5;
  --indigo-text: #342e6b;
  --canvas: #fff;
  --panel: #fff;
  --ink: #1f2430;
  --ink-2: #4a5160;
  --muted: #6b7280;
  --faint: #9aa1ad;
  --line: #e4e6ea;
  --line-soft: #eef0f3;
  --row-hover: #f8f9fb;
  --sub-row: #fbfbfc;
  --danger: #b42318;
  --ok: #1a7f4b;
  --ok-bg: #e7f5ec;
  --warn: #9a5b00;
  --warn-bg: #fdf1dc;
  --bad: #b42318;
  --bad-bg: #fde8e6;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: var(--sans);
  --topbar-h: 48px;
  --side-w: 224px;
  --radius: 6px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

/* ───────── motion ─────────
   One timing for the whole product: 180ms ease-out, no bounce. Views fade in
   on route change; the previous view dims (after a short delay) while the next
   one loads so nothing ever flashes blank. */
:root { --ease: cubic-bezier(0.2, 0, 0, 1); --quick: 160ms; --move: 180ms; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes route-sweep { from { background-position: -100vw 0; } to { background-position: 100vw 0; } }
#view { transition: opacity var(--quick) var(--ease); }
#view.is-loading { opacity: 0.6; transition-delay: 220ms; }
#view.view-enter { animation: view-in var(--move) var(--ease) both; }
#view.is-loading::before, #view.is-refreshing::before {
  content: "";
  position: fixed;
  top: var(--topbar-h);
  left: var(--side-w);
  right: 0;
  height: 2px;
  z-index: 11;
  background: linear-gradient(90deg, transparent, var(--indigo) 40%, var(--indigo) 60%, transparent);
  background-repeat: no-repeat;
  animation: route-sweep 1.1s var(--ease) 220ms infinite both;
  pointer-events: none;
}
.panel { animation: view-in var(--move) var(--ease) both; }
.toast { animation: view-in var(--move) var(--ease) both; }
.reset-ask { animation: rise-in var(--move) var(--ease) both; }
.btn, .btn-out, .side a, .branch, .toolbar .table-tools button, .explore th .sort, .backlink, .linklike, .goal-row td, .kr-row td {
  transition: background-color var(--quick) var(--ease), color var(--quick) var(--ease), border-color var(--quick) var(--ease), box-shadow var(--quick) var(--ease);
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--ink);
  font: 400 13px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
::selection { background: var(--indigo-soft); color: var(--indigo); }
h1, h2, h3, p, ul, dl { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img, svg { display: block; }
a { color: var(--indigo-text); }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip {
  position: absolute;
  left: 12px;
  top: 0;
  transform: translateY(-120%);
  background: var(--indigo);
  color: #fff;
  padding: 8px 12px;
  z-index: 40;
  text-decoration: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.skip:focus { transform: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 30;
  max-width: min(440px, calc(100vw - 28px));
  background: #1f2430;
  color: #fff;
  padding: 10px 14px;
  font: 500 13px/1.4 var(--sans);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 20, 30, 0.22);
}
.toast-err { background: #fff; color: var(--danger); border: 1px solid #f1b8b2; }

/* ───────── top bar ───────── */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand-mark { flex: none; width: 24px; height: 24px; border-radius: 5px; overflow: hidden; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-text { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand-name { font: 600 14px/1 var(--sans); letter-spacing: -0.01em; color: var(--ink); }
.brand-company { font: 400 12.5px/1 var(--sans); color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.who-chip { display: inline-flex; align-items: center; gap: 8px; padding: 0 6px; }
.who-avatar {
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  --seat-h: 245;
  background: hsl(var(--seat-h) 42% 90%); color: hsl(var(--seat-h) 45% 30%);
  font: 600 10px/1 var(--sans); letter-spacing: 0.02em;
}
.who-name { font: 500 12.5px/1.3 var(--sans); color: var(--ink-2); white-space: nowrap; }
.btn-out {
  height: 28px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  padding: 0 10px;
  cursor: pointer;
  font: 500 12.5px/1 var(--sans);
  border-radius: var(--radius);
}
.btn-out:hover { background: var(--row-hover); color: var(--ink); }

.reset-ask {
  background: #fffaf0;
  border-bottom: 1px solid #f1deb0;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  font-size: 13px;
}
.reset-ask p { max-width: 70ch; }
.reset-acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ───────── shell: side nav + main ───────── */
.shell { flex: 1; display: flex; min-height: 0; align-items: stretch; animation: view-in var(--move) var(--ease) both; }
/* The gate lives outside the shell: signing in swaps one for the other, so
   nothing that stays on screen moves. */
body:has(#gate:not([hidden])) .shell { display: none; }
.side {
  flex: none;
  width: var(--side-w);
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 12px 10px 16px;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.side-workspace {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  min-width: 0;
}
.side-company-mark {
  display: grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--indigo); color: #fff;
  font: 600 12px/1 var(--sans);
}
.side-company { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.side-company-name { font: 600 13px/1.2 var(--sans); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-cycle { font: 400 11.5px/1.2 var(--sans); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-group { display: flex; flex-direction: column; gap: 1px; }
.side-group:not(:has(a:not([hidden]))) { display: none; }
.side-label {
  font: 600 10.5px/1 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 6px 8px 6px;
}
.side a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius);
  color: var(--ink-2);
  text-decoration: none;
  font: 500 13px/1 var(--sans);
}
.side a svg { color: var(--faint); flex: none; }
.side a:hover { background: var(--row-hover); color: var(--ink); }
.side a[aria-current="page"] { background: var(--indigo-soft); color: var(--indigo); font-weight: 600; }
.side a[aria-current="page"] svg { color: var(--indigo); }

main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.board { flex: 1; width: 100%; padding: 12px 24px 40px; }
.foot { display: none; }

/* Gate: hide the app chrome and center a plain sign-in card. */
body:has(#gate:not([hidden])) { background: #f5f6f8; }
/* The top bar stays in flow on the gate (just invisible) so signing in does
   not shift the whole shell down by its height. */
body:has(#app[hidden]) .topbar { visibility: hidden; background: transparent; border-color: transparent; }
body:has(#gate:not([hidden])) .reset-ask { display: none; }
body:has(#gate:not([hidden])) .foot {
  display: block;
  padding: 0 16px 24px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
  background: #f5f6f8;
}
.gate {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px 16px;
  background: #f5f6f8;
}
.auth {
  width: min(400px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px 26px 22px;
  box-shadow: 0 1px 2px rgba(16, 20, 30, 0.04);
}
.auth-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.auth-brand .brand-mark { width: 22px; height: 22px; }
.gate-h { font: 600 18px/1.25 var(--sans); letter-spacing: -0.01em; margin-bottom: 4px; }
.gate-lede { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; }
.obj-sample { display: none; }

/* ───────── forms & buttons ───────── */
.field { margin-bottom: 12px; }
.field label, .panel label {
  display: block;
  font: 500 12.5px/1.3 var(--sans);
  color: var(--ink-2);
  margin-bottom: 5px;
}
input, textarea, select {
  width: 100%;
  min-height: 34px;
  border: 1px solid #d4d7dd;
  background: #fff;
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 13px;
}
input:hover, textarea:hover, select:hover { border-color: #b8bdc7; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(28, 24, 68, 0.12); }
textarea { resize: vertical; min-height: 84px; }
.field-hint, .hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.form-err { color: var(--danger); font: 500 12.5px/1.4 var(--sans); margin: 4px 0 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--indigo);
  background: var(--indigo);
  color: #fff;
  font: 500 13px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius);
  white-space: nowrap;
}
.btn:hover { background: var(--indigo-deep); border-color: var(--indigo-deep); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-quiet { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-quiet:hover { background: var(--row-hover); color: var(--ink); border-color: #cfd3da; }
.btn-wide { width: 100%; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.demo-slot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.demo-tag { font: 600 11px/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.demo-rows { margin-bottom: 10px; }
.demo-rows div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 12.5px; }
.demo-rows dt { color: var(--muted); }
.demo-rows dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.card-alt { margin-top: 14px; color: var(--muted); font-size: 12.5px; }
.linklike {
  border: 0;
  background: none;
  padding: 0;
  color: var(--indigo-text);
  font: 500 inherit var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ───────── objectives explore ───────── */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  min-height: 32px;
  margin-bottom: 10px;
}
.page-title-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-title { font: 600 18px/1.2 var(--sans); letter-spacing: -0.015em; color: var(--ink); }
.cycle-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px; border-radius: 4px;
  background: var(--indigo-soft); color: var(--indigo);
  font: 600 12px/1 var(--sans); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.cycle-pill-span, .cycle-pill-left { font-weight: 400; color: var(--indigo-text); }
.cycle-pill-span::before, .cycle-pill-left::before { content: "·"; margin-right: 6px; color: var(--faint); }
.page-actions { display: flex; align-items: center; gap: 14px; }

.status-summary {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.status-avg b { font-weight: 600; color: var(--ink); }
.status-bar { display: flex; width: 120px; height: 6px; border-radius: 99px; overflow: hidden; background: #e6e8ec; gap: 1px; }
.status-bar i { display: block; height: 100%; flex: 0 1 auto; min-width: 2px; }
.status-bar .seg-on, .status-bar .seg-done { background: #2f9e62; }
.status-bar .seg-mid { background: #e0a53a; }
.status-bar .seg-off { background: #d9534f; }
.status-bar .seg-empty { background: #c3c7cf; }
.status-legend { display: inline-flex; align-items: center; gap: 12px; }
.status-legend span { display: inline-flex; align-items: center; gap: 5px; }
.status-legend b { font-weight: 600; color: var(--ink); }
.status-legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--faint); }
.status-legend .dot-on, .status-legend .dot-done { background: #2f9e62; }
.status-legend .dot-mid { background: #e0a53a; }
.status-legend .dot-off { background: #d9534f; }
.status-legend .dot-empty { background: #c3c7cf; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.tool-count { margin-left: 8px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.toolbar .table-tools { display: flex; gap: 2px; margin-left: 4px; flex: none; }
.toolbar .table-tools button {
  height: 26px;
  white-space: nowrap;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 500 12px/1 var(--sans);
  border-radius: 4px;
  cursor: pointer;
}
.toolbar .table-tools button:hover { background: var(--row-hover); color: var(--ink); }
.tool { position: relative; display: flex; align-items: center; flex: none; }
.tool-select, .tool-static, .tool-search input {
  min-height: 30px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: 500 12.5px/1 var(--sans);
  width: auto;
}
.tool-select {
  padding-right: 26px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  cursor: pointer;
}
.tool-select:hover, .tool-search input:hover { border-color: #c5c9d1; }
.tool-select:focus-visible, .tool-search input:focus-visible { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(28, 24, 68, 0.1); }
.tool-static { display: inline-flex; align-items: center; color: var(--ink-2); }
.tool-search { flex: 1 1 200px; max-width: 260px; min-width: 140px; margin-left: auto; }
.tool-search input { width: 100%; padding-left: 28px; font-weight: 400; }
.tool-search input::placeholder { color: var(--faint); }
.tool-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.tool-divider { width: 1px; height: 18px; background: var(--line); margin: 0 2px; }
.chip-static { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: var(--radius); background: var(--indigo-soft); color: var(--indigo); font: 500 12px/1 var(--sans); }

.table-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.table-card .empty { border: 0; background: #fff; padding: 36px 24px; max-width: 460px; }

.explore { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.explore th {
  text-align: left;
  font: 500 11.5px/1 var(--sans);
  letter-spacing: 0.01em;
  color: var(--muted);
  padding: 0 12px;
  height: 34px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
  white-space: nowrap;
}
.explore th .sort {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; margin: 0 -6px; padding: 0 6px;
  border: 0; background: transparent; border-radius: 4px; cursor: pointer;
  font: inherit; color: inherit; letter-spacing: inherit;
}
.explore th .sort svg { color: var(--faint); opacity: 0; }
.explore th .sort:hover { background: #eef0f3; color: var(--ink); }
.explore th .sort:hover svg, .explore th.is-sorted .sort svg { opacity: 1; }
.explore th.is-sorted .sort { color: var(--ink); }
.explore th.is-sorted .sort svg { color: var(--indigo); }
.explore th.toggle { width: 32px; padding: 0; }
.explore th.name { padding-left: 2px; }
.explore th.owner { width: 200px; }
.explore th.progress { width: 240px; }
.explore th.status { width: 160px; }
.explore th.due { width: 110px; }
.explore td {
  padding: 0 12px;
  height: 40px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.explore td.toggle { padding: 0; text-align: center; }
.explore td.name { padding-left: 2px; }
.explore tbody tr:last-child td { border-bottom: 0; }
.goal-row:hover td { background: var(--row-hover); }
.explore .cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.goal-glyph { flex: none; color: var(--indigo); opacity: 0.8; }
.goal-row td.name .cell a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.goal-row td.name .cell a:hover { color: var(--indigo); text-decoration: underline; text-underline-offset: 3px; }
.kr-count { color: var(--faint); font-size: 11.5px; flex: none; }
.branch {
  width: 22px; height: 22px; flex: none;
  border: 0; background: transparent; border-radius: 4px; cursor: pointer;
  color: var(--muted);
  display: inline-grid; place-items: center;
  margin: 0 auto;
}
.branch:hover { background: #eceef2; color: var(--ink); }
.branch:disabled { cursor: default; opacity: 0.3; }
.branch:disabled:hover { background: transparent; }
.branch svg { transition: transform var(--move) var(--ease); }
.branch[aria-expanded="true"] svg { transform: rotate(90deg); }
.owner-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; min-width: 0; }
.owner-chip span:last-child { overflow: hidden; text-overflow: ellipsis; }
.seat-initial {
  display: grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  --seat-h: 245;
  background: hsl(var(--seat-h) 42% 90%); color: hsl(var(--seat-h) 45% 30%);
  font: 600 9.5px/1 var(--sans); letter-spacing: 0.02em;
}
.group-row td {
  height: 30px;
  padding: 0 12px;
  background: #f4f5f7;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font: 600 12px/1 var(--sans);
}
.group-row:first-child td { border-top: 0; }
.group-row td::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--faint); margin-right: 8px; vertical-align: 0; }
.group-row.group-on td::before, .group-row.group-done td::before { background: #2f9e62; }
.group-row.group-mid td::before { background: #e0a53a; }
.group-row.group-off td::before { background: #d9534f; }
.group-row.group-empty td::before { background: #c3c7cf; }
.group-name { color: var(--ink); }
.group-meta { margin-left: 10px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.explore td.progress .cell { gap: 10px; }
.explore .meter { flex: 1; height: 4px; background: #e6e8ec; border-radius: 99px; min-width: 80px; overflow: hidden; }
.explore .meter-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--indigo); }
.explore .pct { width: 36px; flex: none; font-variant-numeric: tabular-nums; font-weight: 500; font-size: 12.5px; text-align: right; color: var(--ink); }
.goal-row.pace-on .meter-fill, .goal-row.pace-done .meter-fill { background: #2f9e62; }
.goal-row.pace-mid .meter-fill { background: #e0a53a; }
.goal-row.pace-off .meter-fill { background: #d9534f; }
.goal-row.pace-empty .meter-fill { background: #c3c7cf; }
.pace {
  display: inline-flex; align-items: center; gap: 6px;
  height: 20px; padding: 0 8px; border-radius: 4px;
  font: 500 11.5px/1 var(--sans); white-space: nowrap;
  background: #eef0f3; color: var(--ink-2);
}
.pace::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.pace.pace-on, .pace.pace-done { color: var(--ok); background: var(--ok-bg); }
.pace.pace-mid { color: var(--warn); background: var(--warn-bg); }
.pace.pace-off { color: var(--bad); background: var(--bad-bg); }
.pace.pace-empty { color: var(--muted); background: #eef0f3; }
.explore td.due { color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* Key-result rows ease open and closed: each cell wraps its content in a grid
   whose single row track animates 0fr → 1fr, so the table row's height follows
   without any JavaScript measuring. */
.kr-row td { background: var(--sub-row); height: auto; padding-top: 0; padding-bottom: 0; font-size: 12.5px; color: var(--ink-2); }
.kr-row:hover td { background: #f6f7f9; }
.kr-row .kr-wrap { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--move) var(--ease); }
.kr-row .kr-in { min-height: 0; overflow: hidden; transition: opacity var(--quick) var(--ease); }
.kr-row .kr-line { display: flex; align-items: center; height: 34px; min-width: 0; }
.kr-row .kr-line > * { min-width: 0; flex: 1 1 auto; }
.kr-row.is-collapsed .kr-wrap { grid-template-rows: 0fr; }
.kr-row.is-collapsed .kr-in { opacity: 0; }
.kr-row.is-collapsed td { border-bottom-color: transparent; }
.kr-row td.name { padding-left: 2px; }
.kr-row td.name .cell { gap: 8px; padding-left: 22px; }
.owner-chip-kr { color: var(--muted); font-size: 12px; padding-left: 30px; }
.kr-row td.name .kr-title { overflow: hidden; text-overflow: ellipsis; }
.kr-mark {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  height: 16px; padding: 0 4px; border-radius: 3px;
  font: 600 9.5px/1 var(--sans); letter-spacing: 0.04em; color: var(--muted); background: #e9ebef;
}
.kr-row .meter { height: 4px; }
.kr-row .meter-fill { background: #8f93a3; }
.kr-row .pct { color: var(--ink-2); font-weight: 500; }
.explore .measure { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.measure-now { color: var(--ink); font-weight: 500; }
.measure-arrow { color: var(--faint); }
.explore .meter-fill { transition: none; }

/* ───────── generic content panels: detail page, cycles, company, forms ───────── */
.loading { color: var(--muted); font-size: 13px; padding: 12px 0; }
.empty {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 24px 20px;
  max-width: 560px;
}
.empty h1, .empty h2 { font: 600 15px/1.3 var(--sans); }
.empty p { margin: 6px 0 14px; color: var(--muted); font-size: 13px; max-width: 52ch; }
.backlink { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: 12.5px; text-decoration: none; }
.backlink::before { content: "← "; }
.backlink:hover { color: var(--indigo); }
.obj {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  padding: 18px 20px;
}
.obj h2, .obj h3, .detail-h { font: 600 15px/1.3 var(--sans); letter-spacing: -0.01em; }
.detail-h { font-size: 18px; }
.owner { margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.summary { margin-top: 8px; max-width: 70ch; color: var(--ink-2); }
.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 6px;
  font: 500 12.5px/1.3 var(--sans);
}
.meter-label span:last-child { font-variant-numeric: tabular-nums; }
.meter { height: 6px; background: #e6e8ec; border-radius: 99px; overflow: hidden; }
.meter-fill { display: block; height: 100%; width: 0; background: var(--indigo); border-radius: inherit; transition: width 220ms var(--ease); }
.meter-kr { height: 4px; }
.kr-list { margin-top: 6px; }
.kr + .kr, .checkin + .checkin { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.kr .meter-label { margin-top: 0; }
.measure, .checkin p { color: var(--muted); font-size: 12.5px; }
.checkin-top, .ci-note { color: var(--ink); }
.ci-note { margin-top: 4px; }
.checkins { margin-top: 8px; }
.checkin-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 500; }
.panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.panel h2, .panel h3 { font: 600 13.5px/1.3 var(--sans); margin-bottom: 10px; }
.work { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; max-width: 1100px; }
.work-main { padding: 20px 22px; }
.work-head .detail-h { margin-top: 2px; }
.work-side {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
}
.work-cycle { font: 600 13.5px/1.3 var(--sans); }
.work-state { margin: 2px 0 12px; color: var(--muted); text-transform: capitalize; font-size: 12.5px; }
.work-side .btn, .work-side .acts .btn { width: 100%; }
.work-side .acts { margin-top: 8px; }
.stack { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); align-items: start; margin-top: 14px; }
.stack .obj p { margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.stack .obj .btn { margin-top: 10px; margin-right: 6px; }
.objective-state {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  font: 500 11.5px/1 var(--sans); border-radius: 4px; background: #eef0f3; color: var(--ink-2);
  text-transform: capitalize;
}
.state-complete { background: var(--ok-bg); color: var(--ok); }
.state-empty { background: var(--warn-bg); color: var(--warn); }
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 16px 0 24px; align-items: start; max-width: 1100px; }
.setup-grid .obj { min-width: 0; }
.setup-heading { margin: 20px 0 6px; font: 600 15px/1.3 var(--sans); }
.company-code { overflow-wrap: anywhere; font: 500 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 6px 0; background: #f5f6f8; padding: 6px 8px; border-radius: 4px; }
.obj-form { max-width: 620px; }
#view > p:not([class]) { color: var(--ink-2); max-width: 70ch; margin-top: 6px; }
#view > .detail-h + p, #view > .detail-h + p + .btn { margin-top: 6px; }
#view > .btn { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  #view.is-loading { opacity: 1; }
}

/* ───────── narrow screens ───────── */
@media (max-width: 1100px) {
  .toolbar { flex-wrap: wrap; }
  .explore th.owner { width: 150px; }
  .explore th.progress { width: 160px; }
  .explore th.status { width: 140px; }
  .explore th.due { width: 100px; }
}
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side {
    width: auto;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: visible;
  }
  .side-workspace { display: none; }
  .side-group { display: contents; }
  .side-label { display: none; }
  .side a { min-height: 44px; height: auto; flex: 1 1 auto; padding: 8px; }
  .board { padding: 16px 14px 32px; }
  .work, .setup-grid { grid-template-columns: 1fr; }
  .work-side { position: static; }
  .tool-search { flex: 1 1 100%; margin-left: 0; order: -1; }
  .status-summary { display: none; }
  .tool-count, .toolbar .table-tools { display: none; }
  .page-title-wrap { flex-wrap: wrap; }
  .explore, .explore tbody, .explore tr, .explore td { display: block; }
  .explore thead { display: none; }
  .explore tr { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
  .explore tbody tr:last-child { border-bottom: 0; }
  .explore td { height: auto; padding: 0; border: 0; background: transparent; white-space: normal; overflow: visible; }
  .explore tr.group-row { display: block; padding: 8px 12px; background: #f4f5f7; }
  .goal-row td.toggle { grid-column: 1; grid-row: 1; }
  .goal-row td.name { grid-column: 2 / -1; grid-row: 1; }
  .goal-row td.name .cell a { white-space: normal; }
  .goal-row td.owner { grid-column: 2; grid-row: 2; }
  .goal-row td.status { grid-column: 3; grid-row: 2; justify-self: end; }
  .goal-row td.progress { grid-column: 2 / -1; grid-row: 3; }
  .goal-row td.due { display: none; }
  .kr-row { background: var(--sub-row); }
  .kr-row td.toggle, .kr-row td.owner, .kr-row td.due { display: none; }
  .kr-row td.name { grid-column: 2 / -1; grid-row: 1; }
  .kr-row td.name .cell { padding-left: 0; }
  .kr-row .kr-line { height: auto; min-height: 22px; }
  #view.is-loading::before, #view.is-refreshing::before { left: 0; }
  .kr-row td.progress { grid-column: 2; grid-row: 2; }
  .kr-row td.status { grid-column: 3; grid-row: 2; justify-self: end; }
  .explore .meter { min-width: 0; }
  .who-name { display: none; }
}
