:root {
  /* Brand colours, taken from the logo files in /resources */
  --navy: #0a1428; --petrol: #084054; --teal: #02707d; --lime: #1ac68b; --cyan: #06d2d5;
  --bg: #f3f5f4; --panel: #ffffff; --panel2: #f7f9f8; --line: #e0e5e3;
  --text: #1e2a2b; --muted: #5f6e6c; --accent: #084054; --accent-hover: #0a1428; --accent-ink: #ffffff;
  --link: #02707d; --danger: #b42318; --warn: #b45309; --ok: #12996b; --radius: 12px;
  --shadow: 0 1px 2px rgba(12, 26, 39, .05), 0 4px 14px rgba(12, 26, 39, .05);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 Inter, Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--link); }
h1 { font-size: 1.35rem; font-weight: 650; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; font-weight: 650; margin: 0 0 .6rem; }
h3 { font-size: 1.05rem; margin: 0; overflow-wrap: anywhere; }
h3 a { color: var(--accent); text-decoration: none; }
h3 a:hover { text-decoration: underline; }
code { background: #e9eeec; padding: .1em .35em; border-radius: 5px; font-size: .9em; overflow-wrap: anywhere; }
main { max-width: 820px; margin: 0 auto; padding: 16px; }
.muted { color: var(--muted); } .small { font-size: .875rem; }
.sr { position: absolute; left: -9999px; }

/* Shell: dark bar on a phone, dark sidebar on a wide screen. */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 12px 16px;
  background: #fff; color: var(--petrol); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5; box-shadow: 0 2px 10px rgba(10, 20, 40, .06); }
.brand { display: flex; flex-direction: column; gap: 5px; margin-right: auto; text-decoration: none; color: var(--petrol); }
.brand img { display: block; height: 22px; width: auto; }
.brand span { font-size: .68rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--teal); }
.top nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.top nav a, .top button.link { display: block; color: #33474c; text-decoration: none; font-weight: 500;
  font-size: .95rem; padding: 8px 12px; border-radius: 10px; }
.top nav a:hover, .top button.link:hover { background: #eef4f3; color: var(--petrol); }
.top nav a[aria-current] { background: #e6f8f0; color: var(--petrol); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--lime); }
.top form { margin: 0; }
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; font-size: .92rem; }
.subnav a { text-decoration: none; font-weight: 600; color: var(--accent); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; }
.subnav a:hover { border-color: var(--accent); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  margin: 0 0 16px; box-shadow: var(--shadow); }
.card.narrow { max-width: 440px; margin: 8vh auto 16px; }
.card.success { border-color: var(--lime); background: #eafaf3; box-shadow: 0 0 0 3px rgba(26, 198, 139, .18); }
.card .card { background: var(--panel2); box-shadow: none; }

input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 6px; padding: 11px 14px; min-height: 46px;
}
input::placeholder { color: #8a9795; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(2, 112, 125, .18); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--accent); flex: none; }
label { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
label > input, label > select, label > textarea { margin-top: 6px; font-weight: 400; letter-spacing: normal; text-transform: none; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--text);
  font-size: .95rem; font-weight: 400; letter-spacing: normal; text-transform: none; }
.stack { display: grid; gap: 14px; }
.inline { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.inline label { flex: 1 1 220px; }
.code { font-size: 1.6rem; letter-spacing: .3em; text-align: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--text); background: var(--panel); text-decoration: none;
  border: 1px solid #cfd7d4; border-radius: 6px; padding: 9px 16px; min-height: 44px; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.danger { background: #fff; color: var(--danger); border-color: #f0b4ae; }
.btn.danger:hover { background: #fdeaea; border-color: var(--danger); color: var(--danger); }
.btn.big { min-height: 54px; font-size: 1.05rem; padding: 14px 22px; width: 100%; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .9rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
button.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 6px 0; }

.create { display: grid; gap: 12px; }
.filters { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 14px; }
.filters input, .filters select { background: var(--panel); }
.list { display: grid; gap: 12px; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

.alias { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); border-left: 4px solid var(--lime); }
.alias.quarantined { border-left-color: #f0b23e; }
.alias.retired { border-left-color: #c5cdca; opacity: .8; }
.alias-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.alias-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.alias-foot form, .actions form { margin: 0; }
.nameit { display: flex; gap: 8px; margin: 10px 0 0; padding: 10px; background: #fdf6e3; border: 1px solid #f3dfa8; border-radius: 6px; }
.nameit input { flex: 1; min-width: 0; min-height: 38px; padding: 6px 12px; background: #fff; }
.alias.nameless { border-left-color: #f0b23e; }
.actions { display: grid; gap: 10px; margin-top: 14px; }
.chip { flex: none; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: #eef1f0; color: var(--muted); }
.chip.active { background: #dff7ec; color: #0b6b4a; }
.chip.quarantined { background: #fdf0d5; color: #8a4b08; }

.addr { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; cursor: pointer;
  font: .95rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-align: left; overflow-wrap: anywhere;
  color: var(--text); background: var(--panel2); border: 1px dashed #c5cdca; border-radius: 6px; padding: 11px 14px; min-height: 46px; }
.addr:hover { border-color: var(--teal); background: #eaf6f5; }
.addr.big { font-size: 1.1rem; margin-bottom: 10px; }
.addr.inlineaddr { display: inline-flex; width: auto; min-height: 0; padding: 4px 10px; }
.copy-hint { flex: none; font: 700 .7rem system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--link); }
.bigaddr { font: 600 1.3rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; margin: 4px 0 14px; color: var(--navy); }

.flash { border-radius: 6px; padding: 11px 14px; margin-bottom: 14px; font-weight: 500;
  background: #e6f8f0; color: #0b5a40; border-left: 4px solid var(--lime); }
.flash.error { background: #fdeaea; color: #7a1e1e; border-left-color: var(--danger); }
.warn { border-left: 4px solid #f0b23e; background: #fdf6e3; border-radius: 6px; padding: 10px 12px; margin-top: 10px; }
.warn.danger { border-color: var(--danger); background: #fdeaea; }
.warn form { margin-top: 10px; }
.okline { color: var(--ok); }

.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.history li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.history li:last-child { border: 0; padding-bottom: 0; }
.history form { margin-left: auto; }
.steps { padding-left: 1.2em; display: grid; gap: 10px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stats div { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.stats b { display: block; font-size: 1.5rem; color: var(--accent); } .stats span { color: var(--muted); font-size: .85rem; }
progress { width: 100%; height: 14px; accent-color: var(--accent); }
progress.hot { accent-color: var(--danger); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
tr.bad td { color: var(--danger); }
.scroll { overflow-x: auto; }

#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--navy); color: #fff; font-weight: 600; padding: 12px 18px; border-radius: 999px;
  box-shadow: 0 8px 30px rgba(10, 20, 40, .35), inset 0 0 0 1px rgba(26, 198, 139, .6);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 92vw; text-align: center; z-index: 20; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--danger); box-shadow: 0 8px 30px rgba(12, 26, 39, .35); }
.gap { margin-top: 14px; }

/* Signed-out pages: dark backdrop, white card with the logo in a dark header. */
body.auth {
  min-height: 100vh; color: var(--text);
  background:
    radial-gradient(1200px 600px at 20% -10%, #02707d 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(26, 198, 139, .16) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255, 255, 255, .025) 39px, rgba(255, 255, 255, .025) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255, 255, 255, .025) 39px, rgba(255, 255, 255, .025) 40px),
    var(--navy);
  background-attachment: fixed;
}
body.auth main { max-width: 472px; padding: 7vh 16px 24px; }
.auth-card { background: #fff; border-radius: 8px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .04), 0 0 80px rgba(6, 210, 213, .14); }
.auth-head { background: #fff; padding: 34px 32px 24px; border-bottom: 3px solid var(--lime);
  border-image: linear-gradient(90deg, var(--lime), var(--cyan)) 1; }
.auth-head img { display: block; width: 100%; max-width: 310px; height: auto; }
.auth-head p { margin: 16px 0 0; color: var(--petrol); font-size: 1.02rem; font-weight: 600; }
.auth-body { padding: 26px 32px 28px; }
.auth-body .card, .auth-body .card.narrow { max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; background: none; }
.auth-foot { text-align: center; color: rgba(255, 255, 255, .45); font-size: .8rem; margin-top: 18px; }

@media (min-width: 640px) {
  main { padding: 24px; }
  .create { grid-template-columns: 1fr auto; }
  .create .check { grid-column: 1 / -1; }
  .btn.big { width: auto; }
  .auth-body .btn.big { width: 100%; }
  .filters { grid-template-columns: 2fr 1fr 1fr auto; }
  .actions { display: flex; flex-wrap: wrap; align-items: end; }
}
@media (min-width: 980px) {
  body.shell { padding-left: 250px; }
  .top { position: fixed; inset: 0 auto 0 0; width: 250px; flex-direction: column; flex-wrap: nowrap;
    align-items: stretch; gap: 0; padding: 0; box-shadow: none; border-bottom: 0; border-right: 1px solid var(--line); }
  .brand { margin: 0; padding: 24px 20px 18px; border-bottom: 1px solid var(--line); }
  .brand img { height: auto; width: 100%; max-width: 206px; }
  .top nav { flex: 1; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 2px; padding: 16px 10px; }
  .top nav a, .top button.link { padding: 10px 12px; width: 100%; text-align: left; }
  .top nav form { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
  body.shell main { padding: 32px; }
}
@media (prefers-reduced-motion: reduce) { #toast, .btn { transition: none; } }

/* Vault */
.vault-bar { display: grid; grid-template-columns: 1fr; gap: 8px; }
.vault-sub { margin: 0 0 4px; overflow-wrap: anywhere; font: .92rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.vault-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vault-item { border-left-color: var(--teal); }
.vault-pass { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.vault-pass input { flex: 1 1 220px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.vault-pass .btn { min-height: 46px; }
details summary { cursor: pointer; color: var(--link); }
[hidden] { display: none !important; }
@media (min-width: 640px) { .vault-bar { grid-template-columns: 1fr auto auto auto; } }
.chip.category { background: #eef1f6; color: #33415c; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Printable sheet with recovery codes */
.sheet-meta { color: var(--muted); margin-top: -.4rem; }
.sheet-codes { list-style: decimal inside; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.sheet-codes li { display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; break-inside: avoid; }
.sheet-codes svg { flex: none; }
.sheet-code { background: none; padding: 0; font: 600 1.15rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }
@media print {
  body, body.shell { background: #fff; padding: 0; }
  .top, #toast, .noprint, .flash, .subnav, .tabs, [data-view]:not(.sheet), .card:not(.sheet) { display: none !important; }
  main { max-width: none; padding: 0; }
  .sheet { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .sheet-codes li { border-color: #999; }
}

/* Confirmation pop-up (dialog.js) */
dialog.ask { border: 0; border-radius: 12px; padding: 24px 24px 20px; width: min(420px, calc(100vw - 32px)); color: var(--text); background: #fff;
  border-top: 3px solid var(--lime); box-shadow: 0 30px 80px rgba(10, 20, 40, .45); }
dialog.ask::backdrop { background: rgba(10, 20, 40, .55); }
dialog.ask p { margin: 0 0 20px; font-size: 1.05rem; line-height: 1.45; overflow-wrap: anywhere; }
.ask-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.ask-actions .btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.ask-actions .btn.danger:hover { background: #8f1c13; border-color: #8f1c13; color: #fff; }

/* import preview on "Mijn kluis" */
.import-list { max-height: 420px; overflow-y: auto; border: 1px solid var(--line, #dfe5ea); border-radius: 10px; margin: 12px 0; }
.import-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line, #dfe5ea); cursor: pointer; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 1rem; color: inherit; margin: 0; }
.import-row:last-child { border-bottom: 0; }
.import-row input { width: auto; margin: 0; grid-row: span 2; }
.import-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-sub { grid-column: 2; font-size: .88em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-row .chip { grid-column: 3; grid-row: 1 / span 2; }
ul.steps { padding-left: 1.2em; }
ul.steps li { margin: 6px 0; }

/* history of a vault item */
.history { border-top: 1px solid var(--line); padding-top: 14px; }
.history-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.history-row p { margin: 0 0 6px; font-size: .92rem; }
.history-row code { display: inline-block; }

/* sharing in the vault */
.chip.shared { background: #e6f8f0; color: #0b5a40; }
.share-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.share-row:last-child { border-bottom: 0; }
input[readonly], textarea[readonly] { background: var(--panel2); }

/* devices: system and browser icons in front of the name */
.device-icons { display: inline-flex; gap: 4px; }
.device-icons:empty { display: none; }
.device-icons img { display: block; width: 20px; height: 20px; }

/* password fields: the eye that shows what was typed */
.pw { display: block; position: relative; margin-top: 6px; }
.pw > input { margin-top: 0; padding-right: 48px; font-weight: 400; letter-spacing: normal; text-transform: none; }
.pw-eye { position: absolute; top: 0; right: 0; width: 46px; height: 100%; display: grid; place-items: center;
  background: none; border: 0; border-radius: 6px; color: var(--muted); cursor: pointer; }
.pw-eye:hover { color: var(--accent); }
.pw-eye svg { width: 22px; height: 22px; }
.vault-pass .pw { flex: 1 1 220px; margin-top: 0; }

/* quick unlock: a freshly opened app stays blank until the lock screen is there */
.locking body { visibility: hidden; }

/* password check */
.check-group { border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; margin-top: 10px; background: var(--panel); }
.check-group > p { margin: 8px 0 2px; }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-what { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.check-what strong { overflow-wrap: anywhere; }
.check-where { overflow-wrap: anywhere; }
.check-why { flex-basis: 100%; color: var(--warn); }
.chip.bad { background: #fdeaea; color: #7a1e1e; }

/* Notes with formatting: see vault-notes.js */
.note-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.note-tool { font: inherit; font-size: .85rem; min-height: 36px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--petrol); cursor: pointer; }
.note-tool:hover { border-color: var(--teal); }
.note-tool-bold { font-weight: 800; } .note-tool-italic { font-style: italic; } .note-tool-both { font-weight: 800; font-style: italic; }
.note-tool-underline { text-decoration: underline; } .note-tool-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.note-view { margin-top: 10px; padding: 12px 14px; background: var(--bg); border-radius: 8px; overflow-wrap: anywhere; user-select: text; }
.note-view > :first-child { margin-top: 0; } .note-view > :last-child { margin-bottom: 0; }
.note-view h3 { font-size: 1.15rem; margin: 14px 0 6px; } .note-view h4 { font-size: 1rem; margin: 12px 0 4px; }
.note-view p { margin: 0 0 8px; } .note-view ul, .note-view ol { margin: 0 0 8px; padding-left: 22px; }
.note-view code, .note-view pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.note-view code { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.note-view pre { margin: 0 0 8px; white-space: pre-wrap; }
.note-view pre.note-code { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.nc-rood { color: #b42318; } .nc-oranje { color: #b45309; } .nc-groen { color: #12805c; } .nc-blauw { color: #1d4ed8; } .nc-paars { color: #7c3aed; }
.note-edit > label:first-child { display: block; }
.note-rich { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-weight: 400; }
.note-rich input { width: auto; }

/* Favourites and two-step codes */
.star { flex: none; border: 0; background: none; padding: 0 6px 0 0; font-size: 1.25rem; line-height: 1; color: #9aa8a6; cursor: pointer; min-height: 0; }
.star.on { color: #d99a06; }
.star:hover { color: #d99a06; }
.totp { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg); border-radius: 8px; }
.totp code { font: 700 1.35rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; color: var(--petrol); }

/* Backup reminder, a shared category, alias line */
.warn-card { border-left: 4px solid var(--warn); }
.category-bar { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.category-bar .share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.category-bar .share-row span { flex: 1 1 220px; }
.alias-info { margin-top: -4px; }
.em-detail { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.em-detail .share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.em-detail .share-row span { flex: 1 1 220px; overflow-wrap: anywhere; }
[data-emergency] .share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
[data-emergency] .share-row span { flex: 1 1 220px; }

/* Start page: tiles */
.start-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.start-head h1 { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.tile { position: relative; display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s; }
.tile:hover, .tile:focus-visible { border-color: var(--teal); transform: translateY(-2px); }
.tile-icon { display: block; color: var(--teal); background: #e6f8f0; border-radius: 10px; padding: 8px; width: 44px; height: 44px; margin-bottom: 12px; }
.tile-num { position: absolute; top: 18px; right: 18px; font-size: 1.7rem; line-height: 44px; font-weight: 650; color: var(--accent); }
.tile h2 { margin: 0 0 2px; color: var(--accent); }
.tile p { margin: 0; color: var(--muted); font-size: .9rem; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } }

/* Vault: tabs, filters beside the list, one line per item */
main:has(.vault-layout) { max-width: 1080px; }
.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 14px; padding: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tabs button { border: 0; background: none; font: inherit; font-weight: 500; color: #33474c; cursor: pointer;
  padding: 9px 14px; border-radius: 9px; min-height: 40px; }
.tabs button:hover { background: #eef4f3; color: var(--petrol); }
.tabs button[aria-current] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.tabs .tab-lock { margin-left: auto; color: var(--link); font-size: .9rem; }
.vault-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.vault-main { min-width: 0; }
.vault-filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.filter { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: inherit; font-size: .9rem; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.filter:hover { border-color: var(--teal); }
.filter[aria-current] { background: #e6f8f0; border-color: var(--lime); color: var(--petrol); font-weight: 700; }
.filter-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14em; }
.filter-count { color: var(--muted); font-size: .8rem; font-weight: 500; }
.filter-head { display: none; }
.rows { margin-top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rows:empty { display: none; }
.row-head { margin: 0; padding: 6px 14px; font-size: .8rem; font-weight: 700; letter-spacing: .06em; color: var(--muted);
  background: var(--panel2); border-bottom: 1px solid var(--line); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row:hover { background: #fafcfb; }
.row .star { padding: 0; width: 24px; text-align: center; }
.star-gap { flex: none; width: 24px; }
.row-main { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; text-decoration: none; color: var(--text); }
.row-name { font-weight: 650; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main:hover .row-name { text-decoration: underline; }
.row-sub { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-chips { display: flex; gap: 6px; flex: none; max-width: 100%; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; flex: none; margin-left: auto; }
.row-actions .btn.small { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.more { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin: 14px 0; }
@media (max-width: 639px) { .row-actions { flex-basis: 100%; margin-left: 34px; } .row-chips { margin-left: 34px; } }
@media (min-width: 900px) {
  .vault-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .vault-filters { flex-direction: column; gap: 2px; overflow: visible; padding: 8px; position: sticky; top: 16px;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); max-height: calc(100vh - 32px); overflow-y: auto; }
  .filter { border: 0; border-radius: 8px; padding: 7px 10px; background: none; text-align: left; }
  .filter:hover { background: #eef4f3; }
  .filter[aria-current] { box-shadow: inset 3px 0 0 var(--lime); }
  .filter-name { max-width: none; }
  .filter-head { display: block; margin: 10px 10px 2px; font-size: .72rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--muted); }
}
