/* The website's two typefaces, kept in the app (web/fonts, SIL Open Font License) because the
   page's security policy does not load fonts from other sites. */
@font-face { font-family: "Archivo"; src: url(../fonts/archivo.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url(../fonts/source-serif-4.woff2) format("woff2"); font-weight: 200 900; font-display: swap; }

/* BlockView — design tokens ------------------------------------------------ */
:root {
  color-scheme: light;
  /* the same warm paper and ink as the company website */
  --page: #f8f6f1; --surface: #fdfcf9; --surface-2: #f1eee6; --raised: #ffffff;
  --ink: #181614; --ink-2: #52514e; --muted: #7a7873; --line: #e4e0d6; --line-2: #c9c4b6;
  --ring: rgba(11, 11, 11, 0.10); --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.08);
  --accent: #2f6b3a; --accent-hover: #275a31; --accent-ink: #ffffff; --accent-wash: #e6efe5;
  --good: #0ca30c; --good-ink: #006300; --warning: #fab219; --warning-ink: #8a5a00; --critical: #d03b3b;
  --sel: #e9efe7;
  /* categorical series slots — validated (dataviz validator, light surface #fcfcfb) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --grid: #e1e0d9; --axis: #c3c2b7; --band: rgba(82, 81, 78, 0.13); --other-year: #c9c7bf;
  --radius: 4px; --radius-sm: 3px;   /* near-square, like the website */
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* page titles and the brand name: the website's serif where installed, else the nearest system serif */
  --font-head: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --paper: #f8f6f1;   /* stays light in the dark theme: the logo is black ink */
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0f0f0e; --surface: #1a1a19; --surface-2: #222220; --raised: #20201e;
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #8f8d86; --line: #2c2c2a; --line-2: #383835;
    --ring: rgba(255, 255, 255, 0.10); --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.45);
    --accent: #6bb075; --accent-hover: #7fc289; --accent-ink: #0d140e; --accent-wash: #1f2b21;
    --good-ink: #0ca30c; --warning-ink: #fab219; --sel: #232d24;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --grid: #2c2c2a; --axis: #383835; --band: rgba(195, 194, 183, 0.12); --other-year: #4a4945;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f0f0e; --surface: #1a1a19; --surface-2: #222220; --raised: #20201e;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #8f8d86; --line: #2c2c2a; --line-2: #383835;
  --ring: rgba(255, 255, 255, 0.10); --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.45);
  --accent: #6bb075; --accent-hover: #7fc289; --accent-ink: #0d140e; --accent-wash: #1f2b21;
  --good-ink: #0ca30c; --warning-ink: #fab219; --sel: #232d24;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --grid: #2c2c2a; --axis: #383835; --band: rgba(195, 194, 183, 0.12); --other-year: #4a4945;
}

/* Base -------------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--page); color: var(--ink);
  font: 13px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
svg { display: block; }
code { font-size: 11.5px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
h2 { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0; }
h3 { font-size: 15px; margin: 0 0 6px; }
.note { color: var(--muted); font-size: 12px; }
.note.fine { font-size: 11px; margin: 10px 0 0; }
.warn { color: var(--warning-ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app { display: grid; grid-template-columns: 264px minmax(0, 1fr); grid-template-rows: 52px minmax(0, 1fr); height: 100vh; position: relative; }
.topbar { grid-column: 1 / -1; }
main { grid-row: 2; display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; padding: 12px; position: relative; }

/* Controls ---------------------------------------------------------------- */
button, .btn { font: inherit; font-weight: 550; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--raised); color: var(--ink); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
button:hover, .btn:hover { border-color: var(--muted); background: var(--surface-2); }
button svg, .btn svg { width: 14px; height: 14px; fill: currentColor; flex: none; }
/* the website's main button: ink, turning green under the pointer */
button.primary { background: var(--ink); border-color: var(--ink); color: var(--page); }
button.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.sm, .btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
button.icon { width: 32px; padding: 0; }
button.icon.sm { width: 26px; height: 26px; }
button.block { width: 100%; }
button.link { height: auto; padding: 0; border: none; background: none; color: var(--accent); font-weight: 550; font-size: 12px; }
button.link:hover { background: none; text-decoration: underline; }
button:disabled { opacity: .45; cursor: default; pointer-events: none; }
button[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--accent); color: var(--ink); }

select, input[type=date], input[type=text], input[type=password] {
  font: inherit; width: 100%; height: 32px; padding: 0 9px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--raised); color: var(--ink); }
select:hover, input:hover { border-color: var(--muted); }
.field { margin-top: 12px; }
.field > label { display: block; font-size: 12px; font-weight: 550; color: var(--ink-2); margin-bottom: 4px; }
.field .opt { font-weight: 400; color: var(--muted); margin-left: 4px; }
.dates { display: flex; align-items: center; gap: 6px; }
.dates span { color: var(--muted); }
.field > .link { margin-top: 6px; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; cursor: pointer; color: var(--ink-2); user-select: none; }
.check input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.range { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--ink-2); }
.range input { flex: 1; accent-color: var(--accent); }
