/* ============================================================================
   public/css/components.css — Shared UI primitives
   Buttons, inputs, cards, tables, badges, status indicators
   ============================================================================ */

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: var(--type-body-md);
  font-weight: var(--weight-medium);
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--action-primary);
  color: var(--text-on-action);
}
.btn-primary:hover:not(:disabled) {
  background: var(--action-primary-hover);
  box-shadow: var(--shadow-md);
}
.btn-primary:active:not(:disabled) { background: var(--action-primary-press); }

.btn-secondary {
  background: var(--surface-raised);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-sunken);
  color: var(--text-primary);
}

.btn-sm { padding: 6px 12px; font-size: var(--type-body-sm); }
.btn-lg { padding: 14px 24px; font-size: var(--type-body-lg); }

/* ============================================================================
   INPUTS
   ============================================================================ */
.input,
.input-text,
input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
input[type='number'] {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: var(--type-body-md);
  font-weight: var(--weight-regular);
  color: var(--text-primary);
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-input);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}
.input:hover { border-color: var(--border-strong); }
.input:focus,
input:focus {
  border-color: var(--action-primary);
  box-shadow: 0 0 0 3px rgba(42, 75, 60, 0.12);
}

.label {
  display: block;
  font-size: var(--type-body-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.field {
  margin-bottom: var(--space-5);
}

/* ============================================================================
   CARDS
   ============================================================================ */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
  transition: box-shadow var(--duration-base) var(--ease-out);
}
.card-quiet {
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
}
.card-flush {
  /* Card with no padding — used for tables */
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-4);
}
.card-title {
  font-family: var(--font-display);
  font-size: var(--type-display-sm);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-display);
  color: var(--text-primary);
  font-variation-settings: 'opsz' 24;
}
.card-subtitle {
  font-size: var(--type-body-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}
.card-action {
  font-size: var(--type-body-sm);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

/* ============================================================================
   METRIC TILE — the basic unit for Command Center numbers
   ============================================================================ */
.metric-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-6);
}
.metric-tile .eyebrow {
  margin-bottom: var(--space-1);
}
.metric-tile .metric-value {
  font-family: var(--font-body);
  font-size: var(--type-metric-lg);
  font-weight: var(--weight-medium);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text-primary);
  font-feature-settings: 'tnum', 'lnum', 'ss01';
}
.metric-tile .metric-unit {
  font-size: var(--type-body-md);
  font-weight: var(--weight-regular);
  color: var(--text-tertiary);
  margin-left: 4px;
  letter-spacing: 0;
}
.metric-tile .metric-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--type-body-sm);
  font-weight: var(--weight-medium);
  font-feature-settings: 'tnum';
}
.metric-tile .metric-delta-positive { color: var(--status-positive); }
.metric-tile .metric-delta-negative { color: var(--status-critical); }
.metric-tile .metric-context {
  font-size: var(--type-body-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

/* ============================================================================
   TABLES — sharp corners, tight rows, tabular numerals
   ============================================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--type-body-sm);
  font-feature-settings: 'tnum', 'lnum';
}
/* Header bar adopted from the FBA app: blush caps on deep emerald. On a dense
   table this anchors the header and stops it dissolving into the first row the
   way a cream-on-cream header did. Mono per the data-font rule. */
.data-table th {
  text-align: left;
  font-family: var(--ed-mono);
  font-weight: var(--weight-semibold);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ed-blush);
  background: var(--ed-emerald-deep);
  padding: var(--space-2) var(--space-3);   /* was --space-3 --space-5 */
  border-bottom: none;                       /* the fill is the separator now */
  white-space: nowrap;
}
.data-table th:first-child { border-top-left-radius: var(--radius-card); }
.data-table th:last-child  { border-top-right-radius: var(--radius-card); }

.data-table td {
  padding: var(--space-2) var(--space-3);   /* was --space-4 --space-5 */
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-base); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .col-tight { width: 1%; white-space: nowrap; }

/* ============================================================================
   STATUS BADGES — soft tints, no neon
   ============================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 8px;
  font-size: var(--type-body-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.badge-positive {
  color: var(--status-positive);
  background: var(--status-positive-bg);
}
.badge-warning {
  color: var(--status-warning);
  background: var(--status-warning-bg);
}
.badge-critical {
  color: var(--status-critical);
  background: var(--status-critical-bg);
}
.badge-info {
  color: var(--status-info);
  background: var(--status-info-bg);
}
.badge-neutral {
  color: var(--text-secondary);
  background: var(--surface-sunken);
}

/* Status dot — for inline status indicators */
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 2px;
}
.dot-positive { background: var(--status-positive); }
.dot-warning  { background: var(--status-warning); }
.dot-critical { background: var(--status-critical); }
.dot-info     { background: var(--status-info); }
.dot-neutral  { background: var(--text-tertiary); }

/* ============================================================================
   DIVIDERS
   ============================================================================ */
.divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-6) 0;
}
.divider-vertical {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
  vertical-align: middle;
  margin: 0 var(--space-3);
}

/* ============================================================================
   LAYOUT UTILITIES
   ============================================================================ */
.row { display: flex; align-items: center; gap: var(--space-4); }
.col { display: flex; flex-direction: column; gap: var(--space-4); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.stack-1 > * + * { margin-top: var(--space-1); }
.stack-2 > * + * { margin-top: var(--space-2); }
.stack-3 > * + * { margin-top: var(--space-3); }
.stack-4 > * + * { margin-top: var(--space-4); }
.stack-6 > * + * { margin-top: var(--space-6); }
.grow { flex: 1; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.muted { color: var(--text-secondary); }
.muted-2 { color: var(--text-tertiary); }

/* ============================================================================
   SKELETON LOADING — subtle shimmer, no spinners
   ============================================================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-sunken) 0%,
    var(--border-subtle) 50%,
    var(--surface-sunken) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s var(--ease-in-out) infinite;
  border-radius: var(--radius-input);
  color: transparent;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================================
   ENTRANCE ANIMATIONS — staggered page loads
   ============================================================================ */
.fade-in {
  opacity: 0;
  animation: fadeIn var(--duration-slow) var(--ease-out) forwards;
}
.rise-in {
  opacity: 0;
  transform: translateY(8px);
  animation: riseIn var(--duration-slower) var(--ease-out) forwards;
}
.stagger > * { opacity: 0; transform: translateY(6px); animation: riseIn var(--duration-slow) var(--ease-out) forwards; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }
.stagger > *:nth-child(7) { animation-delay: 360ms; }
.stagger > *:nth-child(8) { animation-delay: 420ms; }
.stagger > *:nth-child(9) { animation-delay: 480ms; }
.stagger > *:nth-child(10) { animation-delay: 540ms; }

@keyframes fadeIn {
  to { opacity: 1; }
}
@keyframes riseIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   Shared component primitives — added Tier 1 design audit batch
   ============================================================================ */

/* Glossary help icon — hover/focus expands subtle background tint */
.glossary-help-icon {
  transition: background 160ms cubic-bezier(0.32, 0.72, 0, 1),
              color 160ms cubic-bezier(0.32, 0.72, 0, 1);
}
.glossary-help-icon:hover,
.glossary-help-icon:focus-visible {
  background: rgba(26, 26, 26, 0.16) !important;
  color: var(--ed-ink) !important;
  outline: none;
}

/* Loading skeleton shimmer — used by loadingSkeleton() in components/feedback.js */
@keyframes skel-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.loading-skel-block {
  will-change: background-position;
}
@media (prefers-reduced-motion: reduce) {
  .loading-skel-block { animation: none; opacity: 0.4; }
}

/* Status pill (Tier 2 #7) — single class with tone variants. Replaces ad-hoc
   inline-styled pills scattered across the new pages. Use:
     <span class="ed-status-pill ed-status-pill-positive">In stock</span>
*/
.ed-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--ed-mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.ed-status-pill-positive { background: var(--ed-emerald-tint, rgba(42, 75, 60, 0.10));   color: var(--ed-emerald); }
.ed-status-pill-warning  { background: var(--ed-oak-tint,     rgba(184, 134, 11, 0.14)); color: var(--ed-oak-deep, #5b4a32); }
.ed-status-pill-critical { background: var(--ed-crimson-tint, rgba(180, 60, 60, 0.12));  color: var(--ed-crimson); }
.ed-status-pill-neutral  { background: rgba(26, 26, 26, 0.06); color: var(--ed-ink-soft); }
.ed-status-pill-info     { background: rgba(70, 110, 130, 0.10); color: #4A6B7A; }

/* ============================================================================
   Mobile responsive — Replenishment, Campaign Builder, Customers, SKU sibling
   ============================================================================ */
@media (max-width: 768px) {
  /* Page header: tighter title + subtitle on mobile */
  .page-title { font-size: 32px !important; line-height: 1.1; }
  .page-subtitle { font-size: 13px; }

  /* Generic ed-bezel content padding tightens on mobile */
  .ed-bezel-inner { padding: 16px !important; }

  /* Tables in new pages — allow horizontal scroll instead of squashing */
  .ed-bezel-inner > div[style*="overflow-x"] { -webkit-overflow-scrolling: touch; }
  table {
    min-width: 720px; /* keep column widths legible; user scrolls horizontally */
  }

  /* Campaign Builder + Replenishment summary tile grids stack to 2 cols */
  .ed-bezel + .ed-bezel,
  div[style*="grid-template-columns: repeat(auto-fit, minmax(200px"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* SKU modal sibling row: collapse the chevron column on narrow screens */
  .sku-sibling-toggle > div[style*="grid-template-columns"] {
    grid-template-columns: 16px 1fr 80px 90px !important;
    font-size: 12px;
  }
  /* Hide the cover + status columns on mobile sibling table — they reveal
     in the expanded location panel anyway */
  .sku-sibling-toggle > div > div:nth-child(5),
  .sku-sibling-toggle > div > div:nth-child(6) {
    display: none;
  }

  /* Customers cohort grid doesn't fit horizontally on mobile — make it
     scroll instead of overflow */
  .customers-cohort-grid { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Brand filter rows wrap cleanly */
  .filter-bar, .filter-chips { flex-wrap: wrap !important; }

  /* Sales by Store chart — make it taller on mobile so columns are readable */
  .sbs-chart { min-height: 200px; }
}

@media (max-width: 480px) {
  /* On very small screens, stack summary tiles to single column */
  div[style*="grid-template-columns: repeat(auto-fit, minmax(200px"],
  div[style*="grid-template-columns: repeat(auto-fit, minmax(180px"] {
    grid-template-columns: 1fr !important;
  }
  /* Smaller hero numbers */
  .ed-bezel-inner [style*="font-size: 32px"],
  .ed-bezel-inner [style*="font-size: 30px"] {
    font-size: 24px !important;
  }
}

/* ============================================================================
   <DataTable> — shared table component (public/js/components/data-table.js)
   Use this for new tables. Existing tables (Overstock, Shortage, etc.) can
   migrate incrementally — their current pattern still works.
   ============================================================================ */
.dt-table {
  display: flex;
  flex-direction: column;
  background: var(--ed-surface-pure);
  border: 1px solid var(--ed-rule-soft);
  border-radius: 12px;
  overflow: hidden;
  font-size: 13px;
}
.dt-header {
  display: grid;
  grid-template-columns: var(--dt-cols);
  gap: 12px;
  padding: 10px 14px;
  background: var(--ed-paper);
  border-bottom: 1px solid var(--ed-rule);
  font-family: var(--ed-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ed-ink-soft);
}
.dt-header-cell {
  align-self: center;
}
.dt-header-sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--ed-fast) var(--ed-ease);
}
.dt-header-sortable:hover { color: var(--ed-ink); }
.dt-header-active { color: var(--ed-ink); font-weight: 600; }
.dt-header-sortable:focus-visible {
  outline: 2px solid var(--ed-emerald);
  outline-offset: 2px;
  border-radius: 3px;
}
.dt-body { display: flex; flex-direction: column; }
.dt-row {
  display: grid;
  grid-template-columns: var(--dt-cols);
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ed-rule-soft);
  align-items: center;
  transition: background var(--ed-fast) var(--ed-ease);
}
.dt-row:last-child { border-bottom: none; }
.dt-row:hover { background: var(--ed-rule-soft); }
.dt-row.dt-row-clickable { cursor: pointer; }
.dt-row.dt-row-active { background: var(--ed-emerald-tint); }
.dt-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Tone modifiers — apply status color to a cell value */
.dt-cell-critical { color: var(--ed-crimson); }
.dt-cell-warning  { color: var(--ed-oak-deep); }
.dt-cell-positive { color: var(--ed-emerald); }
.dt-cell-muted    { color: var(--ed-ink-mute); }

/* Mobile: tables get horizontal scroll */
@media (max-width: 768px) {
  .dt-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dt-header, .dt-row { min-width: 720px; }
}

/* ============================================================================
   Wide Inventory table — horizontal scroll + pinned Design column.
   The grid's flex (fr) columns otherwise compress to fit the viewport, so you
   can never reach the right-hand columns (and adding more just squeezes them).
   width:max-content sizes the table to its columns (fr columns collapse to
   their px minimums), so it overflows the wrapper → real horizontal scroll.
   ========================================================================== */
.cb-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}
.cb-table-scroll > .dt-table {
  width: max-content;
  min-width: 100%;
  overflow: visible;        /* don't clip the sticky first column */
}
/* Pin the Design column (first cell of header + each row) while scrolling. */
.cb-table-sticky-first .dt-header > :first-child,
.cb-table-sticky-first .dt-row > :first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}
.cb-table-sticky-first .dt-header > :first-child { background: var(--ed-paper); }
.cb-table-sticky-first .dt-row > :first-child {
  background: var(--ed-surface-pure);
  box-shadow: 1px 0 0 var(--ed-rule-soft);
}
.cb-table-sticky-first .dt-row:hover > :first-child { background: var(--ed-rule-soft); }

/* Urgency dot — small status indicator (used in Replenishment, Awaiting Outcome) */
.urgency-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}
.urgency-dot--critical { background: var(--ed-crimson); }
.urgency-dot--warning  { background: var(--ed-oak); }
.urgency-dot--positive { background: var(--ed-emerald); }
.urgency-dot--neutral  { background: var(--ed-ink-mute); opacity: 0.4; }

/* ============================================================================
   Toasts — non-blocking inline notifications (replaces native alert())
   ============================================================================ */
.toast {
  background: var(--ed-surface-pure);
  border: 1px solid var(--ed-rule);
  border-left: 3px solid var(--ed-ink-soft);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--ed-ink);
  box-shadow: var(--ed-shadow-lift);
  max-width: 360px;
  font-family: var(--ed-grotesk);
}
.toast-positive { border-left-color: var(--ed-emerald); }
.toast-warning  { border-left-color: var(--ed-oak); }
.toast-critical { border-left-color: var(--ed-crimson); }
.toast-info     { border-left-color: #4A6B7A; }

/* ============================================================================
   promptModal field layout
   ============================================================================ */
.modal-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.modal-field-label {
  font-family: var(--ed-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ed-ink-soft);
}
.modal-field-input {
  padding: 8px 10px;
  border: 1px solid var(--ed-rule);
  border-radius: var(--radius-input);
  font-size: 14px;
  font-family: var(--ed-mono);
  background: var(--ed-paper);
  color: var(--ed-ink);
  transition: border-color var(--ed-fast) var(--ed-ease);
}
.modal-field-input:focus {
  outline: none;
  border-color: var(--ed-emerald);
  background: var(--ed-surface-pure);
}
.modal-field-help {
  font-size: 11px;
  color: var(--ed-ink-mute);
}
.modal-prose {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ed-ink);
}

/* ----------------------------------------------------------------------------
   KPI TILE — compact metric tile adopted from the ZS Inventory (FBA) app,
   2026-07-27. Replaces the 48px .metric-xl treatment for dashboard headers:
   same information in roughly half the vertical space, which is the point of
   the density pass. Use .metric-xl only where a single number IS the page.

     <div class="kpi">
       <div class="kpi-lbl">NET REVENUE MTD</div>
       <div class="kpi-val">Rs 41.2M <span class="kpi-trend up">▲8.3%</span></div>
       <div class="kpi-sub">vs Rs 38.0M prior period</div>
     </div>

   Semantics: .up = emerald, .down = crimson (the ALARM red, never berry — this
   is small text). Null/no-data renders an em-dash via utils/format.js, so
   .kpi-val takes '—' in --ed-ink-mute rather than a 0.
---------------------------------------------------------------------------- */
.kpi {
  background: var(--ed-surface-pure);
  border: 1px solid var(--ed-rule-soft);
  border-radius: var(--radius-card);
  padding: var(--space-3) var(--space-4);
}
.kpi-lbl {
  font-family: var(--ed-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ed-ink-soft);
  margin-bottom: 5px;
}
.kpi-val {
  font-family: var(--ed-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
  color: var(--ed-ink);
  font-feature-settings: 'tnum', 'lnum';
}
.kpi-val.is-empty { color: var(--ed-ink-mute); font-weight: 400; }
.kpi-trend {
  font-family: var(--ed-mono);
  font-size: 9px;
  font-weight: 700;
  margin-left: 5px;
  letter-spacing: 0;
}
.kpi-trend.up   { color: var(--ed-emerald); }
.kpi-trend.down { color: var(--ed-crimson); }
.kpi-trend.flat { color: var(--ed-ink-mute); }
.kpi-sub {
  font-size: 10.5px;
  color: var(--ed-ink-soft);
  margin-top: 4px;
  line-height: 1.4;
}

/* Severity accent — matches the row-severity convention on .data-table */
.kpi.is-critical { border-left: 3px solid var(--ed-crimson); }
.kpi.is-warning  { border-left: 3px solid var(--ed-oak); }
.kpi.is-positive { border-left: 3px solid var(--ed-emerald); }

/* ── Sort table (components/sort-table.js) ───────────────────────────────────
 * Drill-down tables the reader sorts by clicking a header and shapes with
 * ⚙ Columns. Tokens only. */
.st-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 6px; }
.st-count { font-family: var(--ed-mono); font-size: 11px; color: var(--ed-ink-mute); }
.st-count b { font-weight: 500; color: var(--ed-ink-soft); }
.st-cols { position: relative; }
.st-cols summary {
  list-style: none; cursor: pointer; font-size: 12px; color: var(--ed-ink-soft);
  padding: 5px 11px; border: 1px solid var(--ed-rule); border-radius: 999px; background: var(--ed-surface-pure);
}
.st-cols summary::-webkit-details-marker { display: none; }
.st-cols summary:hover, .st-cols[open] summary { color: var(--ed-ink); border-color: var(--ed-ink-soft); }
.st-cols-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; max-height: 360px; overflow-y: auto;
  padding: 8px 6px; background: var(--ed-surface-pure); border: 1px solid var(--ed-rule); border-radius: 10px;
  box-shadow: var(--ed-shadow-lift); display: flex; flex-direction: column;
}
.st-col-opt { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ed-ink); padding: 5px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.st-col-opt:hover { background: var(--ed-paper-soft); }
.st-col-opt input { accent-color: var(--ed-emerald); margin: 0; }
.st-reset { margin: 6px 8px 2px; align-self: flex-start; font: inherit; font-size: 11.5px; color: var(--ed-ink-soft); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.st-wrap { overflow-x: auto; }
.st-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.st-table th {
  text-align: left; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
  color: var(--ed-ink-soft); padding: 6px 10px; border-bottom: 1px solid var(--ed-rule); white-space: nowrap;
  cursor: pointer; user-select: none;
}
.st-table th:hover { color: var(--ed-ink); }
.st-table th.st-on { color: var(--ed-ink); }
.st-table th.st-num, .st-table td.st-num { text-align: right; white-space: nowrap; font-family: var(--ed-mono); font-variant-numeric: tabular-nums; }
.st-table th.st-num { font-family: inherit; }
.st-arrow { margin-left: 4px; font-size: 8px; color: var(--ed-emerald); }
.st-table td { padding: 7px 10px; border-bottom: 1px solid var(--ed-rule-soft); vertical-align: top; }
.st-table tbody tr:hover td { background: var(--ed-paper-soft); }
.st-more { display: flex; align-items: center; gap: 12px; padding: 10px; font-size: 11.5px; color: var(--ed-ink-soft); }
.st-empty { font-size: 13px; color: var(--ed-ink-soft); padding: 10px 0; }
/* Links inside these tables: ONE underline, on hover, under the text only.
 * The global a rule in base.css draws a border-bottom, and on a block-level
 * name it ran the full column width beneath the text underline (Zain,
 * 2026-09-14: "this double underline looks weird"). */
.st-table a, .ns-table a { border-bottom: 0; }
.st-link { color: var(--ed-ink); text-decoration: none; }
.st-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.st-ext { margin-left: 4px; font-size: 10px; color: var(--ed-ink-mute); }
.st-link:hover .st-ext { color: var(--ed-ink-soft); }
.st-details { color: var(--ed-ink-soft); text-decoration: none; }
.st-details:hover { color: var(--ed-ink); text-decoration: underline; text-underline-offset: 2px; }
.sh-link { color: var(--ed-ink); text-decoration: none; border-bottom: 0; }
.sh-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Product photo beside a name (lib/product-thumb.js, migration 131). */
.pthumb {
  display: inline-block;
  flex: none;
  vertical-align: middle;
  object-fit: cover;
  border-radius: 4px;
  background: var(--ed-paper);
  border: 1px solid var(--border-subtle);
  margin-right: 8px;
}
.pthumb--none { background: var(--ed-paper); }
.pthumb-cell { display: inline-flex; align-items: center; min-width: 0; }
.pthumb-cell > a, .pthumb-cell > span:last-child { min-width: 0; }
