/* map.css: page layer on top of flat-warm.css. Tokens only. */
:root { --halo: var(--bg); }
.fw-brand { font-size: 1.1rem; }

.hero { max-width: 90rem; margin: 0 auto; padding: 2.2rem 1.25rem 1rem; display: flow-root; }
.cover { float: right; width: 9.5rem; height: auto; margin: 0 0 1rem 1.5rem; display: block; }
@media (max-width: 860px) { .cover { width: 5.5rem; margin-left: 1rem; } }
.kicker { margin: 0 0 0.4rem; font-family: var(--font-heading); font-size: 0.8125rem; color: var(--nacht); }
.kicker cite { font-style: italic; }
.hero h1 { margin: 0 0 0.6rem; font-family: var(--font-inscription); font-weight: 400; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; color: var(--fg-title); }
.lede { max-width: 46rem; margin: 0; color: var(--fg-second); }
.lede em { color: var(--fg-title); font-style: italic; }

.layout { max-width: 90rem; margin: 0 auto; padding: 0.5rem 1.25rem 1rem; display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1.25rem; align-items: start; }
.stage { min-width: 0; }
.controls { margin-bottom: 0.6rem; }
.controls .fw-group { gap: 0.4rem 1rem; }
.controls .fw-check { font-family: var(--font-heading); font-size: 0.8125rem; color: var(--fg-second); }
.scroller { overflow-x: auto; background: var(--bg-high); }
#map { display: block; width: 100%; min-width: 860px; height: auto; }

.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-top: 0.6rem; font-family: var(--font-heading); font-size: 0.75rem; color: var(--fg-dim); }
.legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.lg { display: inline-block; width: 1.6rem; height: 0; border-top: 2px solid var(--fg-dim); }
.lg-reg { border-top: 2px dashed var(--rubric); }
.lg-retro { border-top: 2px dotted var(--nacht); }
.lg-trans { border-top: 2px solid var(--gold); }
.lg-crit { width: 0.7rem; height: 0.7rem; border: none; background: var(--gold); transform: rotate(45deg); }

/* ---------- svg ---------- */
#map text { font-family: var(--font-heading); }
.band-a { fill: var(--bg); }
.band-b { fill: var(--bg-high); }
.band-dim { fill: var(--bg-high); }
.band-num { font-family: var(--font-inscription) !important; font-size: 30px; fill: var(--rubric); }
.band-title { font-size: 15px; font-weight: 600; fill: var(--rubric); }
.band-sub { font-size: 12px; fill: var(--fg-dim); }
.band-hit { cursor: pointer; }
.band-hit:hover .band-title, .band-hit:focus-visible .band-title { fill: var(--accent); }
.axis-l { font-size: 12px; fill: var(--fg-dim); }
.axis-bar { opacity: 0.9; }

.edge { fill: none; stroke-width: 1.6; transition: opacity 70ms, stroke 70ms; }
.e-gen { stroke: var(--fg-faint); }
.e-reg { stroke: var(--rubric); stroke-dasharray: 6 4; }
.e-retro { stroke: var(--nacht); stroke-dasharray: 2 4; stroke-linecap: round; }
.e-trans { stroke: var(--gold); stroke-width: 2; }
.e-skip { stroke: var(--gold); stroke-width: 1.6; stroke-dasharray: 1 5; stroke-linecap: round; }
.e-treat { stroke: var(--accent); stroke-dasharray: 6 4; opacity: 0.8; }
.e-rhyme { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 1 4; stroke-linecap: round; opacity: 0.8; }
.e-dim { opacity: 0.35; }
.elabel { font-size: 12px; fill: var(--fg-dim); font-style: italic; paint-order: stroke; stroke: var(--halo); stroke-width: 4px; stroke-linejoin: round; }
.elabel.reg { fill: var(--rubric); }
.elabel.trans { fill: var(--gold); }
.elabel.retro { fill: var(--nacht); }

.node { cursor: pointer; outline: none; }
.node .mk { fill: var(--fg-title); transition: fill 70ms; }
.node.reg .mk { fill: var(--rubric); }
.node.crit .mk { fill: var(--gold); }
.node.dim .mk { fill: var(--fg-faint); }
.node .hit { fill: transparent; }
.node .t { font-size: 14px; font-weight: 600; fill: var(--fg-title); paint-order: stroke; stroke: var(--halo); stroke-width: 4px; stroke-linejoin: round; }
.node .d { font-size: 12px; fill: var(--fg-dim); font-style: italic; paint-order: stroke; stroke: var(--halo); stroke-width: 4px; stroke-linejoin: round; font-family: var(--font-ui) !important; }
.node .s { font-size: 12px; fill: var(--gold); paint-order: stroke; stroke: var(--halo); stroke-width: 4px; stroke-linejoin: round; font-variant-numeric: tabular-nums; }
.node.reg .t { fill: var(--rubric); }
.node.dim .t { fill: var(--fg-dim); }
.node:hover .t, .node:focus-visible .t { fill: var(--accent); }
.node:hover .mk, .node:focus-visible .mk { fill: var(--accent); }
.node.sel .mk { fill: var(--accent); }
.node.sel .t { fill: var(--accent); }
.node .ring { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; }
.node.sel .ring, .node:focus-visible .ring { opacity: 1; }
.halo-b .t, .halo-b .d, .halo-b .s { stroke: var(--bg-high); }
.elabel.halo-b { stroke: var(--bg-high); }

.sym rect { fill: var(--gold); }
.sym text { font-size: 12px; font-weight: 600; fill: var(--bg); text-anchor: middle; }
.sym { cursor: pointer; }

#map.has-sel .edge:not(.on) { opacity: 0.25; }
#map.has-sel .edge.on { opacity: 1; stroke-width: 2.4; }

.layer-off { display: none; }

/* ---------- panel ---------- */
.panel { position: sticky; top: 1rem; background: var(--bg-high); padding: 1.1rem 1.2rem 1.3rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.panel-close { display: none; float: right; }
.p-reg { margin: 0 0 0.2rem; font-family: var(--font-heading); font-size: 0.75rem; font-weight: 600; color: var(--rubric); letter-spacing: 0.02em; }
.panel h2 { margin: 0 0 0.15rem; font-family: var(--font-heading); font-size: 1.2rem; line-height: 1.25; color: var(--fg-title); }
.p-de { margin: 0 0 0.6rem; font-style: italic; color: var(--fg-dim); }
.p-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0 0 0.8rem; }
.tag { display: inline-block; padding: 0.15rem 0.45rem; background: var(--chip); font-family: var(--font-heading); font-size: 0.75rem; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; }
.tag.ch { color: var(--nacht); }
.tag.kind-reg { color: var(--rubric); }
.tag.kind-crit { color: var(--gold); }
.panel p { margin: 0 0 0.7rem; }
.panel .p-body p:last-child { margin-bottom: 0; }
.p-links { margin-top: 1rem; }
.p-links h3 { margin: 0 0 0.35rem; font-family: var(--font-heading); font-size: 0.75rem; font-weight: 600; color: var(--fg-dim); }
.p-links .fw-group { gap: 0.3rem; }
.p-links .fw-btn { font-weight: 400; }
.p-links .fw-btn b { font-weight: 600; color: var(--fg-dim); margin-right: 0.15rem; }
.p-hint { color: var(--fg-dim); font-size: 0.875rem; }

/* ---------- outline ---------- */
.outline { min-width: 0; }
.ol-band { margin: 0 0 1.4rem; }
.ol-band h3 { margin: 0 0 0.2rem; font-family: var(--font-heading); font-size: 1rem; color: var(--rubric); }
.ol-band > p { margin: 0 0 0.6rem; color: var(--fg-second); }
.ol-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ol-item { display: grid; grid-template-columns: 0.7rem 1fr auto; gap: 0.7rem; align-items: baseline; width: 100%; padding: 0.55rem 0.7rem; background: var(--bg-high); border: none; text-align: left; transition: background-color 70ms; }
.ol-item:hover { background: var(--chip); }
.ol-item.sel { background: color-mix(in srgb, var(--accent) 14%, var(--bg-high)); }
.ol-item .m { width: 0.55rem; height: 0.55rem; background: var(--fg-title); align-self: center; }
.ol-item.reg .m { background: var(--rubric); }
.ol-item.crit .m { background: var(--gold); transform: rotate(45deg); }
.ol-item .nm { font-family: var(--font-heading); font-weight: 600; color: var(--fg-title); }
.ol-item.reg .nm { color: var(--rubric); }
.ol-item .de { display: block; font-style: italic; font-size: 0.875rem; color: var(--fg-dim); font-weight: 400; font-family: var(--font-ui); }
.ol-item .sc { font-family: var(--font-heading); font-size: 0.75rem; color: var(--gold); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- theses ---------- */
.theses { max-width: 90rem; margin: 0 auto; padding: 1.5rem 1.25rem 1rem; }
.theses h2 { margin: 0 0 0.9rem; font-family: var(--font-heading); font-size: 1rem; color: var(--rubric); }
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 2px; }
.th { background: var(--bg-high); padding: 1rem 1.1rem 1.1rem; }
.th .n { font-family: var(--font-inscription); font-size: 1.6rem; line-height: 1; color: var(--gold); }
.th h3 { margin: 0.35rem 0 0.4rem; font-family: var(--font-heading); font-size: 1rem; color: var(--fg-title); }
.th p { margin: 0 0 0.6rem; color: var(--fg-second); font-size: 0.9375rem; }
.th .p-tags { margin: 0; }

.foot { max-width: 90rem; margin: 0 auto; padding: 1rem 1.25rem 2.5rem; color: var(--fg-dim); font-size: 0.8125rem; }
.foot b { font-family: var(--font-heading); color: var(--gold); font-weight: 600; }

/* ---------- phone ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 62vh; z-index: 20; padding-top: 0.8rem; transform: translateY(100%); transition: transform 160ms; }
  .panel.open { transform: none; }
  .panel-close { display: inline-flex; }
  body.sheet-open { padding-bottom: 62vh; }
}
@media (max-width: 860px) {
  .hero, .layout, .theses, .foot { padding-left: 16px; padding-right: 16px; }
  .fw-brand { font-size: 1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fw-nav { gap: 0.5rem; padding: 0.5rem 16px; }
  .fw-nav .fw-group { flex-wrap: nowrap; }
  :root { --hit: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
