/* Parliament Component Styles
   Built on tokens.css - implements the approved v2 header pattern and all reusable components.
   Source: parliament_restyle/mockups/assets/theme-v2.css + parliament.css */

/* ---------- Section Tones (color chapters) ---------- */

.tone-ink {
  --tone-bg: var(--ink);
  --tone-fg: #f3eee4;
  --tone-soft: var(--ink-soft);
  --tone-ctl: var(--ink-3);
  --tone-ctl-h: #3f3a33;
}

.tone-bronze {
  --tone-bg: var(--bronze-f);
  --tone-fg: #fbf7ef;
  --tone-soft: #e7d8b8;
  --tone-ctl: #7d5414;
  --tone-ctl-h: #8c5f19;
}

.tone-aegean {
  --tone-bg: var(--aegean);
  --tone-fg: #f4f2ee;
  --tone-soft: #c9dadd;
  --tone-ctl: #2b5f70;
  --tone-ctl-h: #326b7d;
}

.tone-paper {
  --tone-bg: var(--paper);
  --tone-fg: var(--ink);
  --tone-soft: var(--muted);
  --tone-ctl: var(--paper-2);
  --tone-ctl-h: #cdc4b3;
}

.tone-gold {
  --tone-bg: var(--gold);
  --tone-fg: var(--ink);
  --tone-soft: #4a3a1c;
  --tone-ctl: #e5c88e;
  --tone-ctl-h: #ecd5a6;
}

/* ---------- App Bar (v2 header layer 1) ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--tone-bg);
  color: var(--tone-fg);
  border-bottom: 1px solid rgba(251, 247, 239, 0.14);
}

.bar-in {
  height: calc(var(--bar-h) - 1px);
  display: flex;
  align-items: center;
  gap: 32px;
  padding-inline: var(--m);
  max-width: var(--frame);
  margin-inline: auto;
}

.mark {
  flex: none;
  display: block;
  height: 22px;
  width: auto;
  aspect-ratio: 282 / 48;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.mark svg {
  display: block;
  height: 22px;
  width: auto;
  aspect-ratio: 282 / 48;
  max-width: none;
}

.nav {
  display: flex;
  flex: none;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
}

.nav a {
  white-space: nowrap;
  flex: none;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--r);
  position: relative;
  color: rgba(255, 252, 246, 0.8);
  transition: color var(--duration-normal) var(--ease);
}

.nav a:hover {
  color: rgba(255, 252, 246, 1);
}

.nav a[aria-current="page"] {
  color: rgba(255, 252, 246, 1);
}

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -9px;
  height: 3px;
  background: var(--gold);
}

/* Context label that appears when page title scrolls off */
.bar-ctx {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: -8px;
  font: 500 var(--t-meta)/1 var(--sans);
  color: var(--paper);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(3px);
  transition: opacity var(--duration-normal) var(--ease),
              transform var(--duration-normal) var(--ease),
              visibility 0s linear var(--duration-normal);
}

.bar-ctx::before {
  content: "/";
  color: #9d917c;
}

body.title-off .bar-ctx {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.bar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.bar-act {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* The signed-out and desk mast share this ink bar. It does not depend on
   body.hdr-v2, so login and the other public pages match the homepage. */
.bar.tone-ink {
  --tone-bg: #312514;
  --tone-fg: #fbf7ef;
  --tone-soft: #d9cdb6;
  --tone-ctl: #47371f;
  --tone-ctl-h: #574429;
  --bar-h: 56px;
}

.bar.tone-ink .nav a,
.bar.tone-ink .nav a:hover,
.bar.tone-ink .nav a[aria-current="page"] {
  color: #e6e0d4;
}

.bar.tone-ink .nav a {
  opacity: 0.7;
}

.bar.tone-ink .nav a:hover,
.bar.tone-ink .nav a[aria-current="page"] {
  opacity: 1;
}

.bar.tone-ink .btn {
  background: #d9b26a;
  color: #1c1a17;
}

.bar.tone-ink .btn:hover {
  background: #e5c88e;
}

.signin {
  color: var(--tone-fg);
  text-decoration: none;
  opacity: 0.9;
  padding: 8px 12px;
  white-space: nowrap;
  transition: opacity var(--duration-normal);
}

.signin:hover {
  opacity: 1;
}

.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: var(--t-meta);
}

/* ---------- Account Menu ---------- */

.acct {
  position: relative;
  flex: none;
}

.acct-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px 0 4px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--tone-fg);
  font: 500 var(--t-meta) var(--sans);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease);
}

.acct-btn:hover,
.acct-btn[aria-expanded="true"] {
  background: var(--tone-ctl);
}

.avatar {
  flex: none;
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  min-height: 32px;
  max-height: 32px;
  box-sizing: border-box;
  padding: 0;
  aspect-ratio: 1 / 1;
  align-self: center;
  line-height: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--gold);
  color: var(--ink);
  font: 600 11px/1 var(--sans);
  letter-spacing: -0.04em;
  text-align: center;
}

.acct-btn svg {
  width: 12px;
  height: 12px;
}

.who-name {
  white-space: nowrap;
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 320px;
  background: var(--stone);
  color: var(--ink);
  border-radius: var(--r-panel);
  box-shadow: 0 12px 32px rgba(28, 26, 23, 0.22),
              0 2px 6px rgba(28, 26, 23, 0.12);
  padding: 8px;
  display: none;
  z-index: 40;
}

.acct.open .menu {
  display: block;
  animation: menuIn 180ms var(--ease) both;
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.menu-who {
  padding: 10px 12px 12px;
}

.menu-label {
  display: block;
  font-weight: 600;
}

.menu-name {
  display: block;
  margin-top: 6px;
  font-weight: 600;
}

.menu-email {
  display: block;
  margin-top: 2px;
  color: var(--meta);
  font-size: 12px;
  line-height: 1.3;
}

.menu a,
.menu button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: none;
  text-align: left;
  font: 400 var(--t-cell) var(--sans);
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--r);
  cursor: pointer;
}

.menu a:hover,
.menu button:hover {
  background: var(--paper);
}

.menu .ext {
  color: var(--meta);
  font-size: var(--t-meta);
  white-space: nowrap;
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.menu hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 6px 0;
}

/* ---------- Page Header (v2 layer 2 - identity block) ---------- */

.phead {
  background: var(--tone-bg);
  color: var(--tone-fg);
}

.phead-in {
  max-width: var(--frame);
  margin-inline: auto;
  padding: 28px var(--m) 26px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: #d3c4ac;
  margin-bottom: 10px;
}

.crumbs a {
  color: inherit;
  text-decoration-color: rgba(211, 196, 172, 0.5);
}

.crumbs a:hover {
  color: var(--tone-fg);
}

.phead-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
}

.phead-row:not(:has(.phead-act)) {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.phead h1 {
  color: var(--tone-fg);
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.phead h1 small {
  font: 500 var(--t-cell) var(--sans);
  color: var(--tone-soft);
  letter-spacing: 0;
}

.phead h1 .code-chip { align-self: center; }

.phead .lede {
  margin-top: 10px;
  max-width: 76ch;
  font: 400 var(--t-prose)/1.5 var(--sans);
  color: var(--tone-fg);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  /* Short copy keeps the same box as a 3-line clamp, so every page header
     starts at the same height. */
  min-height: calc(1.5em * 3);
}

.phead .lede-wrap.is-empty .lede {
  display: none;
  min-height: 0;
  margin-top: 0;
}

.phead .lede-wrap.is-open .lede {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

.phead .lede-more {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 2px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(251, 247, 239, 0.14);
  color: var(--tone-fg);
  font: 500 13px/1.4 var(--sans);
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.phead .lede-more:hover {
  background: rgba(251, 247, 239, 0.24);
  color: var(--tone-fg);
}

.phead .lede-more:focus-visible {
  outline: 2px solid var(--tone-fg);
  outline-offset: 2px;
}

.phead .lede-more[hidden] {
  display: none;
}

.phead .asof {
  margin-top: 8px;
  font-size: 13px;
  color: #d3c4ac;
}

.phead-act {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 2px;
}

/* ---------- Tab Strip (v2 layer 3) ---------- */

.tabstrip {
  position: sticky;
  top: var(--bar-h);
  z-index: 25;
  background: #5a3a0e; /* --strip: bronze-f mixed ~80% with ink */
  color: #fbf7ef;
  transition: box-shadow var(--duration-normal) var(--ease);
}

.tabstrip.stuck {
  box-shadow: 0 6px 14px -8px rgba(28, 26, 23, 0.55);
}

.tabstrip-in {
  max-width: var(--frame);
  margin-inline: auto;
  padding: 0 var(--m);
  height: 48px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
}

.tabs {
  margin: 0 0 0 -14px;
  gap: 2px;
  align-self: stretch;
  align-items: flex-end;
  display: flex;
}

.tabs a {
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 6px 6px 0 0;
  color: #e7d8b8;
  text-decoration: none;
  font: 500 var(--t-cell) var(--sans);
  transition: background-color var(--duration-normal) var(--ease),
              color var(--duration-normal) var(--ease);
}

.tabs a:hover {
  color: #fbf7ef;
  background: rgba(251, 247, 239, 0.08);
}

.tabs a[aria-selected="true"] {
  background: var(--ground);
  color: var(--ink);
}

.tabs a[aria-selected="true"] .count {
  color: var(--muted);
}

.tabs a:focus-visible {
  outline-offset: -3px;
}

.tabs .count {
  margin-left: 6px;
  color: var(--tone-soft);
  font-weight: 400;
}

.tabstrip .asof {
  margin: 0 0 0 auto;
  align-self: center;
  font-size: 12.5px;
  color: #d6c6a9;
  white-space: nowrap;
}

/* ---------- Canvas & Layout ---------- */

.canvas {
  max-width: var(--frame);
  margin-inline: auto;
  padding: var(--s6) var(--m) var(--s8);
}

.with-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  gap: var(--gap);
  align-items: start;
}

.stack {
  display: grid;
  gap: var(--gap);
  align-content: start;
}

.panel {
  background: var(--surface);
  border-radius: var(--r-panel);
  padding: 20px 24px;
  min-width: 0;
}

.panel-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-f {
  margin-top: 12px;
  font-size: var(--t-meta);
  color: var(--meta);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--ctl);
  padding: 0 16px;
  border: 0;
  border-radius: var(--r);
  background: var(--gold);
  color: var(--ink);
  font: 600 var(--t-meta)/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--duration-normal) var(--ease),
              transform 150ms var(--ease);
}

.btn:hover {
  background: var(--gold-2);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-ink {
  background: var(--ink);
  color: #f3eee4;
}

.btn-ink:hover {
  background: #34302a;
}

.btn-tone {
  background: var(--tone-ctl);
  color: var(--tone-fg);
}

.btn-tone:hover {
  background: var(--tone-ctl-h);
}

.btn-group {
  display: inline-flex;
  border: 1px solid rgba(251, 247, 239, 0.55);
  border-radius: var(--r);
}

.btn-group .btn {
  background: transparent;
  color: var(--tone-fg);
  border-radius: 0;
  height: 34px;
  padding: 0 14px;
  font-weight: 500;
}

.btn-group .btn + .btn {
  box-shadow: inset 1px 0 0 rgba(251, 247, 239, 0.4);
}

.btn-group .btn:hover {
  background: var(--tone-ctl-h);
}

.btn-group .btn:focus-visible {
  outline-offset: -3px;
}

/* ---------- Segmented Controls ---------- */

.seg {
  display: inline-flex;
  gap: 2px;
  background: var(--paper-2);
  padding: 3px;
  border-radius: var(--r-panel);
}

.seg button {
  border: 0;
  background: transparent;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r);
  font: 500 var(--t-meta) var(--sans);
  color: var(--muted);
  cursor: pointer;
  transition: color var(--duration-fast), background-color var(--duration-fast);
}

.seg button:hover {
  color: var(--ink);
}

.seg [aria-pressed="true"] {
  background: var(--stone);
  color: var(--ink);
  outline: 1px solid rgba(28, 26, 23, 0.14);
  outline-offset: -1px;
}

/* ---------- Stats Strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr));
  background: var(--surface);
  border-radius: var(--r-panel);
}

.stats > div {
  padding: 16px 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  min-width: 0;
}

.stats > div + div {
  border-left: 1px solid var(--rule);
}

.stats dt {
  font-size: var(--t-meta);
  color: var(--meta);
}

.stats dd {
  margin: 0;
  font: 500 26px/1.1 var(--sans);
  letter-spacing: -0.01em;
}

.stats dd small {
  font-size: var(--t-meta);
  color: var(--meta);
  font-weight: 400;
  margin-left: 4px;
}

.stats .lead dd {
  font: 500 32px/1.05 var(--serif);
}

/* ---------- Table ---------- */

.t {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-cell);
}

.t th {
  text-align: left;
  font: 500 var(--t-meta) var(--sans);
  color: var(--meta);
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.t th.num {
  text-align: right;
}

.t td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

.t tr:last-child td {
  border-bottom: 0;
}

.t td:last-child,
.t th:last-child {
  padding-right: 0;
}

.t tbody tr {
  transition: background-color 150ms;
}

.t tbody tr:hover {
  background: rgba(216, 208, 193, 0.35);
}

.t .sub {
  display: block;
  font-size: var(--t-meta);
  color: var(--meta);
}

.t .name {
  font-weight: 500;
}

.t.dense td {
  padding-top: 8px;
  padding-bottom: 8px;
}

.tk {
  font-weight: 600;
  text-decoration: none;
}

.tk:hover {
  text-decoration: underline;
  text-decoration-color: var(--gold);
}

/* ---------- Chips ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r);
  font: 500 var(--t-meta)/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  flex: none;
}

.chip-theme {
  background: #eadcc4;
  color: #4d320a;
}

.chip-ticker {
  background: #d3e2e5;
  color: #163640;
}

.chip:hover {
  filter: brightness(0.96);
}

/* ---------- Pills (status indicators) ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font: 600 12px/1 var(--sans);
  white-space: nowrap;
  flex: none;
}

.pill-up {
  background: var(--up-bg);
  color: var(--up-ink);
}

.pill-down {
  background: var(--down-bg);
  color: var(--down-ink);
}

.pill-warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

/* ---------- States ---------- */

.state {
  border: 1px dashed var(--control);
  border-radius: var(--r-panel);
  padding: 16px 18px;
  font-size: var(--t-meta);
  color: var(--ink);
  background: transparent;
}

.state b {
  font-weight: 600;
}

.state .btn {
  margin-top: 10px;
}

.state-err {
  border-style: solid;
  border-color: #e2b8a6;
  background: #f8ebe5;
}

.skel {
  display: block;
  background: var(--paper-2);
  border-radius: var(--r);
}

.skel-line {
  height: 14px;
  margin: 10px 0;
}

@media (prefers-reduced-motion: no-preference) {
  .skel {
    animation: pulse 1.6s ease-in-out infinite;
  }
}

@keyframes pulse {
  50% {
    opacity: 0.55;
  }
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: var(--r-panel);
  padding: 14px 18px;
  font-size: var(--t-meta);
}

.notice[hidden] {
  display: none !important;
}

.notice b {
  color: #3f2a05;
}

/* ---------- Footer ---------- */

.foot {
  background: var(--ink);
  color: var(--paper);
}

.foot-in {
  max-width: var(--frame);
  margin-inline: auto;
  padding: 40px var(--m) 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 32px;
  align-items: center;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: var(--t-cell);
}

.foot-links a {
  text-decoration: none;
  color: #eae4d8;
}

.foot-links a:hover {
  color: var(--gold);
  text-decoration: underline;
}

.foot-legal {
  grid-column: 1 / -1;
  font-size: var(--t-meta);
  color: var(--ink-soft);
  max-width: 90ch;
}

.foot .mark {
  width: 150px;
  color: var(--paper);
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .with-rail {
    grid-template-columns: minmax(0, 1fr);
  }
  
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  
  .stats > div:nth-child(3n+1) {
    border-left: 0;
  }
  
  .stats > div:nth-child(n+4) {
    border-top: 1px solid var(--rule);
  }
  
  .bar-ctx {
    margin-left: 0;
  }
}

@media (max-width: 1000px) {
  .tabstrip .asof {
    display: none;
  }
  
  .phead .asof {
    display: block;
    margin-top: 10px;
  }
}

@media (max-width: 1023px) {
  .bar .mark {
    width: 18px;
    aspect-ratio: auto;
  }
}

@media (max-width: 700px) {
  .bar .nav {
    display: none;
  }
}

@media (max-width: 640px) {
  
  .who-name {
    display: none;
  }
  
  .phead-in {
    padding-top: 20px;
  }
  
  .phead-row {
    grid-template-columns: 1fr;
  }
  
  .bar-ctx {
    display: none;
  }
  
  .tabs {
    margin-left: -6px;
  }
  
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .stats > div:nth-child(3n+1) {
    border-left: 1px solid var(--rule);
  }
  
  .stats > div:nth-child(2n+1) {
    border-left: 0;
  }
  
  .stats > div:nth-child(n+3) {
    border-top: 1px solid var(--rule);
  }
  
  .panel {
    padding: 16px;
  }
  
  .t .hide-sm {
    display: none;
  }
  
  .foot-in {
    grid-template-columns: 1fr;
  }
}

/* Header v2: dark app bar, section identity below it. */
body.hdr-v2 {
  --bar-h: 56px;
}
body.hdr-v2 .bar {
  --tone-bg: #312514;
  --tone-fg: #fbf7ef;
  --tone-soft: #d9cdb6;
  --tone-ctl: #47371f;
  --tone-ctl-h: #574429;
}
body.hdr-v2 .bar .nav a {
  color: #e6e0d4;
  opacity: 0.7;
}
body.hdr-v2 .bar .nav a:hover,
body.hdr-v2 .bar .nav a[aria-current="page"] {
  opacity: 1;
  color: #e6e0d4;
}

.tabstrip.tone-aegean { background: #1a4150; }
.tabstrip.tone-aegean .tabs a { color: #cddfe2; }
.tabstrip.tone-ink { background: #141210; }
.tabstrip.tone-ink .tabs a { color: #e6e0d4; }
.tabstrip.tone-bronze { background: #5a3a0e; }
.tabstrip .tabs a[aria-selected="true"],
.tabstrip.tone-ink .tabs a[aria-selected="true"],
.tabstrip.tone-aegean .tabs a[aria-selected="true"],
.tabstrip.tone-bronze .tabs a[aria-selected="true"] {
  background: var(--ground);
  color: var(--ink);
}

.phead .page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.phead .page-action,
.phead .watch-add {
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r);
  background: rgba(251, 247, 239, 0.14);
  color: var(--tone-fg, #fbf7ef);
  font: 600 14px var(--sans);
  cursor: pointer;
}
.phead .macro-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.phead h1 .logo-plate {
  display: inline-flex;
  margin-right: 10px;
  vertical-align: middle;
}
.phead h1 .company-logo {
  height: 28px;
  width: 28px;
  object-fit: contain;
}

.kfind {
  position: relative;
  margin-top: 20px;
  max-width: 760px;
}
.kfind svg {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.kfind input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 46px;
  font: 400 17px/1 var(--sans);
  background: var(--stone);
  border: 0;
  border-radius: var(--r);
  color: var(--ink);
}

.codefind {
  position: relative;
  flex: none;
}
.codefind svg {
  position: absolute;
  left: 8px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  color: var(--tone-fg, #fbf7ef);
  opacity: 0.7;
  pointer-events: none;
}
.codefind input {
  width: 128px;
  height: 32px;
  padding: 0 10px 0 28px;
  border: 0;
  border-radius: var(--r);
  background: rgba(251, 247, 239, 0.12);
  color: var(--tone-fg, #fbf7ef);
  font: 600 13px/1 var(--mono);
  letter-spacing: 0.04em;
}
.codefind input::placeholder {
  color: rgba(251, 247, 239, 0.55);
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0;
}
.title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.title-line h1 { margin: 0; }
.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 8px 0 10px;
  border: 1px solid rgba(251, 247, 239, 0.35);
  border-radius: var(--r);
  background: rgba(251, 247, 239, 0.12);
  color: var(--tone-fg, #fbf7ef);
  font: 600 13px/1 var(--sans);
  letter-spacing: 0;
  cursor: pointer;
  vertical-align: 2px;
}
.code-chip-mark {
  font: 600 13px/1 var(--sans);
  letter-spacing: 0;
}
.code-chip-hint {
  font: 500 11px/1 var(--sans);
  letter-spacing: 0;
  opacity: 0.75;
}
.code-chip:hover,
.code-chip:focus-visible {
  background: rgba(251, 247, 239, 0.22);
}
.code-ref {
  margin-left: 8px;
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.03em;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.code-ref:hover { color: var(--ink); }
.phead .code-ref,
.playbook-card .code-ref { color: var(--tone-soft, var(--muted)); }
.alias-note,
.code-line {
  margin: 10px 0 0;
  color: var(--tone-soft, var(--muted));
  font-size: var(--t-meta);
}
@media (max-width: 980px) {
  .bar-in,
  .hdr-v2 .bar-in {
    height: auto;
    min-height: calc(var(--bar-h) - 1px);
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-block: 8px;
  }
  .nav { min-width: 0; }
  .nav a { padding-inline: 8px; }
  .bar-end { flex: none; }
  .codefind input {
    width: 92px;
    padding-left: 26px;
    background: #47371f;
    border: 1px solid rgba(251, 247, 239, 0.4);
  }
}
@media (max-width: 640px) {
  .codefind input {
    width: 72px;
    font-size: 12px;
  }
}
.with-left {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}
.g12 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.span-6 { min-width: 0; }
.sec-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.sec-h p { color: var(--muted); font-size: var(--t-meta); }
.flow { list-style: none; margin: 0; padding: 0; }
.flow li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 64px;
  gap: 14px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--rule);
}
.flow li:first-child { border-top: 0; }
.flow .sub, .many .sub, .t .sub {
  display: block;
  font-size: 13px;
  color: var(--meta);
  font-weight: 400;
}
.fbar { height: 8px; background: var(--paper-2); position: relative; }
.fbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--aegean); }
.tk { color: var(--aegean-2); text-decoration: none; }
.tk:hover { text-decoration: underline; }
.many { list-style: none; margin: 0; padding: 0; }
.many li { padding: 10px 0; border-top: 1px solid var(--rule); }
.many li:first-child { border-top: 0; }
.many .mt { display: flex; align-items: baseline; gap: 10px; }
.many .mt b { margin-left: auto; font-weight: 500; }
.many .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.ctl-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.seg a {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r);
  text-decoration: none;
  color: var(--muted);
  font: 500 var(--t-meta) var(--sans);
}
.seg a[aria-pressed="true"] { background: var(--stone); color: var(--ink); }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { padding: 6px 0; }
.phead.tone-paper, .tone-paper.phead { color: var(--ink); }
@media (max-width: 1024px) {
  .with-left, .g12 { grid-template-columns: 1fr; }
  .flow li { grid-template-columns: minmax(0, 1fr) 64px; }
  .fbar { display: none; }
}

/* ---------- Header v2 (Three-Layer Pattern) ---------- */
/* Usage: Add class="hdr-v2" to <body> and use .bar.tone-bar, .phead with tone, and .tabstrip */

.hdr-v2 {
  --bar-h: 56px;
  --bar-dark: #312514;  /* app bar: bronze-f mixed ~25% into ink */
  --strip: #5a3a0e;     /* tab strip: bronze-f mixed ~80% with ink */
  scroll-padding-top: 120px;
}

/* Layer 1: App bar */
.hdr-v2 .bar.tone-bar {
  --tone-bg: var(--bar-dark);
  --tone-fg: #fbf7ef;
  --tone-soft: #d9cdb6;
  --tone-ctl: #47371f;
  --tone-ctl-h: #574429;
  border-bottom: 1px solid rgba(251, 247, 239, 0.14);
}

.hdr-v2 .bar-in {
  height: calc(var(--bar-h) - 1px);
}

.hdr-v2 .bar .nav a {
  color: #e6e0d4;
  opacity: 0.7;
}

.hdr-v2 .bar .nav a:hover {
  opacity: 1;
}

body.hdr-v2 .bar.tone-paper .nav a:not(.btn),
body.hdr-v2 .bar.tone-paper .nav a[aria-current="page"]:not(.btn) {
  color: var(--ink);
  opacity: 0.8;
}

.hdr-v2 .bar .nav a[aria-current="page"] {
  color: #e6e0d4;
  opacity: 1;
}

.hdr-v2 .bar .nav a[aria-current="page"]::after {
  bottom: -9px;
}

/* Context label (appears when title scrolls off) */
.hdr-v2 .bar-ctx {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: -8px;
  font: 500 var(--t-meta)/1 var(--sans);
  color: var(--paper);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(3px);
  transition: opacity 0.2s var(--ease),
              transform 0.2s var(--ease),
              visibility 0s linear 0.2s;
}

.hdr-v2 .bar-ctx::before {
  content: "/";
  color: #9d917c;
}

.hdr-v2.title-off .bar-ctx {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

/* Layer 2: Identity block */
.hdr-v2 .phead-in {
  padding: 28px var(--m) 26px;
}

.hdr-v2 .crumbs {
  font-size: 13px;
  color: #d3c4ac; /* fg at ~70% on bronze, 4.9:1 */
  margin-bottom: 10px;
}

.hdr-v2 .crumbs a {
  color: inherit;
  text-decoration-color: rgba(211, 196, 172, 0.5);
}

.hdr-v2 .crumbs a:hover {
  color: var(--tone-fg);
}

.hdr-v2 .phead .lede {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.hdr-v2 .phead-act {
  gap: 0;
  padding-bottom: 2px;
}

.btn-group {
  display: inline-flex;
  border: 1px solid rgba(251, 247, 239, 0.55);
  border-radius: var(--r);
}

.btn-group .btn {
  background: transparent;
  color: var(--tone-fg);
  border-radius: 0;
  height: 34px;
  padding: 0 14px;
  font-weight: 500;
}

.btn-group .btn + .btn {
  box-shadow: inset 1px 0 0 rgba(251, 247, 239, 0.4);
}

.btn-group .btn:hover {
  background: var(--tone-ctl-h);
}

.btn-group .btn:focus-visible {
  outline-offset: -3px;
}

/* Layer 3: Tab strip */
.hdr-v2 .tabstrip {
  position: sticky;
  top: var(--bar-h);
  z-index: 25;
  background: var(--strip);
  color: #fbf7ef;
  transition: box-shadow 0.2s var(--ease);
}

.hdr-v2 .tabstrip.tone-aegean { --strip: #1a4150; }
.hdr-v2 .tabstrip.tone-ink { --strip: #141210; }

.hdr-v2 .tabstrip.stuck {
  box-shadow: 0 6px 14px -8px rgba(28, 26, 23, 0.55);
}

.hdr-v2 .tabstrip-in {
  max-width: var(--frame);
  margin-inline: auto;
  padding: 0 var(--m);
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.hdr-v2 .tabs {
  margin: 0 0 0 -12px;
  gap: 3px;
  align-items: center;
}

.hdr-v2 .tabs a {
  height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  color: #e7d8b8;
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.hdr-v2 .tabs a:hover {
  color: #fbf7ef;
  background: rgba(251, 247, 239, 0.1);
}

.hdr-v2 .tabstrip .tabs a[aria-selected="true"],
.hdr-v2 .tabstrip .tabs a[aria-current="true"] {
  background: var(--ground);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.hdr-v2 .tabstrip .panel-switch { margin-left: auto; flex: none; }

.phead:has(.view-nav) .phead-in { padding-bottom: 16px; }

.phead .view-nav {
  border-top: 1px solid rgba(251, 247, 239, 0.18);
}

.phead.tone-bronze .view-nav { background: #5a3a0e; }
.phead.tone-aegean .view-nav { background: #1a4150; }

.phead .view-nav-in {
  box-sizing: border-box;
  max-width: var(--frame);
  margin-inline: auto;
  padding: 10px var(--m) 12px;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.phead .view-nav .tabs {
  margin: 0;
  align-self: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.phead .view-nav .tabs a {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--tone-soft);
  font-size: 13px;
  font-weight: 500;
}

.phead .view-nav .tabs a:hover {
  color: var(--tone-fg);
  background: rgba(251, 247, 239, 0.12);
}

.phead .view-nav .tabs a[aria-selected="true"] {
  background: var(--ground);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.phead .view-nav .asof {
  margin: 0 0 0 auto;
  color: var(--tone-soft);
  font-size: 12.5px;
  white-space: nowrap;
}

.hdr-v2 .tabstrip.section-strip {
  background: var(--ground);
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}

.hdr-v2 .tabstrip.section-strip .tabs {
  margin-left: 0;
}

.hdr-v2 .tabstrip.section-strip .tabs a {
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.hdr-v2 .tabstrip.section-strip .tabs a:hover {
  color: var(--ink);
  background: rgba(28, 25, 21, 0.06);
}

.hdr-v2 .tabstrip.section-strip .tabs a[aria-current="true"] {
  background: var(--ink);
  color: var(--ground);
  font-weight: 600;
  box-shadow: none;
}
.hdr-v2 .tabstrip .section-nav {
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.hdr-v2 .tabstrip .section-nav::-webkit-scrollbar { display: none; }
.hdr-v2 .tabstrip .tabs a { white-space: nowrap; flex: none; }

.hdr-v2 .tabs a[aria-selected="true"]::after {
  content: none;
}

.hdr-v2 .tabs a[aria-selected="true"] .count {
  color: var(--muted);
}

.hdr-v2 .tabs a:focus-visible {
  outline-offset: -3px;
}

.hdr-v2 .tabs .count {
  margin-left: 6px;
  color: inherit;
  font-weight: 400;
  opacity: 0.7;
}

.hdr-v2 .tabstrip .asof {
  margin: 0 0 0 auto;
  align-self: center;
  font-size: 12.5px;
  color: #d6c6a9;
  white-space: nowrap;
}

.hdr-v2 .phead .asof-narrow {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 1180px) {
  .hdr-v2 .bar-ctx {
    margin-left: 0;
  }
}

@media (max-width: 1000px) {
  .hdr-v2 .tabstrip .asof,
  .phead .view-nav .asof {
    display: none;
  }
  .hdr-v2 .phead .asof-narrow {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: #d3c4ac;
  }
}

@media (max-width: 640px) {
  .hdr-v2 .phead-in {
    padding-top: 20px;
  }
  .hdr-v2 .bar-ctx {
    display: none;
  }
  .hdr-v2 .tabs {
    margin-left: -6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hdr-v2 .bar-ctx,
  .hdr-v2 .tabstrip,
  .hdr-v2 .tabs a {
    transition: none;
  }
  .hdr-v2 .bar-ctx {
    transform: none;
  }
}

/* Chip improvements for better contrast */
.chip-theme {
  background: #eadcc4;
  color: #4d320a;
}

.chip-ticker {
  background: #d3e2e5;
  color: #163640;
}

.on-tone .chip-theme {
  background: rgba(251, 247, 239, 0.16);
  color: var(--tone-fg);
}

.on-tone .chip-ticker {
  background: rgba(195, 226, 230, 0.2);
  color: #d3e2e5;
}

/* Ticker-specific enhancements */
.logo-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-right: 12px;
  background: var(--stone);
  border-radius: var(--r);
  overflow: hidden;
  vertical-align: middle;
}

.company-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.watch-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(251, 247, 239, 0.55);
  border-radius: var(--r);
  background: transparent;
  color: var(--tone-fg);
  font-size: 20px;
  font-weight: 300;
  cursor: pointer;
  transition: background-color var(--duration-normal) var(--ease);
}

.watch-add:hover {
  background: var(--tone-ctl-h);
}

.watch-add:focus-visible {
  outline-offset: -3px;
}

.page-action {
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(251, 247, 239, 0.55);
  border-radius: var(--r);
  background: transparent;
  color: var(--tone-fg);
  font: 500 var(--t-meta) var(--sans);
  cursor: pointer;
  transition: background-color var(--duration-normal) var(--ease);
}

.page-action:hover {
  background: var(--tone-ctl-h);
}

.page-action:focus-visible {
  outline-offset: -3px;
}

.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------- Layout Grids ---------- */
.canvas {
  max-width: var(--frame);
  margin-inline: auto;
  padding: var(--s6) var(--m) var(--s8);
}

.with-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  gap: var(--gap);
  align-items: start;
}

.stack {
  display: grid;
  gap: var(--gap);
  align-content: start;
}

.rail {
  display: grid;
  gap: var(--gap);
  align-content: start;
}

.g12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: 1 / -1; }

@media (max-width: 1180px) {
  .with-rail {
    grid-template-columns: 1fr;
  }
  .g12 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Section Headers ---------- */
.sec-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: var(--s4);
}

.sec-h p {
  color: var(--meta);
  font-size: var(--t-meta);
}

/* ---------- Stats Strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr));
  background: var(--surface);
  border-radius: var(--r-panel);
}

.stats > div {
  padding: 16px 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  min-width: 0;
}

.stats > div + div {
  border-left: 1px solid var(--rule);
}

.stats dt {
  font-size: var(--t-meta);
  color: var(--meta);
}

.stats dd {
  margin: 0;
  font: 500 26px/1.1 var(--sans);
  letter-spacing: -0.01em;
}

.stats .lead dd {
  font-size: 32px;
  color: var(--data);
}

@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stats > div:nth-child(n+4) {
    border-top: 1px solid var(--rule);
    border-left: 0;
  }
  .stats > div:nth-child(3n+1) {
    border-left: 0;
  }
}

/* ---------- 100% Composition Bars ---------- */
.bar100 {
  height: 32px;
  display: flex;
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 12px;
}

.bar100 span {
  display: block;
  height: 100%;
}

.comps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 40px;
}

.comp h3 {
  font-size: var(--t-cell);
  margin-bottom: 8px;
}

.comp-l {
  margin-top: 10px;
  display: grid;
  gap: 4px;
  font-size: var(--t-meta);
}

.comp-l li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: center;
}

.comp-l i {
  width: 10px;
  height: 10px;
  display: block;
}

.comp-l li.meta {
  display: block;
  color: var(--meta);
}

@media (max-width: 640px) {
  .comps {
    grid-template-columns: 1fr;
  }
}

/* ---------- Factor Bars (Rail) ---------- */
.fac {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.fac li {
  display: grid;
  grid-template-columns: 84px 150px 1fr;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}

.fac b {
  font-weight: 600;
}

/* ---------- Neighbor/Overlap List ---------- */
.nb {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nb li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 40px;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--rule);
}

.nb li:first-child {
  border-top: 0;
}

.nb a {
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb a:hover {
  text-decoration: underline;
}

.ov {
  height: 6px;
  background: var(--paper-2);
  position: relative;
}

.ov i {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--theme-c);
}

/* ---------- Legend ---------- */
.legend {
  display: flex;
  gap: 16px;
  font-size: var(--t-meta);
  color: var(--meta);
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 12px;
  height: 12px;
  display: block;
  border-radius: 1px;
}

/* ---------- Chart Styles ---------- */
.chart {
  width: 100%;
  height: auto;
  margin: 12px 0;
}

.chart .grid-l {
  stroke: var(--rule);
  stroke-width: 1;
}

.chart .base {
  stroke: var(--ink);
  stroke-width: 1.5;
}

.chart text {
  fill: var(--meta);
  font: 400 var(--t-tick) var(--sans);
}

.chart .lab {
  fill: var(--ink);
  font-weight: 500;
}

/* ---------- Progressive Depth (L2) ----------
   Header and body share one padding box. A standalone expander is a card
   (.panel). One nested inside a card flattens so it does not add a second
   inset or a second surface. */
.detail-expander {
  margin-top: 16px;
}

.detail-expander[hidden] {
  display: none;
}

.panel .detail-expander {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  max-width: none;
}

.detail-expander > .expand-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 500 14px/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
}

.detail-expander > .expand-toggle:hover {
  background: transparent;
  color: var(--ink);
}

.detail-expander > .expand-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.detail-expander > .expand-toggle svg {
  flex: none;
  width: 12px;
  height: 12px;
  color: var(--meta);
  transition: transform var(--duration-normal) var(--ease);
}

.detail-expander > .expand-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.detail-expander > .expander-content {
  padding: 12px 0 0;
  border: 0;
  background: transparent;
}

/* Section targets sit just under the sticky bar + strip. scroll-padding and
   scroll-margin add together, so the padding baked into the page is cleared
   wherever an in-page section nav is driving the scroll. */
html:has(.section-nav),
body.hdr-v2:has(.section-nav) { scroll-padding-top: 0; }

main section[id],
.section-nav ~ main [id] { scroll-margin-top: var(--section-offset, calc(var(--bar-h) + 60px)); }

body.dash-page .phead .lede {
  max-width: 80ch;
  color: #d6c6a9;
}

body.mail-export .phead .lede {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
  min-height: 0;
}

body.mail-export .phead .lede-more {
  display: none !important;
}

/* ---------- Jump nav: secondary section nav, sticky under the tab strip ---------- */
.jump {
  position: sticky;
  top: calc(var(--bar-h) + 48px);
  z-index: 20;
  background: var(--ground);
  border-bottom: 1px solid var(--rule);
}

.jump-in {
  box-sizing: border-box;
  max-width: var(--frame);
  margin-inline: auto;
  padding: 8px var(--m);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.jump-in::-webkit-scrollbar { display: none; }

.jump a {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font: 500 13px var(--sans);
  text-decoration: none;
  white-space: nowrap;
}

.assist-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 12px 22px;
  background: #f4efe4;
  color: var(--ink);
  border-bottom: 1px solid rgba(28, 25, 21, 0.12);
  font: 500 14px var(--sans);
}
.assist-banner p { margin: 0; }
.assist-banner .pill { border-radius: 999px; }

.jump a:hover { background: var(--paper-2); color: var(--ink); }
.jump a[aria-current="true"] { background: var(--ink); color: var(--ground); }

/* ---------- Detail tables, chart grid and Analytics (L2/L3) ---------- */
.detail-table { margin-top: 8px; }
.detail-table tr.split th { padding-top: 14px; font-weight: 600; color: var(--ink); }
.detail-table th[scope="row"] { font-weight: 400; text-align: left; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 8px; }
.chart-cell { margin: 0; padding: 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); }
.chart-cell figcaption { font: 500 var(--t-meta) var(--sans); color: var(--ink); margin-bottom: 6px; }
.chart-cell svg { width: 100%; height: auto; }
.csv-btn { margin-left: auto; padding: 4px 10px; border: 1px solid var(--control); border-radius: var(--r); background: var(--surface); color: var(--ink); font: 500 13px var(--sans); cursor: pointer; }
.csv-btn:hover { background: var(--stone); }
.panel-h .csv-btn { margin-left: 12px; }
.analytics { padding-top: 4px; }
.analytics-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.analytics-ctl .csv-btn { margin-left: auto; }

/* No hard corners: default radius for controls, menus and table frames.
   :where() keeps specificity at zero so component rules still win. */
:where(button, select, textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="range"])) { border-radius: var(--r); }
:where(.chip, .pill, .tag, .badge, .kind-badge, .notice, .tip, [role="menu"], [role="listbox"], dialog, .modal, .menu, .dropdown) { border-radius: var(--r); }
:where(.panel, .card) { border-radius: var(--r-panel); }
.btn-group { overflow: hidden; }
