/* WixPass — black, red and grey. */

:root {
  --side: #0C0C0E;
  --side-2: #1A1A1D;
  --side-3: #27272B;
  --side-text: #D9D9DC;
  --side-dim: #8C8C93;
  --canvas: #EEEEF0;
  --paper: #FFFFFF;
  --line: #E0E0E4;
  --line-2: #C9C9CF;
  --text: #141416;
  --muted: #5E5F66;
  --red: #C41E2A;
  --red-hover: #A3161F;
  --red-soft: #FBE9EA;
  --red-text: #B81B27;
  --on-red: #FFFFFF;
  --steel: #8A8B92;
  --steel-soft: #F2F2F4;
  --ember: #B81B27;
  --ember-soft: #FBE9EA;
  --digit: #B81B27;
  --sym: #5E5F66;
  --focus: #D9363F;
  --mono-l: 91%;
  --mono-text-l: 28%;
  --mono-red-s: 62%;

  --r-lg: 14px;
  --r: 10px;
  --r-sm: 7px;
  --shadow-pop: 0 2px 6px rgba(0, 0, 0, .08), 0 24px 48px -16px rgba(0, 0, 0, .32);

  --font: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Segoe UI Variable Display", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --side: #060607; --side-2: #141416; --side-3: #212125; --side-text: #D9D9DC; --side-dim: #85858C;
    --canvas: #0F0F11; --paper: #18181B; --line: #2A2A2F; --line-2: #3B3B41;
    --text: #ECECEE; --muted: #9C9DA4;
    --red: #CF2731; --red-hover: #E0363F; --red-soft: #361416; --red-text: #FF6E75; --on-red: #FFFFFF;
    --steel: #8A8B92; --steel-soft: #202024; --ember: #FF6E75; --ember-soft: #361416;
    --digit: #FF6E75; --sym: #A6A7AE; --focus: #FF5A62;
    --mono-l: 21%; --mono-text-l: 86%; --mono-red-s: 42%;
    --shadow-pop: 0 2px 6px rgba(0, 0, 0, .4), 0 24px 48px -16px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --side: #060607; --side-2: #141416; --side-3: #212125; --side-text: #D9D9DC; --side-dim: #85858C;
  --canvas: #0F0F11; --paper: #18181B; --line: #2A2A2F; --line-2: #3B3B41;
  --text: #ECECEE; --muted: #9C9DA4;
  --red: #CF2731; --red-hover: #E0363F; --red-soft: #361416; --red-text: #FF6E75; --on-red: #FFFFFF;
  --steel: #8A8B92; --steel-soft: #202024; --ember: #FF6E75; --ember-soft: #361416;
  --digit: #FF6E75; --sym: #A6A7AE; --focus: #FF5A62;
  --mono-l: 21%; --mono-text-l: 86%; --mono-red-s: 42%;
  --shadow-pop: 0 2px 6px rgba(0, 0, 0, .4), 0 24px 48px -16px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
.sprite { display: none; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--font-round); letter-spacing: -0.01em; margin: 0; line-height: 1.2; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3, .h3 { font-family: var(--font-round); font-size: 1rem; font-weight: 650; margin: 0 0 .75rem; display: block; }
p { margin: 0; }
a { color: var(--red-text); text-underline-offset: 2px; }
code, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .86rem; margin: .35rem 0 .2rem; }
.hint.ok { color: var(--text); font-weight: 600; }
.spacer { flex: 1; }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

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

/* ---------- form controls ---------- */

label { display: block; font-size: .86rem; font-weight: 600; margin: 1rem 0 .35rem; color: var(--text); }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: .6rem .75rem;
  min-height: 42px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--red); flex: none; }
input[type="range"] { padding: 0; border: 0; min-height: 0; accent-color: var(--red); background: transparent; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

.check { display: flex; align-items: center; gap: .6rem; font-weight: 500; margin: .9rem 0; cursor: pointer; }
.check.compact { margin: 0; font-size: .85rem; }
.check select { width: auto; min-height: 34px; padding: .25rem .5rem; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input { padding-right: 88px; }
.input-wrap > .icon-btn { position: absolute; right: 4px; }
.input-wrap > .icon-btn + .icon-btn { right: 44px; }
.input-wrap:has(> .icon-btn:only-of-type) input { padding-right: 46px; }

.form-error { color: var(--ember); background: var(--ember-soft); border-radius: var(--r-sm); padding: .6rem .8rem; margin: 1rem 0 0; font-size: .9rem; }
.form-actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: 600 .92rem/1 var(--font);
  min-height: 40px; padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn .icon { width: 18px; height: 18px; }
.btn.primary { background: var(--red); border-color: var(--red); color: var(--on-red); }
.btn.primary:hover { background: var(--red-hover); border-color: var(--red-hover); }
.btn.danger { background: transparent; border-color: var(--red-text); color: var(--red-text); }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red-text); }
.btn.subtle { border-color: transparent; background: transparent; color: var(--muted); }
.btn.subtle:hover { background: var(--canvas); color: var(--text); }
.btn.small { min-height: 34px; padding: 0 .85rem; font-size: .86rem; }
.btn.wide { width: 100%; margin-top: 1.2rem; min-height: 46px; font-size: 1rem; }
.danger-text { color: var(--red-text) !important; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border: 0; border-radius: 999px;
  background: transparent; color: var(--muted);
  cursor: pointer; flex: none;
  text-decoration: none;
}
.icon-btn:hover { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--text); }
.icon-btn.inline { width: 36px; height: 36px; }
.icon-btn.fav-on { color: var(--red); }
.icon-btn.fav-on .icon { fill: currentColor; }

.link-btn { display: inline-flex; align-items: center; gap: .35rem; background: none; border: 0; padding: .4rem 0; color: var(--red-text); font: 600 .88rem var(--font); cursor: pointer; }
.link-btn .icon { width: 16px; height: 16px; }

.pill {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .76rem; font-weight: 600; line-height: 1;
  padding: .3rem .55rem; border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 12%, transparent); color: var(--muted);
  white-space: nowrap; max-width: 14rem; overflow: hidden; text-overflow: ellipsis;
}
.pill .icon { width: 13px; height: 13px; }
.pill.warn { background: var(--ember-soft); color: var(--ember); }

/* ---------- monograms ---------- */

.mono-sm, .mono-md, .mono-lg {
  position: relative; display: inline-grid; place-items: center; flex: none;
  background: hsl(var(--h, 240) var(--s, 5%) var(--mono-l));
  color: hsl(var(--h, 240) var(--s, 6%) var(--mono-text-l));
  font-family: var(--font-round); font-weight: 700; letter-spacing: .01em;
  border-radius: 30%;
  font-variant-numeric: normal;
}
.mono-sm { width: 34px; height: 34px; font-size: .8rem; }
.mono-md { width: 40px; height: 40px; font-size: .9rem; }
.mono-lg { width: 64px; height: 64px; font-size: 1.4rem; }
.mono-badge {
  position: absolute; right: -4px; bottom: -4px;
  width: 20px; height: 20px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--paper); color: var(--muted);
  box-shadow: 0 0 0 2px var(--paper);
}
.mono-badge .icon { width: 13px; height: 13px; stroke-width: 2; }
.mono-lg .mono-badge { width: 26px; height: 26px; right: -6px; bottom: -6px; }
.mono-lg .mono-badge .icon { width: 16px; height: 16px; }

/* ---------- auth ---------- */

.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(320px, 42%) 1fr; }
.auth-brand {
  background: var(--side); color: var(--side-text);
  padding: clamp(2rem, 6vw, 4.5rem);
  display: flex; flex-direction: column; justify-content: center; gap: 1.6rem;
  position: relative; overflow: hidden;
}
.auth-brand::after {
  content: ""; position: absolute; right: -120px; bottom: -120px; width: 360px; height: 360px;
  border-radius: 50%; border: 56px solid color-mix(in srgb, var(--red) 14%, transparent);
}
.brandmark { font: 800 1.9rem/1 var(--font-round); color: #fff; letter-spacing: -0.01em; }
.glyph { display: block; width: 44px; height: 44px; border-radius: 24%; object-fit: cover; flex: none; }
.auth-logo {
  width: clamp(120px, 13vw, 176px); height: auto; border-radius: 26%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 18px 60px -10px color-mix(in srgb, var(--red) 55%, transparent);
}
.vault-glyph { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 30%; background: var(--red-soft); color: var(--red-text); flex: none; }
.vault-glyph .icon { width: 20px; height: 20px; }
.auth-tagline { font: 600 clamp(1.7rem, 3.2vw, 2.4rem)/1.15 var(--font-round); color: #fff; max-width: 15ch; letter-spacing: -0.015em; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; color: var(--side-text); max-width: 34ch; }
.auth-points li { display: flex; gap: .7rem; align-items: flex-start; }
.auth-points .icon { color: var(--red); margin-top: 2px; }

.auth-main { display: grid; place-items: center; padding: 2rem 1.25rem; }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h1 { margin-bottom: .4rem; }
.auth-form > p.muted { margin-bottom: .5rem; }
.auth-foot { margin-top: 1.4rem; font-size: .9rem; text-align: center; }
.notice { border-left: 3px solid var(--red); background: var(--steel-soft); color: var(--text); padding: .6rem .8rem; border-radius: var(--r-sm); margin: .8rem 0 0; font-size: .9rem; }
.warning { border-left: 3px solid var(--red); display: flex; gap: .7rem; align-items: flex-start; background: var(--steel-soft); padding: .8rem .9rem; border-radius: var(--r); margin-top: 1.2rem; font-size: .9rem; }
.warning .icon { color: var(--red-text); margin-top: 1px; }

.meter-row { display: flex; align-items: center; gap: .7rem; margin-top: .5rem; min-height: 18px; }
.meter { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .2s, background .2s; }
.meter[data-score="0"] span { width: 12%; background: var(--ember); }
.meter[data-score="1"] span { width: 32%; background: var(--ember); }
.meter[data-score="2"] span { width: 56%; background: var(--steel); }
.meter[data-score="3"] span { width: 80%; background: var(--text); }
.meter[data-score="4"] span { width: 100%; background: var(--text); }
.meter-label { font-size: .8rem; color: var(--muted); min-width: 6.5em; text-align: right; }

/* ---------- shell ---------- */

.shell { display: grid; grid-template-columns: 248px minmax(300px, 360px) 1fr; height: 100dvh; overflow: hidden; }
.shell.page-mode { grid-template-columns: 248px 1fr; }
.shell.page-mode .listpane { display: none; }
.mobile-only { display: none !important; }
.scrim { display: none; }

/* sidebar */
.sidebar { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; min-height: 0; }
.nav-brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1rem .9rem 1.1rem; font: 700 1.15rem var(--font-round); color: #fff; }
.nav-brand .glyph { width: 34px; height: 34px; }
.nav-brand .icon-btn { margin-left: auto; color: var(--side-text); }
.nav-scroll { flex: 1; overflow-y: auto; padding: 0 .6rem 1rem; scrollbar-width: thin; scrollbar-color: var(--side-3) transparent; }
.nav-group { margin-top: 1rem; }
.nav-group:first-child { margin-top: .2rem; }
.nav-group h2 { font: 600 .74rem var(--font); color: var(--side-dim); margin: 0 0 .25rem .65rem; letter-spacing: .02em; }
.nav-item {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .5rem .65rem; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--side-text);
  font: 500 .92rem var(--font); text-align: left; cursor: pointer;
}
.nav-item .icon { width: 18px; height: 18px; color: var(--side-dim); }
.nav-item:hover { background: var(--side-2); }
.nav-item.active { background: var(--side-3); color: #fff; }
.nav-item.active .icon { color: var(--red-text); }
.nav-item.active { box-shadow: inset 3px 0 0 var(--red); }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { font-size: .78rem; color: var(--side-dim); font-variant-numeric: tabular-nums; }
.nav-foot { display: flex; align-items: center; gap: .65rem; padding: .8rem .8rem .8rem 1rem; border-top: 1px solid var(--side-2); }
.me { min-width: 0; flex: 1; display: grid; line-height: 1.25; }
.me strong { color: #fff; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me span { font-size: .76rem; color: var(--side-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lock-btn { color: var(--side-text); }
.lock-btn:hover { background: var(--side-2); color: #fff; }

/* list pane */
.listpane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--paper); }
.list-head { display: flex; align-items: center; gap: .5rem; padding: 1rem 1rem .6rem 1.1rem; }
.list-title { font-size: 1.3rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { position: relative; margin: 0 1rem .6rem; }
.search .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.search input { padding-left: 2.3rem; background: var(--canvas); border-color: transparent; border-radius: 999px; }
.search input:focus { background: var(--paper); }
.list { flex: 1; overflow-y: auto; padding: .2rem .5rem 1rem; }
.list.flat { padding: 0; margin: 0 -.5rem; }

.row {
  display: flex; align-items: center; gap: .85rem; width: 100%;
  padding: .6rem .6rem; border-radius: var(--r);
  cursor: pointer; text-align: left;
  border: 0; background: transparent; color: inherit; font: inherit;
}
.row:hover { background: var(--canvas); }
.row.selected { background: var(--steel-soft); box-shadow: inset 3px 0 0 var(--red); }
.row.broken .row-name { color: var(--ember); }
.row-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.row-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: .84rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { display: flex; align-items: center; gap: .35rem; }
.row-meta .fav { width: 16px; height: 16px; color: var(--red); fill: var(--red); }

.empty { padding: 2.5rem 1.2rem; text-align: center; color: var(--muted); }
.empty-actions { display: grid; gap: .6rem; margin-top: 1.2rem; justify-items: center; }

/* detail pane */
.detailpane { overflow-y: auto; min-height: 0; outline: none; }
.detail, .page { max-width: 760px; margin: 0 auto; padding: 1.2rem clamp(1rem, 3vw, 2.2rem) 4rem; }
.detail-toolbar { display: flex; align-items: center; gap: .4rem; min-height: 44px; margin-bottom: .8rem; }
.editor-title { font-size: 1.15rem; }
.detail-head { display: flex; gap: 1.1rem; align-items: center; margin-bottom: 1.3rem; }
.detail-head h1 { font-size: 1.7rem; overflow-wrap: anywhere; }
.detail-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .4rem; color: var(--muted); font-size: .9rem; }

.detail-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 1rem; color: var(--muted); padding: 2rem; text-align: center; }
.detail-empty-art { width: 88px; height: 88px; border-radius: 30%; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); color: var(--line-2); }
.detail-empty-art .icon { width: 44px; height: 44px; stroke-width: 1.3; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card > label:first-child, .card > h3 + label { margin-top: 0; }

.field { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label actions" "value actions"; column-gap: .5rem; padding: .7rem 0; border-top: 1px solid var(--line); align-items: center; }
.card > .field:first-child, .card > h3 + .field, .history > summary + .field { border-top: 0; }
.field-label { grid-area: label; font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .5rem; }
.field-value { grid-area: value; font-size: 1rem; overflow-wrap: anywhere; min-height: 1.5em; }
.field-value.small { font-size: .85rem; }
.field-value.mono { font-size: 1.02rem; letter-spacing: .02em; }
.field-value a { color: var(--text); text-decoration: none; }
.field-value a:hover { color: var(--red-text); text-decoration: underline; }
.field-actions { grid-area: actions; display: flex; align-items: center; gap: .1rem; }
.masked { letter-spacing: .12em; color: var(--muted); }
.ch-digit { color: var(--digit); }
.ch-sym { color: var(--sym); }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.notes-copy { justify-content: flex-end; margin-top: .3rem; }
.meta { font-size: .82rem; text-align: center; margin-top: 1.4rem; }

.totp-code { font-size: 1.4rem !important; font-weight: 600; letter-spacing: .08em !important; color: var(--text); }
.ring-wrap { position: relative; width: 34px; height: 34px; display: grid; place-items: center; }
.ring { position: absolute; inset: 3px; border-radius: 50%;
  background: conic-gradient(var(--muted) calc(var(--p, 1) * 360deg), var(--line) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px)); }
.ring.low { background: conic-gradient(var(--red) calc(var(--p, 1) * 360deg), var(--line) 0); }
.ring-num { font-size: .72rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

details.card > summary { cursor: pointer; font: 650 1rem var(--font-round); list-style-position: inside; }
details.card[open] > summary { margin-bottom: .4rem; }

/* editor */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; }
.form-grid .f.full { grid-column: 1 / -1; }
.form-grid .f > label { margin-top: .9rem; }
.form-grid > .f:nth-child(-n+2) > label, .form-grid > .f.full:first-child > label { margin-top: 0; }
.uri-row, .custom-row { display: flex; gap: .4rem; align-items: center; margin-bottom: .5rem; }
.custom-row input:first-child { flex: 0 0 34%; }
.fav-check { margin: .2rem 0 1rem .2rem; }

/* modals */
dialog.modal {
  border: 0; padding: 0; border-radius: var(--r-lg); background: var(--paper); color: var(--text);
  width: min(460px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem);
  box-shadow: var(--shadow-pop);
}
dialog.modal-wide { width: min(640px, calc(100vw - 2rem)); }
dialog.modal::backdrop { background: rgba(9, 24, 26, .45); backdrop-filter: blur(2px); }
dialog[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }
.modal-body { padding: 1.4rem 1.4rem 1.2rem; }
.modal-body h2 { margin-bottom: .5rem; }
.modal-body.center { text-align: center; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.4rem; }
.qr { width: min(280px, 70vw); height: auto; margin: 1rem auto 0; display: block; border-radius: var(--r); image-rendering: pixelated; }

.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: 1rem; }
.type-tile {
  display: grid; justify-items: center; gap: .5rem; padding: 1rem .5rem;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); color: var(--text);
  font: 600 .86rem var(--font); cursor: pointer; text-align: center;
}
.type-tile .icon { width: 26px; height: 26px; color: var(--red-text); }
.type-tile:hover { border-color: var(--red); background: var(--red-soft); }

/* toasts */
#toasts { position: fixed; left: 50%; bottom: max(1.2rem, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: .5rem; z-index: 100; width: min(440px, calc(100vw - 2rem)); pointer-events: none; }
.toast {
  background: var(--side); color: #fff; padding: .7rem 1rem; border-radius: var(--r); border: 1px solid var(--side-3);
  box-shadow: var(--shadow-pop); font-size: .92rem;
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.toast.in { opacity: 1; transform: none; }
.toast-error { background: var(--red); border-color: var(--red); }
.toast-ok { border-left: 4px solid var(--red); }

/* pages */
.page-body { padding-top: .4rem; }
.page-body.narrow { max-width: 620px; }
.page-head { margin-bottom: 1.3rem; }
.page-head p { margin-top: .45rem; max-width: 62ch; }
.page-actions { display: flex; gap: .6rem; margin-bottom: 1rem; }

.generator { display: grid; gap: .9rem; }
.segmented { display: inline-flex; padding: 3px; background: var(--canvas); border-radius: 999px; justify-self: start; }
.segmented button { border: 0; background: transparent; padding: .45rem 1rem; border-radius: 999px; font: 600 .88rem var(--font); color: var(--muted); cursor: pointer; }
.segmented button[aria-selected="true"] { background: var(--paper); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.gen-box { display: flex; align-items: center; gap: .5rem; background: var(--canvas); border-radius: var(--r); padding: .9rem .9rem .9rem 1.1rem; }
.gen-output { flex: 1; font-size: 1.25rem; line-height: 1.4; overflow-wrap: anywhere; min-height: 1.75em; }
.gen-actions { display: flex; }
.gen-bits { font-size: .84rem; color: var(--muted); }
.gen-options .checks { display: flex; flex-wrap: wrap; gap: 0 1.4rem; }
.gen-options .check { margin: .55rem 0; }
.slider { display: grid; grid-template-columns: 5rem 1fr 2.5rem; align-items: center; gap: .8rem; margin: .2rem 0 .3rem; font-weight: 600; }
.slider-val { font-variant-numeric: tabular-nums; text-align: right; }

.all-good { display: flex; align-items: center; gap: .5rem; color: var(--text); font-weight: 600; font-size: .92rem; }

.vault-head { display: flex; align-items: center; gap: .8rem; }
.vault-head h3 { margin: 0; }
.vault-head .hint { margin: .15rem 0 0; }
.members { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; }
.members li { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.members li:first-child { border-top: 0; }
.member-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.member-text strong { font-weight: 600; }
.member-text span { font-size: .84rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.members select { width: auto; min-height: 36px; padding: .3rem .6rem; font-size: .88rem; }
.vault-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.fp { display: inline-block; font-size: 1rem; letter-spacing: .04em; background: var(--canvas); padding: .45rem .7rem; border-radius: var(--r-sm); margin-top: .4rem; }

.invite-result { background: var(--steel-soft); border-left: 3px solid var(--red); border-radius: var(--r); padding: .9rem 1rem; margin-top: 1rem; }
.invite-result .field { border-top-color: var(--line-2); }
.invites { margin-top: 1rem; }
.invites summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--muted); }
ul.plain { list-style: none; padding: 0; margin: .6rem 0 0; }
ul.plain li { display: flex; gap: .8rem; align-items: center; padding: .45rem 0; border-top: 1px solid var(--line); font-size: .9rem; flex-wrap: wrap; }
ul.plain li > span:first-child { flex: 1; min-width: 10rem; }
.import-status { margin-top: .6rem; }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .shell { grid-template-columns: 220px minmax(270px, 320px) 1fr; }
  .shell.page-mode { grid-template-columns: 220px 1fr; }
}

@media (max-width: 860px) {
  body { font-size: 16px; }
  .mobile-only { display: inline-grid !important; }
  .shell, .shell.page-mode { grid-template-columns: 1fr; }
  .shell .listpane, .shell .detailpane { grid-column: 1; grid-row: 1; }
  .shell .detailpane { display: none; background: var(--canvas); }
  .shell[data-pane="detail"] .detailpane, .shell.page-mode .detailpane { display: block; }
  .shell[data-pane="detail"] .listpane { display: none; }
  .listpane { border-right: 0; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 84vw); z-index: 40;
    transform: translateX(-100%); transition: transform .22s ease;
    padding-top: env(safe-area-inset-top);
  }
  .shell[data-pane="nav"] .sidebar { transform: none; }
  .shell[data-pane="nav"] .scrim { display: block; position: fixed; inset: 0; background: rgba(9, 24, 26, .45); z-index: 30; }
  .list-head { padding: .8rem .8rem .5rem .5rem; padding-top: max(.8rem, env(safe-area-inset-top)); }
  .search { margin: 0 .8rem .5rem; }
  .detail, .page { padding: .6rem 1rem 5rem; padding-top: max(.6rem, env(safe-area-inset-top)); }
  .detail-head h1 { font-size: 1.4rem; }
  .mono-lg { width: 54px; height: 54px; font-size: 1.2rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > .f:nth-child(2) > label { margin-top: .9rem; }
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 1.4rem 1.25rem; gap: .5rem; }
  .auth-brand::after, .auth-points { display: none; }
  .auth-brand { flex-direction: row; align-items: center; flex-wrap: wrap; column-gap: .9rem; }
  .auth-logo { width: 56px; border-radius: 24%; box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--red) 60%, transparent); }
  .brandmark { font-size: 1.4rem; }
  .auth-tagline { flex-basis: 100%; }
  .auth-tagline { font-size: 1.05rem; max-width: none; font-weight: 500; color: var(--side-text); }
  .auth-main { place-items: start center; }
  .detail-toolbar .btn span { display: none; }
  .editor .detail-toolbar .btn:not(.primary) { display: none; }
}

/* ============================================================ sections (home, to-dos, bills & budget) */

.nav-group.sections { margin-bottom: .2rem; padding-bottom: .8rem; border-bottom: 1px solid var(--side-2); }
.nav-group.sections .nav-item { font-weight: 600; padding: .55rem .65rem; }
.nav-item.sub { padding: .4rem .65rem .4rem 1.1rem; font-size: .88rem; color: var(--side-dim); }
.nav-item.sub .icon { width: 16px; height: 16px; }
.nav-item.sub:hover { color: var(--side-text); }
.nav-item.sub.active { background: transparent; box-shadow: none; color: #fff; }
.nav-item.sub.active .nav-label { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.nav-add { color: var(--side-dim); }
.count.badge { background: var(--red); color: #fff; border-radius: 999px; padding: 0 .45rem; min-width: 1.4rem; text-align: center; font-weight: 700; line-height: 1.45; }

.page-head.with-action { display: flex; align-items: flex-start; gap: 1rem; justify-content: space-between; flex-wrap: wrap; }
.page-head.with-action > div { flex: 1 1 18rem; }
.empty-card { display: grid; gap: 1rem; justify-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.chip { border: 1px solid var(--line-2); background: var(--paper); color: var(--text); border-radius: 999px; padding: .35rem .8rem; font: 500 .86rem var(--font); cursor: pointer; }
.chip:hover { border-color: var(--red); color: var(--red-text); }
.icon-btn.flip .icon { transform: scaleX(-1); }
.icon-spacer { width: 38px; flex: none; }
.count-inline { font: 600 .8rem var(--font); color: var(--muted); margin-left: .5rem; }
.sub-h { margin-top: 1.4rem; }

/* toasts with an action */
#toasts .toast.has-action { pointer-events: auto; display: flex; align-items: center; gap: .8rem; }
.toast.has-action > span { flex: 1; }
.toast-action { background: transparent; border: 1px solid rgba(255, 255, 255, .35); color: #fff; border-radius: 999px; padding: .3rem .8rem; font: 600 .85rem var(--font); cursor: pointer; }
.toast-action:hover { background: rgba(255, 255, 255, .12); }

/* ---------- to-dos ---------- */
.todo-head { display: flex; align-items: flex-start; gap: 1rem; }
.todo-head > div:first-child { flex: 1; min-width: 0; }
.todo-head h1 { overflow-wrap: anywhere; }
.head-actions { display: flex; gap: .1rem; }
.add-task {
  display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: .35rem .4rem .35rem .9rem;
}
.add-task:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.add-task > .icon { color: var(--red-text); }
.add-task input { border: 0; box-shadow: none !important; padding: .5rem 0; background: transparent; }
.task-card { padding: .35rem .6rem; }
.done-card > summary { padding: .7rem .6rem; font-size: .95rem; color: var(--muted); }
.done-card .form-actions { margin: .2rem .4rem .6rem; }
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; gap: .3rem; border-top: 1px solid var(--line); }
.tasks > .task:first-child { border-top: 0; }
.task-main { flex: 1; display: flex; align-items: flex-start; gap: .8rem; margin: 0; padding: .75rem .4rem; font-weight: 400; font-size: 1rem; cursor: pointer; min-width: 0; }
.task-main input[type="checkbox"] { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--red); }
.task-body { display: grid; min-width: 0; line-height: 1.4; }
.task-text { overflow-wrap: anywhere; }
.task-meta { font-size: .8rem; color: var(--muted); }
.task.done .task-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.task.pending { opacity: .5; }
.task-main > input[type="text"], .task-body + input { margin: .3rem 0; }
.task-actions { display: flex; opacity: 0; transition: opacity .12s; }
.task:hover .task-actions, .task:focus-within .task-actions { opacity: 1; }
@media (hover: none) { .task-actions { opacity: 1; } }
.task > input { flex: 1; margin: .4rem; }
.tasks.mini .task-main { padding: .45rem 0; font-size: .92rem; }
.tasks.mini .task-main input[type="checkbox"] { width: 18px; height: 18px; }

/* ---------- bills ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-bottom: 1rem; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: .9rem 1rem; display: grid; gap: .15rem; }
.stat-value { font: 700 1.35rem var(--font-round); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: .4rem; }
.stat-value .icon { color: var(--red-text); }
.stat-label { font-size: .82rem; color: var(--muted); }
.stat.alert { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }

.bill-group h3 { display: flex; align-items: baseline; }
.bills { list-style: none; margin: 0; padding: 0; }
.bill { display: flex; align-items: center; gap: .85rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.bills > .bill:first-child { border-top: 0; }
.date-block {
  flex: none; width: 46px; height: 50px; border-radius: var(--r); display: grid; place-content: center; text-align: center;
  background: var(--steel-soft); border: 1px solid var(--line); line-height: 1.05;
}
.db-month { font-size: .68rem; font-weight: 700; color: var(--muted); }
.db-day { font: 700 1.2rem var(--font-round); font-variant-numeric: tabular-nums; }
.date-block.overdue { background: var(--red); border-color: var(--red); color: #fff; }
.date-block.overdue .db-month { color: rgba(255, 255, 255, .85); }
.date-block.soon { border-color: var(--red); }
.date-block.paid { opacity: .6; }
.bill-main { flex: 1; min-width: 0; display: grid; gap: .1rem; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.bill-main:hover .bill-name { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.bill-name { font-weight: 600; display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; overflow-wrap: anywhere; }
.bill-meta { font-size: .84rem; color: var(--muted); display: flex; align-items: center; gap: .3rem; }
.bill-meta .icon { width: 15px; height: 15px; }
.bill-meta.is-overdue { color: var(--red-text); font-weight: 600; }
.bill-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bill-actions { display: flex; align-items: center; gap: .2rem; }
.bill.paid .bill-amount { color: var(--muted); }

.modal-actions.split { justify-content: space-between; align-items: center; }
.modal-actions-right { display: flex; gap: .6rem; }
.pay-history { margin-top: .4rem; font-size: .9rem; }
.pay-history summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.pay-history li strong { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- budget ---------- */
.budget-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.month-nav { display: flex; align-items: center; gap: .3rem; }
.month-nav strong { font: 650 1.05rem var(--font-round); min-width: 9.5rem; text-align: center; }
.budget-total .hero-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem; margin-bottom: .7rem; }
.hero-num { font: 800 2.2rem/1 var(--font-round); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.hero-sub { margin-top: .5rem; color: var(--muted); font-size: .92rem; display: flex; align-items: center; gap: .3rem; }
.hero-sub.over { color: var(--red-text); font-weight: 600; }
.hero-sub .icon { width: 16px; height: 16px; }
.budget-meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.budget-meter > span { display: block; height: 100%; border-radius: 4px; background: var(--text); min-width: 0; }
.budget-meter.over > span { background: var(--red); }
.budget-meter.no-limit > span { background: var(--steel); }
.budget-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.budget-row { display: grid; gap: .35rem; }
.budget-line { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; }
.budget-cat { font-weight: 600; }
.budget-amt { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .92rem; }
.budget-note { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .3rem; }
.budget-note.over { color: var(--red-text); font-weight: 600; }
.budget-note .icon { width: 14px; height: 14px; }
.entries { list-style: none; margin: 0; padding: 0; }
.entry { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.entries > .entry:first-child { border-top: 0; }
.entry-text { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.entry-title { font-weight: 600; overflow-wrap: anywhere; }
.entry-sub { font-size: .82rem; color: var(--muted); }
.entry-amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.budget-edit-head, .budget-edit-row { display: grid; grid-template-columns: 1fr 9rem 38px; gap: .5rem; align-items: center; }
.budget-edit-head { font-size: .8rem; color: var(--muted); font-weight: 600; margin: 1rem 0 .3rem; }
.budget-edit { display: grid; gap: .45rem; max-height: 50dvh; overflow-y: auto; padding: 2px; }
.budget-edit-total { margin-top: .8rem; font-size: .92rem; }

/* ---------- home ---------- */
.page-body.home { max-width: 1040px; }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.home-card { margin: 0; display: grid; gap: .8rem; justify-items: stretch; }
.home-card > .btn { justify-self: start; }
.home-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.home-card-head h2 { font-size: 1.1rem; }
.home-lede { font-weight: 600; }
.home-card .bill { gap: .7rem; }
.home-card .date-block { width: 40px; height: 44px; }
.home-card .db-day { font-size: 1.05rem; }
.home-card .bill-actions .btn span { display: none; }
.home-card .bill-actions .btn { padding: 0 .6rem; }
.home-lists { display: grid; gap: .9rem; }
.home-list { display: grid; gap: .1rem; }
.home-list + .home-list { border-top: 1px solid var(--line); padding-top: .8rem; }
.home-list-name { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.home-list-name:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.home-list > .link-btn { justify-self: start; padding-top: 0; }
.home-budgets { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.home-budget { display: grid; gap: .35rem; width: 100%; background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.health-alert {
  display: flex; align-items: center; gap: .6rem; width: 100%; padding: .7rem .8rem; border-radius: var(--r);
  background: var(--red-soft); color: var(--red-text); border: 0; font: 600 .92rem var(--font); cursor: pointer; text-align: left;
}

@media (max-width: 860px) {
  .home-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
  .stat { padding: .7rem .75rem; }
  .stat-value { font-size: 1.05rem; }
  .stat-label { font-size: .76rem; line-height: 1.25; }
  .bill { flex-wrap: wrap; }
  .bill-main { flex-basis: calc(100% - 130px); }
  .bill-actions { margin-left: calc(46px + .85rem); }
  .home-card .bill-actions { margin-left: 0; }
  .home-card .bill { flex-wrap: nowrap; }
  .budget-edit-head, .budget-edit-row { grid-template-columns: 1fr 6.5rem 38px; }
  .hero-num { font-size: 1.9rem; }
}
.idle-cats { margin-top: 1.1rem; }

/* Home: generator and notes cards */
.generator.compact { gap: .7rem; }
.generator.compact .gen-output { font-size: 1.08rem; }
.generator.compact .gen-box { padding: .7rem .6rem .7rem .9rem; }
.generator.compact > .btn { justify-self: start; }
.gen-compact-opts .slider { grid-template-columns: 4rem 1fr 2rem; margin: 0; }
.home-notes { list-style: none; margin: 0; padding: 0; display: grid; }
.home-notes li + li { border-top: 1px solid var(--line); }
.home-note { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .55rem 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.home-note:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.home-note-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.home-note-text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-note-text .muted { font-size: .8rem; }
.mono-sm .mono-badge { width: 16px; height: 16px; right: -4px; bottom: -4px; }
.mono-sm .mono-badge .icon { width: 10px; height: 10px; }
