/* ============================================================================
   SynAmp Spectrum — design system, layer 2: components
   Buttons · chips · forms · cards · meters · tabs · accordion · tables ·
   toast · modal · tooltip · search · empty · callouts · timeline
   Requires synamp.css (tokens) first.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   BUTTONS — one primary per viewport. States move the background, never fade
   the label toward the background.
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--ghost);
  --btn-fg: var(--fg);
  --btn-border: var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r-sm);
  font: 500 0.9375rem/1 var(--font-sans); letter-spacing: 0.01em;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
  white-space: nowrap;
}
/* Hover changes the tokens, never a literal background — otherwise a later
   .btn:hover rule would clobber the variant's fill and darken primary. */
.btn:hover { --btn-bg: var(--ghost-hi); --btn-border: var(--border-strong); --btn-fg: #ffffff; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primary { --btn-bg: var(--gold); --btn-fg: var(--on-gold); --btn-border: var(--gold); font-weight: 600; }
.btn--primary:hover { --btn-bg: var(--gold-hi); --btn-border: var(--gold-hi); --btn-fg: var(--on-gold); box-shadow: var(--shadow-glow); }

.btn--coral { --btn-bg: var(--coral); --btn-fg: var(--on-coral); --btn-border: var(--coral); font-weight: 600; }
.btn--coral:hover { --btn-bg: var(--coral-hi); --btn-border: var(--coral-hi); --btn-fg: var(--on-coral); }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--fg); --btn-border: var(--border-strong); }
.btn--ghost:hover { --btn-bg: var(--ghost-hi); --btn-fg: #ffffff; --btn-border: var(--border-strong); }

.btn--quiet { --btn-bg: transparent; --btn-fg: var(--muted); --btn-border: transparent; }
.btn--quiet:hover { --btn-bg: var(--ghost); --btn-fg: #ffffff; }

.btn--danger { --btn-bg: transparent; --btn-fg: var(--danger-ink); --btn-border: rgba(255, 92, 87, 0.5); }
.btn--danger:hover { --btn-bg: rgba(255, 92, 87, 0.16); --btn-fg: #ffd7d5; --btn-border: var(--danger); }

.btn--sm { min-height: 36px; padding: 0 13px; font-size: 0.875rem; }
.btn--lg { min-height: 52px; padding: 0 26px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* ---------------------------------------------------------------------------
   CHIPS · TAGS · BADGES · SEGMENTED
   -------------------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: var(--r-pill);
  background: var(--ghost); border: 1px solid var(--border);
  color: #cfd4e2; font-size: 0.8125rem; letter-spacing: 0.01em;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.chip:hover { background: var(--ghost-hi); color: var(--fg); }
.chip[aria-pressed="true"], .chip.is-active { background: rgba(255, 205, 0, 0.14); border-color: var(--gold); color: var(--gold); }
.chip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; }
.chip--static { pointer-events: none; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: var(--r-xs);
  background: var(--ghost); border: 1px solid var(--border);
  font: 500 0.6875rem/1.6 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: #b0b6ca; /* 5.5:1 on raised cards */
}

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font: 500 0.75rem/1 var(--font-mono); letter-spacing: 0.04em;
  border: 1px solid var(--border); color: var(--muted);
}
.badge--live { color: var(--success); border-color: rgba(0, 230, 118, 0.4); background: rgba(0, 230, 118, 0.1); }
.badge--soon { color: var(--gold); border-color: rgba(255, 205, 0, 0.4); background: rgba(255, 205, 0, 0.1); }
.badge--next { color: var(--lavender-ink); border-color: rgba(171, 81, 255, 0.45); background: rgba(171, 81, 255, 0.12); }
.badge--muted { color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status-dot--live { background: var(--success); box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.18); }
.status-dot--soon { background: var(--gold); }
.status-dot--next { background: var(--lavender); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--well); border: 1px solid var(--border); border-radius: var(--r-pill); }
.segmented button {
  min-height: 34px; padding: 0 14px; border-radius: var(--r-pill);
  color: var(--muted); font-size: 0.8125rem; font-weight: 500;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.segmented button:hover { color: var(--fg); }
.segmented button[aria-selected="true"] { background: var(--surface-2); color: var(--fg); }

/* ---------------------------------------------------------------------------
   FORMS
   -------------------------------------------------------------------------- */
.field { display: grid; gap: 7px; }
.field > label, .label {
  font: 500 0.75rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.field .hint { font-size: 0.8125rem; color: var(--muted); }
.field .error { font-size: 0.8125rem; color: var(--danger-ink); display: flex; align-items: center; gap: 6px; }

.input, .textarea, .select {
  width: 100%; min-height: 44px; padding: 11px 13px;
  background: var(--well); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--border-strong); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--gold); background: var(--well-2);
  box-shadow: 0 0 0 3px rgba(255, 205, 0, 0.16);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger); }
.check input[aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 2px; }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(255, 92, 87, 0.18); }
.select { appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a4abc1' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.select--sm { min-height: 36px; padding: 7px 32px 7px 12px; font-size: 0.8125rem; background-position: right 11px center; border-radius: var(--r-pill); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group svg { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.input-group .input { padding-left: 40px; }
.input-group .input-group__btn { position: absolute; right: 6px; }

/* Checkbox + radio */
.check { display: flex; align-items: flex-start; gap: 11px; font-size: 0.9375rem; color: #d4d8e4; cursor: pointer; }
.check input { appearance: none; flex: none; width: 20px; height: 20px; margin-top: 2px;
  background: var(--well); border: 1px solid var(--border-strong); border-radius: 5px;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease); }
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: var(--gold); border-color: var(--gold);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231a1503' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 13px; background-position: center; background-repeat: no-repeat; }
.check input[type="radio"]:checked { background-image: none; box-shadow: inset 0 0 0 4px var(--well); }
.check input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 0.9375rem; }
.switch input { appearance: none; position: relative; width: 44px; height: 26px; flex: none;
  background: var(--surface-3); border-radius: var(--r-pill);
  transition: background var(--dur-2) var(--ease); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  background: #f1f1f1; border-radius: 50%; transition: transform var(--dur-2) var(--ease-out); }
.switch input:checked { background: var(--gold); }
.switch input:checked::after { transform: translateX(18px); background: var(--on-gold); }
.switch input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Range */
.range { appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--gold) var(--range-p, 40%), var(--surface-3) var(--range-p, 40%)); }
.range::-moz-range-track { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); }
.range::-moz-range-progress { height: 6px; border-radius: var(--r-pill); background: var(--gold); }
.range::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; margin-top: -6px;
  background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); border: 0; }
.range::-moz-range-thumb { width: 18px; height: 18px; background: #fff; border: 0; border-radius: 50%; }

/* ---------------------------------------------------------------------------
   CARDS · PANELS
   -------------------------------------------------------------------------- */
.card {
  --card-pad: clamp(20px, 2.4vw, 28px);
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--card-pad);
}
.card--ink { background: var(--ink); }
.card--well { background: var(--well); }
.card--flush { padding: 0; overflow: hidden; }
.card--interactive { transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease); }
.card--interactive:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--surface-2); }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-4); }
.card__head h3, .card__head h4 { margin: 0; }
.card__icon {
  width: 48px; height: 48px; border-radius: var(--r-md); flex: none;
  display: grid; place-items: center; background: var(--ghost); border: 1px solid var(--border); color: var(--gold);
}
.card__icon svg { width: 24px; height: 24px; }
.card p { color: var(--muted); font-size: 0.9375rem; }
.card p + p { margin-top: var(--s-3); }

/* Icon cards — the icon box hangs over the top edge, centred, elevated. */
.card--icon { padding-top: calc(var(--card-pad) + 46px); }
.card--icon > .card__icon {
  position: absolute; top: -20px; left: var(--card-pad); margin: 0;
  width: 58px; height: 58px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  z-index: 1;
}
.card--icon > .card__icon svg { width: 27px; height: 27px; }
.card--icon h3, .card--icon h4 { margin: 0 0 var(--s-3); }
@media (max-width: 640px) {
  .card--icon { padding-top: calc(var(--card-pad) + 40px); }
  .card--icon > .card__icon { top: -16px; width: 52px; height: 52px; }
  .card--icon > .card__icon svg { width: 24px; height: 24px; }
}

.panel { background: var(--well); border: 1px solid var(--border); border-radius: var(--r-lg); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-4) var(--s-5); }
.panel__body { padding: var(--s-5); border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------------------
   METRICS · PROGRESS · METER
   -------------------------------------------------------------------------- */
.metric { display: grid; gap: 6px; }
.metric__value { font-family: var(--font-display); font-size: clamp(2rem, 1.4rem + 2vw, 3rem); line-height: 1; letter-spacing: -0.02em; }
.metric__label { font: 500 0.75rem/1.4 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.metric__delta { font: 500 0.8125rem var(--font-mono); }
.metric__delta--up { color: var(--success); }
.metric__delta--down { color: var(--danger-ink); }

.meter { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.meter__fill { height: 100%; border-radius: inherit; background: var(--gold); width: var(--value, 40%); transition: width var(--dur-4) var(--ease-out); }
.meter--spectrum .meter__fill { background-image: var(--spectrum); background-size: 200% 100%; }
.meter--lg { height: 12px; }
progress.meter { appearance: none; width: 100%; border: 0; }
progress.meter::-webkit-progress-bar { background: var(--surface-3); border-radius: var(--r-pill); }
progress.meter::-webkit-progress-value { background: var(--gold); border-radius: var(--r-pill); }
progress.meter::-moz-progress-bar { background: var(--gold); border-radius: var(--r-pill); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font: 400 0.8125rem var(--font-mono); color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--gold); }

/* ---------------------------------------------------------------------------
   TABS
   -------------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  position: relative; padding: 12px 14px; color: var(--muted); font-size: 0.9375rem; white-space: nowrap;
  transition: color var(--dur-1) var(--ease);
}
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { color: var(--fg); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--gold); border-radius: 2px; }
.tabpanel { padding-top: var(--s-5); }

/* ---------------------------------------------------------------------------
   ACCORDION (native details/summary)
   -------------------------------------------------------------------------- */
.accordion { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.accordion + .accordion { margin-top: 12px; }
.accordion > summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: 18px 22px; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-size: 1.15rem;
}
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary:hover { background: var(--ghost); }
.accordion > summary .acc-icon { width: 20px; height: 20px; color: var(--gold); flex: none; transition: transform var(--dur-2) var(--ease); }
.accordion[open] > summary .acc-icon { transform: rotate(45deg); }
.accordion__body { padding: 0 22px 22px; color: var(--muted); font-size: 0.9375rem; }
.accordion__body > * + * { margin-top: var(--s-3); }

/* ---------------------------------------------------------------------------
   LIST ROWS · TABLES
   -------------------------------------------------------------------------- */
.rows { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-4);
  padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--border);
  transition: background var(--dur-1) var(--ease);
}
.rows .row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row__title { font-weight: 500; }
.row__meta { font: 400 0.8125rem var(--font-mono); color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table caption { text-align: left; padding-bottom: 12px; color: var(--muted); font-size: 0.875rem; }
.table th, .table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font: 500 0.6875rem/1.4 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.table tbody tr:hover { background: var(--ghost); }
.table td.num, .table th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.table--zebra tbody tr:nth-child(odd) { background: rgba(255, 255, 255, 0.02); }

/* ---------------------------------------------------------------------------
   CALLOUTS · NOTES
   -------------------------------------------------------------------------- */
.callout {
  display: flex; gap: var(--s-4); padding: var(--s-5);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.callout__icon { flex: none; width: 22px; height: 22px; color: var(--gold); margin-top: 2px; }
.callout__icon svg { width: 100%; height: 100%; }
.callout h4 { margin-bottom: 4px; }
.callout p { color: var(--muted); font-size: 0.9375rem; }
.callout--info .callout__icon { color: var(--info); }
.callout--warn .callout__icon { color: var(--warn); }
.callout--danger { border-color: rgba(255, 92, 87, 0.4); }
.callout--danger .callout__icon { color: var(--danger-ink); }
.callout--gold { border-color: rgba(255, 205, 0, 0.4); background: linear-gradient(180deg, rgba(255, 205, 0, 0.07), rgba(255, 205, 0, 0.02)); }

.note {
  font: 400 0.8125rem/1.6 var(--font-mono); color: var(--muted);
  padding-left: 14px; border-left: 2px solid var(--border-strong);
}

/* ---------------------------------------------------------------------------
   CODE · KBD
   -------------------------------------------------------------------------- */
kbd {
  font: 500 0.75rem/1 var(--font-mono); padding: 3px 7px; border-radius: var(--r-xs);
  background: var(--well); border: 1px solid var(--border-strong); border-bottom-width: 2px; color: #d4d8e4;
}
code { font-family: var(--font-mono); font-size: 0.875em; color: #ffd964; background: rgba(255, 205, 0, 0.09); padding: 2px 6px; border-radius: var(--r-xs); }
pre { font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.7; background: var(--well); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4); overflow: auto; }
pre code { background: none; padding: 0; color: #d4d8e4; }

/* ---------------------------------------------------------------------------
   TOOLBAR · FORM STATUS
   -------------------------------------------------------------------------- */
.toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .search { flex: 1 1 280px; }
.toolbar .count { font: 400 0.8125rem var(--font-mono); color: var(--muted); white-space: nowrap; }
.toolbar .select { flex: 0 1 auto; }

.form-status { border-radius: var(--r-sm); padding: 12px 14px; font-family: var(--font-sans); font-size: 0.9375rem; border: 1px solid var(--border); color: var(--muted); }
.form-status[data-tone="success"] { background: rgba(0, 230, 118, 0.1); border-color: rgba(0, 230, 118, 0.4); color: #8ff0bd; }
.form-status[data-tone="error"] { background: rgba(255, 92, 87, 0.1); border-color: rgba(255, 92, 87, 0.45); color: #ffb3b0; }

/* ---------------------------------------------------------------------------
   BREADCRUMB · PAGINATION
   -------------------------------------------------------------------------- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 400 0.8125rem var(--font-mono); color: var(--muted); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .sep { color: var(--faint); }

/* ---------------------------------------------------------------------------
   EMPTY STATE · SKELETON
   -------------------------------------------------------------------------- */
.empty { text-align: center; padding: clamp(40px, 6vw, 72px) var(--s-5); }
.empty__icon { width: 56px; height: 56px; margin: 0 auto var(--s-4); color: var(--gold); opacity: 0.9; }
.empty h3 { margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 42ch; margin-inline: auto; }

.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: sk 1.4s ease-in-out infinite; border-radius: var(--r-sm); height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------------------
   TOAST
   -------------------------------------------------------------------------- */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 160; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 40px)); }
.toast {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  background: var(--glass-solid); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  animation: toast-in var(--dur-3) var(--ease-out);
}
.toast[data-tone="success"] { border-color: rgba(0, 230, 118, 0.5); }
.toast[data-tone="error"] { border-color: rgba(255, 92, 87, 0.55); }
.toast__icon { flex: none; width: 20px; height: 20px; color: var(--gold); margin-top: 1px; }
.toast[data-tone="success"] .toast__icon { color: var(--success); }
.toast[data-tone="error"] .toast__icon { color: var(--danger); }
.toast strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1rem; }
.toast p { color: var(--muted); font-size: 0.875rem; margin-top: 2px; }
.toast__close { margin-left: auto; color: var(--muted); }
.toast__close:hover { color: var(--fg); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------------------------------------------------------------------------
   MODAL / DIALOG
   -------------------------------------------------------------------------- */
dialog.modal {
  border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  background: var(--bg-deep); color: var(--fg); padding: 0;
  width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(6, 7, 12, 0.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog.modal[open] { animation: modal-in var(--dur-3) var(--ease-out); }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.99); } }
.modal__head { padding: var(--s-5) var(--s-5) 0; }
.modal__body { padding: var(--s-4) var(--s-5) var(--s-5); }
.modal__foot { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.modal__close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: var(--r-sm); color: var(--muted); display: grid; place-items: center; }
.modal__close:hover { background: var(--ghost); color: var(--fg); }

/* ---------------------------------------------------------------------------
   TOOLTIP
   -------------------------------------------------------------------------- */
.tip { position: relative; }
.tip::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
  background: var(--glass-solid); border: 1px solid var(--border-strong); color: var(--fg);
  font: 400 0.75rem var(--font-mono); padding: 6px 10px; border-radius: var(--r-sm); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
  box-shadow: var(--shadow-md); z-index: 20;
}
.tip:hover::after, .tip:focus-visible::after { opacity: 1; transform: translateX(-50%); }

/* ---------------------------------------------------------------------------
   SEARCH
   -------------------------------------------------------------------------- */
.search { position: relative; }
.search .input { padding-left: 42px; height: 48px; }
.search > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }

/* ---------------------------------------------------------------------------
   TIMELINE (roadmap)
   -------------------------------------------------------------------------- */
.timeline { position: relative; }
.timeline__rail { position: absolute; left: 19px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.phase { position: relative; padding-left: 58px; padding-bottom: var(--s-7); }
.phase:last-child { padding-bottom: 0; }
.phase__node {
  position: absolute; left: 0; top: 2px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-strong);
  font: 500 0.8125rem var(--font-mono); color: var(--muted);
}
.phase[data-state="done"] .phase__node { background: rgba(0, 230, 118, 0.14); border-color: var(--success); color: var(--success); }
.phase[data-state="active"] .phase__node { background: rgba(255, 205, 0, 0.16); border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 5px rgba(255, 205, 0, 0.09); }
.phase[data-state="next"] .phase__node { border-color: var(--lavender); color: var(--lavender-ink); }
.phase__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.phase__head h2, .phase__head h3 { margin: 0; }
.phase__goal { color: #d4d8e4; margin-bottom: var(--s-4); max-width: 62ch; }
.phase__list { display: grid; gap: 8px; }
.phase__list li { position: relative; padding-left: 24px; color: var(--muted); font-size: 0.9375rem; }
.phase__list li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: 0.75; }
.phase__list li[data-kind="risk"]::before { background: var(--warn); }
.phase__list li[data-kind="done"]::before { background: var(--success); }
@media (max-width: 640px) { .phase { padding-left: 44px; } .timeline__rail { left: 15px; } .phase__node { width: 32px; height: 32px; font-size: 0.6875rem; } }

/* ---------------------------------------------------------------------------
   SPECTRUM SWATCHES
   -------------------------------------------------------------------------- */
.swatch { border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); }
.swatch__chip { height: 72px; }
.swatch__meta { padding: 10px 12px; background: var(--surface); }
.swatch__name { font: 500 0.75rem var(--font-mono); letter-spacing: 0.06em; }
.swatch__hex { font: 400 0.6875rem var(--font-mono); color: var(--muted); text-transform: uppercase; }
