:root {
  color-scheme: dark;
  --bg: #0b0d11;
  --bg-elev: #14171d;
  --card: #161a21;
  --border: #262c36;
  --border-hover: #38414f;
  --text: #e7eaf0;
  --muted: #9aa3b2;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --danger: #f87171;
  --ok: #34d399;
  --bg-glow: #171b22;
  --surface-subtle: rgba(255, 255, 255, 0.03);
  --surface-code: rgba(255, 255, 255, 0.06);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
}

/* Light palette. Applied to a system-light visitor who hasn't forced a theme,
   and to anyone who explicitly chooses light via the toggle. Dark remains the
   default on :root above, so an explicit data-theme="dark" always wins. */
:root[data-theme="light"],
:root[data-theme="light"] * {
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6f7f9;
    --bg-elev: #ffffff;
    --card: #ffffff;
    --border: #e4e8ee;
    --border-hover: #c7ced9;
    --text: #1a1f29;
    --muted: #596273;
    --accent: #c2690a;
    --accent-hover: #a2560a;
    --danger: #dc2626;
    --ok: #059669;
    --bg-glow: #eef1f6;
    --surface-subtle: rgba(15, 23, 42, 0.03);
    --surface-code: rgba(15, 23, 42, 0.06);
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  }
}
:root[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --border: #e4e8ee;
  --border-hover: #c7ced9;
  --text: #1a1f29;
  --muted: #596273;
  --accent: #c2690a;
  --accent-hover: #a2560a;
  --danger: #dc2626;
  --ok: #059669;
  --bg-glow: #eef1f6;
  --surface-subtle: rgba(15, 23, 42, 0.03);
  --surface-code: rgba(15, 23, 42, 0.06);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

/* The `hidden` attribute must always win: class-based display rules (.btn,
   .seg, .nav-menu, …) are more specific than the UA's [hidden]{display:none},
   so without this an element toggled via .hidden would stay visible. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(
      1200px 600px at 50% -10%,
      var(--bg-glow) 0%,
      var(--bg) 55%
    )
    no-repeat;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 16px 56px;
}

/* Header / brand */
.site-header {
  text-align: center;
  margin-bottom: 26px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  font-size: 26px;
  line-height: 1;
}
.brand-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.tagline {
  color: var(--muted);
  margin: 12px 0 0;
  font-size: 15px;
}

/* Shared top navigation */
.topnav {
  display: flex;
  flex-direction: column;
  position: relative;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
/* The always-visible top strip: brand + "Share a secret" on the left, the
   account shortcut + hamburger on the right. Never wraps — when space is tight
   the left group shrinks (truncating "Share a secret" only as a last resort)
   so the right-hand controls can't drop to a second line. */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.topnav .brand-name {
  font-size: 18px;
}
.topnav .brand-mark {
  font-size: 20px;
}
.nav-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 14px;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.nav-links a:hover {
  color: var(--text);
}
.nav-links a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

.hero {
  text-align: center;
  margin-bottom: 26px;
}
.hero .tagline {
  margin: 0;
}

/* Shared footer columns */
.footer-cols {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
  text-align: left;
  margin-bottom: 18px;
}
.footer-cols > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-cols strong {
  color: var(--text);
  font-size: 13px;
  margin-bottom: 2px;
}
.footer-cols a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.footer-cols a:hover {
  color: var(--accent);
}
.footer-zk {
  max-width: 540px;
  margin: 0 auto 8px;
}

/* Simple content page (tools + info) */
.page-content h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.page-content h2 {
  font-size: 18px;
  margin: 28px 0 10px;
}
.page-content p,
.page-content li {
  color: var(--muted);
  font-size: 15px;
}
.page-content a:not(.btn) {
  color: var(--accent);
}
.lead {
  font-size: 16px;
  margin-bottom: 20px;
}
.page-content h3 {
  font-size: 16px;
  margin: 22px 0 8px;
}
/* Info / success notice (e.g. "check your email to confirm") */
.notice {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--bg-elev);
  font-size: 15px;
}
.notice p {
  margin: 0 0 8px;
}
.notice p:last-child {
  margin-bottom: 0;
}
/* API-docs field reference (dl of request fields) */
.field-docs {
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field-docs dt {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.field-docs dd {
  margin: 0;
  padding-left: 14px;
  border-left: 2px solid var(--border);
  color: var(--muted);
  font-size: 15px;
}
.field-docs dd p {
  margin: 0 0 8px;
}
.field-docs dd p:last-child {
  margin-bottom: 0;
}
.field-docs dd ul {
  margin: 6px 0 0;
}

/* Generator tool controls */
.pw-out {
  font-family: var(--mono);
  font-size: 15px;
}
.pw-sets {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pw-sets legend {
  padding: 0 6px;
}
.pw-sets label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}
.copy-tip {
  color: var(--ok);
  font-size: 13px;
  align-self: center;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.page-content code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg-elev);
  padding: 1px 5px;
  border-radius: 5px;
}
.code-block,
.page-content pre {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre;
  margin: 0 0 8px;
}
.page-content pre code {
  background: none;
  padding: 0;
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

/* Fields */
.field {
  display: block;
  margin-bottom: 16px;
}
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
}
.field-label .muted {
  font-weight: 400;
}
.muted {
  color: var(--muted);
}

textarea,
input[type="text"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea {
  resize: vertical;
  font-family: var(--mono);
  font-size: 14px;
  min-height: 120px;
}
#secret-out {
  font-family: var(--mono);
}
textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.row {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.field-grow {
  flex: 1 1 180px;
  margin-bottom: 16px;
}

/* Label + inline action (e.g. "Generate password") */
.field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}
.field-head .field-label {
  margin-bottom: 0;
}

/* Password input with a show/hide eye toggle */
.input-reveal {
  position: relative;
  display: flex;
  align-items: center;
}
.input-reveal input {
  flex: 1;
  padding-right: 46px;
}
.eye-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--muted);
}
.eye-btn:hover {
  color: var(--text);
}
.eye-btn[aria-pressed="true"] {
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover {
  border-color: var(--border-hover);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.btn-primary {
  width: 100%;
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1203;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-ghost {
  background: transparent;
}
.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 11px 2px;
  font-family: inherit;
}
/* Align the "+ Add passphrase" toggle inline with the dropdown box:
   match the field wrapper's 16px bottom margin so flex-end lines them up,
   and nudge it right so it sits at the end of the row. */
/* The optional-protection toggles (passphrase / email / attach file) sit inline. */
.opt-row {
  gap: 20px;
  align-items: center;
  margin: 2px 0 6px;
}
#passphrase-toggle,
#email-toggle,
#file-toggle {
  white-space: nowrap;
}
.link-btn:hover {
  color: var(--accent-hover);
}

/* Result / view shared */
.result-title,
.state h2 {
  margin: 0 0 8px;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.link-row {
  display: flex;
  gap: 10px;
  margin: 14px 0;
}
.link-row input {
  font-family: var(--mono);
  font-size: 13px;
}
.link-row textarea {
  width: 100%;
}
.link-row .btn {
  flex-shrink: 0;
}

.qr {
  display: flex;
  justify-content: center;
  margin: 8px 0 18px;
}
.qr img {
  width: 180px;
  height: 180px;
  image-rendering: pixelated;
  background: #fff;
  padding: 8px;
  border-radius: 10px;
}

.state {
  text-align: center;
}
.state .field,
.state .link-row {
  text-align: left;
}
.state .btn-primary {
  margin-top: 8px;
}
.state .btn-ghost {
  margin-top: 14px;
}
.destroyed {
  margin-top: 16px;
  font-size: 14px;
}

/* Error */
.error {
  color: var(--danger);
  font-size: 14px;
  margin: 12px 0 0;
  text-align: left;
}

/* Info: How it works + FAQ (SEO content) */
.info {
  margin-top: 30px;
}
.info h2 {
  font-size: 16px;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  color: var(--text);
}
.steps {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
}
.steps li {
  margin: 7px 0;
}
.steps strong {
  color: var(--text);
}
.info details {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  padding: 0 14px;
  margin: 8px 0;
}
.info summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.info summary::-webkit-details-marker {
  display: none;
}
.info summary::after {
  content: "+";
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.info details[open] summary::after {
  content: "\2212"; /* minus */
}
.info details p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

/* Footer */
.site-footer {
  margin-top: 26px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.site-footer p {
  margin: 8px 0;
}
.site-footer strong {
  color: var(--text);
}
.site-footer .links a {
  color: var(--accent);
  text-decoration: none;
}
.site-footer .links a:hover {
  text-decoration: underline;
}

@media (max-width: 420px) {
  .wrap {
    padding: 28px 14px 44px;
  }
  .link-row {
    flex-direction: column;
  }
  .link-row .btn {
    width: 100%;
  }
}

/* ---- Accounts: nav account slot, auth forms, dashboards ---- */

/* Narrower column for focused pages (login, account) */
.page-content.narrow {
  max-width: 520px;
}

/* Account-aware nav slot (right side of the top nav) */
.nav-account {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}
.nav-account a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.nav-account a:hover {
  color: var(--text);
}
.nav-account a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}
.nav-account .link-btn {
  font-size: 14px;
  color: var(--muted);
  padding: 0;
}
.nav-account .link-btn:hover {
  color: var(--text);
}

/* Segmented control (sign in / create account) */
.seg {
  display: flex;
  gap: 4px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}
.seg-btn {
  flex: 1;
  background: none;
  border: none;
  border-radius: 9px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.seg-btn:hover {
  color: var(--text);
}
.seg-btn[aria-selected="true"] {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}

.auth-form {
  margin-top: 4px;
}
.field-hint {
  font-size: 12px;
  margin: 7px 0 0;
}

/* Key/value list (account details) */
.kv {
  margin: 0 0 20px;
}
.kv > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.kv dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.kv dd {
  margin: 0;
  text-align: right;
  word-break: break-word;
}

/* Button rows (auto width, not full-bleed primary) */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.btn-row .btn {
  width: auto;
}

/* Admin stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  text-align: center;
}
.stat-num {
  display: block;
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.small {
  font-size: 13px;
}

/* ---- Nav: a collapsible hamburger menu at every viewport width ---- */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  padding: 6px 12px;
  cursor: pointer;
}
.nav-toggle:hover {
  border-color: var(--border-hover);
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  line-height: 1;
  padding: 7px 10px;
  cursor: pointer;
}
.theme-toggle:hover {
  border-color: var(--border-hover);
}
/* Floating dropdown panel, anchored under the right edge of the nav bar. */
.nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  min-width: 224px;
  max-width: calc(100vw - 32px);
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.nav-menu.open {
  display: flex;
}
.nav-menu .nav-links,
.nav-menu .nav-account {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 100%;
}
/* A quiet divider between the tool links and the account actions. */
.nav-menu .nav-account {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.nav-menu a,
.nav-menu .link-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.nav-menu a:hover,
.nav-menu .link-btn:hover {
  background: var(--surface-code);
  color: var(--text);
}
.nav-menu a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

/* ---- Admin "preview as standard user" banner ---- */
.preview-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 14px;
}
.preview-banner .link-btn {
  color: var(--accent);
  font-weight: 600;
}

/* ---- MFA ---- */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.badge-ok {
  color: #06230f;
  background: var(--ok);
  border-color: var(--ok);
}
.badge-off {
  color: var(--muted);
}
.mfa-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.qr-box {
  display: inline-block;
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  line-height: 0;
}
.qr-box svg {
  display: block;
  width: 200px;
  height: 200px;
}
.secret-key {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.12em;
  word-break: break-all;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  -webkit-user-select: all;
  user-select: all;
}
.otp-input {
  font-family: var(--mono);
  font-size: 20px;
  letter-spacing: 0.4em;
  text-align: center;
}
.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-family: var(--mono);
  font-size: 15px;
  margin: 12px 0;
}
.recovery-codes span {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
/* API keys */
.new-key {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--bg-elev);
}
.key-reveal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.key-reveal .secret-key {
  flex: 1 1 240px;
  min-width: 0;
}
.key-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.key-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.key-row .key-name {
  font-weight: 600;
  word-break: break-word;
}
.key-row .key-meta {
  color: var(--muted);
  font-size: 13px;
  font-family: var(--mono);
}
.key-row .key-revoke {
  margin-left: auto;
}
.recovery-note {
  color: var(--danger);
  font-size: 13px;
}
.steps {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
}
.steps li {
  margin-bottom: 4px;
}

/* ---- My links ---- */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.link-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.link-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.link-id {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.link-meta {
  margin: 0;
  display: grid;
  gap: 4px;
}
.link-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.link-meta dt {
  color: var(--muted);
}
.link-meta dd {
  margin: 0;
  text-align: right;
}
.link-actions {
  margin-top: 12px;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  width: auto;
}
/* Compact inline buttons inside vault entry rows (show / hide / copy). */
.vault-mini {
  font-size: 12px;
  padding: 2px 4px;
  margin-left: 4px;
}
/* My Links: per-link access log. */
.link-activity {
  margin-top: 10px;
}
.activity-log {
  margin-top: 8px;
}
.activity-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}
.activity-list li {
  padding: 3px 0;
  border-top: 1px solid var(--border);
}

/* CLI options list on the /cli page. */
.cli-opts {
  margin: 0;
}
.cli-opts > div {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.cli-opts dt {
  margin-bottom: 3px;
}
.cli-opts dd {
  margin: 0;
  color: var(--muted);
}

/* Create-form: Markdown checkbox + the passphrase/email toggle row. */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 2px;
  cursor: pointer;
  font-size: 14px;
}
.check-row input[type="checkbox"] {
  margin-top: 3px;
  width: auto;
  flex: 0 0 auto;
}
.row-wrap {
  flex-wrap: wrap;
  gap: 18px;
}

/* Reveal page: safely rendered Markdown message. */
.secret-md {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--surface-subtle);
  overflow-wrap: anywhere;
  max-height: 440px;
  overflow: auto;
}
.secret-md > :first-child {
  margin-top: 0;
}
.secret-md > :last-child {
  margin-bottom: 0;
}
.secret-md h3,
.secret-md h4,
.secret-md h5,
.secret-md h6 {
  margin: 14px 0 6px;
  line-height: 1.25;
}
.secret-md p {
  margin: 8px 0;
}
.secret-md ul,
.secret-md ol {
  margin: 8px 0;
  padding-left: 22px;
}
.secret-md li {
  margin: 3px 0;
}
.secret-md blockquote {
  margin: 10px 0;
  padding: 4px 12px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
.secret-md code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--surface-code);
  padding: 1px 5px;
  border-radius: 5px;
}
.secret-md pre.code-block {
  margin: 10px 0;
}
.secret-md pre.code-block code {
  background: none;
  padding: 0;
}
.secret-md a {
  color: var(--accent);
}
.secret-md hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}
.badge-danger {
  color: #2a0a0a;
  background: var(--danger);
  border-color: var(--danger);
}

/* ---- Admin feature toggles ---- */
.toggle-list {
  display: flex;
  flex-direction: column;
  margin: 14px 0 4px;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.toggle-row:first-child {
  border-top: 0;
}
.toggle-desc {
  font-size: 13px;
  margin: 3px 0 0;
}
.switch {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 26px;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s;
}
.slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 0.15s, background 0.15s;
}
.switch input:checked + .slider {
  background: var(--accent);
  border-color: var(--accent);
}
.switch input:checked + .slider::before {
  transform: translateX(20px);
  background: #1a1203;
}
.switch input:focus-visible + .slider {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

.link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.link-note {
  font-size: 12px;
}

.nav-install {
  color: var(--accent);
  font-weight: 600;
}

/* ---- Nav bar groups + persistent quick links ---- */
.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* Left group takes the slack and may shrink; right group keeps its size. */
.nav-left {
  flex: 1 1 auto;
  min-width: 0;
}
.nav-right {
  flex: 0 0 auto;
  gap: 8px;
}
.brand {
  flex: 0 0 auto;
}
.nav-quick,
.nav-account-quick a,
.nav-login {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font-size: 14px;
}
/* "Share a secret" is the one part allowed to clip on very narrow screens,
   keeping the whole strip on a single row. */
.nav-quick {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-quick:hover,
.nav-account-quick a:hover,
.nav-login:hover {
  color: var(--text);
}
.nav-quick[aria-current="page"],
.nav-account-quick a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

.settings-sub {
  margin: 22px 0 4px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.view-expiry {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}
.view-expiry strong {
  color: var(--accent);
}

/* Data tables (admin account list). The wrapper owns the scrolling and is a
   container, so the table adapts to ITS width — it stays readable inside the
   admin card regardless of viewport. tabindex makes the scroll area reachable
   by keyboard; role+aria-labelledby name it. */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(560px, 70vh);
  container-type: inline-size;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 14px;
}
.table-wrapper:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.data-table {
  inline-size: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.94rem;
}
.data-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
}
.data-table th,
.data-table td {
  text-align: start;
  padding: 10px 12px;
  border-block-end: 1px solid var(--border);
  white-space: nowrap;
}
.data-table thead th {
  background: var(--bg-elev);
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.data-table tbody th {
  /* Row header: keeps the email in view while the row scrolls sideways. */
  position: sticky;
  inset-inline-start: 0;
  background: var(--card);
  font-weight: 600;
  max-inline-size: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-block-end: 0;
}
.data-table .num {
  font-variant-numeric: tabular-nums;
}
.data-table .no-rows {
  color: var(--muted);
  white-space: normal;
}
/* Non-colour state cues (a tick/dash reads without colour vision). */
.flag-yes {
  color: var(--ok);
}
.flag-no {
  color: var(--muted);
}
.role-admin {
  color: var(--accent);
  font-weight: 600;
}

/* Narrow container: stack each row into a card and inject the column labels. */
@container (width < 640px) {
  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
  }
  .data-table thead {
    /* Hidden from layout AND from assistive tech: the labels below replace it. */
    display: none;
  }
  .data-table tr {
    border-block-end: 1px solid var(--border);
    padding-block-end: 6px;
  }
  .data-table tr:last-child {
    border-block-end: 0;
  }
  .data-table tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: var(--bg-elev);
    max-inline-size: none;
  }
  .data-table th,
  .data-table td {
    border-block-end: 0;
    padding-block: 5px;
    white-space: normal;
  }
  .data-table {
    --label-2: "Role";
    --label-3: "Confirmed";
    --label-4: "2FA";
    --label-5: "Registered";
    --label-6: "Sessions";
    --label-7: "API keys";
    --label-8: "Links";
  }
  .data-table td:nth-child(2)::before {
    content: var(--label-2) ": ";
  }
  .data-table td:nth-child(3)::before {
    content: var(--label-3) ": ";
  }
  .data-table td:nth-child(4)::before {
    content: var(--label-4) ": ";
  }
  .data-table td:nth-child(5)::before {
    content: var(--label-5) ": ";
  }
  .data-table td:nth-child(6)::before {
    content: var(--label-6) ": ";
  }
  .data-table td:nth-child(7)::before {
    content: var(--label-7) ": ";
  }
  .data-table td:nth-child(8)::before {
    content: var(--label-8) ": ";
  }
  .data-table td::before {
    color: var(--muted);
  }
}

/* The account list is the one genuinely wide thing on the admin page. On a big
   screen let just that card break out of the 560px reading column (percentage
   margins resolve against the column, so this stays correct at any width) and
   the table shows real columns instead of collapsing to stacked cards. */
@media (min-width: 1040px) {
  .card-wide {
    inline-size: min(1000px, 94vw);
    margin-inline: calc(50% - min(500px, 47vw));
  }
}
