/* ==========================================================================
   Smile Auth - styles
   The same tokens, header, footer and sidebar layout as smilehosting.tech,
   plus the vault's own pieces (code cards, the unlock screen, animations).
   No inline styles anywhere (the page's security policy forbids them).
   ========================================================================== */

@font-face { font-family: "Plus Jakarta Sans"; src: url(/assets/fonts/plus-jakarta-sans.woff2) format("woff2"); font-weight: 500 800; font-display: swap; }
@font-face { font-family: Inter; src: url(/assets/fonts/inter.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/assets/fonts/jetbrains-mono.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --primary: #f2c200;
  --primary-2: #ffd84d;
  --primary-ink: #1c1600;
  --primary-soft: rgba(242, 194, 0, 0.13);
  --bg: #091424;
  --bg-2: #0c1b30;
  --surface: #0f2038;
  --surface-2: #132846;
  --surface-3: #183152;
  --overlay: rgba(4, 10, 20, 0.72);
  --text: #f3f6fb;
  --text-2: #d3dce8;
  --muted: #93a5bc;
  --faint: #677c96;
  --border: rgba(147, 176, 214, 0.14);
  --border-2: rgba(147, 176, 214, 0.26);
  --border-accent: rgba(242, 194, 0, 0.38);
  --success: #6ee7a0;
  --success-soft: rgba(52, 211, 120, 0.14);
  --danger: #fb8f8f;
  --danger-soft: rgba(248, 113, 113, 0.13);
  --border-danger: rgba(248, 113, 113, 0.32);
  --warning: #fbcb4a;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --info: #7cc4fa;
  --info-soft: rgba(96, 165, 250, 0.13);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow: 0 24px 60px rgba(2, 8, 18, 0.55);
  --shadow-soft: 0 10px 28px rgba(2, 8, 18, 0.32);
  --ring: 0 0 0 3px rgba(242, 194, 0, 0.22);
  --font: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Plus Jakarta Sans", Inter, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", Consolas, ui-monospace, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --sidebar: 262px;
}

/* ---------------------------------------------------------------- base */
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--font); font-size: 15px; line-height: 1.6; color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 12% -8%, rgba(242, 194, 0, 0.09), transparent 60%),
    radial-gradient(900px 600px at 95% 0%, rgba(60, 120, 200, 0.12), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { color: var(--text); line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.6em; }
h1, h2 { font-family: var(--font-display); font-weight: 800; }
h3, h4 { font-weight: 700; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code, kbd { font-family: var(--font-mono); font-size: 0.88em; background: rgba(147, 176, 214, 0.1); padding: 0.08em 0.4em; border-radius: 5px; }
::selection { background: rgba(242, 194, 0, 0.35); color: #fff; }
:focus-visible { outline: none; box-shadow: var(--ring); }
* { scrollbar-width: thin; scrollbar-color: rgba(147, 176, 214, 0.3) transparent; }
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.i-lg { width: 1.5em; height: 1.5em; }
.container { width: min(1200px, calc(100% - 2.5rem)); margin: 0 auto; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.85rem; }
.mono { font-family: var(--font-mono); }
.eyebrow { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }
.lead { font-size: 1.08rem; color: var(--text-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 0.8rem; }
.spacer { flex: 1; }
.center { text-align: center; }

/* ---------------------------------------------------------------- brand */
.brand { display: inline-flex; align-items: center; gap: 0.65rem; font-family: var(--font-display); font-weight: 800; font-size: 1.02rem; letter-spacing: -0.01em; color: var(--text); white-space: nowrap; }
.brand b { color: var(--primary); font-weight: 800; }
.brand img { width: 36px; height: 36px; border-radius: 11px; box-shadow: 0 6px 16px rgba(242, 194, 0, 0.18); }

/* ---------------------------------------------------------------- site header / footer (public pages) */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(9, 20, 36, 0.78); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid var(--border); }
.navbar { display: flex; align-items: center; gap: 1.5rem; height: 68px; }
.nav-links { display: flex; align-items: center; gap: 0.2rem; flex: 1; min-width: 0; }
.nav-links a { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.75rem; border-radius: 8px; color: var(--muted); font-size: 0.92rem; font-weight: 500; white-space: nowrap; transition: color 140ms ease, background 140ms ease; }
.nav-links a:hover { color: var(--text); background: rgba(147, 176, 214, 0.08); }
.nav-links a.active { color: var(--text); }
.nav-spacer { flex: 1; }
.nav-links a.nav-dash { padding: 0.55rem 1rem; border-radius: 9px; background: linear-gradient(180deg, var(--primary-2), var(--primary)); color: var(--primary-ink); font-weight: 700; font-size: 0.9rem; box-shadow: 0 6px 18px rgba(242, 194, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.nav-links a.nav-dash:hover { background: linear-gradient(180deg, #ffe066, var(--primary-2)); color: var(--primary-ink); }
.mobile-toggle { display: none; margin-left: auto; width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); align-items: center; justify-content: center; cursor: pointer; }
.footer { margin-top: 2rem; padding: 3.5rem 0 2rem; color: var(--muted); border-top: 1px solid var(--border); background: linear-gradient(180deg, rgba(6, 13, 25, 0.4), rgba(6, 13, 25, 0.9)); font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); gap: 2rem; }
.footer h3 { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); margin: 0 0 0.9rem; }
.footer p { margin: 0 0 0.55rem; }
.footer a:hover { color: var(--text); }
.footer .brand { margin-bottom: 0.9rem; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid var(--border); font-size: 0.84rem; }
@media (max-width: 900px) {
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 0.8rem 1rem 1rem; background: rgba(9, 20, 36, 0.97); border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-spacer { display: none; }
  .mobile-toggle { display: inline-flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.68rem 1.1rem; border-radius: 10px; border: 1px solid transparent; font-weight: 650; font-size: 0.92rem; line-height: 1.2; cursor: pointer; white-space: nowrap; background: var(--surface-2); border-color: var(--border); color: var(--text); transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms var(--ease-spring), color 150ms ease; }
.btn:hover { background: var(--surface-3); border-color: var(--border-2); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(180deg, var(--primary-2), var(--primary)); color: var(--primary-ink); border-color: transparent; box-shadow: 0 6px 18px rgba(242, 194, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-primary:hover { background: linear-gradient(180deg, #ffe066, var(--primary-2)); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(147, 176, 214, 0.08); color: var(--text); border-color: transparent; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--border-danger); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.22); border-color: var(--danger); }
.btn-sm { padding: 0.42rem 0.7rem; font-size: 0.84rem; border-radius: 8px; }
.btn-lg { padding: 0.85rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; transition: background 140ms ease, color 140ms ease, transform 140ms var(--ease-spring); }
.icon-btn:hover { background: rgba(147, 176, 214, 0.1); color: var(--text); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn.on { color: var(--primary); }
.btn .spin, .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: 0.35rem; }
.field > span, .label { font-size: 0.84rem; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 0.8rem; color: var(--faint); }
.input, .select, .textarea { width: 100%; padding: 0.68rem 0.85rem; border-radius: 10px; border: 1px solid var(--border-2); background: rgba(6, 13, 25, 0.55); color: var(--text); transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--border-accent); box-shadow: var(--ring); background: rgba(6, 13, 25, 0.8); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input.mono { letter-spacing: 0.02em; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-right: 5.2rem; }
.input-wrap .input-actions { position: absolute; right: 0.3rem; display: flex; gap: 0.1rem; }
.input-wrap .input-actions .icon-btn { width: 30px; height: 30px; }
.error-text { color: var(--danger); font-size: 0.86rem; min-height: 1.2em; }
.error-text:empty { min-height: 0; }
.check { display: flex; align-items: flex-start; gap: 0.6rem; cursor: pointer; font-size: 0.92rem; }
.check input { margin-top: 0.25rem; accent-color: var(--primary); width: 16px; height: 16px; flex: none; }

/* switch */
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-2); transition: background 200ms ease; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-2); transition: transform 260ms var(--ease-spring), background 200ms ease; }
.switch input:checked + span { background: var(--primary); border-color: var(--primary); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--primary-ink); }
.switch input:focus-visible + span { box-shadow: var(--ring); }

/* strength meter */
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 0.3rem; }
.meter i { height: 4px; border-radius: 4px; background: var(--surface-3); transition: background 240ms ease; }
.meter[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.meter[data-score="2"] i:nth-child(-n+2) { background: var(--warning); }
.meter[data-score="3"] i:nth-child(-n+3) { background: var(--success); }
.meter[data-score="4"] i { background: var(--success); }

/* ---------------------------------------------------------------- cards, pills, chips */
.card { background: linear-gradient(180deg, rgba(19, 40, 70, 0.72), rgba(15, 32, 56, 0.72)); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.3rem; box-shadow: var(--shadow-soft); }
.card h2 { font-size: 1.15rem; }
.card + .card { margin-top: 1rem; }
.pill { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.7rem; border-radius: 999px; border: 1px solid var(--border-accent); background: var(--primary-soft); color: var(--primary-2); font-size: 0.8rem; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.12rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.badge.gold { background: var(--primary-soft); color: var(--primary-2); }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.75rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 0.84rem; font-weight: 600; cursor: pointer; transition: all 160ms ease; }
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip.active { color: var(--primary-ink); background: var(--primary); border-color: var(--primary); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.notice { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.8rem 1rem; border-radius: 12px; font-size: 0.9rem; line-height: 1.5; background: var(--info-soft); color: var(--info); border: 1px solid rgba(96, 165, 250, 0.25); }
.notice.warn { background: var(--warning-soft); color: var(--warning); border-color: rgba(251, 191, 36, 0.3); }
.notice.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--border-danger); }
.notice.good { background: var(--success-soft); color: var(--success); border-color: rgba(52, 211, 120, 0.3); }
.notice .i { margin-top: 0.15rem; }
.notice strong { color: inherit; }
.empty { text-align: center; padding: 3.5rem 1rem; color: var(--muted); }
.empty .empty-art { width: 84px; height: 84px; margin: 0 auto 1rem; border-radius: 24px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); animation: float 5s ease-in-out infinite; }
.empty .empty-art .i { width: 40px; height: 40px; }
.empty h3 { color: var(--text); font-size: 1.15rem; }

/* ---------------------------------------------------------------- app shell */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 1.1rem 0.9rem; border-right: 1px solid var(--border); background: rgba(8, 17, 31, 0.72); backdrop-filter: blur(14px); overflow-y: auto; }
.sidebar > .brand { padding: 0.2rem 0.4rem 1rem; }
.side-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin: 1rem 0 0.35rem; padding: 0 0.7rem; }
.side-nav { display: grid; gap: 2px; position: relative; }
.side-link { position: relative; display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.7rem; border-radius: 10px; color: var(--muted); font-size: 0.91rem; font-weight: 550; cursor: pointer; border: 0; background: none; text-align: left; width: 100%; transition: color 160ms ease, background 160ms ease; }
.side-link:hover { color: var(--text); background: rgba(147, 176, 214, 0.07); }
.side-link.active { color: var(--text); background: linear-gradient(90deg, rgba(242, 194, 0, 0.14), rgba(242, 194, 0, 0.02)); }
.side-link.active::before { content: ""; position: absolute; left: -0.9rem; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); animation: grow-y 260ms var(--ease-out); }
.side-link .count { margin-left: auto; font-size: 0.75rem; color: var(--faint); font-weight: 600; }
.side-link .i { width: 18px; height: 18px; }
.side-link img { width: 20px; height: 20px; border-radius: 6px; }
.side-link .dot { width: 9px; height: 9px; border-radius: 50%; margin: 0 4px; flex: none; }
.side-profile { margin-top: auto; display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 0.5rem 0.2rem; border-top: 1px solid var(--border); }
.avatar { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; color: var(--primary-ink); background: linear-gradient(135deg, var(--primary), #ffe27a); }
.side-profile .who { min-width: 0; flex: 1; }
.side-profile .who b { display: block; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-profile .who span { display: block; font-size: 0.76rem; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { min-width: 0; padding: 1.4rem clamp(1rem, 3vw, 2.4rem) 4rem; }
.topbar { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1.3rem; }
.topbar h1 { margin: 0; font-size: 1.55rem; }
.search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.search .input { padding-left: 2.4rem; border-radius: 12px; }
.search .i { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search kbd { position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%); font-size: 0.72rem; color: var(--faint); }
.menu-toggle { display: none; }
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: min(86vw, 300px); transform: translateX(-102%); transition: transform 320ms var(--ease-out); box-shadow: var(--shadow); background: rgba(8, 17, 31, 0.98); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-grid; }
  .search { max-width: none; }
  .scrim { position: fixed; inset: 0; z-index: 55; background: var(--overlay); animation: fade-in 200ms ease; }
}

/* ---------------------------------------------------------------- code cards (authenticator) */
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0.9rem; }
.codes.compact { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.6rem; }
.code-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.9rem; padding: 1rem 1.05rem; border-radius: 16px; border: 1px solid var(--border); background: linear-gradient(180deg, rgba(19, 40, 70, 0.78), rgba(15, 32, 56, 0.78)); cursor: pointer; user-select: none; overflow: hidden; animation: card-in 420ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 28ms); transition: border-color 160ms ease, transform 200ms var(--ease-out), box-shadow 200ms ease; }
.code-card:hover { border-color: var(--border-2); transform: translateY(-2px); box-shadow: 0 14px 30px rgba(2, 8, 18, 0.4); }
.code-card:active { transform: scale(0.985); }
.code-card.dragging { opacity: 0.4; }
.code-card.drop-before { box-shadow: -3px 0 0 var(--primary); }
.compact .code-card { padding: 0.7rem 0.8rem; gap: 0.7rem; }
.svc-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: #fff; flex: none; background: var(--c1, #3a5a86); background-image: linear-gradient(135deg, var(--c1, #3a5a86), var(--c2, #22406a)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15); overflow: hidden; }
.svc-icon img { width: 100%; height: 100%; object-fit: cover; }
/* a website's own icon: big ones fill the tile, small favicons sit on white like a browser tab */
.svc-icon.site { background: #fff; background-image: none; }
.svc-icon.site.pad { padding: 18%; }
.svc-icon.site.pad img { object-fit: contain; }
.compact .svc-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 0.9rem; }
.code-meta { min-width: 0; }
.code-meta .issuer { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-meta .account { font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-value { font-family: var(--font-mono); font-weight: 700; font-size: 1.62rem; letter-spacing: 0.06em; color: var(--text); display: flex; gap: 0.45em; margin-top: 0.25rem; }
.compact .code-value { font-size: 1.25rem; margin-top: 0.1rem; }
.code-value .digit { display: inline-block; animation: digit-in 380ms var(--ease-out) both; animation-delay: calc(var(--d, 0) * 22ms); }
.code-value.hidden-code { filter: blur(7px); transition: filter 220ms ease; }
.code-card:hover .code-value.hidden-code, .code-card:focus-visible .code-value.hidden-code, .code-value.hidden-code.reveal { filter: none; }
.code-value.expiring { color: var(--danger); }
.code-next { font-size: 0.74rem; color: var(--faint); font-family: var(--font-mono); margin-top: 0.1rem; }
.code-side { display: grid; justify-items: center; gap: 0.2rem; }
.ring { width: 38px; height: 38px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.2; }
.ring .track { stroke: rgba(147, 176, 214, 0.15); }
.ring .bar { stroke: var(--primary); stroke-linecap: round; stroke-dasharray: 100.53; transition: stroke-dashoffset 1s linear, stroke 300ms ease; }
.ring.low .bar { stroke: var(--danger); }
.ring .secs { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.72rem; font-weight: 700; color: var(--muted); font-family: var(--font-mono); }
.ring.low .secs { color: var(--danger); animation: pulse 1s ease-in-out infinite; }
.code-card .fav { position: absolute; top: 8px; right: 10px; color: var(--primary); width: 13px; height: 13px; }
.code-card .copied { position: absolute; inset: 0; display: grid; place-items: center; gap: 0.3rem; background: rgba(9, 20, 36, 0.9); color: var(--success); font-weight: 700; opacity: 0; pointer-events: none; }
.code-card.did-copy .copied { animation: copied 1.1s var(--ease-out); }
.code-card .copied .i { width: 30px; height: 30px; stroke-width: 2.4; }
.code-card.did-copy .copied path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 420ms 80ms var(--ease-out) forwards; }
.code-card .more { opacity: 0; transition: opacity 140ms ease; }
.code-card:hover .more, .code-card:focus-within .more { opacity: 1; }
.hotp-next { font-size: 0.74rem; }

/* ---------------------------------------------------------------- lists (passwords, notes, cards) */
.list { display: grid; gap: 0.35rem; }
.list-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.85rem; padding: 0.7rem 0.85rem; border-radius: 12px; border: 1px solid transparent; cursor: pointer; animation: card-in 380ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 18ms); transition: background 140ms ease, border-color 140ms ease; }
.list-item:hover { background: rgba(147, 176, 214, 0.06); border-color: var(--border); }
.list-item.selected { background: var(--primary-soft); border-color: var(--border-accent); }
.list-item .title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .sub { font-size: 0.82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .actions { display: flex; gap: 0.15rem; opacity: 0.6; transition: opacity 140ms ease; }
.list-item:hover .actions { opacity: 1; }
.split { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .split .detail { order: -1; } }
.detail { position: sticky; top: 1rem; animation: slide-in 320ms var(--ease-out); }
.detail-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1rem; }
.detail-head .svc-icon { width: 52px; height: 52px; font-size: 1.3rem; border-radius: 14px; }
.detail-head h2 { margin: 0; font-size: 1.3rem; }
.kv { display: grid; gap: 0.15rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: 0; }
.kv .k { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); }
.kv .v { display: flex; align-items: center; gap: 0.4rem; min-width: 0; word-break: break-all; }
.kv .v .text { flex: 1; min-width: 0; }
.kv .v.secret .text { font-family: var(--font-mono); letter-spacing: 0.04em; }

/* ---------------------------------------------------------------- tabs, segmented, table */
.tabs { display: inline-flex; gap: 0.25rem; padding: 0.25rem; border-radius: 12px; background: rgba(6, 13, 25, 0.5); border: 1px solid var(--border); position: relative; }
.tab { position: relative; z-index: 1; padding: 0.45rem 0.85rem; border-radius: 9px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 0.88rem; cursor: pointer; display: inline-flex; gap: 0.4rem; align-items: center; transition: color 160ms ease; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary-ink); }
.tabs .glider { position: absolute; z-index: 0; top: 0.25rem; bottom: 0.25rem; border-radius: 9px; background: var(--primary); transition: left 300ms var(--ease-out), width 300ms var(--ease-out); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
.table td { padding: 0.65rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.setting { display: flex; align-items: center; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting .what { flex: 1; min-width: 0; }
.setting .what b { display: block; font-weight: 650; }
.setting .what span { display: block; font-size: 0.84rem; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- modal, toast, menu */
.modal-back { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 1rem; background: var(--overlay); backdrop-filter: blur(6px); animation: fade-in 200ms ease; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 2rem); overflow-y: auto; padding: 1.5rem; border-radius: 20px; border: 1px solid var(--border-2); background: linear-gradient(180deg, #13294a, #0f2038); box-shadow: var(--shadow); animation: pop-in 320ms var(--ease-spring); }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.modal-head h2 { margin: 0; font-size: 1.25rem; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.3rem; flex-wrap: wrap; }
.modal-back.closing { animation: fade-out 180ms ease forwards; }
.modal-back.closing .modal { animation: pop-out 180ms ease forwards; }
.toasts { position: fixed; z-index: 100; bottom: 1.2rem; left: 50%; transform: translateX(-50%); display: grid; gap: 0.5rem; justify-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1.1rem; border-radius: 12px; background: #183152; border: 1px solid var(--border-2); box-shadow: var(--shadow); font-weight: 600; font-size: 0.9rem; animation: toast-in 380ms var(--ease-spring); pointer-events: auto; }
.toast.good .i { color: var(--success); }
.toast.bad .i { color: var(--danger); }
.toast.leaving { animation: toast-out 260ms ease forwards; }
.menu { position: fixed; z-index: 95; min-width: 200px; padding: 0.35rem; border-radius: 12px; border: 1px solid var(--border-2); background: #13294a; box-shadow: var(--shadow); animation: menu-in 180ms var(--ease-out); transform-origin: top right; }
.menu button { display: flex; width: 100%; align-items: center; gap: 0.6rem; padding: 0.5rem 0.65rem; border: 0; border-radius: 8px; background: none; color: var(--text-2); cursor: pointer; font-size: 0.88rem; text-align: left; }
.menu button:hover { background: rgba(147, 176, 214, 0.1); color: var(--text); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; height: 1px; background: var(--border); margin: 0.3rem 0; }

/* ---------------------------------------------------------------- sign-in / unlock screens */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.gate-card { width: min(440px, 100%); padding: 2rem; border-radius: 22px; border: 1px solid var(--border-2); background: linear-gradient(180deg, rgba(19, 41, 74, 0.88), rgba(15, 32, 56, 0.9)); box-shadow: var(--shadow); animation: pop-in 460ms var(--ease-spring); }
.gate-card.wide { width: min(620px, 100%); }
.gate-card h1 { font-size: 1.55rem; margin-bottom: 0.3rem; }
.gate-card .brand { margin-bottom: 1.4rem; }
.gate-card form { display: grid; gap: 0.9rem; margin-top: 1.2rem; }
.lock-art { width: 88px; height: 88px; margin: 0 auto 1rem; display: block; }
.lock-art .shackle { transform-origin: 62px 40px; transition: transform 520ms var(--ease-spring); }
.lock-art .body { transition: transform 300ms var(--ease-out); }
.lock-art.opening .shackle { transform: translateY(-7px) rotate(28deg); }
.lock-art.shake { animation: shake 420ms ease; }
.lock-art .keyhole { transition: fill 200ms ease; }
.lock-art.opening .keyhole { fill: var(--success); }
.kit { font-family: var(--font-mono); font-size: 1.02rem; font-weight: 700; letter-spacing: 0.05em; line-height: 1.9; padding: 1rem 1.1rem; border-radius: 12px; border: 1px dashed var(--border-accent); background: rgba(242, 194, 0, 0.06); color: var(--primary-2); word-break: break-all; user-select: all; text-align: center; }
.steps { display: flex; gap: 0.4rem; margin-bottom: 1.2rem; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-3); transition: background 300ms ease; }
.steps i.done { background: var(--primary); }
.fingerprint { font-family: var(--font-mono); font-weight: 700; color: var(--primary-2); padding: 0.6rem 0.8rem; border-radius: 10px; background: rgba(242, 194, 0, 0.07); border: 1px solid var(--border-accent); word-break: break-word; }

/* ---------------------------------------------------------------- QR scanner */
.scanner { position: relative; border-radius: 16px; overflow: hidden; background: #050b14; aspect-ratio: 4 / 3; border: 1px solid var(--border-2); }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; inset: 16%; border-radius: 18px; box-shadow: 0 0 0 999px rgba(5, 11, 20, 0.45); }
.scanner .frame::before, .scanner .frame::after { content: ""; position: absolute; inset: 0; border-radius: 18px; border: 3px solid var(--primary); clip-path: polygon(0 0, 22% 0, 22% 4%, 4% 4%, 4% 22%, 0 22%, 0 78%, 4% 78%, 4% 96%, 22% 96%, 22% 100%, 78% 100%, 78% 96%, 96% 96%, 96% 78%, 100% 78%, 100% 22%, 96% 22%, 96% 4%, 78% 4%, 78% 0, 100% 0, 100% 100%, 0 100%); }
.scanner .laser { position: absolute; left: 18%; right: 18%; height: 2px; background: linear-gradient(90deg, transparent, var(--primary), transparent); box-shadow: 0 0 12px var(--primary); animation: laser 2.2s ease-in-out infinite; }
.scanner.found .frame::before { border-color: var(--success); }
.dropzone { display: grid; place-items: center; gap: 0.6rem; text-align: center; padding: 2.2rem 1rem; border-radius: 16px; border: 2px dashed var(--border-2); color: var(--muted); cursor: pointer; transition: border-color 160ms ease, background 160ms ease, transform 200ms var(--ease-spring); }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.dropzone.over { transform: scale(1.01); }
.dropzone .i { width: 38px; height: 38px; color: var(--primary); }
.preview-img { max-height: 220px; margin: 0 auto; border-radius: 12px; border: 1px solid var(--border); }

/* ---------------------------------------------------------------- public page bits */
.hero { padding: 5rem 0 3.5rem; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); letter-spacing: -0.035em; margin: 1rem 0 1rem; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--primary), #ffe27a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { max-width: 560px; }
.hero-cta { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.6rem; }
.hero-art { position: relative; height: 420px; }
.hero-art .code-card { position: absolute; width: 300px; cursor: default; animation: float 6s ease-in-out infinite, card-in 700ms var(--ease-out) both; }
.hero-art .code-card:nth-child(1) { top: 20px; left: 10%; }
.hero-art .code-card:nth-child(2) { top: 150px; right: 0; animation-delay: -2s, 120ms; }
.hero-art .code-card:nth-child(3) { top: 280px; left: 0; animation-delay: -4s, 240ms; }
.section { padding: 3.5rem 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 2.2rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); letter-spacing: -0.03em; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.feature { padding: 1.4rem; border-radius: 18px; border: 1px solid var(--border); background: linear-gradient(180deg, rgba(19, 40, 70, 0.6), rgba(15, 32, 56, 0.6)); transition: transform 240ms var(--ease-out), border-color 200ms ease; }
.feature:hover { transform: translateY(-4px); border-color: var(--border-accent); }
.feature .icon-badge { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 0.9rem; }
.feature .icon-badge .i { width: 22px; height: 22px; }
.feature h3 { margin-bottom: 0.4rem; }
.feature p { color: var(--muted); margin: 0; font-size: 0.93rem; }
.download-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.download { display: grid; gap: 0.7rem; padding: 1.5rem; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.download img { width: 52px; height: 52px; border-radius: 14px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
@media (max-width: 900px) { .hero-grid, .features, .download-grid { grid-template-columns: 1fr; } .hero-art { display: none; } }

/* ---------------------------------------------------------------- animations */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(8px) scale(0.97); } }
@keyframes card-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(16px); } }
@keyframes digit-in { from { opacity: 0; transform: translateY(-60%) rotateX(80deg); filter: blur(2px); } }
@keyframes copied { 0% { opacity: 0; } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse { 50% { opacity: 0.45; } }
@keyframes float { 50% { transform: translateY(-10px); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px) scale(0.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(0.95); } }
@keyframes menu-in { from { opacity: 0; transform: scale(0.94); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes laser { 0%, 100% { top: 18%; } 50% { top: 80%; } }
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton { border-radius: 16px; height: 86px; background: linear-gradient(90deg, rgba(147, 176, 214, 0.06) 25%, rgba(147, 176, 214, 0.13) 37%, rgba(147, 176, 214, 0.06) 63%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }

/* Reduce motion: the OS setting, or the app's own setting. */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; } }
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }

/* ---------------------------------------------------------------- small extras */
.spacer-sm { height: 0.9rem; }
.view { min-width: 0; }
.list-item .meta { min-width: 0; }
.list-item .title .badge { margin-left: 0.4rem; vertical-align: 0.1em; }
.list-item .title .badge .i { width: 11px; height: 11px; }
details summary { cursor: pointer; padding: 0.3rem 0; }
details[open] summary { margin-bottom: 0.6rem; }
input[type="range"] { accent-color: var(--primary); flex: 1; }
.setting .dot { flex: none; }
.gate-card .list-item { grid-template-columns: auto 1fr auto; text-align: left; width: 100%; background: rgba(6, 13, 25, 0.35); border-color: var(--border); color: inherit; font: inherit; }
.gate-card .list-item .svc-icon { background: var(--primary-soft); color: var(--primary); }
.gate-card .list-item .svc-icon .i { width: 20px; height: 20px; }
/* The text in a row may shrink (and, on the sign-in cards, wrap) instead of pushing the row wider than its card. */
.list-item > div { min-width: 0; }
.gate-card .list-item .title, .gate-card .list-item .sub { white-space: normal; overflow-wrap: anywhere; }
/* A dropdown at the end of a settings row keeps its own size, so it never covers the name beside it. */
.setting > .select { width: auto; flex: none; min-width: 8.5rem; }
.setting .what b { overflow-wrap: anywhere; }
.setting .svc-icon { background: var(--surface-3); color: var(--text-2); }
.setting .svc-icon .i { width: 20px; height: 20px; }
.card ul { padding-left: 1.2rem; margin: 0; display: grid; gap: 0.45rem; }
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; row-gap: 0.7rem; }
  .topbar h1 { flex: 1; font-size: 1.3rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .search { order: 10; flex-basis: 100%; max-width: none; margin: 0; }
  .topbar .btn > span { display: none; }
  .search kbd { display: none; }
  .main { padding-top: 1rem; }
  .codes { grid-template-columns: 1fr; }
  .gate-card { padding: 1.4rem; }
}
.tab { white-space: nowrap; }
a.link { color: var(--primary); font-weight: 600; }
a.link:hover { text-decoration: underline; }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--primary); font-weight: 600; }
button.link:hover, button.link:focus-visible { text-decoration: underline; }
.row .meter { width: 120px; margin: 0; }
.topbar h1 { margin-right: auto; }
.topbar .search { margin-left: 0; }
.feature .icon-badge b { font-family: var(--font-display); font-size: 1.2rem; }
#security-notes { margin-top: 1.2rem; }
#cta-bottom { justify-content: center; }
.download .steps-list { margin: 0; padding-left: 1.2rem; color: var(--muted); font-size: 0.9rem; display: grid; gap: 0.3rem; }
.download .soon { color: var(--faint); font-size: 0.85rem; }
.page-hero { padding: 4rem 0 1.5rem; text-align: center; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 0.8rem 0 0.7rem; letter-spacing: -0.03em; }
.page-hero .lead { max-width: 640px; margin: 0 auto; }
.page-hero .hero-cta { justify-content: center; }
#ext-meta .mono { word-break: break-all; font-size: 0.72rem; }
#win-meta .mono { word-break: break-all; font-size: 0.72rem; }

/* ---------------------------------------------------------------- staff messages, closed screen */
.app-banner { position: fixed; z-index: 120; top: 0.7rem; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 0.6rem; max-width: min(760px, calc(100% - 2rem)); padding: 0.55rem 0.6rem 0.55rem 0.9rem; border-radius: 12px; background: var(--info-soft); color: var(--info); border: 1px solid rgba(96, 165, 250, 0.3); backdrop-filter: blur(10px); box-shadow: var(--shadow-soft); font-size: 0.88rem; font-weight: 600; animation: toast-in 380ms var(--ease-spring); }
.app-banner.warn { background: var(--warning-soft); color: var(--warning); border-color: rgba(251, 191, 36, 0.35); }
.app-banner .icon-btn { width: 28px; height: 28px; color: inherit; }
.closed-art { width: 84px; height: 84px; margin: 0 auto 1rem; border-radius: 24px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); animation: float 5s ease-in-out infinite; }
.closed-art .i { width: 40px; height: 40px; }

/* ==========================================================================
   Light theme (html[data-theme="light"]) - the Smile app's Appearance setting.
   Same layout; lighter surfaces, darker text, gold kept for accents.
   ========================================================================== */
html[data-theme="light"] {
  --primary: #c99a00;
  --primary-2: #f2c200;
  --primary-soft: rgba(201, 154, 0, 0.12);
  --bg: #f4f6fa;
  --bg-2: #eef2f8;
  --surface: #ffffff;
  --surface-2: #f2f5fa;
  --surface-3: #e5eaf2;
  --overlay: rgba(20, 30, 45, 0.35);
  --text: #122033;
  --text-2: #2c3d55;
  --muted: #56667d;
  --faint: #8391a6;
  --border: rgba(18, 32, 51, 0.1);
  --border-2: rgba(18, 32, 51, 0.18);
  --border-accent: rgba(201, 154, 0, 0.45);
  --success: #178a50;
  --success-soft: rgba(23, 138, 80, 0.1);
  --danger: #c43d3d;
  --danger-soft: rgba(196, 61, 61, 0.09);
  --border-danger: rgba(196, 61, 61, 0.3);
  --warning: #9a6a00;
  --warning-soft: rgba(201, 154, 0, 0.12);
  --info: #245fa6;
  --info-soft: rgba(36, 95, 166, 0.09);
  --shadow: 0 24px 60px rgba(18, 32, 51, 0.16);
  --shadow-soft: 0 8px 22px rgba(18, 32, 51, 0.08);
  --ring: 0 0 0 3px rgba(201, 154, 0, 0.25);
  color-scheme: light;
}
html[data-theme="light"] body { background-image: radial-gradient(1100px 520px at 12% -8%, rgba(242, 194, 0, 0.1), transparent 60%), radial-gradient(900px 600px at 95% 0%, rgba(60, 120, 200, 0.08), transparent 60%); }
html[data-theme="light"] ::selection { color: #122033; }
html[data-theme="light"] .input, html[data-theme="light"] .select, html[data-theme="light"] .textarea { background: #ffffff; }
html[data-theme="light"] .input:focus, html[data-theme="light"] .select:focus, html[data-theme="light"] .textarea:focus { background: #ffffff; }
html[data-theme="light"] .card, html[data-theme="light"] .code-card, html[data-theme="light"] .feature { background: #ffffff; }
html[data-theme="light"] .sidebar { background: rgba(255, 255, 255, 0.82); }
html[data-theme="light"] .modal, html[data-theme="light"] .gate-card { background: #ffffff; }
html[data-theme="light"] .menu { background: #ffffff; }
html[data-theme="light"] .toast { background: #ffffff; color: var(--text); }
html[data-theme="light"] .tabs { background: var(--surface-2); }
html[data-theme="light"] .side-link.active { background: linear-gradient(90deg, rgba(242, 194, 0, 0.2), rgba(242, 194, 0, 0.04)); }
html[data-theme="light"] .code-card:hover { box-shadow: 0 14px 30px rgba(18, 32, 51, 0.1); }
html[data-theme="light"] .kit { background: rgba(242, 194, 0, 0.1); color: #7a5b00; }
html[data-theme="light"] .fingerprint { color: #7a5b00; }
html[data-theme="light"] .brand b, html[data-theme="light"] .eyebrow, html[data-theme="light"] a.link, html[data-theme="light"] button.link { color: #a37c00; }
html[data-theme="light"] .site-header { background: rgba(255, 255, 255, 0.85); }
html[data-theme="light"] .footer { background: linear-gradient(180deg, rgba(238, 242, 248, 0.5), #e9eef6); }
html[data-theme="light"] .svc-icon { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); }

/* Legal pages (privacy) */
.legal { max-width: 780px; }
.legal h2 { font-size: 1.25rem; margin: 2rem 0 0.6rem; }
.legal p, .legal li { color: var(--text-2); line-height: 1.7; }
.legal ul { padding-left: 1.2rem; display: grid; gap: 0.45rem; }
.legal ul ul { margin-top: 0.4rem; }

/* Passkeys in a login */
.passkey-badge { gap: 0.25rem; margin-left: 0.4rem; vertical-align: 0.1em; color: var(--primary); border-color: var(--border-accent); background: var(--primary-soft); }
.passkey-badge .i { width: 11px; height: 11px; }
.passkeys { display: grid; gap: 0.45rem; margin-top: 0.9rem; }
.passkeys > .k { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.passkey-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.75rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.passkey-art { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 11px; background: var(--primary-soft); color: var(--primary); }
.passkey-art .i { width: 20px; height: 20px; }
.passkey-row .meta { flex: 1; min-width: 0; }
.passkey-row .meta b { display: block; overflow-wrap: anywhere; }
.passkey-row .meta span { display: block; font-size: 0.82rem; color: var(--muted); }

/* Unlock screen: "Use fingerprint" (the phone app) */
.quick-unlock { margin-top: 0.6rem; }

/* Download page: copyable commands (Linux) */
.code-block { margin: 0.5rem 0; padding: 0.7rem 0.8rem; max-width: 100%; overflow-x: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; font: 0.78rem/1.5 "JetBrains Mono", ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.download h3 .badge { vertical-align: middle; margin-left: 0.3rem; }
.download { min-width: 0; }

/* Settings > Import: how to export from other apps */
.export-guide { margin-top: 0.8rem; }
.export-guide summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.export-guide dl { margin: 0.6rem 0 0; display: grid; gap: 0.15rem; }
.export-guide dt { font-weight: 700; font-size: 0.86rem; margin-top: 0.45rem; }
.export-guide dd { margin: 0; color: var(--text-2); font-size: 0.86rem; line-height: 1.5; }

/* Touch screens: text boxes at 16px or more - iPhones zoom the whole page (and stay zoomed) when
   you tap a smaller one. */
@media (pointer: coarse) { .input, .select, .textarea, input, select, textarea { font-size: max(16px, 1rem); } }

/* Download page: stable rows and card alignment across devices */
.section-tight { padding-top: 0.5rem; }
.download-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.download { display: grid; align-content: start; gap: 0.6rem; padding: 1.1rem 1.2rem; }
.download .dl-head { display: flex; align-items: center; gap: 0.75rem; }
.download .dl-head img { width: 40px; height: 40px; border-radius: 11px; }
.download .dl-head h3 { margin: 0; font-size: 1.05rem; }
.download .dl-head p { margin: 0.1rem 0 0; }
.download > p.muted { margin: 0; font-size: 0.9rem; line-height: 1.5; }
.download .dl-steps summary { cursor: pointer; font-size: 0.86rem; font-weight: 600; color: var(--text-2); }
.download .dl-steps[open] summary { margin-bottom: 0.5rem; }
.download .dl-meta { margin: 0; overflow-wrap: anywhere; }
.download .dl-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.download .dl-buttons .btn { flex: 1 1 auto; justify-content: center; }
.download .dl-meta:empty { display: none; }
.download.for-you { border-color: var(--border-accent); box-shadow: 0 0 0 1px var(--border-accent), 0 12px 32px rgba(242, 194, 0, 0.08); }
.dl-for-you { margin: 0 0 0.9rem; text-align: center; color: var(--muted); }
@media (max-width: 1100px) { .download-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .download-grid { grid-template-columns: 1fr; } }
.download .dl-steps .dl-meta { margin-top: 0.5rem; }
.download .dl-meta > br:first-child { display: none; }

/* Unlock screen: "Trust this device for 30 days" (the apps and the extension) */
.trust-row { margin: 0.2rem 0 0.4rem; align-items: flex-start; }
.trust-row span { line-height: 1.45; font-size: 0.9rem; }
.trust-note { margin: 0 0 0.6rem; }

/* Download page: "Need an older version?" */
.download .dl-older .older-list { display: grid; gap: 0.6rem; }
.download .older-row { display: flex; align-items: flex-start; gap: 0.8rem; padding: 0.65rem 0; border-top: 1px solid var(--border, rgba(255,255,255,.08)); }
.download .older-what { flex: 1; min-width: 0; }
.download .older-notes { margin: 0.3rem 0 0; padding-left: 1.1rem; }
.download .older-notes li { margin: 0.15rem 0; }
.download .older-hash { margin: 0.3rem 0 0; overflow-wrap: anywhere; }
.download .older-row .btn { flex: none; }

/* Download page: the Linux & ChromeOS card's tabs (no sliding glider - the active tab is filled) */
.download .dl-pick { justify-self: start; }
.download .dl-pick .tab.active { background: var(--primary); }
.download .dl-pane { display: grid; gap: 0.6rem; }
.download .dl-pane[hidden] { display: none; }
