/* Prokura design tokens and base components. The app imports the same file. */
@font-face { font-family: "Plex"; src: url("fonts/plex-sans-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-sans-latin-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-sans-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #16181b;
  --ink-2: #4b5058;
  --ink-3: #868b93;
  --rule: #e4e1da;
  --rule-strong: #cdc9bf;
  --focus: #1d3f66;
  --pos: #2e6a4c;
  --neg: #9b3a30;
  --warn: #8c5a12;
  --ai: #9a6b12;          /* unconfirmed: written by the assistant */
  --ai-soft: #f6ecd6;
  --change: #fff1b8;      /* a value that just changed */
  --select: #e9eef4;
  --shadow: 0 1px 0 rgba(20, 20, 20, .04), 0 1px 2px rgba(20, 20, 20, .05);
  --radius: 4px;
  --font: "Plex", "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1012; --surface: #16181b; --surface-2: #131517; --ink: #e9e7e2; --ink-2: #aeb2b8; --ink-3: #757a82;
    --rule: #25282c; --rule-strong: #353a40; --focus: #8fb3dc; --pos: #79c39c; --neg: #e48f82; --warn: #e0a85a;
    --ai: #dcae55; --ai-soft: #2b2416; --change: #3a3313; --select: #1e2630;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1012; --surface: #16181b; --surface-2: #131517; --ink: #e9e7e2; --ink-2: #aeb2b8; --ink-3: #757a82;
  --rule: #25282c; --rule-strong: #353a40; --focus: #8fb3dc; --pos: #79c39c; --neg: #e48f82; --warn: #e0a85a;
  --ai: #dcae55; --ai-soft: #2b2416; --change: #3a3313; --select: #1e2630;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 13px; line-height: 1.45;
  font-variant-numeric: tabular-nums lining-nums; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.005em; }
h1 { font-size: 20px; line-height: 1.25; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-weight: 600; }
h3 { font-size: 14px; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sub { color: var(--ink-2); }
.small { font-size: 12px; }
.tiny { font-size: 11px; letter-spacing: .01em; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; height: 48px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--rule); }
.mark { font-weight: 600; letter-spacing: .14em; font-size: 12px; text-transform: uppercase; }
.mark i { display: inline-block; width: 7px; height: 7px; background: var(--ink); margin-right: 8px; vertical-align: 1px; }
.nav { display: flex; gap: 2px; height: 100%; }
.nav a { display: flex; align-items: center; padding: 0 10px; color: var(--ink-2); border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.nav .count { margin-left: 6px; font-size: 11px; color: var(--ai); }
.bar .right { margin-left: auto; display: flex; align-items: center; gap: 16px; color: var(--ink-2); }
.trust { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.trust svg { width: 12px; height: 12px; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); display: inline-block; }
.dot.wait { background: var(--ink-3); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--select); color: var(--ink); display: grid; place-items: center; font-size: 11px; font-weight: 600; }

.page { max-width: 1360px; margin: 0 auto; padding: 20px 20px 48px; }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.head .actions { margin-left: auto; display: flex; gap: 8px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--rule-strong);
  border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.big { height: 38px; padding: 0 18px; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; }
.seg a { padding: 0 10px; height: 28px; display: flex; align-items: center; color: var(--ink-2); }
.seg a.on { background: var(--select); color: var(--ink); font-weight: 500; }

/* panels */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.panel > header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.panel > header .actions { margin-left: auto; }
.panel .body { padding: 12px 14px; }

/* unconfirmed and sources */
.ai { position: relative; }
.ai::before { content: ""; display: inline-block; width: 6px; height: 6px; transform: rotate(45deg); background: var(--ai);
  margin-right: 6px; vertical-align: 1px; }
.ai-u { text-decoration: underline dotted var(--ai); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.src { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.src:hover { color: var(--ink); }
.src::before { content: "↗ "; opacity: .7; }
.chg { background: var(--change); border-radius: 2px; box-shadow: 0 0 0 2px var(--change); }
.tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 3px; font-size: 11px; font-weight: 500;
  border: 1px solid var(--rule-strong); color: var(--ink-2); white-space: nowrap; }
.tag.ai-tag { border-color: transparent; background: var(--ai-soft); color: var(--ai); }
.tag.due { border-color: transparent; background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.tag.pos { border-color: transparent; background: color-mix(in srgb, var(--pos) 14%, transparent); color: var(--pos); }

/* tables */
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  padding: 6px 10px; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
table.grid td { padding: 7px 10px; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
table.grid th.num, table.grid td.num { text-align: right; }
table.grid tr.calc td { color: var(--ink-2); }
table.grid tr:last-child td { border-bottom: 0; }
.formula { font-size: 11px; color: var(--ink-3); }

dl.memo { display: grid; grid-template-columns: 180px 1fr; margin: 0; }
dl.memo dt { padding: 12px 0; color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; border-top: 1px solid var(--rule); }
dl.memo dd { margin: 0; padding: 10px 0 12px; border-top: 1px solid var(--rule); }
dl.memo dd .meta { display: block; margin-top: 3px; }

.progress { height: 3px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--ink); }

/* board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(196px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { min-width: 0; }
.col > header { display: flex; align-items: baseline; gap: 6px; padding: 0 2px 8px; border-bottom: 2px solid var(--ink); margin-bottom: 8px; }
.col > header .n { color: var(--ink-3); }
.col > header .sum { margin-left: auto; font-size: 11px; color: var(--ink-3); }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 11px; margin-bottom: 8px; box-shadow: var(--shadow); }
.card .name { font-weight: 600; font-size: 13px; }
.card .where { color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.card .figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 9px 0 8px; padding: 7px 0 0; border-top: 1px solid var(--rule); }
.card .figs div { text-align: right; }
.card .figs span { display: block; font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.card .figs b { font-weight: 500; font-size: 13px; }
.card .foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 11px; color: var(--ink-3); }
.card.moved { outline: 2px solid var(--change); }

/* lifecycle */
.life { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.life div { padding: 7px 10px 6px; border-top: 3px solid var(--rule-strong); color: var(--ink-3); font-size: 12px; }
.life div b { display: block; color: var(--ink-3); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.life div.done { border-top-color: var(--ink); color: var(--ink-2); }
.life div.now { border-top-color: var(--ink); color: var(--ink); }
.life div.now b, .life div.done b { color: var(--ink); }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 7px 0; border-top: 1px solid var(--rule); font-size: 12px; }
.feed li:first-child { border-top: 0; }
.feed time { color: var(--ink-3); }
.who { font-weight: 500; }
.who.claude { color: var(--ai); }

.pop { position: absolute; z-index: 10; width: 300px; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 12px 14px; font-size: 12px; }
.pop dl { display: grid; grid-template-columns: 70px 1fr; gap: 4px 8px; margin: 8px 0 10px; }
.pop dt { color: var(--ink-3); }
.pop dd { margin: 0; }

.check { color: var(--pos); font-weight: 600; }
.cross { color: var(--neg); font-weight: 600; }

@media (max-width: 760px) {
  .bar { gap: 12px; padding: 0 16px; }
  .bar .nav { display: none; }
  .bar .trust span, .bar .conn span { display: none; }
  .page { padding: 16px 16px 40px; }
  dl.memo { grid-template-columns: 1fr; }
  dl.memo dt { padding-bottom: 0; }
  dl.memo dd { border-top: 0; padding-top: 4px; }
  .board { grid-auto-flow: row; grid-auto-columns: auto; }
  .mnav { display: flex !important; }
}
.mnav { display: none; gap: 4px; overflow-x: auto; padding: 8px 16px; border-bottom: 1px solid var(--rule); background: var(--surface); }
.mnav a { padding: 4px 10px; border-radius: 999px; color: var(--ink-2); white-space: nowrap; font-size: 12px; }
.mnav a.on { background: var(--select); color: var(--ink); font-weight: 500; }
