:root {
  --bg: #05060b;
  --bg-raised: #0c0f1a;
  --sheet: #0e1220;
  --text: #eaf2ff;
  --muted: #8a94b0;
  --faint: #4a5470;
  --stroke: rgba(255, 255, 255, .09);
  --glass: rgba(255, 255, 255, .05);
  --c1: #00ffa3;
  --c2: #00c2ff;
  --c3: #3d5afe;
  --neon: linear-gradient(120deg, var(--c1), var(--c2) 55%, var(--c3));
  --mint: #69f0ae;
  --amber: #ffb300;
  --danger: #ff3d71;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, "Courier New", monospace;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--c2); outline-offset: 2px; }
.hidden { display: none !important; }

/* aurora background, like the app */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.aurora span {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(90px); opacity: .18; animation: drift 28s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { background: var(--c1); top: -25vmax; left: -15vmax; }
.aurora span:nth-child(2) { background: var(--c2); bottom: -30vmax; right: -20vmax; animation-delay: -9s; }
.aurora span:nth-child(3) { background: var(--c3); top: 30%; left: 40%; opacity: .12; animation-delay: -17s; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .aurora span { animation: none; } }

#root { height: 100%; }
.center-note { text-align: center; color: var(--muted); padding: 40px 16px; }

.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.grad-text { background: var(--neon); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); letter-spacing: .5px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--stroke); background: var(--glass); border-radius: 14px;
  padding: 10px 16px; font-weight: 600; min-height: 42px; transition: background .15s, opacity .15s;
}
.btn:hover { background: rgba(255, 255, 255, .09); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary {
  background: var(--neon); border: 0; color: #fff; font-weight: 700; min-height: 52px; border-radius: 16px;
  box-shadow: 0 8px 26px rgba(0, 194, 255, .35);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: rgba(255, 61, 113, .35); }
.btn.block { width: 100%; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--stroke);
  background: var(--glass); display: inline-grid; place-items: center; padding: 0; flex: none;
}
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.icon-btn svg, .btn svg { width: 18px; height: 18px; }

/* inputs */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 6px 4px; font-weight: 600; }
.input-wrap { position: relative; display: flex; gap: 6px; align-items: center; }
input, select, textarea {
  width: 100%; background: rgba(255, 255, 255, .04); border: 1px solid var(--stroke);
  border-radius: 14px; padding: 12px 14px; outline: none; transition: border-color .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--c2); }
select option { background: var(--sheet); }
.error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 4px 10px; }

/* auth */
.auth { height: 100%; overflow: auto; display: flex; flex-direction: column; padding: 32px 16px 20px; }
.landing {
  flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) 430px; gap: 64px;
}
.auth-card { width: 100%; max-width: 430px; padding: 28px 24px; justify-self: end; scroll-margin-top: 16px; }
.auth-card .orb { width: 64px; height: 64px; margin-bottom: 12px; padding: 4px; }
.auth-card .orb svg { width: 28px; height: 28px; }
.card-title { text-align: center; margin: 0 0 18px; font-size: 20px; }

.hero { max-width: 620px; }
.eyebrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; font-size: 13.5px; }
.brand-mark { font-weight: 900; letter-spacing: 6px; font-size: 18px; }
/* The rounded icon carries its own corners and rim; the glow sits under it. */
.logo-img { flex: none; display: block; filter: drop-shadow(0 6px 18px rgba(0, 194, 255, .28)); }
.logo { display: flex; align-items: center; gap: 10px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.08; margin: 0 0 18px; letter-spacing: -.5px; }
.lead { color: var(--muted); font-size: 17px; line-height: 1.6; margin: 0 0 28px; max-width: 560px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 40px; }
.cta .btn.primary { padding: 0 24px; }
.ghost-link { min-height: 52px; padding: 0 22px; border-radius: 16px; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.feature { display: flex; gap: 12px; padding: 16px; border-radius: 16px; background: var(--glass); border: 1px solid var(--stroke); }
.feature-icon { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; background: rgba(0, 255, 163, .1); color: var(--c1); }
.feature-icon svg { width: 19px; height: 19px; }
.feature h3 { margin: 0 0 4px; font-size: 14.5px; }
.feature p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.foot { text-align: center; color: var(--faint); font-size: 12px; margin-top: 32px; }
.foot a, .legal-note a { color: var(--muted); }
.legal-note { font-size: 12px; color: var(--faint); text-align: center; margin: 12px 0 0; }
@media (max-width: 900px) {
  .landing { grid-template-columns: 1fr; gap: 36px; max-width: 560px; }
  .auth-card { justify-self: stretch; max-width: none; }
  .hero h1 { font-size: clamp(32px, 9vw, 44px); }
  .cta { margin-bottom: 28px; }
}
@media (max-width: 520px) {
  .features { grid-template-columns: 1fr; }
  .cta .btn { width: 100%; }
}
.orb {
  width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 50%; padding: 6px;
  background: conic-gradient(var(--c1), var(--c2), var(--c3), var(--c1));
  box-shadow: 0 0 40px rgba(0, 194, 255, .45); animation: spin 14s linear infinite;
}
.orb > div { width: 100%; height: 100%; border-radius: 50%; background: var(--bg-raised); display: grid; place-items: center; animation: spin 14s linear infinite reverse; }
.orb svg { width: 38px; height: 38px; color: var(--c1); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .orb, .orb > div { animation: none; } }
.brand { text-align: center; font-size: 34px; font-weight: 900; letter-spacing: 9px; margin: 0; }
.tagline { text-align: center; color: var(--muted); margin: 4px 0 22px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--stroke); margin-bottom: 18px; }
.tabs button { border: 0; background: none; border-radius: 10px; padding: 9px; font-weight: 600; color: var(--muted); }
.tabs button[aria-selected="true"] { background: rgba(255, 255, 255, .09); color: var(--text); }
.note {
  font-size: 12.5px; color: var(--muted); padding: 12px 14px; border-radius: 14px; margin: 4px 0 16px;
  background: rgba(255, 179, 0, .06); border: 1px solid rgba(255, 179, 0, .25);
}
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; margin: 0 0 16px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--amber); }
.trust { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.trust span { font-size: 11.5px; color: var(--muted); border: 1px solid var(--stroke); border-radius: 99px; padding: 4px 10px; }

/* vault layout */
.app { height: 100%; display: grid; grid-template-rows: auto 1fr; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--stroke); background: rgba(5, 6, 11, .6); backdrop-filter: blur(20px); }
.topbar .logo { font-weight: 900; letter-spacing: 5px; font-size: 18px; white-space: nowrap; }
.search { flex: 1; max-width: 520px; position: relative; }
.search input { padding-left: 40px; min-height: 42px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.sync-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); white-space: nowrap; border: 1px solid var(--stroke); border-radius: 99px; padding: 5px 11px; background: var(--glass); }
.sync-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px currentColor; }
.sync-pill[data-s="saving"] i { background: var(--c2); }
.sync-pill[data-s="offline"] i, .sync-pill[data-s="error"] i { background: var(--amber); }
.spacer { flex: 1; }

.body { display: grid; grid-template-columns: 220px minmax(260px, 380px) 1fr; min-height: 0; }
.side { padding: 14px 10px; border-right: 1px solid var(--stroke); overflow: auto; }
.side button {
  width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none;
  padding: 9px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; text-align: left;
}
.side button:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.side button[aria-current="true"] { background: rgba(255, 255, 255, .08); color: var(--text); }
.side button svg { width: 18px; height: 18px; flex: none; }
.side button .count { margin-left: auto; font-size: 12px; color: var(--faint); }
.side .label { font-size: 11px; letter-spacing: 1.6px; color: var(--faint); font-weight: 700; margin: 16px 12px 6px; text-transform: uppercase; }
.side .new { margin-bottom: 10px; }

.list { overflow: auto; border-right: 1px solid var(--stroke); padding: 8px; }
.list .empty { color: var(--muted); text-align: center; padding: 40px 16px; }
.row {
  width: 100%; display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px;
  border: 1px solid transparent; background: none; text-align: left;
}
.row:hover { background: rgba(255, 255, 255, .04); }
.row[aria-current="true"] { background: rgba(255, 255, 255, .07); border-color: var(--stroke); }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { min-width: 0; flex: 1; }
.row .star { color: var(--amber); width: 15px; height: 15px; flex: none; }
.avatar { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; flex: none; color: #05060b; }
.avatar svg { width: 20px; height: 20px; }
.avatar.lg { width: 58px; height: 58px; border-radius: 18px; font-size: 22px; }

.detail { overflow: auto; padding: 22px 26px 40px; }
.detail .blank { height: 100%; display: grid; place-items: center; text-align: center; color: var(--muted); }
.detail-head { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.detail-head h2 { margin: 0; font-size: 22px; word-break: break-word; }
.detail-head .actions { margin-left: auto; display: flex; gap: 8px; }
.back { display: none; }
.fields { padding: 4px 0; }
.f { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.f + .f { border-top: 1px solid var(--stroke); }
.f .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.f .v { word-break: break-all; white-space: pre-wrap; }
.f .grow { flex: 1; min-width: 0; }
.f .tools { display: flex; gap: 6px; }
.section-label { font-size: 11px; letter-spacing: 1.6px; color: var(--faint); font-weight: 700; margin: 22px 4px 8px; text-transform: uppercase; }
.totp { font-family: var(--mono); font-size: 26px; letter-spacing: 3px; font-weight: 700; }
.ring { width: 30px; height: 30px; flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; border: 1px solid var(--stroke); border-radius: 99px; padding: 3px 10px; color: var(--muted); }
.stamp { color: var(--faint); font-size: 12px; margin-top: 18px; }

/* dialog */
dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border-radius: 24px;
  border: 1px solid var(--stroke); background: var(--sheet); color: var(--text);
}
dialog::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(6px); }
dialog form { padding: 22px; }
dialog h3 { margin: 0 0 16px; font-size: 20px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.dialog-actions .left { margin-right: auto; }
.custom-row { display: grid; grid-template-columns: 1fr 1.4fr auto auto; gap: 6px; margin-bottom: 6px; align-items: center; }
.custom-row label { display: flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); }
.custom-row input[type="checkbox"] { width: 16px; height: 16px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--sheet); border: 1px solid var(--stroke); padding: 10px 16px; border-radius: 14px;
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { border-color: rgba(255, 61, 113, .5); color: #ffc2d1; }

/* tablet: hide the sidebar, keep a type filter above the list */
.type-select { display: none; margin-bottom: 8px; }
@media (max-width: 1000px) {
  .body { grid-template-columns: minmax(240px, 340px) 1fr; }
  .side { display: none; }
  .type-select { display: block; }
}
/* phone: list and detail take turns */
@media (max-width: 680px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .topbar .logo { font-size: 16px; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
  .sync-pill .txt { display: none; }
  .body { grid-template-columns: 1fr; }
  .list { border-right: 0; padding: 8px 8px 80px; }
  .app[data-view="detail"] .list { display: none; }
  .app:not([data-view="detail"]) .detail { display: none; }
  .detail { padding: 16px 16px 40px; }
  .back { display: inline-grid; }
  .fab { position: fixed; right: 16px; bottom: 16px; z-index: 5; }
  .detail-head { flex-wrap: wrap; }
  .custom-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 681px) { .fab { display: none; } }
a.btn, a.icon-btn, a.side-link { color: inherit; text-decoration: none; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-top: 14px; border-radius: 12px;
  font-weight: 600; font-size: 13.5px; border: 1px solid var(--stroke); background: var(--glass);
}
.side-link:hover { background: rgba(255, 255, 255, .08); }
.side-link svg { width: 18px; height: 18px; color: var(--c1); flex: none; }
button.side-link { width: 100%; color: var(--text); }

/* browser extension offer: a centered popup over a dimmed page */
dialog.ext-offer {
  width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; padding: 26px 24px 22px;
  background: radial-gradient(120% 70% at 0 0, rgba(0, 255, 163, .10), transparent 60%),
    radial-gradient(120% 70% at 100% 100%, rgba(61, 90, 254, .16), transparent 60%), var(--sheet);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(0, 194, 255, .12);
  animation: ext-in .35s cubic-bezier(.2, .9, .3, 1.2);
}
dialog.ext-offer::backdrop { animation: ext-fade .3s ease; }
.ext-offer.leaving { opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .2s, transform .2s; }
@keyframes ext-in { from { opacity: 0; transform: translateY(24px) scale(.96); } }
@keyframes ext-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ext-offer, dialog.ext-offer::backdrop { animation: none; } }
.ext-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; }
.ext-head { display: flex; align-items: center; gap: 12px; padding-right: 36px; }
.ext-head img { flex: none; }
.ext-head h3 { margin: 0; font-size: 18px; }
.ext-head p { margin: 2px 0 0; }
.ext-points { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.ext-points li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.ext-point {
  width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: rgba(0, 255, 163, .1); color: var(--c1);
}
.ext-point svg { width: 17px; height: 17px; }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

/* setup guide */
.ext-guide { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 4px; counter-reset: none; }
.ext-step { display: flex; gap: 12px; padding: 10px 4px; position: relative; }
.ext-step:not(:last-child)::after {
  content: ''; position: absolute; left: 17px; top: 42px; bottom: -8px; width: 2px;
  background: linear-gradient(var(--stroke), transparent);
}
.ext-num {
  width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; color: #05060b; background: var(--neon); box-shadow: 0 4px 14px rgba(0, 194, 255, .3);
}
.ext-step-body { flex: 1; min-width: 0; }
.ext-step-body > b { display: block; font-size: 14.5px; margin-top: 3px; }
.ext-step-body p { margin: 3px 0 0; line-height: 1.5; }
.ext-step-body p b { color: var(--text); }
.ext-step-body code { font-family: var(--mono); color: var(--c2); user-select: all; }
.ext-step-body .btn { margin-top: 8px; min-height: 36px; padding: 6px 14px; font-size: 13.5px; }
.ext-step-body .btn.primary { min-height: 38px; box-shadow: 0 6px 18px rgba(0, 194, 255, .3); }
.ext-step-body .btn svg { width: 16px; height: 16px; }
.ext-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--stroke); }

/* sign-in page: a note about the extension under the features */
.ext-strip {
  display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 16px; border-radius: 16px;
  background: linear-gradient(120deg, rgba(0, 255, 163, .07), rgba(61, 90, 254, .09));
  border: 1px solid rgba(0, 194, 255, .22);
}
.ext-strip-text { flex: 1; min-width: 0; }
.ext-strip h3 { margin: 0 0 4px; font-size: 14.5px; }
.ext-strip p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.ext-strip .btn { flex: none; white-space: nowrap; }
.ext-badge {
  flex: none; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  color: var(--mint); background: rgba(105, 240, 174, .1); border: 1px solid rgba(105, 240, 174, .3);
}
@media (max-width: 520px) {
  .ext-strip { flex-wrap: wrap; }
  .ext-strip .btn { width: 100%; }
}
.ext-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.ext-actions .btn.primary { min-height: 42px; }

