/*
 * No web fonts and no external stylesheets on purpose: the page claims it
 * makes no requests once loaded, and a font request would make that a lie.
 */

:root {
  --bg: #fbfaf8;
  --fg: #1d1c1a;
  --muted: #6b6862;
  --line: #ddd8d0;
  --panel: #ffffff;
  --accent: #1c5d99;
  --warn-bg: #fdf5e6;
  --warn-line: #d9a441;
  --warn-fg: #7a5310;
  --ok: #2f6f43;
  --ok-bg: #eef6f0;
  --chip-bg: #eef1f5;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17161a;
    --fg: #eae7e1;
    --muted: #a29d95;
    --line: #35323a;
    --panel: #1f1e23;
    --accent: #7db3e0;
    --warn-bg: #2c2415;
    --warn-line: #a9803a;
    --warn-fg: #e8c281;
    --ok: #77c093;
    --ok-bg: #1b2a21;
    --chip-bg: #2b2933;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 1rem 4rem;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.75;
  font-size: 16px;
}

.page-head, main, .page-foot {
  max-width: 48rem;
  margin: 0 auto;
}

.page-head { padding: 2.5rem 0 1rem; }

h1 {
  font-size: 1.7rem;
  margin: 0 0 .4rem;
  letter-spacing: .01em;
}

.version {
  font-size: .95rem;
  font-weight: 400;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.lead { margin: 0 0 1rem; }

.links { margin: 0 0 1.2rem; display: flex; gap: 1.1rem; flex-wrap: wrap; }
.links a, .page-foot a, .guide a { color: var(--accent); }

.offline {
  border: 1px solid var(--line);
  border-left: 4px solid var(--ok);
  border-radius: var(--radius);
  background: var(--panel);
  padding: .8rem 1rem;
  margin: 0;
}
.offline-detail {
  display: block;
  margin-top: .4rem;
  font-size: .9rem;
  color: var(--muted);
}

.request-meter {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: .5rem .7rem;
  margin: .6rem 0 0;
  padding: .7rem 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ok);
  border-radius: var(--radius);
  background: var(--panel);
}
.meter-label { font-size: .9rem; color: var(--muted); }
.meter-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ok);
}
.meter-note {
  grid-column: 1 / -1;
  font-size: .82rem;
  color: var(--muted);
}
.meter-note kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95em;
  background: var(--chip-bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 .3rem;
}
/* Only ever set, never cleared: a request that happened, happened. */
.request-meter.dirty { border-left-color: var(--warn-line); }
.request-meter.dirty .meter-value { color: var(--warn-fg); }

.panel-guide { border-left: 4px solid var(--accent); }
.guide {
  margin: 0;
  padding-left: 1.3rem;
  display: grid;
  gap: .55rem;
}
.guide li { line-height: 1.65; }

.loading, .load-error { padding: 2rem 0; color: var(--muted); }
.load-error { color: var(--warn-fg); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem 1.4rem;
  margin: 1.6rem 0;
}

.panel h2 {
  font-size: 1.15rem;
  margin: 0 0 .3rem;
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
}
.panel h2 code {
  font-size: .85rem;
  font-weight: 400;
  color: var(--muted);
}

.panel-lead { margin: 0 0 1rem; font-size: .93rem; color: var(--muted); }
.panel-lead code, .guide code, .notes code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--chip-bg);
  border-radius: 3px;
  padding: 0 .25rem;
}

.sub {
  font-size: .95rem;
  margin: 0 0 .6rem;
  color: var(--fg);
}
.sub-tz {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.fact { font-variant-numeric: tabular-nums; }

.presets { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }

.preset {
  font: inherit;
  font-size: .88rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
  line-height: 1.5;
  text-align: left;
}
.preset:hover { border-color: var(--accent); }
.preset-label { font-weight: 600; white-space: nowrap; }
.preset-note { font-size: .78rem; color: var(--muted); }

.field { display: block; }
.field-label {
  display: block;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: .3rem;
  padding: 0;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem 1.2rem;
  align-items: flex-end;
}
.field-narrow { max-width: 16rem; }
.field-tiny { max-width: 5.5rem; }

input[type="date"], input[type="number"], select {
  font: inherit;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .45rem .6rem;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.radios {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.radios label {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .88rem;
  margin-right: .9rem;
}

.wareki-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1.4rem;
}
.wareki-col { min-width: 0; }

.output { margin-top: 1.1rem; }

.summary { font-size: .85rem; color: var(--muted); margin: 1rem 0 .5rem; }
.aside {
  font-size: .85rem;
  margin: .8rem 0 0;
  display: flex;
  align-items: baseline;
  gap: .4rem;
  flex-wrap: wrap;
}

/* The headline answer. */
.verdict {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: .7rem 1rem;
}
.verdict-plain { border-left-color: var(--muted); }
.verdict-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  color: var(--muted);
}
.verdict-arrow { color: var(--muted); font-size: .9rem; }
.verdict-name { font-size: 1.25rem; font-weight: 600; }

.badge {
  font-size: .75rem;
  border-radius: 999px;
  padding: .05rem .6rem;
  border: 1px solid currentColor;
  white-space: nowrap;
  line-height: 1.6;
}
.badge-confirmed { color: var(--ok); }
/* Provisional is filled, not outlined: it has to survive being skimmed. */
.badge-provisional {
  color: var(--warn-fg);
  background: var(--warn-bg);
  border-color: var(--warn-line);
  font-weight: 700;
}

.kv-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .15rem .8rem;
  margin: .9rem 0 0;
  font-size: .87rem;
}
.kv-list dt { color: var(--muted); }
.kv-list dd { margin: 0; }
.kv-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  color: var(--muted);
}
.kv-value { font-variant-numeric: tabular-nums; }
.kv-note { color: var(--muted); font-size: .82rem; }

.holiday-list { list-style: none; margin: 0; padding: 0; }
.holiday-list > li {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
  padding: .25rem .4rem;
  border-top: 1px solid var(--line);
  font-size: .88rem;
}
.holiday-list > li.hit {
  background: var(--ok-bg);
  border-radius: 4px;
}
.hl-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.hl-name { font-weight: 600; }
.hl-cat { font-size: .76rem; color: var(--muted); }

/* Failures are shown as an outcome the library chose, not as a page error. */
.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  padding: .6rem .85rem;
  margin: 0;
}
.warn-head {
  margin: 0 0 .3rem;
  display: flex;
  align-items: baseline;
  gap: .5rem;
  flex-wrap: wrap;
}
.err-name, .case-expr {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem;
  background: var(--chip-bg);
  border-radius: 4px;
  padding: .05rem .4rem;
}
.err-lead { font-size: .85rem; color: var(--warn-fg); }
.err-message { margin: 0; font-size: .85rem; }

.case-group {
  font-size: .9rem;
  margin: 1.3rem 0 .5rem;
}
.case-group:first-child { margin-top: 0; }

.cases { list-style: none; margin: 0; padding: 0; }
.case {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .2rem .7rem;
  padding: .55rem 0;
  border-top: 1px solid var(--line);
}
.case-expr { justify-self: start; overflow-wrap: anywhere; }
.case-verdict {
  font-size: .75rem;
  border-radius: 999px;
  padding: 0 .6rem;
  border: 1px solid currentColor;
  white-space: nowrap;
  justify-self: end;
  line-height: 1.7;
}
.case-accept { color: var(--ok); }
.case-refuse { color: var(--accent); }
.case-depends { color: var(--warn-fg); background: var(--warn-bg); border-color: var(--warn-line); }
/* Never expected to render — see INPUT_CASES in app.js. */
.case-unexpected {
  color: var(--warn-fg);
  background: var(--warn-bg);
  border-color: var(--warn-line);
  font-weight: 700;
}
.case-result {
  grid-column: 1 / -1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.case-note { grid-column: 1 / -1; font-size: .82rem; }
.case-alarm {
  grid-column: 1 / -1;
  font-size: .82rem;
  color: var(--warn-fg);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 4px;
  padding: .3rem .5rem;
}

.tz-env {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 0 0 .6rem;
}
.tz-rows { list-style: none; margin: 0; padding: 0; }
.tz-rows > li {
  display: grid;
  grid-template-columns: auto auto;
  gap: .1rem .7rem;
  align-items: baseline;
  padding: .35rem 0;
  border-top: 1px solid var(--line);
  justify-content: start;
}
.tz-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  font-weight: 600;
}
.tz-rows .case-note { grid-column: 1 / -1; }

.tz-verdict {
  margin: .8rem 0 0;
  padding: .55rem .8rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ok);
  font-size: .88rem;
}
.tz-diff {
  border-left-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-fg);
}
.tz-trap { margin-top: 1.4rem; }

.panel-note h2 { margin-bottom: .6rem; }
.notes { margin: 0; padding-left: 1.2rem; }
.notes li { margin-bottom: .6rem; }

.install {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .7rem .9rem;
  overflow-x: auto;
  font-size: .85rem;
  margin: 0 0 .8rem;
}

.page-foot {
  border-top: 1px solid var(--line);
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  font-size: .85rem;
  color: var(--muted);
}
.page-foot h2 { font-size: .95rem; color: var(--fg); margin: 0 0 .5rem; }
.page-foot p { margin: 0 0 .6rem; }
.foot-meta { font-size: .8rem; }
.sha {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  overflow-wrap: anywhere;
}
