:root {
  color-scheme: dark;
  --bg: #05080f;
  --card: rgba(14, 22, 38, 0.72);
  --card-solid: #0e1626;
  --card-soft: rgba(18, 30, 50, 0.78);
  --muted: #9ab0d4;
  --text: #f3f7ff;
  --line: rgba(140, 170, 220, 0.16);
  --accent: #6eb0ff;
  --accent-2: #8b74ff;
  --gold: #e8c98a;
  --ok: #3ee0a0;
  --warn: #ffc46a;
  --bad: #ff7b86;
  --danger: #ff7b86;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  --glow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 20px 60px rgba(8, 16, 36, 0.45);
  --mx: 50vw;
  --my: 40vh;
}

* {
  box-sizing: border-box;
}

body.cloud-console .local-only {
  display: none !important;
}

body.cloud-console .nav-with-local {
  display: none !important;
}

body:not(.cloud-console) .nav-no-local {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "SF Pro Display", "PingFang SC", "HarmonyOS Sans", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  letter-spacing: 0.01em;
}

.layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid var(--line);
  padding: 22px 18px 16px;
  background: rgba(6, 10, 18, 0.62);
  backdrop-filter: blur(28px) saturate(160%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand h1 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.2;
}

.brand p {
  display: none;
}

.brand-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(90, 162, 255, 0.12);
  color: #a8cbff;
  font-size: 12px;
}

.sidebar button,
.content button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  padding: 0 16px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(80, 110, 255, 0.22);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, filter 0.22s ease;
}

.api-base {
  margin-top: 16px;
}

.connection-details > summary {
  display: block;
  cursor: pointer;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  list-style: none;
}

.connection-details > summary::-webkit-details-marker {
  display: none;
}

.api-base label,
.api-base input {
  display: block;
  width: 100%;
}

.api-base input {
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding: 10px;
}

.side-card {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
}

.side-card h3 {
  margin: 0 0 10px;
}

.side-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.content {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 32px 40px 56px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(90, 162, 255, 0.12), rgba(124, 92, 255, 0.1));
}

.hero h2 {
  margin: 8px 0;
  font-size: 30px;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.hero-tag {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #d7e5ff;
  font-size: 12px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.card,
.panel {
  position: relative;
  isolation: isolate;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--glow);
  backdrop-filter: blur(22px) saturate(140%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease, box-shadow 0.35s ease;
}

.card .label {
  color: var(--muted);
  font-size: 13px;
}

.card .value {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 700;
}

.card .tip {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
}

.subtext {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-divider {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
}

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

.login-panel {
  min-height: 100%;
}

.step-kicker {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #a8cbff;
  text-transform: uppercase;
}

.form-stack {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-soft);
  color: var(--text);
  padding: 0 12px;
}

.field-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-panel {
  margin: 0;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.result-panel + .action-row,
.form-stack .action-row {
  margin-top: 16px;
}

.result-panel.ok {
  border-color: rgba(49, 210, 134, 0.28);
  background: rgba(49, 210, 134, 0.08);
  color: #d8ffe9;
}

.result-panel.bad {
  border-color: rgba(255, 115, 115, 0.28);
  background: rgba(255, 115, 115, 0.08);
  color: #ffd0d0;
}

.result-panel.muted {
  color: var(--muted);
}

.result-title {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.result-lines {
  display: grid;
  gap: 8px;
}

.result-lines > div {
  display: grid;
  grid-template-columns: 4.5em minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
}

.result-lines span {
  color: var(--muted);
}

.result-lines strong {
  font-weight: 500;
  color: inherit;
  word-break: break-word;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

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

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar input:not([type="checkbox"]),
.toolbar select,
textarea,
.session-grid input,
.import-actions input,
.import-actions select {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card-soft);
  color: var(--text);
  padding: 10px;
}

.toolbar input:not([type="checkbox"]),
.toolbar select {
  min-width: 180px;
}

.import-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 16px;
}

textarea {
  min-height: 120px;
  width: 100%;
  resize: vertical;
}

.import-actions p {
  color: var(--muted);
  line-height: 1.6;
}

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

.session-grid textarea {
  grid-column: 1 / -1;
}

.session-grid button {
  width: fit-content;
}

.referral-actions {
  gap: 14px;
}

.referral-results {
  overflow: auto;
  max-height: min(62vh, 720px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-soft);
}

.referral-results table {
  margin: 0;
}

.referral-results .tag-ok {
  color: #7ddea0;
}

.referral-results .tag-bad {
  color: #f0a0a0;
}

.referral-results .tag-warn {
  color: #e6c07b;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  color: #b8c8e8;
  font-size: 13px;
}

.status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.status.active { background: rgba(45, 207, 122, 0.14); color: var(--ok); }
.status.cooling { background: rgba(247, 184, 75, 0.14); color: var(--warn); }
.status.limited,
.status.invalid { background: rgba(255, 107, 107, 0.14); color: var(--bad); }

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.actions button.secondary {
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
}

.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.mono {
  font-family: Consolas, monospace;
  font-size: 12px;
}

.small-pre {
  font-size: 12px;
  color: #c9d7f6;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d4dcff;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 12px;
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .cards, .grid { grid-template-columns: 1fr; }
  .import-grid { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  .sidebar {
    position: relative;
    height: auto;
    min-width: 0;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .content {
    min-width: 0;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .brand h1 {
    margin: 0;
    font-size: 21px;
  }
  .brand p {
    display: none;
  }
  .brand-badge {
    flex: 0 0 auto;
  }
  .sidebar .nav {
    display: flex;
    gap: 8px;
    margin: 14px 0 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .sidebar .nav::-webkit-scrollbar {
    display: none;
  }
  .sidebar .nav-btn {
    width: auto;
    min-width: max-content;
    padding: 9px 13px !important;
  }
  #refreshAll {
    padding: 9px 13px;
  }
  .connection-details {
    display: inline-block;
    margin-left: 8px;
    vertical-align: top;
  }
  .connection-details > summary {
    display: inline-block;
    cursor: pointer;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    background: var(--card);
  }
  .connection-details[open] {
    display: block;
    margin: 12px 0 0;
  }
  .connection-details[open] > summary {
    display: block;
    width: max-content;
  }
  .connection-details .api-base {
    margin-top: 12px;
    max-width: 520px;
  }
}

.nav {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.nav-btn {
  width: 100%;
  text-align: left;
  background: rgba(255,255,255,0.035) !important;
  box-shadow: none !important;
  border: 1px solid transparent !important;
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
  box-shadow: 0 10px 24px rgba(90, 120, 255, 0.28) !important;
}

.tab-panel { display: none; max-width: 1240px; }
.tab-panel.active { display: block; }

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.guide-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.guide-card h3 { margin-top: 0; }
.guide-card ul, .guide-card ol { color: var(--muted); line-height: 1.8; margin-bottom: 0; }

.hero-actions .secondary,
.secondary {
  background: transparent !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
}

.toolbar button.danger,
button.danger {
  background: rgba(255, 115, 115, 0.16) !important;
  border: 1px solid rgba(255, 115, 115, 0.45) !important;
  color: var(--bad) !important;
  box-shadow: none !important;
}

.chart-list {
  display: grid;
  gap: 12px;
}

.chart-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #d7e5ff;
}

.chart-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.chart-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.account-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 16px 14px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(90, 162, 255, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-height: 0;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.account-card.status-invalid {
  background:
    linear-gradient(145deg, rgba(255, 115, 115, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

.account-card.status-limited,
.account-card.status-cooling {
  background:
    linear-gradient(145deg, rgba(255, 190, 85, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

.account-card:hover {
  border-color: rgba(90, 162, 255, 0.45);
  transform: translateY(-2px);
}

.codex-account-card {
  background:
    linear-gradient(145deg, rgba(116, 94, 255, 0.16), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
}

.account-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.account-card-head h3 {
  margin: 0 0 5px;
  font-size: 15px;
  word-break: break-all;
}

.account-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.account-card-meta,
.usage-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 12px;
}

.usage-mini {
  padding: 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.14);
}

.health-pill {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.07);
}

.health-pill.good { color: var(--ok); background: rgba(49, 210, 134, 0.12); }
.health-pill.warn { color: var(--warn); background: rgba(255, 190, 85, 0.12); }
.health-pill.bad { color: var(--danger); background: rgba(255, 115, 115, 0.12); }

.action-row.compact {
  flex-wrap: wrap;
  margin-top: auto;
}

.action-row.compact button {
  padding: 7px 10px;
  font-size: 12px;
}

.account-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.account-select {
  padding: 2px 0 0;
  flex-shrink: 0;
}

.account-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.account-email {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-all;
}

.account-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  color: #c7d7f5;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.chip-warn {
  color: var(--warn);
  background: rgba(255, 190, 85, 0.12);
  border-color: rgba(255, 190, 85, 0.24);
}

.chip-accent {
  color: #ffd28a;
  background: rgba(255, 190, 85, 0.12);
  border-color: rgba(255, 190, 85, 0.22);
}

.chip-ok {
  color: var(--ok);
  background: rgba(49, 210, 134, 0.12);
  border-color: rgba(49, 210, 134, 0.28);
}

.chip-bad {
  color: var(--bad);
  background: rgba(255, 115, 115, 0.12);
  border-color: rgba(255, 115, 115, 0.28);
}

.auth-status {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.auth-status.ok { color: var(--ok); }
.auth-status.warn { color: var(--warn); }
.auth-status.bad { color: var(--bad); }

.bridge-banner {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  line-height: 1.45;
}

.bridge-banner.ok {
  color: #b8f0d2;
  border-color: rgba(49, 210, 134, 0.35);
  background: rgba(49, 210, 134, 0.1);
}

.bridge-banner.warn {
  color: #ffe0a8;
  border-color: rgba(255, 190, 85, 0.35);
  background: rgba(255, 190, 85, 0.1);
}

.bridge-banner.bad {
  color: #ffc0c0;
  border-color: rgba(255, 115, 115, 0.35);
  background: rgba(255, 115, 115, 0.1);
}

.local-panel .panel-header {
  margin-bottom: 18px;
}

.local-status-board {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.local-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid rgba(120, 170, 255, 0.22);
  background:
    radial-gradient(circle at 0% 0%, rgba(90, 162, 255, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(18, 35, 59, 0.95), rgba(10, 20, 36, 0.98));
}

.local-kicker {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}

.local-email {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  word-break: break-all;
  line-height: 1.25;
}

.local-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.local-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #d5e4ff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.local-tag.ok {
  color: var(--ok);
  background: rgba(49, 210, 134, 0.12);
  border-color: rgba(49, 210, 134, 0.28);
}

.local-tag.warn {
  color: var(--warn);
  background: rgba(255, 190, 85, 0.12);
  border-color: rgba(255, 190, 85, 0.28);
}

.local-tag.bad {
  color: var(--bad);
  background: rgba(255, 115, 115, 0.12);
  border-color: rgba(255, 115, 115, 0.28);
}

.local-pill {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.local-pill.ok {
  color: var(--ok);
  border-color: rgba(49, 210, 134, 0.35);
  background: rgba(49, 210, 134, 0.12);
}

.local-pill.warn {
  color: var(--warn);
  border-color: rgba(255, 190, 85, 0.35);
  background: rgba(255, 190, 85, 0.12);
}

.local-pill.bad {
  color: var(--bad);
  border-color: rgba(255, 115, 115, 0.35);
  background: rgba(255, 115, 115, 0.12);
}

.local-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.local-metric {
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.local-metric-k {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.local-metric-v {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.local-metric-v.ok { color: var(--ok); }
.local-metric-v.warn { color: var(--warn); }
.local-metric-v.bad { color: var(--bad); }
.local-metric-v.muted { color: var(--muted); }

.local-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.local-action-group {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.local-action-group h3 {
  margin: 0;
  font-size: 15px;
}

.local-action-group .subtext {
  margin: 0;
  font-size: 12px;
}

.local-action-group .action-row {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.local-action-group.danger-zone {
  border-color: rgba(255, 115, 115, 0.28);
  background: rgba(255, 115, 115, 0.05);
}

.local-paths {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.16);
}

.local-path-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 12px;
}

.local-path-row span {
  color: var(--muted);
  padding-top: 2px;
}

.local-path-row code {
  color: #c9daf8;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.local-path-row code.missing {
  color: var(--bad);
}

.local-raw {
  margin-top: 4px;
}

.local-raw pre {
  max-height: 280px;
  overflow: auto;
  margin: 10px 0 0;
  font-size: 12px;
}

@media (max-width: 980px) {
  .local-metrics,
  .local-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .local-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .local-metrics,
  .local-actions {
    grid-template-columns: 1fr;
  }

  .local-path-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.ops-board {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.ops-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid rgba(120, 170, 255, 0.22);
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 92, 255, 0.14), transparent 40%),
    linear-gradient(135deg, rgba(18, 35, 59, 0.95), rgba(10, 20, 36, 0.98));
}

.ops-hero-title {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  word-break: break-all;
  line-height: 1.3;
}

.ops-ide-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.ops-ide-email {
  font-size: 16px;
  font-weight: 600;
  margin-top: 4px;
  word-break: break-all;
}

.ops-health-line {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  max-width: 55%;
  line-height: 1.5;
}

.ops-tool-grid .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ops-tool-grid .field span {
  font-size: 12px;
  color: var(--muted);
}

.ops-tool-grid .field input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  padding: 10px 12px;
}

.ops-export-row {
  flex-direction: column;
  align-items: stretch;
}

.ops-export-row button {
  width: 100%;
}

.ops-last-action {
  margin-top: auto;
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

.ops-last-action.muted {
  color: var(--muted);
  font-weight: 500;
}

.ops-key-create {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.ops-key-create .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ops-key-create .field span {
  font-size: 12px;
  color: var(--muted);
}

.ops-key-create input,
.ops-key-create select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  padding: 10px 12px;
}

.ops-keys-table {
  margin-top: 12px;
}

.select-all-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  width: auto;
  flex: 0 0 auto;
}

.select-all-row input {
  width: 15px;
  height: 15px;
  margin: 0;
  padding: 0;
  flex: 0 0 15px;
  accent-color: var(--accent);
  appearance: none;
  border: 1.5px solid rgba(190, 214, 255, 0.45);
  border-radius: 4px;
  background: rgba(8, 12, 20, 0.65);
  box-shadow: none;
}

.select-all-row input:checked {
  border-color: transparent;
  background:
    linear-gradient(135deg, var(--accent), var(--accent-2))
    padding-box;
  box-shadow: 0 0 0 1px rgba(110, 176, 255, 0.25);
}

.select-all-row span {
  display: block;
  line-height: 1;
}

.guide-panel {
  max-width: 920px;
}

.guide-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.guide-toc a {
  color: #c5dbff;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(90, 162, 255, 0.22);
  background: rgba(90, 162, 255, 0.08);
}

.guide-toc a:hover {
  border-color: rgba(90, 162, 255, 0.45);
  color: #fff;
}

.guide-article {
  margin: 0 0 22px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.14);
}

.guide-article h3 {
  margin: 0 0 12px;
  font-size: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.guide-article h4 {
  margin: 14px 0 8px;
  font-size: 14px;
  color: #d7e5ff;
}

.guide-article ol,
.guide-article ul {
  margin: 0;
  padding-left: 20px;
  color: #dce8ff;
  line-height: 1.75;
}

.guide-article p {
  margin: 10px 0 0;
  line-height: 1.7;
  color: #c8d7f0;
}

.guide-article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #e8f0ff;
}

button.guide-jump {
  font-size: 13px !important;
  min-height: 40px !important;
  height: 40px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  background: rgba(90, 162, 255, 0.16) !important;
  border: 1px solid rgba(90, 162, 255, 0.32) !important;
}

.guide-tip,
.guide-warn {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
}

.guide-tip {
  color: #b8f0d2;
  background: rgba(49, 210, 134, 0.1);
  border: 1px solid rgba(49, 210, 134, 0.28);
}

.guide-warn {
  color: #ffe0a8;
  background: rgba(255, 190, 85, 0.1);
  border: 1px solid rgba(255, 190, 85, 0.28);
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.guide-table th,
.guide-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.guide-table th {
  color: var(--muted);
  font-weight: 600;
}

.guide-faq dt {
  margin-top: 12px;
  font-weight: 650;
  color: #edf4ff;
}

.guide-faq dd {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.ops-keys-panel #opsKeyCreated {
  margin-top: 4px;
}

@media (max-width: 720px) {
  .ops-hero,
  .ops-ide-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .ops-health-line {
    text-align: left;
    max-width: none;
  }

  .ops-key-create {
    grid-template-columns: 1fr;
  }
}

.api-base input[type='password'] {
  width: 100%;
}

#importCookie,
#importEmailsBulk {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #d7e5ff;
}

.plan-badge.plan-free {
  color: var(--muted);
  background: rgba(147, 164, 199, 0.12);
}

.plan-badge.plan-paid {
  color: #ffd28a;
  background: rgba(255, 190, 85, 0.14);
  border-color: rgba(255, 190, 85, 0.28);
}

.account-meters {
  display: grid;
  gap: 10px;
  flex: 1;
}

.meter-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.meter {
  display: grid;
  gap: 4px;
}

.meter-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  color: var(--muted);
}

.meter-head strong {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
}

.account-meters .usage-bar {
  margin-top: 0;
  grid-template-columns: 1fr;
}

.account-meters .usage-pct {
  display: none;
}

.account-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 12px;
}

.account-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.account-card-actions button {
  padding: 7px 12px;
  font-size: 12px;
  box-shadow: none;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.06);
}

.status.active {
  color: var(--ok);
  background: rgba(49, 210, 134, 0.12);
}

.status.cooling {
  color: var(--warn);
  background: rgba(255, 190, 85, 0.12);
}

.status.limited {
  color: var(--warn);
  background: rgba(255, 190, 85, 0.12);
}

.status.invalid {
  color: var(--bad);
  background: rgba(255, 115, 115, 0.12);
}

.detail-layout {
  display: grid;
  gap: 18px;
  margin-bottom: 16px;
}

.detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(90, 162, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(90, 162, 255, 0.12), transparent 55%),
    rgba(255, 255, 255, 0.03);
}

.detail-email {
  font-size: 20px;
  font-weight: 700;
  word-break: break-all;
  margin-bottom: 10px;
}

.detail-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-hero-side {
  display: grid;
  gap: 10px;
  min-width: 180px;
}

.detail-hero-side .metric {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-hero-side .metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.detail-hero-side .metric strong {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

.detail-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #c7d7f5;
  font-weight: 600;
}

.detail-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.detail-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
}

.detail-card.wide {
  grid-column: span 2;
}

.detail-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.detail-value {
  font-size: 15px;
  color: var(--text);
  word-break: break-word;
}

.raw-fold {
  margin-top: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  padding: 0 14px;
}

.raw-fold summary {
  cursor: pointer;
  padding: 12px 0;
  color: var(--muted);
  font-size: 13px;
  user-select: none;
}

.raw-fold pre {
  margin: 0 0 14px;
  max-height: 320px;
  overflow: auto;
}

.drawer-head {
  align-items: flex-start;
}

.drawer-actions {
  justify-content: flex-end;
}

.usage-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.usage-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  border-radius: inherit;
  background: #4da3ff;
}

.usage-fill.ok { background: #31d286; }
.usage-fill.warn { background: #ffbe55; }
.usage-fill.crit { background: #ff7373; }
.usage-fill.empty { background: transparent; }

.usage-pct {
  font-size: 11px;
  color: var(--muted);
  min-width: 36px;
  text-align: right;
}

@media (max-width: 1280px) {
  .login-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .login-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .detail-cards { grid-template-columns: 1fr 1fr; }
  .detail-card.wide { grid-column: span 2; }
  .detail-hero {
    flex-direction: column;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .meter-pair {
    grid-template-columns: 1fr;
  }
}

.empty-state {
  padding: 18px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--line);
  color: var(--muted);
}

.drawer.hidden {
  display: none;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.drawer-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  width: min(760px, 100%);
  height: 100%;
  overflow: auto;
  background: var(--bg);
  border-left: 1px solid var(--line);
  padding: 20px;
  box-shadow: var(--shadow);
  animation: drawerIn 0.16s ease;
}

.check-row {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  padding: 8px 0;
}

.check-row input {
  width: auto;
}

label.check-row.select-all-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  margin: 0;
  width: auto;
  color: var(--text);
}

label.check-row.select-all-row input {
  width: 15px;
  height: 15px;
  min-width: 15px;
  margin: 0;
  padding: 0;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.capability-grid div {
  min-height: 96px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.06);
}

.capability-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.capability-grid span {
  display: block;
  line-height: 1.6;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1280px) {
  .capability-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .capability-grid {
    grid-template-columns: 1fr;
  }
}

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: grid;
  gap: 8px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 36px));
}

.toast {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(15, 27, 45, 0.96);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-ok {
  border-color: rgba(49, 210, 134, 0.35);
  background: rgba(18, 48, 36, 0.96);
}

.toast-error {
  border-color: rgba(255, 115, 115, 0.4);
  background: rgba(52, 22, 22, 0.96);
}

button:disabled,
button.is-busy {
  opacity: 0.65;
  cursor: wait;
  filter: saturate(0.75);
}

.account-grid.is-loading {
  opacity: 0.72;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.skeleton-block {
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes drawerIn {
  from { transform: translateX(18px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.mailbox-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}

.mailbox-code-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  background:
    linear-gradient(160deg, rgba(90, 162, 255, 0.12), transparent 42%),
    var(--card-soft);
  text-align: center;
}

.mailbox-code-label {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.mailbox-code-value {
  margin: 12px 0 16px;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.mailbox-code-value.has-code {
  color: var(--ok);
}

.mailbox-mail-list {
  margin-top: 16px;
  text-align: left;
  max-height: 260px;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.mailbox-mail-item + .mailbox-mail-item {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(146, 164, 199, 0.25);
}

.mailbox-mail-meta {
  font-size: 13px;
  margin-bottom: 4px;
}

.mailbox-mail-snip {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  word-break: break-word;
}

@media (max-width: 900px) {
  .mailbox-layout {
    grid-template-columns: 1fr;
  }
}

/* Primary account-switching experience */
.home-hero {
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 0%, rgba(124, 92, 255, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(90, 162, 255, 0.08), transparent 52%),
    var(--card);
}

.home-current-card,
.home-status {
  display: grid;
  gap: 16px;
}

.home-current-main,
.home-current-plan,
.home-current-state {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(7, 17, 31, 0.54);
}

.home-current-label,
.home-current-plan span,
.home-current-state span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.home-current-email {
  margin: 8px 0 12px;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-current-tags,
.home-candidate-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.home-current-plan,
.home-current-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-current-plan strong,
.home-current-state strong {
  margin: 7px 0;
  font-size: 17px;
  line-height: 1.35;
}

.home-current-plan small {
  color: var(--muted);
  line-height: 1.5;
}

.home-current-state.ok {
  border-color: rgba(49, 210, 134, 0.38);
  background: rgba(49, 210, 134, 0.08);
}

.home-current-state.warn {
  border-color: rgba(255, 190, 85, 0.38);
  background: rgba(255, 190, 85, 0.07);
}

.home-loading,
.home-error {
  grid-column: 1 / -1;
  display: flex;
  min-height: 112px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
}

.home-error span {
  color: var(--bad);
}

.home-candidates-panel {
  margin-top: 0;
}

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

.home-candidate-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card-soft);
}

.home-candidate-top {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.home-candidate-top > div {
  min-width: 0;
}

.home-candidate-top strong,
.home-candidate-top span {
  display: block;
}

.home-candidate-top strong {
  overflow: hidden;
  margin-bottom: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-candidate-top > div > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.home-switch-button {
  width: 100%;
  margin-top: auto;
}

.home-empty {
  grid-column: 1 / -1;
  display: flex;
  min-height: 150px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.home-empty span {
  color: var(--muted);
}

.home-bottom-grid,
.home-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.7fr);
  gap: 20px;
  margin-top: 20px;
  align-items: stretch;
}

.switch-idle {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  color: var(--muted);
  text-align: center;
}

.switch-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.switch-progress-head span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switch-progress-head.success strong {
  color: var(--ok);
}

.switch-progress-head.failure strong {
  color: var(--bad);
}

.switch-step-list {
  display: grid;
  gap: 8px;
}

.switch-step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.switch-step-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
}

.switch-step.done {
  color: var(--text);
}

.switch-step.done .switch-step-icon {
  border-color: rgba(49, 210, 134, 0.45);
  background: rgba(49, 210, 134, 0.14);
  color: var(--ok);
}

.switch-step.active .switch-step-icon {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px rgba(90, 162, 255, 0.1);
}

.switch-step.failed,
.switch-step.failed .switch-step-icon {
  border-color: rgba(255, 115, 115, 0.45);
  color: var(--bad);
}

.switch-message {
  margin-top: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(90, 162, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.switch-message.failure {
  background: rgba(255, 115, 115, 0.08);
  color: #ffc0c0;
}

.switch-history {
  display: grid;
  gap: 8px;
}

.switch-history-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(34, 54, 86, 0.65);
}

.switch-history-item:last-child {
  border-bottom: 0;
}

.switch-history-item .switch-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--ok);
}

.switch-history-item.bad .switch-dot {
  background: var(--bad);
}

.switch-history-item strong,
.switch-history-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switch-history-item small {
  margin-top: 4px;
  color: var(--muted);
}

.advanced-matrix {
  overflow: visible;
}

.advanced-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

.content button.advanced-tile,
.content .advanced-tile {
  display: flex;
  min-height: 112px;
  height: auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  padding: 18px 18px 16px;
  overflow: visible;
  isolation: isolate;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018)),
    var(--card-soft);
  text-align: left;
  white-space: normal;
  box-shadow: none;
  filter: none;
}

.advanced-tile strong,
.advanced-tile span {
  position: relative;
  z-index: 1;
}

.advanced-tile strong {
  font-size: 16px;
  line-height: 1.35;
}

.advanced-tile span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  white-space: normal;
}

.advanced-return {
  margin-bottom: 12px;
}

.advanced-disclosure {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 27, 45, 0.72);
}

.advanced-disclosure > summary,
.account-usage-details > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}

.advanced-disclosure > summary {
  padding: 15px 18px;
}

.advanced-disclosure > .panel {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
  box-shadow: none;
}

.account-quick-usage {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid rgba(34, 54, 86, 0.7);
  border-bottom: 1px solid rgba(34, 54, 86, 0.7);
  font-size: 12px;
}

.account-quick-usage span {
  color: var(--muted);
}

.account-quick-usage strong {
  text-align: right;
}

.account-usage-details {
  padding: 9px 0 2px;
}

.account-usage-details > summary {
  padding: 3px 0;
}

.account-usage-details .account-meters {
  margin-top: 12px;
}

.account-detail-chips {
  display: flex;
  padding-top: 4px;
}

@media (max-width: 1180px) {
  .home-workbench,
  .home-bottom-grid {
    grid-template-columns: 1fr;
  }

  .home-candidate-grid,
  .advanced-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .home-current-card,
  .home-status-metrics,
  .home-now,
  .home-workbench,
  .home-bottom-grid,
  .home-candidate-grid,
  .advanced-grid {
    grid-template-columns: 1fr;
  }

  .home-current-state {
    grid-column: auto;
  }

  .home-current-email {
    font-size: 20px;
  }

  .home-candidate-top,
  .switch-progress-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .switch-progress-head span {
    max-width: 100%;
  }

  .advanced-tile {
    min-height: 100px;
  }
}

/* ========== Luxury motion & atmosphere ========== */
.fx-root {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.fx-aurora,
.fx-orb,
.fx-grid,
.fx-noise,
.fx-spotlight {
  position: absolute;
  inset: 0;
}

.fx-aurora {
  background:
    radial-gradient(ellipse 80% 55% at 12% -10%, rgba(110, 176, 255, 0.28), transparent 52%),
    radial-gradient(ellipse 70% 50% at 92% 0%, rgba(139, 116, 255, 0.24), transparent 48%),
    radial-gradient(ellipse 50% 40% at 50% 110%, rgba(62, 224, 160, 0.08), transparent 50%);
  animation: auroraDrift 18s ease-in-out infinite alternate;
}

.fx-orb {
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  mix-blend-mode: screen;
  will-change: transform;
}

.fx-orb-a {
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(110, 176, 255, 0.55), transparent 68%);
  animation: orbFloatA 16s ease-in-out infinite;
}

.fx-orb-b {
  top: 18%;
  right: -16%;
  width: 36vw;
  height: 36vw;
  background: radial-gradient(circle, rgba(139, 116, 255, 0.48), transparent 70%);
  animation: orbFloatB 22s ease-in-out infinite;
}

.fx-orb-c {
  bottom: -18%;
  left: 28%;
  width: 32vw;
  height: 32vw;
  background: radial-gradient(circle, rgba(232, 201, 138, 0.18), transparent 68%);
  animation: orbFloatC 20s ease-in-out infinite;
}

.fx-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 78%);
  opacity: 0.55;
}

.fx-noise {
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.fx-spotlight {
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(180, 210, 255, 0.16), transparent 42%);
  transition: background 0.08s linear;
}

.fx-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 80;
  width: 18px;
  height: 18px;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0;
  transform: translate3d(-100px, -100px, 0);
}

.fx-cursor.is-on {
  opacity: 1;
}

.fx-cursor-ring,
.fx-cursor-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.fx-cursor-ring {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(190, 214, 255, 0.55);
  box-shadow: 0 0 24px rgba(110, 176, 255, 0.28);
  transition: width 0.22s ease, height 0.22s ease, opacity 0.22s ease, background 0.22s ease;
}

.fx-cursor-dot {
  width: 5px;
  height: 5px;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

.fx-cursor.is-press .fx-cursor-ring {
  width: 22px;
  height: 22px;
  background: rgba(110, 176, 255, 0.16);
}

.fx-cursor.is-hover .fx-cursor-ring {
  width: 52px;
  height: 52px;
  border-color: rgba(232, 201, 138, 0.7);
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  margin-bottom: 0;
  flex: 0 0 38px;
}

.brand-mark span {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px rgba(90, 130, 255, 0.35);
}

.brand-mark span:last-child {
  inset: 8px;
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(232, 201, 138, 0.75));
  transform: rotate(18deg);
  animation: markSpin 10s linear infinite;
}

.brand-badge {
  background: linear-gradient(135deg, rgba(110, 176, 255, 0.16), rgba(232, 201, 138, 0.12));
  border: 1px solid rgba(232, 201, 138, 0.22);
  color: var(--gold);
  letter-spacing: 0.08em;
}

.brand h1 {
  background: linear-gradient(180deg, #fff 20%, #c9dbff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.layout {
  position: relative;
  z-index: 1;
}

.sidebar button:hover,
.content button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 14px 32px rgba(90, 120, 255, 0.32);
}

.sidebar button:active,
.content button:active {
  transform: translateY(1px) scale(0.98);
}

.sidebar button.secondary:hover,
.content button.secondary:hover,
.hero-actions .secondary:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(160, 190, 255, 0.38) !important;
}

.sidebar button.danger:hover,
.content button.danger:hover {
  background: rgba(255, 123, 134, 0.24) !important;
  box-shadow: 0 10px 24px rgba(255, 80, 90, 0.18) !important;
}

.nav-btn {
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease !important;
}

.nav-btn:hover {
  transform: translateX(4px);
  border-color: rgba(160, 190, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.07) !important;
}

.nav-btn.active:hover {
  transform: translateX(4px);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
}

.card::before,
.panel::before,
.account-card::before,
.home-candidate-card::before,
.advanced-tile::before,
.local-metric::before,
.local-action-group::before,
.mailbox-code-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--spot-x, 50%) var(--spot-y, 0%), rgba(210, 228, 255, 0.16), transparent 42%);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 0;
}

.card:hover::before,
.panel:hover::before,
.account-card:hover::before,
.home-candidate-card:hover::before,
.advanced-tile:hover::before,
.local-metric:hover::before,
.local-action-group:hover::before,
.mailbox-code-card:hover::before {
  opacity: 1;
}

.panel:hover,
.card:hover {
  border-color: rgba(170, 200, 255, 0.28);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.account-card,
.home-candidate-card,
.advanced-tile,
.local-metric,
.local-action-group,
.mailbox-code-card,
.home-current-main,
.home-current-plan,
.home-current-state {
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease, box-shadow 0.35s ease;
}

.account-card:hover,
.home-candidate-card:hover,
.advanced-tile:hover {
  transform: translateY(-6px);
  border-color: rgba(170, 200, 255, 0.42);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}

.content button.advanced-tile,
.content .advanced-tile {
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018)),
    var(--card-soft);
}

.content button.advanced-tile:hover,
.content .advanced-tile:hover {
  transform: translateY(-3px);
  filter: none;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.tab-panel.active.is-entering {
  animation: tabEnter 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.tab-panel.active.is-entering > * {
  animation: riseIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tab-panel.active.is-entering > *:nth-child(1) { animation-delay: 0.02s; }
.tab-panel.active.is-entering > *:nth-child(2) { animation-delay: 0.08s; }
.tab-panel.active.is-entering > *:nth-child(3) { animation-delay: 0.14s; }
.tab-panel.active.is-entering > *:nth-child(4) { animation-delay: 0.2s; }
.tab-panel.active.is-entering > *:nth-child(5) { animation-delay: 0.26s; }

.field input,
.field select,
.field textarea,
.toolbar input,
.toolbar select,
.api-base input,
textarea {
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.toolbar input:focus,
.toolbar select:focus,
.api-base input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(110, 176, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(110, 176, 255, 0.14);
  background: rgba(18, 30, 50, 0.92);
}

.fx-ripple {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  animation: rippleOut 0.7s ease-out forwards;
}

.drawer-mask {
  backdrop-filter: blur(8px);
  background: rgba(2, 6, 14, 0.55);
  animation: fadeIn 0.22s ease;
}

.drawer-panel {
  background: linear-gradient(180deg, rgba(10, 16, 28, 0.96), rgba(6, 10, 18, 0.98));
  animation: drawerIn 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast {
  backdrop-filter: blur(16px);
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.show {
  transform: translateY(0) scale(1);
}

.switch-step.active .switch-step-icon {
  animation: pulseRing 1.4s ease-in-out infinite;
}

.home-current-card,
.local-hero,
.ops-hero {
  position: relative;
  overflow: hidden;
}

.usage-fill {
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes auroraDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-2%, 2%, 0) scale(1.06); }
}

@keyframes orbFloatA {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(8%, 10%, 0); }
}

@keyframes orbFloatB {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-10%, 8%, 0); }
}

@keyframes orbFloatC {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(6%, -12%, 0); }
}

@keyframes markSpin {
  from { transform: rotate(18deg); }
  to { transform: rotate(378deg); }
}

@keyframes tabEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rippleOut {
  to { transform: translate(-50%, -50%) scale(8); opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 0 4px rgba(90, 162, 255, 0.1); }
  50% { box-shadow: 0 0 0 8px rgba(90, 162, 255, 0.18); }
}

@keyframes drawerIn {
  from { transform: translateX(28px); opacity: 0.4; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 1100px) {
  .fx-cursor { display: none; }
  .brand-mark { width: 32px; height: 32px; margin: 0; }
}

.fx-aurora {
  background:
    radial-gradient(ellipse 90% 60% at 8% -8%, rgba(110, 176, 255, 0.42), transparent 54%),
    radial-gradient(ellipse 80% 55% at 96% 4%, rgba(139, 116, 255, 0.38), transparent 50%),
    radial-gradient(ellipse 55% 45% at 48% 108%, rgba(232, 201, 138, 0.16), transparent 52%);
}

.fx-orb {
  opacity: 0.78;
  filter: blur(52px);
}

.fx-spotlight {
  background: radial-gradient(640px circle at var(--mx) var(--my), rgba(200, 224, 255, 0.22), transparent 44%);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(18, 28, 48, 0.55), rgba(6, 10, 18, 0.72)),
    rgba(6, 10, 18, 0.48);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(110, 176, 255, 0.35), transparent 40%, rgba(232, 201, 138, 0.18));
  pointer-events: none;
}

.nav-btn {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.nav-btn i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
  flex: 0 0 auto;
}

.nav-btn.active i {
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.7);
}

.api-base {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(160, 190, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.api-base label {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.home-hero {
  background:
    radial-gradient(circle at 88% -10%, rgba(139, 116, 255, 0.28), transparent 36%),
    radial-gradient(circle at 8% 120%, rgba(110, 176, 255, 0.16), transparent 40%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.05), transparent 46%),
    var(--card);
}

.home-current-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-orb {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 36%), rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.06);
}

.status-orb span,
.status-orb::after {
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: #8ea2c4;
}

.status-orb::after {
  content: "";
  inset: 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: orbPulse 2.4s ease-out infinite;
}

.status-orb.ok span { background: var(--ok); box-shadow: 0 0 16px rgba(62, 224, 160, 0.55); }
.status-orb.ok::after { border-color: rgba(62, 224, 160, 0.35); }
.status-orb.warn span { background: var(--warn); box-shadow: 0 0 16px rgba(255, 196, 106, 0.45); }
.status-orb.warn::after { border-color: rgba(255, 196, 106, 0.3); }
.status-orb.off span { background: #7d8eae; }

.home-current-main,
.home-current-plan,
.home-current-state {
  background: rgba(7, 12, 22, 0.42);
  backdrop-filter: blur(10px);
}

.home-empty,
.switch-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 168px;
  border: 1px solid rgba(160, 190, 255, 0.1);
  background:
    radial-gradient(circle at 50% 0%, rgba(110, 176, 255, 0.1), transparent 55%),
    rgba(255, 255, 255, 0.02);
}

.empty-glyph,
.idle-glyph {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(110, 176, 255, 0.28), rgba(139, 116, 255, 0.16));
  border: 1px solid rgba(190, 214, 255, 0.2);
  box-shadow: 0 10px 24px rgba(20, 40, 90, 0.25);
  position: relative;
}

.empty-glyph::before,
.idle-glyph::before {
  content: "";
  position: absolute;
  inset: 16px 12px 20px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
}

.empty-glyph::after,
.idle-glyph::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 12px;
  height: 3px;
  border-radius: 99px;
  background: rgba(232, 201, 138, 0.7);
}

.idle-glyph.pulse {
  animation: glyphBreath 2.2s ease-in-out infinite;
}

.switch-history-item {
  padding: 14px 16px;
  border: 1px solid rgba(160, 190, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.switch-history-item:hover {
  transform: translateX(4px);
  border-color: rgba(170, 200, 255, 0.22);
  background: rgba(255, 255, 255, 0.045);
}

.switch-history-item .switch-dot {
  box-shadow: 0 0 10px currentColor;
}

.home-loading {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

@keyframes orbPulse {
  0% { transform: scale(0.72); opacity: 0.7; }
  100% { transform: scale(1.35); opacity: 0; }
}

@keyframes glyphBreath {
  0%, 100% { transform: scale(1); box-shadow: 0 10px 24px rgba(20, 40, 90, 0.25); }
  50% { transform: scale(1.06); box-shadow: 0 14px 30px rgba(90, 130, 255, 0.28); }
}

.command-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  max-width: 1240px;
  margin: 0 0 28px;
  padding: 12px 16px;
  border: 1px solid rgba(232, 201, 138, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(232, 201, 138, 0.08), transparent 28%),
    rgba(8, 12, 20, 0.55);
  backdrop-filter: blur(18px);
}

.command-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.command-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 12px rgba(62, 224, 160, 0.7);
  animation: glyphBreath 2.4s ease-in-out infinite;
}

.command-brand em {
  font-style: normal;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--gold);
}

.command-brand strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: #e8eefc;
}

.command-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.command-metrics em {
  display: block;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 3px;
}

.command-metrics b {
  font-size: 14px;
  color: var(--text);
}

.home-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.kpi-tile {
  padding: 16px 18px 14px;
  border-radius: 18px;
  border: 1px solid rgba(160, 190, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    rgba(10, 16, 28, 0.45);
}

.kpi-tile em {
  display: block;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.kpi-tile strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.kpi-tile span {
  color: var(--muted);
  font-size: 12px;
}

.nav-btn em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--gold);
  min-width: 18px;
}

.nav-btn.active em {
  color: #fff;
}

.login-panel {
  display: flex;
  flex-direction: column;
  padding: 22px 22px 20px;
}

.login-panel .panel-header {
  min-height: 92px;
  align-items: flex-start;
}

.login-panel .form-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-panel .action-row {
  margin-top: 2px;
}

.login-panel .action-row button {
  flex: 1;
}

.login-panel .result-panel {
  margin-top: 0;
}

.login-panel .check-row {
  padding: 2px 0;
  min-height: 28px;
}

.home-candidate-grid {
  grid-template-columns: 1fr;
}

.home-candidate-card {
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

.home-candidate-index {
  flex: 0 0 auto;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.home-candidate-card .home-switch-button {
  width: auto;
  min-width: 148px;
  margin-top: 0;
}

.page-head {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(232, 201, 138, 0.12);
}

.step-kicker {
  color: var(--gold);
  letter-spacing: 0.12em;
}

@media (max-width: 1180px) {
  .home-kpi-row,
  .login-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.codex-hero {
  display: grid;
  gap: 18px;
  padding: 22px 24px;
}

.codex-hero .result-panel {
  margin: 0;
}

.codex-hero-actions {
  margin: 0;
  padding-top: 2px;
}

.form-stack {
  gap: 14px;
}

@media (max-width: 860px) {
  .command-bar,
  .home-kpi-row,
  .login-grid,
  .home-candidate-card {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .command-metrics {
    width: 100%;
    justify-content: space-between;
  }

  .home-candidate-card .home-switch-button {
    width: 100%;
  }
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 22px;
}

.page-head h2 {
  margin: 4px 0 0;
  font-size: 34px;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.page-head .subtext {
  max-width: 520px;
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.live-pills {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(160, 190, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.live-pills .auth-status {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.nav {
  gap: 6px;
  margin: 22px 0 16px;
}

.home-now {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(200px, 260px);
  gap: 20px 22px;
  align-items: center;
}

.home-now-main {
  min-width: 0;
}

.home-now-kicker,
.home-now-side span,
.home-now-hint {
  color: var(--muted);
  font-size: 12px;
}

.home-now-email {
  margin: 6px 0 10px;
  color: var(--text);
  font-size: clamp(20px, 2.3vw, 28px);
  font-weight: 750;
  line-height: 1.2;
  word-break: break-all;
}

.home-now-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.home-now-hint {
  margin: 10px 0 0;
  line-height: 1.5;
}

.home-now-side {
  min-width: 0;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(160, 190, 255, 0.1);
  background: rgba(7, 12, 22, 0.38);
}

.home-now-side strong {
  display: block;
  margin: 7px 0 6px;
  font-size: 16px;
}

.home-now-side small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.home-now-side.ok {
  border-color: rgba(62, 224, 160, 0.28);
  background: rgba(62, 224, 160, 0.08);
}

.home-now-side.warn {
  border-color: rgba(255, 196, 106, 0.28);
  background: rgba(255, 196, 106, 0.07);
}

.home-now.is-ready .home-now-hint {
  color: #8be7c0;
}

.content button.home-save-current,
.home-save-current {
  margin-top: 12px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

.home-status-lead {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 6px 2px 2px;
}

.home-status-copy {
  min-width: 0;
}

.home-status-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.7fr);
  gap: 20px;
}

.home-metric {
  min-width: 0;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(160, 190, 255, 0.1);
  background: rgba(7, 12, 22, 0.38);
}

.home-metric span,
.home-metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.home-metric strong {
  display: block;
  margin: 7px 0 6px;
  font-size: 16px;
}

.home-metric.ok {
  border-color: rgba(62, 224, 160, 0.28);
  background: rgba(62, 224, 160, 0.08);
}

.home-metric.warn {
  border-color: rgba(255, 196, 106, 0.28);
  background: rgba(255, 196, 106, 0.07);
}

.home-rail {
  display: grid;
  gap: 16px;
}

.home-rail .switch-idle,
.home-rail .home-empty {
  min-height: 120px;
}

.home-hero {
  padding: 22px 24px 20px;
}

.panel {
  padding: 20px 22px;
}

.panel-header {
  align-items: center;
  margin-bottom: 16px;
}

.home-candidates-panel,
.home-rail > .panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.home-candidate-grid,
.switch-progress,
.switch-history {
  flex: 1;
}

.home-empty,
.home-rail .switch-idle {
  min-height: 220px;
  height: 100%;
}

.home-current-email {
  white-space: normal;
  line-height: 1.2;
}

@media (max-width: 1100px) {
  .home-now {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .home-now-side {
    grid-column: 1 / -1;
  }

  .content {
    padding: 20px 16px 36px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-head h2 {
    font-size: 28px;
  }

  .sidebar-foot {
    margin-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fx-aurora,
  .fx-orb,
  .brand-mark span:last-child,
  .tab-panel.active.is-entering,
  .tab-panel.active.is-entering > * {
    animation: none !important;
  }

  .sidebar button,
  .content button,
  .account-card,
  .home-candidate-card,
  .advanced-tile,
  .panel,
  .card {
    transition: none !important;
  }

  .fx-cursor { display: none; }
}

#tab-advanced,
#tab-advanced.is-entering,
#tab-advanced.is-entering > * {
  animation: none !important;
  transform: none !important;
  overflow: visible;
}

#tab-advanced {
  max-width: 760px;
  padding-bottom: 48px;
}

.advanced-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

a.advanced-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  height: auto !important;
  min-height: 0 !important;
  padding: 18px 20px !important;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 18, 32, 0.78);
  color: var(--text);
  text-decoration: none;
  box-shadow: none;
  transform: none;
  filter: none;
  overflow: visible !important;
}

a.advanced-item:hover,
a.advanced-item:focus-visible {
  transform: none;
  filter: none;
  border-color: rgba(170, 200, 255, 0.36);
  background: rgba(16, 28, 48, 0.92);
}

a.advanced-item em {
  flex: 0 0 28px;
  margin-top: 2px;
  color: var(--gold);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.08em;
}

a.advanced-item strong {
  display: block;
  font-size: 16px;
  line-height: 1.4;
}

a.advanced-item span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
