/* ==========================================================================
   Components — docs/07. Class naming: .c-<component>__<part>--<modifier>
   ========================================================================== */

/* ---- Button (docs/07 §1) ------------------------------------------------ */

.c-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  height: 36px;
  padding: 0 var(--sp-16);
  border-radius: var(--r-sm);
  font-size: var(--t-label-size);
  font-weight: var(--t-label-weight);
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-instant) var(--ease-out);
  border: 1px solid transparent;
}
.c-btn:active { transform: scale(.97); }
.c-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.c-btn--sm { height: 30px; padding: 0 var(--sp-12); font-size: 12px; }
.c-btn--lg { height: 44px; padding: 0 var(--sp-20); font-size: var(--t-body-size); }

.c-btn--primary {
  background: var(--ink-900);
  color: #fff;
}
.c-btn--primary:hover:not(:disabled) { background: var(--ink-900-hover); transform: translateY(-1px); }

.c-btn--secondary {
  background: var(--surface);
  border-color: var(--ink-200);
  color: var(--ink-900);
}
.c-btn--secondary:hover:not(:disabled) { background: var(--ink-50); transform: translateY(-1px); }

.c-btn--ghost {
  background: transparent;
  color: var(--ink-700);
}
.c-btn--ghost:hover:not(:disabled) { background: var(--ink-50); }

.c-btn--danger {
  background: var(--red-050);
  color: var(--red-600);
}
.c-btn--danger:hover:not(:disabled) { background: var(--red-600); color: #fff; }

.c-btn--link {
  background: transparent;
  color: var(--accent-600);
  height: auto;
  padding: 0;
}
.c-btn--link:hover:not(:disabled) { text-decoration: underline; }

.c-btn__icon { width: 16px; height: 16px; flex-shrink: 0; }

.c-btn[aria-busy="true"] { color: transparent; position: relative; }
.c-btn__dots {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.c-btn__dots span {
  width: 4px; height: 4px; border-radius: 50%;
  background: currentColor;
  opacity: .4;
  animation: pulse-dot 1000ms var(--ease-inout) infinite;
}
.c-btn--primary .c-btn__dots span { background: #fff; }
.c-btn__dots span:nth-child(2) { animation-delay: 120ms; }
.c-btn__dots span:nth-child(3) { animation-delay: 240ms; }

/* ---- Icon button (docs/07 §2) -------------------------------------------- */

.c-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  color: var(--ink-500);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.c-icon-btn:hover { background: var(--ink-50); color: var(--ink-900); }
.c-icon-btn:active { transform: scale(.94); }
.c-icon-btn--lg { width: 44px; height: 44px; }
.c-icon-btn svg { width: 18px; height: 18px; }

/* ---- Input (docs/07 §3) -------------------------------------------------- */

.c-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.c-field__label {
  font-size: var(--t-label-size);
  font-weight: var(--t-label-weight);
  color: var(--ink-700);
}

.c-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.c-input {
  width: 100%;
  height: 36px;
  padding: 0 var(--sp-12);
  border-radius: var(--r-sm);
  border: 1px solid var(--ink-200);
  background: var(--surface);
  font-size: var(--t-body-size);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.c-input::placeholder { color: var(--ink-400); }
.c-input:hover { border-color: var(--ink-300); }
.c-input:focus-visible { border-color: var(--accent-600); outline: 2px solid var(--accent-600); outline-offset: 1px; }
.c-input:disabled { background: var(--canvas-sunken); color: var(--ink-400); }

.c-input--lg { height: 44px; font-size: var(--t-body-lg-size); }
.c-input--money { text-align: right; padding-left: var(--sp-24); }

.c-input-wrap__prefix {
  position: absolute;
  left: var(--sp-12);
  color: var(--ink-400);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.c-field__hint { font-size: var(--t-meta-size); color: var(--ink-400); }
.c-field--error .c-input { border-color: var(--red-600); }
.c-field__error { font-size: var(--t-meta-size); color: var(--red-600); }

/* ---- Select / dropdown (docs/07 §4) -------------------------------------- */

.c-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
  height: 36px;
  padding: 0 var(--sp-12);
  border-radius: var(--r-sm);
  border: 1px solid var(--ink-200);
  background: var(--surface);
  font-size: var(--t-body-size);
  min-width: 140px;
}
.c-select-trigger:hover { border-color: var(--ink-300); }
.c-select-trigger svg { width: 14px; height: 14px; color: var(--ink-400); }

/* ---- Autocomplete (docs/07 §5) ------------------------------------------- */

.c-autocomplete { position: relative; }

.c-autocomplete__provenance {
  font-size: var(--t-micro-size);
  color: var(--ink-400);
  margin-top: var(--sp-4);
}

/* ---- Chip (docs/07 §6) --------------------------------------------------- */

.c-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-6);
  height: 28px;
  padding: 0 var(--sp-12);
  border-radius: var(--r-full);
  font-size: var(--t-micro-size);
  font-weight: var(--t-micro-weight);
  letter-spacing: var(--t-micro-track);
  background: var(--ink-50);
  color: var(--ink-700);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.c-chip:hover { background: var(--ink-100); }
.c-chip.is-selected { background: var(--ink-900); color: #fff; }
.c-chip__count { opacity: .65; font-weight: 400; }
.c-chip__remove { margin-left: var(--sp-4); opacity: .6; }
.c-chip__remove:hover { opacity: 1; }

/* ---- Card (docs/07 §7) ---------------------------------------------------- */

.c-card {
  background: var(--surface);
  border: var(--border-hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-20);
}
.c-card--lg-pad { padding: var(--sp-24); }
.c-card--clickable {
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.c-card--clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.c-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-16);
}
.c-card__title { font-size: var(--t-h2-size); font-weight: var(--t-h2-weight); letter-spacing: var(--t-h2-track); }
.c-card__footer {
  margin-top: var(--sp-16);
  padding-top: var(--sp-16);
  border-top: var(--border-hairline);
}

/* ---- Stat tile (docs/07 §8) ------------------------------------------------ */

.c-stat-tile {
  height: 180px;
  padding: var(--sp-16);
  background: var(--surface);
  border: var(--border-hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.c-stat-tile[role="button"] { cursor: pointer; }
.c-stat-tile[role="button"]:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.c-stat-tile__value {
  font-size: var(--t-money-lg-size);
  line-height: var(--t-money-lg-line);
  font-weight: var(--t-money-lg-weight);
  letter-spacing: var(--t-money-lg-track);
  font-variant-numeric: proportional-nums;
}

.c-stat-tile__delta {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  font-size: var(--t-meta-size);
}
.c-stat-tile__delta-glyph { width: 10px; height: 10px; }
.c-stat-tile__delta.is-good { color: var(--delta-up); }
.c-stat-tile__delta.is-bad { color: var(--delta-down); }
.c-stat-tile__spark { width: 40px; height: 16px; color: var(--ink-300); }

/* ---- Intelligence card (docs/07 §10) --------------------------------------- */

.c-insight-card {
  background: var(--violet-050);
  border-radius: var(--r-lg);
  padding: var(--sp-20);
}
.c-insight-card__heading {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  color: var(--violet-600);
  font-size: var(--t-h3-size);
  font-weight: var(--t-h3-weight);
  margin-bottom: var(--sp-12);
}
.c-insight-card__list { display: flex; flex-direction: column; gap: var(--sp-12); }
.c-insight-card__line { font-size: var(--t-body-size); color: var(--ink-900); }

/* ---- Chat bubble (docs/07 §11) --------------------------------------------- */

.c-bubble-row { display: flex; margin-bottom: var(--sp-12); }
.c-bubble-row--sale { justify-content: flex-start; }
.c-bubble-row--payment { justify-content: flex-end; }

.c-bubble {
  position: relative;
  border-radius: var(--r-lg);
  padding: var(--sp-12) var(--sp-16);
  font-size: var(--t-body-size);
}
.c-bubble--sale {
  max-width: 440px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  border-bottom-left-radius: 4px;
}
.c-bubble--payment {
  max-width: 380px;
  background: var(--green-050);
  border-left: 2px solid var(--green-600);
  border-bottom-right-radius: 4px;
}
.c-bubble.is-selected { box-shadow: 0 0 0 2px var(--accent-100); }
.c-bubble.is-voided { opacity: .45; }
.c-bubble.is-voided .c-bubble__total { text-decoration: line-through; }

.c-bubble__kind { font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.c-bubble__clock {
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
  color: var(--ink-300);
}
.c-bubble:hover .c-bubble__clock { opacity: 1; }
.c-bubble__clock:hover { color: var(--ink-700); }

.c-bubble__line { display: flex; justify-content: space-between; gap: var(--sp-16); }
.c-bubble__mercy { font-size: var(--t-micro-size); color: var(--ink-400); text-transform: lowercase; }
.c-bubble__balance { display: flex; justify-content: space-between; font-weight: 600; padding-top: var(--sp-8); margin-top: var(--sp-8); border-top: var(--border-hairline); }
.c-bubble__footer { font-size: var(--t-meta-size); color: var(--ink-400); margin-top: var(--sp-6); }
.c-bubble__voided-note { font-size: var(--t-meta-size); color: var(--ink-400); margin-top: var(--sp-4); }

.c-bubble__pulse {
  display: none;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-400);
  margin-left: var(--sp-6);
}

.c-date-sep {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  margin: var(--sp-20) 0;
  color: var(--ink-500);
}
.c-date-sep::before, .c-date-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ink-100);
}
.c-date-sep__pill {
  background: var(--ink-50);
  padding: var(--sp-6) var(--sp-12);
  border-radius: var(--r-full);
  font-size: var(--t-meta-size);
  white-space: nowrap;
}

/* ---- Modal / side sheet / popover (docs/07 §12-14) ------------------------- */

.c-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27,26,23,.28);
  z-index: var(--z-overlay);
}
.c-overlay--blur { backdrop-filter: blur(2px); }

.c-modal {
  position: fixed;
  z-index: var(--z-modal);
  top: 18vh;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  max-height: 72vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-24);
}
.c-modal--md { width: 640px; }
.c-modal--lg { width: 800px; }

.c-sheet {
  position: fixed;
  z-index: var(--z-modal);
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-24);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-20);
}

.c-popover {
  position: absolute;
  z-index: var(--z-popover);
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-8);
  min-width: 200px;
}

/* ---- Toast (docs/07 §15) --------------------------------------------------- */

.c-toast-host {
  position: fixed;
  right: var(--sp-24);
  bottom: calc(var(--dock-clearance) + var(--sp-16));
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--sp-8);
  width: 320px;
}

.c-toast {
  position: relative;
  background: var(--ink-900);
  color: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-12) var(--sp-16);
  overflow: hidden;
}
.c-toast--error { background: var(--red-600); }
.c-toast__body { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); }
.c-toast__msg { font-size: var(--t-body-size); }
.c-toast__undo { color: #fff; font-weight: 600; font-size: var(--t-label-size); flex-shrink: 0; }
.c-toast__undo:hover { text-decoration: underline; }
.c-toast__bar {
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  background: rgba(255,255,255,.4);
  animation: toast-drain 6000ms linear forwards;
}
@keyframes toast-drain { from { width: 100%; } to { width: 0%; } }

/* ---- Empty / error state (docs/07 §18-19) ----------------------------------- */

.c-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-16);
  max-width: 320px;
  margin: var(--sp-64) auto;
}
.c-state__glyph { width: 40px; height: 40px; color: var(--ink-300); }
.c-state--error .c-state__glyph { color: var(--amber-600); }
.c-state__text { font-size: var(--t-body-lg-size); color: var(--ink-700); }

/* ---- Table (docs/07 §20) ---------------------------------------------------- */

.c-table thead th {
  background: var(--canvas-sunken);
  text-align: left;
  font-size: var(--t-eyebrow-size);
  font-weight: var(--t-eyebrow-weight);
  letter-spacing: var(--t-eyebrow-track);
  text-transform: uppercase;
  color: var(--ink-500);
  padding: var(--sp-12) var(--sp-16);
  position: sticky;
  top: 0;
}
.c-table td {
  padding: var(--sp-12) var(--sp-16);
  height: var(--table-row-h);
  border-top: var(--border-hairline);
  font-size: var(--t-body-size);
}
.c-table tbody tr { transition: background var(--dur-fast) var(--ease-out); }
.c-table tbody tr:hover { background: var(--surface-hover); }
.c-table .u-num { text-align: right; font-variant-numeric: tabular-nums; }
.c-table--compact td { height: var(--table-row-h-compact); }
.c-table th.is-sortable { cursor: pointer; }
.c-table th.is-sortable svg { width: 10px; height: 10px; margin-left: var(--sp-4); }

/* ---- List row (docs/07 §21) ------------------------------------------------- */

.c-list-row {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  height: var(--row-h);
  padding: 0 var(--sp-16);
  border-radius: var(--r-md);
  transition: background var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.c-list-row + .c-list-row { border-top: var(--border-hairline); }
.c-list-row:hover {
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.c-list-row__body { flex: 1; min-width: 0; }
.c-list-row__primary { font-size: var(--t-h3-size); font-weight: var(--t-h3-weight); }
.c-list-row__secondary { font-size: var(--t-meta-size); color: var(--ink-500); }
.c-list-row__value { font-variant-numeric: tabular-nums; font-weight: 500; }
.c-list-row--compact { height: var(--row-h-compact); }
.c-list-row__actions {
  display: flex;
  gap: var(--sp-4);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.c-list-row:hover .c-list-row__actions { opacity: 1; }

/* ---- Avatar (docs/07 §22) ---------------------------------------------------- */

.c-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}
.c-avatar--28 { width: 28px; height: 28px; font-size: 11px; }
.c-avatar--36 { width: 36px; height: 36px; font-size: 13px; }
.c-avatar--64 { width: 64px; height: 64px; font-size: 22px; }
.c-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Segmented control (docs/07 §23) ------------------------------------------ */

.c-segmented {
  position: relative;
  display: inline-flex;
  background: var(--ink-50);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}
.c-segmented__item {
  position: relative;
  z-index: 1;
  padding: var(--sp-6) var(--sp-16);
  border-radius: var(--r-sm);
  font-size: var(--t-label-size);
  font-weight: 500;
  color: var(--ink-500);
  transition: color var(--dur-base) var(--ease-out);
}
.c-segmented__item.is-active {
  color: var(--ink-900);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

/* ---- Tabs (docs/07 §24) -------------------------------------------------------- */

.c-tabs { display: flex; gap: var(--sp-24); border-bottom: var(--border-hairline); }
.c-tabs__item {
  position: relative;
  padding: var(--sp-12) 0;
  font-size: var(--t-label-size);
  font-weight: 500;
  color: var(--ink-500);
}
.c-tabs__item.is-active { color: var(--ink-900); }
.c-tabs__item.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--ink-900);
}

/* ---- Toggle (docs/07 §32) ------------------------------------------------------ */

.c-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: var(--r-full);
  background: var(--ink-200);
  transition: background var(--dur-base) var(--ease-out);
  flex-shrink: 0;
}
.c-toggle.is-on { background: var(--ink-900); }
.c-toggle__knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.c-toggle.is-on .c-toggle__knob { transform: translateX(16px); }

/* ---- Tooltip (docs/07 §33) ------------------------------------------------------ */

.c-tooltip {
  position: absolute;
  background: var(--ink-900);
  color: #fff;
  font-size: var(--t-micro-size);
  padding: var(--sp-6) var(--sp-8);
  border-radius: var(--r-xs);
  z-index: var(--z-popover);
  pointer-events: none;
  white-space: nowrap;
}

/* ---- Health pill (docs/07 §34) --------------------------------------------------- */

.c-health-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  font-size: var(--t-label-size);
  font-weight: 500;
}
.c-health-pill__dot { width: 8px; height: 8px; border-radius: 50%; }
.c-health-pill--good .c-health-pill__dot { background: var(--green-600); }
.c-health-pill--warn .c-health-pill__dot { background: var(--amber-600); }
.c-health-pill--bad  .c-health-pill__dot { background: var(--red-600); }

/* ---- Progress bar ---------------------------------------------------------------- */

.c-progress {
  height: 4px;
  border-radius: var(--r-full);
  background: var(--ink-100);
  overflow: hidden;
}
.c-progress__fill {
  height: 100%;
  background: var(--ink-900);
  border-radius: var(--r-full);
  transition: width var(--dur-base) var(--ease-out);
}

/* ---- Badge / provenance --------------------------------------------------------- */

.c-mercy { font-size: var(--t-micro-size); color: var(--ink-400); text-transform: lowercase; }

/* ==========================================================================
   Shell — floating dock, command palette, user chip
   docs/02 §3, §5
   ========================================================================== */

.c-dock {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: var(--z-dock);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  height: 60px;
  padding: 0 10px;
  border-radius: var(--r-xl);
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: var(--shadow-dock);
  transition: opacity var(--dur-base) var(--ease-out);
}
@supports not (backdrop-filter: blur(1px)) {
  .c-dock { background: #fff; box-shadow: var(--shadow-lg); }
}
.c-dock.is-faded { opacity: .35; }

.c-dock__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  color: var(--ink-500);
  transition: transform var(--dur-fast) var(--ease-spring),
              background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.c-dock__item svg { width: 20px; height: 20px; }
.c-dock__item:hover { color: var(--ink-900); background: var(--ink-50); transform: translateY(-2px) scale(1.06); }
.c-dock__item:active { transform: scale(.96); }
.c-dock__item.is-active { color: var(--ink-900); background: var(--surface); box-shadow: var(--shadow-xs); }
.c-dock__item.is-active::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent-600);
}

.c-dock__label {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-4) var(--sp-8);
  border-radius: var(--r-xs);
  font-size: var(--t-micro-size);
  color: var(--ink-700);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.c-dock__item:hover .c-dock__label { opacity: 1; }

.c-dock__divider {
  width: 1px;
  align-self: stretch;
  margin: var(--sp-12) var(--sp-4);
  background: var(--ink-100);
}

.c-dock__search {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-6);
  height: 44px;
  padding: 0 var(--sp-12);
  border-radius: var(--r-md);
  color: var(--ink-500);
  font-size: var(--t-micro-size);
}
.c-dock__search:hover { background: var(--ink-50); color: var(--ink-900); }
.c-dock__search kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--ink-100);
  padding: 2px 5px;
  border-radius: 4px;
}

.c-dock__user {
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--ink-200);
}
.c-dock__user img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Command palette ---------------------------------------------------------- */

.c-palette {
  position: fixed;
  z-index: var(--z-modal);
  top: 18vh;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.c-palette__input-row {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  padding: var(--sp-16) var(--sp-20);
  border-bottom: var(--border-hairline);
}
.c-palette__input-row svg { width: 18px; height: 18px; color: var(--ink-400); flex-shrink: 0; }
.c-palette__input {
  flex: 1;
  font-size: var(--t-body-lg-size);
  background: transparent;
}
.c-palette__input::placeholder { color: var(--ink-400); }

.c-palette__results {
  overflow-y: auto;
  padding: var(--sp-8);
}

.c-palette__group-label {
  padding: var(--sp-8) var(--sp-12) var(--sp-4);
  font-size: var(--t-eyebrow-size);
  font-weight: var(--t-eyebrow-weight);
  letter-spacing: var(--t-eyebrow-track);
  text-transform: uppercase;
  color: var(--ink-400);
}

.c-palette__row {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  height: 44px;
  padding: 0 var(--sp-12);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.c-palette__row.is-selected { background: var(--ink-50); }
.c-palette__row svg { width: 16px; height: 16px; color: var(--ink-500); flex-shrink: 0; }
.c-palette__row-label { flex: 1; font-size: var(--t-body-size); }
.c-palette__row-label mark { background: none; color: var(--ink-900); font-weight: 600; }
.c-palette__row-meta { font-size: var(--t-meta-size); color: var(--ink-400); font-variant-numeric: tabular-nums; }

.c-palette__empty {
  padding: var(--sp-32);
  text-align: center;
  color: var(--ink-500);
  font-size: var(--t-body-size);
}
