/*
 * SotiDo Admin theme adapter.
 *
 * Product colors, type sizes, spacing and component recipes come from the
 * generated Design Core stylesheets loaded before this file. This file owns
 * only admin-shell composition and legacy-class mapping.
 */

html[data-sotido-admin-theme="true"] {
  color-scheme: dark;
  --bg-1: var(--sotido-theme-background);
  --bg-2: var(--sotido-theme-background);
  --bg: var(--sotido-theme-background);
  --ink: var(--sotido-theme-text-primary);
  --muted: var(--sotido-theme-text-muted);
  --card: var(--sotido-theme-surface);
  --card-strong: var(--sotido-theme-surface-raised);
  --line: var(--sotido-theme-border);
  --brand: var(--sotido-theme-accent);
  --brand-2: var(--sotido-theme-accent);
  --accent: var(--sotido-theme-accent);
  --accent-ink: var(--sotido-theme-primary-accent-text);
  --ok: var(--sotido-theme-success);
  --danger: var(--sotido-theme-danger);
  min-width: 320px;
  background: var(--sotido-theme-background);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-sotido-admin-theme="true"] *,
html[data-sotido-admin-theme="true"] *::before,
html[data-sotido-admin-theme="true"] *::after {
  box-sizing: border-box;
}

html[data-sotido-admin-theme="true"] body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--sotido-theme-background);
  color: var(--sotido-theme-text-primary);
  font-family: inherit;
  font-size: var(--sotido-type-body-compact);
  line-height: 1.45;
  accent-color: var(--sotido-theme-accent);
}

html[data-sotido-admin-theme="true"] ::selection {
  background: var(--sotido-theme-accent);
  color: var(--sotido-theme-primary-accent-text);
}

html[data-sotido-admin-theme="true"] .page-bg {
  display: none;
}

html[data-sotido-admin-theme="true"] :is(button, input, select, textarea) {
  font: inherit;
}

html[data-sotido-admin-theme="true"] :is(code, pre, .data-json, .secret-box, .broadcast-recipient-preview span) {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

html[data-sotido-admin-theme="true"] :is(h1, h2, h3, p) {
  color: inherit;
}

html[data-sotido-admin-theme="true"] h1 {
  font-size: var(--sotido-type-headline);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

html[data-sotido-admin-theme="true"] h2 {
  font-size: var(--sotido-type-title);
  line-height: 1.2;
}

html[data-sotido-admin-theme="true"] h3 {
  font-size: var(--sotido-type-body);
  line-height: 1.25;
}

html[data-sotido-admin-theme="true"] :is(.eyebrow, .admin-context-group, .admin-nav-label, .stat-label, .data-kv-label) {
  color: var(--sotido-theme-text-muted);
  font-size: var(--sotido-type-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-sotido-admin-theme="true"] :is(.meta, .muted, .subtitle, .compact-line) {
  color: var(--sotido-theme-text-muted);
}

/* Main admin chrome */

html[data-sotido-admin-theme="true"] .shell {
  position: relative;
  width: min(100%, 1600px);
  max-width: none;
  margin: 0 auto;
  padding: var(--sotido-space-xl);
}

html[data-sotido-admin-theme="true"] .topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--sotido-space-md);
  min-height: 52px;
  margin-bottom: var(--sotido-space-md);
}

html[data-sotido-admin-theme="true"] .topbar > :first-child {
  grid-column: 2;
  min-width: 180px;
  padding: var(--sotido-space-xs) var(--sotido-space-lg);
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-pill);
  background: var(--sotido-theme-surface-chrome);
  text-align: center;
}

html[data-sotido-admin-theme="true"] .topbar > .row {
  grid-column: 3;
  justify-self: end;
  min-width: 0;
}

html[data-sotido-admin-theme="true"] .topbar h1 {
  margin: 0;
  font-size: var(--sotido-type-title);
}

html[data-sotido-admin-theme="true"] .topbar .eyebrow {
  margin: 0 0 2px;
}

html[data-sotido-admin-theme="true"] .me-badge {
  max-width: min(42vw, 520px);
  overflow: hidden;
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-pill);
  padding: var(--sotido-space-xs) var(--sotido-space-md);
  background: var(--sotido-theme-surface-soft);
  color: var(--sotido-theme-text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-sotido-admin-theme="true"] .runtime-identity-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sotido-space-xs) var(--sotido-space-md);
  margin: 0 0 var(--sotido-space-md);
  padding: var(--sotido-space-sm) var(--sotido-space-md);
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface-soft);
  box-shadow: none;
}

html[data-sotido-admin-theme="true"] .runtime-identity-banner strong {
  color: var(--sotido-theme-text-primary);
  font-size: var(--sotido-type-label);
  letter-spacing: 0.08em;
}

html[data-sotido-admin-theme="true"] .runtime-identity-banner span {
  color: var(--sotido-theme-text-secondary);
}

html[data-sotido-admin-theme="true"] .runtime-identity-banner.is-local {
  border-color: var(--sotido-theme-accent);
  background: var(--sotido-theme-info-surface);
}

html[data-sotido-admin-theme="true"] .runtime-identity-banner.is-staging {
  border-color: var(--sotido-theme-warning-accent);
  background: var(--sotido-theme-warning-surface);
}

html[data-sotido-admin-theme="true"] .runtime-identity-banner.is-production {
  border-color: var(--sotido-theme-danger);
  background: var(--sotido-theme-danger-surface);
}

html[data-sotido-admin-theme="true"] .card,
html[data-sotido-admin-theme="true"] .admin-context-bar {
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface);
  box-shadow: none;
  backdrop-filter: none;
}

html[data-sotido-admin-theme="true"] .no-access {
  padding: var(--sotido-space-xl);
}

html[data-sotido-admin-theme="true"] :is(
  .device-access-issue-panel,
  .device-access-code-card,
  .device-access-session-row,
  .device-access-session-empty
) {
  border-color: var(--sotido-theme-border);
  background: var(--sotido-theme-surface-soft);
  color: var(--sotido-theme-text-primary);
}

html[data-sotido-admin-theme="true"] .device-access-code-card code {
  border-color: var(--sotido-theme-border);
  background: var(--sotido-theme-surface-highest);
  color: var(--sotido-theme-text-primary);
}

html[data-sotido-admin-theme="true"] .device-access-session-row.is-current {
  border-color: var(--sotido-theme-accent);
  box-shadow: inset 3px 0 0 var(--sotido-theme-accent);
}

html[data-sotido-admin-theme="true"] .admin-console {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: var(--sotido-space-md);
  align-items: start;
}

html[data-sotido-admin-theme="true"] .admin-main {
  min-width: 0;
}

html[data-sotido-admin-theme="true"] .admin-sidebar {
  position: sticky;
  top: var(--sotido-space-xl);
  max-height: calc(100vh - (var(--sotido-space-xl) * 2));
  overflow-y: auto;
  padding: var(--sotido-space-sm);
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface);
  scrollbar-color: var(--sotido-theme-surface-highest) transparent;
  scrollbar-width: thin;
}

html[data-sotido-admin-theme="true"] .admin-sidebar-heading {
  display: flex;
  align-items: center;
  gap: var(--sotido-space-sm);
  padding: var(--sotido-space-xs) var(--sotido-space-xs) var(--sotido-space-md);
  border-bottom: 1px solid var(--sotido-theme-divider);
}

html[data-sotido-admin-theme="true"] .admin-sidebar-heading > div {
  display: grid;
  min-width: 0;
}

html[data-sotido-admin-theme="true"] .admin-sidebar-heading strong {
  color: var(--sotido-theme-text-primary);
  font-size: var(--sotido-type-body);
}

html[data-sotido-admin-theme="true"] .admin-sidebar-heading span:not(.admin-sidebar-mark) {
  color: var(--sotido-theme-text-muted);
  font-size: var(--sotido-type-caption);
}

html[data-sotido-admin-theme="true"] .admin-sidebar-mark {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface-raised);
  color: var(--sotido-theme-accent);
}

html[data-sotido-admin-theme="true"] .admin-sidebar-mark svg {
  width: 20px;
  height: 20px;
}

html[data-sotido-admin-theme="true"] .admin-context-bar {
  display: grid;
  gap: var(--sotido-space-md);
  margin-bottom: var(--sotido-space-md);
  padding: var(--sotido-space-md);
}

html[data-sotido-admin-theme="true"] .admin-context-top {
  align-items: flex-start;
}

html[data-sotido-admin-theme="true"] .admin-context-bar h2 {
  margin: 0;
  font-size: var(--sotido-type-headline);
}

html[data-sotido-admin-theme="true"] .admin-context-side,
html[data-sotido-admin-theme="true"] .admin-health-cluster,
html[data-sotido-admin-theme="true"] .admin-node-badges {
  gap: var(--sotido-space-xs);
}

html[data-sotido-admin-theme="true"] .admin-header-nav {
  display: grid;
  gap: var(--sotido-space-md);
  padding-top: var(--sotido-space-md);
  border: 0;
}

html[data-sotido-admin-theme="true"] .admin-nav-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sotido-space-xs);
  align-items: start;
}

html[data-sotido-admin-theme="true"] .admin-nav-row--sections {
  padding-top: var(--sotido-space-md);
  border-top: 1px solid var(--sotido-theme-divider);
}

html[data-sotido-admin-theme="true"] :is(.tabs, .subtabs) {
  display: flex;
  flex-flow: column nowrap;
  gap: var(--sotido-space-xs);
  margin: 0;
  padding: 0;
  overflow: visible;
}

html[data-sotido-admin-theme="true"] .subtabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html[data-sotido-admin-theme="true"] :is(.tab, .subtab) {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--sotido-radius-card);
  background: transparent;
  color: var(--sotido-theme-text-secondary);
  font-size: var(--sotido-type-body-compact);
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

html[data-sotido-admin-theme="true"] :is(.tab, .subtab)[hidden] {
  display: none;
}

html[data-sotido-admin-theme="true"] .tab {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: var(--sotido-space-sm);
  min-height: 52px;
  padding: var(--sotido-space-xs) var(--sotido-space-sm);
}

html[data-sotido-admin-theme="true"] .admin-nav-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface-soft);
  color: var(--sotido-theme-text-muted);
}

html[data-sotido-admin-theme="true"] .admin-nav-icon svg {
  width: 18px;
  height: 18px;
}

html[data-sotido-admin-theme="true"] .admin-nav-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

html[data-sotido-admin-theme="true"] .admin-nav-copy strong,
html[data-sotido-admin-theme="true"] .admin-nav-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-sotido-admin-theme="true"] .admin-nav-copy strong {
  color: inherit;
  font-size: var(--sotido-type-body-compact);
}

html[data-sotido-admin-theme="true"] .admin-nav-copy small {
  color: var(--sotido-theme-text-muted);
  font-size: var(--sotido-type-caption);
  font-weight: 500;
}

html[data-sotido-admin-theme="true"] .subtab {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 var(--sotido-space-sm) 0 30px;
  white-space: normal;
}

html[data-sotido-admin-theme="true"] .subtab::before {
  position: absolute;
  left: 13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sotido-theme-text-muted);
  content: "";
  opacity: 0.55;
}

html[data-sotido-admin-theme="true"] :is(.tab, .subtab):is(:hover, :focus-visible) {
  border-color: var(--sotido-theme-border);
  background: var(--sotido-theme-surface-raised);
  color: var(--sotido-theme-text-primary);
}

html[data-sotido-admin-theme="true"] :is(.tab, .subtab).is-active {
  border-color: var(--sotido-theme-accent);
  background: var(--sotido-theme-surface-highest);
  color: var(--sotido-theme-text-primary);
  box-shadow: inset 3px 0 0 var(--sotido-theme-accent);
}

html[data-sotido-admin-theme="true"] .tab.is-active .admin-nav-icon {
  background: var(--sotido-theme-info-surface);
  color: var(--sotido-theme-accent);
}

html[data-sotido-admin-theme="true"] .subtab.is-active::before {
  background: var(--sotido-theme-accent);
  opacity: 1;
}

html[data-sotido-admin-theme="true"] .tab-content {
  max-width: 100%;
  padding: var(--sotido-space-lg);
  overflow-x: hidden;
}

/* Shared controls: legacy selectors are mapped to canonical recipes in JS. */

html[data-sotido-admin-theme="true"] button {
  width: auto;
  min-width: 0;
  min-height: var(--sotido-space-touch-target);
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-pill);
  background: var(--sotido-theme-surface-soft);
  color: var(--sotido-theme-text-primary);
  cursor: pointer;
  transition: background var(--sotido-motion-fast) ease, border-color var(--sotido-motion-fast) ease, opacity var(--sotido-motion-fast) ease;
}

html[data-sotido-admin-theme="true"] button:hover {
  transform: none;
}

html[data-sotido-admin-theme="true"] :is(button.site-page-item, button.site-page-variant-btn) {
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface-raised);
}

html[data-sotido-admin-theme="true"] button.site-page-collection-toggle {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}

html[data-sotido-admin-theme="true"] button.site-page-collection-toggle:hover {
  background: var(--sotido-theme-surface-soft);
}

html[data-sotido-admin-theme="true"] button:focus-visible {
  outline: 2px solid var(--sotido-theme-accent);
  outline-offset: 2px;
}

html[data-sotido-admin-theme="true"] button:disabled {
  opacity: 0.55;
  transform: none;
}

html[data-sotido-admin-theme="true"] :is(.primary-btn, .sotido-action-button--primary) {
  border-color: var(--sotido-theme-accent);
  background: var(--sotido-theme-accent);
  color: var(--sotido-theme-primary-accent-text);
}

html[data-sotido-admin-theme="true"] :is(.primary-btn, .sotido-action-button--primary):hover {
  border-color: var(--sotido-theme-accent-pressed);
  background: var(--sotido-theme-accent-pressed);
}

html[data-sotido-admin-theme="true"] :is(.ghost-btn, .admin-health-action-btn, .sotido-action-button):not(.sotido-action-button--primary):not(.sotido-action-button--danger) {
  border-color: var(--sotido-theme-border);
  background: var(--sotido-theme-surface-soft);
  color: var(--sotido-theme-text-primary);
}

html[data-sotido-admin-theme="true"] :is(.danger-btn, .sotido-action-button--danger) {
  border-color: var(--sotido-theme-destructive-accent);
  background: var(--sotido-theme-destructive-accent);
  color: var(--sotido-theme-text-on-accent);
}

html[data-sotido-admin-theme="true"] :is(.compact-btn, .editorial-mini-btn, .admin-health-action-btn) {
  min-height: 32px;
}

html[data-sotido-admin-theme="true"] .sotido-segmented-control > .sotido-segmented-control-btn,
html[data-sotido-admin-theme="true"] .sotido-segmented-control > .sotido-segmented-control-btn:is(:hover, .is-active) {
  border: 0;
  background: transparent;
  color: var(--sotido-theme-text-primary);
  transform: none;
}

html[data-sotido-admin-theme="true"] :is(input:not([type]), input[type="text"], input[type="search"], input[type="email"], input[type="url"], input[type="number"], input[type="date"], input[type="month"], input[type="time"], input[type="datetime-local"], select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: var(--sotido-space-touch-target);
  padding: var(--sotido-space-sm) var(--sotido-space-md);
  border: 1px solid transparent;
  border-radius: var(--sotido-recipe-form-control-corner-radius);
  outline: 0;
  background: var(--sotido-recipe-form-control-fill);
  color: var(--sotido-recipe-form-control-text);
}

/* Keep the accessibility utility authoritative after generic form recipes. */
html[data-sotido-admin-theme="true"] .visually-hidden {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html[data-sotido-admin-theme="true"] :is(input, select, textarea):focus {
  border-color: var(--sotido-theme-accent);
  background: var(--sotido-recipe-form-control-focus-fill);
}

html[data-sotido-admin-theme="true"] :is(input, textarea)::placeholder {
  color: var(--sotido-recipe-form-control-placeholder-text);
  opacity: 1;
}

html[data-sotido-admin-theme="true"] :is(input[type="checkbox"], input[type="radio"]) {
  display: inline-grid;
  flex: 0 0 18px;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  place-content: center;
  appearance: none;
  border: 1px solid var(--sotido-theme-border);
  border-radius: 5px;
  background: var(--sotido-theme-surface-highest);
  color: var(--sotido-theme-text-on-accent);
}

html[data-sotido-admin-theme="true"] input[type="radio"] {
  border-radius: 50%;
}

html[data-sotido-admin-theme="true"] input[type="checkbox"]::before {
  width: 8px;
  height: 4px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  content: "";
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
}

html[data-sotido-admin-theme="true"] input[type="radio"]::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  transform: scale(0);
}

html[data-sotido-admin-theme="true"] :is(input[type="checkbox"], input[type="radio"]):checked {
  border-color: var(--sotido-theme-accent);
  background: var(--sotido-theme-accent);
}

html[data-sotido-admin-theme="true"] :is(input[type="checkbox"], input[type="radio"]):checked::before {
  transform: rotate(-45deg) scale(1);
}

html[data-sotido-admin-theme="true"] input[type="radio"]:checked::before {
  transform: scale(1);
}

html[data-sotido-admin-theme="true"] input[type="file"] {
  width: 100%;
  min-width: 0;
  min-height: var(--sotido-space-touch-target);
  padding: var(--sotido-space-xs);
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-recipe-form-control-corner-radius);
  background: var(--sotido-theme-surface-soft);
  color: var(--sotido-theme-text-secondary);
}

html[data-sotido-admin-theme="true"] input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: var(--sotido-space-sm);
  padding: 0 var(--sotido-space-md);
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-pill);
  background: var(--sotido-theme-surface-raised);
  color: var(--sotido-theme-text-primary);
  cursor: pointer;
}

html[data-sotido-admin-theme="true"] label {
  margin-top: var(--sotido-space-sm);
  margin-bottom: var(--sotido-space-xxs);
  color: var(--sotido-theme-text-secondary);
  font-size: var(--sotido-type-caption);
  font-weight: 600;
}

html[data-sotido-admin-theme="true"] :is(.row, .action-row) {
  min-width: 0;
}

/* Status and runtime controls */

html[data-sotido-admin-theme="true"] :is(.admin-health-pill, .admin-node-badge) {
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface-soft);
  color: var(--sotido-theme-text-primary);
  box-shadow: none;
}

html[data-sotido-admin-theme="true"] .admin-health-pill {
  min-width: 210px;
  padding: var(--sotido-space-sm) var(--sotido-space-md);
}

html[data-sotido-admin-theme="true"] :is(.admin-health-pill, .admin-node-badge).is-ok {
  border-color: var(--sotido-theme-success);
  background: color-mix(in srgb, var(--sotido-theme-success) 14%, var(--sotido-theme-surface));
}

html[data-sotido-admin-theme="true"] :is(.admin-health-pill, .admin-node-badge).is-warn {
  border-color: var(--sotido-theme-warning-accent);
  background: var(--sotido-theme-warning-surface);
}

html[data-sotido-admin-theme="true"] :is(.admin-health-pill, .admin-node-badge).is-critical {
  border-color: var(--sotido-theme-danger);
  background: var(--sotido-theme-danger-surface);
}

html[data-sotido-admin-theme="true"] .admin-node-badge {
  padding: var(--sotido-space-xs) var(--sotido-space-sm);
}

html[data-sotido-admin-theme="true"] :is(.admin-health-label, .admin-node-badge span, #adminOpsHealthMeta) {
  color: var(--sotido-theme-text-muted);
}

html[data-sotido-admin-theme="true"] .status-bar,
html[data-sotido-admin-theme="true"] .status-card {
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-pill);
  background: var(--sotido-theme-surface-soft);
  color: var(--sotido-theme-text-secondary);
  box-shadow: none;
}

html[data-sotido-admin-theme="true"] :is(.status-bar, .status-card).is-error {
  border-color: var(--sotido-theme-danger);
  background: var(--sotido-theme-danger-surface);
  color: var(--sotido-theme-danger-text);
}

html[data-sotido-admin-theme="true"] .text-danger,
html[data-sotido-admin-theme="true"] [data-status-tone="danger"] {
  color: var(--sotido-theme-danger-text);
}

html[data-sotido-admin-theme="true"] .text-warning,
html[data-sotido-admin-theme="true"] [data-status-tone="warning"] {
  color: var(--sotido-theme-warning-accent);
}

html[data-sotido-admin-theme="true"] [data-status-tone="success"] {
  color: var(--sotido-theme-success);
}

html[data-sotido-admin-theme="true"] [data-status-tone="muted"] {
  color: var(--sotido-theme-text-muted);
}

.status-strong {
  font-weight: 700;
}

.meta-spaced-bottom {
  margin-bottom: 12px;
}

.meta-spaced-top {
  margin-top: 10px;
}

.meta-spaced-top-compact {
  margin-top: 4px;
}

.offscreen-copy-buffer {
  position: fixed;
  left: -9999px;
}

html[data-sotido-admin-theme="true"] :is(.status-pill, .badge, .destination-badge, .editorial-badge, .editorial-review-badge, .data-pill, .candidate-import-provider-badge, .candidate-manual-preview-badge) {
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-pill);
  background: var(--sotido-theme-surface-raised);
  color: var(--sotido-theme-text-secondary);
}

/* Workspace surfaces */

html[data-sotido-admin-theme="true"] :is(
  .support-threads,
  .support-thread-view,
  .reports-sidebar,
  .reports-detail,
  .routes-target-card,
  .routes-registry-card,
  .destinations-sidebar,
  .destinations-detail,
  .editorial-sidebar,
  .editorial-detail,
  .analytics-detail,
  .data-sidebar,
  .data-detail,
  .game-zones-sidebar,
  .game-zones-detail,
  .game-zone-editor,
  .site-pages-sidebar,
  .site-pages-detail,
  .broadcast-create,
  .broadcast-list,
  .broadcast-details,
  .ops-summary-card,
  .ops-detail-card,
  .ops-topology-node,
  .card-section,
  .editorial-analytics-panel
) {
  min-width: 0;
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface);
  color: var(--sotido-theme-text-primary);
  box-shadow: none;
}

html[data-sotido-admin-theme="true"] .card-section {
  padding: var(--sotido-space-md);
}

html[data-sotido-admin-theme="true"] .candidate-queue-pane {
  border: 0;
  padding: 0;
  background: transparent;
}

html[data-sotido-admin-theme="true"] :is(
  .candidate-import-workflow,
  .candidate-review-queue,
  .candidate-import-preview,
  .candidate-preview-summary-item,
  .candidate-preview-row
) {
  border-color: var(--sotido-theme-border);
  background: var(--sotido-theme-surface);
  color: var(--sotido-theme-text-primary);
  box-shadow: none;
}

html[data-sotido-admin-theme="true"] :is(.candidate-import-preview, .candidate-category-chip) {
  background: var(--sotido-theme-surface-soft);
}

html[data-sotido-admin-theme="true"] .candidate-category-chip:has(input:checked) {
  border-color: var(--sotido-theme-accent);
  background: var(--sotido-theme-info-surface);
}

html[data-sotido-admin-theme="true"] .candidate-preview-summary-item[data-status-tone="success"] {
  border-color: var(--sotido-theme-success);
  background: color-mix(in srgb, var(--sotido-theme-success) 10%, var(--sotido-theme-surface));
}

html[data-sotido-admin-theme="true"] .candidate-preview-summary-item[data-status-tone="warning"] {
  border-color: var(--sotido-theme-warning-accent);
  background: var(--sotido-theme-warning-surface);
}

html[data-sotido-admin-theme="true"] .candidate-preview-summary-item[data-status-tone="danger"] {
  border-color: var(--sotido-theme-danger);
  background: var(--sotido-theme-danger-surface);
}

html[data-sotido-admin-theme="true"] .routes-registry-toggle {
  color: var(--sotido-theme-text-muted);
}

html[data-sotido-admin-theme="true"] #supportSection {
  padding: 0;
  border: 0;
  background: transparent;
}

html[data-sotido-admin-theme="true"] :is(
  .access-kv-item,
  .access-feature-chip,
  .destination-item,
  .editorial-event-row,
  .editorial-photo-card,
  .editorial-ticket-offer-row,
  .candidate-import-provider-row,
  .candidate-manual-preview-summary,
  .candidate-manual-preview-row,
  .candidate-match-group,
  .candidate-match-row,
  .thread-item,
  .job-item,
  .attempt-item,
  .stat-card,
  .data-card,
  .data-kv,
  .data-mini-item,
  .data-result-item,
  .data-json,
  .report-incident-group,
  .ops-table-row,
  .ops-note,
  .broadcast-preview,
  .broadcast-safety,
  .attempts,
  .messages
) {
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface-soft);
  color: var(--sotido-theme-text-primary);
  box-shadow: none;
}

html[data-sotido-admin-theme="true"] :is(.thread-item, .job-item, .data-result-item) {
  width: 100%;
  text-align: left;
}

html[data-sotido-admin-theme="true"] :is(.thread-item, .job-item, .data-result-item, .destination-item, .editorial-event-main, .access-assignment-item).is-active,
html[data-sotido-admin-theme="true"] :is(.thread-item, .job-item, .data-result-item, .destination-item, .access-assignment-item):focus-visible {
  border-color: var(--sotido-theme-accent);
  background: var(--sotido-theme-surface-raised);
  box-shadow: inset 3px 0 0 var(--sotido-theme-accent);
}

html[data-sotido-admin-theme="true"] .messages {
  min-height: 340px;
}

html[data-sotido-admin-theme="true"] .msg {
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface-raised);
  color: var(--sotido-theme-text-primary);
}

html[data-sotido-admin-theme="true"] .msg.admin {
  border-color: var(--sotido-theme-accent);
  background: var(--sotido-theme-info-surface);
}

html[data-sotido-admin-theme="true"] .msg.user {
  border-color: var(--sotido-theme-border);
  background: var(--sotido-theme-surface-soft);
}

html[data-sotido-admin-theme="true"] :is(.data-kv-value, .data-result-title, .data-mini-item-title, .editorial-event-title, .destination-item-title) {
  color: var(--sotido-theme-text-primary);
}

html[data-sotido-admin-theme="true"] :is(.data-result-meta, .data-mini-item-meta, .thread-last, .stat-help, .editorial-section-copy, .editorial-analytics-subtitle) {
  color: var(--sotido-theme-text-muted);
}

html[data-sotido-admin-theme="true"] :is(.access-feature-chip.is-active, .candidate-match-filters .ghost-btn.is-active, .candidate-manual-preview-actions .ghost-btn.is-active) {
  border-color: var(--sotido-theme-accent);
  background: var(--sotido-theme-info-surface);
}

html[data-sotido-admin-theme="true"] .access-feature-chip.is-role-default:disabled {
  opacity: 1;
}

html[data-sotido-admin-theme="true"] :is(.ops-summary-card.is-warn, .ops-detail-card.is-warn) {
  border-color: var(--sotido-theme-warning-accent);
  background: var(--sotido-theme-warning-surface);
}

html[data-sotido-admin-theme="true"] :is(.ops-summary-card.is-critical, .ops-detail-card.is-critical, .candidate-manual-preview-row.is-error) {
  border-color: var(--sotido-theme-danger);
  background: var(--sotido-theme-danger-surface);
}

html[data-sotido-admin-theme="true"] .ops-topology-node {
  width: 100%;
  min-height: 0;
  border-left-width: 3px;
  border-radius: var(--sotido-radius-card);
  padding: 12px;
  text-align: left;
}

html[data-sotido-admin-theme="true"] .ops-topology-node[data-topology-signal="contract"] {
  border-left-color: var(--sotido-theme-accent);
}

html[data-sotido-admin-theme="true"] .ops-topology-node.is-ok {
  border-left-color: var(--sotido-theme-success-accent);
}

html[data-sotido-admin-theme="true"] .ops-topology-node.is-warn {
  border-left-color: var(--sotido-theme-warning-accent);
  background: var(--sotido-theme-warning-surface);
}

html[data-sotido-admin-theme="true"] .ops-topology-node.is-critical {
  border-left-color: var(--sotido-theme-danger);
  background: var(--sotido-theme-danger-surface);
}

html[data-sotido-admin-theme="true"] .ops-topology-node.is-actionable:hover {
  border-color: var(--sotido-theme-accent);
  background: var(--sotido-theme-surface-raised);
  transform: translateY(-1px);
}

html[data-sotido-admin-theme="true"] :is(.candidate-manual-preview-row.is-ok, .destination-badge.is-live) {
  border-color: var(--sotido-theme-success);
  background: color-mix(in srgb, var(--sotido-theme-success) 14%, var(--sotido-theme-surface));
}

html[data-sotido-admin-theme="true"] :is(.analytics-intro, .analytics-hero, .editorial-mode-summary) {
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface-soft);
  color: var(--sotido-theme-text-primary);
  box-shadow: none;
}

html[data-sotido-admin-theme="true"] .editorial-mode-switch {
  border-color: var(--sotido-theme-border);
  background: var(--sotido-theme-surface-soft);
}

html[data-sotido-admin-theme="true"] .editorial-mode-btn {
  background: transparent;
  color: var(--sotido-theme-text-secondary);
}

html[data-sotido-admin-theme="true"] .editorial-mode-btn.is-active {
  background: var(--sotido-theme-surface-highest);
  color: var(--sotido-theme-text-primary);
}

html[data-sotido-admin-theme="true"] :is(table, .ops-table) {
  color: var(--sotido-theme-text-primary);
}

html[data-sotido-admin-theme="true"] :is(th, td) {
  border-color: var(--sotido-theme-divider);
}

html[data-sotido-admin-theme="true"] th {
  color: var(--sotido-theme-text-muted);
}

html[data-sotido-admin-theme="true"] details {
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface-soft);
}

html[data-sotido-admin-theme="true"] a {
  color: var(--sotido-theme-info-text);
}

/* Shared confirmation and prompt surface for the main admin and Support app. */

html[data-sotido-admin-theme="true"] .admin-action-dialog {
  width: min(520px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface);
  color: var(--sotido-theme-text-primary);
  box-shadow: 0 24px 80px color-mix(in srgb, #000 48%, transparent);
}

html[data-sotido-admin-theme="true"] .admin-action-dialog::backdrop {
  background: color-mix(in srgb, #000 68%, transparent);
  backdrop-filter: blur(4px);
}

html[data-sotido-admin-theme="true"] .admin-action-dialog-form {
  display: flex;
  flex-direction: column;
  gap: var(--sotido-space-md);
  padding: var(--sotido-space-lg);
}

html[data-sotido-admin-theme="true"] .admin-action-dialog-header,
html[data-sotido-admin-theme="true"] .admin-action-dialog-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sotido-space-md);
}

html[data-sotido-admin-theme="true"] .admin-action-dialog-header h2 {
  margin: 4px 0 0;
}

html[data-sotido-admin-theme="true"] .admin-action-dialog-eyebrow,
html[data-sotido-admin-theme="true"] .admin-action-dialog-label {
  color: var(--sotido-theme-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-sotido-admin-theme="true"] .admin-action-dialog-message {
  margin: 0;
  color: var(--sotido-theme-text-secondary);
  line-height: 1.55;
  white-space: pre-wrap;
}

html[data-sotido-admin-theme="true"] .admin-action-dialog-field {
  display: flex;
  flex-direction: column;
  gap: var(--sotido-space-sm);
}

html[data-sotido-admin-theme="true"] .admin-action-dialog-field[hidden] {
  display: none;
}

html[data-sotido-admin-theme="true"] .admin-action-dialog-field textarea {
  width: 100%;
  resize: vertical;
}

html[data-sotido-admin-theme="true"] .admin-action-dialog-error {
  min-height: 18px;
  color: var(--sotido-theme-danger-text);
  font-size: 12px;
}

html[data-sotido-admin-theme="true"] .admin-action-dialog-actions {
  align-items: center;
  justify-content: flex-end;
}

@media (max-width: 560px) {
  html[data-sotido-admin-theme="true"] .admin-action-dialog-form {
    padding: var(--sotido-space-md);
  }

  html[data-sotido-admin-theme="true"] .admin-action-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  html[data-sotido-admin-theme="true"] .admin-action-dialog-actions button {
    width: 100%;
  }
}

/* Dark-surface guard for legacy and dynamically rendered admin modules. */

html[data-sotido-admin-theme="true"] :is(
  .editorial-mode-shell,
  .editorial-event-main,
  .editorial-photo-thumb,
  .editorial-ticket-offer-badge,
  .candidate-manual-preview-summary-item,
  .candidate-manual-preview-badge,
  .candidate-ai-preview,
  .editorial-review-card,
  .editorial-review-copy-grid article,
  .editorial-ai-suggestion,
  .candidate-match-confidence,
  .candidate-match-action,
  .candidate-match-provider-presence,
  .candidate-match-reason,
  .candidate-match-action-note,
  .editorial-analytics-breadcrumb-btn,
  .editorial-analytics-country,
  .analytics-intro-panel,
  .analytics-intro-item,
  .analytics-badge,
  .ops-history-report-card,
  .ops-history-card,
  .ops-history-timeline,
  .ops-probe-verdict,
  .ops-probe-summary section,
  .ops-probe-diagnostics section,
  .ops-health-item,
  .ops-health-action,
  .ops-db-growth-summary,
  .ops-table-head,
  .broadcast-recipient-preview span,
  .candidate-cover-preview
) {
  border-color: var(--sotido-theme-border);
  background: var(--sotido-theme-surface-soft);
  color: var(--sotido-theme-text-primary);
  box-shadow: none;
}

html[data-sotido-admin-theme="true"] .editorial-review-badge.is-warning {
  border-color: var(--sotido-theme-warning-accent);
  background: var(--sotido-theme-warning-surface);
  color: var(--sotido-theme-text-primary);
}

html[data-sotido-admin-theme="true"] .editorial-review-badge.is-success {
  border-color: var(--sotido-theme-success-accent);
  background: color-mix(in srgb, var(--sotido-theme-success) 14%, var(--sotido-theme-surface));
  color: var(--sotido-theme-text-primary);
}

html[data-sotido-admin-theme="true"] .editorial-review-badge.is-accent {
  border-color: var(--sotido-theme-accent);
  background: var(--sotido-theme-info-surface);
  color: var(--sotido-theme-info-text);
}

html[data-sotido-admin-theme="true"] .editorial-ai-dialog {
  width: min(900px, calc(100vw - 32px));
}

html[data-sotido-admin-theme="true"] .editorial-ai-suggestion-warning {
  color: var(--sotido-theme-warning-accent);
}

html[data-sotido-admin-theme="true"] :is(
  .editorial-mode-shell,
  .candidate-ai-preview,
  .analytics-intro-panel,
  .ops-history-timeline
) {
  background: var(--sotido-theme-surface);
}

html[data-sotido-admin-theme="true"] :is(
  .editorial-mode-summary.is-page-mode,
  .editorial-ticket-offer-row.is-primary,
  .candidate-import-provider-row.is-active,
  .candidate-manual-preview-summary-item.is-create,
  .candidate-match-action.is-create,
  .candidate-match-provider-presence,
  .ops-db-growth-summary,
  .analytics-badge.is-scope,
  .analytics-badge.is-selection
) {
  border-color: var(--sotido-theme-accent);
  background: var(--sotido-theme-info-surface);
  color: var(--sotido-theme-info-text);
}

html[data-sotido-admin-theme="true"] :is(
  .candidate-manual-preview-summary-item.is-attach,
  .candidate-manual-preview-row.is-ok,
  .candidate-match-confidence.is-high,
  .candidate-match-action.is-attach,
  .analytics-badge.is-surface,
  .ops-history-report-card.is-ok,
  .ops-history-card.is-ok,
  .ops-health-item.is-ok
) {
  border-color: var(--sotido-theme-success);
  background: color-mix(in srgb, var(--sotido-theme-success) 14%, var(--sotido-theme-surface));
  color: var(--sotido-theme-text-primary);
}

html[data-sotido-admin-theme="true"] :is(
  .candidate-manual-preview-summary-item.is-duplicate,
  .candidate-manual-preview-summary-item.is-review,
  .candidate-manual-preview-row.is-duplicate,
  .candidate-match-confidence.is-medium,
  .candidate-match-action.is-review,
  .ops-history-report-card.is-warn,
  .ops-history-card.is-warn,
  .ops-health-item.is-warn,
  .analytics-badge.is-geo
) {
  border-color: var(--sotido-theme-warning-accent);
  background: var(--sotido-theme-warning-surface);
  color: var(--sotido-theme-text-primary);
}

html[data-sotido-admin-theme="true"] :is(
  .candidate-manual-preview-summary-item.is-error,
  .candidate-manual-preview-row.is-error,
  .candidate-match-confidence.is-low,
  .candidate-match-provider-presence.is-exact,
  .ops-history-report-card.is-critical,
  .ops-history-card.is-critical,
  .ops-health-item.is-critical
) {
  border-color: var(--sotido-theme-danger);
  background: var(--sotido-theme-danger-surface);
  color: var(--sotido-theme-danger-text);
}

html[data-sotido-admin-theme="true"] :is(
  .candidate-manual-preview-summary-item.is-attached,
  .candidate-manual-preview-summary-item.is-skipped,
  .candidate-manual-preview-summary-item.is-deferred,
  .candidate-manual-preview-row.is-skipped,
  .candidate-match-action.is-already-attached,
  .analytics-badge.is-state,
  .ops-table-head,
  .ops-health-action
) {
  background: var(--sotido-theme-surface-raised);
  color: var(--sotido-theme-text-secondary);
}

/* Focused support workspace */

html[data-sotido-admin-theme="true"] .support-shell {
  width: min(calc(100% - 32px), 1480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: var(--sotido-space-lg) 0;
  gap: var(--sotido-space-md);
}

html[data-sotido-admin-theme="true"] .hero {
  min-height: 64px;
  padding: var(--sotido-space-md) var(--sotido-space-lg);
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface);
  box-shadow: none;
}

html[data-sotido-admin-theme="true"] .hero h1,
html[data-sotido-admin-theme="true"] .moderation-hero h2 {
  margin: 0;
  font-size: var(--sotido-type-headline);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

html[data-sotido-admin-theme="true"] .hero .subtitle {
  margin-top: var(--sotido-space-xxs);
}

html[data-sotido-admin-theme="true"] .support-workspace {
  gap: var(--sotido-space-sm);
}

html[data-sotido-admin-theme="true"] .module-switcher.sotido-segmented-control {
  width: min(100%, 440px);
  margin: 0 auto;
  padding: var(--sotido-segment-inset);
  border: 0;
  border-radius: var(--sotido-recipe-segmented-control-rail-radius);
}

html[data-sotido-admin-theme="true"] .module-switcher .module-tab {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--sotido-theme-text-secondary);
}

html[data-sotido-admin-theme="true"] .module-switcher .module-tab.is-active {
  background: transparent;
  color: var(--sotido-theme-text-primary);
}

html[data-sotido-admin-theme="true"] :is(.module-viewport, .chat-sidebar, .reports-sidebar, .chat-pane, .report-pane, .moderation-board) {
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface);
  color: var(--sotido-theme-text-primary);
  box-shadow: none;
}

html[data-sotido-admin-theme="true"] :is(.chat-sidebar, .reports-sidebar) {
  background: var(--sotido-theme-surface-soft);
}

html[data-sotido-admin-theme="true"] .chat-head {
  border-bottom-color: var(--sotido-theme-border);
  background: var(--sotido-theme-surface-raised);
  color: var(--sotido-theme-text-primary);
}

html[data-sotido-admin-theme="true"] :is(.support-stats > div, .queue-card, .item-btn, .chat-messages, .detail-body, .action-panel, .report-detail, .queue-list-card) {
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface-soft);
  color: var(--sotido-theme-text-primary);
  box-shadow: none;
}

html[data-sotido-admin-theme="true"] .item-btn {
  width: 100%;
  text-align: left;
}

html[data-sotido-admin-theme="true"] .item-btn:is(:hover, .is-selected) {
  border-color: var(--sotido-theme-accent);
  background: var(--sotido-theme-surface-raised);
}

html[data-sotido-admin-theme="true"] .message {
  border: 1px solid var(--sotido-theme-border);
  border-radius: var(--sotido-radius-card);
  background: var(--sotido-theme-surface-soft);
  color: var(--sotido-theme-text-primary);
}

html[data-sotido-admin-theme="true"] .message.is-admin {
  border-color: var(--sotido-theme-accent);
  background: var(--sotido-theme-accent);
  color: var(--sotido-theme-primary-accent-text);
}

html[data-sotido-admin-theme="true"] .action-panel {
  border-color: var(--sotido-theme-border);
  background: var(--sotido-theme-surface-raised);
}

html[data-sotido-admin-theme="true"] .secret-box {
  border-color: var(--sotido-theme-accent);
  background: var(--sotido-theme-info-surface);
  color: var(--sotido-theme-info-text);
}

/* Responsive composition */

@media (max-width: 1220px) {
  html[data-sotido-admin-theme="true"] :is(
    .support-layout,
    .reports-layout,
    .routes-layout,
    .destinations-layout,
    .editorial-layout,
    .ops-layout,
    .data-layout,
    .analytics-intro-grid,
    .analytics-layout .editorial-analytics-toolbar,
    .analytics-layout .editorial-analytics-grid,
    .broadcast-layout
  ) {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-sotido-admin-theme="true"] .admin-context-top {
    align-items: flex-start;
    flex-direction: column;
  }

  html[data-sotido-admin-theme="true"] .admin-context-side {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  html[data-sotido-admin-theme="true"] .admin-console {
    display: block;
  }

  html[data-sotido-admin-theme="true"] .admin-sidebar {
    position: static;
    max-height: none;
    margin-bottom: var(--sotido-space-md);
    overflow: visible;
  }

  html[data-sotido-admin-theme="true"] :is(.tabs, .subtabs) {
    display: flex;
    flex-flow: row nowrap;
    grid-template-columns: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  html[data-sotido-admin-theme="true"] .admin-nav-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sotido-space-xxs);
  }

  html[data-sotido-admin-theme="true"] .tab {
    grid-template-columns: 28px auto;
    width: auto;
    min-height: 44px;
    padding-inline: var(--sotido-space-sm);
  }

  html[data-sotido-admin-theme="true"] .admin-nav-icon {
    width: 28px;
    height: 28px;
  }

  html[data-sotido-admin-theme="true"] .admin-nav-copy small {
    display: none;
  }

  html[data-sotido-admin-theme="true"] .subtab {
    width: auto;
    padding-inline: 28px var(--sotido-space-md);
  }
}

@media (max-width: 720px) {
  html[data-sotido-admin-theme="true"] .shell {
    padding: var(--sotido-space-md);
  }

  html[data-sotido-admin-theme="true"] .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--sotido-space-sm);
  }

  html[data-sotido-admin-theme="true"] .topbar > :first-child {
    grid-column: 1;
    min-width: 0;
    padding-inline: var(--sotido-space-md);
    text-align: left;
  }

  html[data-sotido-admin-theme="true"] .topbar > .row {
    grid-column: 2;
    width: auto;
    flex-wrap: nowrap;
  }

  html[data-sotido-admin-theme="true"] .topbar h1 {
    font-size: var(--sotido-type-title);
  }

  html[data-sotido-admin-theme="true"] .me-badge {
    display: none;
  }

  html[data-sotido-admin-theme="true"] .runtime-identity-banner {
    align-items: flex-start;
    flex-direction: row;
    padding: var(--sotido-space-sm);
  }

  html[data-sotido-admin-theme="true"] .runtime-identity-banner strong {
    flex: 1 0 100%;
  }

  html[data-sotido-admin-theme="true"] :is(.admin-context-bar, .tab-content) {
    padding: var(--sotido-space-sm);
  }

  html[data-sotido-admin-theme="true"] .admin-context-side {
    align-items: stretch;
    flex-direction: column;
  }

  html[data-sotido-admin-theme="true"] .admin-health-cluster {
    align-items: stretch;
    flex-direction: row;
  }

  html[data-sotido-admin-theme="true"] .admin-health-pill {
    width: 100%;
  }

  html[data-sotido-admin-theme="true"] .admin-node-badges {
    width: 100%;
  }

  html[data-sotido-admin-theme="true"] .admin-node-badge {
    flex: 1 1 112px;
  }

  html[data-sotido-admin-theme="true"] :is(.tabs, .subtabs) {
    display: flex;
    grid-template-columns: none;
    scroll-snap-type: x proximity;
  }

  html[data-sotido-admin-theme="true"] :is(.tab, .subtab) {
    min-height: var(--sotido-space-touch-target);
    scroll-snap-align: start;
  }

  html[data-sotido-admin-theme="true"] :is(.support-threads, .support-thread-view, .reports-sidebar, .reports-detail, .data-sidebar, .data-detail) {
    padding: var(--sotido-space-sm);
  }

  html[data-sotido-admin-theme="true"] .support-shell {
    width: min(calc(100% - 16px), 720px);
    padding-block: var(--sotido-space-sm);
  }

  html[data-sotido-admin-theme="true"] .hero {
    align-items: center;
    flex-direction: row;
    padding: var(--sotido-space-sm) var(--sotido-space-md);
  }

  html[data-sotido-admin-theme="true"] .hero h1 {
    font-size: var(--sotido-type-title);
  }

  html[data-sotido-admin-theme="true"] .module-switcher.sotido-segmented-control {
    width: 100%;
  }

  html[data-sotido-admin-theme="true"] :is(.chat-pane, .report-pane, .chat-sidebar, .reports-sidebar, .moderation-board) {
    border-radius: var(--sotido-radius-card);
  }
}

@media (hover: none) and (pointer: coarse) {
  html[data-sotido-admin-theme="true"] :is(input, select, textarea) {
    font-size: var(--sotido-type-body-large);
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-sotido-admin-theme="true"] *,
  html[data-sotido-admin-theme="true"] *::before,
  html[data-sotido-admin-theme="true"] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
/* Calendar cache is an internal Ops consumer of the existing field recipes. */
.calendar-cache-targets { display: grid; gap: 12px; }
.calendar-cache-fields { display: flex; flex-wrap: wrap; gap: 12px; border: 0; padding: 12px 0; min-width: 0; }
.calendar-cache-fields label { display: flex; align-items: center; gap: 6px; }
.calendar-cache-fields input:not([type="checkbox"]) { width: 160px; }
.calendar-cache-fields input[type="checkbox"] { width: auto; }
#calendarCacheSearch { width: min(100%, 420px); }
