/* Fill Day. One stylesheet, no framework, light and dark. */
:root {
  --paper: #f6f3ea;
  --card: #fffdf7;
  --ink: #1c211f;
  --muted: #5b625e;
  --line: #ddd6c6;
  --amber: #b25f00;
  --amber-soft: #f3dfbf;
  --teal: #17625d;
  --teal-soft: #d5ebe7;
  --red: #a3341f;
  --chart-grid: #e6e0d2;
  --focus: #0b57d0;
  --radius: 10px;
  --wrap: 68rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121614;
    --card: #1a1f1c;
    --ink: #ece7da;
    --muted: #a7ada6;
    --line: #2f3632;
    --amber: #f0a43c;
    --amber-soft: #3b2c16;
    --teal: #5fc4b9;
    --teal-soft: #17302d;
    --red: #f08a72;
    --chart-grid: #2a302c;
    --focus: #8ab4f8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121614; --card: #1a1f1c; --ink: #ece7da; --muted: #a7ada6; --line: #2f3632;
  --amber: #f0a43c; --amber-soft: #3b2c16; --teal: #5fc4b9; --teal-soft: #17302d; --red: #f08a72;
  --chart-grid: #2a302c; --focus: #8ab4f8; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
h1, h2, h3 {
  font-family: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 1.6em 0 0.5em;
}
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); margin-top: 0.4em; }
h2 { font-size: clamp(1.35rem, 3.2vw, 1.75rem); }
h3 { font-size: 1.15rem; }
p, ul, ol, table { margin: 0 0 1em; }
a { color: var(--teal); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 10; }

/* Header */
.site-head { border-bottom: 1px solid var(--line); background: var(--card); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; font-size: 0.97rem; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 0; display: inline-block; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--amber); }

main { padding-bottom: 48px; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin: 18px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li + li::before { content: "/"; margin: 0 6px 0 2px; color: var(--line); }
.crumbs a { color: var(--muted); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 44rem; }
.prose { max-width: 44rem; }

/* The question panel on the home page */
.answer { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 20px 0 28px; }
.answer h2 { margin-top: 0; }
.answer .verdict { font-size: 1.15rem; max-width: 46rem; }
.signals { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin: 16px 0 8px; }
.signal { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--paper); }
.signal .k { font-size: 0.88rem; color: var(--muted); margin: 0; }
.signal .v { font: 700 2rem/1.1 system-ui, sans-serif; font-variant-numeric: tabular-nums; margin: 6px 0; }
.signal .v small { font-size: 0.95rem; font-weight: 500; color: var(--muted); }
.signal .d { font-size: 0.9rem; margin: 0; }
.down { color: var(--teal); }
.up { color: var(--red); }
.src { font-size: 0.85rem; color: var(--muted); }
.src a { color: var(--muted); }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin: 12px 0 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.note { background: var(--amber-soft); border-radius: var(--radius); padding: 14px 16px; max-width: 46rem; }
.note.teal { background: var(--teal-soft); }
.note p:last-child { margin-bottom: 0; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 1em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; margin: 0; }
caption { text-align: left; padding: 10px 12px; font-weight: 600; }
th, td { padding: 8px 12px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { background: var(--paper); font-weight: 600; border-top: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { display: inline-block; vertical-align: middle; margin-right: 8px; }
.bar rect { fill: var(--amber); }
.trap { position: absolute; left: -9999px; }
input.check { width: auto; min-height: 0; }
label.inline { display: inline; font-weight: 400; }
button { font: inherit; font-weight: 600; padding: 10px 18px; min-height: 44px; border: 0; border-radius: 8px; background: var(--teal); color: var(--paper); cursor: pointer; }

/* Charts */
figure.chart { margin: 8px 0 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 8px; }
figure.chart svg { width: 100%; height: auto; display: block; }
figure.chart figcaption { font-size: 0.88rem; color: var(--muted); padding: 6px 4px 0; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis text, .chart text { fill: var(--muted); font: 12px system-ui, sans-serif; }
.chart .l1 { stroke: var(--amber); stroke-width: 2.2; fill: none; }
.chart .l2 { stroke: var(--teal); stroke-width: 2; fill: none; }
.chart .l3 { stroke: var(--muted); stroke-width: 1.5; fill: none; stroke-dasharray: 4 3; }
.chart .zero { stroke: var(--muted); stroke-width: 1; }
.chart .colpos { fill: var(--red); }
.chart .colneg { fill: var(--teal); }
.chart .lab { fill: var(--ink); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.88rem; color: var(--muted); margin: 4px 4px 0; padding: 0; list-style: none; }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.legend .k1 { background: var(--amber); } .legend .k2 { background: var(--teal); } .legend .k3 { background: var(--muted); }

details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; }
details summary { cursor: pointer; font-weight: 600; }

/* Tools */
.tool { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 20px; }
.tool h2 { margin-top: 0; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
input, select { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); min-height: 44px; }
output, .out { display: block; margin-top: 12px; font-size: 1.05rem; min-height: 1.6em; }
.hint { font-size: 0.85rem; color: var(--muted); font-weight: 400; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); background: var(--card); font-size: 0.9rem; color: var(--muted); }
.site-foot .wrap { padding-top: 20px; padding-bottom: 28px; }
.site-foot a { color: var(--muted); }
.site-foot ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }

@media (max-width: 520px) {
  body { font-size: 1rem; }
  figure.chart { padding: 8px 4px 6px; }
  table.hide4 th:nth-child(4), table.hide4 td:nth-child(4) { display: none; }
  .bar { width: 56px; height: 8px; }
  .chart text, .chart .axis text { font-size: 24px; }
  .chart .minor { display: none; }
  .chart .l1 { stroke-width: 4; }
  .chart .l2 { stroke-width: 3.5; }
  .chart .l3 { stroke-width: 3; }
  .signal .v { font-size: 1.7rem; }
  th, td { padding: 7px 9px; }
}
@media print {
  .site-head nav, .site-foot { display: none; }
  body { background: #fff; color: #000; }
}
