/* Starpath — one stylesheet. Tokens first; light and dark redefine them. */

:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --surface-2: #f0ebe0;
  --text: #1d1a26;
  --text-2: #4a4558;
  --text-3: #7c7689;
  --line: #e2dccf;
  --line-strong: #c9c0ae;
  --accent: #7a5c1e;
  --accent-soft: #f1e6cc;
  --accent-ink: #fff;
  --side: #17142a;
  --side-text: #d9d3c4;
  --side-active: #2b2645;
  --gold: #c9a96e;
  --ok: #2f7d5b;
  --bad: #b33a3a;
  --warn: #9a6a00;
  --easy: #2b6fb3;
  --tense: #c0392b;
  --blend: #8a6a10;
  --creative: #7d4bb5;
  --fire: #d65a31;
  --earth: #5d7b3a;
  --air: #c49a1c;
  --water: #2f72a8;
  --fire-soft: #fbe5dc;
  --earth-soft: #e5eddb;
  --air-soft: #f7efd4;
  --water-soft: #dce8f3;
  --shadow: 0 1px 2px rgba(30, 20, 10, 0.05), 0 4px 16px rgba(30, 20, 10, 0.05);
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --glyph: "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", "Apple Symbols", "DejaVu Sans", "Arial Unicode MS", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #100e1c; --surface: #1a1729; --surface-2: #231f36; --text: #ece7f5; --text-2: #bdb5cf; --text-3: #8b84a0;
    --line: #2e2945; --line-strong: #453f62; --accent: #e3c27f; --accent-soft: #3a3020; --accent-ink: #1a1408;
    --side: #0b0a14; --side-active: #221e36; --easy: #6aa8e8; --tense: #ee6b5e; --blend: #e1bd5a; --creative: #b48ae6;
    --fire: #f08257; --earth: #93b866; --air: #e8c552; --water: #64a7dd;
    --fire-soft: #3d2219; --earth-soft: #232f1a; --air-soft: #362e15; --water-soft: #172a3b;
    --ok: #5cc493; --bad: #ee6b5e; --warn: #e6b04a; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #100e1c; --surface: #1a1729; --surface-2: #231f36; --text: #ece7f5; --text-2: #bdb5cf; --text-3: #8b84a0;
  --line: #2e2945; --line-strong: #453f62; --accent: #e3c27f; --accent-soft: #3a3020; --accent-ink: #1a1408;
  --side: #0b0a14; --side-active: #221e36; --easy: #6aa8e8; --tense: #ee6b5e; --blend: #e1bd5a; --creative: #b48ae6;
  --fire: #f08257; --earth: #93b866; --air: #e8c552; --water: #64a7dd;
  --fire-soft: #3d2219; --earth-soft: #232f1a; --air-soft: #362e15; --water-soft: #172a3b;
  --ok: #5cc493; --bad: #ee6b5e; --warn: #e6b04a; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -0.01em; }
h2 { font-size: 22px; } h3 { font-size: 16px; } h4 { font-size: 14px; margin-top: 1em; }
h3 small, h2 small { font-weight: 400; color: var(--text-3); font-size: 13px; margin-left: 6px; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.g { font-family: var(--glyph); font-variant-emoji: text; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 999; background: var(--surface); padding: 6px 10px; }

/* ── Shell ── */
.shell { display: flex; min-height: 100vh; }
.side { width: 248px; flex-shrink: 0; background: var(--side); color: var(--side-text); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 650; font-size: 19px; padding: 4px 10px 14px; }
.logo { color: var(--gold); font-size: 22px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-h { margin: 14px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8a83a3; }
.nav a { color: var(--side-text); text-decoration: none; padding: 7px 10px; border-radius: 8px; font-size: 14px; }
.nav a:hover { background: var(--side-active); color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 10px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.top h1 { font-size: 18px; margin: 0; flex: 1; }
.top-actions { display: flex; gap: 6px; }
.icon-btn.menu { display: none; }
main { padding: 22px 28px 40px; max-width: 1280px; width: 100%; outline: none; }
main:focus, main:focus-visible { outline: none; }
.icon-btn svg { width: 18px; height: 18px; }
.foot { padding: 18px 28px 28px; color: var(--text-3); font-size: 12px; }

@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
  .icon-btn.menu { display: inline-flex; }
  .top { padding: 10px 16px; }
  main { padding: 16px 16px 32px; }
  .foot { padding: 12px 16px 24px; }
}

/* ── Building blocks ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow); min-width: 0; }
.stack > .card:last-child { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack > .card { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
.intro { color: var(--text-2); margin: 0 0 16px; max-width: 760px; }
.lead { font-size: 16px; }
.notice { background: var(--accent-soft); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.notice p { margin: 4px 0; }
.notice.error { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border-color: var(--bad); }
.empty { text-align: center; padding: 36px 18px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--text-3); padding: 24px 4px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 5px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
ul.cols { columns: 2; column-gap: 18px; } ul.cols li { break-inside: avoid; }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); margin: 1px 4px 1px 0; white-space: nowrap; }
.tag.rare { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tag.dig-domicile, .tag.dig-exaltation { background: color-mix(in srgb, var(--ok) 15%, var(--surface)); color: var(--ok); }
.tag.dig-detriment, .tag.dig-fall { background: color-mix(in srgb, var(--bad) 13%, var(--surface)); color: var(--bad); }
.tag.oob { background: color-mix(in srgb, var(--warn) 15%, var(--surface)); color: var(--warn); }
.rx { color: var(--bad); font-weight: 600; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.btn.file { position: relative; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); width: 36px; height: 36px; border-radius: 9px; cursor: pointer; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 10px; min-width: 0; max-width: 100%; }
input[type=checkbox], input[type=range] { padding: 0; }
textarea { width: 100%; resize: vertical; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); font-weight: 500; }
label.inline { flex-direction: row; align-items: center; gap: 6px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--text); font-size: 14px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form .row { display: flex; gap: 12px; flex-wrap: wrap; }
.form .row > label { flex: 1 1 160px; }
.form .actions { display: flex; justify-content: flex-end; gap: 8px; }
.row-form { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; }
legend { font-size: 13px; color: var(--text-2); padding: 0 4px; }
.hint { font-size: 12.5px; color: var(--text-3); margin: 0; }
.adv summary { cursor: pointer; font-size: 13px; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { flex-direction: row; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; font-size: 13px; font-weight: 400; color: var(--text); cursor: pointer; background: var(--surface); }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.chip .sw, .sw { display: inline-block; width: 12px; height: 4px; border-radius: 2px; }
.cond-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 6px 16px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 16px; }
.picker { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.picker select { min-width: 200px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 14px; font: inherit; font-size: 14px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.export-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chart-head { margin-bottom: 12px; } .chart-head p { margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.hl td { background: var(--accent-soft); }
.tbl .nm { white-space: nowrap; font-weight: 500; }
.tbl .pos { white-space: nowrap; }
.tbl .kw, .kw { color: var(--text-3); font-size: 12.5px; }
.tbl.compact td { padding: 4px 8px; }
.positions .notes { min-width: 160px; }
.asp-g { font-family: var(--glyph); padding: 0 3px; }
.asp-g.tense, .nat-tense .asp-g { color: var(--tense); }
.asp-g.easy, .nat-easy .asp-g { color: var(--easy); }
.asp-g.blend, .nat-blend .asp-g { color: var(--blend); }
.ap { font-size: 11px; color: var(--ok); } .ap.sep { color: var(--text-3); }
.pos-score { color: var(--ok); } .neg-score { color: var(--bad); }
.row-actions { white-space: nowrap; text-align: right; }

table.grid { border-collapse: collapse; font-family: var(--glyph); }
table.grid th, table.grid td { width: 30px; height: 30px; text-align: center; border: 1px solid var(--line); font-size: 14px; padding: 0; position: relative; }
table.grid th { font-weight: 400; color: var(--text-2); }
table.grid td.diag { background: var(--surface-2); color: var(--text-2); }
table.grid td small { position: absolute; right: 2px; bottom: 0; font-size: 8.5px; color: var(--text-3); font-family: var(--mono); }
table.grid td.nat-tense { color: var(--tense); } table.grid td.nat-easy { color: var(--easy); } table.grid td.nat-blend { color: var(--blend); }

/* Bars */
.bars { margin-bottom: 10px; }
.bar-row { display: grid; grid-template-columns: 74px 1fr 26px; align-items: center; gap: 8px; font-size: 13px; padding: 2px 0; }
.bt { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bf { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.el-fire { background: var(--fire); } .el-earth { background: var(--earth); } .el-air { background: var(--air); } .el-water { background: var(--water); }
.bf.mo-cardinal { background: var(--tense); } .bf.mo-fixed { background: var(--blend); } .bf.mo-mutable { background: var(--easy); }
.big3 { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 8px; }
.b3 { font-size: 30px; line-height: 1.2; color: var(--accent); }

/* Hero (today) */
.hero { display: flex; flex-direction: column; gap: 12px; }
.hero-row { display: flex; gap: 14px; align-items: center; }
.big { font-size: 34px; width: 44px; text-align: center; color: var(--accent); }
.moonbar { height: 6px; width: 180px; max-width: 100%; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin: 6px 0 2px; }
.moonbar span { display: block; height: 100%; background: var(--gold); }
.voc { font-size: 14px; color: var(--text-2); padding: 8px 10px; background: var(--surface-2); border-radius: 9px; }
.voc.on { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--text); }

/* Event lists */
ul.events { list-style: none; margin: 0; padding: 0; }
.ev { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 4px 14px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.ev:last-child { border-bottom: 0; }
.ev .when { font-size: 12.5px; color: var(--text-2); }
.ev .what { font-size: 14.5px; }
.ev-eclipse .what { font-weight: 500; }
.ev-station .what, .ev-ingress .what { }

/* Rarity pill */
.hist { display: inline-block; margin-left: 6px; vertical-align: middle; }
.hist[open] { display: block; margin: 6px 0 0; }
.hist > summary { list-style: none; display: inline-flex; cursor: pointer; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); }
.hist.rare > summary { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.hist > summary::-webkit-details-marker { display: none; }
.hist-panel { margin-top: 6px; padding: 10px 14px; background: var(--surface-2); border-radius: 10px; }
.hist-head { font-weight: 600; margin: 0 0 2px; font-size: 13.5px; }
.hist-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 3px 16px; max-height: 260px; overflow-y: auto; font-family: var(--mono); font-size: 12.5px; }
.hist-list.wide { max-height: none; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 2px; max-height: 620px; overflow-y: auto; }
.tl-row { display: grid; grid-template-columns: minmax(150px, 260px) 1fr; gap: 10px; align-items: center; font-size: 13px; }
.tl-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label .small { color: var(--text-3); }
.tl-track { position: relative; height: 16px; background: var(--surface-2); border-radius: 4px; }
.tl-bar { position: absolute; top: 3px; height: 10px; border-radius: 5px; background: var(--blend); opacity: .55; }
.nat-tense .tl-bar { background: var(--tense); } .nat-easy .tl-bar { background: var(--easy); }
.tl-x { position: absolute; top: -1px; transform: translateX(-50%); font-size: 11px; color: var(--text); }
@media (max-width: 640px) { .tl-row { grid-template-columns: 1fr; gap: 2px; margin-bottom: 4px; } .tl-label .small { display: none; } }

/* Calendar */
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { font-size: 12px; color: var(--text-3); padding: 4px 6px; }
.cal-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-cell { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 5px; font-size: 11.5px; overflow: hidden; }
.cal-cell.pad { background: var(--surface-2); }
.cal-cell.today { background: var(--accent-soft); }
.cal-d { font-weight: 600; font-size: 12px; color: var(--text-2); }
.cal-ev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; font-family: var(--glyph); }
.cal-ev .mono { font-size: 10px; color: var(--text-3); }
.cal-ev.ev-eclipse { color: var(--bad); }
.cal-ev.ev-station { color: var(--accent); font-weight: 600; }
.cal-ev.ev-voc { color: var(--text-3); }
.rare-dot { color: var(--gold); }
@media (max-width: 700px) { .cal-cell { min-height: 70px; font-size: 10px; padding: 2px; } .cal-ev .mono { display: none; } }

/* Wheel */
.wheel-card { padding: 10px; }
.wheel { width: 100%; height: auto; display: block; max-width: 640px; margin: 0 auto; overflow: visible; }
.w-bg { fill: var(--surface); stroke: var(--line-strong); }
.w-sign { stroke: var(--line-strong); stroke-width: .6; }
.w-sign.el-fire { fill: var(--fire-soft); } .w-sign.el-earth { fill: var(--earth-soft); } .w-sign.el-air { fill: var(--air-soft); } .w-sign.el-water { fill: var(--water-soft); }
.w-sign-glyph { font-family: var(--glyph); font-size: 19px; text-anchor: middle; dominant-baseline: central; }
.w-sign-glyph.el-fire { fill: var(--fire); } .w-sign-glyph.el-earth { fill: var(--earth); } .w-sign-glyph.el-air { fill: var(--air); } .w-sign-glyph.el-water { fill: var(--water); }
.w-tick { stroke: var(--line-strong); stroke-width: .6; }
.w-line { fill: none; stroke: var(--line-strong); }
.w-line.faint { stroke-dasharray: 2 3; }
.w-house { stroke: var(--line-strong); stroke-width: .7; }
.w-house.angular { stroke: var(--text-2); stroke-width: 1.6; }
.w-house-num { font-size: 10px; fill: var(--text-3); text-anchor: middle; dominant-baseline: central; font-family: var(--mono); }
.w-angle { stroke: var(--text); stroke-width: 2; }
.w-angle-label { font-size: 11px; font-weight: 700; fill: var(--text); text-anchor: middle; dominant-baseline: central; }
.w-asp { stroke-width: 1.15; } .w-asp.dim { opacity: .07 !important; }
.w-asp.asp-tense { stroke: var(--tense); } .w-asp.asp-easy { stroke: var(--easy); } .w-asp.asp-blend { stroke: var(--blend); } .w-asp.asp-creative { stroke: var(--creative); stroke-dasharray: 3 2; }
.w-ptick { stroke: var(--text-2); stroke-width: 1; } .w-ptick.outer { stroke: var(--accent); }
.w-point { cursor: default; outline: none; }
.w-glyph { font-family: var(--glyph); font-size: 18px; text-anchor: middle; dominant-baseline: central; fill: var(--text); }
.w-point.outer .w-glyph { fill: var(--accent); font-size: 15px; }
.w-deg { font-size: 9px; text-anchor: middle; dominant-baseline: central; fill: var(--text-3); font-family: var(--mono); }
.w-point:hover .w-glyph, .w-point:focus .w-glyph { fill: var(--accent); font-weight: 700; }

/* Map */
.map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
#map { height: 560px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); }
.map-side { max-height: 560px; overflow-y: auto; margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
@media (max-width: 900px) { .map-wrap { grid-template-columns: 1fr; } #map { height: 420px; } }

/* Settings text editor */
.ed-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 6px 18px; }
.ed-row { flex-direction: row; align-items: center; gap: 10px; }
.ed-row span { width: 130px; flex-shrink: 0; font-family: var(--glyph); }
.ed-row input { flex: 1; font-size: 13.5px; padding: 6px 8px; }
.ed-row.edited input { border-color: var(--accent); background: var(--accent-soft); }

/* Report */
.report-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.report-tools span { flex: 1; }
.report-body { outline: none; max-width: 760px; line-height: 1.65; padding: 6px 2px; }
.report-body:focus { box-shadow: 0 0 0 2px var(--accent-soft); border-radius: 6px; }
.report-body p { margin: 0 0 .7em; }

.profection .lead { margin: 4px 0 8px; }
.tally { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 600; }
.tally .nat-easy { color: var(--easy); } .tally .nat-tense { color: var(--tense); } .tally .nat-blend { color: var(--blend); }
.prose { max-width: 820px; } .prose li { margin-bottom: 6px; }

/* Place suggestions */
.suggest { list-style: none; margin: 2px 0 0; padding: 0; border-radius: 9px; overflow: hidden; box-shadow: var(--shadow); }
.suggest:empty { display: none; }
.suggest li { padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-top: 0; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-weight: 400; color: var(--text); font-size: 14px; }
.suggest li:first-child { border-top: 1px solid var(--line); }
.suggest li:hover { background: var(--accent-soft); }
.suggest li span { color: var(--text-3); font-size: 12.5px; }

/* Modal & toast */
.modal-root { display: none; }
.modal-root.open { display: block; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 8, 20, .5); z-index: 90; }
.modal { position: fixed; z-index: 100; left: 50%; top: 5vh; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); max-height: 90vh; overflow-y: auto; background: var(--surface); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.modal header h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 16px 18px 18px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 200; font-size: 14px; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.error { background: var(--bad); color: #fff; }

@media (max-width: 640px) {
  .ev { grid-template-columns: 70px minmax(0, 1fr); }
  .picker select { min-width: 0; width: 100%; }
  .picker { width: 100%; } .picker label { flex: 1; }
  .ed-row { flex-direction: column; align-items: stretch; } .ed-row span { width: auto; }
  ul.cols { columns: 1; }
  .positions .notes .kw { display: none; }
}

/* Print: the page itself becomes the report */
@media print {
  .side, .top, .foot, .toolbar, .tabs, .export-row, .report-tools, .btn, .hist > summary { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .hist-panel { display: block; }
}

/* ── Plain-English explanations (tips.js) ── */
.term { text-decoration: underline dotted color-mix(in srgb, var(--accent) 70%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; cursor: help; }
.term.quiet, .term-glyph { text-decoration: none; cursor: help; }
.term:hover, .term:focus-visible { background: var(--accent-soft); border-radius: 3px; outline: none; }
body.tips-off .term { text-decoration: none; cursor: inherit; }
body.tips-off .term:hover { background: none; }
.nav a .term, .btn .term, .tabs .term { text-decoration: none; }
.tip { position: absolute; z-index: 300; background: var(--text); color: var(--bg); padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; box-shadow: 0 8px 30px rgba(0,0,0,.3); pointer-events: none; display: flex; flex-direction: column; gap: 4px; }
.tip[hidden] { display: none; }
.tip strong { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.tip strong:empty { display: none; }
.tip em { font-style: normal; font-family: var(--mono); font-size: 12.5px; opacity: .9; }
.tips-btn { width: auto; padding: 0 10px; gap: 6px; font-size: 13px; font-weight: 600; }
.tips-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tips-lbl { font-weight: 500; }
@media (max-width: 520px) { .tips-lbl { display: none; } }
.nav a { display: flex; flex-direction: column; line-height: 1.3; }
.nav-sub { font-size: 11.5px; color: #8a83a3; font-weight: 400; }
.nav a.active .nav-sub, .nav a:hover .nav-sub { color: #b9b2cc; }
.explain { background: var(--surface-2); border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; color: var(--text-2); font-size: 14px; max-width: 860px; }
.explain strong { color: var(--text); }
.day-block { margin-bottom: 14px; }
.day-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 18px; background: var(--side); color: #f1ead9; border-radius: var(--radius) var(--radius) 0 0; }
.day-head h3 { margin: 0; color: #fff; }
.day-head .muted { color: #b9b2cc; }
.day-block .card { border-radius: 0 0 var(--radius) var(--radius); margin: 0; }
.chipline { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ev-personal .what { border-left: 3px solid var(--accent); padding-left: 8px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.stat .k { font-size: 12px; color: var(--text-3); }
.stat .v { font-size: 16px; font-weight: 600; }
.ev.moonish .what { color: var(--text-2); font-size: 13.5px; }
.inline-row { display: flex; align-items: center; gap: 10px; }
.inline-row input[type=range] { flex: 1; max-width: 420px; }
.ed-row textarea { flex: 1; font-size: 13.5px; padding: 6px 8px; }
.ed-row.edited textarea { border-color: var(--accent); background: var(--accent-soft); }

.ya-period { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.ya-period .lead { margin: 4px 0 6px; }
.ya-period details { margin: 4px 0; }
.moon-toggle { margin: 0 0 16px; background: var(--surface); }
.moon-toggle legend label { font-weight: 600; }
.moon-toggle .chip:has(input:disabled) { opacity: .5; }
