/* ═══════════════════════════════════════════════════
   HaLow Admin Dashboard — loads after styles.css and reuses its tokens,
   header, buttons, and footer. Layout only; no new palette.
   ═══════════════════════════════════════════════════ */

.admin-page {
  background-color: var(--halo-deep);
  
  
  display: flex;
  flex-direction: column;
  min-height: var(--app-frame-height, 100lvh);
  padding: 0 env(safe-area-inset-right, 0) 0 env(safe-area-inset-left, 0);
}

/* The header bar follows the shared site header spec in styles.css; only the content column is wide. */
.admin-main {
  max-width: 1560px;
}

.admin-brand { color: inherit; flex: 0 1 auto; text-decoration: none; }

.admin-badge {
  background: transparent;
  border: 1px solid var(--halo-border-strong);
  border-radius: 999px;
  color: var(--halo-gold);
  flex: 0 0 auto;
  font-size: .6875rem;
  font-weight: 500;
  padding: 4px 10px;
  
}

.admin-header-actions {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 12px;
  justify-content: flex-end;
  min-width: 0;
}

.admin-identity {
  color: var(--halo-muted);
  font-size: .8125rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-header-link { padding: 6px 12px; }

.admin-main {
  box-sizing: border-box;
  flex: 1 0 auto;
  margin: 0 auto;
  padding: var(--space-5) 16px 48px;
  width: 100%;
}

.admin-main:focus { outline: none; }

/* ── Access gate (loading / signed out / forbidden) ── */
.admin-gate { display: grid; min-height: 50vh; place-items: center; }
.admin-gate[hidden] { display: none; }

.admin-gate-card {
  background: var(--halo-panel);
  border: 1px solid var(--halo-border);
  border-radius: var(--halo-radius-panel);
  box-shadow: none;
  display: grid;
  gap: 12px;
  justify-items: center;
  max-width: 440px;
  padding: 36px 28px;
  text-align: center;
}

.admin-gate-title { font-size: 1.25rem; margin: 0; }
.admin-gate-copy { color: var(--halo-muted); line-height: 1.55; margin: 0; }

.admin-gate-spinner {
  animation: admin-spin 1s linear infinite;
  border: 3px solid var(--halo-border);
  border-radius: 50%;
  border-top-color: var(--halo-accent);
  height: 28px;
  width: 28px;
}

.admin-gate.is-final .admin-gate-spinner { display: none; }

@keyframes admin-spin { to { transform: rotate(360deg); } }

/* ── Title bar + tabs ── */
.admin-titlebar {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.admin-title { font-size: 1.6rem;  margin: 0; }
.admin-updated { color: var(--halo-muted); font-size: .8125rem; margin: 4px 0 0; min-height: 1.2em; }
.admin-titlebar-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 12px; }

.admin-toggle {
  align-items: center;
  color: var(--halo-subtle);
  cursor: pointer;
  display: inline-flex;
  font-size: .875rem;
  font-weight: 600;
  gap: 8px;
  min-height: 40px;
}

.admin-toggle input { accent-color: var(--halo-accent); height: 18px; margin: 0; width: 18px; }

.admin-tabs {
  border-bottom: 1px solid var(--halo-border);
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-5);
  overflow-x: auto;
  scrollbar-width: thin;
}

.admin-tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--halo-muted);
  cursor: pointer;
  flex: 0 0 auto;
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  margin-bottom: -1px;
  min-height: 44px;
  padding: 10px 14px;
  white-space: nowrap;
}

.admin-tab:hover { color: var(--halo-text); }
.admin-tab[aria-selected="true"] { border-bottom-color: var(--halo-accent); color: var(--halo-text); }

.admin-alert {
  background: color-mix(in srgb, var(--halo-red-strong) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--halo-red) 30%, transparent);
  border-radius: var(--halo-radius-control);
  color: var(--halo-red);
  font-size: .875rem;
  margin: 0 0 var(--space-4);
  padding: 12px 14px;
}

/* minmax(0, 1fr) keeps wide tables scrolling inside .admin-table-wrap instead of widening the page. */
.admin-view { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.admin-view[hidden] { display: none; }

/* ── Cards, KPIs ── */
.admin-card {
  background: var(--halo-panel);
  border: 1px solid var(--halo-border);
  border-radius: var(--halo-radius-card);
  box-shadow: none;
  align-content: start;
  display: grid;
  gap: var(--space-3);
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  padding: var(--space-5);
}

.admin-card-header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.admin-card-header h2,
.admin-card-header h3 { font-size: 1rem; margin: 0; }
.admin-card-help { color: var(--halo-muted); font-size: .8125rem; line-height: 1.5; margin: 4px 0 0; }
.admin-catalog-help { margin: 0; }

.admin-kpis {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-kpi {
  background: var(--halo-panel);
  border: 1px solid var(--halo-border);
  border-radius: var(--halo-radius-tile);
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: var(--space-4);
}

.admin-kpi-label { color: var(--halo-muted); font-size: .75rem; font-weight: 500;   }
.admin-kpi-value { color: var(--halo-text); font-size: var(--type-value-compact); font-variant-numeric: tabular-nums; font-weight: 500; }
.admin-kpi-detail { color: var(--halo-subtle); font-size: .8125rem; }

.admin-grid-2 {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-dl {
  display: grid;
  gap: 10px 16px;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
  margin: 0;
}

.admin-dl dt { color: var(--halo-muted); font-size: .8125rem; }
.admin-dl dd { color: var(--halo-text); font-size: .875rem; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.admin-dl-compact { grid-template-columns: repeat(2, minmax(110px, auto) minmax(0, 1fr)); }

.admin-bars,
.admin-list { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }

.admin-bar { display: grid; gap: 4px; }
.admin-bar-label { display: flex; font-size: .8125rem; gap: 8px; justify-content: space-between; }
.admin-bar-label span:last-child { color: var(--halo-subtle); font-variant-numeric: tabular-nums; }
.admin-bar-track { background: var(--halo-fill-strong); border-radius: 999px; height: 6px; overflow: hidden; }
.admin-bar-fill { background: var(--halo-accent); border-radius: inherit; height: 100%; }

.admin-list li {
  align-items: baseline;
  border-bottom: 1px solid var(--halo-border);
  display: flex;
  font-size: .875rem;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
  padding-bottom: 8px;
}

.admin-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.admin-list .admin-muted { flex: 0 0 auto; }
.admin-empty { color: var(--halo-muted); font-size: .875rem; }

.admin-link-button {
  align-items: center;
  background: none;
  border: 0;
  color: var(--halo-accent);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: .8125rem;
  font-weight: 600;
  gap: 4px;
  min-height: 32px;
  padding: 0;
  text-align: left;
}

.admin-link-button:hover { color: var(--halo-accent-bright); text-decoration: underline; }
.admin-link-button svg,
.admin-header-link svg { fill: none; height: 16px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 16px; }

/* ── Filters + tables ── */
.admin-filters { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 12px; }
.admin-field { color: var(--halo-muted); display: grid; font-size: .75rem; font-weight: 600; gap: 6px; min-width: 180px; }
.admin-field-grow { flex: 1 1 280px; }
.admin-filter-toggle { padding-bottom: 2px; }

.admin-input {
  background: var(--halo-panel-inner);
  border: 1px solid var(--halo-border-strong);
  border-radius: var(--halo-radius-control);
  box-sizing: border-box;
  color: var(--halo-text);
  font: inherit;
  font-size: .9375rem;
  min-height: 42px;
  padding: 8px 12px;
  width: 100%;
}

.admin-input:focus-visible { border-color: var(--halo-accent); box-shadow: 0 0 0 3px var(--halo-accent-glow); outline: none; }
.admin-count { color: var(--halo-muted); font-size: .8125rem; margin: 0; }

.admin-table-wrap {
  background: var(--halo-panel);
  border: 1px solid var(--halo-border);
  border-radius: var(--halo-radius-tile);
  max-width: 100%;
  overflow-x: auto;
  /* Contains absolutely positioned .sr-only headers so they scroll with the table. */
  position: relative;
}

.admin-card .admin-table-wrap { background: var(--halo-panel-inner); }

.admin-table { border-collapse: collapse; font-size: .875rem; min-width: 760px; width: 100%; }

.admin-table th {
  background: var(--halo-fill);
  color: var(--halo-muted);
  font-size: .75rem;
  font-weight: 500;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
}

.admin-table td {
  border-top: 1px solid var(--halo-border);
  padding: 10px 12px;
  vertical-align: middle;
}

.admin-table time { white-space: nowrap; }

/* The identity column (email or device) keeps whole words; the table scrolls instead. */
.admin-table td:first-child,
.admin-table th:first-child { min-width: 13rem; }
.admin-table td:first-child:has(.admin-status) { min-width: 0; }

.admin-table tbody tr:hover { background: var(--halo-fill); }
.admin-table .num { font-variant-numeric: tabular-nums; text-align: right; }
.admin-table td.admin-empty { padding: 24px 12px; text-align: center; }

.admin-primary { color: var(--halo-text); display: block; font-weight: 500; overflow-wrap: break-word; }
.admin-secondary { color: var(--halo-muted); display: block; font-size: .75rem; margin-top: 2px; }
.admin-muted { color: var(--halo-muted); }
.admin-mono { font-family: var(--font-mono); font-size: .8125rem; }

.admin-status {
  align-items: center;
  color: var(--halo-muted);
  display: inline-flex;
  font-size: .8125rem;
  font-weight: 500;
  gap: 6px;
  white-space: nowrap;
}

.admin-status::before { background: var(--halo-subtle); border-radius: 50%; content: ""; height: 8px; width: 8px; }
.admin-status.is-online { color: var(--halo-green); }
.admin-status.is-online::before { background: var(--halo-green); box-shadow: none; }
.admin-status.is-stale::before { background: var(--halo-amber); }

.admin-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.admin-chip {
  background: var(--halo-fill);
  border: 1px solid var(--halo-border-strong);
  border-radius: 999px;
  color: var(--halo-subtle);
  display: inline-flex;
  font-size: .75rem;
  font-weight: 500;
  padding: 2px 8px;
  white-space: nowrap;
}

.admin-chip.is-cyan { background: var(--halo-fill); border-color: var(--halo-border-strong); color: var(--halo-accent); }
.admin-chip.is-green { background: transparent; border-color: var(--halo-border-strong); color: var(--halo-green); }
.admin-chip.is-gold { background: transparent; border-color: var(--halo-border-strong); color: var(--data-gold); }
.admin-chip.is-red { background: transparent; border-color: var(--halo-border-strong); color: var(--halo-red); }

/* Use Case Catalog tab */
.admin-inline-link { color: var(--halo-accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--halo-accent) 40%, transparent); text-underline-offset: 3px; }
.admin-inline-link:hover { text-decoration-color: currentColor; }
.admin-library-table td { vertical-align: top; }
.admin-library-table .admin-chip + .admin-secondary { margin-top: 6px; }
.admin-library-hardware { color: var(--halo-subtle); display: grid; font-size: .8125rem; gap: 2px; }
.admin-library-hidden { margin-top: 24px; }

/* ── User detail + access editor ── */
.admin-list-panel { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.admin-list-panel[hidden] { display: none; }
.admin-user-detail { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.admin-user-detail[hidden] { display: none; }
.admin-back { justify-self: start; }
.admin-user-header { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.admin-user-email { font-size: 1.3rem; margin: 0; overflow-wrap: anywhere; }
.admin-user-meta { color: var(--halo-muted); font-size: .8125rem; margin: 4px 0 0; }

.admin-grant-all {
  background: var(--halo-panel-inner);
  border: 1px solid var(--halo-border);
  border-radius: var(--halo-radius-control);
  justify-self: start;
  padding: 0 14px;
}

.admin-access-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.admin-access-item {
  align-items: flex-start;
  background: var(--halo-panel-inner);
  border: 1px solid var(--halo-border);
  border-radius: var(--halo-radius-tile);
  cursor: pointer;
  display: grid;
  gap: 4px 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 12px 14px;
}

.admin-access-item:has(input:checked) { border-color: color-mix(in srgb, var(--halo-accent) 45%, transparent); }
.admin-access-item:has(input:disabled) { cursor: default; }
.admin-access-item input { accent-color: var(--halo-accent); height: 18px; margin: 2px 0 0; width: 18px; }
.admin-access-copy { display: grid; gap: 6px; min-width: 0; }
.admin-access-label { color: var(--halo-text); font-size: .875rem; font-weight: 500; }
.admin-access-id { color: var(--halo-muted); font-family: var(--font-mono); font-size: .75rem; }
.admin-access-note { color: var(--halo-muted); font-size: .75rem; line-height: 1.4; }

.admin-form-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.admin-form-status { color: var(--halo-muted); flex: 1 1 200px; font-size: .8125rem; margin: 0; }
.admin-form-status.is-error { color: var(--halo-red); }
.admin-form-status.is-success { color: var(--halo-green); }

/* ── Sign-in & support ── */
.admin-support-status { grid-template-columns: 150px minmax(0, 1fr); }
.admin-support-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-support-actions .btn svg { fill: none; height: 16px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 16px; }
.admin-support-actions + .admin-form-status:empty { display: none; }
.admin-inline-action { align-items: center; display: inline-flex; flex-wrap: wrap; gap: 10px; }
.admin-reset-list { display: grid; gap: 6px; list-style: none; margin: 0; padding: 0; }
.admin-reset-list li { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.admin-reset-list .admin-secondary { display: inline; margin: 0; }
.admin-note-field { min-width: 0; }
.admin-note { line-height: 1.5; min-height: 84px; resize: vertical; }
.admin-row-actions { display: inline-flex; flex-wrap: nowrap; gap: 8px; }

/* ── Catalog table ── */
.admin-catalog-table { min-width: 900px; }
.admin-expand-cell { text-align: right; width: 48px; }

/* ── Flasher order (drag handle, position, up/down) ── */
.admin-table td.admin-order-cell,
.admin-table th.admin-order-cell { min-width: 0; white-space: nowrap; width: 1%; }
.admin-catalog-table td:nth-child(2) { min-width: 13rem; }
.admin-flasher-order-actions .admin-form-status:empty { display: none; }
.admin-order-controls { align-items: center; display: inline-flex; gap: 6px; }

.admin-order-handle {
  align-items: center;
  border-radius: var(--halo-radius-control);
  color: var(--halo-muted);
  cursor: grab;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  transition: color .15s var(--ease), background .15s var(--ease);
  user-select: none;
  width: 24px;
}

.admin-order-handle:hover { background: var(--halo-fill); color: var(--halo-accent); }
.admin-order-handle:active { cursor: grabbing; }
.admin-order-handle svg { fill: currentColor; height: 16px; width: 16px; }

.admin-order-position {
  color: var(--halo-text);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  min-width: 1.5ch;
  text-align: right;
}

.admin-order-steps {
  border: 1px solid var(--halo-border);
  border-radius: var(--halo-radius-control);
  display: inline-flex;
  overflow: hidden;
}

.admin-order-step {
  align-items: center;
  background: none;
  border: 0;
  color: var(--halo-subtle);
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  width: 32px;
}

.admin-order-step + .admin-order-step { border-left: 1px solid var(--halo-border); }
.admin-order-step:hover:not(:disabled) { background: var(--halo-fill); color: var(--halo-accent); }
.admin-order-step:disabled { cursor: default; opacity: .35; }
.admin-order-step svg { fill: none; height: 16px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 16px; }
.admin-catalog-row.is-dragging { opacity: .4; }
.admin-catalog-row.is-drag-over td { background: var(--halo-fill); border-top: 2px solid var(--halo-accent); }

.admin-expand {
  align-items: center;
  background: none;
  border: 1px solid var(--halo-border);
  border-radius: 999px;
  color: var(--halo-subtle);
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.admin-expand:hover { border-color: var(--halo-border-strong); color: var(--halo-accent); }
.admin-expand svg { fill: none; height: 16px; stroke: currentColor; stroke-linecap: round; stroke-width: 2; transition: transform .16s var(--ease); width: 16px; }
.admin-expand[aria-expanded="true"] svg { transform: rotate(90deg); }
.admin-catalog-row.is-expanded td { border-bottom: 0; background: color-mix(in srgb, var(--halo-accent) 4%, transparent); }
.admin-catalog-detail td { background: var(--halo-fill); border-top: 0; padding: 0 12px 16px; }
.admin-catalog-detail-grid { display: grid; gap: 12px; max-width: 920px; }
.admin-catalog-description { color: var(--halo-subtle); font-size: .8125rem; line-height: 1.5; margin: 0; }
.admin-catalog-detail .admin-dl { grid-template-columns: 150px minmax(0, 1fr); }
.admin-catalog-emails { display: grid; gap: 2px; }
.admin-catalog-emails span { overflow-wrap: anywhere; }

/* ── Sortable headers, export, notices ── */
.admin-sort {
  align-items: center;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: 4px;
  letter-spacing: inherit;
  padding: 0;
  text-transform: inherit;
}

.admin-sort:hover,
.admin-sort[data-direction="asc"],
.admin-sort[data-direction="desc"] { color: var(--halo-text); }
.admin-sort[data-direction="asc"]::after { content: "▲"; font-size: .6875rem; }
.admin-sort[data-direction="desc"]::after { content: "▼"; font-size: .6875rem; }
.admin-export { min-height: 42px; }
.admin-export svg { fill: none; height: 16px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 16px; }

.admin-notice {
  background: var(--halo-green-dim);
  border: 1px solid color-mix(in srgb, var(--data-green) 30%, transparent);
  border-radius: var(--halo-radius-control);
  color: var(--halo-green);
  font-size: .875rem;
  margin: 0 0 var(--space-4);
  padding: 12px 14px;
}

.admin-danger-zone { border-color: color-mix(in srgb, var(--halo-red) 28%, transparent); }
.admin-danger-zone .admin-card-header { align-items: center; }
.admin-danger-zone .btn { flex: 0 0 auto; }
.admin-danger-zone .btn svg { fill: none; height: 16px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 16px; }

/* ── Dialogs ──
   styles.css resets every margin, which removes the UA `margin: auto` that centers a modal
   <dialog>; restore it and pin the box to the viewport. */
.admin-dialog {
  inset: 0;
  margin: auto;
  overflow: auto;
  position: fixed;
  background: var(--halo-panel);
  border: 1px solid var(--halo-border-strong);
  border-radius: var(--halo-radius-card);
  box-shadow: 0 30px 80px color-mix(in srgb, var(--halo-shadow) 55%, transparent);
  color: var(--halo-text);
  max-height: min(86vh, 900px);
  max-width: min(920px, calc(100vw - 24px));
  padding: 0;
  width: 100%;
}

.admin-dialog::backdrop { background: var(--halo-scrim); }
.admin-dialog-inner { display: grid; gap: var(--space-4); padding: var(--space-5); }
.admin-dialog-header { align-items: flex-start; display: flex; gap: 12px; justify-content: space-between; }
.admin-dialog-header h2 { font-size: 1.15rem; margin: 0; }
.admin-dialog-close svg { fill: none; height: 18px; stroke: currentColor; stroke-linecap: round; stroke-width: 2; width: 18px; }
.admin-dialog-json-header { align-items: center; display: flex; justify-content: space-between; }
.admin-dialog-json-header h3 { font-size: .9375rem; margin: 0; }
.admin-dialog-compact { max-width: min(480px, calc(100vw - 24px)); }
.admin-dialog-copy { color: var(--halo-subtle); font-size: .875rem; line-height: 1.55; }
.admin-dialog-compact .admin-field { min-width: 0; }
.admin-dialog-compact .admin-form-status:empty { display: none; }
.admin-dialog[open] { animation: admin-dialog-in .16s var(--ease); }
@keyframes admin-dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.admin-json {
  background: var(--halo-raised);
  border: 1px solid var(--halo-border);
  border-radius: var(--halo-radius-tile);
  color: var(--halo-text);
  font-family: var(--font-mono);
  font-size: .75rem;
  line-height: 1.5;
  margin: 0;
  max-height: 46vh;
  overflow: auto;
  padding: 14px;
  white-space: pre;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .admin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .admin-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .admin-identity { display: none; }
}

@media (max-width: 600px) {
  .admin-main { padding: var(--space-4) 12px 32px; }
  .admin-kpis { grid-template-columns: minmax(0, 1fr); }
  .admin-card { padding: var(--space-4); }
  /* Phones keep the brand text; Dashboard keeps its label as the accessible name behind the icon. */
  .admin-header-link { justify-content: center; min-width: 44px; padding: 6px 10px; }
  .admin-header-link-label {
    border: 0; clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; margin: -1px;
    overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px;
  }
  .admin-titlebar { align-items: stretch; flex-direction: column; }
  .admin-titlebar-actions .btn,
  .admin-form-actions .btn { flex: 1 1 auto; min-height: 48px; }
  .admin-field { min-width: 0; width: 100%; }
  .admin-access-grid { grid-template-columns: minmax(0, 1fr); }
  /* Phones keep the catalog to Use Case / Access / Devices; the rest is in the expanded row. */
  .admin-catalog-table { min-width: 0; }
  .admin-catalog-table .admin-col-wide { display: none; }
  .admin-catalog-table td:nth-child(2) { min-width: 0; }
  /* Touch has no drag; stacked arrows do the reordering and keep full-size targets. */
  .admin-table th.admin-order-cell { white-space: normal; }
  .admin-table td.admin-order-cell { padding-inline: 8px 4px; }
  .admin-catalog-table .admin-mono { overflow-wrap: anywhere; }
  .admin-catalog-table .admin-expand-cell { padding-left: 4px; }
  .admin-order-handle,
  .admin-order-position { display: none; }
  .admin-order-steps { flex-direction: column; }
  .admin-order-step { height: 40px; width: 44px; }
  .admin-order-step + .admin-order-step { border-left: 0; border-top: 1px solid var(--halo-border); }
  .admin-catalog-detail .admin-dl { grid-template-columns: minmax(0, 1fr); }
  .admin-danger-zone .admin-card-header { align-items: stretch; flex-direction: column; }
  .admin-support-status { grid-template-columns: minmax(0, 1fr); }
  .admin-support-actions .btn { flex: 1 1 100%; min-height: 48px; }
  .admin-dialog { max-height: calc(100dvh - 24px); }
  .admin-dialog-inner { padding: var(--space-4); }
  .admin-dl,
  .admin-dl-compact { grid-template-columns: minmax(0, 1fr); }
  .admin-dl dd { margin-bottom: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-gate-spinner { animation-duration: 3s; }
  .admin-dialog[open] { animation: none; }
  .admin-expand svg { transition: none; }
}

.admin-row-action { min-height: 36px; padding: 6px 12px; white-space: nowrap; }
