@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --bg: #f1f4fc;
  --surface: #fffefc;
  --surface-2: #f4f6fe;
  --surface-3: #e8edfb;
  --text: #14182e;
  --muted: #687093;
  --border: #d5dced;
  --primary: #8a70ff;
  --primary-2: #22d8be;
  --ai: #8a70ff;
  --ok: #1fa971;
  --warn: #ffb547;
  --err: #ff5d67;
  --shadow: 0 12px 28px rgba(28, 40, 84, 0.10);
  --shadow-sm: 0 4px 12px rgba(138, 112, 255, 0.10);
  --radius: 14px;
  --radius-sm: 10px;
  --focus: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dark {
  color-scheme: dark;
  --bg: #070914;
  --surface: #10152b;
  --surface-2: #171e3a;
  --surface-3: #1f2750;
  --text: #f1f4ff;
  --muted: #9da7c9;
  --border: #2a3358;
  --primary: #8a70ff;
  --primary-2: #22d8be;
  --ai: #b9a8ff;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
html { scroll-behavior: smooth; }
.btn, button.btn, a.btn {
  transition: transform .12s cubic-bezier(.22,1,.36,1), box-shadow .16s ease, background .16s ease;
}
.btn:active, button.btn:active, a.btn:active { transform: scale(.97); }
.card, .tile, .kernel-tile {
  transition: transform .16s cubic-bezier(.22,1,.36,1), box-shadow .2s ease, border-color .16s ease;
}
.main > .page-head, .main > section, .main > .card {
  animation: saEnter .28s cubic-bezier(.22,1,.36,1) both;
}
@keyframes saEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.table-wrap { content-visibility: auto; contain-intrinsic-size: 480px; }
@media (prefers-reduced-motion: reduce) {
  .main > .page-head, .main > section, .main > .card { animation: none; }
  .btn:active, button.btn:active, a.btn:active { transform: none; }
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(138, 112, 255, 0.16), transparent 34rem),
    radial-gradient(circle at 90% 10%, rgba(34, 216, 190, 0.10), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
  animation-timing-function: cubic-bezier(.22, 1, .36, 1);
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  box-shadow: var(--focus);
  outline: none;
}
button, input, select, textarea { font: inherit; }
button, [role="button"], summary { touch-action: manipulation; }
input, select, textarea {
  min-height: 42px;
  max-width: 100%;
}
::selection {
  background: color-mix(in srgb, var(--primary) 28%, transparent);
  color: var(--text);
}
textarea { min-height: 96px; resize: vertical; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.skip-link {
  background: var(--primary);
  border-radius: 0 0 var(--radius-sm) 0;
  color: #fff;
  font-weight: 900;
  left: 0;
  padding: 9px 12px;
  position: fixed;
  top: -48px;
  z-index: 200;
}
.skip-link:focus { top: 0; }

.topbar {
  height: 60px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(16px);
}
.topbar::after {
  color: var(--muted);
  content: "Live";
  border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--border));
  background: color-mix(in srgb, var(--ok) 10%, var(--surface));
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  padding: 4px 8px;
  text-transform: uppercase;
}
.dark .topbar { background: rgba(16, 21, 43, 0.92); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
  flex-shrink: 0;
}
.brand span { color: var(--muted); font-weight: 700; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.icon-btn {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  padding: 0;
  width: 38px;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--primary); border-color: var(--border); }
.btn.is-loading, .icon-btn.is-loading {
  cursor: progress;
  opacity: .72;
  pointer-events: none;
}
.icon-btn.logout:hover { color: var(--err); }
.icon-btn .ic { width: 19px; height: 19px; }
.menu-toggle { display: none; }
.whoami {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px 0 8px;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ic { width: 18px; height: 18px; flex-shrink: 0; }

.side b, .tile b, .nav-link b {
  background: var(--err);
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 7px;
}

.crisis {
  background: var(--err);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 9px 12px;
  text-align: center;
  font-size: 13px;
}
.crisis.maint { background: var(--warn); }

.shell { display: flex; min-height: calc(100vh - 60px); }
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.nav-backdrop.show { opacity: 1; pointer-events: auto; }

.side {
  width: 264px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  overscroll-behavior: contain;
  position: sticky;
  top: 60px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 12px 12px 28px;
}
.side::-webkit-scrollbar { width: 7px; }
.side::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }

.nav-section { margin-bottom: 6px; }
.nav-section h3 {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  margin: 14px 0 6px;
  padding: 0 10px;
  text-transform: uppercase;
  opacity: 0.85;
}
.nav-link {
  align-items: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
  display: flex;
  font-weight: 600;
  gap: 11px;
  margin-bottom: 2px;
  min-height: 38px;
  padding: 8px 10px;
  position: relative;
  transition: background 120ms ease, color 120ms ease;
}
.nav-link .nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link .ic { color: var(--muted); transition: color 120ms ease; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link:hover .ic { color: var(--text); }
.nav-link.on {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-weight: 700;
}
.nav-link.on .ic { color: var(--primary); }
.nav-link.on::before {
  content: "";
  position: absolute;
  left: 0; top: 7px; bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.kbd, kbd { border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); font: 11px ui-monospace, monospace; padding: 2px 6px; }
.ops-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.ops-metrics a { color: inherit; text-decoration: none; }
.freshness-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.freshness-grid a { background: var(--surface-2); border-radius: 9px; color: inherit; display: flex; flex-direction: column; gap: 5px; padding: 12px; text-decoration: none; }
.freshness-grid span { color: var(--primary); font-size: 13px; font-weight: 800; }
.freshness-grid small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.policy-list { display: grid; gap: 8px; }
.policy-list p { background: var(--surface-2); border-left: 3px solid var(--primary); margin: 0; padding: 10px 12px; }
.notification-preview { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 9px; padding: 14px; }
.notification-preview h3 { margin: 8px 0 4px; }
.notification-preview p { margin: 0; white-space: pre-wrap; }
.bulk-bar { align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; padding: 9px 12px; }
.bulk-bar strong { margin-right: 4px; }
.ops-strip > div, .checklist a { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; gap: 5px; padding: 14px; }
.ops-strip strong, .checklist strong { font-size: 13px; }
.ops-strip span, .checklist span { color: var(--muted); font-size: 12px; }
.ops-strip a, .checklist a { color: var(--primary); font-size: 12px; font-weight: 700; text-decoration: none; }
.checklist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.help-panel { align-items: center; background: rgba(15, 23, 42, .45); display: flex; inset: 0; justify-content: center; padding: 18px; position: fixed; z-index: 120; }
.help-panel.hidden { display: none; }
.help-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 55px rgba(15,23,42,.25); max-width: 520px; padding: 24px; position: relative; width: 100%; }
.help-box h2 { margin-top: 0; }
.help-close { position: absolute; right: 12px; top: 12px; }
.sr-only { height: 1px; margin: -1px; overflow: hidden; position: absolute; width: 1px; clip: rect(0, 0, 0, 0); }
.status-form { align-items: center; display: inline-flex; gap: 5px; margin: 4px 0; }
.status-form select { min-width: 108px; }
.status-pill { border-radius: 999px; display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 8px; }
.status-pill.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.status-pill.err { background: color-mix(in srgb, var(--err) 16%, transparent); color: var(--err); }

.mini-preview {
  align-items: flex-start;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, transparent), transparent),
    var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
}
.mini-preview .dot {
  background: var(--primary);
  border-radius: 999px;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 14%, transparent);
  flex: 0 0 auto;
  height: 12px;
  margin-top: 5px;
  width: 12px;
}
.mini-preview .dot.critical { background: var(--err); box-shadow: 0 0 0 6px color-mix(in srgb, var(--err) 16%, transparent); }
.mini-preview .dot.high { background: var(--warn); box-shadow: 0 0 0 6px color-mix(in srgb, var(--warn) 16%, transparent); }
.mini-preview b { display: block; font-weight: 900; }
.mini-preview p { color: var(--muted); margin: 2px 0 5px; }
.mini-preview small {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.notify-recipes button {
  min-height: 86px;
  text-align: left;
}
.nav-link.sub { min-height: 32px; padding-left: 34px; font-size: 12.5px; font-weight: 600; }
.nav-link.sub .nav-label { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 12px; }

.side-group { margin-bottom: 1px; }
.side-group summary {
  align-items: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 11px;
  list-style: none;
  min-height: 36px;
  padding: 8px 10px;
}
.side-group summary:hover { background: var(--surface-2); color: var(--text); }
.side-group summary::-webkit-details-marker { display: none; }
.side-group summary span { flex: 1; }
.side-group summary::after { content: "▸"; font-size: 10px; transition: transform 150ms ease; }
.side-group[open] summary::after { transform: rotate(90deg); }
.side-group[open] summary { color: var(--text); }

.main {
  flex: 1;
  min-width: 0;
  padding: 24px;
}

.page-head {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}
.page-head .actions {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 8px;
  position: sticky;
  top: 72px;
  z-index: 12;
}
h1, .page-head h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 5px;
}
h2 { font-size: 18px; letter-spacing: -0.02em; margin: 0 0 14px; }
h3 { margin: 0 0 10px; }
.page-head p { color: var(--muted); margin: 0; }
.section-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-head h2 { margin: 0; }
.section-head span { color: var(--muted); font-weight: 700; }
.actions, .toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  min-width: 0;
  padding: 18px;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.card:hover {
  border-color: color-mix(in srgb, var(--primary) 18%, var(--border));
  box-shadow: var(--shadow);
}
.card > .section-head:first-child {
  position: relative;
}
.card:empty { display: none; }
pre {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 0 0 12px;
  max-width: 100%;
  overflow: auto;
  padding: 14px;
}
code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
}

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }
.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  margin-bottom: 18px;
}
.stats article, .tile, .feature-grid button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-height: 98px;
  overflow: hidden;
  padding: 16px;
  position: relative;
}
.stats article::before, .tile::before, .feature-grid button::before {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  content: "";
  height: 3px;
  inset: 0 0 auto;
  position: absolute;
}
.stats span, .tile span, .feature-grid span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.stats strong {
  color: var(--text);
  display: block;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-top: 7px;
}
.stats small { color: var(--ok); font-weight: 800; }
.tile { display: block; transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease; }
.tile:hover, .feature-grid button:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.tile strong, .feature-grid b {
  color: var(--text);
  display: block;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 5px;
}
.tile b { position: absolute; right: 12px; top: 12px; }
.feature-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.feature-grid button { color: var(--text); cursor: pointer; text-align: left; width: 100%; }

.btn {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: none;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  max-width: 100%;
  min-height: 36px;
  padding: 8px 13px;
  text-align: center;
  white-space: normal;
}
.btn[disabled], button:disabled {
  cursor: not-allowed;
  opacity: .55;
}
.btn:hover { background: var(--surface-2); border-color: var(--surface-3); }
.btn.sm { font-size: 12px; min-height: 30px; padding: 6px 10px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.ai { background: var(--ai); border-color: var(--ai); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.err { background: var(--err); border-color: var(--err); color: #fff; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }

.flash {
  align-items: center;
  background: color-mix(in srgb, var(--ok) 11%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--ok) 28%, var(--border));
  border-radius: var(--radius);
  color: var(--ok);
  display: flex;
  font-weight: 800;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
}
.flash.err {
  background: color-mix(in srgb, var(--err) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--err) 30%, var(--border));
  color: var(--err);
}

input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  padding: 10px 12px;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--focus);
}
input:invalid, textarea:invalid, select:invalid {
  border-color: color-mix(in srgb, var(--err) 50%, var(--border));
}
label { color: var(--text); display: block; font-size: 13px; font-weight: 800; }
label input, label textarea, label select { margin-top: 6px; }
.stack { display: grid; gap: 13px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.wide { grid-column: 1 / -1; }
.checks { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); margin: 12px 0; }
.checks label {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
}
.checks input { width: auto; }

/* enterprise-table: reserved for future wide-data tables */
.enterprise-table table { min-width: 720px; }
.enterprise-table input,
.enterprise-table textarea {
  min-width: 100px;
  padding: 7px 9px;
}
.enterprise-table textarea {
  min-height: 54px;
  width: 100%;
}
.switch-row {
  align-items: center;
  display: flex;
  font-size: 12px;
  gap: 7px;
  margin: 3px 0;
  white-space: nowrap;
}
.switch-row input { margin: 0; width: auto; }
.subpanel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 14px;
  padding: 12px;
}
.subpanel summary {
  cursor: pointer;
  font-weight: 800;
}
.flag-board {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.flag-board article {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.flag-board h3 { font-size: 14px; }
.flag-board label {
  align-items: center;
  display: flex;
  font-size: 12px;
  gap: 8px;
  margin-top: 8px;
  word-break: break-word;
}
.flag-board input { width: auto; }
.sticky-save {
  align-items: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  bottom: 16px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 12px 14px;
  position: sticky;
  z-index: 24;
}
.sticky-save span {
  color: var(--muted);
  font-weight: 800;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
.table-wrap::after {
  color: var(--muted);
  content: "Scroll horizontally if needed";
  display: none;
  font-size: 11px;
  font-weight: 800;
  padding: 8px 10px;
}
table { border-collapse: collapse; font-size: 13px; width: 100%; }
th, td {
  border-bottom: 1px solid var(--border);
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
}
tbody tr {
  transition: background 120ms ease, box-shadow 120ms ease;
}
th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 1;
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: color-mix(in srgb, var(--primary) 4%, transparent); }
tr[data-risk="high"] td { background: color-mix(in srgb, var(--err) 5%, transparent); }
td, th { overflow-wrap: anywhere; }
td:first-child, th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}
td:first-child { background: var(--surface); }
th:first-child { z-index: 3; }
tr:hover td:first-child {
  background: color-mix(in srgb, var(--primary) 4%, var(--surface));
}

.inline { display: inline-flex; flex-wrap: wrap; gap: 7px; }
.inline.mini select { min-width: 132px; padding: 6px 9px; }
.inline-details { display: inline-block; position: relative; vertical-align: top; }
.inline-details summary { list-style: none; }
.inline-details summary::-webkit-details-marker { display: none; }
.mini-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 8px;
  padding: 12px;
  position: absolute;
  right: 0;
  width: 290px;
  z-index: 20;
}
.mini-form textarea { min-height: 72px; }
.row-actions { white-space: nowrap; }
.row-actions .inline { vertical-align: middle; }
.pager, .pagination {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-weight: 800;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 14px;
}
.queue header { align-items: center; display: flex; gap: 12px; justify-content: space-between; margin-bottom: 12px; }
.risk {
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
  border-radius: 999px;
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 9px;
}
.pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  padding: 5px 8px;
  text-transform: uppercase;
  white-space: nowrap;
}
.copyable {
  cursor: copy;
  text-decoration: underline dotted color-mix(in srgb, var(--muted) 45%, transparent);
  text-underline-offset: 3px;
}
.kbd {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 6px;
}
.quality-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}
.quality-strip a,
.quality-strip article {
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 7%, var(--surface)), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-height: 74px;
  padding: 13px 14px;
}
.quality-strip strong { display: block; font-size: 14px; font-weight: 900; }
.quality-strip span { color: var(--muted); display: block; font-size: 12px; font-weight: 800; margin-top: 3px; }
.empty-state {
  align-items: center;
  color: var(--muted);
  display: grid;
  min-height: 180px;
  place-items: center;
  text-align: center;
}
.skeleton {
  animation: pulse 1.2s ease-in-out infinite;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 220% 100%;
  border-radius: var(--radius);
  min-height: 72px;
}
@keyframes pulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.pill.ok {
  background: color-mix(in srgb, var(--ok) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--ok) 35%, var(--border));
  color: var(--ok);
}
.pill.warn {
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--warn) 35%, var(--border));
  color: var(--warn);
}
.pill.err {
  background: color-mix(in srgb, var(--err) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--err) 35%, var(--border));
  color: var(--err);
}
.quality-row { border-left: 4px solid transparent; }
.quality-row.risk-high { border-left-color: var(--err); background: color-mix(in srgb, var(--err) 5%, transparent); }
.quality-row.risk-med { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 5%, transparent); }
.quality-row.stale { border-left-color: var(--warn); }
.empty { color: var(--muted); padding: 54px 20px; text-align: center; width: 100%; }

.backend-health {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 18px;
  padding: 13px 15px;
}
.backend-health > div { align-items: center; display: flex; gap: 8px; margin-right: auto; }
.backend-health small { color: var(--muted); font-size: 11px; font-weight: 600; }
.backend-health > span:not(.health-message) {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 5px 9px;
}
.backend-health > span b { color: var(--text); }
.health-dot {
  background: var(--ok);
  border-radius: 50%;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 14%, transparent);
  height: 9px;
  width: 9px;
}
.backend-health.degraded { border-color: color-mix(in srgb, var(--err) 45%, var(--border)); }
.backend-health.degraded .health-dot {
  background: var(--err);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--err) 14%, transparent);
}
.health-message { color: var(--err); font-size: 12px; font-weight: 700; }

/* Horizontal bar rows (analytics, AI Ops intents) */
.bar { align-items: center; display: grid; gap: 10px; grid-template-columns: 128px 1fr auto; margin: 8px 0; }
.bar span { color: var(--muted); font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar b { background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: 999px; display: block; height: 9px; min-width: 4px; }
.bar em { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 800; white-space: nowrap; }

/* Membership / status badges */
.badge { border-radius: 999px; display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.03em; padding: 4px 9px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.badge.ok { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); color: var(--ok); }
.badge.info { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); color: var(--primary); }
.badge.gold { background: color-mix(in srgb, #d4a017 18%, var(--surface)); border-color: color-mix(in srgb, #d4a017 45%, var(--border)); color: #b8860b; }
.dark .badge.gold { color: #fbbf24; }

/* Live App Surgery kill-switch cards */
.killswitch { align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; display: flex; gap: 14px; justify-content: space-between; margin: 0; padding: 15px 16px; }
.killswitch div { display: grid; gap: 3px; }
.killswitch strong { font-size: 15px; }
.killswitch span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.killswitch input { accent-color: var(--err); height: 20px; width: 40px; flex-shrink: 0; }
.killswitch.danger { border-color: color-mix(in srgb, var(--err) 45%, var(--border)); background: color-mix(in srgb, var(--err) 8%, var(--surface)); }

/* Approval Timeline */
.timeline { display: grid; gap: 0; margin: 6px 0; }
.tl-item { border-left: 2px solid var(--border); display: grid; gap: 3px; margin-left: 8px; padding: 0 0 20px 22px; position: relative; }
.tl-item:last-child { border-left-color: transparent; padding-bottom: 4px; }
.tl-item::before { background: var(--surface); border: 2px solid var(--primary); border-radius: 50%; content: ""; height: 12px; left: -7px; position: absolute; top: 2px; width: 12px; }
.tl-item.status::before { border-color: var(--ok); }
.tl-item.reject::before { border-color: var(--err); }
.tl-item.note::before { border-color: var(--warn); }
.tl-item.edit::before { border-color: var(--ai); }
.tl-when { color: var(--muted); font-size: 12px; font-weight: 700; }
.tl-title { font-weight: 800; }
.tl-body { color: var(--text); font-size: 13px; }

/* Diff viewer */
.diff { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.diff-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.diff-col h4 { background: var(--surface-3); font-size: 12px; letter-spacing: 0.06em; margin: 0; padding: 8px 12px; text-transform: uppercase; }
.diff-row { border-top: 1px solid var(--border); display: grid; font-size: 12.5px; gap: 2px; padding: 8px 12px; }
.diff-row .k { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.diff-row.changed { background: color-mix(in srgb, var(--warn) 12%, transparent); }
.diff-row.changed .k { color: var(--warn); }
@media (max-width: 720px) { .diff { grid-template-columns: 1fr; } .bar { grid-template-columns: 92px 1fr auto; } }

.chat-fab {
  align-items: center;
  background: var(--ai);
  border: 0;
  border-radius: 999px;
  bottom: 22px;
  box-shadow: var(--shadow);
  color: #fff;
  cursor: pointer;
  display: flex;
  font-weight: 800;
  height: 54px;
  justify-content: center;
  position: fixed;
  right: 22px;
  width: 54px;
  z-index: 50;
}
.chat-fab:hover { transform: translateY(-2px); }
.chat-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  bottom: 88px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 560px;
  max-height: calc(100vh - 110px);
  max-width: calc(100vw - 32px);
  overflow: hidden;
  position: fixed;
  right: 22px;
  width: 400px;
  z-index: 50;
}
.chat-panel.hidden { opacity: 0; pointer-events: none; transform: translateY(12px); }
.chat-panel header {
  align-items: center;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  font-weight: 800;
  justify-content: space-between;
  padding: 13px 15px;
}
.chat-panel header button { border: 0; border-radius: 999px; cursor: pointer; height: 28px; width: 28px; }
#chatMessages { display: flex; flex: 1; flex-direction: column; gap: 10px; overflow-y: auto; padding: 14px; }
.msg { border-radius: 14px; max-width: 86%; padding: 10px 12px; }
.msg.user { align-self: flex-end; background: var(--primary); color: #fff; }
.msg.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); }
.chat-panel form { border-top: 1px solid var(--border); display: flex; gap: 8px; padding: 12px; }
.chat-panel form button { background: var(--primary); border: 0; border-radius: var(--radius-sm); color: #fff; cursor: pointer; font-weight: 800; padding: 0 14px; }

.cmd {
  background: rgba(15, 23, 42, 0.48);
  display: grid;
  inset: 0;
  padding-top: 10vh;
  place-items: start center;
  position: fixed;
  z-index: 90;
}
.cmd-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  width: min(720px, calc(100vw - 32px));
}
.cmd-box input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; font-size: 17px; padding: 17px 18px; }
#cmdResults { max-height: 420px; overflow: auto; padding: 8px; }
#cmdResults a {
  border-radius: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  padding: 11px 12px;
}
#cmdResults a:hover, #cmdResults a.sel { background: var(--surface-2); }
#cmdResults span { color: var(--muted); font-size: 12px; }

.login-body {
  background:
    radial-gradient(circle at 12% 18%, rgba(138, 112, 255, 0.28), transparent 26rem),
    radial-gradient(circle at 88% 8%, rgba(34, 216, 190, 0.18), transparent 22rem),
    linear-gradient(160deg, #10152b, #1a1240 58%, #0b1228);
  display: grid;
  min-height: 100vh;
  place-items: center;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(8, 10, 28, 0.28);
  max-width: 90vw;
  padding: 36px 34px 28px;
  width: 420px;
}
.login-kicker {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  margin: 0 0 8px;
  text-align: center;
  text-transform: uppercase;
}
.login-card h1 { font-size: 28px; margin: 0 0 8px; text-align: center; }
.login-lead { margin: 0 0 20px; text-align: center; }
.login-foot { margin-top: 16px; text-align: center; font-size: 12px; }
.login-card form { display: grid; gap: 14px; }
.pass-row { display: flex; gap: 8px; }
.pass-row input { flex: 1; }
.nav-filter {
  display: grid;
  gap: 6px;
  margin: 0 10px 12px;
}
.nav-filter input {
  min-height: 36px;
  width: 100%;
}

#toast { bottom: 92px; display: flex; flex-direction: column; gap: 10px; position: fixed; right: 22px; z-index: 100; }
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 800;
  padding: 12px 14px;
}

@media (max-width: 980px) {
  .ops-strip, .checklist { grid-template-columns: 1fr 1fr; }
  .freshness-grid { grid-template-columns: 1fr 1fr; }
  .menu-toggle { display: inline-flex; }
  .whoami { display: none; }
  .side {
    position: fixed;
    top: 60px;
    left: 0;
    height: calc(100vh - 60px);
    width: min(86vw, 280px);
    z-index: 58;
    transform: translateX(-100%);
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: var(--shadow);
    padding-top: 12px;
  }
  .side.open { transform: translateX(0); }
  .shell { height: auto; min-height: calc(100vh - 56px); }
  .main { padding: 16px; }
  .page-head { flex-direction: column; }
  .page-head .actions { position: static; width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .grid.two { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 1.25rem; }
  .table-wrap::after { display: block; }
}
@media (max-width: 640px) {
  .ops-strip, .checklist { grid-template-columns: 1fr; }
  .freshness-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand { font-size: 15px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .main { padding: 13px; }
  .card { padding: 15px; }
  h1, .page-head h1 { font-size: 22px; }
  .mini-form { width: min(290px, calc(100vw - 40px)); }
  .topbar::after { display: none; }
  .toolbar input, .toolbar select, .toolbar .btn { flex: 1 1 100%; }
  .btn { min-height: 40px; }
  .pager, .pagination { justify-content: stretch; }
  .pager .btn, .pagination .btn, .pager a, .pagination a { flex: 1 1 auto; }
  .sticky-save { align-items: stretch; flex-direction: column; }
  th, td { padding: 10px; }
  .table-wrap {
    scroll-snap-type: x proximity;
  }
  td, th {
    max-width: 240px;
  }
  .chat-panel {
    bottom: 76px;
    height: min(560px, calc(100vh - 92px));
    right: 10px;
    width: calc(100vw - 20px);
  }
  .chat-fab { bottom: 14px; right: 14px; }
}
@media (max-width: 440px) {
  .stats { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
@media (prefers-contrast: more) {
  :root { --border: #7b8495; --muted: #465168; }
  .dark { --border: #8290a6; --muted: #c0cada; }
  .card, input, select, textarea, .btn, .nav-link { border-width: 2px; }
}
@media (forced-colors: active) {
  .brand::before, .nav-link.on::before { forced-color-adjust: none; }
  .icon-btn, .btn, input, select, textarea, .card {
    border: 1px solid ButtonText;
  }
}

/* -- UX polish: sticky table head, focus, motion safety --------------- */
.table-wrap { overflow: auto; max-height: 72vh; }
.table-wrap table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  box-shadow: inset 0 -1px 0 var(--border);
}
.table-wrap table tbody tr:hover td { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.pagination { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* -- In-depth UX: density, column menu, toast variants --------------- */
html.compact .table-wrap table th,
html.compact .table-wrap table td { padding-top: 4px; padding-bottom: 4px; font-size: 12.5px; }
html.compact .table-wrap table { font-size: 12.5px; }

.col-menu {
  position: fixed; top: 64px; right: 16px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; min-width: 220px; max-height: 60vh; overflow: auto;
}
.col-menu strong { display: block; margin-bottom: 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.col-menu label { display: flex; gap: 8px; align-items: center; padding: 5px 2px; font-size: 13.5px; cursor: pointer; border-radius: 6px; }
.col-menu label:hover { background: var(--surface-2); }

.toast.err { background: var(--err); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

/* -- Mobile card transform support (toggle hidden on desktop) -------- */
.table-wrap td.mc-toggle-cell { display: none; }
.table-wrap td.mc-toggle-cell::before { content: none; }
img, pre, iframe, video { max-width: 100%; }

/* -- Automation hub --------------------------------------------------- */
.pill.err { background: color-mix(in srgb, var(--err) 16%, transparent); color: var(--err); }
.pill.pill-good { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.tile form { margin-top: 4px; }
.card code, p > code { background: var(--surface-2); border: 1px solid var(--border); padding: 2px 6px; border-radius: 5px; font-size: 12.5px; overflow-wrap: anywhere; }

/* -- Theme switcher (Light / Dark / System) -------------------------- */
.theme-switch { position: relative; display: inline-flex; }
.theme-menu {
  position: absolute; top: 46px; right: 0; z-index: 80;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 6px; display: grid; gap: 4px; min-width: 172px;
}
.theme-menu[hidden], .theme-menu.hidden { display: none !important; }
.theme-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 10px 12px; color: var(--text); font: 800 13px Inter, system-ui, sans-serif;
  cursor: pointer; transition: background 120ms ease, color 120ms ease;
}
.theme-menu button:hover { background: var(--surface-2); }
.theme-menu button.on { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.theme-menu button::before { font-size: 15px; }

/* -- Image rendering in data tables (with fallback) ------------------ */
.img-wrap { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; }
.cell-img {
  display: block; max-width: 68px; max-height: 68px; width: auto; height: auto;
  border-radius: 9px; object-fit: cover; background: var(--surface-2);
  border: 1px solid var(--border);
}
.img-ph {
  display: none; align-items: center; justify-content: center; gap: 6px;
  min-width: 68px; min-height: 44px; padding: 6px 10px;
  border: 1px dashed var(--border); border-radius: 9px;
  color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.02em;
}
.img-error .cell-img { display: none; }
.img-error .img-ph { display: inline-flex; }

/* -- Pagination spacing --------------------------------------------- */
.pagination, .pager { margin-bottom: 8px; }


/* ===== newcityadmin polish pack (2026-08-30) ===== */
:root {
  --bdc-radius: 14px;
  --bdc-shadow: 0 10px 30px rgba(28, 40, 84, 0.08);
  --bdc-accent: #8a70ff;
  --bdc-ok: #1fa971;
  --bdc-err: #ff5d67;
}
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h1 {
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.card {
  border-radius: var(--bdc-radius);
  box-shadow: var(--bdc-shadow);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}
.table-wrap table {
  min-width: 720px;
}
.btn.sm {
  padding: 6px 10px;
  font-size: 0.78rem;
}
.flash {
  border-radius: 12px;
  padding: 12px 14px;
}
.empty, .empty-state {
  text-align: center;
  padding: 28px 16px;
  color: #64748b;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
html.dark-mode .card,
body.dark-mode .card {
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
}

/* ===== Missing class definitions (2026-08-30) ===== */

/* edit-grid: used by app_management, control_center, coupons, feature_flags,
   gamification, memberships, roles, secrets for form field layouts */
.edit-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}
.edit-grid .field { display: flex; flex-direction: column; gap: 5px; }
.edit-grid .field label { font-weight: 600; font-size: 13px; color: var(--muted); }
.edit-grid .field input,
.edit-grid .field select,
.edit-grid .field textarea { width: 100%; }

/* search-form: used by contributions, directory_profiles, ngo_moderation,
   users, logs for filter/search bars */
.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
.search-form input,
.search-form select {
  flex: 1 1 180px;
  min-height: 40px;
}
.search-form .btn { flex: 0 0 auto; }

/* table-toolbar: used by approval_timeline, coupons, feature_flags,
   gamification, memberships, oncall, report_center, sessions,
   smart_queue, _domain_manager */
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.table-toolbar input,
.table-toolbar select {
  flex: 1 1 160px;
  min-height: 38px;
}
.table-toolbar .btn { flex: 0 0 auto; }

/* count-badge: small inline count indicator */
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* data-table: semantic class for styled tables (matches existing table rules) */
.data-table { width: 100%; }

/* ===== Mobile card transform CSS (2026-08-30) =====
   The JS in admin.js adds .mobile-cards to <body> at ≤768px and classifies
   table cells into mc-primary, mc-more, mc-actions, mc-essential, mc-toggle-cell.
   These rules make the cards actually visible and interactive. */
.mobile-cards .table-wrap table {
  min-width: 0;
  display: block;
}
.mobile-cards .table-wrap thead { display: none; }
.mobile-cards .table-wrap tr {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  position: relative;
  background: var(--surface);
}
.mobile-cards .table-wrap tr.mc-head { display: none; }
.mobile-cards .table-wrap tr.mc-full { flex-basis: 100%; }
.mobile-cards .table-wrap td {
  border: none;
  padding: 4px 0;
  max-width: none;
  font-size: 13px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.mobile-cards .table-wrap td::before {
  content: attr(data-label);
  font-weight: 700;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 72px;
  flex-shrink: 0;
}
.mobile-cards .table-wrap td.mc-primary {
  flex-basis: 100%;
  font-weight: 700;
  font-size: 15px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.mobile-cards .table-wrap td.mc-primary::before { display: none; }
.mobile-cards .table-wrap td.mc-essential {
  flex: 0 0 auto;
  padding-right: 8px;
}
.mobile-cards .table-wrap td.mc-essential::before { display: none; }
.mobile-cards .table-wrap td.mc-actions {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.mobile-cards .table-wrap td.mc-actions::before { display: none; }
.mobile-cards .table-wrap td.mc-more {
  display: none;
  flex-basis: 100%;
}
.mobile-cards .table-wrap tr.expanded td.mc-more {
  display: flex;
}
.mobile-cards .table-wrap td.mc-toggle-cell {
  display: none;
}
.mobile-cards .table-wrap .mc-toggle-btn {
  display: none;
}
.mobile-cards .table-wrap tr:not(.mc-head):not(.mc-full) .mc-toggle-btn {
  display: inline-flex;
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 11px;
  padding: 4px 8px;
  min-height: auto;
}
.mobile-cards .table-wrap td.mc-actions .btn.icon-only {
  width: 34px;
  height: 34px;
  min-height: auto;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* ===== Responsive form input fixes (2026-08-30) ===== */
@media (max-width: 640px) {
  .edit-grid {
    grid-template-columns: 1fr;
  }
  .search-form {
    flex-direction: column;
    align-items: stretch;
  }
  .search-form input,
  .search-form select {
    flex: 1 1 100%;
  }
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .table-toolbar input,
  .table-toolbar select {
    flex: 1 1 100%;
  }
  /* Kill inline hardcoded widths on mobile */
  [style*="width:300px"],
  [style*="width: 300px"],
  [style*="width:200px"],
  [style*="width: 200px"],
  [style*="width:160px"],
  [style*="width: 160px"] {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* =====================================================================
   IMMERSIVE MOBILE UX (2026-08-30)
   Toast notifications, safe areas, tap feedback, skeleton variants,
   dark mode polish, FAB, empty states, micro-interactions.
   ===================================================================== */

/* -- Toast notifications (JS creates .toast in #toast) --------------- */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.24);
  opacity: 1;
  transition: opacity 300ms ease, transform 300ms ease;
  pointer-events: auto;
  white-space: nowrap;
  max-width: calc(100vw - 40px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.ok { background: var(--ok); color: #fff; }
.toast.err { background: var(--err); color: #fff; }
.toast.warn { background: var(--warn); color: #1a1a2e; }
@media (max-width: 640px) {
  #toast { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .toast { font-size: 12px; padding: 9px 16px; }
}

/* -- Safe area insets for notch / home indicator -------------------- */
@supports (padding: env(safe-area-inset-bottom)) {
  .topbar { padding-top: env(safe-area-inset-top); }
  .main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .chat-fab {
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    right: calc(22px + env(safe-area-inset-right, 0px));
  }
  .chat-panel {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    right: calc(22px + env(safe-area-inset-right, 0px));
  }
  #toast {
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .sticky-save {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}
@supports (padding: env(safe-area-inset-left)) {
  .side { padding-left: env(safe-area-inset-left); }
}

/* -- Tap feedback / micro-interactions ----------------------------- */
.btn, .icon-btn, .tile, .nav-link, .card, .feature-grid button, .checklist a, .quality-strip a {
  -webkit-tap-highlight-color: transparent;
}
.btn:active, .icon-btn:active {
  transform: scale(0.97);
  transition: transform 80ms ease;
}
.tile:active, .feature-grid button:active {
  transform: scale(0.98) translateY(0);
  transition: transform 80ms ease;
}
.nav-link:active {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  transition: background 60ms ease;
}
.card {
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.card:active {
  transform: scale(0.995);
  transition: transform 80ms ease;
}
/* Ripple-like focus ring for touch */
.btn:focus-visible, .icon-btn:focus-visible {
  box-shadow: var(--focus);
  outline: none;
}
/* Smooth input focus */
input, select, textarea {
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
/* Smooth sidebar slide */
.side {
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
/* Smooth page transitions */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 200ms;
  animation-timing-function: cubic-bezier(.22, 1, .36, 1);
}

/* -- FAB mobile polish --------------------------------------------- */
.chat-fab {
  transition: transform 200ms ease, box-shadow 200ms ease, opacity 200ms ease;
}
.chat-fab:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 36px rgba(138, 112, 255, 0.35);
}
.chat-fab:active {
  transform: scale(0.92);
  transition: transform 80ms ease;
}
@media (max-width: 640px) {
  .chat-fab {
    width: 50px;
    height: 50px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 16px;
  }
}

/* -- Dark mode mobile polish --------------------------------------- */
.dark .topbar {
  background: rgba(7, 9, 20, 0.94);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.dark .side {
  background: var(--surface);
  border-right-color: var(--border);
}
.dark .card {
  background: var(--surface);
  border-color: var(--border);
}
.dark input, .dark select, .dark textarea {
  background: var(--surface-2);
  border-color: var(--border);
}
.dark .nav-backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.dark .toast {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}
.dark .toast.ok { background: color-mix(in srgb, var(--ok) 85%, #1a1a2e); color: #fff; }
.dark .toast.err { background: color-mix(in srgb, var(--err) 85%, #1a1a2e); color: #fff; }
.dark .chat-fab {
  box-shadow: 0 8px 28px rgba(138, 112, 255, 0.3);
}
.dark .chat-panel {
  background: var(--surface);
  border-color: var(--border);
}

/* -- Skeleton loading variants ------------------------------------- */
.skeleton-line {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 220% 100%;
  animation: pulse 1.2s ease-in-out infinite;
  margin-bottom: 8px;
}
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w100 { width: 100%; }
.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 220% 100%;
  animation: pulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* -- Enhanced empty states ----------------------------------------- */
.empty-state {
  padding: 40px 20px;
  min-height: 200px;
}
.empty-state::before {
  content: "📭";
  display: block;
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}
.empty-state h3 {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--text);
}
.empty-state p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  max-width: 320px;
  margin-inline: auto;
}
.dark .empty-state::before { opacity: 0.4; }

/* -- Swipe hint on tables (mobile) --------------------------------- */
@media (max-width: 768px) {
  .table-wrap {
    position: relative;
  }
  .table-wrap::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 32px;
    background: linear-gradient(to left, var(--surface), transparent);
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease;
  }
  .table-wrap.scroll-right::before {
    opacity: 1;
  }
}

/* -- Pull-to-refresh indicator (visual only, JS-driven) ------------ */
.pull-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 0;
  overflow: hidden;
  transition: height 200ms ease;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  gap: 8px;
}
.pull-indicator.visible {
  height: 44px;
}
.pull-indicator .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* -- Mobile bottom bar (for primary actions) ----------------------- */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  gap: 8px;
  justify-content: center;
}
.mobile-bottom-bar .btn {
  flex: 1;
  min-height: 44px;
}
@media (max-width: 640px) {
  .mobile-bottom-bar {
    display: flex;
  }
  .main {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

/* -- Card entrance animation (staggered on load) ------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.card, .stats article, .tile {
  animation: fadeInUp 320ms ease both;
}
.stats article:nth-child(2) { animation-delay: 40ms; }
.stats article:nth-child(3) { animation-delay: 80ms; }
.stats article:nth-child(4) { animation-delay: 120ms; }
.stats article:nth-child(5) { animation-delay: 160ms; }
@media (prefers-reduced-motion: reduce) {
  .card, .stats article, .tile {
    animation: none;
  }
}

/* -- Stat number counter animation --------------------------------- */
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.stats strong {
  animation: countUp 400ms ease both;
}
@media (prefers-reduced-motion: reduce) {
  .stats strong { animation: none; }
}

/* -- Nav link active indicator animation --------------------------- */
.nav-link.on::before {
  animation: slideIn 200ms ease both;
}
@keyframes slideIn {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
  .nav-link.on::before { animation: none; }
}

/* -- Flash message entrance ---------------------------------------- */
.flash {
  animation: flashIn 300ms ease both;
}
@keyframes flashIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .flash { animation: none; }
}

/* -- Mobile: larger touch targets for all interactive elements ----- */
@media (max-width: 640px) {
  .nav-link { min-height: 44px; padding: 10px 12px; }
  .side-group summary { min-height: 44px; }
  .btn { min-height: 44px; }
  .icon-btn { height: 44px; width: 44px; }
  .status-form select { min-height: 44px; }
  th, td { padding: 12px 10px; }
}

/* -- Haptic-like visual pulse for important actions ---------------- */
@keyframes pulseOnce {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 40%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.btn.primary:active {
  animation: pulseOnce 400ms ease;
}
.btn.ok:active {
  animation-name: pulseOnce;
  --pulse-color: var(--ok);
}

/* -- Status bar theme color for mobile browsers --------------------- */
@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); }
}

/* -- Smooth scrolling for sidebar on mobile ------------------------ */
@media (max-width: 980px) {
  .side {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}

/* ================================================================== */
/* Modern architecture v3.1 — Command Center dashboard               */
/* ================================================================== */
.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.cmd-head .actions { flex-wrap: wrap; gap: 8px; }

.live-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--line, #e2e8f0) 100%, transparent);
  background: color-mix(in srgb, var(--card, #fff) 92%, #f1f5f9);
}
.live-strip.on-air {
  border-color: color-mix(in srgb, #e11d48 45%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, #e11d48 12%, transparent), color-mix(in srgb, #8a70ff 8%, transparent));
}
.live-strip .live-pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: #e11d48;
  box-shadow: 0 0 0 0 rgba(225, 29, 72, .55);
  animation: livePulse 1.4s ease-out infinite;
}
@keyframes livePulse {
  70% { box-shadow: 0 0 0 12px rgba(225, 29, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}
.live-strip strong { font-weight: 900; }
.live-strip span { color: var(--muted, #64748b); font-size: 13px; flex: 1; min-width: 140px; }

.kernel-grid { margin: 0 0 18px; }
.kernel-grid .section-head,
.grid .section-head.full {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin: 0 0 10px; width: 100%;
}
.kernel-grid .section-head h2,
.grid .section-head.full h2 { margin: 0; font-size: 15px; font-weight: 800; }
.kernel-grid .section-head span { font-size: 12px; color: var(--muted, #64748b); }
.kernel-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.kernel-tile {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line, #e2e8f0);
  background: var(--card, #fff);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.kernel-tile:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, #8a70ff 40%, transparent);
  box-shadow: 0 12px 28px rgba(138, 112, 255, .12);
}
.kernel-tile .k-icon { font-size: 20px; line-height: 1; }
.kernel-tile strong { font-size: 14px; font-weight: 800; }
.kernel-tile span { font-size: 12px; color: var(--muted, #64748b); line-height: 1.35; }

.arch-card .arch-flow {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px;
  margin: 0 0 14px;
}
.arch-card .arch-flow > div:not(.arch-arrow) {
  flex: 1 1 140px;
  padding: 12px;
  border-radius: 12px;
  background: color-mix(in srgb, #8a70ff 8%, transparent);
  border: 1px solid color-mix(in srgb, #8a70ff 18%, transparent);
}
.arch-card .arch-flow b { display: block; font-size: 13px; margin-bottom: 4px; }
.arch-card .arch-flow span { font-size: 12px; color: var(--muted, #64748b); line-height: 1.4; }
.arch-arrow {
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: #8a70ff; min-width: 24px;
}
.arch-links { margin-top: 4px; }

html.dark .kernel-tile,
html.dark-mode .kernel-tile,
.dark .kernel-tile,
.dark-mode .kernel-tile {
  background: color-mix(in srgb, #0f172a 80%, #1e293b);
  border-color: #334155;
}
html.dark .live-strip,
html.dark-mode .live-strip,
.dark .live-strip,
.dark-mode .live-strip {
  background: color-mix(in srgb, #0f172a 70%, #1e293b);
}

/* Unified mobile nav: support both body.nav-open and .side.open */
@media (max-width: 980px) {
  body.nav-open .side,
  .side.open {
    transform: translateX(0) !important;
  }
  body.nav-open {
    overflow: hidden;
  }
  body.nav-open #navBackdrop,
  #navBackdrop.show {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ═══ Admin UX v4 — ops pin, breadcrumbs, toasts, confirm, density ═══ */
.ops-pin{display:flex;flex-wrap:wrap;gap:8px;padding:10px 16px;border-bottom:1px solid var(--border);background:color-mix(in srgb,var(--surface) 92%,var(--primary));position:sticky;top:0;z-index:20}
.ops-chip{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border-radius:999px;font-weight:700;font-size:12.5px;text-decoration:none;color:var(--text);background:var(--surface);border:1px solid var(--border);box-shadow:var(--shadow-sm)}
.ops-chip:hover{border-color:var(--primary);color:var(--primary)}
.ops-chip.on{background:color-mix(in srgb,var(--primary) 14%,var(--surface));border-color:color-mix(in srgb,var(--primary) 40%,var(--border));color:var(--primary)}
.ops-chip.hot{background:color-mix(in srgb,var(--err) 12%,var(--surface));border-color:color-mix(in srgb,var(--err) 35%,var(--border));color:var(--err)}
.ops-badge,.nav-count{display:inline-flex;min-width:18px;height:18px;padding:0 5px;align-items:center;justify-content:center;border-radius:999px;font-size:10px;font-weight:800;background:var(--err);color:#fff}
.nav-count{margin-left:auto}
.breadcrumbs{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:12.5px;color:var(--muted);margin:0 0 12px}
.breadcrumbs a{color:var(--primary);text-decoration:none;font-weight:600}
.bc-sep{opacity:.5}
.bc-cur{color:var(--text);font-weight:700}
#toast{position:fixed;right:16px;bottom:16px;z-index:9999;display:flex;flex-direction:column;gap:8px;max-width:min(360px,92vw);pointer-events:none}
.toast{pointer-events:auto;padding:12px 14px;border-radius:12px;background:var(--surface);color:var(--text);border:1px solid var(--border);box-shadow:var(--shadow);font-weight:600;font-size:13px;animation:saEnter .22s ease both}
.toast.err{border-color:color-mix(in srgb,var(--err) 50%,var(--border));background:color-mix(in srgb,var(--err) 10%,var(--surface))}
.toast.ok{border-color:color-mix(in srgb,var(--ok) 45%,var(--border))}
.toast .toast-actions{display:flex;gap:8px;margin-top:8px}
#saConfirmModal{position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;background:rgba(10,12,24,.48);padding:16px}
#saConfirmModal.hidden{display:none}
#saConfirmModal .sa-modal{width:min(420px,100%);background:var(--surface);border-radius:16px;border:1px solid var(--border);box-shadow:var(--shadow);padding:18px}
#saConfirmModal h3{margin:0 0 8px;font-size:17px}
#saConfirmModal p{margin:0 0 14px;color:var(--muted);font-size:13.5px;line-height:1.45}
#saConfirmModal .row{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.top-live{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border-radius:999px;font-size:11px;font-weight:800;text-decoration:none;background:color-mix(in srgb,var(--err) 14%,transparent);color:var(--err);border:1px solid color-mix(in srgb,var(--err) 30%,transparent)}
.top-live .dot{width:8px;height:8px;border-radius:50%;background:var(--err);box-shadow:0 0 0 0 rgba(255,93,103,.6);animation:livePulse 1.4s infinite}
@keyframes livePulse{0%{box-shadow:0 0 0 0 rgba(255,93,103,.55)}70%{box-shadow:0 0 0 8px rgba(255,93,103,0)}100%{box-shadow:0 0 0 0 rgba(255,93,103,0)}}
body.density-compact{font-size:13px}
body.density-compact .table-wrap td,body.density-compact .table-wrap th{padding:6px 8px}
body.density-compact .card{padding:12px}
body.density-compact .ops-chip{padding:5px 10px}
.queue-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;margin:12px 0 18px}
.queue-card{display:block;padding:14px;border-radius:14px;border:1px solid var(--border);background:var(--surface);text-decoration:none;color:inherit;box-shadow:var(--shadow-sm)}
.queue-card:hover{border-color:var(--primary);transform:translateY(-1px)}
.queue-card strong{display:block;font-size:22px;font-weight:800}
.queue-card span{color:var(--muted);font-size:12.5px}
.queue-card .q-cta{margin-top:10px;font-size:12px;font-weight:800;color:var(--primary)}
.live-hero{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:14px;margin:12px 0 18px}
@media(max-width:820px){.live-hero{grid-template-columns:1fr}}
.live-hero .preview{aspect-ratio:16/9;background:#0b0f1c;border-radius:14px;overflow:hidden;border:1px solid var(--border)}
.live-hero .preview iframe,.live-hero .preview img{width:100%;height:100%;border:0;object-fit:cover;display:block}
.live-hero .meta h3{margin:0 0 6px}
.live-hero .share-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.col-picker{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 12px}
.col-picker label{font-size:11.5px;font-weight:600;color:var(--muted);display:inline-flex;gap:4px;align-items:center;padding:4px 8px;border-radius:8px;border:1px solid var(--border);background:var(--surface)}
.table-wrap thead th{position:sticky;top:0;z-index:2;background:var(--surface-2);box-shadow:0 1px 0 var(--border)}
.empty-cta{padding:28px 16px;text-align:center;color:var(--muted)}
.empty-cta .btn{margin-top:10px}
.page-help{font-size:12.5px;color:var(--muted);margin:0 0 12px;padding:10px 12px;border-radius:12px;background:color-mix(in srgb,var(--primary) 8%,var(--surface));border:1px solid color-mix(in srgb,var(--primary) 18%,var(--border))}
.page-help strong{color:var(--text)}
.recent-nav{padding:8px 12px 4px;border-bottom:1px solid var(--border)}
.recent-nav a{display:block;font-size:12px;padding:4px 8px;border-radius:6px;color:var(--muted);text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.recent-nav a:hover{background:var(--surface-2);color:var(--primary)}
.pulse-row{display:flex;flex-wrap:wrap;gap:10px;margin:10px 0 16px}
.pulse-pill{padding:8px 12px;border-radius:12px;background:var(--surface);border:1px solid var(--border);font-size:12.5px}
.pulse-pill b{font-size:16px;margin-right:4px}
.sk{display:block;height:12px;border-radius:6px;background:linear-gradient(90deg,var(--surface-2),var(--surface-3),var(--surface-2));background-size:200% 100%;animation:sk 1.2s linear infinite;margin:6px 0}
@keyframes sk{to{background-position:-200% 0}}
.form-field{display:flex;flex-direction:column;gap:4px;margin-bottom:10px}
.form-field label{font-weight:700;font-size:12.5px}
.form-field .hint{font-size:11.5px;color:var(--muted)}
.form-field .err{font-size:12px;color:var(--err);font-weight:600}
.timeline{list-style:none;margin:0;padding:0}
.timeline li{padding:10px 0 10px 14px;border-left:2px solid var(--border);margin-left:6px;position:relative}
.timeline li::before{content:"";position:absolute;left:-5px;top:14px;width:8px;height:8px;border-radius:50%;background:var(--primary)}
.timeline li small{display:block;color:var(--muted);font-size:11.5px}
