:root {
  --bg: #061018;
  --bg-2: #0a1621;
  --surface: rgba(13, 28, 41, 0.82);
  --surface-strong: rgba(16, 37, 54, 0.94);
  --line: rgba(149, 178, 194, 0.18);
  --text: #f4fbff;
  --muted: #91a9b8;
  --green: #02c39a;
  --green-soft: rgba(2, 195, 154, 0.16);
  --cyan: #2bb7ff;
  --cyan-soft: rgba(43, 183, 255, 0.16);
  --amber: #f2b84b;
  --amber-soft: rgba(242, 184, 75, 0.16);
  --red: #ff6b6b;
  --red-soft: rgba(255, 107, 107, 0.14);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  background:
    radial-gradient(circle at 18% 12%, rgba(2, 195, 154, 0.13), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(43, 183, 255, 0.13), transparent 24%),
    linear-gradient(135deg, #040b11 0%, #081722 48%, #071018 100%);
}

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

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

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: rgba(4, 12, 18, 0.88);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.brand img {
  width: 66px;
  height: 54px;
  object-fit: contain;
}

.login-logo,
.loading-logo,
.verify-panel img {
  width: 112px;
  height: auto;
  max-height: 94px;
  object-fit: contain;
}

.login-logo,
.loading-logo {
  width: 126px;
  max-height: 104px;
}

.brand strong,
.loading-core strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.brand small,
.loading-core small,
.user-chip small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.nav-stack {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.nav-stack a {
  padding: 11px 12px;
  color: #c8d8e2;
  border-radius: var(--radius);
  border: 1px solid transparent;
}

.nav-stack a:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.status-dot,
.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(2, 195, 154, 0.11);
  flex: 0 0 auto;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.eyeline {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.12;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
  margin-bottom: 0;
}

.topbar-actions,
.button-row,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.user-chip {
  min-width: 150px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(2, 195, 154, 0.45);
}

.btn.primary {
  color: #001a16;
  background: linear-gradient(135deg, var(--green), #69e6c3);
  border-color: rgba(2, 195, 154, 0.8);
  font-weight: 800;
}

.btn.secondary {
  background: var(--cyan-soft);
  border-color: rgba(43, 183, 255, 0.34);
}

.btn.ghost {
  background: transparent;
}

.btn.wide {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.panel,
.login-panel,
.verify-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), rgba(8, 18, 27, 0.78));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.metric-card {
  min-height: 128px;
  padding: 18px;
  border-top: 2px solid var(--green);
}

.metric-card.cyan {
  border-top-color: var(--cyan);
}

.metric-card.amber {
  border-top-color: var(--amber);
}

.metric-card.red {
  border-top-color: var(--red);
}

.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  margin: 12px 0 8px;
}

.metric-card span {
  color: #aac3d2;
  font-size: 13px;
}

.dashboard-grid,
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  gap: 18px;
}

.wide-panel {
  grid-column: 1 / -1;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel.narrow {
  max-width: 820px;
}

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

.panel-head > a:not(.btn) {
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

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

th {
  color: #bcd2de;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  background: rgba(255, 255, 255, 0.03);
}

td {
  color: #dceaf1;
  font-size: 14px;
}

.table-action {
  color: var(--green);
  font-weight: 800;
}

.empty,
.muted-line {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border-radius: 999px;
  color: #d8edf4;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pill.green {
  color: #a9f8e4;
  background: var(--green-soft);
  border-color: rgba(2, 195, 154, 0.35);
}

.pill.amber {
  color: #ffe3a4;
  background: var(--amber-soft);
  border-color: rgba(242, 184, 75, 0.4);
}

.pill.red {
  color: #ffc4c4;
  background: var(--red-soft);
  border-color: rgba(255, 107, 107, 0.42);
}

.pill.muted {
  color: var(--muted);
}

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

.activity-list.compact {
  gap: 6px;
}

.activity-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.activity-row strong,
.activity-row small {
  display: block;
}

.activity-row small,
.activity-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.detail-list {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
  color: #eef8fc;
  overflow-wrap: anywhere;
}

.form-grid,
.search-grid,
.form-stack {
  display: grid;
  gap: 14px;
}

.form-grid.two,
.search-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.search-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: #c5d8e3;
  font-weight: 750;
  font-size: 13px;
}

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

.field em {
  color: #ffc4c4;
  font-style: normal;
  font-size: 12px;
}

.field-check {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.field-check span {
  grid-column: 2;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  color: var(--text);
  background: rgba(2, 10, 16, 0.62);
  border: 1px solid rgba(148, 179, 196, 0.25);
  border-radius: var(--radius);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--green);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(2, 195, 154, 0.14);
}

select option {
  background: #07121b;
  color: var(--text);
}

.form-actions {
  margin-top: 14px;
}

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

.result-table input,
.result-table select {
  min-width: 170px;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  border-radius: var(--radius);
  padding: 11px 13px;
  background: var(--cyan-soft);
  border: 1px solid rgba(43, 183, 255, 0.26);
  color: #cdefff;
}

.message.success {
  background: var(--green-soft);
  border-color: rgba(2, 195, 154, 0.34);
  color: #bef9e9;
}

.message.error {
  background: var(--red-soft);
  border-color: rgba(255, 107, 107, 0.35);
  color: #ffcaca;
}

.message.warning {
  background: var(--amber-soft);
  border-color: rgba(242, 184, 75, 0.35);
  color: #ffe1a2;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 48%, rgba(2, 195, 154, 0.15), transparent 26%),
    linear-gradient(135deg, #02070b, #071521 54%, #03090e);
  transition: opacity 520ms ease, visibility 520ms ease;
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-core {
  position: relative;
  z-index: 2;
  width: min(320px, 86vw);
  padding: 28px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 18, 27, 0.7);
  box-shadow: 0 0 70px rgba(2, 195, 154, 0.18);
}

.loading-logo {
  margin-bottom: 12px;
}

.particle-field span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.65;
  animation: drift 4.5s ease-in-out infinite;
}

.particle-field span:nth-child(1) { left: 18%; top: 28%; }
.particle-field span:nth-child(2) { left: 70%; top: 22%; animation-delay: 0.6s; background: var(--cyan); }
.particle-field span:nth-child(3) { left: 78%; top: 72%; animation-delay: 1s; }
.particle-field span:nth-child(4) { left: 26%; top: 76%; animation-delay: 1.6s; background: var(--cyan); }
.particle-field span:nth-child(5) { left: 50%; top: 15%; animation-delay: 2.1s; }

@keyframes drift {
  0%, 100% { transform: translateY(0); opacity: 0.42; }
  50% { transform: translateY(-18px); opacity: 0.9; }
}

.login-body,
.verify-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.login-shell,
.verify-shell {
  width: min(480px, calc(100vw - 32px));
}

.login-panel,
.verify-panel {
  padding: 30px;
}

.login-panel h1,
.verify-panel h1 {
  font-size: 32px;
  margin: 12px 0 8px;
}

.login-panel p {
  color: var(--muted);
  margin-bottom: 22px;
}

.verify-panel {
  text-align: left;
}

.verify-mark {
  display: inline-flex;
  margin-top: 18px;
  color: #001a16;
  background: var(--green);
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 900;
}

.verify-mark.bad {
  color: #fff;
  background: var(--red);
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

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

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

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .nav-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    padding: 18px;
  }

  .topbar,
  .dashboard-grid,
  .detail-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .metric-grid,
  .form-grid.two,
  .search-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 25px;
  }

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

  .nav-stack {
    grid-template-columns: 1fr 1fr;
  }

  .panel,
  .metric-card {
    padding: 14px;
  }

  .panel-head,
  .topbar-actions,
  .button-row,
  .form-actions {
    align-items: stretch;
  }

  .btn,
  .topbar-actions form {
    width: 100%;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}


/* =====================================================================
   Atom8 Trace - public front (landing + login) and mobile navigation.
   Appended 2026 refresh. Existing rules above are unchanged.
   ===================================================================== */

/* ---- Shared auth/landing background ---- */
.landing-body,
.auth-body {
  display: block;
  min-height: 100vh;
}

.landing-body {
  display: flex;
  flex-direction: column;
}

/* ---- Public landing page ---- */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 12, 18, 0.6);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 5;
}

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

.landing-brand img {
  width: 60px;
  height: 50px;
  object-fit: contain;
}

.landing-brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.05;
}

.landing-brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.landing-main {
  flex: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(36px, 7vw, 88px) clamp(18px, 5vw, 64px) 56px;
}

.landing-hero {
  max-width: 760px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px 12px;
  border: 1px solid rgba(2, 195, 154, 0.35);
  border-radius: 999px;
  background: var(--green-soft);
  color: #a9f8e4;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.landing-hero h1 {
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}

.landing-hero h1 .accent {
  background: linear-gradient(120deg, var(--green), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-lede {
  color: #b9cdd9;
  font-size: clamp(16px, 2.1vw, 20px);
  line-height: 1.55;
  max-width: 620px;
  margin-bottom: 30px;
}

.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.btn.lg {
  min-height: 50px;
  padding: 13px 26px;
  font-size: 16px;
}

.landing-reassure {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: clamp(44px, 7vw, 72px);
}

.feature-card {
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), rgba(8, 18, 27, 0.7));
  box-shadow: var(--shadow);
}

.feature-card .feature-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--green-soft);
  border: 1px solid rgba(2, 195, 154, 0.3);
  color: #a9f8e4;
  font-weight: 900;
  font-size: 14px;
  margin-bottom: 14px;
}

.feature-card h3 {
  margin: 0 0 7px;
  font-size: 16px;
  line-height: 1.2;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.landing-footer {
  border-top: 1px solid var(--line);
  padding: 22px clamp(18px, 5vw, 64px);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
  align-items: center;
}

/* ---- Login: split panel ---- */
.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.auth-shell {
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface-strong);
}

.auth-visual {
  position: relative;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background:
    radial-gradient(circle at 20% 15%, rgba(2, 195, 154, 0.22), transparent 42%),
    radial-gradient(circle at 90% 85%, rgba(43, 183, 255, 0.2), transparent 46%),
    linear-gradient(155deg, #06141d, #0a2230 60%, #061119);
  border-right: 1px solid var(--line);
}

.auth-visual .auth-logo {
  width: 116px;
  height: auto;
  max-height: 96px;
  object-fit: contain;
}

.auth-visual h2 {
  font-size: 27px;
  line-height: 1.1;
  margin: 6px 0 0;
}

.auth-visual p {
  color: #b9cdd9;
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0;
}

.auth-points {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.auth-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #cfe1ea;
  font-size: 14px;
}

.auth-points li::before {
  content: "";
  margin-top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(2, 195, 154, 0.16);
}

.auth-visual .auth-foot {
  margin-top: auto;
  color: var(--muted);
  font-size: 12.5px;
}

.auth-form-panel {
  padding: 44px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(180deg, rgba(13, 28, 41, 0.6), rgba(8, 18, 27, 0.6));
}

.auth-form-panel .auth-logo-sm {
  display: none;
  width: 92px;
  height: auto;
  margin-bottom: 18px;
}

.auth-form-panel h1 {
  font-size: 26px;
  margin: 0 0 6px;
}

.auth-form-panel .auth-sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px;
}

.auth-form-panel .form-stack {
  gap: 16px;
}

.auth-form-panel label > span {
  display: block;
  margin-bottom: 7px;
  color: #c5d8e3;
  font-weight: 700;
  font-size: 13px;
}

.auth-form-panel input {
  min-height: 46px;
}

.auth-back {
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.auth-back a {
  color: var(--green);
  font-weight: 700;
}

/* ---- Brute-force lockout page ---- */
.lockout-panel {
  max-width: 460px;
  text-align: center;
}

.lockout-panel .lockout-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--amber-soft);
  border: 1px solid rgba(242, 184, 75, 0.4);
  font-size: 26px;
  margin-bottom: 16px;
}

/* ---- Mobile navigation drawer (app shell) ---- */
.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.menu-btn svg {
  width: 22px;
  height: 22px;
}

.topbar-lead {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 28;
  background: rgba(2, 8, 12, 0.62);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 200ms ease;
}

@media (max-width: 900px) {
  .menu-btn {
    display: inline-flex;
  }

  /* Sidebar becomes an off-canvas drawer instead of stacking inline. */
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    width: min(300px, 84vw);
    height: 100vh;
    padding: 20px 16px;
    transform: translateX(-100%);
    transition: transform 240ms ease;
    overflow-y: auto;
    background: rgba(4, 12, 18, 0.98);
  }

  .nav-stack {
    grid-template-columns: 1fr;
    margin-top: 22px;
  }

  .sidebar-footer {
    display: flex;
  }

  .app-shell.nav-open .sidebar {
    transform: translateX(0);
  }

  .app-shell.nav-open .nav-backdrop {
    display: block;
    opacity: 1;
  }

  /* Landing + login adapt to one column. */
  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 460px;
  }

  .auth-visual {
    display: none;
  }

  .auth-form-panel {
    padding: 34px 26px;
  }

  .auth-form-panel .auth-logo-sm {
    display: block;
  }

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

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

  .landing-cta .btn {
    width: 100%;
  }

  .landing-nav {
    padding: 16px 18px;
  }
}

/* Keep button labels on one line. */
.btn { white-space: nowrap; }

/* ===================== SPA-specific helpers ===================== */
[hidden] { display: none !important; }
.hidden { display: none !important; }

.view { animation: fadein 200ms ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.crumbs a { color: var(--green); font-weight: 700; }
.crumbs span.sep { opacity: 0.5; }

.section-label { display: block; color: var(--green); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; margin: 22px 0 10px; }

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

.link-btn { background: none; border: none; color: var(--green); font-weight: 800; cursor: pointer; padding: 0; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.kv { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: rgba(255,255,255,0.02); }
.kv small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.kv strong { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }

.params-editor { display: grid; gap: 8px; }
.param-line { display: grid; grid-template-columns: 1fr 1fr 1.4fr 0.7fr auto; gap: 8px; align-items: end; }
.param-line .param-del { color: var(--red); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(2,8,12,0.66); backdrop-filter: blur(3px); }
.modal { width: min(560px, 100%); max-height: 90vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-strong); box-shadow: var(--shadow); padding: 24px; }
.modal h2 { margin-bottom: 4px; }
.modal .modal-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Toast */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; gap: 8px; }
.toast { padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-strong); box-shadow: var(--shadow); font-size: 14px; max-width: 340px; animation: fadein 160ms ease; }
.toast.success { border-color: rgba(2,195,154,0.4); color: #bef9e9; }
.toast.error { border-color: rgba(255,107,107,0.4); color: #ffcaca; }
.toast.warning { border-color: rgba(242,184,75,0.4); color: #ffe1a2; }

/* QR + verify */
.qr-box { display: inline-flex; padding: 10px; background: #fff; border-radius: 8px; }
.qr-box img, .qr-box canvas { display: block; width: 150px; height: 150px; }
.verify-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.verify-shell { width: min(560px, 100%); }
.verify-panel { padding: 30px; }

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