/* ABOUTME: Stylesheet for the Grim Dawn Devotion Planner static page. */
/* ABOUTME: Covers layout (header, map, sidebars), SVG star states, art tint, and tooltip. */
:root {
  /* Tunable map visuals. */
  --link-color: #6f82ad; /* constellation lines (brighter than the art) */
  --link-width: 4px; /* carries a unit so calc(var(--link-width) * N) resolves for SVG stroke-width */
  --link-taken-color: #f0c14b; /* gold, like grimtools, for a segment whose both ends are taken */
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #0d1117;
  color: #e6edf3;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
header {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  /* Dragging the slider must never select header text (-webkit- is required on iOS Safari). */
  -webkit-user-select: none;
  user-select: none;
}
/* Points group (label + bar + total) on the left, reset controls pushed to the right. */
.plabel {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #9aa4b2;
  flex: none;
}
#point-total {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: #aab4c0;
  white-space: nowrap;
  flex: none;
}
#total-word {
  color: #9aa4b2;
}
/* The cap is a button: click it to remove the point limit (shows the infinity glyph), click again to restore it. */
#cap-toggle {
  font-variant-numeric: tabular-nums;
  color: #e6edf3;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
}
#cap-toggle:hover {
  background: #1a2230;
  border-color: #6cb6ff;
  color: #fff;
}
/* Blocked re-cap (still over 55 while uncapped): pulse the used count red. */
@keyframes flash-blocked-count {
  0%,
  100% {
    color: #9aa4b2;
  }
  50% {
    color: #ff6b6b;
  }
}
#cap-toggle.flash-blocked {
  animation: flash-blocked-count 0.5s ease-in-out 3;
}
header button {
  margin-left: 0;
  background: #21262d;
  color: #e6edf3;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition:
    background 0.12s,
    border-color 0.12s;
}
header button:hover {
  background: #2d333b;
  border-color: #444c56;
}
header button:active {
  background: #1a1e24;
}
/* With Reset view removed, push Reset points to the far right of the top bar. */
#reset-points {
  margin-left: auto;
}
/* Header app menu: a hamburger button at the header's right edge opening one popover with a cross-app
   link, the language list, and the About panel. Shared by both pages (both load this stylesheet). */
.app-menu {
  position: relative;
  flex: none;
}
.app-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.45rem; /* icon fits tighter than the text buttons */
  line-height: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: #9aa4b2; /* subtle by default; brightens on hover */
}
.app-menu-btn:hover {
  color: #e6edf3;
}
.app-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: 17rem;
  padding: 0.35rem;
  background: #1b2129;
  border: 1px solid #30363d;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  font-size: 0.85rem;
  color: #e6edf3;
}
.app-menu-panel[hidden] {
  display: none;
}
.app-menu-sep {
  border-top: 1px solid #30363d;
  margin: 0.3rem 0;
}
/* Cross-app link: a plain row, kept light even on the RR page (whose global `a` color is gold). */
.app-menu-panel a.app-menu-nav {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  color: #e6edf3;
  text-decoration: none;
  font-weight: 600;
}
.app-menu-panel a.app-menu-nav:hover {
  background: #2d333b;
}
.app-menu-heading {
  display: block;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7e8aa0;
}
.app-menu-langlist {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 40vh;
  overflow-y: auto;
}
/* Locale rows are plain rows, not the boxed header buttons they would otherwise inherit. */
.app-menu-langlist button {
  display: block;
  width: 100%;
  margin: 0;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  color: #e6edf3;
  font-size: 0.85rem;
  cursor: pointer;
}
.app-menu-langlist button:hover {
  background: #2d333b;
}
.app-menu-langlist button.current {
  font-weight: 600;
}
.app-menu-langlist button.current::after {
  content: "✓";
  float: right;
  margin-left: 0.75rem;
  color: #9aa4b2;
}
.app-menu-about {
  padding: 0.35rem 0.6rem;
}
.app-menu-about p {
  margin: 0 0 0.4rem;
}
.app-menu-about p:last-child {
  margin-bottom: 0;
}
.app-menu-about a {
  color: #6cb6ff;
}
.app-menu-about .info-version {
  color: #9aa4b2;
}
/* Points budget bar: used (spent) / min (validity floor) / headroom, with a grey cap grabber. */
#point-bar {
  position: relative;
  flex: 1 1 auto;
  max-width: 420px;
  min-width: 220px;
  height: 24px;
  border-radius: 7px;
  background: #30363d;
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
#point-bar:focus-visible {
  outline: 2px solid #6cb6ff;
  outline-offset: 2px;
}
#point-bar.uncapped {
  cursor: default;
  opacity: 0.75;
}
.pb-seg {
  position: absolute;
  top: 0;
  bottom: 0;
}
.pb-used {
  left: 0;
  background: #2f6da8;
  border-radius: 7px 0 0 7px;
}
.pb-min {
  background: #8a6233;
}
.pb-head {
  background: #2a3d56;
}
.pb-lab {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 0 6px;
  pointer-events: none;
  text-shadow: 0 1px 2px #000;
  color: #e6edf3;
  z-index: 2;
}
.pb-grab {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #aab4c0;
  border: 2px solid #161b22;
  box-shadow: 0 1px 3px #000;
  transform: translate(-50%, -50%);
  cursor: grab;
  z-index: 3;
}
.pb-grab:active {
  cursor: grabbing;
}
main {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr 250px;
  min-height: 0;
}
.sidebar {
  overflow-y: auto;
  padding: 0.75rem;
  background: #11161d;
  border-inline: 1px solid #30363d;
  font-size: 0.85rem;
}
.sidebar h2 {
  font-size: 1rem;
  margin: 0.25rem 0 0.5rem;
}
.sidebar h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #9aa4b2;
  margin: 0.7rem 0 0.3rem;
  border-bottom: 1px solid #30363d;
  padding-bottom: 0.2rem;
}
.benefit,
.affinity {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  gap: 0.5rem;
}
.benefit > span:first-child {
  text-transform: capitalize;
}
.benefit .val,
.affinity .val {
  color: #cdd6e3;
  white-space: nowrap;
}
/* Flash a value when it changes since the last selection: yellow up, red down. */
@keyframes flash-up {
  from {
    color: #ffe066;
  }
}
@keyframes flash-down {
  from {
    color: #ff6b6b;
  }
}
.benefit.up .val,
.affinity.up .val {
  animation: flash-up 10s linear;
}
.benefit.down .val,
.affinity.down .val {
  animation: flash-down 10s linear;
}
/* Condensed benefits: selectable subject groups (avail path only; active path uses .brow). */
.bgroup {
  border-radius: 6px;
  padding: 1px 5px;
  margin: 1px -3px;
  transition:
    background 0.1s,
    box-shadow 0.1s;
}
/* The single "active filter tag" affordance: a light blue fill + squircle outline, matching the
   Available-to-get pills. Each element keeps its own border-radius; hover rules light the label. */
.bgroup.gsel,
.brow.vsel,
.affinity.vsel,
.tip-bonus.vsel,
.aff.vsel {
  background: rgba(108, 182, 255, 0.08);
  box-shadow: 0 0 0 1.5px rgba(108, 182, 255, 0.6);
}
.bsubj {
  text-transform: capitalize;
  cursor: pointer;
}
.bsubj:hover {
  color: #6cb6ff;
}
/* Unified benefit rows: one value per row, compact, both modes */
.brow {
  display: flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.45;
}
.brow.vsel {
  border-radius: 4px;
}
.brow-lbl {
  flex: 1;
  min-width: 0; /* let a long label shrink and ellipsize instead of pushing the value columns right */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brow-lbl.subj {
  color: #d7c89a;
  cursor: pointer;
}
.brow-lbl.subj:hover,
.brow.vsel .brow-lbl.subj {
  color: #6cb6ff;
}
.brow-lbl.subj.up {
  color: #83c995;
}
.brow-lbl.subj.down {
  color: #e0696a;
}
.brow-lbl.subj.mixed {
  color: #6f9fc4;
}
.brow-lbl.sub {
  color: #7e8aa0;
  padding-left: 12px;
  font-size: 0.78rem;
}
.brow-lbl.cont {
  padding-left: 12px;
}
.brow-vals {
  display: flex;
  cursor: pointer;
}
.brow-v {
  width: 64px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #c9d3e0;
}
/* regular-mode flash reuses the same green/red via the ' up'/' down' class changeClass adds */
.brow-v.base {
  color: #7e8aa0;
}
.brow-v.up {
  color: #83c995;
}
.brow-v.down {
  color: #e0696a;
}
.brow-v.same {
  color: #566175;
}
/* compare control row: Swap at the left, Revert over Base, Update Baseline over Now+Delta */
.cmp-controls {
  display: flex;
  align-items: center;
  padding: 0 5px 5px;
}
.cmp-controls .cmp-spacer {
  flex: 1;
}
.cmp-controls .cmp-swap-slot {
  width: 64px;
  text-align: center;
}
.cmp-controls .cmp-revert-slot {
  width: 64px;
  text-align: center;
}
.cmp-controls .cmp-upd-slot {
  width: 128px;
  text-align: center;
}
.cmp-controls button {
  background: #161d27;
  border: 1px solid #283446;
  border-radius: 4px;
  padding: 2px 0;
  font-size: 0.7rem;
  cursor: pointer;
}
#cmp-revert {
  width: 60px;
  color: #d7c89a;
}
#cmp-update {
  width: 124px;
  color: #83c995;
}
#cmp-swap {
  width: 60px;
  color: #6cb6ff;
}
.cmp-head {
  display: flex;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7e8aa0;
  border-bottom: 1px solid #283446;
  padding: 0 5px 4px;
  margin-bottom: 4px;
}
.cmp-head .brow-lbl {
  flex: 1;
}
/* "Available to get": the rest of the catalog as compact, taggable pills. */
.avail-head {
  margin-top: 1.6rem;
  padding-top: 0.9rem;
  border-top: 1px solid #30363d;
  color: #8a93a3;
}
.bempty {
  color: #9aa4b2;
  font-size: 0.82rem;
  padding: 2px 0;
}
.avail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.2rem;
}
.bgroup.avail {
  display: inline-flex;
  margin: 0;
  padding: 1px 9px;
  border-radius: 6px; /* squircle, matching the other selected-filter outlines (not a pill) */
  background: rgba(255, 255, 255, 0.045);
}
.bgroup.avail .bsubj {
  color: #9aa4b2;
}
.bgroup.avail:hover .bsubj {
  color: #cdd6e3;
}
.bgroup.avail.gsel {
  background: rgba(108, 182, 255, 0.12);
}
.bgroup.avail.gsel .bsubj {
  color: #cfe8ff;
}
.affinity > span:first-child {
  text-transform: capitalize;
}
.affinity:hover > span:first-child {
  color: #6cb6ff;
}
/* Affinity panel: two columns - current "have" total + wanted-max "need" (red unmet, green met).
   The rows are clickable grant-filter toggles, so they carry the pointer affordance always. */
.affinity {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  align-items: baseline;
  cursor: pointer;
}
.affinity-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7480;
  padding-bottom: 0.2rem;
}
.aff-have {
  font-variant-numeric: tabular-nums;
  color: #cdd6e3;
  min-width: 1.6em;
  text-align: right;
  white-space: nowrap;
}
.aff-need {
  font-variant-numeric: tabular-nums;
  min-width: 1.6em;
  text-align: right;
  cursor: help;
}
.aff-need.missing {
  color: #e0696a;
}
.aff-need.met {
  color: #83c995;
}
.aff-need.none {
  color: #5b636e;
  cursor: default;
} /* nothing requires this color: dim, neutral 0 */
.aff-need-h {
  min-width: 1.6em;
  text-align: right;
}
.affinity.up .aff-have {
  animation: flash-up 10s linear;
}
.affinity.down .aff-have {
  animation: flash-down 10s linear;
}
.affinity.vsel {
  border-radius: 6px;
}
/* Full-width divider between the Affinity panel and the "Available to get" list below it. */
.panel-sep {
  border: 0;
  border-top: 1px solid #30363d;
  margin: 1.3rem -0.75rem 0.7rem;
}
/* Search panel. The controls follow the in-sidebar convention set by .cmp-controls
   (#161d27 on #283446, 4px radius) rather than the chunkier header-button one, and the
   count line uses the same muted grey as the sidebar's h3 labels. */
.search-row {
  display: flex;
  gap: 4px;
  align-items: center;
}
#search-input {
  flex: 1;
  min-width: 0;
  background: #161d27;
  border: 1px solid #283446;
  border-radius: 4px;
  padding: 0.3rem 0.4rem;
  color: #e6edf3;
  font-family: inherit;
  font-size: 0.85rem;
}
#search-input::placeholder {
  color: #6b7688;
}
#search-input:focus {
  outline: none;
  border-color: #6cb6ff;
}
/* Chrome renders a second clear affordance inside type="search"; we ship our own button. */
#search-input::-webkit-search-cancel-button {
  display: none;
}
#search-clear {
  flex: none;
  background: #161d27;
  border: 1px solid #283446;
  border-radius: 4px;
  padding: 0.3rem 0.45rem;
  color: #9aa4b2;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
}
#search-clear:hover {
  background: #1d2530;
  border-color: #3d4a5c;
  color: #e6edf3;
}
#search-count {
  margin-top: 0.35rem;
  color: #9aa4b2;
  font-size: 0.75rem;
}
.power,
.tip-power {
  color: #f0c14b;
}
.power[data-star-id] {
  cursor: help;
}
.tip-power-desc {
  color: #c9b88a;
  font-size: 0.92em;
  margin: 0.1rem 0 0.25rem;
}
/* Constellation flavour text. Prose rather than a stat line, so it is italic and muted to sit
   behind the numbers, and it needs line-height a paragraph can breathe in. */
/* A run of text matching the live search query. Bold plus a faint wash, like find-in-page:
   it marks WHICH words matched without changing the characters, so it works in every script. */
.tip-hit {
  color: #cfe6ff;
  background: rgba(108, 182, 255, 0.18);
  border-radius: 2px;
  padding: 0 1px;
}
.tip-flavour {
  color: #98a3b3;
  font-style: italic;
  font-size: 0.92em;
  line-height: 1.35;
  margin: 0.2rem 0 0.35rem;
}
.tip-proc {
  color: #8fb4d6;
  font-size: 0.9em;
}
.tip-power-level {
  color: #9aa4b2;
  font-size: 0.85em;
  margin-bottom: 0.15rem;
}
.tip-pet {
  margin-top: 0.35rem;
  color: #cda6e8;
  font-size: 0.92em;
}
.tip-pet-bonus-head {
  margin-top: 0.35rem;
  color: #cda6e8;
  font-weight: 600;
  font-size: 0.9em;
}
.tip-dim {
  margin-top: 0.35rem;
  color: #e0a96a;
  font-size: 0.9em;
}
.tip-path-cost {
  margin-top: 0.15rem;
  color: #9aa4b2;
  font-size: 0.9em;
}
.bo-partial {
  color: #9aa4b2;
  font-size: 0.85em;
}
#map-container {
  position: relative;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background: radial-gradient(circle at 50% 40%, #15203a, #0d1117 70%);
}
#map-container.con-hover {
  cursor: pointer;
}
#map-container.grabbing {
  cursor: grabbing;
}
#map {
  width: 100%;
  height: 100%;
}
.link {
  stroke: var(--link-color);
  stroke-width: var(--link-width);
  pointer-events: none;
}
/* A fully-taken segment (both endpoint stars selected) glows gold, like grimtools. The bloom is a
   separate wide, faint underlay line (.link-glow, drawn by the renderer just beneath this one): an SVG
   filter glow collapses to nothing on a perfectly horizontal or vertical line, so a filter cannot be
   used here. */
.link.taken {
  stroke: var(--link-taken-color);
  stroke-width: calc(var(--link-width) * 1.35);
}
.link-glow {
  /* gold at low alpha (faintness in the color, so the inline opacity stays free for brightness) */
  stroke: rgba(240, 193, 75, 0.5);
  stroke-width: calc(var(--link-width) * 3.4);
  stroke-linecap: round;
  pointer-events: none;
}
.art {
  pointer-events: none;
}
.art-tint {
  mix-blend-mode: screen;
  pointer-events: none;
}
/* A fully-selected (active) constellation: full-opacity, brighter art with a warm glow so active
   constellations stand out when zoomed out (a calmer, steady version of the old blocked flash). */
.art.active {
  /* SVG-native self-glow + brightness (#self-glow-art); CSS drop-shadow on SVG fails on WebKit/iOS. */
  filter: url(#self-glow-art);
}
.hit {
  fill: transparent;
  pointer-events: all;
}
.hit.selectable,
.hit.selected {
  cursor: pointer;
}
.star {
  stroke: #0d1117;
  stroke-width: 1;
  pointer-events: none;
}
.star.locked {
  fill: #9aa3b2;
}
.star.selectable {
  fill: var(--grad);
  /* SVG-native self-glow (#self-glow); CSS drop-shadow on SVG fails on WebKit/iOS. NOTE: this applies to
     every selectable star (100+ from empty), so if it janks pan/zoom on mobile, drop the glow here. */
  filter: url(#self-glow);
}
.star.selected {
  fill: #fff;
  stroke: var(--grad);
  stroke-width: 7;
}
/* Benefit-match emphasis: a separate full-opacity layer the renderer draws as its own element
   (enlarged + bold halo), so the emphasis reads even on a dim star without overriding the dot's
   attainability opacity. When the star is off the affinity filter the renderer wraps this in
   #mute-wide so the whole glow desaturates. */
.benefit-glow {
  fill: var(--grad);
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(1.45);
  /* SVG-native halo (see #match-glow in the renderer); CSS drop-shadow on SVG fails on WebKit/iOS. */
  filter: url(#match-glow);
}
/* Affinity-filter de-emphasis: drain color, never brightness (see #mute in the renderer). */
.mute {
  filter: url(#mute);
}
/* The affinity match halo (see #aff-glow in the renderer). Non-interactive so it never intercepts a
   click meant for the art/stars beneath or around it. */
.aff-glow {
  pointer-events: none;
}
/* Search-match halo on constellation art. The colour and blur live in the SVG filter
   (#search-glow); this only controls how the masked source rect participates. */
.search-glow {
  pointer-events: none;
}
.orb {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  border-radius: 50%;
  margin-right: 0.3em;
  vertical-align: -0.05em;
}
#tooltip {
  position: fixed;
  display: none;
  pointer-events: none;
  background: #1c2330;
  border: 1px solid #30363d;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  max-width: 280px;
  /* Above the narrow corner toggles (24), scrim (25), and drawers (30) so the popover is never occluded. */
  z-index: 40;
}
#tooltip strong {
  color: #6cb6ff;
}
.tip-cost {
  color: #9aa4b2;
  font-size: 0.9em;
}
.tip-bonus {
  color: #d7c89a;
}
.tip-bonus .val {
  color: #e6edf3;
}
.tip-req {
  margin-top: 0.35rem;
  color: #9aa4b2;
}
.tip-weapon-req {
  margin-top: 0.35rem;
  color: #d7c89a;
  font-style: italic;
}
.tip-grant {
  margin-top: 0.15rem;
  color: #c9d3e0;
}
.tip-req .aff.missing {
  color: #e0696a;
}
.tip-req .aff.met {
  color: #83c995;
}
.tip-req .aff,
.tip-grant .aff {
  text-transform: capitalize;
  white-space: nowrap;
  margin-right: 0.4em;
}
/* Active filter tag inside the tooltip: mirror the sidebar's .brow.vsel selected look. */
.tip-bonus.vsel {
  border-radius: 3px;
}
.aff.vsel {
  border-radius: 3px;
  padding: 0 2px;
}

/* Baseline comparison: widened benefits panel + Base/Now/Delta table */
/* The panel is a grid track, so widen the track (not the item) to give the three value columns room. */
body.comparing main {
  grid-template-columns: 450px 1fr 250px;
}
.cmp-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1b2531;
  border: 1px solid #283446;
  border-radius: 6px;
  padding: 6px 9px;
  margin: 6px 0 10px;
  font-size: 0.78rem;
  color: #d7c89a;
}
#set-baseline {
  float: right;
  background: #1b2531;
  border: 1px solid #283446;
  border-radius: 4px;
  color: #d7c89a;
  font-size: 0.68rem;
  padding: 1px 7px;
  cursor: pointer;
}
#set-baseline.hidden {
  display: none;
}
.star.cmp-add {
  stroke: #83c995;
  stroke-width: 2.5;
}
.star.cmp-rm {
  stroke: #e0696a;
  stroke-width: 1.5;
  stroke-dasharray: 3 2;
}
.bo-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bo-step {
  display: grid;
  grid-template-columns: 1.5em 1.4em 1fr auto auto;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  border-radius: 3px;
}
.bo-step:hover {
  background: rgba(255, 255, 255, 0.06);
}
.bo-n {
  text-align: right;
  opacity: 0.6;
}
.bo-art {
  width: 1.4em;
  height: 1.4em;
  object-fit: contain;
}
.bo-add {
  opacity: 0.85;
  font-style: italic;
}
.bo-refund {
  opacity: 0.6;
  font-style: italic;
}
.bo-pts {
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.bo-held {
  min-width: 2.2em;
  text-align: right;
  opacity: 0.5;
  font-variant-numeric: tabular-nums;
}
.bo-empty {
  opacity: 0.8;
  font-size: 0.9em;
}
.bo-empty-sub {
  margin-top: 4px;
  opacity: 0.6;
  font-size: 0.85em;
}
.bo-compare-head,
.bo-note {
  margin: 2px 0 6px;
  opacity: 0.6;
  font-size: 0.85em;
}
#bo-pop {
  position: fixed;
  display: none;
  pointer-events: none;
  background: #1c2330;
  border: 1px solid #30363d;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  /* Size to content so long localized column heads (e.g. German) get real columns. */
  width: max-content;
  min-width: 200px;
  max-width: 300px;
  /* Same layer as the map tooltip: above corner toggles, scrim, and drawers. */
  z-index: 40;
}
#bo-pop .bo-pop-name {
  font-weight: 600;
  margin-bottom: 4px;
}
/* One shared grid for the whole table (rows join it via display: contents), so every cell in a
   column shares one width: heads sit exactly over their numbers in every locale, and rows with
   parenthetical deltas cannot widen their own columns out of line with plain rows. */
#bo-pop .bo-pop-table {
  display: grid;
  grid-template-columns: 1fr auto auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: baseline;
}
#bo-pop .affinity,
#bo-pop .affinity-head {
  display: contents;
}
#bo-pop .aff-have,
#bo-pop .aff-need,
#bo-pop .aff-need-h {
  text-align: right;
}
#bo-pop .bo-pop-delta {
  opacity: 0.65;
  font-size: 0.78em;
}
.con-highlight {
  fill: none;
  stroke: #ffd479;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

/* --- Narrow layout: overlay drawers + corner toggles (body.narrow set by JS via matchMedia) --- */
.drawer-toggle {
  display: none;
}
#drawer-scrim {
  display: none;
}
body.narrow main {
  grid-template-columns: 1fr;
}
body.narrow .sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 30;
  width: 85vw;
  transition: transform 0.2s ease;
}
body.narrow #benefits {
  left: 0;
  max-width: 380px;
  transform: translateX(-110%);
}
body.narrow #affinity {
  right: 0;
  max-width: 320px;
  transform: translateX(110%);
}
body.narrow #benefits.open,
body.narrow #affinity.open {
  transform: translateX(0);
}
body.narrow .drawer-toggle {
  display: flex;
  position: fixed;
  top: calc(var(--header-h, 52px) + 8px);
  /* Above the scrim (25) so the opposite toggle stays tappable to switch drawers directly while one is open. */
  z-index: 26;
  align-items: center;
  background: #21262d;
  color: #e6edf3;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}
body.narrow .drawer-left {
  left: 8px;
}
body.narrow .drawer-right {
  right: 8px;
}
body.narrow #drawer-scrim.show {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(0, 0, 0, 0.5);
}
/* Narrow top bar: let the slider shrink and drop the "total" word so the point count
   (the cap-toggle) and Reset stay on-screen instead of overflowing off the right edge. */
body.narrow #point-bar {
  min-width: 90px;
}
body.narrow #total-word {
  display: none;
}

/* Touch popover commit button (only present in the interactive popover, not the passive hover tooltip). */
.tip-commit {
  display: block;
  margin-top: 0.5rem;
  width: 100%;
  min-height: 44px;
  background: #21262d;
  color: #e6edf3;
  border: 1px solid #6cb6ff;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  cursor: pointer;
  /* A comfortable touch target, and manipulation disables iOS double-tap-zoom delay on the button. */
  touch-action: manipulation;
}
.tip-commit:disabled {
  border-color: #30363d;
  color: #6e7681;
  cursor: not-allowed;
}

/* First-load indicator: absolutely positioned inside #map-container (which is position:relative).
   The map's first render replaces #map-container's innerHTML, removing it. It fades in after a short
   delay so a fast load never flashes it. */
#boot-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #e6edf3;
  opacity: 0;
  animation: boot-fade-in 0.3s ease 0.2s forwards;
}
.boot-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid #6f82ad;
  border-top-color: #f0c14b;
  border-radius: 50%;
  animation: boot-spin 0.8s linear infinite;
}
@keyframes boot-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes boot-fade-in {
  to {
    opacity: 1;
  }
}
