/* Southwest Day / Twilight / Night token system, ported from
   PinonPMCore/web/index.html (docs/THEME.md). Day is :root; Twilight and
   Night are full token sets, not inversions of Day. Shared across every
   page -- keep page-specific styles (tables, board, chips) local to the
   page instead of adding them here. */
:root {
  --ink: #141210;
  --paper: #f3eee4;
  --panel: #fffcf6;
  --line: #d2cbbd;
  --muted: #5a544b;
  --sage: #2f5a43;
  --resin: #b4531e;
  --turquoise: #2f8a86;
  --font-ui: "Source Sans 3", "Plex Sans UI", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Source Serif 4", ui-serif, Georgia, serif;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --text-page: 1.15rem;
  --text-section: .95rem;
  --text-sub: .9rem;
}
.claim-chip {
  display: inline-block; font-size: .75rem; padding: 1px var(--space-2); border-radius: 999px;
  border: 1px solid var(--line); white-space: nowrap;
}
.claim-chip.live { color: var(--turquoise); border-color: var(--turquoise); }
.claim-chip.stale { color: var(--resin); border-color: var(--resin); }
.claim-chip .claim-age { opacity: .8; }
.claim-none { color: var(--muted); }
.claim-chip.live .claim-status { font-weight: 650; }
@keyframes claim-working-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--turquoise) 50%, transparent); }
  50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--turquoise) 28%, transparent); }
}
.claim-chip.live { animation: claim-working-pulse 1.6s ease-in-out infinite; }
.claim-chip.here { color: var(--ink); border-color: var(--line); }
.claim-live-bar {
  font-size: .85rem; color: var(--turquoise); border: 1px solid var(--turquoise);
  border-radius: 4px; padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3);
}
html[data-theme="twilight"] {
  --paper: #3d2f47;
  --panel: #4a3a52;
  --ink: #f0e3dc;
  --line: #746078;
  --muted: #c9b6bf;
  --sage: #8fbf9a;
  --resin: #f09460;
  --turquoise: #62c6bf;
}
html[data-theme="night"] {
  --paper: #17151d;
  --panel: #1e1c26;
  --ink: #ece6df;
  --line: #423e50;
  --muted: #8b8590;
  --sage: #6ea882;
  --resin: #d47a48;
  --turquoise: #3ecfc4;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper);
}
header {
  display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap;
  padding: var(--space-3) var(--space-4); background: var(--panel); color: var(--ink);
  border-bottom: 1px solid var(--line);
}
header h1 { font-family: var(--font-display); font-size: var(--text-page); margin: 0; font-weight: 600; color: var(--sage); }
header a.navlink { font-size: .8rem; color: var(--turquoise); text-decoration: none; }
header a.navlink:hover { text-decoration: underline; }
header a.navlink.gear {
  display: inline-flex; align-items: center; color: var(--ink);
}
header a.navlink.gear svg { width: 1.25rem; height: 1.25rem; }
header a.navlink.gear:hover { color: var(--turquoise); text-decoration: none; }
header .tag { font-size: .75rem; color: var(--muted); }
header .tag.clickable { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; margin-left: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
header .context {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  flex: 0 1 14rem; min-width: 12rem;
}
header .context select {
  background: transparent; border: none; padding: 0; max-width: 28rem;
  cursor: pointer; font-family: var(--font-ui);
}
header .context #orgSelect {
  font-family: var(--font-display); font-size: var(--text-page); font-weight: 600;
  color: var(--sage);
}
header .context #projectSelect {
  font-size: .95rem; color: var(--muted); font-weight: 500;
}
header a.gear {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); text-decoration: none;
  width: 2rem; height: 2rem; border-radius: 4px;
  font-size: 1.25rem; line-height: 1;
}
header a.gear:hover { color: var(--ink); background: var(--paper); }
header .consult {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  flex: 1 1 16rem; min-width: 12rem;
}
header .consult[hidden] { display: none; }
header .consult select, header .consult input {
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px;
  padding: var(--space-1) var(--space-2);
}
header .consult #consultRole { max-width: 12rem; }
header .consult #consultQuestion { flex: 1 1 10rem; min-width: 8rem; }
header .consult details { font-size: .75rem; color: var(--muted); }
header .consult details summary { cursor: pointer; }
#consultStatus, #consultAnswer { width: 100%; }
#consultAnswer {
  white-space: pre-wrap; font-size: .88rem; margin: 0 var(--space-4);
}
/* View selector lives in the existing header, not a second sticky nav.
   Look stolen from the public shell's #shellNav: text links, ink, no
   underline until active. */
#viewSelector {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center;
}
#viewSelector a {
  color: var(--ink); font-size: .85rem; text-decoration: none;
  border-bottom: 2px solid transparent; padding-bottom: 2px;
}
#viewSelector a.active { font-weight: 650; color: var(--ink); border-bottom-color: var(--resin); }
#themeMode {
  font-family: var(--font-ui); font-size: .85rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: var(--space-1) var(--space-2);
}
main { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); max-width: min(96rem, 96vw); margin: 0 auto; }
main.narrow { max-width: 34rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: var(--space-4); }
.panel h2 { font-family: var(--font-display); font-size: var(--text-section); margin: 0 0 var(--space-3); color: var(--ink); }
.panel.collapsed { display: none; }
.row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: var(--space-2); }
label { font-size: .8rem; color: var(--muted); }
input, select, textarea {
  font-family: var(--font-ui); font-size: .9rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 4px; padding: var(--space-1) var(--space-2);
}
input[type=text], input[type=password] { min-width: 22rem; }
textarea { width: 100%; min-height: 8rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }
/* Size to the label. `.col` is a column flex (align-items: stretch by
   default) and would otherwise turn every stacked-form button into a
   full-width bar. Form fields still fill the column; that's their job. */
button {
  font-family: var(--font-ui); font-size: .85rem; color: var(--paper); background: var(--sage);
  border: none; border-radius: 4px; padding: var(--space-2) var(--space-3); cursor: pointer;
  width: max-content;
}
button:hover { opacity: .9; }
button.ghost { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.link-btn { background: transparent; color: var(--turquoise); border: none; padding: 0; font-size: .8rem; text-decoration: underline; cursor: pointer; }
.empty, .error, .muted { color: var(--muted); font-size: .85rem; }
.error { color: var(--resin); }
.success { color: var(--sage); font-size: .85rem; }
code.kv { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 1px var(--space-2); }
