:root {
  --bg: #f3efee;
  --bg-soft: #faf7f5;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --panel-muted: rgba(255, 255, 255, 0.68);
  --sidebar: linear-gradient(180deg, #0d223d 0%, #071a30 100%);
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --text: #162033;
  --muted: #6f7b90;
  --line: rgba(22, 32, 51, 0.08);
  --accent: #bb5b32;
  --accent-dark: #984320;
  --accent-soft: rgba(187, 91, 50, 0.12);
  --blue: #2b6cb4;
  --blue-soft: rgba(43, 108, 180, 0.14);
  --cyan: #4e93be;
  --cyan-soft: rgba(78, 147, 190, 0.14);
  --mint: #5ea7a2;
  --mint-soft: rgba(94, 167, 162, 0.14);
  --amber: #d8994a;
  --amber-soft: rgba(216, 153, 74, 0.16);
  --live: #1f9d78;
  --live-soft: rgba(31, 157, 120, 0.12);
  --danger: #be4f44;
  --danger-soft: rgba(190, 79, 68, 0.14);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --shadow-lg: 0 26px 60px rgba(17, 28, 45, 0.08);
  --shadow-md: 0 16px 34px rgba(17, 28, 45, 0.08);
  --shadow-sm: 0 10px 24px rgba(17, 28, 45, 0.05);
}

body[data-theme="dark"] {
  --bg: #0d1420;
  --bg-soft: #121b29;
  --panel: rgba(17, 25, 37, 0.88);
  --panel-strong: rgba(19, 29, 43, 0.96);
  --panel-muted: rgba(24, 36, 52, 0.82);
  --text: #edf3ff;
  --muted: #99a7bd;
  --line: rgba(110, 138, 175, 0.22);
  --accent-soft: rgba(187, 91, 50, 0.2);
  --blue-soft: rgba(43, 108, 180, 0.22);
  --cyan-soft: rgba(78, 147, 190, 0.22);
  --mint-soft: rgba(94, 167, 162, 0.22);
  --amber-soft: rgba(216, 153, 74, 0.22);
  --live-soft: rgba(31, 157, 120, 0.2);
  --danger-soft: rgba(190, 79, 68, 0.2);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(78, 147, 190, 0.16), transparent 22%),
    radial-gradient(circle at right center, rgba(187, 91, 50, 0.12), transparent 24%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

h1,
h2,
h3,
.sidebar-brand strong,
.hero-copy h2,
.auth-copy h1 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
}

.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 20px;
  min-height: 100vh;
  padding: 18px;
}

.sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-content: start;
  gap: 24px;
  min-height: calc(100vh - 36px);
  padding: 24px 20px;
  border-radius: var(--radius-xl);
  color: #eff5ff;
  background:
    radial-gradient(circle at top right, rgba(94, 167, 162, 0.22), transparent 28%),
    radial-gradient(circle at bottom left, rgba(187, 91, 50, 0.18), transparent 24%),
    var(--sidebar);
  box-shadow: var(--shadow-lg);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 4px;
}

.brand-orb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 34%, #ffd7a1 0 22%, #ff9d42 24% 48%, #1a75b3 52% 100%);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.08);
}

.sidebar-brand strong,
.sidebar-brand small,
.operator-chip strong,
.operator-chip small {
  display: block;
}

.sidebar-brand small,
.operator-chip small {
  color: rgba(239, 245, 255, 0.72);
}

.sidebar-nav {
  display: grid;
  gap: 10px;
  align-content: start;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 18px;
  color: rgba(239, 245, 255, 0.88);
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.nav-link::after {
  content: "›";
  margin-left: auto;
  opacity: 0;
  transform: translateX(-4px);
  transition: inherit;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active {
  transform: translateX(4px);
  color: #fff;
  border-color: var(--sidebar-border);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link.active::after {
  opacity: 0.75;
  transform: translateX(0);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-refresh-form {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.sidebar-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #eff5ff;
  box-shadow: none;
}

.sidebar-theme-toggle:hover,
.sidebar-theme-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

.sidebar-refresh-form select {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #eff5ff;
}

.theme-glyph {
  font-size: 1.2rem;
  line-height: 1;
}

.workspace,
.workspace-content,
.page-grid,
.dashboard-stack,
.dashboard-feed,
.editor-main-stack,
.editor-rail,
.stack-list,
.auth-points,
.profile-grid,
.group-editor,
.editor-screen {
  display: grid;
  gap: 18px;
  align-content: start;
}

[data-live-region] {
  display: grid;
  gap: 18px;
  min-width: 0;
  align-content: start;
}

.workspace-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 24px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
}

.workspace-copy {
  display: grid;
  gap: 4px;
  max-width: 760px;
}

.workspace-title-row,
.workspace-actions,
.section-head,
.action-row,
.toolbar-form,
.summary-grid,
.quick-stats,
.hero-inline-stats,
.filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.action-row-tight {
  gap: 8px;
}

.workspace-copy h1,
.workspace-copy p {
  margin: 0;
}

.workspace-copy h1 {
  font-size: clamp(1.9rem, 2.8vw, 2.6rem);
}

.workspace-subtitle,
.muted,
.empty-state p,
.confirm-shell p,
.metric-caption,
.inline-meta {
  color: var(--muted);
}

.workspace-subtitle {
  max-width: 560px;
  margin-top: 6px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
}

.workspace-actions {
  justify-content: flex-end;
  align-self: center;
}

.operator-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.operator-chip:hover,
.operator-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(43, 108, 180, 0.2);
  box-shadow: var(--shadow-sm);
}

.operator-chip small {
  color: var(--muted);
}

.operator-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(43, 108, 180, 0.22), rgba(94, 167, 162, 0.18));
  color: var(--blue);
  font-weight: 800;
}

.operator-avatar-image {
  object-fit: cover;
  overflow: hidden;
}

.flash-stack {
  display: grid;
  gap: 10px;
}

.flash {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  box-shadow: var(--shadow-sm);
}

.flash.success {
  border-color: rgba(31, 157, 120, 0.18);
  color: #0f7357;
}

.flash.error {
  border-color: rgba(190, 79, 68, 0.18);
  color: #9f3d35;
}

body[data-theme="dark"] .flash.success {
  color: #72dfbd;
}

body[data-theme="dark"] .flash.error {
  color: #ff9d8f;
}

.surface {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.hero-surface,
.toolbar-surface,
.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-surface-compact {
  align-items: flex-end;
}

.hero-copy h2,
.surface h2,
.surface h3 {
  margin: 0;
}

.hero-copy h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.hero-inline-stats {
  justify-content: flex-end;
}

.container-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.container-status-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-muted);
}

.container-status-card strong,
.container-status-card small {
  display: block;
}

.hero-stat,
.quick-stats div,
.summary-grid article,
.domain-card {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-muted);
}

.hero-stat span,
.quick-stats span,
.summary-grid span,
.mini-list strong,
.rank-item small {
  display: block;
}

.hero-stat strong,
.quick-stats strong,
.summary-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1.2rem;
}

.metric-grid,
.dashboard-main-grid,
.dashboard-dual-grid,
.dashboard-overview-grid,
.editor-workspace {
  display: grid;
  gap: 18px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-grid-compact .metric-tile {
  min-height: 214px;
}

.dashboard-main-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.78fr);
  align-items: start;
}

.dashboard-dual-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.78fr);
  align-items: start;
}

.dashboard-overview-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  align-items: start;
}

.editor-workspace {
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.9fr);
  align-items: start;
}

.profile-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
  align-items: start;
}

.system-top-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.system-card {
  display: grid;
  gap: 16px;
  height: 100%;
  align-content: start;
}

.system-card-body {
  display: grid;
  gap: 16px;
  align-content: start;
  height: 100%;
}

.system-cert-form {
  grid-template-columns: 1fr;
}

.system-cert-form input[type="file"] {
  width: 100%;
}

.system-cert-progress {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 72px;
  background: rgba(10, 16, 26, 0.32);
  backdrop-filter: blur(4px);
}

.system-cert-progress[hidden] {
  display: none !important;
}

.system-cert-progress-bar {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  width: min(860px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(34, 35, 40, 0.88);
  color: #f5f7fb;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

.system-cert-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: cert-spin 0.8s linear infinite;
}

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

.full-span {
  grid-column: 1 / -1;
}

.metric-tile {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 6px;
}

.metric-tile::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -26px;
  width: 110px;
  height: 110px;
  border-radius: 28px;
  opacity: 0.55;
  transform: rotate(12deg);
}

.metric-label {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
}

.metric-tile strong {
  display: block;
  margin: 10px 0 6px;
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
}

.metric-caption {
  margin: 0;
}

.metric-sparkline {
  min-height: 128px;
  margin-top: auto;
}

.accent-blue::after {
  background: linear-gradient(180deg, rgba(43, 108, 180, 0.3), rgba(43, 108, 180, 0));
}

.accent-cyan::after {
  background: linear-gradient(180deg, rgba(78, 147, 190, 0.3), rgba(78, 147, 190, 0));
}

.accent-amber::after {
  background: linear-gradient(180deg, rgba(216, 153, 74, 0.3), rgba(216, 153, 74, 0));
}

.accent-mint::after {
  background: linear-gradient(180deg, rgba(94, 167, 162, 0.3), rgba(94, 167, 162, 0));
}

.traffic-surface,
.summary-card,
.preview-card,
.side-feed,
.auth-panel {
  display: grid;
  gap: 18px;
}

.traffic-line-surface {
  min-height: 420px;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-stats-compact div {
  min-height: 94px;
}

.rank-list,
.mini-list,
.domain-card-grid {
  display: grid;
  gap: 10px;
}

.rank-item,
.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-muted);
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
}

.domain-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.domain-card strong {
  display: block;
  word-break: break-word;
}

.domain-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff7f0;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
  box-shadow: 0 12px 24px rgba(187, 91, 50, 0.22);
}

.button:hover,
button:hover,
.button:focus-visible,
button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(187, 91, 50, 0.24);
}

.button.ghost {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: none;
}

.button.ghost:hover,
.button.ghost:focus-visible {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-sm);
}

.button.ghost.is-active {
  border-color: rgba(43, 108, 180, 0.28);
  background: rgba(43, 108, 180, 0.08);
  color: var(--blue);
}

body[data-theme="dark"] .button.ghost:hover,
body[data-theme="dark"] .button.ghost:focus-visible {
  background: rgba(31, 43, 61, 0.98);
}

.button.danger {
  background: linear-gradient(135deg, #cb5d4c 0%, #a53f34 100%);
  box-shadow: 0 12px 24px rgba(190, 79, 68, 0.24);
}

.button.wide {
  width: 100%;
}

.button.slim {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.92rem;
}

.button.is-disabled,
.button[aria-disabled="true"],
.button:disabled {
  pointer-events: none;
  opacity: 0.5;
  box-shadow: none;
}

.text-link {
  color: var(--accent-dark);
  font-weight: 700;
}

body[data-theme="dark"] .text-link {
  color: #f2c299;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(22, 32, 51, 0.1);
  border-radius: 16px;
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

body[data-theme="dark"] input,
body[data-theme="dark"] textarea,
body[data-theme="dark"] select {
  background: rgba(15, 22, 33, 0.94);
  border-color: rgba(153, 167, 189, 0.16);
}

input:hover,
textarea:hover,
select:hover {
  border-color: rgba(43, 108, 180, 0.24);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(43, 108, 180, 0.42);
  box-shadow: 0 0 0 4px rgba(43, 108, 180, 0.1);
  transform: translateY(-1px);
}

input.is-invalid,
textarea.is-invalid,
select.is-invalid {
  border-color: rgba(190, 79, 68, 0.62);
  box-shadow: 0 0 0 4px rgba(190, 79, 68, 0.12);
}

.field-error {
  color: var(--danger);
  font-size: 0.82rem;
  line-height: 1.35;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-muted);
}

.toggle-field input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.field-caption {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.inherited-policy-panel,
.inherited-policy-section,
.list-editor {
  display: grid;
  gap: 12px;
}

.inherited-policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.readonly-rule-list {
  display: grid;
  gap: 10px;
}

.readonly-rule,
.readonly-rule-empty {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-muted);
}

.readonly-rule {
  display: flex;
  align-items: center;
  font-weight: 600;
  word-break: break-word;
}

.readonly-rule-empty {
  color: var(--muted);
}

.list-editor-items {
  display: grid;
  gap: 10px;
}

.list-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.list-editor[data-columns="2"] .list-editor-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.list-editor-row [data-row-control] {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 14px;
  font-size: 1.2rem;
  line-height: 1;
}

.list-editor-row [data-row-control].is-add {
  color: var(--live);
  border-color: rgba(38, 163, 118, 0.28);
}

.list-editor-row .field-error {
  grid-column: 1 / -1;
}

.danger-text {
  color: var(--danger);
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
}

.setting-field {
  display: grid;
  gap: 10px;
}

.nested-surface {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.48);
}

body[data-theme="dark"] .nested-surface {
  background: rgba(20, 30, 44, 0.48);
}

.setting-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.setting-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.info-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0;
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.info-badge:hover,
.info-badge:focus-visible,
.info-badge.is-open {
  color: var(--blue);
  border-color: rgba(59, 130, 246, 0.32);
  background: rgba(59, 130, 246, 0.08);
  transform: translateY(-1px);
}

.app-info-tooltip {
  position: fixed;
  z-index: 80;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-line;
  pointer-events: none;
}

body[data-theme="dark"] .app-info-tooltip {
  background: rgba(15, 24, 39, 0.96);
}

.app-info-tooltip[hidden] {
  display: none;
}

.logging-disabled-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-pill.live,
.status-pill.online {
  color: var(--live);
  background: var(--live-soft);
}

.status-pill.muted,
.status-pill.offline {
  color: var(--muted);
  background: rgba(111, 123, 144, 0.12);
}

.status-pill.blocked {
  color: var(--danger);
  background: var(--danger-soft);
}

.section-head {
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-head.tight,
.compact-head {
  margin-bottom: 0;
}

.table-wrap {
  overflow: auto;
  padding-bottom: 2px;
}

.table-wrap-scroll {
  max-height: 100%;
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.compact-table thead th {
  padding-top: 4px;
}

.table thead th {
  padding: 0 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table-head-cell {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.table-sort-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-sort-button {
  min-height: 30px;
  min-width: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-strong);
  color: var(--muted);
  box-shadow: none;
  font-size: 0.82rem;
}

.table-sort-button.is-active {
  color: var(--blue);
  border-color: rgba(43, 108, 180, 0.24);
  background: rgba(43, 108, 180, 0.08);
}

.table-filter-input {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.86rem;
  text-transform: none;
  letter-spacing: normal;
}

.table-actions-head {
  white-space: nowrap;
}

.filter-popover {
  position: relative;
}

.filter-popover summary {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(22, 32, 51, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  cursor: pointer;
  list-style: none;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.86rem;
}

body[data-theme="dark"] .filter-popover summary {
  background: rgba(15, 22, 33, 0.94);
  border-color: rgba(153, 167, 189, 0.16);
}

.filter-popover summary::-webkit-details-marker {
  display: none;
}

.filter-popover summary::after {
  content: "▾";
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.75rem;
}

.filter-popover[open] summary::after {
  content: "▴";
}

.filter-popover-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 5;
  display: grid;
  gap: 8px;
  min-width: 220px;
  max-height: 260px;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-md);
}

body[data-theme="dark"] .filter-popover-menu {
  background: rgba(19, 29, 43, 0.98);
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px;
  font-weight: 500;
}

.filter-check input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.filter-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.table tbody td {
  padding: 15px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  min-height: 70px;
}

.table tbody tr[hidden] {
  display: none;
}

.table tbody td strong,
.table tbody td small {
  display: block;
}

.table tbody td small {
  margin-top: 4px;
  color: var(--muted);
}

.table-status-col {
  width: 168px;
  min-width: 168px;
}

.latency-chip {
  display: inline-block;
  min-width: 104px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.inline-meta {
  font-size: 0.92rem;
}

.cell-domain {
  min-width: 320px;
  max-width: 0;
  word-break: break-word;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 200px;
}

.table-actions form {
  margin: 0;
}

.table tbody tr[data-href] {
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.table tbody tr[data-href]:hover,
.table tbody tr[data-href]:focus-within {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 0 0 1px rgba(43, 108, 180, 0.06);
}

body[data-theme="dark"] .table tbody tr[data-href]:hover,
body[data-theme="dark"] .table tbody tr[data-href]:focus-within {
  background: rgba(31, 43, 61, 0.74);
}

.table tbody tr[data-href]:hover td:first-child strong {
  color: var(--blue);
}

.compact-inline-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.limit-inline-form {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  margin-top: 14px;
}

.limit-inline-unit {
  align-self: center;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.users-toolbar {
  grid-template-columns: minmax(260px, 1fr) 180px auto;
  margin: 18px 0 14px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.compact-inline-form label {
  min-width: 0;
}

.logs-top-grid {
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  justify-content: start;
  align-items: stretch;
}

.limit-meta {
  display: grid;
  gap: 4px;
  margin-top: 14px;
}

.limit-meta strong,
.limit-meta small {
  display: block;
}

.limit-meta small {
  color: var(--muted);
}

.editor-rail {
  position: sticky;
  top: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.status-summary-head {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.action-stack {
  display: grid;
  gap: 10px;
}

.code-preview {
  margin: 0;
  padding: 18px;
  min-height: 280px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(13, 21, 38, 0.95), rgba(22, 32, 51, 0.98));
  color: #f7ecdd;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
  line-height: 1.55;
}

.side-feed .mini-list + .mini-list {
  margin-top: 10px;
}

.danger-zone {
  border-color: rgba(190, 79, 68, 0.18);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 245, 243, 0.94));
}

body[data-theme="dark"] .danger-zone {
  background: linear-gradient(135deg, rgba(46, 22, 25, 0.82), rgba(34, 24, 26, 0.92));
}

.confirm-dialog {
  width: min(460px, calc(100vw - 40px));
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: transparent;
}

.confirm-dialog::backdrop {
  background: rgba(12, 18, 31, 0.5);
  backdrop-filter: blur(6px);
}

.confirm-shell {
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 28px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-lg);
}

.confirm-actions {
  display: grid;
  gap: 12px;
}

.confirm-action {
  margin: 0;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 160px;
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.52);
}

body[data-theme="dark"] .empty-state {
  background: rgba(17, 25, 37, 0.52);
}

.empty-state.small {
  min-height: 110px;
}

.line-chart-shell {
  position: relative;
  padding-bottom: 2px;
}

.line-chart {
  width: 100%;
  min-height: 220px;
}

.line-chart.large {
  min-height: 320px;
}

.icmp-uptime-grid {
  margin-top: 18px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: visible;
}

.icmp-uptime-tile {
  min-height: 0;
}

.icmp-uptime-tile .metric-label {
  font-size: 1.08rem;
}

.metric-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.icmp-logs-stack {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.icmp-user-card .line-chart {
  margin-top: 18px;
}

.line-chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid-line {
  stroke: rgba(153, 167, 189, 0.18);
  stroke-width: 1;
  stroke-dasharray: 4 6;
}

.chart-axis-label {
  fill: var(--muted);
  font-size: 10px;
}

.chart-axis-y-label {
  fill: var(--muted);
  font-size: 9px;
}

.chart-axis-line {
  stroke: rgba(153, 167, 189, 0.28);
  stroke-width: 1;
}

.chart-line {
  filter: drop-shadow(0 8px 14px rgba(14, 27, 45, 0.16));
}

.chart-hover-line {
  stroke: rgba(153, 167, 189, 0.5);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.chart-hover-dot {
  stroke: rgba(255, 255, 255, 0.78);
  stroke-width: 1.5;
}

.line-chart-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 120px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  font-size: 0.74rem;
}

.line-chart-tooltip strong,
.line-chart-tooltip span {
  display: block;
}

.line-chart-tooltip strong {
  font-size: 0.74rem;
}

.line-chart-tooltip span {
  font-size: 0.72rem;
}

.line-chart-tooltip span + span {
  margin-top: 4px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 100px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 18px;
}

.dashboard-users-surface {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 520px;
}

.dashboard-users-scroll {
  max-height: 640px;
  overflow: auto;
}

.dashboard-events-scroll {
  max-height: 320px;
}

.dashboard-events-surface {
  min-height: 0;
}

.page-grid-fill {
  min-height: calc(100vh - 210px);
}

.page-grid-fill > [data-live-region] {
  min-height: inherit;
  grid-template-rows: auto minmax(0, 1fr);
}

.fill-surface {
  min-height: 0;
}

.toolbar-surface-compact {
  padding-block: 18px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-layout {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
  gap: 24px;
  align-items: center;
}

.auth-copy {
  display: grid;
  gap: 16px;
  padding: 36px;
}

.auth-copy h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
}

.auth-points {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-points div {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.56);
}

body[data-theme="dark"] .auth-points div {
  background: rgba(24, 36, 52, 0.66);
}

@media (max-width: 1440px) {
  .dashboard-main-grid,
  .dashboard-dual-grid,
  .dashboard-overview-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.9fr);
  }

  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1320px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .system-top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .icmp-uptime-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .app-shell,
  .editor-workspace,
  .dashboard-main-grid,
  .dashboard-dual-grid,
  .dashboard-overview-grid,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .editor-rail {
    position: static;
  }

  .auth-points {
    grid-template-columns: 1fr;
  }

  .inherited-policy-grid,
  .password-field {
    grid-template-columns: 1fr;
  }

  .dashboard-users-surface {
    grid-row: auto;
    min-height: 0;
  }

  .dashboard-users-scroll,
  .dashboard-events-scroll {
    max-height: none;
  }
}

@media (max-width: 920px) {
  .app-shell {
    padding: 14px;
    gap: 14px;
  }

  .workspace-bar,
  .surface,
  .sidebar {
    padding: 18px;
  }

  .workspace-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .workspace-bar {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .summary-grid,
  .quick-stats,
  .form-grid,
  .domain-card-grid,
  .compact-inline-form,
  .users-toolbar {
    grid-template-columns: 1fr;
  }

  .logs-top-grid {
    grid-template-columns: 1fr;
  }

  .system-top-grid {
    grid-template-columns: 1fr;
  }

  .icmp-uptime-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-summary-head {
    justify-items: start;
  }

  .toolbar-form {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .workspace-title-row {
    align-items: flex-start;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .icmp-uptime-grid {
    grid-template-columns: 1fr;
  }

  .table {
    min-width: 720px;
  }
}
