/* Pass-GJ — light and dark themes follow the system setting. */

:root {
  color-scheme: light dark;
  --bg: #f3f4f8;
  --bg-grad: radial-gradient(1200px 600px at 10% -10%, #e6e3ff 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #dff3ff 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f4f5fa;
  --surface-3: #eceef5;
  --border: #e2e4ee;
  --border-strong: #cfd3e1;
  --text: #141621;
  --muted: #697086;
  --accent: #5a4bf0;
  --accent-hover: #4b3ce0;
  --accent-text: #ffffff;
  --accent-soft: #eeecff;
  --accent-soft-text: #4a3cd6;
  --danger: #d43d3d;
  --danger-soft: #fdeceb;
  --ok: #158a52;
  --warn: #b7790d;
  --shadow-sm: 0 1px 2px rgba(20, 22, 40, .06);
  --shadow: 0 1px 2px rgba(20, 22, 40, .05), 0 8px 24px -6px rgba(20, 22, 40, .10);
  --shadow-lg: 0 24px 64px -12px rgba(20, 22, 40, .28);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", "JetBrains Mono", ui-monospace, "Roboto Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --bg-grad: radial-gradient(1100px 600px at 0% -20%, #1d1940 0%, transparent 60%), radial-gradient(900px 500px at 120% 120%, #0d2433 0%, transparent 55%);
    --surface: #141720;
    --surface-2: #1a1e2a;
    --surface-3: #222736;
    --border: #252a39;
    --border-strong: #333a4e;
    --text: #eceef6;
    --muted: #8c93a9;
    --accent: #7e70ff;
    --accent-hover: #8f83ff;
    --accent-text: #ffffff;
    --accent-soft: #221d4a;
    --accent-soft-text: #b9b1ff;
    --danger: #ff6b6b;
    --danger-soft: #3a1d22;
    --ok: #3ccf8e;
    --warn: #f0b44c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px -10px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 80px -10px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
#app { height: 100dvh; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 650; line-height: 1.2; }
h2 { font-size: 20px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.grow { flex: 1; }
.center-text { text-align: center; }
.ico { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 560; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .7; cursor: default; }
.btn .ico { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-text); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.subtle { background: var(--surface-2); box-shadow: none; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; min-height: 46px; }
.danger-text { color: var(--danger) !important; }
.link { background: none; border: 0; padding: 4px 0; color: var(--accent); font-weight: 560; }
.link:hover { text-decoration: underline; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.icon-btn.ghost:hover { color: var(--text); background: var(--surface-3); }
.icon-btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-text); }
.icon-btn.primary:hover { background: var(--accent-hover); }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field-label.split { display: flex; align-items: center; justify-content: space-between; }
.field-hint { font-size: 12.5px; color: var(--muted); }
input:not([type=checkbox]):not([type=range]):not([type=file]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input[type=file] { font-size: 14px; }
input[type=range] { accent-color: var(--accent); flex: 1; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input { padding-right: 46px; }
.input-wrap .icon-btn { position: absolute; right: 3px; }
.form-msg { color: var(--danger); font-size: 14px; min-height: 0; }
.form-msg:empty { display: none; }
.note {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent-soft-text); font-size: 13.5px;
}
.note .ico { width: 18px; height: 18px; margin-top: 1px; }
details.advanced summary { cursor: pointer; color: var(--muted); font-size: 13.5px; font-weight: 560; list-style: none; }
details.advanced summary::before { content: "▸ "; }
details.advanced[open] summary::before { content: "▾ "; }
details.advanced[open] summary { margin-bottom: 10px; }

.meter-row { display: flex; align-items: center; gap: 10px; }
.meter { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.meter i { height: 4px; border-radius: 4px; background: var(--surface-3); transition: background .2s; }
.meter[data-score="0"] i:nth-child(-n+1) { background: var(--danger); }
.meter[data-score="1"] i:nth-child(-n+1) { background: var(--warn); }
.meter[data-score="2"] i:nth-child(-n+2) { background: var(--warn); }
.meter[data-score="3"] i:nth-child(-n+3) { background: var(--ok); }
.meter[data-score="4"] i { background: var(--ok); }
.meter-label { font-size: 12.5px; color: var(--muted); min-width: 76px; text-align: right; }

/* ---------- setup / lock ---------- */
.center { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; overflow: auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 32px; }
.card.narrow { width: min(440px, 100%); display: grid; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand-mark {
  width: 36px; height: 36px; flex: none; display: block; border-radius: 22.6%;
  box-shadow: 0 6px 16px -6px #5a4bf0;
}
.brand.large .brand-mark { width: 60px; height: 60px; }
.brand.large { font-size: 22px; flex-direction: column; align-items: flex-start; gap: 14px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.row-links { display: flex; justify-content: space-between; gap: 12px; }
.lock-card { text-align: center; }
.lock-card .stack { text-align: left; }
.lock-icon {
  width: 72px; height: 72px; margin: 0 auto 4px; border-radius: 22px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #8a7bff, #5a4bf0 55%, #3d2fd1);
  box-shadow: 0 16px 36px -12px #5a4bf0;
}
.lock-icon .ico { width: 34px; height: 34px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- main layout ---------- */
.shell {
  height: 100dvh; display: grid; grid-template-columns: 240px minmax(300px, 380px) 1fr;
}
.sidebar {
  display: flex; flex-direction: column; gap: 22px; padding: 20px 14px;
  border-right: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 55%, transparent);
  backdrop-filter: blur(20px);
}
.sidebar .brand { padding: 0 8px; }
.nav { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  border: 0; background: none; color: var(--muted); font-weight: 560; text-align: left;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-soft-text); }
.nav-item span:nth-child(2) { flex: 1; }
.nav-item .count { font-size: 12.5px; opacity: .8; font-variant-numeric: tabular-nums; }
.side-actions { display: grid; gap: 2px; }
.side-actions .btn { justify-content: flex-start; color: var(--muted); font-weight: 540; }
.side-actions .btn:hover { color: var(--text); }

.sync-pill {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; text-align: left;
}
.sync-pill .ico { width: 17px; height: 17px; }
.sync-pill.ok .ico, .sync-dot.ok { color: var(--ok); }
.sync-pill.busy .ico, .sync-dot.busy .ico { animation: spin 1s linear infinite; color: var(--accent); }
.sync-pill.offline .ico, .sync-dot.offline { color: var(--warn); }
.sync-pill.error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.sync-dot.error { color: var(--danger); }
.sync-dot {
  display: grid; place-items: center; width: 38px; height: 38px; border: 0; background: none; color: var(--muted); border-radius: 10px;
}

.listpane {
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 80%, transparent);
}
.mobile-top { display: none; }
.list-head {
  display: grid; grid-template-columns: 1fr auto; gap: 12px 10px; padding: 20px 16px 12px;
}
.list-title { grid-column: 1 / -1; font-size: 22px; }
.search { position: relative; display: flex; align-items: center; }
.search .ico { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 38px !important; background: var(--surface-2) !important; border-color: transparent !important; min-height: 40px !important; }
.search input:focus { border-color: var(--accent) !important; background: var(--surface) !important; }
.add-btn { width: 40px; height: 40px; }
.list { flex: 1; overflow-y: auto; padding: 4px 8px 16px; display: grid; align-content: start; gap: 2px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 12px;
  border: 0; background: none; text-align: left; transition: background .12s;
}
.row:hover { background: var(--surface-3); }
.row.selected { background: var(--accent-soft); }
.row-text { display: grid; min-width: 0; flex: 1; }
.row-text strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-text span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { color: var(--accent); opacity: .8; }
.badge .ico { width: 16px; height: 16px; }
.otp-row { padding: 6px 6px 6px 10px; }
.otp-row:hover { background: none; }
.row-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left; }
.otp-copy { border: 0; background: var(--surface-2); border-radius: 12px; padding: 8px 10px 8px 14px; transition: background .12s; }
.otp-copy:hover { background: var(--accent-soft); }
.list-foot { padding: 12px 4px; display: flex; justify-content: center; }

.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center;
  font-weight: 700; font-size: 17px; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .15);
}
.avatar.xl { width: 64px; height: 64px; border-radius: 18px; font-size: 28px; }
.avatar.c0 { background: linear-gradient(135deg, #7b6dff, #5442e6); }
.avatar.c1 { background: linear-gradient(135deg, #ff8a65, #f0533a); }
.avatar.c2 { background: linear-gradient(135deg, #34d399, #0f9d6b); }
.avatar.c3 { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.avatar.c4 { background: linear-gradient(135deg, #f472b6, #db2777); }
.avatar.c5 { background: linear-gradient(135deg, #fbbf24, #d97706); }
.avatar.c6 { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.avatar.c7 { background: linear-gradient(135deg, #a3a3b8, #626277); }

.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 48px 24px; color: var(--muted); }
.empty h3 { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--text); }
.empty p { font-size: 14px; max-width: 260px; }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); margin-bottom: 4px; }
.empty-icon .ico { width: 26px; height: 26px; }
.empty-icon.big { width: 76px; height: 76px; border-radius: 24px; }
.empty-icon.big .ico { width: 34px; height: 34px; }

/* ---------- detail ---------- */
.detail { overflow-y: auto; min-height: 0; }
.detail-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.detail-inner { max-width: 720px; margin: 0 auto; padding: 16px 28px 48px; display: grid; gap: 18px; }
.detail-bar {
  display: flex; align-items: center; gap: 6px; min-height: 44px; position: sticky; top: 0; z-index: 2;
  margin: 0 -28px; padding: 8px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px);
}
.bar-title { font-size: 18px; }
.back-btn { display: none !important; }
.hero { display: flex; align-items: center; gap: 18px; padding: 8px 0 4px; }
.hero h2 { font-size: 26px; word-break: break-word; }
.host { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; }
.host .ico { width: 14px; height: 14px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.kv { display: grid; grid-template-columns: 112px 1fr auto; align-items: center; gap: 12px; padding: 12px 10px 12px 18px; min-height: 60px; }
.kv + .kv { border-top: 1px solid var(--border); }
.k { font-size: 13px; color: var(--muted); font-weight: 560; }
.value { min-width: 0; overflow-wrap: anywhere; }
.kv-actions { display: flex; gap: 2px; }
.secret-dots { letter-spacing: .12em; color: var(--muted); }
.link-value { color: var(--accent); }
.otp-inline { border: 0; background: none; padding: 0; text-align: left; justify-self: start; }
.notes { padding: 16px 18px; display: grid; gap: 6px; }
.notes p { white-space: pre-wrap; overflow-wrap: anywhere; }
.meta { font-size: 12.5px; color: var(--muted); text-align: center; }

.edit .panel.form { padding: 18px; display: grid; gap: 16px; }
.gen { display: grid; gap: 12px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.gen-row { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.gen-row .mono { width: 2.2em; text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; cursor: pointer; }
.chip input { accent-color: var(--accent); margin: 0; }
.gen .btn { justify-self: start; }
.otp-box { display: grid; gap: 12px; }
.otp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.otp-actions .btn { border-color: var(--border); }
.key-row { display: flex; gap: 8px; }
.otp-set { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-soft-text); }
.otp-set > div { display: grid; }

/* ---------- 2FA code widget ---------- */
.otp { --p: 1; display: inline-flex; align-items: center; gap: 12px; }
.otp .code { font-family: var(--mono); font-size: 19px; font-weight: 650; letter-spacing: .06em; color: var(--text); font-variant-numeric: tabular-nums; }
.otp.large .code { font-size: 24px; }
.otp .ring { position: relative; width: 28px; height: 28px; display: grid; place-items: center; }
.otp .ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.otp .ring circle { fill: none; stroke-width: 2.5; }
.otp .ring .track { stroke: var(--surface-3); }
.otp .ring .bar { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 62.83; stroke-dashoffset: calc(62.83 * (1 - var(--p))); transition: stroke-dashoffset 1s linear, stroke .3s; }
.otp .secs { font-size: 10.5px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.otp.expiring .ring .bar { stroke: var(--danger); }
.otp.expiring .code { color: var(--danger); }

/* ---------- modal, toasts ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: rgba(8, 10, 18, .45); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s;
}
.backdrop.in { opacity: 1; }
.modal {
  width: min(460px, 100%); max-height: calc(100dvh - 48px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(.98); transition: transform .2s;
}
.modal.wide { width: min(620px, 100%); }
.backdrop.in .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 6px 24px; }
.modal-body { padding: 8px 24px 24px; overflow-y: auto; display: grid; gap: 16px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.actions.left { justify-content: flex-start; }
.set { display: grid; gap: 12px; padding: 18px 0; border-top: 1px solid var(--border); }
.set:first-child { border-top: 0; padding-top: 4px; }
.status-line { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.status-line.ok .ico { color: var(--ok); }
.status-line.offline .ico { color: var(--warn); }
.status-line.error { background: var(--danger-soft); }
.status-line.error .ico { color: var(--danger); }
.status-line.busy .ico { color: var(--accent); animation: spin 1s linear infinite; }
.link-box { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
.link-box > .btn { grid-column: 1 / -1; justify-self: start; }
.link-box > p { grid-column: 1 / -1; }
.qr { width: 168px; padding: 8px; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
.qr svg { display: block; width: 100%; height: auto; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }

.scanner { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 1; }
.scanner-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-frame { position: absolute; inset: 18%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }

#toasts { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 80; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px;
  background: #1b1e2b; color: #f2f3f8; font-size: 14px; font-weight: 520; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s;
}
.toast .ico { width: 18px; height: 18px; color: #a99fff; }
.toast.in { opacity: 1; transform: none; }

.tabbar, .fab { display: none; }

/* ---------- tablet & phone ---------- */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 76px minmax(280px, 340px) 1fr; }
  .sidebar { padding: 18px 10px; align-items: center; }
  .sidebar .brand span, .nav-item span, .side-actions .btn span, .sync-pill span { display: none; }
  .nav-item, .side-actions .btn, .sync-pill { justify-content: center; padding: 10px; }
  .sidebar .brand { padding: 0; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr; position: relative; }
  .sidebar { display: none; }
  .listpane { border-right: 0; background: transparent; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .mobile-top { display: flex; align-items: center; gap: 4px; padding: calc(10px + env(safe-area-inset-top)) 10px 0 16px; }
  .list-head { grid-template-columns: 1fr; padding: 10px 16px 10px; }
  .list-title { font-size: 28px; }
  .add-btn { display: none !important; }
  .list { padding: 0 8px 96px; }
  .row { padding: 10px; }
  .detail {
    position: fixed; inset: 0; z-index: 20; background: var(--bg-grad), var(--bg);
    transform: translateX(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
  }
  .show-detail .detail { transform: none; visibility: visible; }
  .detail-inner { padding: calc(6px + env(safe-area-inset-top)) 16px 48px; }
  .detail-bar { background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); margin: 0 -16px; padding: 8px 12px; }
  .back-btn { display: inline-grid !important; }
  .hide-mobile { display: none !important; }
  .kv { grid-template-columns: 1fr auto; padding-left: 16px; }
  .kv .k { grid-column: 1 / -1; margin-bottom: -8px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--border);
  }
  .tab { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border: 0; background: none; color: var(--muted); font-size: 11.5px; font-weight: 600; border-radius: 12px; }
  .tab.active { color: var(--accent); }
  .tab.active .ico { background: var(--accent-soft); border-radius: 999px; padding: 3px 14px; width: 52px; height: 28px; }
  .tab .ico { width: 22px; height: 22px; padding: 1px; }
  .fab {
    display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 11;
    width: 58px; height: 58px; border-radius: 18px; border: 0; color: #fff;
    background: linear-gradient(135deg, #8a7bff, #5a4bf0); box-shadow: 0 12px 28px -8px #5a4bf0;
  }
  .fab .ico { width: 26px; height: 26px; }
  [data-view="trash"] .fab { display: none; }
  .backdrop { place-items: end stretch; padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); transform: translateY(30px); }
  .link-box { grid-template-columns: 1fr; }
  .qr { width: 200px; }
  .card { padding: 26px 22px; border-radius: 20px; }
  #toasts { bottom: calc(150px + env(safe-area-inset-bottom)); }
}

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