:root {
  color-scheme: dark;
  --ink: #eef7ff;
  --muted: #a6b5c7;
  --line: rgba(255, 255, 255, .14);
  --panel: rgba(10, 18, 32, .58);
  --panel-strong: rgba(13, 25, 44, .72);
  --soft: rgba(255, 255, 255, .08);
  --deep: #050812;
  --blue: #2f7cff;
  --blue-hot: #7db7ff;
  --blue-dark: #1552c5;
  --cyan: #57e6ff;
  --red: #ff6b6b;
  --amber: #ffc46b;
  --green: #8df0b0;
  --glass: blur(22px) saturate(150%);
  --shadow: 0 28px 90px rgba(0, 0, 0, .42);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(47, 124, 255, .18), transparent 32%),
    linear-gradient(210deg, rgba(87, 230, 255, .10), transparent 36%),
    linear-gradient(180deg, #050812 0%, #0a1220 48%, #03050a 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 96px);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.78), transparent 82%);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--blue-hot);
  outline-offset: 2px;
  border-radius: 6px;
}

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

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 60;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--blue);
  color: #031022;
  font-weight: 700;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ------------------------------------------------------------------ topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px clamp(18px, 4vw, 64px);
  background: rgba(5, 8, 18, .78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: var(--glass);
}

.brand, .nav a, .primary-button, .secondary-button, .ghost-button {
  text-decoration: none;
  color: inherit;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  color: var(--blue-hot);
  filter: drop-shadow(0 0 12px rgba(47, 124, 255, .64));
}

.brand-mark svg {
  width: 29px;
  height: 29px;
  stroke-width: 2.3;
}

button svg, a svg, .sidebar svg { width: 18px; height: 18px; flex: none; }

.nav {
  display: flex;
  gap: clamp(14px, 3vw, 34px);
  font-size: 14px;
  color: #d6e6f8;
}

.nav a:hover { color: var(--blue-hot); }

button, select, input { font: inherit; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-actions { display: flex; align-items: center; gap: 8px; }
.auth-actions[hidden] { display: none; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.06);
  font-size: 13px;
}
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lang-toggle, .ghost-button, .primary-button, .secondary-button {
  min-height: 42px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255,255,255,.07);
  backdrop-filter: var(--glass);
  cursor: pointer;
  white-space: nowrap;
}

.lang-toggle {
  min-width: 76px;
  color: var(--blue-hot);
  font-weight: 800;
}

.primary-button {
  border-color: rgba(47, 124, 255, .74);
  background: linear-gradient(135deg, #7db7ff, #2f7cff);
  color: #031022;
  font-weight: 800;
  box-shadow: 0 12px 32px rgba(47, 124, 255, .30);
}

.primary-button:hover { filter: brightness(1.08); }
.secondary-button:hover, .ghost-button:hover, .lang-toggle:hover {
  border-color: rgba(125, 183, 255, .68);
  background: rgba(47, 124, 255, .14);
}
.compact { min-height: 38px; font-size: 14px; }

button:disabled, input:disabled, select:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.link-button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--blue-hot);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.icon-action {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.06);
  color: var(--ink);
  cursor: pointer;
}
.icon-action:hover { border-color: rgba(125, 183, 255, .6); background: rgba(47, 124, 255, .16); }
.icon-action.danger:hover { border-color: rgba(255, 107, 107, .6); background: rgba(255, 107, 107, .16); color: var(--red); }

/* -------------------------------------------------------------------- hero */

section[id], main { scroll-margin-top: 90px; }

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(320px, .84fr) minmax(420px, 1.16fr);
  align-items: center;
  gap: clamp(28px, 5vw, 74px);
  padding: clamp(34px, 5vw, 76px) clamp(18px, 4vw, 64px) 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue-hot);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
  font-size: 12px;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 760px;
  font-size: clamp(38px, 5.4vw, 76px);
  line-height: 1.02;
  margin-bottom: 22px;
  text-shadow: 0 18px 58px rgba(0,0,0,.38);
}

.lead {
  max-width: 660px;
  color: #cad9ea;
  font-size: clamp(16px, 1.7vw, 20px);
  line-height: 1.55;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0; }

.hero-media {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(125, 183, 255, .28);
  background: rgba(255,255,255,.06);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter: var(--glass);
}

.hero-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 620px;
  object-fit: cover;
  opacity: .9;
  filter: saturate(1.08) contrast(1.06);
}

/* ----------------------------------------------------------------- metrics */

.metrics-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 0 clamp(18px, 4vw, 64px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255,255,255,.08);
  backdrop-filter: var(--glass);
}

.metrics-band div {
  padding: 26px clamp(18px, 4vw, 40px);
  background: rgba(255,255,255,.045);
}

.metrics-band span { display: block; font-size: 32px; font-weight: 800; color: var(--blue-hot); }
.metrics-band small { color: var(--muted); }

/* --------------------------------------------------------------- workspace */

.workspace {
  position: relative;
  display: grid;
  grid-template-columns: 248px 1fr;
  max-width: 1280px;
  margin: 64px auto;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass);
  overflow: hidden;
}

.workspace.locked > .sidebar,
.workspace.locked > .console {
  filter: blur(2px) saturate(.6);
  opacity: .5;
  user-select: none;
  pointer-events: none;
}

.console-lock {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 8, 16, .58);
  backdrop-filter: blur(3px);
}
.console-lock[hidden] { display: none; }

.lock-card {
  max-width: 460px;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 30px;
  text-align: center;
  border: 1px solid rgba(125, 183, 255, .34);
  border-radius: var(--radius);
  background: rgba(9, 16, 30, .92);
  box-shadow: var(--shadow);
}

.lock-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  color: #031022;
  background: linear-gradient(135deg, var(--blue-hot), var(--blue));
}
.lock-mark svg { width: 22px; height: 22px; }

.lock-card h3 { margin: 0; font-size: 22px; }
.lock-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.lock-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }

.sidebar {
  background: rgba(6, 11, 22, .55);
  padding: 18px;
  border-right: 1px solid var(--line);
}

.side-item {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #c8d8ea;
  text-align: left;
  cursor: pointer;
}

.side-item.active, .side-item:hover:not(:disabled) {
  border-color: rgba(125, 183, 255, .36);
  background: rgba(47, 124, 255, .14);
  color: #fff;
}

.console { min-width: 0; padding: clamp(20px, 3vw, 34px); }

.console-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.console h2 { font-size: 28px; margin: 0; }
.panel { display: none; }
.panel.active { display: block; }
.panel:focus { outline: none; }

.panel-hint { color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 720px; }
.empty-note { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------------ tables */

.table-tools {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.08);
}

.search input {
  border: 0;
  outline: 0;
  width: 100%;
  color: var(--ink);
  background: transparent;
}

select, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input:not([type]) {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255,255,255,.08);
  padding: 0 12px;
}

select option { color: #eef7ff; background: #081425; }
::placeholder { color: #7f93ab; opacity: 1; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.045);
}
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
th { color: #b7cce6; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(47, 124, 255, .10); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
.col-actions { width: 1%; white-space: nowrap; }
.col-actions button + button { margin-left: 6px; }

.empty-state {
  height: 72px;
  color: var(--muted);
  text-align: center;
}
.status { display: inline-block; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 800; }
.active-badge { color: #092516; background: var(--green); }
.paused-badge { color: #061323; background: #94c5ff; }
.expired-badge { color: #2a0d0d; background: var(--amber); }

/* -------------------------------------------------------------- 2FA panel */

.twofa-grid {
  display: grid;
  grid-template-columns: minmax(260px, .78fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}

.setup-box, .qr-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: rgba(255,255,255,.06);
  backdrop-filter: var(--glass);
}

.setup-box h3 { margin-bottom: 8px; }
.setup-box p { color: var(--muted); line-height: 1.5; font-size: 14px; }
.setup-box label { display: grid; gap: 7px; margin-bottom: 12px; color: #d8e9fb; font-size: 13px; }

.qr-box {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  min-height: 300px;
}

.qr-frame { background: white; padding: 12px; border-radius: var(--radius); line-height: 0; }
.qr-frame:has(canvas[hidden]) { display: none; }
#qr { width: min(240px, 60vw) !important; height: auto !important; display: block; }
.qr-placeholder { margin: 0; color: var(--muted); font-size: 14px; text-align: center; max-width: 260px; }

.secret-line {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0,0,0,.34);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}
.secret-line[hidden] { display: none; }

.secret-line button {
  border: 0;
  background: transparent;
  color: var(--blue-hot);
  cursor: pointer;
  flex: none;
}

#otp-uri {
  max-width: 100%;
  color: var(--muted);
  overflow-wrap: anywhere;
  text-align: center;
  font-size: 12px;
}

.saved-keys { margin-top: 24px; }
.saved-keys h3 { font-size: 18px; margin-bottom: 12px; }
.totp-list { display: grid; gap: 10px; }

.totp-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.045);
}
.totp-item strong { display: block; }
.totp-item small { color: var(--muted); }
.totp-item-actions { display: flex; align-items: center; gap: 8px; }

.field-error {
  margin: 0 0 4px;
  color: #ffb3b3;
  font-size: 13px;
  line-height: 1.45;
}
.field-error[hidden] { display: none; }

/* ----------------------------------------------------------------- devices */

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.device-grid article {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255,255,255,.06);
  backdrop-filter: var(--glass);
}

.device-grid strong { overflow-wrap: anywhere; font-size: 14px; }
.device-grid span { color: var(--muted); font-size: 13px; }
.device-grid .risk { border-color: rgba(255, 107, 107, .42); background: rgba(255, 107, 107, .08); }
.device-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.device-actions .ghost-button { font-size: 12px; padding: 0 10px; min-height: 34px; }

/* ---------------------------------------------------------------- features */

.feature-head { margin: 14px 0 16px; }
.inline-field { display: inline-grid; gap: 6px; font-size: 13px; color: #d8e9fb; }

.feature-list {
  display: grid;
  gap: 10px;
  max-width: 560px;
}

.feature-list label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.045);
  cursor: pointer;
}

.feature-list input { width: 22px; height: 22px; accent-color: var(--blue); flex: none; }

/* ------------------------------------------------------------------ audit */

.audit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.audit-head .panel-hint { margin: 0; }

.audit-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.audit-list li {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.045);
}

.audit-list span { display: block; font-weight: 700; }
.audit-list small { color: var(--muted); overflow-wrap: anywhere; }

/* -------------------------------------------------------- live 2FA section */

.live-section {
  max-width: 1180px;
  margin: 80px auto;
  padding: 0 clamp(18px, 4vw, 24px);
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(300px, 1fr);
  gap: clamp(24px, 4vw, 54px);
  align-items: center;
}

.live-head h2 { font-size: clamp(28px, 3.6vw, 42px); }
.live-head .lead { font-size: 16px; }

.public-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid rgba(141, 240, 176, .38);
  border-radius: 999px;
  background: rgba(141, 240, 176, .10);
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}
.public-badge svg { width: 15px; height: 15px; }

.live-card {
  display: grid;
  gap: 12px;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid rgba(125, 183, 255, .3);
  border-radius: var(--radius);
  background: rgba(255,255,255,.06);
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass);
}

.live-secret { color: #d8e9fb; font-size: 13px; margin: 0; }
.live-row { display: flex; gap: 10px; flex-wrap: wrap; }
.live-row input { flex: 1 1 220px; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.code-output {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "code copy"
    "meta meta";
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(125, 183, 255, .44);
  border-radius: var(--radius);
  background: rgba(0,0,0,.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}

#live-code {
  grid-area: code;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(30px, 6vw, 40px);
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.1;
}

#copy-code {
  grid-area: copy;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.12);
  color: white;
  cursor: pointer;
}
#copy-code:hover { background: rgba(47, 124, 255, .26); }

.code-meta { grid-area: meta; display: flex; align-items: center; gap: 10px; }
#code-timer { color: var(--cyan); font-variant-numeric: tabular-nums; min-width: 34px; }

.code-progress {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
}
.code-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  transition: width .45s linear;
}

.live-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* -------------------------------------------------------------------- api */

.split-section {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(24px, 5vw, 70px);
  align-items: center;
  max-width: 1180px;
  margin: 70px auto;
  padding: 0 20px;
}

.split-section h2 { font-size: clamp(28px, 3.6vw, 44px); }
.split-section p { color: var(--muted); line-height: 1.65; }
pre {
  margin: 0;
  overflow-x: auto;
  padding: 22px;
  border: 1px solid rgba(125, 183, 255, .22);
  border-radius: var(--radius);
  color: #e8f4ff;
  background: rgba(0,0,0,.44);
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass);
  font-size: 13px;
  line-height: 1.55;
}

/* ----------------------------------------------------------------- footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 20px 40px;
  border-top: 1px solid var(--line);
  font-weight: 700;
}
.site-footer small { color: var(--muted); font-weight: 400; }

/* ----------------------------------------------------------------- modals */

.modal {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
.modal::backdrop { background: rgba(2, 5, 12, .72); backdrop-filter: blur(4px); }

.modal-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 28px;
  border: 1px solid rgba(125, 183, 255, .3);
  border-radius: var(--radius);
  background: #0a1220;
  box-shadow: var(--shadow);
}

.modal-card h3 { margin: 0; font-size: 22px; padding-right: 32px; }
.modal-copy { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255,255,255,.08);
  color: var(--ink);
  cursor: pointer;
}
.modal-close:hover { background: rgba(255,255,255,.16); }

.stack { display: grid; gap: 6px; font-size: 13px; color: #d8e9fb; }
.stack[hidden] { display: none; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-switch { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.modal-disclaimer { margin: 0; font-size: 12px; color: #8397ad; line-height: 1.5; }

/* ----------------------------------------------------------------- toasts */

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 8px;
  justify-items: end;
  pointer-events: none;
}

.toast {
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 16px;
  border: 1px solid rgba(125, 183, 255, .4);
  border-radius: var(--radius);
  background: #0c1728;
  box-shadow: var(--shadow);
  font-size: 14px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .3s ease, transform .3s ease;
}
.toast.out { opacity: 0; transform: translateY(8px); }
.toast-warn { border-color: rgba(255, 196, 107, .5); color: var(--amber); }
.toast-error { border-color: rgba(255, 107, 107, .5); color: #ffb3b3; }

/* -------------------------------------------------------------- api block */

.api-points {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.api-points li { position: relative; padding-left: 22px; }

.api-points li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue-hot);
}

.api-endpoint { margin: 0; }
.api-endpoint code {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid rgba(125, 183, 255, .3);
  border-radius: var(--radius);
  background: rgba(0,0,0,.34);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.key-badge { width: 14px; height: 14px; color: var(--green); vertical-align: -2px; }
.device-key { font-size: 12px; opacity: .75; overflow-wrap: anywhere; }
.lock-note { margin: 4px 0 0; color: var(--amber); font-size: 13px; }
.lock-note[hidden] { display: none; }

/* ---------------------------------------------------------- verify dialog */

.modal-wide { width: min(620px, calc(100vw - 32px)); }

.verify-result { display: grid; gap: 10px; margin-top: 4px; }
.verify-result[hidden] { display: none; }

.verify-status { margin: 0; font-weight: 800; }
.verify-status.ok { color: var(--green); }
.verify-status.bad { color: #ffb3b3; }

.modal-card pre {
  max-height: 280px;
  overflow: auto;
  padding: 14px;
  font-size: 12px;
  box-shadow: none;
}

input[readonly] { color: var(--muted); background: rgba(255,255,255,.04); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1080px) {
  .live-section { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  /* No burger menu: the nav moves to a scrollable second row so every section
     stays reachable instead of disappearing. */
  .topbar { flex-wrap: wrap; }
  .nav {
    order: 3;
    width: 100%;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0 2px;
    border-top: 1px solid var(--line);
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  section[id], main { scroll-margin-top: 132px; }
  .hero { min-height: calc(100vh - 132px); }
  .hero, .workspace, .split-section { grid-template-columns: 1fr; }
  .metrics-band { grid-template-columns: repeat(2, 1fr); }
  .sidebar { display: flex; overflow-x: auto; gap: 8px; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
  .side-item { width: auto; min-width: max-content; padding: 0 14px; margin: 0; flex: 0 0 auto; }
  .twofa-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .topbar { flex-wrap: wrap; padding: 10px 18px; }
  .top-actions { gap: 6px; }
  .lang-toggle { min-width: 54px; padding: 0 8px; }
  .lang-toggle svg { display: none; }
  .user-chip { max-width: 130px; }
  .metrics-band { grid-template-columns: 1fr; }
  .metrics-band { margin-inline: 18px; }
  .table-tools, .console-head { flex-direction: column; align-items: stretch; }
  .modal-grid { grid-template-columns: 1fr; }
  h1 { font-size: 38px; }
  .workspace { margin: 40px 18px; }
}
