:root {
  color-scheme: dark;
  --bg: #0a0f18;
  --bg-soft: #0d1320;
  --bg-elevated: #0f172a;
  --bg-subtle: #111b2d;
  --bg-panel: rgba(255, 255, 255, 0.028);
  --bg-panel-strong: rgba(255, 255, 255, 0.04);
  --line: rgba(148, 163, 184, 0.1);
  --line-strong: rgba(148, 163, 184, 0.18);
  --text: #e5edf8;
  --text-soft: #c6d1df;
  --muted: #8a98ad;
  --muted-soft: #64748b;
  --accent: #93c5fd;
  --accent-strong: #e2e8f0;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg); }
body {
  font-family: Inter, "SF Pro Display", "PingFang SC", sans-serif;
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.06), transparent 26%), var(--bg);
  color: var(--text);
}
button, input, textarea, select { font: inherit; }
a { color: inherit; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(147, 197, 253, 0.08);
  color: var(--accent);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -44px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent-strong);
  color: #0f172a;
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus { top: 12px; }

.console-body { min-height: 100vh; }
.app-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 15, 24, 0.9);
  backdrop-filter: blur(18px);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.14);
}
.topbar-brand strong,
.topbar-brand span { display: block; }
.topbar-brand strong { font-size: 13px; font-weight: 650; color: #f8fafc; }
.topbar-brand span { font-size: 12px; color: var(--muted-soft); }
.topbar-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.topbar-chip {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  font-size: 12px;
}
.topbar-chip:first-child {
  color: var(--text-soft);
  border-color: rgba(147, 197, 253, 0.16);
  background: rgba(147, 197, 253, 0.08);
}

.workspace-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 288px;
  min-height: calc(100vh - 58px);
}
body[data-section="accounts"] .workspace-shell,
body[data-section="aliases"] .workspace-shell,
body[data-section="mail"] .workspace-shell,
body[data-section="history"] .workspace-shell {
  grid-template-columns: 240px minmax(0, 1fr);
}
body[data-section="accounts"] .context-rail,
body[data-section="aliases"] .context-rail,
body[data-section="mail"] .context-rail,
body[data-section="history"] .context-rail {
  display: none;
}
.workspace-nav,
.context-rail {
  background: var(--bg-soft);
}
.workspace-nav {
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: grid;
  align-content: start;
  gap: 16px;
}
.workspace-nav-head {
  padding: 10px 10px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}
.workspace-nav-head h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.workspace-nav-head p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted-soft);
}
.workspace-nav-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}
.nav-summary,
.context-panel,
.panel,
.auth-card,
.toast {
  border: 1px solid var(--line);
  background: var(--bg-panel);
}
.auth-panel,
.toast {
  box-shadow: var(--shadow);
}
.nav-summary {
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
}
.nav-summary h2 {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-soft);
}
.nav-summary p {
  margin: 0;
  font-size: 12px;
  color: var(--muted-soft);
  line-height: 1.55;
}

.nav { display: grid; gap: 6px; }
.nav--stack { align-content: start; }
.nav-item,
.ghost-button,
.primary-button,
.danger-button,
.context-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
  touch-action: manipulation;
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.nav-item:hover,
.ghost-button:hover,
.primary-button:hover,
.danger-button:hover,
.context-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}
.nav-item:disabled,
.ghost-button:disabled,
.primary-button:disabled,
.danger-button:disabled,
.context-button:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}
.nav-item:disabled:hover,
.ghost-button:disabled:hover,
.primary-button:disabled:hover,
.danger-button:disabled:hover,
.context-button:disabled:hover {
  transform: none;
  border-color: var(--line);
}
.nav-item:focus-visible,
.ghost-button:focus-visible,
.primary-button:focus-visible,
.danger-button:focus-visible,
.context-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.skip-link:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.18);
  border-color: rgba(147, 197, 253, 0.4);
}
.nav-item {
  justify-content: flex-start;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
}
.nav-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
}
.nav-item.active {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  border-color: var(--line-strong);
}
.nav-item.active .nav-item-dot { background: #60a5fa; }
.primary-button {
  background: var(--accent-strong);
  color: #0f172a;
  border-color: transparent;
  font-weight: 650;
}
.ghost-button { background: rgba(255, 255, 255, 0.04); }
.danger-button {
  color: var(--danger);
  background: rgba(251, 113, 133, 0.06);
}
.full-width { width: 100%; }

.workspace-main {
  background: var(--bg-elevated);
  padding: 18px 22px 24px;
}
.workspace-main-inner {
  display: grid;
  align-content: start;
}
.context-rail {
  border-left: 1px solid var(--line);
  padding: 22px 16px;
}
.context-rail-content {
  position: sticky;
  top: 80px;
  display: grid;
  gap: 12px;
}
.context-panel {
  border-radius: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.context-rail-content > .context-panel {
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}
.context-rail-content > .context-panel:first-child {
  padding-top: 0;
  border-top: 0;
}
.context-panel h3 {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-soft);
}
.context-buttons,
.actions,
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.context-button {
  width: 100%;
  justify-content: flex-start;
  display: flex;
  align-items: center;
}
.context-metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.06);
  font-size: 12px;
  color: var(--muted);
}
.context-metric:first-of-type { border-top: 0; padding-top: 0; }
.context-metric strong {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  text-align: right;
}
.context-list {
  display: grid;
  gap: 10px;
}
.context-list-item {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.06);
}
.context-list-item:first-child { border-top: 0; padding-top: 0; }
.context-list-item strong {
  font-size: 12px;
  color: var(--text-soft);
}
.context-list-item span,
.context-note {
  font-size: 12px;
  color: var(--muted-soft);
  line-height: 1.55;
}

.panel-section { display: none; }
.panel-section.active { display: block; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.page-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.page-head h2 {
  margin: 0;
  font-size: clamp(22px, 2.8vw, 30px);
  letter-spacing: -0.03em;
}
.page-description {
  margin: 8px 0 0;
  max-width: 720px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.panel,
.auth-panel,
.auth-card {
  border-radius: 16px;
}
.priority-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  padding: 0 0 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}
.priority-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}
.priority-strip h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.03em;
}
.priority-strip-main p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.priority-strip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-self: center;
}
.priority-chip {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  background: rgba(255, 255, 255, 0.03);
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-soft);
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 14px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.018);
}
.stat-item {
  padding: 14px 16px 15px;
  display: grid;
  gap: 6px;
  border-right: 1px solid rgba(148, 163, 184, 0.08);
}
.stat-item:last-child { border-right: 0; }
.stat-item--warning {
  background: rgba(251, 191, 36, 0.035);
}
.stat-label {
  font-size: 12px;
  color: var(--muted-soft);
}
.stat-value {
  font-size: clamp(24px, 2.8vw, 32px);
  letter-spacing: -0.05em;
  font-weight: 750;
}
.stat-value--small {
  font-size: 24px;
  letter-spacing: -0.03em;
}
.stat-meta {
  font-size: 12px;
  color: var(--muted);
}

.content-grid {
  display: grid;
  gap: 14px;
}
.content-grid--overview {
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
}
.content-grid--split {
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  align-items: start;
}
.content-grid--aliases {
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
}
.content-grid--settings {
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.014);
  overflow: hidden;
  box-shadow: none;
}
.panel--full {
  width: 100%;
}
.panel--soft {
  background: rgba(255, 255, 255, 0.02);
}
.panel--tool {
  background: rgba(255, 255, 255, 0.025);
}
.panel--ledger {
  background: transparent;
}
.panel--sticky {
  position: sticky;
  top: 80px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
}
.panel-head h3 {
  margin: 0;
  font-size: 15px;
  color: var(--text-soft);
}
.panel-head p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted-soft);
  line-height: 1.55;
}
.panel-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(147, 197, 253, 0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.stack-form {
  display: grid;
  gap: 14px;
  padding: 14px 16px 16px;
}
.settings-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}
.settings-ledger {
  display: grid;
  gap: 14px;
  align-content: start;
}
.stack-form label {
  display: grid;
  gap: 6px;
}
label span {
  font-size: 12px;
  color: var(--muted);
}
input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
}
input::placeholder,
textarea::placeholder { color: #607086; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 16px 16px;
}
.toolbar--wide > input {
  flex: 1 1 280px;
}
.toolbar--wide > button,
.toolbar--wide > select {
  flex: 0 0 auto;
}

.command-shelf {
  margin: 0 16px 16px;
  padding: 14px 16px 16px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.command-shelf-head {
  margin-bottom: 12px;
}
.command-shelf-head h3 {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
}
.command-shelf-head p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.command-shelf-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 10px;
  align-items: end;
}
.command-shelf-grid label {
  display: grid;
  gap: 6px;
}
.detail-list {
  display: grid;
  gap: 0;
  padding: 0 16px 16px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.06);
}
.detail-row:first-child {
  border-top: 0;
}
.detail-list--compact {
  padding-top: 0;
}
.detail-row span {
  font-size: 12px;
  color: var(--muted);
}
.inline-link {
  color: var(--accent);
  text-decoration: none;
}
.inline-link:hover {
  color: #bfdbfe;
}
.detail-row strong {
  font-size: 12px;
  color: var(--text-soft);
  text-align: right;
}
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 16px 16px;
}
.secret-panel {
  margin: 0 16px 16px;
  padding: 14px 16px 16px;
  border-radius: 16px;
  border: 1px solid rgba(251, 191, 36, 0.18);
  background: rgba(251, 191, 36, 0.05);
}
.secret-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.secret-panel-head strong {
  display: block;
  font-size: 14px;
  color: var(--text-soft);
}
.secret-panel-head p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}
.secret-code {
  display: block;
  width: 100%;
  overflow: auto;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(4, 9, 15, 0.34);
  color: #f8fafc;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
  margin-bottom: 12px;
}
.secret-code--inline {
  display: inline-flex;
  width: auto;
  margin: 6px 0 0;
  padding: 8px 10px;
}
.secret-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.secret-list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}
.secret-list-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.table-wrap {
  overflow: auto;
  padding: 0 16px 14px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.table th,
.table td {
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}
.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 11px;
  color: #5f7087;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: transparent;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}
.table tbody td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.table-primary {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-soft);
}
.table-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted-soft);
}
.table-inline-input {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}
.table-actions { justify-content: flex-end; }
.actions--tight {
  gap: 8px;
  display: flex;
  flex-wrap: wrap;
}
.table-actions .ghost-button,
.table-actions .danger-button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
}
.mail-open-trigger {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.mail-open-trigger .table-primary,
.mail-open-trigger .table-meta {
  display: block;
}
.mail-open-trigger:hover .table-primary {
  color: #dbeafe;
}

.modal-layer {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
}
.modal-layer.is-open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 9, 15, 0.68);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: #0f1726;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
}
.modal-card--mail {
  width: min(880px, calc(100vw - 40px));
}
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}
.modal-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.modal-head h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}
.modal-head p {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.modal-head--mail {
  align-items: flex-end;
}
.modal-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.mail-detail-meta {
  margin-top: 8px;
  color: var(--muted-soft);
}
.modal-close {
  min-width: 76px;
}
.modal-form {
  padding-top: 16px;
}
.modal-actions {
  justify-content: flex-end;
}
.mail-detail-viewer {
  padding: 16px 18px 18px;
}
.mail-detail-inline-codes {
  margin-bottom: 12px;
}
.mail-detail-body {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  line-height: 1.72;
  color: var(--muted);
  word-break: break-word;
}
.mail-detail-frame {
  width: 100%;
  min-height: min(72vh, 760px);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  background: #ffffff;
}
.mail-detail-loading,
.mail-detail-warning {
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
}
.mail-detail-loading {
  background: rgba(147, 197, 253, 0.1);
  color: var(--text-soft);
}
.mail-detail-warning {
  margin-top: 12px;
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
}
.mail-detail-empty {
  margin: 0;
  color: var(--muted-soft);
}

.pill,
.mini-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.pill.success,
.mini-pill {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
}
.code-pill {
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.code-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.16);
}
.code-pill:active {
  transform: translateY(0);
}
.pill.warning {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
}
.pill.danger {
  background: rgba(251, 113, 133, 0.12);
  color: var(--danger);
}
.pill.neutral {
  background: rgba(147, 197, 253, 0.12);
  color: var(--accent);
}
.code-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.muted { color: var(--muted); }

.message-feed,
.audit-list {
  display: grid;
  gap: 0;
  padding: 0 16px 16px;
}
.message-row,
.audit-item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  background: transparent;
}
.message-row:last-child,
.audit-item:last-child {
  border-bottom: 0;
}
.message-row-head,
.audit-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.message-row-head strong,
.audit-item strong {
  font-size: 13px;
  color: var(--text-soft);
}
.message-row-head span,
.audit-item span,
.message-row-meta {
  font-size: 12px;
  color: var(--muted-soft);
}
.message-row-body p {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}
.message-code-row { margin-top: 10px; }

.empty-state {
  padding: 18px;
  border-radius: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--muted-soft);
  background: rgba(255, 255, 255, 0.02);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 32px));
  border-radius: 16px;
  padding: 14px 16px;
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  gap: 12px;
}
.toast::before {
  content: "";
  display: none;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.toast.is-success {
  border-color: rgba(52, 211, 153, 0.24);
  color: #d5ffec;
}
.toast.is-success::before {
  display: block;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14);
}
.toast.is-loading {
  border-color: rgba(147, 197, 253, 0.28);
  color: var(--text-soft);
}
.toast.is-loading::before {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(147, 197, 253, 0.2);
  border-top-color: var(--accent);
  background: transparent;
  box-shadow: none;
  animation: toast-spin .8s linear infinite;
}
.toast.is-error {
  border-color: rgba(251, 113, 133, 0.28);
  color: #ffd1da;
}
.toast.is-error::before {
  display: block;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.14);
}
.hidden { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

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

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-body--console {
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.09), transparent 28%), var(--bg);
}
.auth-shell {
  width: min(960px, calc(100vw - 32px));
}
.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 22px;
  padding: 22px;
}
.auth-panel-copy {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 8px;
}
.auth-eyebrow {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(147, 197, 253, 0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  align-items: center;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.auth-panel-copy h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.auth-panel-copy p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 440px;
}
.auth-card {
  padding: 20px;
}
.auth-card--console {
  background: rgba(255, 255, 255, 0.04);
}
.auth-card-head h2 {
  margin: 0;
  font-size: 20px;
}
.auth-card-head p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.alert {
  border-radius: 14px;
  padding: 12px 14px;
}
.alert.danger {
  background: rgba(251, 113, 133, 0.1);
  color: #ffd1da;
  border: 1px solid rgba(251, 113, 133, 0.2);
}

.public-body {
  align-items: start;
  padding-top: 40px;
  padding-bottom: 48px;
}
.public-shell {
  width: min(1120px, calc(100vw - 32px));
  display: grid;
  gap: 18px;
}
.public-shell--access {
  width: min(1180px, calc(100vw - 32px));
}
.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 420px);
  gap: 18px;
  padding: 22px;
  align-items: stretch;
}
.public-copy {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 8px;
}
.public-copy--access {
  align-content: start;
  padding-top: 20px;
}
.public-copy h1 {
  margin: 0;
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}
.public-copy p {
  margin: 0;
  max-width: 640px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}
.public-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.public-meta-item {
  padding: 14px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}
.public-meta-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.public-meta-item strong {
  display: block;
  font-size: 13px;
  color: var(--text-soft);
  word-break: break-word;
}
.public-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.035);
}
.public-footnote {
  margin: 0;
  padding: 0 16px 4px;
  font-size: 12px;
  color: var(--muted-soft);
  line-height: 1.6;
}
.public-result {
  overflow: hidden;
}
.public-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 16px;
  padding: 0 16px 16px;
}
.public-summary-item {
  padding: 14px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.06);
}
.public-summary-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.public-summary-item strong {
  display: block;
  font-size: 13px;
  color: var(--text-soft);
  word-break: break-word;
}
.public-inline-note {
  margin: 0 16px 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(147, 197, 253, 0.06);
  border: 1px solid rgba(147, 197, 253, 0.14);
  color: var(--text-soft);
  font-size: 12px;
}
.public-message-list {
  display: grid;
  gap: 0;
  padding: 0 16px 16px;
}
.public-message-item {
  padding: 16px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}
.public-message-item:first-child {
  border-top: 0;
}
.public-message-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.public-message-head strong {
  font-size: 14px;
  color: var(--text-soft);
}
.public-message-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted-soft);
}
.public-message-item p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}
.public-message-item .code-list {
  margin-top: 12px;
}

@media (max-width: 1280px) {
  .workspace-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .context-rail { display: none; }
  .content-grid--overview { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
  .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid--split,
  .content-grid--aliases,
  .content-grid--settings,
  .priority-strip { grid-template-columns: 1fr; }
  .panel--sticky { position: static; }
  .auth-panel { grid-template-columns: 1fr; }
  .public-hero,
  .public-summary,
  .public-meta { grid-template-columns: 1fr; }
  .command-shelf-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }
  .workspace-nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
  }
  .nav--stack {
    grid-auto-flow: column;
    grid-auto-columns: minmax(110px, 1fr);
    overflow: auto;
  }
  .workspace-main {
    padding: 18px 16px 28px;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 12px 14px;
    align-items: flex-start;
    flex-direction: column;
  }
  .topbar-status { justify-content: flex-start; }
  .page-head,
  .panel-head {
    flex-direction: column;
  }
  .grid.cols-2,
  .stats-strip {
    grid-template-columns: 1fr;
  }
  .modal-layer {
    padding: 14px;
  }
  .modal-card {
    width: calc(100vw - 28px);
  }
  .table { min-width: 680px; }
  .auth-body { padding: 16px; }
  .auth-panel,
  .auth-card {
    padding: 16px;
  }
}
