/* Plansza I — Konstelacja ustaw */

#sky { cursor: grab; }
#sky.dragging { cursor: grabbing; }

/* krawędzie: cienki biały rysunek na odbitce */
.edges line { stroke: var(--paper); stroke-linecap: round; transition: opacity 0.25s; }
.edges line.off { opacity: 0.015 !important; }
.edges line.lit { stroke: var(--brass); opacity: 0.85 !important; }

/* linie treści: para z listy albo najbliżsi treścią wybranego aktu */
.semlinks line { stroke: var(--brass); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.7; pointer-events: none; }
.semlinks line.pair { stroke-dasharray: none; stroke-width: 1.6; opacity: 0.9; }

/* gwiazdy */
.stars g { transition: opacity 0.25s; }
.stars g.dim { opacity: 0.12; }
/* w układzie według treści akty bez położenia (za mało orzeczeń w próbie) */
#sky.sem .stars g.nopos { opacity: 0.18; }
#sky.sem .labels text.nopos { opacity: 0.25; }
.stars circle.core { stroke: none; cursor: pointer; }
.stars circle.halo { pointer-events: none; }
.stars g.sel circle.core { stroke: var(--brass); stroke-width: 2px; }
.stars g.sel circle.halo { fill: var(--brass); opacity: 0.22; }
.stars circle.core:focus-visible { outline: none; stroke: var(--brass); stroke-width: 2px; }

/* podpisy gwiazd */
.labels text {
  font-family: var(--serif); fill: var(--paper); pointer-events: none;
  paint-order: stroke; stroke: var(--ground); stroke-width: 3px; stroke-linejoin: round;
  transition: opacity 0.25s;
}
.labels text.dim { opacity: 0.1; }
.labels text.hidden { opacity: 0; }
.labels text.sel { fill: var(--brass); }

/* nazwy gwiazdozbiorów */
.constellations text {
  font-family: var(--serif); font-size: 44px; font-style: italic; letter-spacing: 0.02em;
  fill: var(--paper); opacity: 0.13; pointer-events: none; text-anchor: middle;
  transition: opacity 0.6s;
}
.constellations text.lit { opacity: 0.4; }
.constellations text.hide { opacity: 0; }

/* wyszukiwarka u góry płótna */
.search { position: absolute; left: 24px; top: 20px; z-index: 6; width: 320px; }
.search input { width: 100%; background: rgba(8, 11, 17, 0.85); }
.sugg {
  list-style: none; margin: 4px 0 0; padding: 4px 0; max-height: 320px; overflow-y: auto;
  background: var(--ground-deep); border: 1px solid var(--rule); border-radius: 3px;
}
.sugg li { padding: 6px 12px; cursor: pointer; font-size: var(--t-sm); display: flex; gap: 10px; align-items: baseline; }
.sugg li b { font-family: var(--serif); font-weight: 500; white-space: nowrap; }
.sugg li span { color: var(--ink-muted); font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg li[aria-selected="true"], .sugg li:hover { background: var(--ground-lift); }
.sugg li[aria-selected="true"] b { color: var(--brass); }

.controls { flex-direction: column; align-items: flex-start; gap: 10px; }
.controls .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.controls .layout-ctl { display: inline-flex; align-items: center; gap: 8px; }
.controls .ctl-label { font-size: var(--t-xs); color: var(--ink-muted); }
.controls .legend span { cursor: pointer; }
.controls .legend span.on { color: var(--paper); }
button.ghost { background: transparent; color: var(--ink-muted); }
button.ghost:hover { color: var(--paper); }

/* panel szczegółów */
.panel .hero { font-family: var(--serif); font-size: var(--t-2xl); line-height: 1; margin: 14px 0 2px; color: var(--paper); }
.panel .hero small { font-size: var(--t-md); color: var(--ink-muted); margin-left: 6px; }
.panel .sub { color: var(--ink-muted); font-size: var(--t-sm); margin: 0 0 6px; }
.panel .area-tag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--ink-muted); }
.panel .area-tag i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.panel .title { font-family: var(--serif); font-size: var(--t-md); color: var(--ink-muted); line-height: 1.35; margin-top: 4px; }
.panel .h3row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel .h3row h3 { margin-bottom: 6px; }
.panel .seg.small button { font-size: var(--t-xs); padding: 3px 9px; }
.panel svg.spark { display: block; width: 100%; height: 96px; overflow: visible; }
.panel .areas-bar { display: flex; height: 8px; border-radius: 2px; overflow: hidden; margin: 6px 0 10px; }
.panel .areas-bar i { display: block; height: 100%; }
.panel .rows li .k { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.panel .rows li .k small { color: var(--ink-faint); font-size: var(--t-xs); white-space: nowrap; }
.panel .rows li .k b { font-weight: 500; }
.panel .rows li .v em { font-style: normal; color: var(--brass); }
.panel .back { margin-top: 24px; font-size: var(--t-sm); color: var(--ink-muted); }
.panel .back button { background: none; border: 0; padding: 0; color: var(--ink-muted); text-decoration: underline; text-underline-offset: 3px; }
.panel .back button:hover { color: var(--brass); }
.panel .note { font-size: var(--t-xs); color: var(--ink-faint); margin-top: 8px; line-height: 1.45; }
.panel h3 + .note { margin: -2px 0 8px; }

/* znaczniki zgodności obu map przy sąsiadach */
.panel .rows li .k .tag { font-size: var(--t-xs); white-space: normal; }
.panel .rows li .k .tag.agree { color: var(--ink-faint); }
.panel .rows li .k .tag.warn { color: var(--brass); }
.panel .twin.sem-first { display: flex; flex-direction: column-reverse; }

/* pary z list: ukryte pokrewieństwa, dziwne pary */
.panel .rows.pairs li .k { flex-direction: column; align-items: flex-start; gap: 1px; }
.panel .rows.pairs li .k .names { line-height: 1.3; }
.panel .rows.pairs li .k .amp { color: var(--ink-faint); margin: 0 2px; }
.panel .rows.pairs li .k small { white-space: normal; color: var(--ink-muted); }
.panel .rows.pairs li .v { font-family: var(--serif); color: var(--paper); }
.panel .rows.pairs li:focus-visible { outline-offset: -2px; }

/* karta pary */
.panel .kicker { font-family: var(--serif); font-style: italic; color: var(--brass); font-size: var(--t-md); margin-bottom: 8px; }
.panel .pair-acts li.act .k { flex-direction: column; align-items: flex-start; gap: 0; }
.panel .pair-acts li.act .k b { font-family: var(--serif); font-size: var(--t-lg); font-weight: 500; }
.panel .pair-acts li.act .k small { white-space: normal; line-height: 1.3; }
.panel .pair-acts li.act .v { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); }
.panel .pair-acts li.act .v .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.panel .pair-nums { display: flex; gap: 24px; margin: 16px 0 6px; }
.panel .pair-nums .big { display: block; font-family: var(--serif); font-size: var(--t-2xl); line-height: 1; color: var(--paper); }
.panel .pair-nums small { display: block; color: var(--ink-muted); font-size: var(--t-xs); margin-top: 4px; }

@media (max-width: 900px) {
  .search { width: calc(100% - 48px); }
  .constellations text { font-size: 30px; }
}
