:root {
  --bg: #0a0d14;
  --panel: #111725;
  --panel-alt: #171f31;
  --panel-soft: #0f1521;
  --line: #20293a;
  --line-strong: #31405b;
  --text: #edf2fb;
  --muted: #8f9ab0;
  --accent: #58a6ff;
  --accent-2: #34d399;
  --warn: #f59e0b;
  --danger: #fb7185;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at top, #0f1626, var(--bg) 48%); color: var(--text); font-family: "Segoe UI Variable Text", "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
body { padding: 24px; }

.shell { max-width: 1560px; margin: 0 auto; display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 22px; }
.sidebar, .main-card, .auth-card, .panel { background: rgba(17, 23, 37, 0.95); border: 1px solid var(--line); border-radius: 14px; }
.sidebar { padding: 18px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 24px; height: calc(100vh - 48px); overflow: auto; }
.brand { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.brand h1 { margin: 0; font-size: 1.35rem; line-height: 1.1; }
.brand p, .muted { margin: 0; color: var(--muted); }
.brand-logo-wrap { display: inline-flex; align-items: center; margin-bottom: 10px; }
.brand-logo { width: 40px; height: 40px; display: block; border-radius: 10px; box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22); }
.brand-badge, .status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 0.78rem; color: #d7e4fb; background: rgba(255,255,255,0.03); }
.status-badge.live { color: #c8ffe9; border-color: rgba(52, 211, 153, 0.35); }

.nav-section { display: flex; flex-direction: column; gap: 10px; }
.nav-title { color: #cbd7ee; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.monitor-list { display: flex; flex-direction: column; gap: 10px; }
.monitor-list-sortable[data-sort-state="saving"] { opacity: 0.88; }
.monitor-link {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px 12px 38px;
  background: var(--panel-soft);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}
.monitor-link[data-dragging="1"] {
  opacity: 0.55;
  transform: scale(0.985);
}
.monitor-link[data-drop-before="1"] {
  box-shadow: inset 0 3px 0 rgba(88, 166, 255, 0.92);
  border-color: rgba(88, 166, 255, 0.56);
}
.monitor-link[data-drop-after="1"] {
  box-shadow: inset 0 -3px 0 rgba(88, 166, 255, 0.92);
  border-color: rgba(88, 166, 255, 0.56);
}
.monitor-link.active {
  border-color: rgba(52, 211, 153, 0.72);
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.18), rgba(52, 211, 153, 0.06));
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.22), 0 0 0 1px rgba(52, 211, 153, 0.12);
}
.monitor-drag-handle {
  position: absolute;
  left: 12px;
  top: 12px;
  color: #8ea2c3;
  font-size: 0.92rem;
  letter-spacing: -0.06em;
  cursor: grab;
  user-select: none;
}
.monitor-link[data-dragging="1"] .monitor-drag-handle {
  cursor: grabbing;
}
.monitor-link strong { display: block; font-size: 0.98rem; }
.monitor-meta { margin-top: 6px; color: var(--muted); font-size: 0.83rem; display: flex; justify-content: space-between; gap: 10px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: #d7deec; font-size: 0.76rem; }
.chip.public { color: #baf7d8; border-color: rgba(52, 211, 153, 0.35); }
.chip.shared { color: #d5e8ff; border-color: rgba(88,166,255,0.35); }
.chip.private { color: #f5d0fe; border-color: rgba(232,121,249,0.3); }

.main { display: flex; flex-direction: column; gap: 18px; }
.main-card { padding: 22px; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 16px; }
.topbar h2 { margin: 0; font-size: 1.6rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn, button, input[type=submit] { border: 1px solid var(--line-strong); background: #16233b; color: #f3f8ff; border-radius: 10px; padding: 10px 14px; font: inherit; cursor: pointer; }
.btn.primary, input[type=submit].primary { background: linear-gradient(180deg, #58a6ff, #3f83f8); color: #07101f; border-color: #4e8fe2; font-weight: 600; }
.btn.primary.is-active { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), 0 0 0 1px rgba(88, 166, 255, 0.24); }
.btn.subtle { background: rgba(255,255,255,0.02); }
.btn.danger { background: rgba(251,113,133,0.12); border-color: rgba(251,113,133,0.35); color: #ffd8df; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.graph-grid-single { grid-template-columns: minmax(0, 1fr); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.panel { padding: 18px; }
.panel h3 { margin: 0 0 10px; font-size: 1rem; }
.panel p { margin: 0; color: var(--muted); }
.settings-panel-collapsed {
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(74, 118, 204, 0.26), rgba(30, 50, 92, 0.22)),
    rgba(17, 23, 37, 0.95);
  border-color: rgba(125, 170, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(180, 210, 255, 0.12);
}
.settings-panel-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(115, 166, 255, 0.18), rgba(63, 104, 192, 0.08));
}
.settings-panel-summary::-webkit-details-marker {
  display: none;
}
.settings-panel-summary h3 {
  margin: 0 0 8px;
}
.settings-panel-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.03);
  color: #dce8fb;
  font-size: 1.15rem;
  transition: transform 0.18s ease;
}
.settings-panel-collapsed[open] .settings-panel-chevron {
  transform: rotate(180deg);
}
.settings-panel-body {
  padding: 0 18px 18px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.panel-head h3 { margin-bottom: 0; }
.panel-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.trace-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  column-gap: 12px;
  row-gap: 10px;
}
.trace-panel-head > :first-child {
  min-width: 0;
}
.trace-panel-head .toggle-group,
.trace-panel-head .panel-head-actions {
  flex-wrap: nowrap;
  white-space: nowrap;
}
.trace-panel-head .panel-head-actions .btn,
.trace-panel-head .panel-head-actions .icon-action {
  flex: 0 0 auto;
}
.range-panel {
  margin-bottom: 16px;
}
.range-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.range-field {
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.015));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.range-field label {
  margin-bottom: 4px;
}
.range-field-meta {
  margin-bottom: 10px;
  color: #8ea2c3;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}
.time-range-input {
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #0b1320;
  color: #eef4ff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.time-range-input:focus {
  outline: none;
  border-color: rgba(88, 166, 255, 0.56);
  box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.12);
}
.toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
}
.toggle-pill {
  min-width: 58px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #9fb0cb;
  font-size: 0.8rem;
}
.toggle-pill.is-active {
  background: #223554;
  border-color: #39537f;
  color: #eef5ff;
}
.icon-action {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.03);
  color: #dbe7fb;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 1rem;
}
.nav-action-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nav-action-stack .btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}
.compare-workspace {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.compare-range-panel {
  margin-bottom: 0;
}
.compare-sync-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #dce8fb;
  font-size: 0.86rem;
}
.compare-sync-toggle input {
  width: 16px;
  height: 16px;
}
.compare-range-note {
  margin-top: 12px;
}
.compare-columns-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}
.compare-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(360px, 1fr);
  gap: 16px;
  align-items: start;
}
.compare-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}
.compare-column-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.compare-column-title {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}
.compare-select {
  width: 100%;
}
.compare-column-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.compare-column-meta span {
  color: var(--muted);
  font-size: 0.9rem;
}
.compare-chip-row {
  margin-top: -2px;
}
.compare-graphs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.compare-graph-panel {
  background: rgba(255,255,255,0.02);
}
.compare-chart-shell {
  min-height: 270px;
}
.compare-chart-message {
  min-height: 270px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}
.compare-chart-shell canvas.is-dragging {
  cursor: ew-resize;
}
.compare-column.is-focused,
.compare-graph-panel.is-focused {
  border-color: rgba(88, 166, 255, 0.48);
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.12);
}
.compare-empty-state {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.compare-chart-status {
  color: var(--muted);
  font-size: 0.9rem;
}
.compare-chart-error {
  color: #ffd8df;
  font-size: 0.9rem;
}
.policy-builder {
  margin-bottom: 18px;
}
.policy-sentence-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 14px 16px;
  border: 1px solid rgba(120, 164, 255, 0.22);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(112, 150, 225, 0.08), rgba(30, 42, 70, 0.10));
}
.policy-clauses {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
}
.policy-clause-row,
.policy-outcome-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.policy-clause-row {
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}
.policy-clause-prefix {
  min-width: auto;
}
.policy-clause-text {
  color: #d9e4f5;
  font-size: 0.92rem;
  white-space: nowrap;
}
.policy-field-select {
  min-width: 150px;
  width: auto !important;
  flex: 0 0 auto;
}
.policy-join-select {
  min-width: 86px;
  width: auto !important;
  flex: 0 0 auto;
}
.policy-clause-row input[type="number"],
.policy-outcome-row input[type="number"] {
  width: 88px;
  min-width: 88px;
  flex: 0 0 auto;
}
.policy-clause-row select,
.policy-outcome-row select {
  min-height: 38px;
  width: auto !important;
  flex: 0 0 auto;
}
.policy-sentence-actions {
  display: inline-flex;
  align-items: center;
}
.policy-sentence-actions .btn {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
}
.policy-outcome-row {
  flex: 0 1 auto;
  padding-top: 0;
}
.policy-enabled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #dce8fb;
  padding-left: 0;
  margin-left: 2px;
}
.policy-enabled input[type="checkbox"] {
  width: auto !important;
}
.policy-sections {
  margin-bottom: 18px;
}
.policy-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.policy-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 0.88rem;
}
.policy-card-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.policy-card-actions form {
  margin: 0;
}
.policy-trace-preview {
  overflow: auto;
}
.chart-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 60;
}
.chart-modal-backdrop.is-open {
  display: flex;
}
.chart-modal {
  width: min(1320px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  background: rgba(17, 23, 37, 0.98);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}
.chart-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 12px;
}
.chart-modal-head h3 {
  margin: 8px 0 0;
  font-size: 1.35rem;
}
.chart-modal-shell {
  height: min(72vh, 860px);
  margin-top: 16px;
}
.icon-action.copied {
  color: #c8ffe9;
  border-color: rgba(52, 211, 153, 0.35);
}
.mtr-run-button[data-state="running"] {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.35);
  color: #ffd8df;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-size: 0.86rem; color: #d6e0f1; margin-bottom: 8px; }
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%;
  background: #0e1522;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
.check-grid { display: grid; gap: 10px; }
.check {
  display: flex;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
}
.check input { margin-top: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.stat .label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat .value { margin-top: 6px; font-size: 1.3rem; font-weight: 700; }

.chart-shell {
  position: relative;
  height: 280px;
}
.chart-shell canvas.is-dragging {
  cursor: crosshair;
}
.chart-selection-box {
  position: absolute;
  display: none;
  border: 1px solid rgba(96, 165, 250, 0.95);
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.18), rgba(96, 165, 250, 0.08));
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.14), 0 8px 24px rgba(15, 23, 42, 0.22);
  pointer-events: none;
  z-index: 2;
}
.chart-selection-box.is-visible {
  display: block;
}
.mtr-shell {
  min-height: 0;
  background: #0d1320;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(8px, 0.9vw, 12px);
  overflow: auto;
}
.mtr-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 1110px;
}
.mtr-table th,
.mtr-table td {
  padding: clamp(4px, 0.42vw, 7px) clamp(4px, 0.58vw, 8px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
  font-size: clamp(0.64rem, 0.68vw, 0.82rem);
  line-height: 1.15;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  vertical-align: top;
}
.mtr-table th {
  position: relative;
  user-select: none;
  overflow: visible;
}
.mtr-table th,
.mtr-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}
.mtr-table th:nth-child(2),
.mtr-table td:nth-child(2) {
  white-space: nowrap;
  text-overflow: clip;
}
.mtr-column-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  z-index: 3;
}
.mtr-column-resizer::before {
  content: "";
  position: absolute;
  top: 16%;
  bottom: 16%;
  left: 3px;
  width: 2px;
  border-radius: 999px;
  background: rgba(143, 154, 176, 0.18);
  transition: background 0.16s ease;
}
.mtr-table th:hover .mtr-column-resizer::before,
.mtr-column-resizer.is-active::before {
  background: rgba(88, 166, 255, 0.75);
}
.mtr-shell pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d9e4f5;
  font: 0.88rem/1.5 Consolas, Monaco, monospace;
}

.flash { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 16px; }
.flash.error { background: rgba(251,113,133,0.1); color: #ffd9e1; border-color: rgba(251,113,133,0.35); }
.flash.success { background: rgba(52,211,153,0.1); color: #d0ffeb; border-color: rgba(52,211,153,0.35); }

.auth-wrap { min-height: calc(100vh - 48px); display: grid; place-items: center; }
.auth-card { width: min(1040px, 100%); overflow: hidden; display: grid; grid-template-columns: 1.1fr 0.9fr; }
.auth-visual { padding: 36px; background:
  radial-gradient(circle at top right, rgba(88,166,255,0.35), transparent 32%),
  linear-gradient(180deg, #10192b, #0a0f19);
  border-right: 1px solid var(--line);
}
.auth-form { padding: 36px; }
.auth-visual h1, .auth-form h2 { margin: 0 0 12px; }
.auth-visual p { color: #c7d3ea; max-width: 36rem; line-height: 1.6; }
.feature-list { margin: 18px 0 0; padding-left: 18px; color: #d5dff0; line-height: 1.9; }
.auth-login-panel { max-width: 460px; }
.auth-copy { line-height: 1.6; }
.auth-login-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.auth-link-button { color: #dce9ff; }
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 13, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
}
.auth-modal-backdrop.is-open { display: flex; }
.auth-modal {
  width: min(520px, 100%);
  background: #101826;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}
.auth-modal-wide {
  width: min(720px, 100%);
}
.add-host-trigger {
  width: 100%;
  justify-content: center;
}
.add-host-trigger.is-disabled {
  opacity: 0.72;
  cursor: not-allowed;
  filter: saturate(0.72);
}
.admin-limit-input {
  width: 92px;
}
.auth-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 10px;
}
.auth-modal-close {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  color: #d5e3fa;
  font-size: 1.4rem;
  line-height: 1;
}

.detail-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 18px; }
.detail-head h3 { margin: 0; font-size: 1.5rem; }
.subline { color: var(--muted); margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; }
.share-field { display: flex; gap: 10px; }
.share-field input { flex: 1; }
.admin-summary-grid,
.admin-grid {
  margin-top: 16px;
}
.admin-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-summary-card {
  min-height: 180px;
  background:
    radial-gradient(circle at top right, rgba(88, 166, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
}
.admin-summary-value {
  margin: 8px 0 10px;
  font-size: 2rem;
  font-weight: 700;
  color: #eef5ff;
}
.admin-panel {
  overflow: hidden;
}
.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 12, 21, 0.46);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
  vertical-align: top;
}
.admin-table th {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a9b9d4;
  background: rgba(255,255,255,0.03);
}
.admin-table td {
  color: #e5edf9;
}
.admin-inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}
.admin-inline-form input[type=password] {
  min-width: 150px;
}
.admin-open-link {
  white-space: nowrap;
}
.admin-delete-user-button {
  white-space: nowrap;
}
.admin-delete-protected {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

@media (max-width: 1180px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .grid-3, .grid-2, .stat-grid, .form-grid, .auth-card, .range-grid { grid-template-columns: 1fr; }
  .compare-columns {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: 1fr;
  }
  .policy-clause-row,
  .policy-outcome-row {
    align-items: stretch;
  }
  .policy-sentence-card,
  .policy-clauses {
    align-items: stretch;
  }
  .policy-clause-row {
    border-radius: 16px;
  }
  .auth-login-panel { max-width: none; }
  .panel-head { align-items: start; flex-direction: column; }
  .trace-panel-head {
    display: flex;
    grid-template-columns: none;
  }
  .mtr-shell {
    overflow-x: hidden;
  }
  .mtr-table th,
  .mtr-table td {
    font-size: 0.68rem;
    padding: 4px 5px;
  }
}
