/* ===========================================================================
 * Soft-UI design kit: components
 * ---------------------------------------------------------------------------
 * Plain CSS, no framework needed. Load tokens.css first.
 *
 * The look in one paragraph: a neutral grey page, flat white cards with large
 * corners, grey fills instead of bordered boxes for anything nested, capsule
 * controls, one ink primary button per view, and heavy tight-tracked headings
 * in one sans family. Separation comes from tone, not from lines.
 *
 * Contents: base, focus, type helpers, surfaces, buttons, inputs, segmented
 * control, chips, badges, list group, stat tile, table, app shell, navigation,
 * menu, modal, scope switcher, motion.
 * =========================================================================== */

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--body-size);
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { margin: 0; font-family: var(--font-sans); color: var(--ink); }
h1 { font-size: var(--h1-size); font-weight: var(--h1-weight); letter-spacing: var(--h1-track); line-height: 1.1; }
h2 { font-size: var(--h2-size); font-weight: var(--h2-weight); letter-spacing: var(--h2-track); line-height: 1.2; }
h3 { font-size: var(--h3-size); font-weight: var(--h3-weight); letter-spacing: var(--h3-track); line-height: 1.25; }
h4 { font-size: var(--h4-size); font-weight: var(--h4-weight); letter-spacing: var(--h4-track); line-height: 1.3; }
p  { margin: 0; }
a  { color: var(--brand); }

/* The hidden attribute must win over a component that sets display. */
[hidden] { display: none !important; }

/* ---- Focus (WCAG 2.4.7) ---------------------------------------------------
 * A visible 2px ring in the brand colour. :focus-visible, so a mouse click on a
 * button paints no ring while keyboard focus always does. Never remove this. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
/* On a dark surface the ring switches to the light tint so it stays visible. */
:where(.on-dark) :where(a, button, [tabindex]):focus-visible { outline-color: var(--tint); }

/* ---- Type helpers ---------------------------------------------------------- */
.eyebrow {
  font-size: var(--eyebrow-size);
  font-weight: var(--eyebrow-weight);
  letter-spacing: var(--eyebrow-track);
  text-transform: uppercase;
  color: var(--muted);
}
.caption  { font-size: var(--caption-size); color: var(--muted); }
.small    { font-size: var(--small-size); }
.muted    { color: var(--muted); }
.num-hero {
  font-size: var(--num-hero-size);
  font-weight: var(--num-hero-weight);
  letter-spacing: var(--num-hero-track);
  line-height: 1.05;
}
/* Column-aligned figures: tables, axis ticks, money. */
.tabular-nums { font-variant-numeric: tabular-nums; }

/* ===========================================================================
 * Surfaces. Pick by what the thing IS:
 *   .surface-card     the main content surface: a panel, a chart or table section
 *   .surface-tile     a small peer in a row or grid (a stat tile). White on the
 *                     canvas, a grey fill when it sits inside a white surface
 *   .surface-popover  a menu or dropdown: the first surface with a shadow
 *   .surface-overlay  a modal or dialog: pair it with a .scrim behind it
 * No border and no resting shadow on a card or a tile.
 * =========================================================================== */
.surface-card {
  background-color: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-flat);
}
.surface-tile {
  background-color: var(--surface);
  border: 0;
  border-radius: var(--radius-tile);
  box-shadow: var(--elev-flat);
}
/* Nested in a white surface: a grey fill (white on white would vanish). */
:is(.surface-card, .surface-overlay, .surface-popover) .surface-tile {
  background-color: var(--fill);
}
:is(.surface-card, .surface-overlay) .surface-card {
  background-color: var(--fill);
  border-radius: var(--radius-tile);
}
/* Charts sit on white, never on grey: a nested card that holds a canvas stays
 * white and takes an inset hairline instead of the fill. */
:is(.surface-card, .surface-overlay) .surface-card:has(canvas) {
  background-color: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.surface-popover {
  background-color: var(--surface);
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--elev-popover);
}
.surface-overlay {
  background-color: var(--surface);
  border: 0;
  border-radius: var(--radius-xl);
  box-shadow: var(--elev-overlay);
}
/* The dim layer behind an overlay. No blur: the page stays readable. */
.scrim { background-color: var(--scrim); }

/* ===========================================================================
 * Buttons. Capsules. ONE primary (ink) per view; everything else is a grey
 * capsule or plain text. The brand colour is never a button fill.
 * Feedback is quiet: ink dims to 92 percent on hover, a grey capsule goes one
 * step darker, and every button shrinks slightly while held.
 * =========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--dur-press) var(--ease-out), opacity var(--dur-fade) ease, background-color var(--dur-fade) ease;
}
.btn:active { transform: scale(var(--scale-press)); }
.btn-sm    { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg    { height: 56px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-primary         { background-color: var(--ink); color: #FFFFFF; }
.btn-primary:hover   { opacity: .92; }
.btn-secondary       { background-color: var(--fill-2); color: var(--ink); }
.btn-secondary:hover { background-color: var(--fill-3); }
.btn-ghost           { background-color: transparent; color: var(--ink); }
.btn-ghost:hover     { background-color: var(--fill-2); }
.btn-danger          { background-color: var(--neg-bg); color: var(--neg); }
.btn-danger:hover    { background-color: var(--neg-bg-2); }
.btn:disabled,
.btn[aria-disabled="true"] {
  background-color: var(--fill-2);
  color: var(--faint);
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

/* A round icon-only button: close, back, more. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background-color: var(--fill);
  color: var(--ink);
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fade) ease;
}
.icon-btn:hover  { background-color: var(--fill-2); }
.icon-btn:active { transform: scale(var(--scale-press)); }
/* On the grey canvas a grey disc would vanish, so it is white there. */
.icon-btn-on-canvas       { background-color: var(--surface); }
.icon-btn-on-canvas:hover { background-color: var(--fill-2); }

/* ===========================================================================
 * Inputs. A grey fill, not an outlined box. 16px text stops phones zooming on
 * focus. The focus ring comes from the global rule above.
 * =========================================================================== */
.field {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-md);
  background-color: var(--fill-2);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}
.field::placeholder { color: var(--placeholder); opacity: 1; }
textarea.field { height: auto; min-height: 96px; padding: 14px 16px; resize: vertical; }
.field-sm { height: 40px; padding: 0 12px; font-size: 14px; border-radius: var(--radius-row); }
.field-label {
  display: block;
  margin: 0 0 6px 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.field-help { margin: 6px 4px 0; font-size: 12px; color: var(--muted); }

/* ===========================================================================
 * Segmented control: a grey track with one white thumb. Use it for a two- or
 * three-way switch. The thumb is the only resting shadow in the system.
 * =========================================================================== */
.seg-track {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--radius-pill);
  background-color: var(--fill-2);
}
.seg-item {
  padding: 7px 16px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted-strong);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
}
.seg-item:hover { color: var(--ink); }
.seg-item[aria-selected="true"],
.seg-item[aria-pressed="true"],
.seg-item.is-active {
  background-color: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--elev-thumb);
}

/* ===========================================================================
 * Chips: a set of filters that wraps. Grey capsule; the selected one is ink
 * (never the brand colour).
 * =========================================================================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background-color: var(--fill-2);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fade) ease;
}
.chip:hover  { background-color: var(--fill-3); }
.chip:active { transform: scale(var(--scale-press)); }
.chip.is-active,
.chip.is-active:hover,
.chip[aria-pressed="true"],
.chip[aria-pressed="true"]:hover { background-color: var(--ink); color: #FFFFFF; }

/* ---- Badges: a short status word on a soft tint --------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background-color: var(--fill-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.badge-pos     { background-color: var(--pos-bg);     color: var(--pos); }
.badge-warn    { background-color: var(--warn-bg);    color: var(--warn); }
.badge-neg     { background-color: var(--neg-bg);     color: var(--neg); }
.badge-neutral { background-color: var(--fill-2);     color: var(--ink-2); }
.badge-brand   { background-color: var(--brand-wash); color: var(--brand); }
.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

/* A neutral capsule for a short statement ("About the same as last month"). */
.pill-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  background-color: var(--fill);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

/* ===========================================================================
 * Grouped list: rows share ONE grey block and are divided by a hairline,
 * instead of each row being its own card.
 * =========================================================================== */
.list-group {
  border-radius: var(--radius-lg);
  background-color: var(--fill);
  overflow: hidden;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  text-align: left;
  text-decoration: none;
}
.list-row + .list-row { box-shadow: inset 0 1px 0 var(--hairline); }
:is(a, button).list-row { cursor: pointer; }
:is(a, button).list-row:hover { background-color: var(--fill-2); }
.list-row-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--brand-wash);
  color: var(--brand);
}
.list-row-text  { flex: 1 1 auto; min-width: 0; }
.list-row-title { font-weight: 600; }
.list-row-sub   { font-size: 13px; color: var(--muted-strong); }
.list-row-end   { flex: none; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ===========================================================================
 * Stat tile: a label, one figure, one supporting line. Put the class on a
 * .surface-tile. Never abbreviate money in the figure.
 * =========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 12px;
}

/* Vertical stack of cards. The column is minmax(0, 1fr) on purpose: a plain
 * grid column grows to its widest child, so one wide table would widen the
 * whole page on a phone. */
.stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.kpi-tile  { padding: 16px 18px; min-width: 0; }
.kpi-label {
  font-size: var(--eyebrow-size);
  font-weight: var(--eyebrow-weight);
  letter-spacing: var(--eyebrow-track);
  text-transform: uppercase;
  color: var(--muted-strong);
}
.kpi-value {
  margin-top: 4px;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.kpi-sub { margin-top: 4px; font-size: 13px; color: var(--muted-strong); }

/* ===========================================================================
 * Table. Rows are divided by a hairline; there is no outer box. Style the
 * cell, not the row (a row background loses to a cell background).
 * =========================================================================== */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th {
  padding: 10px 14px;
  text-align: left;
  font-size: var(--eyebrow-size);
  font-weight: 600;
  letter-spacing: var(--eyebrow-track);
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  box-shadow: inset 0 1px 0 var(--hairline);
}
.table tbody tr:hover td { background-color: var(--fill); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ===========================================================================
 * App shell: a canvas-grey top bar, a white sidebar, the page on the canvas.
 *
 *   <div class="app-shell">
 *     <header class="app-topbar"> ... </header>
 *     <aside class="app-sidebar"> ... </aside>
 *     <main class="app-main"> ... </main>
 *   </div>
 *
 * Under 1024px the sidebar becomes a drawer: add .is-nav-open to .app-shell to
 * show it, and place a .app-drawer-scrim inside the shell to close it.
 * =========================================================================== */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-rows: 60px minmax(0, 1fr);
  grid-template-areas: "top top" "side main";
}
.app-topbar {
  grid-area: top;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  background-color: var(--canvas);
  box-shadow: inset 0 -1px 0 var(--hairline-soft);
}
.app-topbar-start { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; }
.app-brand       { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--ink); text-decoration: none; }
.app-brand-mark  { flex: none; width: 30px; height: 30px; }
.app-brand-text  { display: grid; min-width: 0; }
.app-brand-name  { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.app-brand-sub   { font-size: 11px; color: var(--muted); line-height: 1.2; }
/* A long product name shortens with an ellipsis instead of pushing the bar wide. */
.app-brand-name,
.app-brand-sub   { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.app-topbar-end  { display: flex; align-items: center; gap: 8px; flex: none; }
.app-nav-toggle  { display: none; }

.app-sidebar {
  grid-area: side;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 12px 8px 20px;
  background-color: var(--surface);
  box-shadow: inset -1px 0 0 var(--hairline-soft);
}
.app-main {
  grid-area: main;
  min-width: 0;
  padding: 28px 24px 48px;
}
.app-content { max-width: 1180px; margin: 0 auto; }
.app-drawer-scrim { display: none; }

.page-header   { margin-bottom: 20px; }
.page-header p { margin-top: 6px; color: var(--muted-strong); max-width: 64ch; }

/* ---- Navigation -------------------------------------------------------------
 * The current item is a grey fill with ink text; its icon is the one
 * brand-coloured mark in the sidebar. */
.nav-group-title {
  padding: 16px 12px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--muted-strong);
  font-size: 14px;
  text-decoration: none;
  transition: background-color var(--dur-fade) ease, color var(--dur-fade) ease;
}
.nav-item:hover { background-color: var(--fill); color: var(--ink); }
.nav-item.is-active,
.nav-item[aria-current="page"] {
  background-color: var(--fill);
  color: var(--ink);
  font-weight: 600;
}
.nav-icon { flex: none; width: 18px; height: 18px; }
.nav-item.is-active .nav-icon,
.nav-item[aria-current="page"] .nav-icon { color: var(--brand); }

@media (max-width: 1023.98px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "main";
  }
  .app-nav-toggle { display: inline-flex; }
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: min(288px, 86vw);
    height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--dur-modal) var(--ease-out);
    box-shadow: none;
  }
  .app-shell.is-nav-open .app-sidebar { transform: none; box-shadow: var(--elev-overlay); }
  .app-shell.is-nav-open .app-drawer-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    border: 0;
    background-color: var(--scrim);
  }
  .app-main { padding: 20px 16px 40px; }
}
@media (max-width: 639.98px) {
  .app-topbar    { padding: 0 12px; }
  .app-brand-sub { display: none; }
}

/* ===========================================================================
 * Menu: a popover list. It floats, so it has a shadow. Position it yourself
 * (place it in a relatively positioned wrapper, or use .menu-anchor).
 * =========================================================================== */
.menu-anchor { position: relative; display: inline-block; }
.menu {
  min-width: 200px;
  padding: 4px;
  background-color: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-popover), 0 0 0 1px var(--hairline-soft);
}
.menu-anchor > .menu { position: absolute; top: 100%; right: 0; margin-top: 6px; z-index: 60; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-row);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu-item:hover { background-color: var(--fill); }
.menu-item:focus-visible { outline-offset: -2px; }
.menu-item.is-active,
.menu-item[aria-current="true"],
.menu-item[aria-checked="true"] { background-color: var(--fill); color: var(--ink); font-weight: 600; }
.menu-item-danger { color: var(--neg); }
.menu-sep { height: 1px; margin: 4px 8px; background-color: var(--hairline); }

/* ===========================================================================
 * Modal: a .surface-overlay centred on a .scrim.
 *
 *   <div class="modal-layer scrim" hidden>
 *     <div class="modal surface-overlay" role="dialog" aria-modal="true"> ... </div>
 *   </div>
 * =========================================================================== */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal {
  width: min(100%, 480px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
}
.modal-sm { width: min(100%, 380px); }
.modal-lg { width: min(100%, 720px); }
.modal-header  { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 24px; }

/* ===========================================================================
 * Scope switcher: "the whole group" or "one item of it".
 * scope-switch.js renders this markup; the classes also work hand-written.
 *
 *   <div class="scope">
 *     <div class="scope-switch" role="group" aria-label="View">
 *       <button class="scope-switch-item" aria-pressed="true">Corporate</button>
 *       <button class="scope-switch-item" aria-pressed="false">Property</button>
 *     </div>
 *     <button class="scope-picker" aria-haspopup="true" aria-expanded="false"> ... </button>
 *     <div class="scope-picker-menu" role="menu" hidden> ... </div>
 *   </div>
 *
 * The switch is the segmented control at full width; the active side carries a
 * small brand-coloured dot. The picker is a full-width grey button; its list is
 * a white popover.
 * =========================================================================== */
.scope { position: relative; display: grid; gap: 8px; }

.scope-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background-color: var(--fill-2);
}
.scope-switch-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted-strong);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
}
.scope-switch-item:hover { color: var(--ink); }
.scope-switch-item[aria-pressed="true"] {
  background-color: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--elev-thumb);
}
.scope-switch-item[aria-pressed="true"]::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--brand);
}

.scope-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-md);
  background-color: var(--fill);
  color: var(--muted-strong);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fade) ease;
}
.scope-picker:hover { background-color: var(--fill-2); }
.scope-picker.has-value { color: var(--ink); font-weight: 500; }
.scope-picker-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.scope-picker-icon  { flex: none; width: 16px; height: 16px; }
.scope-picker-name  { min-width: 0; overflow-wrap: anywhere; }
.scope-picker-chevron {
  flex: none;
  width: 12px;
  height: 12px;
  transition: transform var(--dur-fade) ease;
}
.scope-picker[aria-expanded="true"] .scope-picker-chevron { transform: rotate(180deg); }

.scope-picker-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  max-height: 288px;
  margin-top: 4px;
  padding: 4px;
  overflow-y: auto;
  background-color: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-popover), 0 0 0 1px var(--hairline-soft);
}
.scope-picker-option {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 0;
  border-radius: var(--radius-row);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.scope-picker-option:hover { background-color: var(--fill); }
/* The list scrolls, so the ring is drawn inside the row where it cannot be clipped. */
.scope-picker-option:focus-visible { outline-offset: -2px; }
.scope-picker-option[aria-checked="true"],
.scope-picker-option[aria-current="true"] {
  background-color: var(--fill);
  color: var(--ink);
  font-weight: 600;
}
.scope-picker-empty { padding: 12px; font-size: 13px; color: var(--muted); }

/* ===========================================================================
 * Motion. An overlay fades in with a small rise; the scrim only fades. Under
 * reduced motion the rise is dropped and only the fade remains.
 * =========================================================================== */
@keyframes ui-rise {
  from { opacity: 0; transform: translateY(8px) scale(var(--scale-entry)); }
  to   { opacity: 1; transform: none; }
}
@keyframes ui-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.surface-overlay   { animation: ui-rise var(--dur-modal) var(--ease-out) both; }
.scrim             { animation: ui-fade var(--dur-modal) ease both; }
.menu,
.scope-picker-menu { animation: ui-fade var(--dur-fade) ease both; }
@media (prefers-reduced-motion: reduce) {
  .surface-overlay { animation-name: ui-fade; }
}
