/* PasswordPal — light (default) and dark themes, blue accents */

:root,
[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --scroll-thumb: #c5cedb;
  --scroll-thumb-hover: #94a3b8;
  --border: #e3e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eaf1ff;
  --accent-text: #1e40af;
  --accent-deep: #1e40af;
  --on-accent: #ffffff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .18);
  --ring: 0 0 0 3px rgba(37, 99, 235, .25);
  --switch-off: #94a3b8;
  --switch-off-border: #7d8ca3;
  --radius: 10px;
  --radius-lg: 14px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --bg-soft: #0e1527;
  --surface: #121a2e;
  --surface-2: #18223a;
  --scroll-thumb: #2c3a5a;
  --scroll-thumb-hover: #475a82;
  --border: #233050;
  --border-strong: #334466;
  --text: #e6ebf5;
  --text-2: #b4bfd3;
  --muted: #8a97b0;
  --accent: #4f8bff;
  --accent-hover: #6b9dff;
  --accent-soft: #172a52;
  --accent-text: #a9c4ff;
  --on-accent: #ffffff;
  --danger: #f87171;
  --danger-soft: #2a1419;
  --warn: #fbbf24;
  --warn-soft: #2a2213;
  --ok: #4ade80;
  --ok-soft: #10261a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
  --ring: 0 0 0 3px rgba(79, 139, 255, .35);
  --switch-off: #3a4a6b;
  --switch-off-border: #4a5c80;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; } /* clears the sticky header when jumping to #anchors */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Icons */
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.fill { fill: currentColor; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); background: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.btn-soft:hover { background: var(--accent-soft); filter: brightness(.97); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--on-accent) var(--on-accent) transparent transparent;
  animation: spin .7s linear infinite;
}
.btn:not(.btn-primary):not(.btn-danger).loading::after { border-color: var(--accent) var(--accent) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-moon { display: block; }
[data-theme="dark"] .theme-toggle .i-sun { display: none; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--text); }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=number], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input[readonly] { background: var(--surface-2); }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.input-group:focus-within { box-shadow: var(--ring); border-color: var(--accent); }
.input-group input { border: 0; box-shadow: none !important; background: transparent; min-width: 0; }
.input-group .icon-btn { height: 40px; width: 38px; border-radius: 8px; }
.input-group .icon-btn:last-child { margin-right: 2px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.field > label.switch { display: inline-flex; font-weight: 500; }
.switch .track { display: inline-block; width: 42px; height: 24px; border-radius: 24px; background: var(--switch-off); border: 1px solid var(--switch-off-border); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

/* Strength meter */
.meter { display: flex; gap: 4px; margin-top: 8px; }
.meter span { flex: 1; height: 5px; border-radius: 3px; background: var(--border); transition: background .2s; }
.meter[data-score="0"] span:nth-child(-n+1) { background: var(--danger); }
.meter[data-score="1"] span:nth-child(-n+2) { background: #f97316; }
.meter[data-score="2"] span:nth-child(-n+3) { background: #eab308; }
.meter[data-score="3"] span:nth-child(-n+4) { background: #22c55e; }
.meter[data-score="4"] span { background: var(--ok); }
.meter-label { font-size: 12px; color: var(--muted); margin-top: 4px; min-height: 18px; }

/* ---------- Alerts, badges ---------- */
.alert { padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.alert-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }
.alert-info { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge .icon { width: 12px; height: 12px; }

/* ---------- Site header / footer ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand.small { font-size: 15px; gap: 8px; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links > a:not(.btn) { color: var(--text-2); font-weight: 500; font-size: 14px; }
.nav-links > a:not(.btn):hover, .nav-links > a.current { color: var(--accent); text-decoration: none; }
.nav-toggle { display: none; }
.site-footer { border-top: 1px solid var(--border); padding: 44px 0 28px; margin-top: 40px; font-size: 14px; background: var(--bg-soft); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; }
.footer-grid a { display: block; color: var(--text-2); padding: 4px 0; }
.footer-grid a:hover { color: var(--accent); text-decoration: none; }
.footer-brand p { margin-top: 10px; max-width: 300px; font-size: 13px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; border-top: 1px solid var(--border); margin-top: 32px; padding-top: 18px; font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.footer-inner p { margin: 0; }

/* ---------- Landing ---------- */
.hero { padding: 84px 0 64px; background: radial-gradient(1200px 400px at 50% -100px, var(--accent-soft), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); padding: 5px 12px; border-radius: 99px; margin-bottom: 18px; }
.eyebrow .icon { width: 14px; height: 14px; }
.hero h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 800; letter-spacing: -.03em; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: 18px; color: var(--text-2); max-width: 560px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 16px; font-size: 13px; color: var(--muted); }
.mock { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.mock-bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.mock-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.mock-row:last-child { border-bottom: 0; }
.mock-row b { display: block; font-size: 14px; }
.mock-row small { color: var(--muted); font-size: 12px; }
.mock-row .dots { margin-left: auto; letter-spacing: 2px; color: var(--muted); font-family: ui-monospace, monospace; }

.avatar.c0 { background: #2563eb; } .avatar.c1 { background: #0891b2; } .avatar.c2 { background: #7c3aed; } .avatar.c3 { background: #16a34a; }
.avatar.c4 { background: #db2777; } .avatar.c5 { background: #ea580c; } .avatar.c6 { background: #0d9488; } .avatar.c7 { background: #4f46e5; }
.avatar.note { background: #64748b; }
.avatar { width: 36px; height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: #fff; flex: none; text-transform: uppercase; }

.section { padding: 72px 0; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head h2 { font-size: 32px; font-weight: 800; }
.section-head p { color: var(--text-2); font-size: 17px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.feature .ficon { width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.feature h3 { font-size: 16px; margin-bottom: 6px; }
.feature p { color: var(--text-2); font-size: 14px; margin: 0; }

.sec-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.sec-step { padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.sec-step::before { counter-increment: s; content: counter(s); display: inline-flex; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.sec-step h3 { font-size: 16px; }
.sec-step p { font-size: 14px; color: var(--text-2); margin: 0; }

.pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); gap: 24px; justify-content: center; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; }
.plan.featured { border: 2px solid var(--accent); box-shadow: var(--shadow); position: relative; }
.plan.featured::before { content: "Most popular"; position: absolute; top: -12px; left: 28px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.plan h3 { font-size: 18px; }
.price { font-size: 38px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; }
.price small { font-size: 15px; font-weight: 500; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 18px 0 24px; flex: 1; }
.plan li { display: flex; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--text-2); }
.plan li .icon { color: var(--accent); width: 18px; height: 18px; margin-top: 1px; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 40px 16px; background: radial-gradient(900px 360px at 50% -80px, var(--accent-soft), transparent 70%); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.auth-card.wide { max-width: 520px; }
.auth-card h1 { font-size: 24px; font-weight: 800; }
.auth-card .sub { color: var(--text-2); margin-bottom: 24px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: 14px; color: var(--text-2); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.code-input { text-align: center; font-size: 24px !important; letter-spacing: 8px; font-family: ui-monospace, monospace; height: 54px !important; }
.recovery-key { font-family: ui-monospace, monospace; font-size: 18px; font-weight: 700; letter-spacing: 1px; text-align: center; padding: 18px; border: 2px dashed var(--accent); border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-text); word-break: break-all; user-select: all; }
.choice { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: start; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: var(--ring); }
.choice strong { display: block; }
.choice input { grid-row: span 2; margin-top: 4px; accent-color: var(--accent); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { background: var(--bg-soft); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; }
.sidebar .brand { padding: 18px 18px 14px; }
.side-nav { padding: 4px 10px; display: flex; flex-direction: column; gap: 2px; }
.side-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 16px 10px 6px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 14px; cursor: pointer; border: 0; background: none; text-align: left; width: 100%; font-family: inherit; }
.side-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-link.active { background: var(--accent-soft); color: var(--accent-text); }
.side-link .count { margin-left: auto; font-size: 12px; color: var(--muted); }
.side-link.active .count { color: var(--accent-text); }
.side-foot { margin-top: auto; padding: 14px; border-top: 1px solid var(--border); }
.usage { font-size: 12px; color: var(--muted); }
.usage-bar { height: 6px; border-radius: 4px; background: var(--border); margin: 6px 0 10px; overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.usage-bar.full span { background: var(--danger); }

.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--bg); }
.search { position: relative; flex: 1; max-width: 520px; }
.search .icon { position: absolute; left: 12px; top: 12px; color: var(--muted); }
.search input { padding-left: 38px; background: var(--bg-soft); }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.menu-wrap { position: relative; }
.user-chip { display: flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); background: none; border: 1px solid transparent; border-radius: 10px; padding: 4px 8px 4px 4px; cursor: pointer; }
.user-chip:hover, .user-chip[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border); }
.user-chip .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.user-chip[aria-expanded="true"] .chev { transform: rotate(180deg); }
.user-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); width: 290px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 80; animation: pop .14s ease; }
.menu-head { display: flex; gap: 12px; align-items: flex-start; padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head .meta { min-width: 0; }
.menu-head .meta strong, .menu-head .meta .small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-head .badge { margin-top: 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item .icon { color: var(--text-2); }
.menu-item > span:first-of-type { flex: 1; }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }

.content { flex: 1; overflow: hidden; display: grid; grid-template-columns: minmax(300px, 400px) 1fr; }
.list-pane { border-right: 1px solid var(--border); overflow-y: auto; }
.list-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 8px; }
.list-head h2 { font-size: 16px; margin: 0; }
.item-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; cursor: pointer; border-left: 3px solid transparent; }
.item-row:hover { background: var(--bg-soft); }
.item-row.active { background: var(--accent-soft); border-left-color: var(--accent); }
.item-row .meta { min-width: 0; flex: 1; }
.item-row .title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.item-row .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-row .fav { color: #f59e0b; width: 14px; height: 14px; }

.detail-pane { overflow-y: auto; padding: 28px 32px; }
.detail-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.detail-head .avatar { width: 52px; height: 52px; font-size: 22px; border-radius: 12px; }
.detail-head h2 { font-size: 22px; margin: 2px 0 4px; word-break: break-word; }
.detail-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.fields { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.frow { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.frow:last-child { border-bottom: 0; }
.frow .fl { flex: 1; min-width: 0; }
.frow .fk { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.frow .fv { font-size: 15px; word-break: break-all; }
.frow .fv.pw { font-family: ui-monospace, monospace; letter-spacing: .5px; }
.frow .fv.note { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.6; }
.detail-meta { margin-top: 16px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 18px; }

.empty { text-align: center; padding: 60px 24px; color: var(--muted); }
.empty > .icon { width: 44px; height: 44px; stroke-width: 1.5; color: var(--border-strong); margin-bottom: 10px; }
.empty h3 { color: var(--text); font-size: 17px; }

.page { overflow-y: auto; padding: 28px 32px; grid-column: 1 / -1; }
.page-narrow > * { max-width: 820px; margin-left: auto; margin-right: auto; }
.page h1 { font-size: 24px; font-weight: 800; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 18px; }
.card h3 { font-size: 16px; margin-bottom: 4px; }
.card > .muted:first-of-type { margin-bottom: 14px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--border); margin-bottom: 22px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; border: 0; background: none; color: var(--text-2); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; flex: none; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.gen-output { display: flex; align-items: center; gap: 8px; padding: 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); font-family: ui-monospace, monospace; font-size: 20px; word-break: break-all; min-height: 64px; }
.gen-output span { flex: 1; }
.gen-output .d { color: var(--accent); }
.gen-output .s { color: #e11d48; }
[data-theme="dark"] .gen-output .s { color: #fb7185; }
input[type=range] { width: 100%; accent-color: var(--accent); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.stat.bad .v { color: var(--danger); }
.stat.good .v { color: var(--ok); }

.issue-list { list-style: none; margin: 0; padding: 0; }
.issue-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.issue-list li:last-child { border-bottom: 0; }

.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: ui-monospace, monospace; font-size: 15px; padding: 14px; background: var(--surface-2); border-radius: var(--radius); margin: 12px 0; }
.qr-wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.qr-wrap svg.qr { border-radius: 8px; border: 1px solid var(--border); }
.secret { font-family: ui-monospace, monospace; font-size: 14px; background: var(--surface-2); padding: 8px 10px; border-radius: 6px; word-break: break-all; }

/* Tables (admin + activity) */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 14px; background: var(--bg-soft); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--bg-soft); }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Lock screen */
.lock-screen { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(900px 360px at 50% -80px, var(--accent-soft), transparent 70%); }
.lock-top { position: fixed; top: 14px; right: 14px; }

/* Banner */
.banner { padding: 10px 20px; font-size: 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.banner.info { background: var(--accent-soft); color: var(--accent-text); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner .banner-close { margin-left: auto; color: inherit; }
.banner .btn { margin-left: auto; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: fade .15s ease; }
.modal-backdrop.closing { opacity: 0; transition: opacity .15s; }
.modal { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal.wide { max-width: 640px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-head h2 { font-size: 18px; margin: 0; }
.modal-body { padding: 18px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 10px; background: #0f172a; color: #fff; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .2s ease; transition: opacity .4s, transform .4s; }
[data-theme="dark"] .toast { background: #e6ebf5; color: #0b1120; }
.toast.error { background: var(--danger); color: #fff; }
.toast.hide { opacity: 0; transform: translateY(6px); }
.toast .icon { width: 16px; height: 16px; }

/* ---------- Admin ---------- */
.admin { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin .sidebar { position: sticky; top: 0; height: 100vh; }
.admin-main { padding: 28px 32px; min-width: 0; }
.admin-main h1 { font-size: 24px; font-weight: 800; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type=search] { max-width: 320px; }
.toolbar select { width: auto; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 14px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; word-break: break-word; }
.inline-form { display: inline; }

/* Misc layout helpers */
.row-between { justify-content: space-between; align-items: center; }
.row-between > * { flex: none; }
.row-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.row-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.row-actions { display: flex; gap: 2px; flex: none; }
.issue-list .meta { flex: 1; min-width: 0; }
.share-perm { flex: 0 0 130px !important; }
.steps { padding-left: 20px; margin: 0 0 8px; }
.steps li { margin-bottom: 6px; }
.row > .btn { flex: none; }

/* ---------- Responsive ---------- */
.back-btn { display: none !important; }
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .features, .sec-steps { grid-template-columns: 1fr 1fr; }
  .content { grid-template-columns: 1fr; }
  .content.has-detail .list-pane { display: none; }
  .content:not(.has-detail) .detail-pane { display: none; }
  .back-btn { display: inline-flex !important; }
}
@media (max-width: 820px) {
  .app, .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed !important; inset: 0 auto 0 0; width: 270px; height: 100% !important; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .topbar { padding: 10px 12px; gap: 6px; }
  .topbar .spacer { display: none; }
  .banner { flex-wrap: wrap; }
  .menu-btn { display: inline-flex; }
  .nav-links > a:not(.btn) { display: none; }
  .admin-main, .page, .detail-pane { padding: 20px 16px; }
  .detail-head { flex-wrap: wrap; }
  .detail-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
}
@media (max-width: 600px) {
  .features, .sec-steps, .pricing { grid-template-columns: 1fr; }
  .row { flex-direction: column; gap: 0; }
  .auth-card { padding: 24px 20px; }
  .kv { grid-template-columns: 1fr; }
  .codes { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
}

.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 55; }
.mt { margin-top: 18px; }

/* Admin chart */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 10px; }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar span { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.bar:hover span { opacity: 1; }
.bars-axis { display: flex; justify-content: space-between; margin-top: 6px; }
.toolbar .spacer { flex: 1; }
.admin-main > .toolbar:first-child { margin-bottom: 8px; }


/* ---------- v1.1 additions ---------- */
.mt-sm { margin-top: 8px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.captcha { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.captcha-img { border-radius: 8px; border: 1px solid var(--border); background: #f1f5fc; display: block; }
.captcha-input { width: 190px !important; font-size: 20px !important; letter-spacing: 6px; text-align: center; font-family: ui-monospace, monospace; }
.captcha-input::placeholder { letter-spacing: normal; font-size: 15px; font-family: inherit; }
.banner-actions { margin-left: auto; display: flex; gap: 8px; }
.banner .banner-actions .btn { margin-left: 0; }
.side-title-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.side-title-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-gear { color: var(--muted); display: inline-flex; padding: 2px; border-radius: 6px; }
.side-gear:hover { color: var(--accent); background: var(--surface-2); }
.side-gear .icon { width: 14px; height: 14px; }
.side-link.muted { color: var(--muted); font-size: 13px; }
.select-sm { height: 34px !important; width: auto !important; font-size: 13px; padding-right: 28px !important; background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px !important; }
.modal-foot .spacer { flex: 1; }
.org-card { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.org-card:last-child { border-bottom: 0; }
.org-card .meta { flex: 1; min-width: 160px; }
.org-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.org-icon.lg { width: 54px; height: 54px; border-radius: 14px; }
.org-icon.lg .icon { width: 26px; height: 26px; }
.org-title { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.org-title h1 { margin-bottom: 4px; }
.pricing.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; justify-content: stretch; }
.pricing.compact.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pricing.compact .plan { padding: 20px; }
.pricing.compact .plan.featured::before { content: none; }
.pricing.compact .price { font-size: 26px; }
.pricing.four { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: none; }
.plan .tagline { color: var(--muted); font-size: 14px; min-height: 42px; }

/* Content pages (features, help, legal, contact) */
.page-hero { padding: 64px 0 40px; background: radial-gradient(1000px 340px at 50% -80px, var(--accent-soft), transparent 70%); border-bottom: 1px solid var(--border); }
.page-hero h1 { font-size: clamp(30px, 4.4vw, 44px); font-weight: 800; letter-spacing: -.025em; max-width: 780px; }
.page-hero .lead { margin-bottom: 0; }
.page-hero .eyebrow { margin-bottom: 14px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.prose { max-width: 760px; font-size: 16px; line-height: 1.7; color: var(--text); }
.prose h2 { font-size: 24px; margin: 44px 0 12px; font-weight: 800; }
.prose h3 { font-size: 18px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--text-2); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.prose .callout { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 14px 18px; border-radius: 0 10px 10px 0; color: var(--accent-text); margin: 22px 0; }
.prose .callout p { color: inherit; margin: 0; }
.prose .callout.warn { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--bg-soft); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.with-toc { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; align-items: start; padding: 40px 0 20px; }
.toc { position: sticky; top: 84px; font-size: 14px; }
.toc h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.toc a { display: block; padding: 5px 0 5px 12px; color: var(--text-2); border-left: 2px solid var(--border); }
.toc a:hover { color: var(--accent); border-left-color: var(--accent); text-decoration: none; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
a.feature { color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; display: block; }
a.feature:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.feature .more { display: inline-block; margin-top: 12px; font-weight: 600; color: var(--accent); font-size: 14px; }
.steps-big { counter-reset: st; list-style: none; padding: 0; }
.steps-big > li { counter-increment: st; position: relative; padding-left: 46px; margin-bottom: 18px; }
.steps-big > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.faq details { border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; background: var(--surface); }
.faq summary { font-weight: 600; cursor: pointer; color: var(--text); }
.faq details[open] summary { margin-bottom: 8px; }
.faq details p { margin: 0; }
.cta-band { margin: 56px 0 10px; padding: 34px; border-radius: 18px; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.cta-band h2 { margin: 0 0 4px; font-size: 24px; color: #fff; }
.cta-band p { margin: 0; color: rgba(255, 255, 255, .85); }
.cta-band .btn { background: #fff; color: var(--accent-deep); border-color: #fff; }
.side-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 36px; }
.side-cards a { display: block; padding: 16px; border: 1px solid var(--border); border-radius: 12px; color: inherit; background: var(--surface); }
.side-cards a:hover { border-color: var(--accent); text-decoration: none; }
.side-cards strong { display: block; margin-bottom: 4px; }
.side-cards span { color: var(--muted); font-size: 14px; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; padding: 40px 0; align-items: start; }
.not-found { text-align: center; padding: 100px 20px; }
.not-found .big { font-size: 72px; font-weight: 800; color: var(--accent); letter-spacing: -.04em; }

@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .pricing.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .with-toc { grid-template-columns: 1fr; gap: 20px; }
  .toc { position: static; border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav { position: relative; }
  .nav-links { display: none; position: absolute; top: 64px; left: -20px; right: -20px; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 20px 16px; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links > a:not(.btn) { display: block; padding: 10px 0; font-size: 15px; }
  .nav-links > .btn { margin-top: 8px; }
  .user-name, .user-chip .chev { display: none; }
  .pricing.compact.three { grid-template-columns: 1fr; }
  .menu { position: fixed; right: 10px; left: 10px; top: 60px; width: auto; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .pricing.four, .pricing.compact, .feature-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 24px; }
  .page-hero { padding: 44px 0 28px; }
}
.message-body { white-space: normal; line-height: 1.65; padding: 14px; background: var(--bg-soft); border-radius: 10px; border: 1px solid var(--border); }
.table tr.unread td { font-weight: 600; }
.table tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.feature-grid.two { grid-template-columns: 1fr 1fr; margin: 16px 0; } .prose .feature h3 { margin-top: 0; } .prose .feature p { margin: 0; }
.center-row { justify-content: center; } .toc a.current { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.link-list { list-style: none; padding: 0; margin: 0; } .link-list li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; } .link-list li:last-child { border-bottom: 0; }
.h-xl { font-size: clamp(28px, 3.6vw, 38px); font-weight: 800; letter-spacing: -.02em; }
.ticks { list-style: none; padding: 0; margin: 0 0 24px; }
.ticks li { display: flex; gap: 10px; padding: 5px 0; color: var(--text-2); }
.ticks .icon { color: var(--accent); }
.center-block { margin: 0 auto; }
#families .mock .avatar.note { font-size: 16px; }

/* ---------- v1.2 ---------- */
/* Compact item editor */
.modal.compact .modal-body { padding-top: 12px; padding-bottom: 8px; }
.modal.compact .field { margin-bottom: 12px; }
.modal.compact .tabs { margin-bottom: 12px; }
.modal.compact .meter { margin-top: 6px; }
.modal.compact .meter-label { min-height: 0; margin-top: 2px; }
.modal.compact textarea { min-height: 72px; }
.modal.compact .row { gap: 12px; }
.modal.compact .hint { margin-top: 4px; }
#ed-folder-new { margin-top: 8px; }
.star-toggle { color: var(--muted); }
.star-toggle.on, .star-toggle.on:hover { color: #f59e0b; }
.star-toggle.on svg { fill: currentColor; }
/* Native dropdowns: clear border and contrasting option list in both themes */
select { border-color: var(--border-strong); background-color: var(--surface); }
select option { background: var(--surface); color: var(--text); }
select:hover { border-color: var(--muted); }
/* Avatars with images (Gravatar / website icons) */
.avatar { position: relative; overflow: hidden; }
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .15s; }
.avatar.has-img > img { opacity: 1; }
.avatar.has-img.site { background: #fff; border: 1px solid var(--border); }
.avatar.has-img.site > img { inset: 18%; width: 64%; height: 64%; object-fit: contain; }
.role-help { margin-top: 10px; padding: 12px 14px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; font-size: 13px; color: var(--text-2); }
.role-help strong { color: var(--text); }
.role-help ul { margin: 6px 0 0; padding-left: 18px; }
.role-help li { margin: 2px 0; }
.folder-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.folder-row:last-child { border-bottom: 0; }
.folder-row .meta { flex: 1; min-width: 0; }
.folder-row .meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar.has-img { color: transparent; }
.plan-note { font-size: 13px; color: var(--muted); margin: -2px 0 8px; }

.reply { margin-top: 12px; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; line-height: 1.6; }
.reply .small { margin-bottom: 4px; }

/* Admin colour-theme picker */
.theme-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 8px; }
.theme-pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.theme-pick:has(input:checked) { border-color: var(--accent); box-shadow: var(--ring); }
.theme-pick a { margin-left: auto; font-size: 13px; }
.theme-swatch { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.sw-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.sw-teal { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.sw-indigo { background: linear-gradient(135deg, #6366f1, #4338ca); }
.sw-emerald { background: linear-gradient(135deg, #10b981, #047857); }
/* Banner while previewing a theme that isn't live */
.theme-preview-bar { background: var(--accent); color: var(--on-accent); text-align: center; font-size: 13px; padding: 6px 12px; }
.theme-preview-bar a { color: inherit; text-decoration: underline; font-weight: 600; }

/* ---------- Scrollbars ----------
 * Slim, rounded, and matched to light/dark mode. Firefox and Chrome/Edge use the standard properties;
 * Safari (which doesn't support them yet) gets the ::-webkit-scrollbar rules instead. */
html { scrollbar-color: var(--scroll-thumb) var(--bg); }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
*:hover { scrollbar-color: var(--scroll-thumb-hover) transparent; }
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
  ::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }
  ::-webkit-scrollbar-corner { background: transparent; }
}
/* Keep the hidden scrollbar on the settings tabs */
.tabs { scrollbar-width: none; }

/* ---------- Coming soon page ---------- */
.cs-body { background: var(--bg); }
.cs { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 56px 16px 28px; position: relative;
  background: radial-gradient(900px 480px at 50% -60px, var(--accent-soft), transparent 70%), radial-gradient(600px 400px at 100% 100%, var(--accent-soft), transparent 70%); }
.cs-theme { position: absolute; top: 16px; right: 16px; }
.cs-card { width: 100%; max-width: 620px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 44px 36px 36px; box-shadow: 0 24px 60px -28px rgba(15, 23, 42, .28); }
.cs-logo { width: 88px; height: 88px; margin: 0 auto 10px; border-radius: 24px; display: grid; place-items: center; background: var(--accent-soft); }
.cs-brand { font-weight: 800; font-size: 20px; letter-spacing: -.01em; margin-bottom: 18px; }
.cs-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.cs-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: cs-pulse 1.8s ease-in-out infinite; }
@keyframes cs-pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); opacity: 1; } 50% { box-shadow: 0 0 0 6px transparent; opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .cs-dot { animation: none; } }
.cs h1 { font-size: clamp(30px, 5.4vw, 44px); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; margin: 0 0 14px; }
.cs h1 .accent { color: var(--accent); }
.cs-lead { color: var(--text-2); font-size: 17px; line-height: 1.6; max-width: 480px; margin: 0 auto 22px; }
.cs-points { list-style: none; padding: 0; margin: 0 0 26px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.cs-points li { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; font-weight: 500; background: var(--bg-soft); }
.cs-points .icon { width: 16px; height: 16px; color: var(--accent); }
.cs-actions { margin: 0; }
.cs-foot { text-align: center; }
.cs-foot a { color: inherit; }
@media (max-width: 520px) { .cs-card { padding: 32px 20px 26px; border-radius: 16px; } .cs-lead { font-size: 16px; } }

/* ---------- Authenticator codes ---------- */
.totp-line { display: flex; align-items: center; gap: 14px; }
.totp-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 22px; font-weight: 700; letter-spacing: .08em; color: var(--accent-text); }
.totp-timer { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.totp-ring { width: 20px; height: 20px; transform: rotate(-90deg); }
.totp-ring circle { fill: none; stroke-width: 3; }
.totp-ring .bg { stroke: var(--border); }
.totp-ring .arc { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.totp-ring.ending .arc { stroke: var(--danger); }
.hint.ok-text { color: var(--ok); }
.hint.error-text { color: var(--danger); }

/* ---------- Page hero illustrations (src/views/hero-art.php) ---------- */
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 48px; align-items: center; }
.page-hero.has-art { padding-bottom: 48px; }
.hero-art { max-width: 420px; width: 100%; justify-self: end; font-size: 14px; }
.hero-art .mock { box-shadow: var(--shadow-lg); }
.hero-art .icon { width: 16px; height: 16px; }
.ha-pad { padding: 18px 18px 16px; }
.ha-pad.center, .ha-title.center { text-align: center; justify-content: center; }
.ha-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.ha-sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.ha-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ha-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.ha-ic { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.ha-ic.sm { width: 26px; height: 26px; border-radius: 8px; }
.ha-ic .icon { width: 18px; height: 18px; }
.ha-ic.sm .icon { width: 14px; height: 14px; }
.ha-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 600; }
.ha-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 14px; }
.ha-foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-top: 14px; }
.ha-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; font-size: 13px; }
.ha-ring { width: 64px; height: 64px; transform: rotate(-90deg); flex: none; }
.ha-ring.sm { width: 22px; height: 22px; }
.ha-ring circle { fill: none; stroke-width: 4; }
.ha-ring .bg { stroke: var(--border); }
.ha-ring .arc { stroke: var(--accent); stroke-linecap: round; }
.ha-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; font-size: 16px; letter-spacing: .06em; color: var(--accent-text); margin-left: auto; }
/* features overview tiles */
.ha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
.ha-tile { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--bg-soft); }
.ha-tile .ha-ic { margin-bottom: 10px; }
.ha-tile b { display: block; font-size: 14px; }
.ha-tile small { color: var(--muted); font-size: 12px; }
/* encryption flow */
.ha-flow { padding: 18px; }
.ha-field { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); }
.ha-field .icon { color: var(--accent); }
.ha-cipher { color: var(--muted); overflow: hidden; white-space: nowrap; }
.ha-arrow { display: flex; justify-content: center; position: relative; padding: 12px 0; }
.ha-arrow::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px dashed var(--border-strong); }
.ha-arrow .ha-chip { position: relative; background: var(--surface); border: 1px solid var(--accent); }
/* 2FA */
.ha-otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 16px; }
.ha-otp span { height: 40px; border: 1px solid var(--border-strong); border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 18px; background: var(--surface); }
.ha-otp .cur { border-color: var(--accent); box-shadow: var(--ring); }
.ha-app { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--border); }
.ha-app b { display: block; font-size: 13px; } .ha-app small { color: var(--muted); font-size: 11px; }
/* passkeys */
.ha-big-ic { width: 64px; height: 64px; margin: 4px auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.ha-big-ic .icon { width: 32px; height: 32px; }
/* item detail */
.ha-item-head { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.ha-item-head b { display: block; font-size: 15px; } .ha-item-head small { color: var(--muted); font-size: 12px; }
.ha-item-head .badge { margin-left: auto; }
.ha-kv { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.ha-kv:last-child { border-bottom: 0; }
.ha-kv .ha-label { grid-column: 1 / -1; }
.ha-kv .ha-code { margin-left: 0; font-size: 15px; }
.ha-act { color: var(--muted); }
/* sharing */
.ha-input { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--accent); box-shadow: var(--ring); border-radius: 10px; background: var(--surface); font-size: 13px; margin: 10px 0 8px; }
.ha-select { margin-left: auto; color: var(--muted); font-size: 12px; border-left: 1px solid var(--border); padding-left: 10px; }
.ha-people .mock-row { padding: 10px 0; }
.ha-people .avatar, .ha-stack .avatar { width: 30px; height: 30px; font-size: 13px; border-radius: 50%; }
/* families */
.ha-stack { display: flex; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ha-stack .avatar { border: 2px solid var(--surface); margin-right: -8px; }
/* security score */
.ha-score { display: flex; align-items: center; gap: 16px; padding: 16px; border-bottom: 1px solid var(--border); }
.ha-score b { display: block; font-size: 15px; } .ha-score small { color: var(--muted); font-size: 12px; }
.ha-score-ring { position: relative; width: 64px; height: 64px; flex: none; }
.ha-score-ring span { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ha-score-ring span b { font-size: 18px; } .ha-score-ring span small { font-size: 10px; }
.ha-dot { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.ha-dot.ok { background: var(--ok-soft); color: var(--ok); }
.ha-dot.warn { background: var(--warn-soft, #fffbeb); color: var(--warn, #b45309); }
.hero-art .mock-row .badge { margin-left: auto; flex: none; }
/* help checklist */
.ha-progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 8px 0 14px; }
.ha-progress span { display: block; height: 100%; width: 60%; background: var(--accent); border-radius: inherit; }
.ha-checklist div { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; color: var(--muted); }
.ha-checklist div > span { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; flex: none; }
.ha-checklist .done { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.ha-checklist .done > span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ha-checklist .done .icon { width: 12px; height: 12px; stroke-width: 3; }
.ha-checklist .now { color: var(--text); font-weight: 600; }
.ha-checklist .now > span { border-color: var(--accent); }
/* contact chat */
.ha-chat { display: flex; flex-direction: column; gap: 10px; }
.ha-msg { max-width: 82%; padding: 10px 13px; border-radius: 14px; font-size: 13px; line-height: 1.45; }
.ha-msg.me { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.ha-msg.them { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.ha-typing { align-self: flex-start; display: flex; gap: 4px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.ha-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .5; animation: ha-blink 1.2s infinite; }
.ha-typing i:nth-child(2) { animation-delay: .2s; } .ha-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes ha-blink { 0%, 100% { opacity: .25; } 50% { opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .ha-typing i { animation: none; } }
/* Below tablet width the illustration is left out so the page content comes first */
@media (max-width: 900px) {
  .page-hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-art { display: none; }
  .page-hero.has-art { padding-bottom: 40px; }
}
