/* Intrarea în București — Surveyor's Vellum & Night-Approach Sodium Astrolabe
 * Dual-theme WCAG AAA (>= 7.2:1 normal text), zero hardcoded inline colors.
 */

@font-face {
  font-family: "Bricolage";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/bricolage-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/bricolage-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBMPlexSans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/IBMPlexSans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBMPlexSans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/IBMPlexSans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plex Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/plexmono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plex Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/plexmono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root,
[data-theme="light"] {
  --bg: #f4efe5;
  --bg-elev: #fbf8f2;
  --bg-soft: #eae2d2;
  --fg: #131820;
  --mut: #3b4454;
  --line: #b4a995;
  --line-soft: #d4cbb9;
  --acc: #962811;          /* 7.5:1 on #f4efe5, 8.1:1 on #fbf8f2 (WCAG AAA) */
  --acc-bright: #c83d1d;   /* graphic stroke */
  --acc-soft: #f5dfd8;
  --far: #104573;          /* 8.7:1 on #f4efe5 (WCAG AAA) */
  --far-bright: #1c66a6;
  --far-soft: #dce8f3;
  --road-badge-bg: #183d2c;
  --road-badge-fg: #f7f4ec;
  --map-disc: #efe8da;
  --map-ilfov: #e7decb;
  --map-city: #fbf7ef;
  --map-poly-stroke: #c7bca7;
  --map-city-ring: #5a5245;
  --map-water: #a8cbe0;
  --map-road: #9e927d;
  --map-bezel: #e3dac7;
  --to-top-bg: #fbf8f2;
  --to-top-fg: #131820;
  --read-w: 43rem;
  --wide-w: 71rem;
  --col: 73rem;
  --gut: 1.15rem;
}

[data-theme="dark"] {
  --bg: #0a0f17;
  --bg-elev: #121a27;
  --bg-soft: #172233;
  --fg: #f2eee6;
  --mut: #b3bfd0;          /* 9.4:1 on #0a0f17, 8.1:1 on #121a27 (WCAG AAA) */
  --line: #314159;
  --line-soft: #1f2b3d;
  --acc: #f7b04c;          /* 10.1:1 on #0a0f17, 8.8:1 on #121a27 (WCAG AAA) */
  --acc-bright: #ff9f2e;
  --acc-soft: #2c2114;
  --far: #72cff8;          /* 10.6:1 on #0a0f17 (WCAG AAA) */
  --far-bright: #49b6eb;
  --far-soft: #13293d;
  --road-badge-bg: #1d4d37;
  --road-badge-fg: #f4f7f5;
  --map-disc: #0e1520;
  --map-ilfov: #121b29;
  --map-city: #182436;
  --map-poly-stroke: #26354a;
  --map-city-ring: #8899b0;
  --map-water: #193c5e;
  --map-road: #384c68;
  --map-bezel: #141e2e;
  --to-top-bg: #121a27;
  --to-top-fg: #f2eee6;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden],
.ib-reset[hidden],
.ib-suggest[hidden],
tr[hidden],
svg[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  color: var(--fg);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 3.75rem;
}

body {
  margin: 0;
  font-family: "IBMPlexSans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  overflow-x: clip;
  overflow-anchor: none;
}

a {
  color: var(--acc);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 200;
  padding: 0.5rem 0.9rem;
  background: var(--bg-elev);
  color: var(--fg);
  border: 2px solid var(--acc);
  border-radius: 0.4rem;
  font-family: "Bricolage", sans-serif;
  font-weight: 600;
}
.skip-link:focus {
  left: 0.75rem;
}

/* Topbar (browser-insets safe) */
.ib-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: calc(46px + var(--browser-safe-top, env(safe-area-inset-top, 0px)));
  padding: var(--browser-safe-top, env(safe-area-inset-top, 0px)) 1rem 0;
  background: color-mix(in srgb, var(--bg) 93%, transparent);
  border-bottom: 1px solid var(--line-soft);
  font-family: "Bricolage", sans-serif;
  font-size: 0.875rem;
}

.ib-home {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}
.ib-home svg {
  flex: none;
  color: var(--acc);
}

.ib-topnav {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
  min-width: 0;
}
.ib-topnav::-webkit-scrollbar {
  display: none;
}
.ib-topnav a {
  color: var(--mut);
  text-decoration: none;
  font-weight: 500;
  padding: 0.3rem 0;
}
.ib-topnav a:hover,
.ib-topnav a:focus-visible {
  color: var(--fg);
}

.ib-spacer {
  flex: 1 1 auto;
}

.ib-lang-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
}
.ib-lang-link:hover {
  border-color: var(--acc);
  color: var(--acc);
}

.ib-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  flex: none;
}
.ib-theme-btn:hover {
  border-color: var(--acc);
  color: var(--acc);
}

@media (pointer: coarse) {
  .ib-lang-link {
    min-height: 44px;
    padding: 0.25rem 0.8rem;
  }
  .ib-theme-btn {
    width: 44px;
    height: 44px;
  }
}

/* Hide rail until viewport comfortably fits 73rem + right gutter */
@media (max-width: 1359px) {
  .rail {
    display: none !important;
  }
}

/* Typography & Layout Containers */
h1,
h2,
h3 {
  font-family: "Bricolage", system-ui, sans-serif;
  letter-spacing: -0.018em;
  color: var(--fg);
}

.num,
.mono {
  font-family: "Plex Mono", ui-monospace, SFMono-Regular, monospace;
  font-variant-numeric: tabular-nums;
}

.ib-kicker {
  font-family: "Bricolage", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--acc);
  margin: 0 0 0.35rem;
}

.ib-hero-wrap {
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 0.5rem 1.15rem 1.15rem;
}

.ib-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 28.5rem) minmax(0, 1fr);
  gap: 0.9rem 1.8rem;
  align-items: start;
}

.ib-hero-copy {
  min-width: 0;
}

.ib-hero-copy h1 {
  font-size: clamp(1.32rem, 1.9vw, 1.66rem);
  line-height: 1.12;
  font-weight: 750;
  margin: 0 0 0.35rem;
}

.ib-deck {
  font-size: 0.875rem;
  line-height: 1.38;
  color: var(--mut);
  margin: 0 0 0.45rem;
}
.ib-deck strong {
  color: var(--fg);
  font-weight: 600;
}

/* KPI strip */
.ib-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.38rem;
  margin: 0 0 0.45rem;
}
.ib-kpi {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: 0.5rem;
  padding: 0.32rem 0.46rem;
  min-width: 0;
}
.ib-kpi-val {
  display: block;
  font-family: "Plex Mono", monospace;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--acc);
}
.ib-kpi[data-tone="far"] .ib-kpi-val {
  color: var(--far);
}
.ib-kpi-lbl {
  display: block;
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--mut);
  margin-top: 0.08rem;
}

/* Omni-Search Console */
.ib-console {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.45rem 0.62rem;
  margin-bottom: 0.45rem;
}

.ib-search-label {
  display: block;
  font-family: "Bricolage", sans-serif;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--fg);
  margin-bottom: 0.32rem;
}

.ib-search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ib-search-input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0.42rem 2.2rem 0.42rem 0.72rem;
  font-family: "IBMPlexSans", sans-serif;
  font-size: 0.94rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}
@media (pointer: coarse) {
  .ib-search-input {
    min-height: 44px;
    font-size: 1rem;
  }
}
.ib-search-input::placeholder {
  color: var(--mut);
  opacity: 0.85;
}

.ib-clear-x {
  position: absolute;
  right: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--mut);
  font-size: 1.15rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ib-clear-x:hover {
  color: var(--fg);
}

.ib-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.3rem);
  z-index: 55;
  max-height: 17rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}
.ib-suggest li {
  margin: 0;
}
.ib-suggest-btn {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--fg);
  text-align: left;
  font-family: "IBMPlexSans", sans-serif;
  font-size: 0.92rem;
  cursor: pointer;
}
.ib-suggest-btn:hover,
.ib-suggest-btn[aria-selected="true"] {
  background: var(--bg-soft);
}
.ib-suggest-tag {
  font-family: "Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--mut);
  white-space: nowrap;
}

/* Quick-pick chips */
.ib-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin-top: 0.45rem;
}
.ib-chip-btn {
  min-height: 30px;
  padding: 0.18rem 0.54rem;
  font-family: "Bricolage", sans-serif;
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  cursor: pointer;
}
.ib-chip-btn:hover,
.ib-chip-btn[data-active="true"] {
  border-color: var(--acc);
  color: var(--acc);
  background: var(--acc-soft);
}
@media (pointer: coarse) {
  .ib-chip-btn {
    min-height: 40px;
    padding: 0.32rem 0.72rem;
  }
}

/* Answer Card */
.ib-answer-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-left: 4px solid var(--acc);
  border-radius: 0.7rem;
  padding: 0.5rem 0.7rem;
}
.ib-answer-card[data-regime="far"] {
  border-left-color: var(--far);
}

.ib-answer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.28rem;
}
.ib-answer-title {
  font-family: "Bricolage", sans-serif;
  font-size: 0.99rem;
  font-weight: 750;
  line-height: 1.2;
  margin: 0;
}
.ib-badge-road {
  display: inline-block;
  padding: 0.1rem 0.42rem;
  border-radius: 0.3rem;
  background: var(--road-badge-bg);
  color: var(--road-badge-fg);
  font-family: "Plex Mono", monospace;
  font-size: 0.71rem;
  font-weight: 600;
  white-space: nowrap;
}

.ib-answer-body {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--fg);
  margin: 0 0 0.42rem;
}
.ib-answer-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.34rem;
  margin: 0 0 0.45rem;
}
.ib-ametric {
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 0.45rem;
  padding: 0.34rem 0.5rem;
  min-width: 0;
}
.ib-ametric-k {
  display: block;
  font-size: 0.7rem;
  color: var(--mut);
  line-height: 1.22;
}
.ib-ametric-v {
  display: block;
  font-family: "Plex Mono", monospace;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg);
  margin-top: 0.08rem;
}

.ib-answer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding-top: 0.42rem;
  border-top: 1px solid var(--line-soft);
}

.ib-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 38px;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--acc);
  background: var(--acc-soft);
  color: var(--acc);
  font-family: "Bricolage", sans-serif;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.ib-reset:hover {
  background: var(--acc);
  color: var(--bg-elev);
}
@media (pointer: coarse) {
  .ib-reset {
    min-height: 44px;
  }
}

/* Right column: Roza intrărilor Astrolabe Stage */
.ib-stage-panel {
  min-width: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.85rem;
}

.ib-stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.ib-seg-group {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.2rem;
  background: var(--bg);
  padding: 0.18rem;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  max-width: 100%;
}
.ib-seg-btn {
  min-height: 36px;
  padding: 0.22rem 0.62rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--mut);
  font-family: "Bricolage", sans-serif;
  font-size: 0.79rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.ib-seg-btn[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
}
@media (pointer: coarse) {
  .ib-seg-btn {
    min-height: 42px;
    padding: 0.28rem 0.66rem;
  }
}

.ib-canvas-box {
  position: relative;
  width: 100%;
  max-width: 615px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}

#roza-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
  cursor: pointer;
}

.ib-map-tip {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  max-width: 15.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.5rem;
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  font-size: 0.82rem;
  line-height: 1.38;
}

.ib-legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.8rem;
  color: var(--mut);
}
.ib-legend-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.ib-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.ib-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.ib-swatch--near {
  background: var(--acc-bright);
}
.ib-swatch--far {
  background: var(--far-bright);
}
.ib-swatch--ring {
  border: 2px dashed var(--map-city-ring);
  background: transparent;
}

/* Mobile Recomposition */
@media (max-width: 980px) {
  .ib-hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
  }
  .ib-topnav {
    display: none;
  }
  /* Avoid stacking two reset buttons 80px apart when answer card sits directly above stage */
  .ib-stage-bar .ib-reset {
    display: none !important;
  }
}
@media (max-width: 480px) {
  .ib-hero-wrap {
    padding: 0.9rem 0.85rem 1.5rem;
  }
  .ib-kpi-row {
    gap: 0.4rem;
  }
  .ib-kpi {
    padding: 0.45rem 0.5rem;
  }
  .ib-kpi-val {
    font-size: 1.05rem;
  }
  .ib-stage-panel {
    padding: 0.55rem;
  }
}

/* Editorial Sections Below the Fold */
.ib-section {
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 2.6rem 1.15rem;
  border-top: 1px solid var(--line-soft);
}

.ib-prose {
  max-width: var(--read-w);
}
.ib-prose h2 {
  font-size: clamp(1.45rem, 2.5vw, 1.95rem);
  line-height: 1.18;
  margin: 0 0 0.75rem;
}
.ib-prose p {
  margin: 0 0 1rem;
}

.ib-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  margin: 1.4rem 0;
}
@media (max-width: 780px) {
  .ib-split-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ib-split-card {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: 0.8rem;
  padding: 1rem 1.1rem;
  min-width: 0;
}
.ib-split-card h3 {
  font-size: 1.04rem;
  margin: 0 0 0.65rem;
}

.ib-town-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.48rem 0;
  border-top: 1px solid var(--line-soft);
  font-size: 0.9rem;
}
.ib-town-jump {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--acc);
  font-family: "Bricolage", sans-serif;
  font-weight: 700;
  font-size: 0.94rem;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}
.ib-town-road {
  font-size: 0.78rem;
  color: var(--mut);
  display: block;
}

/* SVG Figure Blocks */
.ib-figure {
  margin: 1.5rem 0;
  padding: 1.1rem 1.15rem;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: 0.85rem;
}
.ib-figure svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.ib-figure svg[data-stacked="1"] {
  max-width: 43rem;
}
.ib-figure figcaption {
  margin-top: 0.7rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--mut);
}

.svg-axis {
  stroke: var(--line);
  stroke-width: 1;
}
.svg-leader {
  stroke: var(--line);
  stroke-width: 0.9;
}
.svg-grid {
  stroke: var(--line-soft);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.svg-thresh {
  stroke: var(--acc);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}
.svg-txt {
  fill: var(--fg);
  font-family: "Bricolage", sans-serif;
  font-size: 12px;
}
.svg-mut {
  fill: var(--mut);
  font-family: "Plex Mono", monospace;
  font-size: 11px;
}
.svg-dot-near {
  fill: var(--acc-bright);
  stroke: var(--bg-elev);
  stroke-width: 1.5;
  cursor: pointer;
}
.svg-dot-far {
  fill: var(--far-bright);
  stroke: var(--bg-elev);
  stroke-width: 1.5;
  cursor: pointer;
}
.svg-bar-near {
  fill: var(--acc-bright);
}
.svg-bar-far {
  fill: var(--far-bright);
}
.svg-bar-soft {
  fill: var(--line);
}

/* Sortable Responsive Data Tables (modern-web-guidance compliant) */
.ib-table-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0.8rem;
}

.ib-table-region {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 0.75rem;
  background: var(--bg-elev);
}

.ib-table {
  width: 100%;
  min-width: 40rem;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}
.ib-table caption {
  text-align: left;
  padding: 0.75rem 0.95rem 0.4rem;
  font-family: "Bricolage", sans-serif;
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--fg);
}
.ib-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-soft);
  color: var(--fg);
  font-family: "Bricolage", sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.75rem;
  white-space: nowrap;
}
.ib-table thead th:has(> button) {
  padding: 0;
}
.ib-sort-btn {
  width: 100%;
  min-height: 40px;
  padding: 0.55rem 0.75rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}
.ib-sort-ic::after {
  content: "↕";
  opacity: 0.45;
  font-size: 0.78rem;
}
th[aria-sort="ascending"] .ib-sort-ic::after {
  content: "↑";
  opacity: 1;
  color: var(--acc);
}
th[aria-sort="descending"] .ib-sort-ic::after {
  content: "↓";
  opacity: 1;
  color: var(--acc);
}

.ib-table tbody th,
.ib-table tbody td {
  padding: 0.52rem 0.75rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.ib-table tbody th {
  font-weight: 600;
  text-align: left;
  background: var(--bg-elev);
}
.ib-table tbody tr:hover th,
.ib-table tbody tr:hover td {
  background: var(--bg-soft);
}
.ib-num-col {
  text-align: right !important;
  font-family: "Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
}
.ib-table thead th.ib-num-col .ib-sort-btn {
  justify-content: flex-end;
}

.ib-more-btn {
  margin-top: 0.75rem;
  min-height: 42px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--fg);
  font-family: "Bricolage", sans-serif;
  font-weight: 650;
  font-size: 0.88rem;
  cursor: pointer;
}
.ib-more-btn:hover {
  border-color: var(--acc);
  color: var(--acc);
}

/* Method & Footer */
.ib-sources-list {
  padding-left: 1.2rem;
  max-width: var(--read-w);
}
.ib-sources-list li {
  margin-bottom: 0.55rem;
}

footer.ib-footer {
  max-width: var(--wide-w);
  margin: 2rem auto 0;
  padding: 1.6rem 1.15rem 2.8rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.4rem;
  font-size: 0.88rem;
  color: var(--mut);
}
footer.ib-footer a {
  color: var(--fg);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
