/* Lore Loop - a field-notebook look: warm paper and ink by day, a lamp-lit night map after dark. */
:root {
  --bg: #f3ecdf; --paper: #fbf7ef; --panel: #fffdf8; --ink: #2b2230; --ink2: #5d5262; --muted: #857a86; --line: #ddd2c0; --line2: #cbbfa9;
  --accent: #b5521f; --accent-ink: #fff8f0; --accent-soft: #f6dfcc; --plum: #4a2f5c; --plum-soft: #ebe1f0;
  --d1: #d9822b; --d2: #2a8a7e; --d3: #b8456a;
  --k-legend: #7a4fb5; --k-history: #a65a24; --k-oddity: #24877b; --k-haunt: #545b6b; --k-festival: #c63f74; --k-food: #b58714; --k-nature: #45823f; --k-you: #6c6170;
  --ok: #2f7a45; --warn: #a8641a; --err: #b23434; --info: #4a6a8e;
  --map-bg: #f7f0e1; --map-grid: #e3d7c1; --map-label: #3b3040; --map-chip: rgba(251, 247, 239, .92);
  --night: rgba(43, 34, 48, .16); --gold: rgba(217, 130, 43, .28);
  --r-documented: #2f7a45; --r-likely: #6d9a3a; --r-contested: #b58714; --r-folklore: #7a4fb5; --r-doubtful: #b23434; --r-unknown: #8a8590;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 20px rgba(60, 40, 20, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14121b; --paper: #1b1824; --panel: #211d2c; --ink: #efe7da; --ink2: #c9bfb3; --muted: #9a90a0; --line: #342e40; --line2: #463e54;
    --accent: #f0a050; --accent-ink: #1b1308; --accent-soft: #3a2a1c; --plum: #cbb2e0; --plum-soft: #2c2338;
    --map-bg: #171a2b; --map-grid: #252a40; --map-label: #e8e0d4; --map-chip: rgba(23, 26, 43, .9);
    --night: rgba(0, 0, 0, .35); --gold: rgba(240, 160, 80, .3); color-scheme: dark;
    --k-legend: #a985e0; --k-history: #d98b52; --k-oddity: #4fc0b0; --k-haunt: #9aa2b4; --k-festival: #ec6f9c; --k-food: #e2b84a; --k-nature: #7cbf6f; --k-you: #b0a5b5;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  --bg: #14121b; --paper: #1b1824; --panel: #211d2c; --ink: #efe7da; --ink2: #c9bfb3; --muted: #9a90a0; --line: #342e40; --line2: #463e54;
  --accent: #f0a050; --accent-ink: #1b1308; --accent-soft: #3a2a1c; --plum: #cbb2e0; --plum-soft: #2c2338;
  --map-bg: #171a2b; --map-grid: #252a40; --map-label: #e8e0d4; --map-chip: rgba(23, 26, 43, .9);
  --night: rgba(0, 0, 0, .35); --gold: rgba(240, 160, 80, .3); color-scheme: dark;
  --k-legend: #a985e0; --k-history: #d98b52; --k-oddity: #4fc0b0; --k-haunt: #9aa2b4; --k-festival: #ec6f9c; --k-food: #e2b84a; --k-nature: #7cbf6f; --k-you: #b0a5b5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); overflow-x: hidden; }
a { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .4em; }
.hidden { display: none !important; }
.small { font-size: .86em; } .muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.back { color: var(--ink2); text-decoration: none; font-size: .9em; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 1.12em; flex: 1; min-width: 0; }
.mark { width: 22px; height: 22px; border-radius: 50%; border: 2px dashed var(--accent); position: relative; flex: none; }
.mark::after { content: ""; position: absolute; left: 6px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.session { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.credits { font-size: .85em; color: var(--ink2); }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 6px 13px; font: inherit; font-size: .9em; cursor: pointer; text-decoration: none; }
.pill:hover:not(:disabled) { border-color: var(--accent); }
.pill.solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pill.solid:hover:not(:disabled) { filter: brightness(1.06); color: var(--accent-ink); }
.pill.big { padding: 11px 22px; font-size: 1em; }
.pill.tiny { padding: 3px 10px; font-size: .8em; }
.pill:disabled { opacity: .5; cursor: not-allowed; }

/* Hero */
.hero { max-width: 1120px; margin: 0 auto; padding: 38px 20px 18px; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .75em; color: var(--accent); margin: 0 0 8px; font-weight: 600; }
.hero h1 { font-size: clamp(2.1em, 6vw, 3.4em); font-weight: 600; margin: 0 0 10px; }
.hero h1 em { color: var(--plum); font-style: italic; text-decoration: underline wavy var(--accent) 2px; text-underline-offset: 8px; }
.sub { max-width: 640px; color: var(--ink2); font-size: 1.06em; margin: 0 0 16px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ex-label { color: var(--muted); font-size: .9em; }
.chip { border: 1px dashed var(--line2); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .9em; cursor: pointer; }
.chip.on { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }

/* Blocks */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px 40px; }
.block { margin: 26px 0 34px; }
.bhead { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 1px dashed var(--line2); padding-bottom: 8px; }
.bhead h2 { font-size: 1.45em; margin: 0; }
.bhead p { margin: 0; color: var(--muted); font-size: .92em; }
.num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--plum); color: var(--paper); font-family: var(--sans); font-size: .62em; margin-right: 6px; vertical-align: 3px; }
.paid { font-family: var(--sans); font-size: .5em; background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 6px; vertical-align: 5px; letter-spacing: .06em; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.tgrid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row4 { display: grid; grid-template-columns: 1.3fr .6fr .9fr 1.2fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .88em; color: var(--ink2); margin-bottom: 10px; min-width: 0; }
.field.wide { width: 100%; }
input[type="text"], input[type="date"], input[type="time"], select, textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--paper); border: 1px solid var(--line2); border-radius: 9px; padding: 8px 10px; width: 100%; min-width: 0; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus, button:focus-visible, .drop:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ints { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .9em; }
.ints legend { color: var(--ink2); font-size: .92em; padding: 0 4px; }
.ints label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.ints .dark { flex-basis: 100%; color: var(--plum); }
.drop { border: 1px dashed var(--line2); border-radius: 10px; padding: 10px; text-align: center; color: var(--muted); font-size: .88em; margin-bottom: 10px; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.linkish { color: var(--accent); text-decoration: underline; cursor: pointer; }
.exports { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Glance */
.glance h3 { font-size: 1.15em; }
.glance h4 { font-size: 1em; margin-top: 14px; }
.daylist { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.daylist li { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; padding: 8px 10px; border-radius: 10px; background: var(--paper); border-left: 4px solid var(--d1); }
.daylist li.d2 { border-left-color: var(--d2); } .daylist li.d3 { border-left-color: var(--d3); }
.daylist .sun { font-size: .86em; color: var(--ink2); text-align: right; }
.daylist .small { grid-column: 1 / -1; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.totals div { background: var(--paper); border-radius: 10px; padding: 8px; text-align: center; }
.totals b { display: block; font-family: var(--serif); font-size: 1.3em; }
.totals span { font-size: .75em; color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; font-size: .88em; }
.checks li, .warnlist li, #recon li { padding-left: 18px; position: relative; }
.checks li::before, .warnlist li::before, #recon li::before { content: ""; position: absolute; left: 3px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--info); }
li.ok::before { background: var(--ok) !important; } li.warn::before { background: var(--warn) !important; } li.error::before { background: var(--err) !important; }
li.none { color: var(--muted); list-style: none; }

/* Map */
.mapwrap { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--map-bg); }
#map { display: block; width: 100%; height: auto; }
.rm-bg { fill: var(--map-bg); }
.rm-grid line { stroke: var(--map-grid); stroke-width: 1; stroke-dasharray: 2 4; }
.rm-route { fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 9 7; opacity: .9; }
.rm-d1 { stroke: var(--d1); } .rm-d2 { stroke: var(--d2); } .rm-d3 { stroke: var(--d3); }
.rm-leads line { stroke: var(--ink2); stroke-width: 1; opacity: .55; }
.rm-leads circle { fill: var(--ink2); opacity: .7; }
.rm-base path { fill: var(--plum); stroke: var(--map-bg); stroke-width: 2; }
.rm-pin { cursor: pointer; }
.rm-dot { fill: var(--k-you); stroke: var(--map-bg); stroke-width: 2.5; }
.k-legend .rm-dot { fill: var(--k-legend); } .k-history .rm-dot { fill: var(--k-history); } .k-oddity .rm-dot { fill: var(--k-oddity); } .k-haunt .rm-dot { fill: var(--k-haunt); }
.k-festival .rm-dot { fill: var(--k-festival); } .k-food .rm-dot { fill: var(--k-food); } .k-nature .rm-dot { fill: var(--k-nature); }
.rm-halo { fill: none; stroke: var(--ink2); stroke-width: 1.2; stroke-dasharray: 2 3; opacity: .7; }
.rm-pin.sel .rm-dot { stroke: var(--accent); stroke-width: 4; }
.rm-pin:focus { outline: none; } .rm-pin:focus .rm-dot { stroke: var(--accent); stroke-width: 4; }
.rm-num { fill: #fff; font: 700 12px var(--sans); pointer-events: none; }
.rm-moon { fill: #f4e7b0; stroke: var(--plum); stroke-width: 1.2; }
.rm-label { fill: var(--map-label); font: 600 12.5px var(--sans); paint-order: stroke; stroke: var(--map-bg); stroke-width: 4px; stroke-linejoin: round; }
.rm-chip { fill: var(--map-chip); }
.rm-scale line { stroke: var(--map-label); stroke-width: 2; }
.rm-scale text, .rm-north text { fill: var(--map-label); font: 600 11px var(--sans); }
.rm-north path { fill: var(--accent); }
.rm-empty { fill: var(--muted); font: 600 18px var(--serif); } .rm-empty.small { font: 13px var(--sans); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--muted); margin: 8px 2px 14px; }
.lg { display: inline-block; width: 16px; height: 4px; border-radius: 2px; margin-left: 6px; }
.lg.d1 { background: var(--d1); } .lg.d2 { background: var(--d2); } .lg.d3 { background: var(--d3); }
.lg.halo { width: 12px; height: 12px; border-radius: 50%; border: 1.5px dashed var(--ink2); }
.lg.moon { width: 10px; height: 10px; border-radius: 50%; background: #f4e7b0; border: 1px solid var(--plum); }
.loopgrid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.strips { display: grid; gap: 12px; min-width: 0; }
.strip { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; border-top: 4px solid var(--d1); }
.strip.d2 { border-top-color: var(--d2); } .strip.d3 { border-top-color: var(--d3); }
.strip h4 { font-size: 1.05em; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.dbar { position: relative; height: 22px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); margin: 6px 0 16px; }
.dbar span { position: absolute; top: 0; bottom: 0; }
.dbar .night { background: var(--night); } .dbar .gold { background: var(--gold); }
.dbar .vb { top: 3px; bottom: 3px; border-radius: 3px; background: var(--k-you); }
.dbar .vb.k-legend { background: var(--k-legend); } .dbar .vb.k-history { background: var(--k-history); } .dbar .vb.k-oddity { background: var(--k-oddity); } .dbar .vb.k-haunt { background: var(--k-haunt); }
.dbar .vb.k-festival { background: var(--k-festival); } .dbar .vb.k-food { background: var(--k-food); } .dbar .vb.k-nature { background: var(--k-nature); }
.dbar .db { top: 9px; bottom: 9px; background: var(--ink2); opacity: .45; }
.dbar .tick { position: absolute; top: 23px; font-size: 10px; font-style: normal; color: var(--muted); transform: translateX(-50%); }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: .9em; }
.items .it { color: var(--muted); padding: 2px 0 2px 2px; white-space: pre-wrap; }
.items .it.visit { color: var(--ink); }
.items .it.wait { color: var(--plum); font-style: italic; }
.itbtn { display: grid; grid-template-columns: 92px 24px 1fr; gap: 6px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; color: inherit; font: inherit; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.itbtn:hover, .it.sel .itbtn { background: var(--accent-soft); }
.itbtn .t { font-family: var(--mono); font-size: .9em; color: var(--ink2); }
.itbtn .n, .pinh .n, .scbtn .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--k-you); color: #fff; font-size: .78em; font-weight: 700; font-family: var(--sans); }
.k-legend .n, .n.k-legend { background: var(--k-legend); } .k-history .n, .n.k-history { background: var(--k-history); } .k-oddity .n, .n.k-oddity { background: var(--k-oddity); } .k-haunt .n, .n.k-haunt { background: var(--k-haunt); }
.k-festival .n, .n.k-festival { background: var(--k-festival); } .k-food .n, .n.k-food { background: var(--k-food); } .k-nature .n, .n.k-nature { background: var(--k-nature); }
.pincard { position: sticky; top: 70px; }
.pinh { font-size: 1.15em; display: flex; align-items: center; gap: 8px; }
.story { font-family: var(--serif); font-size: 1.04em; margin: 8px 0; }
.ask { font-size: .92em; margin: 6px 0; } .respect { font-size: .88em; color: var(--warn); margin: 6px 0; }
.warnline { color: var(--warn); }
.pinclaims { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; font-size: .88em; }
.rchip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78em; font-weight: 700; color: #fff; background: var(--r-unknown); text-transform: lowercase; }
.rchip.r-documented { background: var(--r-documented); } .rchip.r-likely { background: var(--r-likely); } .rchip.r-contested { background: var(--r-contested); }
.rchip.r-folklore { background: var(--r-folklore); } .rchip.r-doubtful { background: var(--r-doubtful); } .rchip.r-none { background: transparent; color: var(--muted); border: 1px dashed var(--line2); }

/* Ask */
.lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.lane { text-align: left; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); border-radius: 14px; padding: 12px 14px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 2px; }
.lane b { font-family: var(--serif); font-size: 1.1em; } .lane span { color: var(--muted); font-size: .88em; }
.lane.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.askform { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.meter { font-size: .9em; color: var(--ink2); margin: 4px 0 8px; }
.note { background: var(--plum-soft); border-radius: 10px; padding: 8px 12px; font-size: .9em; margin: 8px 0; }
.gate { font-size: .9em; color: var(--ink2); margin: 6px 0; }
.runrow { margin-top: 10px; }
.progress { margin-top: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.ptitle { font-family: var(--serif); font-size: 1.08em; margin: 0 0 8px; }
.steps { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 3px; font-size: .9em; }
.step { color: var(--muted); } .step.active { color: var(--accent); font-weight: 600; } .step.done { color: var(--ok); }
.step-ic { display: inline-block; width: 16px; font-family: var(--mono); }
.raw { white-space: pre-wrap; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: 12px/1.45 var(--mono); max-height: 320px; overflow: auto; }

/* Results */
.result { margin-top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.rhead { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.rhead h3 { font-size: 1.35em; }
.rhead p { margin: 0 0 4px; }
.arc { font-style: italic; color: var(--plum); }
.stamp { flex: none; border: 2px solid var(--plum); color: var(--plum); border-radius: 8px; padding: 6px 10px; text-transform: uppercase; letter-spacing: .1em; font-size: .74em; font-weight: 800; transform: rotate(-4deg); margin-top: 4px; }
.stamp.m-eerie { border-color: var(--k-legend); color: var(--k-legend); } .stamp.m-quirky { border-color: var(--k-oddity); color: var(--k-oddity); } .stamp.m-historic { border-color: var(--k-history); color: var(--k-history); }
.stamp.v-mostly-documented { border-color: var(--r-documented); color: var(--r-documented); } .stamp.v-mixed { border-color: var(--r-contested); color: var(--r-contested); } .stamp.v-mostly-folklore { border-color: var(--r-folklore); color: var(--r-folklore); }
.stopcards { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.stopcard { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px; border-left: 4px solid var(--k-you); }
.stopcard.k-legend { border-left-color: var(--k-legend); } .stopcard.k-history { border-left-color: var(--k-history); } .stopcard.k-oddity { border-left-color: var(--k-oddity); } .stopcard.k-haunt { border-left-color: var(--k-haunt); }
.stopcard.k-festival { border-left-color: var(--k-festival); } .stopcard.k-food { border-left-color: var(--k-food); } .stopcard.k-nature { border-left-color: var(--k-nature); }
.stopcard.sel { box-shadow: 0 0 0 2px var(--accent); }
.scbtn { display: flex; gap: 8px; align-items: flex-start; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; padding: 0; cursor: pointer; width: 100%; }
.sch { display: flex; flex-direction: column; } .sch b { font-family: var(--serif); font-size: 1.05em; }
.rgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; }
.rgrid section { min-width: 0; } .rgrid .span2 { grid-column: 1 / -1; }
.rgrid h4 { font-size: 1em; margin-top: 8px; }
.rgrid ul { padding-left: 18px; margin: 0; font-size: .92em; }
.warnlist { list-style: none; padding-left: 0 !important; }
.truthbar { display: flex; gap: 3px; height: 30px; border-radius: 8px; overflow: hidden; margin: 4px 0 14px; }
.tb { display: flex; align-items: center; justify-content: center; color: #fff; font-size: .78em; font-weight: 700; white-space: nowrap; overflow: hidden; padding: 0 6px; background: var(--r-unknown); min-width: 0; }
.tb.r-documented { background: var(--r-documented); } .tb.r-likely { background: var(--r-likely); } .tb.r-contested { background: var(--r-contested); }
.tb.r-folklore { background: var(--r-folklore); } .tb.r-doubtful { background: var(--r-doubtful); }
.ratings { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.rating { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.rating p { margin: 6px 0 0; font-size: .93em; }
.rtop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rid { font-family: var(--mono); font-size: .82em; color: var(--muted); }
.tmeter { display: inline-flex; gap: 3px; } .tmeter i { width: 9px; height: 9px; border-radius: 50%; background: var(--line2); }
.tmeter.r-documented i.on { background: var(--r-documented); } .tmeter.r-likely i.on { background: var(--r-likely); } .tmeter.r-contested i.on { background: var(--r-contested); }
.tmeter.r-folklore i.on { background: var(--r-folklore); } .tmeter.r-doubtful i.on { background: var(--r-doubtful); }
.claim { margin: 8px 0 0; padding: 6px 10px; border-left: 3px solid var(--line2); font-family: var(--serif); color: var(--ink2); }
.retell { color: var(--plum); }
.recon { margin-top: 14px; background: var(--paper); border: 1px dashed var(--line2); border-radius: 12px; padding: 12px 16px; }
.recon h4 { font-size: 1em; }
#recon { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 4px; font-size: .9em; }
.maplinks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.maplinks p { flex-basis: 100%; margin: 0; }

/* History */
.history { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.hrow { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.hinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hinfo b { font-family: var(--serif); }

/* Toasts, footer */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 10px; font-size: .9em; box-shadow: var(--shadow); transition: opacity .5s; }
.toast.err { background: var(--err); color: #fff; } .toast a { color: inherit; font-weight: 700; } .toast.gone { opacity: 0; }
.foot { border-top: 1px solid var(--line); padding: 20px; text-align: center; color: var(--muted); font-size: .86em; }
.foot p { max-width: 760px; margin: 6px auto; }

/* Docs pages */
.doc { max-width: 900px; margin: 0 auto; padding: 28px 20px 50px; }
.doc pre { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: auto; font: 12.5px/1.5 var(--mono); max-width: 100%; }
.doc code { font-family: var(--mono); font-size: .92em; }
.doc table { border-collapse: collapse; width: 100%; font-size: .9em; display: block; overflow-x: auto; margin: 10px 0 16px; }
.doc th, .doc td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.doc h2 { margin-top: 30px; }
.codegroup { margin: 10px 0 18px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tab { border: 1px solid var(--line2); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: .84em; cursor: pointer; }
.tab.active { background: var(--plum); color: var(--paper); border-color: var(--plum); }
.statebox { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 14px 0; }
.tokenrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.tokenbox { font-family: var(--mono); font-size: .85em; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; word-break: break-all; width: 100%; }
.mono { font-family: var(--mono); }

@media (max-width: 900px) {
  .tgrid, .loopgrid { grid-template-columns: 1fr; }
  .pincard { position: static; }
  .row4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .bar { padding: 8px 16px; gap: 8px; }
  .back { display: none; }
  .hero { padding: 26px 16px 10px; }
  .wrap { padding: 0 16px 30px; }
  .row2, .lanes, .rgrid { grid-template-columns: 1fr; }
  .rgrid .span2 { grid-column: auto; }
  .totals b { font-size: 1.1em; }
  .itbtn { grid-template-columns: 82px 22px 1fr; font-size: .95em; }
  .rhead { flex-direction: column; gap: 6px; }
  .stopcards { grid-template-columns: 1fr; }
}
@media print { .bar, .hero, .lanes, .askform, .exports, .foot, .toasts { display: none !important; } body { background: #fff; } }
