/* ==========================================================================
   Components: buttons, forms, badges, cards, tables, drawer, modal, menus
   ========================================================================== */

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 12px; border-radius: var(--radius-control);
  border: 1px solid var(--border); background: var(--raised); color: var(--text);
  font-size: var(--text-sm); font-weight: 600; white-space: nowrap; text-decoration: none;
  transition: background var(--dur), border-color var(--dur), color var(--dur), box-shadow var(--dur);
  user-select: none;
}
.btn:hover { background: var(--hover); border-color: var(--text-faint); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--outline { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn--outline:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn--soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-soft-fg); }
.btn--soft:hover { background: color-mix(in oklab, var(--accent-soft) 80%, var(--accent)); border-color: transparent; }
.btn--ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--hover); border-color: transparent; color: var(--text); }
.btn--danger { background: var(--negative-solid); border-color: var(--negative-solid); color: #fff; }
.btn--danger:hover { background: var(--negative); border-color: var(--negative); }
.btn--danger-soft { background: var(--negative-soft); border-color: transparent; color: var(--negative); }
.btn--danger-soft:hover { background: color-mix(in oklab, var(--negative-soft) 82%, var(--negative-solid)); border-color: transparent; }
.btn--sm { height: 28px; padding: 0 9px; font-size: var(--text-xs); gap: 5px; }
.btn--xs { height: 26px; padding: 0 8px; font-size: var(--text-xs); gap: 4px; } /* DS-G: was 24px */
.btn--lg { height: 38px; padding: 0 18px; font-size: var(--text-base); }
.btn--icon { width: 32px; padding: 0; }
.btn--icon.btn--sm { width: 28px; }
.btn--icon.btn--xs { width: 26px; }
.btn--block { width: 100%; }
.btn-group { display: inline-flex; }
.btn-group > .btn { border-radius: 0; margin-left: -1px; }
.btn-group > .btn:first-child { border-radius: var(--radius-control) 0 0 var(--radius-control); margin-left: 0; }
.btn-group > .btn:last-child { border-radius: 0 var(--radius-control) var(--radius-control) 0; }
.btn-group > .btn--primary + .btn--primary { border-left-color: color-mix(in oklab, var(--accent-contrast) 30%, var(--accent)); }
.link-btn { border: 0; background: none; padding: 0; color: var(--link); cursor: pointer; font: inherit; text-align: left; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Forms ---------- */

.input, .select, .textarea {
  width: 100%; height: 32px; padding: 0 10px; border-radius: var(--radius-control);
  border: 1px solid var(--border); background: var(--raised); color: var(--text);
  font-size: var(--text-sm); outline: none;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-faint); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.input[disabled], .select[disabled], .textarea[disabled] { background: var(--sunken); color: var(--text-faint); cursor: not-allowed; }
.input.is-invalid, .textarea.is-invalid, .taginput.is-invalid { border-color: var(--negative-solid); box-shadow: 0 0 0 3px color-mix(in oklab, var(--negative-solid) 22%, transparent); }
.input--mono { font-family: var(--font-mono); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238791a3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.select--sm { height: 26px; font-size: var(--text-xs); padding: 0 24px 0 8px; width: auto; }
.select--inline { width: auto; min-width: 190px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > svg { position: absolute; left: 9px; color: var(--text-faint); pointer-events: none; }
.input-wrap > .input { padding-left: 30px; }
.input-wrap > .input-suffix { position: absolute; right: 4px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field + .field { margin-top: 14px; }
.field__label { font-size: var(--text-sm); font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 5px; }
.field__label .req { color: var(--negative-solid); }
.field__hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: -2px; }
.field__error { font-size: var(--text-xs); color: var(--negative); display: none; }
.field.has-error .field__error { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .field + .field { margin-top: 0; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: var(--text-sm); color: var(--text-body); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  width: 32px; height: 18px; border-radius: 999px; background: var(--border); position: relative; flex: none;
  transition: background var(--dur);
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform var(--dur) var(--ease);
}
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: .5; }
/* A control whose data has no source yet (real LockedSwitch): shown, locked and off, with the
   no-data label. It never filters. */
.switch.is-locked { cursor: not-allowed; color: var(--text-muted); }
.no-data { color: var(--text-muted); font-size: var(--text-xs); }
.switch-note { margin-left: -3px; }
.assets-toolbar { flex-wrap: wrap; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: var(--text-sm); }
.check input {
  appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; flex: none;
  border: 1.5px solid var(--border); border-radius: var(--radius-xs); background: var(--raised);
  display: grid; place-items: center; cursor: pointer; transition: background var(--dur), border-color var(--dur);
}
.check input:hover { border-color: var(--text-faint); }
.check input:checked, .check input:indeterminate { background: var(--accent); border-color: var(--accent); }
.check input:checked::after {
  content: ""; width: 9px; height: 5px; border-left: 2px solid var(--accent-contrast); border-bottom: 2px solid var(--accent-contrast);
  transform: rotate(-45deg) translate(1px, -1px);
}
.check input:indeterminate::after { content: ""; width: 8px; height: 2px; background: var(--accent-contrast); }
.check input[type="radio"] { border-radius: 50%; }
.check input[type="radio"]:checked::after { width: 6px; height: 6px; border: 0; border-radius: 50%; background: var(--accent-contrast); transform: none; }

.radio-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-card { position: relative; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card span {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--radius-control);
  border: 1px solid var(--border); background: var(--raised); font-size: var(--text-sm); font-weight: 550; cursor: pointer;
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.radio-card span:hover { border-color: var(--text-faint); }
.radio-card input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-soft-fg); }
.radio-card input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.radio-card input:disabled + span { opacity: .5; cursor: not-allowed; }

.taginput {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 32px; padding: 4px 6px;
  border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--raised); cursor: text;
}
.taginput:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.taginput input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 120px; height: 22px; font-size: var(--text-sm); }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: var(--radius-sm);
  background: var(--neutral-soft); color: var(--neutral-fg); font-size: var(--text-xs); font-weight: 600; white-space: nowrap;
}
.chip--accent { background: var(--accent-soft); color: var(--accent-soft-fg); }
.chip--mono { font-family: var(--font-mono); font-weight: 500; }
.chip button { border: 0; background: none; padding: 0; color: inherit; opacity: .6; display: grid; place-items: center; }
.chip button:hover { opacity: 1; }
.tagcell { display: inline-flex; gap: 4px; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 20px; padding: 0 7px; border-radius: var(--radius-sm);
  font: 680 var(--text-2xs)/1 var(--font-sans); letter-spacing: .055em; text-transform: uppercase; white-space: nowrap;
  background: var(--neutral-soft); color: var(--neutral-fg);
}
.badge--wide { min-width: 96px; }
.badge--type { width: 78px; justify-content: flex-start; gap: 5px; padding: 0 8px; background: var(--accent-soft); color: var(--accent-soft-fg); }
.badge--type svg { flex: none; opacity: .8; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; width: 92px; height: 22px; padding: 0 9px; border: 0; border-radius: 999px; font: 600 var(--text-xs)/1 var(--font-sans); white-space: nowrap; }
.status-pill--ok { background: var(--positive-soft); color: var(--positive); }
.status-pill--wait { background: var(--warning-soft); color: var(--warning); cursor: pointer; }
.status-pill--wait:hover { box-shadow: 0 0 0 3px var(--ring); }
.badge--accent { background: var(--accent-soft); color: var(--accent-soft-fg); }
.badge--positive { background: var(--positive-soft); color: var(--positive); }
.badge--negative { background: var(--negative-soft); color: var(--negative); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--purple { background: var(--purple-soft); color: var(--purple); }
.badge--solid-accent { background: var(--accent); color: var(--accent-contrast); }
.badge--solid-positive { background: var(--positive-solid); color: #fff; }
.badge--solid-negative { background: var(--negative-solid); color: #fff; }
.badge--solid-warning { background: var(--warning-solid); color: #241700; }
.badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--text-muted); }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--new { background: var(--purple-soft); color: var(--purple); height: 17px; padding: 0 5px; margin-left: 6px; }
.badge.is-clickable { cursor: pointer; }

.sev {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 98px; height: 20px; padding: 0 8px;
  border-radius: var(--radius-sm); font: 700 var(--text-2xs)/1 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.sev b { font: 650 var(--text-2xs)/1 var(--font-mono); letter-spacing: 0; opacity: .92; }
.sev--critical { background: var(--sev-critical); color: var(--sev-critical-fg); }
.sev--high { background: var(--sev-high); color: var(--sev-high-fg); }
.sev--medium { background: var(--sev-medium); color: var(--sev-medium-fg); }
.sev--low { background: var(--sev-low); color: var(--sev-low-fg); }
.sev--info { background: var(--sev-info); color: var(--sev-info-fg); }

.sevbox { display: inline-flex; gap: 3px; vertical-align: middle; }
.sevbox i {
  min-width: 27px; height: 18px; padding: 0 4px; border-radius: var(--radius-xs); font: 700 10.5px/18px var(--font-mono);
  font-style: normal; text-align: center; background: var(--sev-none); color: var(--sev-none-fg);
}
.sevbox i.c { background: var(--sev-critical); color: var(--sev-critical-fg); }
.sevbox i.h { background: var(--sev-high); color: var(--sev-high-fg); }
.sevbox i.m { background: var(--sev-medium); color: var(--sev-medium-fg); }
.sevbox i.l { background: var(--sev-low); color: var(--sev-low-fg); }
.sevbox i.i { background: var(--sev-info); color: var(--sev-info-fg); }

.code-chip {
  display: inline-block; font: 500 var(--text-xs)/1 var(--font-mono); padding: 4px 6px; border-radius: var(--radius-xs);
  background: var(--accent-soft); color: var(--accent-soft-fg); white-space: nowrap;
}
.code-chip--neutral { background: var(--neutral-soft); color: var(--neutral-fg); }

.path { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.path__node {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: var(--radius-sm);
  background: var(--neutral-soft); color: var(--neutral-fg); font: 600 var(--text-2xs)/1 var(--font-mono); white-space: nowrap; border: 0;
}
.path__node b { font: 700 9.5px/1 var(--font-sans); letter-spacing: .07em; text-transform: uppercase; opacity: .75; }
button.path__node:hover { background: var(--accent-soft); color: var(--accent-soft-fg); }
.path__node.is-current { background: var(--accent-soft); color: var(--accent-soft-fg); }
.path__arrow { color: var(--text-faint); }

/* ---------- Cards ---------- */

.card { background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-card); min-width: 0; }
.card + .card { margin-top: 14px; }
.grid > .card + .card, .card-row > .card + .card, .dash-lead > .card + .card, .dash-row > .card + .card { margin-top: 0; }
.card__head {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; min-height: 44px;
  border-bottom: 1px solid var(--border-subtle);
}
.card__title { font-size: var(--text-base); font-weight: 650; color: var(--text); white-space: nowrap; }
.card__body { padding: 14px; }
.card__body--flush { padding: 0; }
.card__foot { padding: 10px 14px; border-top: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 8px; }
.card > .table-card { border: 0; border-radius: 0 0 var(--radius-card) var(--radius-card); }
.card-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); } }

.stat {
  background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; position: relative;
  text-decoration: none; color: inherit; transition: border-color var(--dur), box-shadow var(--dur);
}
a.stat:hover, button.stat:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); text-decoration: none; }
.stat__label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat__label svg { color: var(--text-faint); }
.stat__value { font: 680 24px/1 var(--font-sans); color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat__value.is-zero { color: var(--text-faint); }
.stat__sub { font-size: var(--text-xs); color: var(--text-muted); }

.kv { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; font-size: var(--text-sm); }
.kv > dt, .kv > dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); min-width: 0; }
.kv > dt { color: var(--text-muted); padding-right: 12px; }
.kv > dd { color: var(--text); overflow-wrap: anywhere; }
.kv > dt:nth-last-child(2), .kv > dd:last-child { border-bottom: 0; }
.kv--plain > dt, .kv--plain > dd { border-bottom: 0; padding: 4px 0; }

.callout {
  display: flex; gap: 10px; padding: 11px 14px; border-radius: var(--radius-card);
  background: var(--info-soft); color: var(--text-body); border: 1px solid color-mix(in oklab, var(--info-solid) 28%, transparent);
  font-size: var(--text-sm);
}
.callout > svg { color: var(--info); margin-top: 1px; }
.callout__title { font-weight: 650; color: var(--info); margin-bottom: 2px; }
.callout--warn { background: var(--warning-soft); border-color: color-mix(in oklab, var(--warning-solid) 35%, transparent); }
.callout--warn > svg, .callout--warn .callout__title { color: var(--warning); }
.callout--danger { background: var(--negative-soft); border-color: color-mix(in oklab, var(--negative-solid) 30%, transparent); }
.callout--danger > svg, .callout--danger .callout__title { color: var(--negative); }
.callout--positive { background: var(--positive-soft); border-color: color-mix(in oklab, var(--positive-solid) 30%, transparent); }
.callout--positive > svg, .callout--positive .callout__title { color: var(--positive); }
.callout ul { margin: 4px 0 0; padding-left: 18px; }
.callout li + li { margin-top: 2px; }

.codeblock {
  font: 500 var(--text-xs)/1.6 var(--font-mono); background: var(--sunken); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control); padding: 10px 12px; overflow: auto; white-space: pre; color: var(--text-body); margin: 0;
  max-height: 340px;
}
.codeblock--wrap { white-space: pre-wrap; overflow-wrap: anywhere; }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 44px 20px; color: var(--text-muted); }
.empty__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--sunken); color: var(--text-faint); border: 1px solid var(--border-subtle); }
.empty__title { font-weight: 650; color: var(--text); font-size: var(--text-base); }
.empty__text { max-width: 420px; font-size: var(--text-sm); }
.empty .btn { margin-top: 6px; }

/* ---------- Data table ---------- */

.table-card {
  background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-card);
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
}
.table-scroll { overflow: auto; position: relative; }
.table-card--bounded > .table-scroll { max-height: 480px; }
table.dt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--text-sm); }
.dt thead th {
  position: sticky; top: 0; z-index: 2; background: var(--sunken); text-align: left;
  font: 680 var(--text-2xs)/1.2 var(--font-sans); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted);
  height: 34px; padding: 0 6px 0 10px; white-space: nowrap;
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border-subtle);
}
.dt thead th:last-child, .dt td:last-child { border-right: 0; }
.dt th.is-sortable { cursor: pointer; user-select: none; }
.dt th.is-sortable:hover { color: var(--text); }
.th-inner { display: flex; align-items: center; gap: 4px; }
.th-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.th-sort { color: var(--text-faint); opacity: .55; display: grid; place-items: center; }
.dt th[aria-sort] .th-sort { color: var(--accent); opacity: 1; }
.th-filter {
  width: 24px; height: 24px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent;
  color: var(--text-faint); display: grid; place-items: center; flex: none; padding: 0;
}
.th-filter:hover { background: var(--raised); border-color: var(--border); color: var(--text); }
.th-filter.is-active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.dt td {
  height: 38px; padding: 0 10px; white-space: nowrap; max-width: 460px; overflow: hidden; text-overflow: ellipsis;
  border-bottom: 1px solid var(--border-subtle); border-right: 1px solid var(--border-subtle); color: var(--text-body);
}
.dt tbody tr:last-child td { border-bottom: 0; }
.dt tbody tr { transition: background .1s; }
.dt tbody tr:hover { background: var(--hover); }
.dt tbody tr.is-selected { background: var(--selected); }
.dt tbody tr.is-clickable { cursor: pointer; }
.dt td.col-check, .dt th.col-check { width: 36px; padding: 0 0 0 10px; }
.dt td.col-menu, .dt th.col-menu { width: 40px; padding: 0 6px; text-align: center; }
.dt td.wrap { white-space: normal; }
.dt td a, .dt td .link-btn { color: var(--link); }
.dt td.mono, .dt td .mono { font-family: var(--font-mono); font-size: 12px; }
.dt tr[data-sev] td:first-child { box-shadow: inset 2px 0 0 var(--row-sev, transparent); }
.dt tr[data-sev="critical"] { --row-sev: var(--sev-critical); }
.dt tr[data-sev="high"] { --row-sev: var(--sev-high); }
.dt tr[data-sev="medium"] { --row-sev: var(--sev-medium); }
.dt tr[data-sev="low"] { --row-sev: var(--sev-low); }
.dt tr[data-sev="info"] { --row-sev: var(--sev-info); }
.dt--compact td { height: 34px; }
.dt--fixed { table-layout: fixed; }
.dt--fixed td { max-width: none; }
.dt .cell-main { color: var(--link); }
.dt .cell-main:hover { text-decoration: underline; }

.dt-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 7px 10px; border-bottom: 1px solid var(--border-subtle); background: var(--raised); font-size: var(--text-xs); }
.dt-bulk {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border);
  background: var(--selected); font-size: var(--text-xs); color: var(--text);
}
.dt-foot {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-top: 1px solid var(--border);
  font-size: var(--text-xs); color: var(--text-muted); flex: none; background: var(--raised);
}
.dt-foot__range { font-family: var(--font-mono); color: var(--text-body); }
.pager { display: flex; align-items: center; gap: 3px; }
.pager button {
  min-width: 24px; height: 24px; padding: 0 5px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--raised); color: var(--text-body); font: 600 11px/1 var(--font-mono); display: grid; place-items: center;
}
.pager button:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); }
.pager button[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.pager button[disabled] { opacity: .4; cursor: default; }
.pager span { padding: 0 3px; color: var(--text-faint); }

/* ---------- Popover / menu / tooltip ---------- */

.popover {
  position: fixed; z-index: 90; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg); min-width: 180px; max-width: 380px; animation: rise .14s var(--ease) both;
}
.menu { padding: 5px; min-width: 200px; }
.menu__label { font: 650 var(--text-2xs)/1 var(--font-sans); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-faint); padding: 7px 8px 5px; }
.menu__item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border: 0; background: transparent; border-radius: var(--radius-sm);
  font-size: var(--text-sm); color: var(--text-body); text-align: left; text-decoration: none; white-space: nowrap;
}
.menu__item:hover, .menu__item:focus-visible { background: var(--hover); color: var(--text); text-decoration: none; outline: 0; }
.menu__item svg { color: var(--text-muted); }
.menu__item--danger, .menu__item--danger svg { color: var(--negative); }
.menu__item[disabled] { opacity: .45; pointer-events: none; }
.menu__item .spacer + * { color: var(--text-faint); font-size: var(--text-xs); }
.menu__sep { height: 1px; background: var(--border-subtle); margin: 5px -5px; }
.menu__check { margin-left: auto; color: var(--accent) !important; }

.filterpop { width: 320px; padding: 12px; }
.filterpop__title { font-weight: 650; color: var(--text); font-size: var(--text-sm); }
.filterpop__desc { font-size: var(--text-xs); color: var(--text-muted); margin: 2px 0 9px; }
.filterpop__list { max-height: 220px; overflow: auto; margin: 8px -6px 0; padding: 0 2px; }
.filterpop__opt { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: var(--radius-sm); font-size: var(--text-sm); cursor: pointer; }
.filterpop__opt:hover { background: var(--hover); }
.filterpop__opt > span:not(.check) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.filterpop__opt em { font: 500 10.5px/1 var(--font-mono); color: var(--text-faint); font-style: normal; }
.filterpop__foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }

.tooltip {
  position: fixed; z-index: 120; pointer-events: none; max-width: 300px; padding: 6px 9px; border-radius: var(--radius-sm);
  background: var(--border-strong); color: #fff; font-size: var(--text-xs); line-height: 1.4; box-shadow: var(--shadow-md);
  opacity: 0; transition: opacity .1s;
}
:root[data-theme="dark"] .tooltip { background: #e9edf4; color: #0b111c; }
.tooltip.is-visible { opacity: 1; }
[data-tip] { cursor: help; }
button[data-tip], a[data-tip], .is-clickable[data-tip], label[data-tip] { cursor: pointer; }

/* ---------- Toasts ---------- */

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 130; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 440px; padding: 10px 12px;
  background: var(--raised); border: 1px solid var(--border); border-left: 3px solid var(--info-solid); border-radius: var(--radius-control);
  box-shadow: var(--shadow-lg); font-size: var(--text-sm); color: var(--text); animation: rise .2s var(--ease) both;
}
.toast--positive { border-left-color: var(--positive-solid); } .toast--positive > svg { color: var(--positive); }
.toast--negative { border-left-color: var(--negative-solid); } .toast--negative > svg { color: var(--negative); }
.toast--warning { border-left-color: var(--warning-solid); } .toast--warning > svg { color: var(--warning); }
.toast--info > svg { color: var(--info); }
.toast__msg { flex: 1; }
.toast.is-leaving { opacity: 0; transform: translateX(12px); transition: opacity .2s, transform .2s; }

/* ---------- Modal ---------- */

.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 100; display: grid; place-items: start center; padding: 9vh 16px 16px; overflow: auto; animation: fade .16s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 560px; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-frame);
  box-shadow: var(--shadow-xl); display: flex; flex-direction: column; animation: rise .2s var(--ease) both;
}
.modal--sm { max-width: 430px; } .modal--lg { max-width: 780px; } .modal--xl { max-width: 980px; }
.modal__head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 12px; }
.modal__title { font-size: var(--text-lg); font-weight: 680; color: var(--text); flex: 1; }
.modal__body { padding: 4px 18px 16px; font-size: var(--text-sm); }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border-subtle); background: var(--surface); border-radius: 0 0 var(--radius-frame) var(--radius-frame); }
.modal__foot .left { margin-right: auto; }

/* ---------- Drawer (slide-out panel) ---------- */

.drawer-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .22s; }
.drawer-overlay.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(1260px, 66vw); min-width: min(100vw, 780px);
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-xl);
  display: flex; transform: translateX(104%); transition: transform .28s var(--ease), width .22s var(--ease);
}
.drawer.is-open { transform: none; }
.drawer.has-feed { width: min(1500px, 82vw); }
.drawer__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.drawer__head { flex: none; padding: 14px 22px 0; background: var(--raised); border-bottom: 1px solid var(--border); }
.drawer__head.no-tabs { padding-bottom: 14px; }
.drawer__top { display: flex; align-items: flex-start; gap: 10px; }
.drawer__badges { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; align-items: center; min-height: 28px; }
.drawer__actions { display: flex; align-items: center; gap: 8px; flex: none; }
.drawer__title { font-size: 22px; font-weight: 700; letter-spacing: -.015em; color: var(--text); margin: 6px 0 8px; line-height: 1.25; overflow-wrap: anywhere; }
.drawer__title.mono { font-size: 19px; letter-spacing: -.02em; }
.drawer__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--text-sm); color: var(--text-muted); margin-bottom: 10px; align-items: center; }
.drawer__meta b { color: var(--text); font-weight: 550; margin-left: 4px; }
.drawer__meta > span { display: inline-flex; align-items: center; gap: 2px; }
.drawer__tabs { margin-top: 4px; }
.drawer__tabs .tab { font-size: var(--text-sm); padding: 8px 9px 9px; }
.drawer__body { flex: 1; min-height: 0; overflow: auto; padding: 16px 22px 32px; }
.drawer__feedtab {
  position: absolute; left: -31px; top: 22px; width: 30px; padding: 12px 0; border: 0;
  background: var(--accent); color: var(--accent-contrast); border-radius: var(--radius-control) 0 0 var(--radius-control);
  display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: var(--text-xs); font-weight: 650; letter-spacing: .04em;
  box-shadow: -4px 4px 12px -6px rgba(0, 0, 0, .4);
}
.drawer__feedtab:hover { background: var(--accent-hover); }
.drawer__feedtab span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.drawer__feedtab em { font: 700 10px/1 var(--font-mono); font-style: normal; background: rgba(255, 255, 255, .22); padding: 3px 4px; border-radius: 3px; }
.drawer__feed { width: 320px; flex: none; border-left: 1px solid var(--border); background: var(--raised); display: none; flex-direction: column; min-height: 0; }
.drawer.has-feed .drawer__feed { display: flex; }
.feed__head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); font-weight: 650; color: var(--text); }
.feed__list { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; }
.feed__item { display: flex; gap: 9px; font-size: var(--text-sm); }
.feed__item .avatar { margin-top: 1px; }
.feed__icon { width: 22px; height: 22px; border-radius: 50%; background: var(--sunken); border: 1px solid var(--border-subtle); display: grid; place-items: center; color: var(--text-muted); flex: none; }
.feed__meta { font-size: var(--text-xs); color: var(--text-faint); }
.feed__meta b { color: var(--text); font-weight: 600; }
.feed__text { color: var(--text-body); margin-top: 2px; overflow-wrap: anywhere; }
.feed__text--comment { background: var(--sunken); border: 1px solid var(--border-subtle); border-radius: 2px 8px 8px 8px; padding: 7px 9px; margin-top: 4px; }
.feed__compose { padding: 10px 14px 12px; border-top: 1px solid var(--border-subtle); }
.feed__compose .textarea { min-height: 62px; }

/* ---------- Charts ---------- */

.rings { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 14px 8px 12px; }
.ring-btn { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 4px; border-radius: var(--radius-card); text-align: center; }
.ring-btn:hover { background: var(--hover); }
.ring-btn__sev { font: 720 var(--text-xs)/1 var(--font-sans); letter-spacing: .07em; }
.ring-btn__cap { font-size: var(--text-xs); color: var(--text-muted); margin-top: 3px; }
.ring-inline { display: inline-flex; gap: 8px; }
.ring-mini { border: 0; background: transparent; padding: 0; border-radius: 50%; }
.ring-mini:hover { filter: brightness(1.05); box-shadow: 0 0 0 3px var(--ring); }
.c-critical { color: var(--sev-critical); } .c-high { color: var(--sev-high); } .c-medium { color: var(--sev-medium); } .c-low { color: var(--sev-low); } .c-info { color: var(--sev-info); }
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font: 500 10.5px var(--font-mono); fill: var(--text-faint); }
.chart .grid-line { stroke: var(--border-subtle); stroke-width: 1; }
.chart .axis-line { stroke: var(--border); stroke-width: 1; }
.chart-legend { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.chart-legend button {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 3px 4px; border-radius: var(--radius-sm);
  font-size: var(--text-xs); color: var(--text-body); font-weight: 550;
}
.chart-legend button:hover { background: var(--hover); }
.chart-legend button.is-off { color: var(--text-faint); text-decoration: line-through; }
.chart-legend i { width: 14px; height: 3px; border-radius: 2px; background: currentColor; display: inline-block; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-control);
  box-shadow: var(--shadow-md); padding: 7px 9px; font-size: var(--text-xs); white-space: nowrap; display: none;
}
.chart-tip b { color: var(--text); }
.chart-tip div { display: flex; align-items: center; gap: 6px; }
.chart-tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ---------- Graph ---------- */

.graph { position: relative; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; min-height: 420px;
  background-image: radial-gradient(circle, var(--border-subtle) 1px, transparent 1px); background-size: 18px 18px; }
.graph > svg { width: 100%; height: 100%; cursor: grab; display: block; touch-action: none; }
.graph > svg.is-panning { cursor: grabbing; }
.graph__edge { stroke: var(--edge); stroke-width: 1; opacity: .5; }
.graph__edge.is-hot { stroke: var(--accent); opacity: 1; stroke-width: 1.6; }
.graph__edge.is-path { stroke: var(--node-current); opacity: 1; stroke-width: 2; }
.graph__edge.is-dim { opacity: .08; }
.graph__node { cursor: pointer; }
.graph__node circle.bg { stroke: var(--raised); stroke-width: 2; }
.graph__node.is-dim { opacity: .18; }
.graph__node.is-selected circle.bg { stroke: var(--text); stroke-width: 2.5; }
.graph__node text { font: 600 11px var(--font-mono); fill: var(--text); paint-order: stroke; stroke: var(--raised); stroke-width: 3px; pointer-events: none; }
.graph__node text { display: none; }
.graph__node.is-labelled text, .graph__node.is-selected text, .graph__node.is-near text, .graph__node:hover text, .graph > svg.show-labels .graph__node text { display: block; }
.graph__node .glyph { stroke: #fff; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.graph__controls { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 4px; }
.graph__controls .btn { box-shadow: var(--shadow-sm); }
.graph__legend {
  position: absolute; left: 10px; bottom: 10px; display: flex; gap: 12px; flex-wrap: wrap; padding: 6px 10px; border-radius: var(--radius-control);
  background: color-mix(in oklab, var(--raised) 92%, transparent); border: 1px solid var(--border-subtle); font-size: var(--text-xs); color: var(--text-muted);
}
.graph__legend span { display: inline-flex; align-items: center; gap: 5px; }
.graph__legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.graph__info {
  position: absolute; top: 10px; right: 10px; width: 270px; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-md); padding: 12px; font-size: var(--text-sm);
}
.graph__info h4 { font: 600 13px/1.3 var(--font-mono); color: var(--text); margin: 6px 0 8px; overflow-wrap: anywhere; }
.graph__count { position: absolute; right: 10px; bottom: 10px; font: 500 var(--text-2xs) var(--font-mono); color: var(--text-faint); }

/* ---------- Map ---------- */

.geo { display: grid; grid-template-columns: minmax(0, 1fr) 300px; border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; background: var(--raised); min-height: 360px; }
.geo__map { position: relative; background: var(--map-sea); min-height: 320px; overflow: hidden; }
.geo__map > svg { width: 100%; height: 100%; display: block; cursor: grab; }
.geo__map .land { fill: var(--map-land); stroke: var(--map-line); stroke-width: .5; vector-effect: non-scaling-stroke; }
.geo__map .graticule { stroke: var(--map-line); stroke-width: .5; opacity: .35; fill: none; vector-effect: non-scaling-stroke; }
.geo__map .pin { fill: var(--accent); stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.geo__map .pulse-ring { fill: none; stroke: var(--accent); vector-effect: non-scaling-stroke; }
.geo__zoom { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 4px; }
.geo__note { position: absolute; left: 10px; bottom: 8px; font: 500 var(--text-2xs) var(--font-mono); color: var(--text-faint); }
.geo__side { border-left: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; }
.geo__side h4 { font: 650 15px var(--font-mono); color: var(--text); padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
.geo__side dl { margin: 0; padding: 4px 14px 10px; overflow: auto; }
.geo__side .kv > dd { text-align: right; font-weight: 600; }
@media (max-width: 1280px) { .geo { grid-template-columns: 1fr; } .geo__side { border-left: 0; border-top: 1px solid var(--border); } }

/* ---------- Command palette ---------- */

.cmdk { max-width: 620px; overflow: hidden; }
.cmdk__input { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 48px; border-bottom: 1px solid var(--border-subtle); color: var(--text-faint); }
.cmdk__input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: var(--text-lg); color: var(--text); }
.cmdk__list { max-height: 54vh; overflow: auto; padding: 6px; }
.cmdk__group { font: 650 var(--text-2xs)/1 var(--font-sans); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-faint); padding: 9px 8px 5px; }
.cmdk__item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-control); font-size: var(--text-sm); color: var(--text-body); cursor: pointer; }
.cmdk__item svg { color: var(--text-muted); }
.cmdk__item.is-active { background: var(--accent-soft); color: var(--accent-soft-fg); }
.cmdk__item.is-active svg { color: var(--accent-soft-fg); }
.cmdk__item small { margin-left: auto; color: var(--text-faint); font-size: var(--text-xs); white-space: nowrap; }
.cmdk__item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk__foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border-subtle); font-size: var(--text-xs); color: var(--text-faint); background: var(--surface); }

/* ---------- Tenant switcher ---------- */

.tenant-pop { width: 330px; }
.tenant-pop__search { padding: 8px; border-bottom: 1px solid var(--border-subtle); }
.tenant-pop__list { max-height: 320px; overflow: auto; padding: 5px; }
.tenant-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; background: transparent; border-radius: var(--radius-sm); text-align: left; }
.tenant-row:hover { background: var(--hover); }
.tenant-row__name { font-size: var(--text-sm); font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-row__sub { font-size: var(--text-xs); color: var(--text-faint); }
.tenant-row .tenant-avatar { width: 26px; height: 26px; font-size: 11px; border-radius: 6px; }
.tenant-pop__foot { border-top: 1px solid var(--border-subtle); padding: 5px; }


/* ==========================================================================
   v2 additions (design review 2026-10-16)
   ========================================================================== */

/* ---------- DS-G: keyboard + targets ---------- */
.dt tbody tr[tabindex]:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: -2px; background: var(--hover); }
.dt th.is-sortable:focus-visible { outline-offset: -3px; }
.menu__item:focus-visible { box-shadow: inset 0 0 0 var(--focus-width) var(--focus); }
@media (pointer: coarse) {
  /* touch: 44px minimum targets */
  .btn, .btn--xs, .btn--sm, .icon-btn, .th-filter, .menu__item, .tab, .nav__item { min-height: 44px; }
  .btn--icon, .icon-btn, .th-filter { min-width: 44px; }
}

/* ---------- locked write actions (ADR 0024, DS-B) ---------- */
[aria-disabled="true"] { opacity: .55; cursor: not-allowed !important; }
[aria-disabled="true"]:hover { box-shadow: none; }
.lock-note { display: flex; align-items: flex-start; gap: 7px; font-size: var(--text-xs); color: var(--text-muted); line-height: 1.4; margin: 0 0 10px; flex: none; }
.lock-note svg { flex: none; margin-top: 1px; color: var(--text-faint); }
.empty .lock-note { margin: 8px 0 0; justify-content: center; }
.menu__item--locked { align-items: flex-start; opacity: .8; }
.menu__item--locked[aria-disabled="true"] { opacity: .8; }
.menu__stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; white-space: normal; }
.menu__stack small { display: flex; gap: 4px; align-items: flex-start; font-size: var(--text-2xs); color: var(--text-faint); max-width: 260px; line-height: 1.35; }
.menu__stack small svg { margin-top: 1px; }
.card.is-off { background: var(--sunken); }

/* ---------- roles in the header / switcher (ADR 0024) ---------- */
.scope__role { font: 650 var(--text-2xs)/1 var(--font-sans); padding: 3px 6px; border-radius: var(--radius-xs); background: var(--accent-soft); color: var(--accent-soft-fg); white-space: nowrap; }
.scope__role--group { background: var(--purple-soft); color: var(--purple); }
.scope__role--platform { background: var(--warning-soft); color: var(--warning); }
.tenant-pop { width: 360px; }
.tenant-pop__label { padding: 9px 8px 3px !important; }
.tenant-pop__group { margin: 5px; border: 1px dashed var(--border); align-items: flex-start; line-height: 1.3; }
.tenant-row .badge { flex: none; }

/* ---------- issue age (DS-E) ---------- */
/* Issue age: one font, one size, tabular figures; the tint (not the type) carries > 30 / > 90 days. */
.age { display: inline-block; min-width: 64px; padding: 3px 8px; border-radius: 999px; background: var(--neutral-soft); color: var(--text-muted);
  font: 550 var(--text-xs)/1.3 var(--font-sans); font-variant-numeric: tabular-nums; letter-spacing: 0; text-align: center; white-space: nowrap; }
.age--30 { background: var(--warning-soft); color: var(--warning); }
.age--90 { background: var(--negative-soft); color: var(--negative); }

/* Security score (ADR 0026): grade letter tile + 0–100. */
:root { --grade-A: var(--positive); --grade-B: var(--sev-low); --grade-C: var(--sev-medium); --grade-D: var(--sev-high); --grade-F: var(--sev-critical); }
.score-chip { display: inline-flex; align-items: center; gap: 7px; font: 600 var(--text-sm)/1 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--text-body); white-space: nowrap; }
.score-chip b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; font: 750 11.5px/1 var(--font-sans); color: #fff; }
.score-chip--lg { font-size: var(--text-base); gap: 9px; }
.score-chip--lg b { width: 26px; height: 26px; font-size: 14px; border-radius: 6px; }
.score-chip--A b { background: var(--grade-A); } .score-chip--B b { background: var(--grade-B); } .score-chip--C b { background: var(--grade-C); }
.score-chip--D b { background: var(--grade-D); } .score-chip--F b { background: var(--grade-F); }

/* ---------- loading / error (DS-C) ---------- */
@keyframes sk-shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk { display: inline-block; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-hi) 50%, var(--skeleton) 75%); background-size: 200% 100%; animation: sk-shine 1.3s linear infinite; vertical-align: middle; }
.sk-tabs { display: flex; gap: 14px; padding-bottom: 12px; }
.sk-table { padding: 0; }
.sk-row { display: flex; gap: 18px; align-items: center; padding: 0 12px; height: 38px; border-bottom: 1px solid var(--border-subtle); }
.sk-row--head { background: var(--sunken); height: 34px; }
.empty__icon--error { background: var(--negative-soft); color: var(--negative); border-color: transparent; }

/* ---------- permission matrix (My account) ---------- */
.perm__yes, .perm__no { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.perm__yes { color: var(--positive); }
.perm__no { color: var(--text-faint); }
.dt.perm td.wrap { white-space: normal; max-width: 520px; }

/* ---------- Prototype controls (not product UI) ---------- */
.proto { position: fixed; left: 12px; bottom: 12px; z-index: 150; font-family: var(--font-sans); color: var(--proto-fg); }
.proto__fab {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--radius-pill); border: 0; cursor: pointer;
  font: 700 var(--text-xs)/1 var(--font-sans); letter-spacing: .02em; color: var(--proto-accent-fg);
  background: repeating-linear-gradient(-45deg, var(--proto-accent) 0 10px, #f2b200 10px 20px); box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .5), 0 0 0 2px var(--proto-bg);
}
.proto__panel {
  width: 356px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; background: var(--proto-bg); border-radius: 10px; overflow: hidden;
  box-shadow: 0 18px 48px -12px rgba(0, 0, 0, .6), 0 0 0 1px var(--proto-line); border-top: 6px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--proto-accent) 0 10px, var(--proto-bg) 10px 20px) 6;
}
.proto__head { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 12px; border-bottom: 1px solid var(--proto-line); }
.proto__head b { font-size: var(--text-sm); }
.proto__tag { font: 800 9.5px/1 var(--font-sans); letter-spacing: .12em; padding: 4px 6px; border-radius: 3px; background: var(--proto-accent); color: var(--proto-accent-fg); }
.proto__sub { font-size: var(--text-2xs); color: var(--proto-muted); flex: 1; }
.proto__x { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--proto-line); background: transparent; color: var(--proto-fg); cursor: pointer; }
.proto__body { overflow: auto; padding: 4px 12px 10px; scrollbar-color: var(--proto-line) transparent; }
.proto section { padding: 9px 0; border-bottom: 1px solid var(--proto-line); }
.proto h3 { font: 700 var(--text-2xs)/1.2 var(--font-sans); letter-spacing: .09em; text-transform: uppercase; color: var(--proto-accent); margin: 0 0 7px; }
.proto h3 small { text-transform: none; letter-spacing: 0; color: var(--proto-muted); font-weight: 500; }
.proto__people { display: grid; gap: 5px; }
.proto__person { display: flex; gap: 9px; align-items: flex-start; text-align: left; width: 100%; padding: 7px 8px; border-radius: 7px; border: 1px solid var(--proto-line); background: var(--proto-raised); color: var(--proto-fg); cursor: pointer; font-size: var(--text-xs); line-height: 1.35; }
.proto__person[aria-pressed="true"] { border-color: var(--proto-accent); box-shadow: inset 3px 0 0 var(--proto-accent); }
.proto__person b { font-size: var(--text-sm); }
.proto__person em { font-style: normal; color: var(--proto-muted); }
.proto__person small { display: block; color: var(--proto-muted); margin-top: 2px; }
.proto__switch { display: flex; align-items: flex-start; gap: 9px; padding: 5px 0; cursor: pointer; font-size: var(--text-xs); }
.proto__switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.proto__switch b { display: block; font-size: var(--text-sm); font-weight: 600; }
.proto__switch small { color: var(--proto-muted); }
.proto__track { flex: none; width: 32px; height: 18px; border-radius: 99px; background: var(--proto-line); position: relative; margin-top: 2px; transition: background .15s; }
.proto__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--proto-fg); transition: transform .15s; }
.proto__switch input:checked + .proto__track { background: var(--proto-accent); }
.proto__switch input:checked + .proto__track::after { transform: translateX(14px); background: var(--proto-accent-fg); }
.proto__switch input:focus-visible + .proto__track { outline: 2px solid var(--proto-accent); outline-offset: 2px; }
.proto__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--text-xs); padding: 2px 0 6px; }
.proto__seg { display: inline-flex; border: 1px solid var(--proto-line); border-radius: 7px; overflow: hidden; }
.proto__seg button { border: 0; background: transparent; color: var(--proto-fg); padding: 5px 10px; font-size: var(--text-xs); cursor: pointer; }
.proto__seg button + button { border-left: 1px solid var(--proto-line); }
.proto__seg button[aria-checked="true"] { background: var(--proto-accent); color: var(--proto-accent-fg); font-weight: 700; }
.proto__news { margin: 0; padding-left: 18px; font-size: var(--text-xs); color: var(--proto-muted); }
.proto__news li { padding: 2px 0; }
.proto__news a { color: var(--proto-fg); cursor: pointer; text-decoration: underline; text-decoration-color: var(--proto-line); text-underline-offset: 2px; font-size: var(--text-xs); line-height: 1.4; }
.proto__news a:hover { text-decoration-color: var(--proto-accent); }
.proto__news span { display: inline-block; margin-left: 5px; font: 600 9.5px/1 var(--font-mono); color: var(--proto-accent); }
.proto__note { font-size: var(--text-2xs); color: var(--proto-muted); margin-top: 6px; }
.proto__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; font-size: var(--text-2xs); color: var(--proto-muted); }
.proto__btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--proto-line); background: var(--proto-raised); color: var(--proto-fg); cursor: pointer; font-size: var(--text-xs); }
.proto :focus-visible { outline: 2px solid var(--proto-accent); outline-offset: 2px; }
.proto .avatar { flex: none; }
