/* PaperAlly design system.
   One file, tokens first. Every module styles with these variables and never
   hard-codes a colour. Light and dark, following the viewer's setting.
   Pattern carried from the OPS-06 dashboard shell: tokens on :root, redefined
   under prefers-color-scheme and under an explicit [data-theme]. */

:root {
  --ink:        #16212b;
  --ink-soft:   #55646f;
  --ink-faint:  #8a97a3;
  --paper:      #ffffff;
  --page:       #f6f8f9;
  --line:       #e2e8ec;
  --line-soft:  #eef2f5;

  --brand:      #0b6e4f;   /* the green of the warrant */
  --brand-dark: #085840;
  --brand-wash: #eaf5f0;

  --amber:      #b26a00;
  --amber-wash: #fdf3e4;
  --red:        #b3261e;
  --red-wash:   #fdecea;
  --blue:       #1d5fa8;
  --blue-wash:  #eaf1fa;

  --radius:     10px;
  --radius-lg:  14px;
  --shadow:     0 1px 2px rgba(16,32,44,.06), 0 4px 14px rgba(16,32,44,.06);
  --shadow-lg:  0 2px 6px rgba(16,32,44,.08), 0 12px 32px rgba(16,32,44,.10);
  --font:       "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono:       "Cascadia Mono", "SF Mono", Consolas, monospace;
  --wrap:       1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e6edf3; --ink-soft: #a9b6c1; --ink-faint: #7b8894;
    --paper: #171d23; --page: #11161b; --line: #2a333c; --line-soft: #222a32;
    --brand: #4cc38a; --brand-dark: #6fd3a2; --brand-wash: #16302a;
    --amber: #e0a44a; --amber-wash: #33280f;
    --red: #f07a72; --red-wash: #3a1f1d;
    --blue: #7fb0e8; --blue-wash: #17263a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.45), 0 12px 32px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  --ink: #e6edf3; --ink-soft: #a9b6c1; --ink-faint: #7b8894;
  --paper: #171d23; --page: #11161b; --line: #2a333c; --line-soft: #222a32;
  --brand: #4cc38a; --brand-dark: #6fd3a2; --brand-wash: #16302a;
  --amber: #e0a44a; --amber-wash: #33280f;
  --red: #f07a72; --red-wash: #3a1f1d;
  --blue: #7fb0e8; --blue-wash: #17263a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.6 var(--font);
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 640; letter-spacing: -.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
small { font-size: .82rem; color: var(--ink-soft); }
code, kbd { font-family: var(--mono); font-size: .9em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--paper); padding: 8px 14px;
  border-radius: var(--radius); z-index: 100; box-shadow: var(--shadow); }

/* ---------------------------------------------------------------- top bar */
.top {
  background: var(--paper); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.top-in { display: flex; align-items: center; gap: 22px; height: 62px;
  max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.brand { font-weight: 700; font-size: 1.12rem; color: var(--ink); letter-spacing: -.02em;
  display: inline-flex; align-items: center; gap: 9px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-size: .82rem; font-weight: 700; }
.top nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.top nav a { color: var(--ink-soft); font-size: .93rem; font-weight: 520; }
.top nav a:hover, .top nav a.on { color: var(--ink); text-decoration: none; }

/* ------------------------------------------------------------------ button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius); border: 1px solid transparent;
  font: 600 .95rem/1 var(--font); cursor: pointer; background: var(--brand); color: #fff;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-soft); }
.btn-quiet { background: transparent; color: var(--ink-soft); padding: 8px 10px; }
.btn-quiet:hover { background: var(--line-soft); color: var(--ink); }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; }
.btn-sm { padding: 6px 12px; font-size: .86rem; }

/* -------------------------------------------------------------------- card */
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
}
.card-flat { box-shadow: none; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }

/* ------------------------------------------------------- the warrant chip */
/* The paper's three states, always with the full state name spelled out. */
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 8px;
  border-radius: 100px; font-size: .82rem; font-weight: 620; line-height: 1.4;
  border: 1px solid transparent; white-space: nowrap;
}
.chip b { font-size: .95em; }
.chip-a { background: var(--brand-wash); color: var(--brand-dark); border-color: var(--brand); }
.chip-v { background: var(--amber-wash); color: var(--amber); border-color: var(--amber); }
.chip-h { background: var(--red-wash);   color: var(--red);   border-color: var(--red); }
.chip-none { background: var(--line-soft); color: var(--ink-soft); border-color: var(--line); }

/* ------------------------------------------------------------------ forms */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=url], input[type=date],
select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--paper); color: var(--ink);
  font: 1rem/1.5 var(--font);
}
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand);
}
.field { margin-bottom: 18px; }
.field .hint { font-size: .85rem; color: var(--ink-soft); margin-top: 6px; }
fieldset { border: 0; padding: 0; margin: 0; }

/* ------------------------------------------------------------------ notes */
.note { border-left: 3px solid var(--brand); background: var(--brand-wash);
  padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin: 18px 0; }
.note-warn { border-left-color: var(--amber); background: var(--amber-wash); }
.note-quiet { border-left-color: var(--line); background: var(--line-soft); }

/* ----------------------------------------------------------------- tables */
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th, table.data td { text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-faint); font-weight: 650; }
.scroll-x { overflow-x: auto; }

/* ----------------------------------------------------------------- footer */
.foot { border-top: 1px solid var(--line); margin-top: 64px; padding: 30px 0 50px;
  color: var(--ink-soft); font-size: .9rem; background: var(--paper); }
.foot a { color: var(--ink-soft); }
.foot-in { display: flex; flex-wrap: wrap; gap: 10px 26px; max-width: var(--wrap);
  margin: 0 auto; padding: 0 24px; }

/* --------------------------------------------------------------- utilities */
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-tight { gap: 7px; }
.push { margin-left: auto; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.center { text-align: center; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.hide { display: none !important; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 100px; font-size: .76rem;
  font-weight: 620; background: var(--line-soft); color: var(--ink-soft); }
.pill-brand { background: var(--brand-wash); color: var(--brand-dark); }
