.display-preferences {
  align-items: stretch;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
}
.language-picker { position: relative; display: flex; align-items: stretch }
.language-picker select {
  appearance: none;
  min-height: 36px;
  border: 0;
  border-radius: 9px 0 0 9px;
  background: transparent;
  padding: 0 24px 0 32px;
  font-size: 13px;
  font-weight: 550;
}
.language-picker svg {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
}
.language-globe { left: 10px; width: 16px; height: 16px }
.language-chevron { right: 8px; width: 11px; height: 11px }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 9px 9px 0;
  background: transparent;
  color: var(--muted);
}
.theme-toggle svg { width: 19px; height: 19px }
.theme-toggle[aria-pressed="true"] { color: var(--gold); background: var(--tint) }
.display-preferences :focus-visible { position: relative; z-index: 1 }
@media (hover: hover) {
  .theme-toggle:hover, .language-picker:hover select { background: var(--tint); color: var(--brass) }
}
@media (pointer: coarse), (max-width: 560px) {
  .language-picker select { min-height: 44px }
  .theme-toggle { min-width: 44px }
}
@media (max-width: 700px) {
  .theme-label { display: none }
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: auto auto;
    gap: 2px 8px;
    align-content: center;
  }
  .topbar-context { display: contents }
  .topbar .mobile-brand { grid-area: 1 / 1; align-self: end }
  .topbar .vault-tag { grid-area: 2 / 1; align-self: start; line-height: 1.2; font-size: 11px }
  .topbar .display-preferences { grid-area: 1 / 2 / span 2 }
  .topbar .mobile-menu { grid-area: 1 / 3 / span 2 }
  .mobile-menu > summary { min-width: 44px; min-height: 44px; display: grid; place-items: center }
}
@media (max-width: 360px) {
  .topbar { gap: 2px 5px; padding-inline: 10px }
  .topbar .wordmark { font-size: 22px }
  .language-globe { display: none }
  .language-picker select { padding-left: 10px }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eff0e8;
  --muted: #b4b8ab;
  --paper: #141613;
  --panel: #20231f;
  --line: #40463d;
  --black: #10120f;
  --gold: #f4c75a;
  --brass: #efca76;
  --tint: #383222;
  --verified: #9fad88;
  --declared: #ebc35d;
  --conflict: #c78c63;
  --unknown: #576051;
  --raised: #2c3029;
  --field: #191c18;
  --field-edge: #7a8172;
}
:root[data-theme="dark"] :focus-visible { outline-color: var(--gold) }
:root[data-theme="dark"] .sidebar { box-shadow: inset -1px 0 var(--line) }
:root[data-theme="dark"] .topbar { background: var(--field) }
:root[data-theme="dark"] :is(.vault-tag, .supplier-cell, .disclose, .metric-top > .icon) { color: var(--muted) }
:root[data-theme="dark"] .origin-cell { color: var(--ink) }
:root[data-theme="dark"] .workspace-avatar { background: var(--tint); border-color: #615333; color: var(--brass) }
:root[data-theme="dark"] :is(.mobile-brand .wordmark > span, td a) { color: var(--brass) }
:root[data-theme="dark"] :is(.skip-link:focus, .row-body, .request-envelope > div, .request-source) { background: var(--field) }
:root[data-theme="dark"] :is(.button:not(.primary), button.ghost, .icon-link, .stat-icon, .row-icon, .scenarios > label, .index-head, th) {
  background: var(--raised);
  color: var(--ink);
}
:root[data-theme="dark"] .row-icon { border-color: var(--line) }
:root[data-theme="dark"] :is(.metric-card:last-child .stat-icon, .icon-link:hover, .scenarios input:checked + label, .index-row[open] > summary, .index-row:target > summary) {
  background: var(--tint);
  color: var(--brass);
}
:root[data-theme="dark"] .bar-field::before {
  border-color: var(--line);
  background: linear-gradient(transparent calc(50% - .5px), var(--line) 50%, transparent calc(50% + .5px));
}
:root[data-theme="dark"] .bar-value { background: var(--verified) }
:root[data-theme="dark"] .mid .bar-value { background: var(--gold) }
:root[data-theme="dark"] .ceiling .bar-value { background: repeating-linear-gradient(130deg,#907537 0 4px,#e8c778 4px 7px) }
:root[data-theme="dark"] :is(.bar-value b, .ring > span) { background: var(--panel) }
:root[data-theme="dark"] :is(.search-box, select, input[type=number], .request-form input:not([type=hidden]), .request-form textarea, .review-note textarea) {
  background: var(--field);
  border-color: var(--field-edge);
  color: var(--ink);
}
:root[data-theme="dark"] .language-picker select { background: transparent }
:root[data-theme="dark"] .language-picker option { background: var(--panel); color: var(--ink) }
:root[data-theme="dark"] ::placeholder { color: #a6ac9e; opacity: 1 }
:root[data-theme="dark"] :is(.index-row > summary:hover, .compact-row:hover) { background: var(--raised) }
:root[data-theme="dark"] .badge { background: #33382f; color: #d5d9cf }
:root[data-theme="dark"] :is(.badge.conflict, .badge.high, .badge.rejected, button.warn) { background: #443024; color: #f4c29e }
:root[data-theme="dark"] :is(.badge.declared, .badge.proposed, .badge.medium, .badge.open) { background: #433820; color: #f2d388 }
:root[data-theme="dark"] :is(.badge.verified, .badge.approved, .badge.confirmed, .badge.resolved) { background: #34412e; color: #cde3bd }
:root[data-theme="dark"] .filter-tabs a[aria-current] { background: var(--tint); border-color: var(--brass); color: var(--brass) }
:root[data-theme="dark"] .record-page button.warn { border-color: #866750 }
:root[data-theme="dark"] .evi { background: #302d23; border-color: var(--gold) }
:root[data-theme="dark"] .notice { border-color: #6d5b2e }
:root[data-theme="dark"] mark.hl { background: #e9c258; color: #272112 }

.workspace-context { min-width: 0; display: flex; align-items: center; gap: clamp(8px, 1.3vw, 20px) }
.workspace-context .vault-tag { flex: none; white-space: nowrap }
.workspace-current { display: block; min-width: 0; max-width: 25ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600 }
.side-bottom > div:last-child { min-width: 0; overflow-wrap: anywhere }
.workspace-switch { min-width: 0; position: relative }
.workspace-switch summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 7px; align-items: center;
  min-height: 40px; padding: 3px 8px; border-radius: 7px; line-height: 1.3; list-style: none;
}
.workspace-switch summary::-webkit-details-marker { display: none }
.workspace-switch summary:hover, .workspace-switch[open] summary { background: var(--tint) }
.workspace-switch-caption { grid-column: 1; color: var(--muted); font-size: 11px }
.workspace-switch summary .workspace-current { grid-column: 1 }
.workspace-switch summary > .icon { grid-column: 2; grid-row: 1 / 3; width: 14px; color: var(--brass) }
.workspace-switch[open] summary > .icon { transform: rotate(180deg) }
.workspace-options {
  position: absolute; z-index: 12; top: calc(100% + 5px); right: 0; width: min(292px, 88vw); padding: 5px;
  color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 7px 20px #0002;
}
.workspace-options a { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 10px; border-radius: 7px }
.workspace-options a:hover, .workspace-options a[aria-current] { background: var(--tint) }
.workspace-options strong { grid-column: 1; font-size: 14px; font-weight: 600; overflow-wrap: anywhere }
.workspace-options small { grid-column: 1; color: var(--muted); font-size: 12px }
.workspace-selected { grid-column: 2; grid-row: 1 / 3; color: var(--brass); font-size: 11px }
@media (max-width: 700px) {
  .topbar { gap: 3px 7px; padding-block: 5px }
  .topbar .mobile-brand { align-self: center }
  .topbar .display-preferences { grid-area: 1 / 2 }
  .topbar .mobile-menu { grid-area: 1 / 3 }
  .workspace-context { grid-area: 2 / 1 / 3 / -1; flex-direction: row-reverse; justify-content: space-between; width: 100%; border-top: 1px solid var(--line); padding-top: 3px }
  .topbar .workspace-context .vault-tag { align-self: center }
  .workspace-switch { flex: 1 }
  .workspace-switch summary { display: flex; width: fit-content; max-width: 100%; gap: 5px; min-height: 33px; padding: 0 2px }
  .workspace-switch summary .workspace-current { flex: 0 1 auto; font-size: 12px }
  .workspace-switch-caption { font-size: 10px }
  .workspace-options { left: 0; right: auto }
  .workspace-context > .workspace-current { padding-block: 3px; max-width: 70% }
}
@media (max-width: 520px) {
  .workspace-switch-caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
  .workspace-switch summary { min-height: 44px }
}
