:root {
  --bg: #f6f5f0; --surface: #ffffff; --line: #dcd9cf; --text: #1d2420; --muted: #5d665f;
  --accent: #1f6b45; --accent-text: #ffffff; --warn-bg: #fff4d6; --warn-line: #d9a514;
  --error-bg: #fde8e6; --error-line: #c0392b; --hole: #1f6b45; --haul: #b2560d; --dryer: #5b3fa8;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101512; --surface: #18201b; --line: #2c3830; --text: #e9eee9; --muted: #9aa69d;
    --accent: #5fca8f; --accent-text: #0c1a12; --warn-bg: #3a2f0c; --warn-line: #d9a514;
    --error-bg: #3b1714; --error-line: #e06a5c; --hole: #5fca8f; --haul: #f0a35e; --dryer: #b39cf2;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 "Trebuchet MS", Arial, Helvetica, sans-serif; }
a { color: var(--accent); }
.top, main, .foot { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.brand { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.brand-name { font-size: 1.4rem; font-weight: 700; letter-spacing: .01em; }
.brand-tag { font-size: .8rem; color: var(--muted); }
main { padding-top: 20px; padding-bottom: 32px; min-height: 60vh; }
h2 { font-size: 1.05rem; margin: 0 0 6px; }

button, select { font: inherit; min-height: 44px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.notice { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; max-width: 620px; margin: 32px auto; }
.notice p { color: var(--muted); margin: 0 0 16px; overflow-wrap: anywhere; }
.empty { color: var(--muted); padding: 20px 0; margin: 0; }
.hint { color: var(--muted); font-size: .85rem; margin: 0 0 10px; }
.inline-error { background: var(--error-bg); border: 1px solid var(--error-line); border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; overflow-wrap: anywhere; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar label { font-weight: 700; }
.toolbar select { flex: 1 1 200px; max-width: 360px; }
.toolbar .checked { margin-left: auto; color: var(--muted); font-size: .85rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.card.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.card-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card-value { font-size: 1.6rem; font-weight: 700; margin: 2px 0; }
.card-note { font-size: .82rem; color: var(--muted); }

.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
@media (max-width: 800px) { .split { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }

.map { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.dot { stroke: var(--surface); stroke-width: 1.5; fill: var(--muted); }
.dot.DOKO_HOLE { fill: var(--hole); }
.dot.MULE_HAUL { fill: var(--haul); }
.dot.DRYER_READING { fill: var(--dryer); }
.scale { stroke: var(--text); stroke-width: 2; }
.scale-label { fill: var(--text); font-size: 12px; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tab { padding: 6px 12px; font-size: .88rem; }
.tab[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }
.events { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.event { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.event:first-child { border-top: 0; }
.event-detail, .event-where, .event time { color: var(--muted); }
.event-where { font-size: .82rem; font-variant-numeric: tabular-nums; }
.event time { white-space: nowrap; font-size: .82rem; }

.foot { display: flex; flex-wrap: wrap; gap: 6px 20px; padding-top: 16px; padding-bottom: 28px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
