/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
/* Copied verbatim from style_guide.html (tokens + system components).
   App-shell / drawer / folded-column additions are documented in NOTES.md.
   kcard cursor overridden from grab → pointer (board is read-only; see lessons/frontend_style.md).
*/

@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Source+Sans+3:wght@400;600;650&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&display=swap");

/* ============================================================
   1. TOKENS — the contract. Everything else is illustration.
   ============================================================ */
:root {
  /* Surfaces & ink */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #17181c;
  --muted: #5b5f6a;
  --rule: #e1e3e8;

  /* Accent — navy, 12 steps. Never invent a lone brand hex. */
  --accent-1:  #f5f8fc;
  --accent-2:  #e8eef6;
  --accent-3:  #dce8f5;
  --accent-4:  #c5d6ea;
  --accent-5:  #a8c0dc;
  --accent-6:  #87a6cb;
  --accent-7:  #6489b5;
  --accent-8:  #3f6b9a;
  --accent-9:  #1f4e79;
  --accent-10: #1a4368;
  --accent-11: #16385a;
  --accent-12: #0c1f33;
  --accent-contrast: #ffffff;

  /* Status — deliberately outside the accent scale */
  --ok: #15803d;
  --ok-bg: #eaf5ee;
  --warn: #b45309;
  --warn-bg: #fdf3e7;
  --bad: #b42318;
  --bad-bg: #fdeceb;
  --meta: #6b7280;
  --meta-bg: #f1f2f4;

  /* Code */
  --code-bg: #f0eee8;
  --code-ink: inherit;
  --code-border: #e1e3e8;

  /* Type */
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --sans: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* Geometry & rhythm */
  --radius: 2px;
  --pad: 1.1rem;
  --line: 1.55;
  --body-size: 16px;
  --measure: 80ch;

  /* Space scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;

  /* Semantic aliases (Radix Themes roles) */
  --accent-solid: var(--accent-9);
  --accent-solid-hover: var(--accent-10);
  --accent-text: var(--accent-11);
  --accent-text-contrast: var(--accent-12);
  --accent-bg: var(--accent-2);
  --accent-bg-hover: var(--accent-3);
  --accent-border: var(--accent-6);
  --accent-focus: var(--accent-8);

  /* The ONLY shadow in the system. Overlays only. */
  --shadow-overlay: 0 8px 28px rgba(12, 31, 51, 0.16);
}

/* ============================================================
   2. BASE
   ============================================================ */
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: var(--body-size)/var(--line) var(--serif); }
h1, h2, h3, h4, .ui { font-family: var(--sans); font-weight: 650; letter-spacing: -0.01em; }
a { color: var(--accent-text); text-underline-offset: 2px; }
a:hover { color: var(--accent-text-contrast); }
code, pre, .mono { font-family: var(--mono); font-size: 0.88em; }
pre {
  background: var(--code-bg); color: var(--code-ink);
  border: 1px solid var(--code-border); border-left: 3px solid var(--accent-9);
  border-radius: var(--radius); padding: 0.75rem 0.9rem; overflow-x: auto;
  line-height: 1.5;
}
:focus-visible { outline: 2px solid var(--accent-focus); outline-offset: 1px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--sp-6) 0; }


.row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.row--top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); grid-gap: var(--sp-4); gap: var(--sp-4); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); grid-gap: var(--sp-4); gap: var(--sp-4); }
.label-sm {
  font-family: var(--sans); font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted);
}

/* ============================================================
   4. THE SYSTEM — components below are the deliverable
   ============================================================ */

/* --- 4.1 Buttons ------------------------------------------ */
.btn {
  font-family: var(--sans); font-weight: 600; font-size: 0.875rem; line-height: 1;
  padding: 0.5rem 0.85rem; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn--primary { background: var(--accent-9); color: var(--accent-contrast); border-color: var(--accent-9); }
.btn--primary:hover { background: var(--accent-10); border-color: var(--accent-10); }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--rule); }
.btn--secondary:hover { border-color: var(--accent-8); color: var(--accent-text); }
.btn--ghost { background: transparent; color: var(--accent-text); border-color: transparent; }
.btn--ghost:hover { background: var(--accent-2); }
.btn--danger { background: var(--surface); color: var(--bad); border-color: #e6c3bf; }
.btn--danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn--sm { font-size: 0.78rem; padding: 0.3rem 0.55rem; }
.btn--lg { font-size: 0.95rem; padding: 0.62rem 1.1rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn--icon { padding: 0.4rem; }
.btn__spinner {
  width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin 700ms linear infinite; opacity: 0.8;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.btn-group .btn[aria-pressed="true"] { background: var(--accent-2); border-color: var(--accent-8); color: var(--accent-text); z-index: 1; }

/* --- 4.2 Form controls ------------------------------------ */
.field { display: flex; flex-direction: column; gap: 0.3rem; max-width: 34rem; }
.field__label { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; }
.field__hint { font-family: var(--sans); font-size: 0.76rem; color: var(--muted); }
.field__error { font-family: var(--sans); font-size: 0.76rem; color: var(--bad); }
.input, .select, .textarea {
  font: 0.9rem/1.4 var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.45rem 0.55rem; width: 100%;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--accent-6); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent-8); outline: 2px solid var(--accent-8); outline-offset: -1px; }
.input[disabled], .select[disabled] { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.input--invalid, .input--invalid:hover { border-color: var(--bad); }
.textarea { min-height: 5.5rem; resize: vertical; }
.select { -webkit-appearance: none; -moz-appearance: none; appearance: none; padding-right: 1.8rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235b5f6a' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.55rem center; }
.check { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--sans); font-size: 0.86rem; cursor: pointer; }
.check input[type="checkbox"], .check input[type="radio"] {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; width: 15px; height: 15px; margin: 0; border: 1px solid var(--accent-7);
  border-radius: var(--radius); background: var(--surface); display: grid; place-content: center; cursor: pointer;
}
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: var(--accent-9); border-color: var(--accent-9); }
.check input[type="checkbox"]:checked::after {
  content: ""; width: 8px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(0.5px, -1px);
}
.check input[type="radio"]:checked::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.switch { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--sans); font-size: 0.86rem; cursor: pointer; }
.switch input { -webkit-appearance: none; -moz-appearance: none; appearance: none; margin: 0; width: 34px; height: 18px; background: #cdd1d8;
  border-radius: var(--radius); position: relative; cursor: pointer; transition: background-color 120ms ease; }
.switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  background: #fff; border-radius: 1px; transition: transform 120ms ease;
}
.switch input:checked { background: var(--accent-9); }
.switch input:checked::after { transform: translateX(16px); }
.searchbox { display: flex; align-items: center; gap: 0.4rem; border: 1px solid var(--rule);
  border-radius: var(--radius); background: var(--surface); padding: 0 0.5rem; max-width: 22rem; }
.searchbox:focus-within { border-color: var(--accent-8); outline: 2px solid var(--accent-8); outline-offset: -1px; }
.searchbox input { border: 0; outline: 0; padding: 0.45rem 0; font: 0.9rem var(--sans); width: 100%; background: transparent; }

/* --- 4.3 Tags, status, meta ------------------------------- */
.tag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--sans); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.16rem 0.4rem; border-radius: var(--radius);
  border: 1px solid var(--rule); background: var(--meta-bg); color: var(--muted);
  white-space: nowrap;
}
.tag--accent { background: var(--accent-2); border-color: var(--accent-6); color: var(--accent-11); }
.tag--solid  { background: var(--accent-9); border-color: var(--accent-9); color: var(--accent-contrast); }
.tag--ok     { background: var(--ok-bg); border-color: #b9dcc6; color: var(--ok); }
.tag--warn   { background: var(--warn-bg); border-color: #ecc9a0; color: var(--warn); }
.tag--bad    { background: var(--bad-bg); border-color: #e8bab6; color: var(--bad); }
.tag--quiet  { background: transparent; }
.dot { width: 6px; height: 6px; border-radius: 1px; background: currentColor; flex: none; }
.dot--live { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.prio { font-family: var(--sans); font-size: 0.72rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); }
.prio__bars { display: inline-flex; gap: 1px; }
.prio__bars i { width: 3px; height: 9px; background: var(--rule); display: block; }
.prio--p1 i:nth-child(-n+3) { background: var(--bad); }
.prio--p2 i:nth-child(-n+2) { background: var(--warn); }
.prio--p3 i:nth-child(-n+1) { background: var(--meta); }

.id { font-family: var(--mono); font-size: 0.78rem; color: var(--accent-8); }
.ts { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.avatar {
  width: 24px; height: 24px; border-radius: var(--radius); background: var(--accent-3);
  color: var(--accent-11); font-family: var(--sans); font-size: 0.68rem; font-weight: 650;
  display: inline-grid; place-content: center; flex: none; border: 1px solid var(--accent-4);
}
.avatar--bot { background: var(--accent-9); color: #fff; border-color: var(--accent-9); }
.kv { display: grid; grid-template-columns: max-content 1fr; grid-gap: 0.3rem 0.9rem; gap: 0.3rem 0.9rem; font-size: 0.86rem; }
.kv dt { font-family: var(--sans); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding-top: 0.15rem; }
.kv dd { margin: 0; }

/* --- 4.4 Table -------------------------------------------- */
.table-wrap { border: 1px solid var(--rule); background: var(--surface); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data thead th {
  font-family: var(--sans); font-size: 0.68rem; font-weight: 650; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted); text-align: left; padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--rule); background: var(--accent-1); white-space: nowrap; position: -webkit-sticky; position: sticky; top: 0;
}
table.data thead th[aria-sort] { cursor: pointer; }
table.data thead th[aria-sort="ascending"]::after { content: " ▲"; font-size: 0.6rem; color: var(--accent-8); }
table.data thead th[aria-sort="descending"]::after { content: " ▼"; font-size: 0.6rem; color: var(--accent-8); }
table.data tbody td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--accent-1); }
table.data tbody tr[aria-selected="true"] td { background: var(--accent-2); }
table.data tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--accent-9); }
table.data .num { text-align: right; font-family: var(--mono); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
table.data--dense tbody td, table.data--dense thead th { padding: 0.3rem 0.6rem; }
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--rule); background: var(--surface); flex-wrap: wrap;
}
.table-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: 0.45rem 0.75rem; border-top: 1px solid var(--rule); font-family: var(--sans);
  font-size: 0.78rem; color: var(--muted);
}
.pager { display: inline-flex; }
.pager button {
  font: 0.78rem var(--sans); border: 1px solid var(--rule); background: var(--surface); color: var(--muted);
  padding: 0.2rem 0.5rem; margin-left: -1px; cursor: pointer;
}
.pager button:first-child { border-radius: var(--radius) 0 0 var(--radius); margin-left: 0; }
.pager button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.pager button[aria-current="page"] { background: var(--accent-2); border-color: var(--accent-8); color: var(--accent-11); font-weight: 600; z-index: 1; position: relative; }

/* --- 4.5 Cards -------------------------------------------- */
/* Kanban card: dense, one glance, status carried by the left edge */
.kcard {
  background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--meta);
  border-radius: var(--radius); padding: 0.6rem 0.7rem; display: block; text-decoration: none; color: inherit;
  cursor: pointer;
  /* Cards are <button>s — UA stylesheet centres button text; guide wants left. */
  text-align: left;
  font: inherit;
  width: 100%;
}
.kcard:hover { border-color: var(--accent-6); border-left-color: inherit; background: var(--accent-1); }
.kcard--running { border-left-color: var(--accent-9); }
.kcard--review  { border-left-color: var(--warn); }
.kcard--failed  { border-left-color: var(--bad); }
.kcard--done    { border-left-color: var(--ok); }
.kcard__top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.3rem; }
.kcard__title { font-family: var(--sans); font-weight: 600; font-size: 0.9rem; line-height: 1.3; margin: 0 0 0.4rem; }
.kcard__meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.kcard__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  margin-top: 0.5rem; padding-top: 0.4rem; border-top: 1px solid var(--rule);
}
/* Project chip on card foot — style guide has no project-chip pattern yet. */
.tag--project {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: none;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag--project-0 { background: var(--accent-2); border-color: var(--accent-6); color: var(--accent-11); }
.tag--project-1 { background: var(--ok-bg); border-color: #b9dcc6; color: var(--ok); }
.tag--project-2 { background: var(--warn-bg); border-color: #ecc9a0; color: var(--warn); }
.tag--project-3 { background: var(--meta-bg); border-color: var(--rule); color: var(--meta); }
.kcard__cursor {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--accent-11);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.kcard__cursor:hover { border-bottom-color: var(--accent-8); }
.kcard__create {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--accent-11);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.kcard__create:hover { border-bottom-color: var(--accent-8); }
.kcard__create:disabled,
.kcard__create.is-pending {
  opacity: 0.55;
  cursor: wait;
  border-bottom-color: transparent;
}
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); grid-gap: var(--sp-3); gap: var(--sp-3); align-items: start; }
.kcol { background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius); }
.kcol__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rule); background: var(--surface);
}
.kcol__name { font-family: var(--sans); font-size: 0.72rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; }
.kcol__count { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.kcol__body { padding: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; min-height: 4rem; }
.kcol__drop { border: 1px dashed var(--accent-6); background: var(--accent-1); border-radius: var(--radius); height: 2.2rem; }

/* Grid card: the browse/detail unit */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); display: flex; flex-direction: column; }
.card:hover { border-color: var(--accent-6); }
.card__head { padding: 0.7rem 0.85rem 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.card__title { font-family: var(--sans); font-size: 1rem; font-weight: 650; margin: 0; line-height: 1.25; }
.card__sub { font-family: var(--sans); font-size: 0.76rem; color: var(--muted); margin: 0.15rem 0 0; }
.card__body { padding: 0.6rem 0.85rem; font-size: 0.9rem; flex: 1 1; }
.card__body p { margin: 0 0 0.6rem; max-width: none; }
.card__foot {
  padding: 0.5rem 0.85rem; border-top: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
}
.card--flagged { border-left: 3px solid var(--warn); }

/* --- 4.6 Metric tile & meter ------------------------------ */
.tile { border: 1px solid var(--rule); background: var(--surface); border-radius: var(--radius); padding: 0.75rem 0.85rem; }
.tile__label { font-family: var(--sans); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.tile__value { font-family: var(--sans); font-size: 1.75rem; font-weight: 650; line-height: 1.1; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; margin: 0.15rem 0; }
.tile__delta { font-family: var(--sans); font-size: 0.76rem; color: var(--muted); }
.tile__delta--up { color: var(--ok); }
.tile__delta--down { color: var(--bad); }
.meter { height: 6px; background: var(--accent-2); border-radius: 0; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent-9); }
.meter--warn > span { background: var(--warn); }
.meter--bad > span { background: var(--bad); }
.meter-row { display: grid; grid-template-columns: 1fr max-content; grid-gap: 0.35rem 0.75rem; gap: 0.35rem 0.75rem; align-items: center; font-family: var(--sans); font-size: 0.78rem; }

/* --- 4.7 Navigation --------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  background: var(--accent-12); color: #e8eef6; padding: 0.5rem 0.85rem;
}
.topbar__brand { font-family: var(--sans); font-weight: 650; font-size: 0.92rem; letter-spacing: -0.01em; color: #fff; }
.topbar__brand span { color: var(--accent-5); font-weight: 400; }
.topbar__right { display: flex; align-items: center; gap: 0.75rem; font-family: var(--sans); font-size: 0.8rem; }
.sidenav { background: var(--surface); border: 1px solid var(--rule); padding: 0.4rem; font-family: var(--sans); font-size: 0.85rem; max-width: 15rem; }
.sidenav__group { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 0.5rem 0.5rem 0.25rem; }
.sidenav a {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.34rem 0.5rem; color: var(--ink); text-decoration: none;
  border-left: 2px solid transparent; border-radius: 0;
}
.sidenav a:hover { background: var(--accent-1); }
.sidenav a[aria-current="page"] { background: var(--accent-2); border-left-color: var(--accent-9); color: var(--accent-11); font-weight: 600; }
.sidenav .count { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--rule); font-family: var(--sans); }
.tabs button {
  background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  padding: 0.45rem 0.75rem; font-size: 0.86rem; font-weight: 600; color: var(--muted);
}
.tabs button:hover { color: var(--accent-text); }
.tabs button[aria-selected="true"] { color: var(--accent-11); border-bottom-color: var(--accent-9); }
.tabpanel { padding: var(--sp-4) 0 0; }
.crumbs { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); display: flex; gap: 0.4rem; flex-wrap: wrap; }
.crumbs a { text-decoration: none; }
.crumbs span[aria-current] { color: var(--ink); font-weight: 600; }
.pagehead {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4);
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--rule); flex-wrap: wrap;
}
.pagehead h1 { font-size: 1.35rem; margin: 0.2rem 0 0.25rem; }

/* --- 4.8 Feedback ----------------------------------------- */
.callout {
  border: 1px solid var(--rule); border-left: 3px solid var(--accent-9);
  background: var(--accent-2); padding: 0.7rem 0.85rem; border-radius: var(--radius); font-size: 0.92rem;
}
.callout--warn { background: var(--warn-bg); border-left-color: var(--warn); border-color: #ecc9a0; }
.callout--bad { background: var(--bad-bg); border-left-color: var(--bad); border-color: #e8bab6; }
.callout--ok { background: var(--ok-bg); border-left-color: var(--ok); border-color: #b9dcc6; }
.callout__title { font-family: var(--sans); font-weight: 650; font-size: 0.85rem; margin: 0 0 0.2rem; }
.callout p { margin: 0; max-width: none; }
.toast {
  display: flex; align-items: flex-start; gap: 0.6rem; background: var(--surface);
  border: 1px solid var(--rule); border-left: 3px solid var(--accent-9); border-radius: var(--radius);
  box-shadow: var(--shadow-overlay); padding: 0.6rem 0.75rem; max-width: 26rem; font-size: 0.88rem;
}
.toast--bad { border-left-color: var(--bad); }
.toast__body { flex: 1 1; }
.toast__title { font-family: var(--sans); font-weight: 650; font-size: 0.85rem; }
.toast-stack { position: fixed; right: var(--sp-4); bottom: var(--sp-4); display: flex; flex-direction: column; gap: 0.5rem; z-index: 60; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(12, 31, 51, 0.38); display: grid; place-items: center; z-index: 50; padding: var(--sp-4); }
.modal {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow-overlay); width: min(30rem, 100%);
}
.modal__head { padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--rule); font-family: var(--sans); font-weight: 650; }
.modal__body { padding: var(--pad); font-size: 0.92rem; }
.modal__body p { max-width: none; margin: 0 0 0.7rem; }
.modal__foot { padding: 0.65rem 0.9rem; border-top: 1px solid var(--rule); display: flex; justify-content: flex-end; gap: 0.5rem; }
.menu { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow-overlay); padding: 0.25rem; min-width: 12rem; font-family: var(--sans); font-size: 0.85rem; }
.menu button { display: flex; width: 100%; text-align: left; gap: 0.5rem; background: transparent; border: 0; padding: 0.35rem 0.5rem; cursor: pointer; color: var(--ink); font: inherit; }
.menu button:hover { background: var(--accent-2); }
.menu hr { margin: 0.25rem 0; }
.menu .danger { color: var(--bad); }

/* --- 4.9 Async & empty ------------------------------------ */
.skel { background: var(--accent-2); border-radius: var(--radius); animation: fade 1.4s ease-in-out infinite; }
@keyframes fade { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.empty { border: 1px dashed var(--rule); background: var(--surface); padding: var(--sp-6) var(--sp-4); text-align: center; border-radius: var(--radius); }
.empty__title { font-family: var(--sans); font-weight: 650; font-size: 0.95rem; margin: 0 0 0.25rem; }
.empty p { color: var(--muted); font-size: 0.9rem; margin: 0 auto 0.9rem; max-width: 42ch; }

/* --- 4.10 Domain patterns --------------------------------- */
.feed { font-family: var(--sans); font-size: 0.84rem; border-left: 1px solid var(--rule); margin-left: 0.45rem; }
.feed__item { position: relative; padding: 0.3rem 0 0.3rem 1rem; }
.feed__item::before {
  content: ""; position: absolute; left: -3px; top: 0.7rem; width: 5px; height: 5px;
  background: var(--accent-6); border-radius: 1px;
}
.feed__item--now::before { background: var(--accent-9); }
.feed__item--bad::before { background: var(--bad); }
.feed__kind { font-family: var(--mono); font-size: 0.68rem; color: var(--accent-8); text-transform: uppercase; letter-spacing: 0.05em; }
.feed__text { color: var(--ink); }
.feed__text--muted { color: var(--muted); }
.linkrow {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.4rem 0.6rem;
  font-family: var(--sans); font-size: 0.84rem; background: var(--surface);
}
.linkrow + .linkrow { margin-top: -1px; }
.linkrow--stale { background: var(--bg); color: var(--muted); }
.diffstat { font-family: var(--mono); font-size: 0.75rem; }
.diffstat .add { color: var(--ok); }
.diffstat .del { color: var(--bad); }

@media (max-width: 1020px) {
  .shell { grid-template-columns: 1fr; }
  .toc { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--rule); }
  main { padding: var(--sp-5) var(--sp-4) 4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}



/* ============================================================
   APP SHELL + DRAWER (not yet in style_guide.html — see NOTES.md)
   ============================================================ */
html, body { height: 100%; }
body { font-family: var(--serif); }

.app-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100dvh;
}
.app-shell__body {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  min-height: 0;
}
.app-shell__nav {
  border-right: 1px solid var(--rule);
  background: var(--surface);
  overflow-y: auto;
  padding: var(--sp-3) var(--sp-2);
}
.app-shell__nav .sidenav {
  border: 0;
  max-width: none;
  padding: 0;
}
.app-shell__main {
  min-width: 0;
  overflow: auto;
  padding: var(--sp-4) var(--sp-5) var(--sp-6);
  background: var(--bg);
}
.topbar { position: -webkit-sticky; position: sticky; top: 0; z-index: 30; }
.topbar__fleet { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; color: var(--accent-5); }
.topbar__status { font-size: 0.75rem; color: var(--accent-6); }
.topbar__status.is-reconnect { color: var(--warn); }

.board-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); margin-bottom: var(--sp-4); flex-wrap: wrap;
}
.board-toolbar .pagehead { border-bottom: 0; padding-bottom: 0; flex: 1 1; }

.unroutable-banner {
  margin-bottom: var(--sp-4);
}

.kcard__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kcard.is-selected {
  border-color: var(--accent-8);
  background: var(--accent-1);
}
.kcard:focus-visible { outline: 2px solid var(--accent-focus); outline-offset: 1px; }

/* Folded column — needs style guide entry */
.kcol--folded .kcol__body { display: none; }
.kcol__head--foldable { cursor: pointer; width: 100%; border: 0; background: var(--surface); text-align: left; }
.kcol__head--foldable:hover { background: var(--accent-1); }

/* Specificity over .kanban; folded tracks use a smaller fr so they stay narrow
   (equal 1fr on all six collapses to six identical columns once mins are met). */
.kanban.kanban--board {
  grid-template-columns: repeat(4, minmax(220px, 1fr)) repeat(2, minmax(140px, 0.45fr));
  overflow-x: auto;
  padding-bottom: var(--sp-2);
}
.kcol--folded { min-width: 140px; }

/* Detail drawer */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(12, 31, 51, 0.38);
  z-index: 40;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(34rem, 100%);
  background: var(--surface);
  border-left: 1px solid var(--rule);
  box-shadow: var(--shadow-overlay);
  z-index: 45;
  display: flex; flex-direction: column;
  min-height: 0;
}
.drawer__head {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 0.5rem;
  flex: none;
}
.drawer__head-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem;
}
.drawer__title {
  font-family: var(--sans); font-size: 1.05rem; font-weight: 650;
  margin: 0.15rem 0 0; line-height: 1.3;
}
.drawer__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.drawer__body {
  flex: 1 1; min-height: 0; overflow-y: auto;
  padding: 0.75rem 0.9rem var(--sp-6);
}
.drawer__links { display: flex; flex-direction: column; margin-bottom: var(--sp-4); }
.drawer__feedback {
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--rule);
  background: var(--bg);
  border-radius: var(--radius);
}
.prose-summary {
  font-family: var(--serif); font-size: 1.02rem; line-height: 1.6;
  max-width: var(--measure); margin: 0 0 var(--sp-4);
}
.md-body {
  font-size: 0.92rem; max-width: var(--measure);
}
.md-body pre {
  background: var(--code-bg); border: 1px solid var(--code-border);
  border-left: 3px solid var(--accent-9); border-radius: var(--radius);
  padding: 0.75rem 0.9rem; overflow-x: auto;
}
.md-body code { font-family: var(--mono); font-size: 0.88em; }
.md-body p { margin: 0 0 0.7rem; }
.md-body ul { margin: 0 0 0.7rem; padding-left: 1.3rem; }

.origin-human {
  font-family: var(--sans); font-size: 0.7rem; font-weight: 650;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--warn);
}

.feed-scroll {
  max-height: min(55dvh, 28rem);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.placeholder-page {
  max-width: 40rem;
}
.placeholder-page h1 { font-size: 1.35rem; margin: 0 0 0.4rem; }
.placeholder-page p { color: var(--muted); margin: 0; }

.btn.is-pending { opacity: 0.7; pointer-events: none; }

@media (max-width: 1020px) {
  .app-shell__body { grid-template-columns: 1fr; }
  .app-shell__nav { display: none; }
  .drawer { width: 100%; }
  .kanban.kanban--board {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}


