/* Angstrom Vault UI. Brand tokens: Angstrom-Brand-Kit/02_Color (v1.0). Fonts: Barlow (OFL), self-hosted. */
@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url(/fonts/barlow-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/barlow-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/barlow-semi-condensed-latin-600-normal.woff2) format("woff2"); }

:root {
  --a-red: #C00000; --a-night: #06090D; --a-deep: #99181D; --a-oxblood: #660F12; --a-glint: #F04545;
  --a-sky: #98B8D9; --a-midnight: #131B26; --a-steel: #2B3540; --a-slate: #2C3847; --a-alloy: #7D8590;
  --a-silver: #C3C8CE; --a-mist: #E6EAEF; --a-paper: #F4F6F8;

  --bg: #05080C;
  --bg-2: #080C12;
  --surface: #0C121A;
  --surface-2: #111925;
  --surface-3: #172131;
  --hover: rgba(152, 184, 217, .06);
  --select: rgba(152, 184, 217, .10);
  --line: rgba(195, 200, 206, .08);
  --line-2: rgba(195, 200, 206, .14);
  --line-3: rgba(195, 200, 206, .22);
  --text: #EEF1F5;
  --text-2: #C3C8CE;
  --muted: #8A94A1;
  --faint: #5F6976;
  --accent: var(--a-red);
  --accent-text: var(--a-glint);
  --accent-soft: rgba(192, 0, 0, .14);
  --focus: var(--a-sky);
  --ok: #3CCB7F;
  --warn: #F2A93B;
  --danger: var(--a-glint);
  --danger-soft: rgba(240, 69, 69, .10);
  --warn-soft: rgba(242, 169, 59, .10);
  --ok-soft: rgba(60, 203, 127, .10);
  --sky-soft: rgba(152, 184, 217, .10);
  --hl: inset 0 1px 0 rgba(255, 255, 255, .035);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-3: 0 24px 64px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .4);
  --r-xs: 6px; --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --font: "Barlow", "Bahnschrift", "Segoe UI", Arial, sans-serif;
  --font-narrow: "Barlow Semi Condensed", "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --logo-dark: block; --logo-light: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #EEF1F5; --bg-2: #F4F6F8; --surface: #FFFFFF; --surface-2: #F7F9FB; --surface-3: #EEF2F6;
    --hover: rgba(44, 56, 71, .045); --select: rgba(44, 56, 71, .07);
    --line: rgba(44, 56, 71, .09); --line-2: rgba(44, 56, 71, .15); --line-3: rgba(44, 56, 71, .24);
    --text: #0B1017; --text-2: #2C3847; --muted: #5E6874; --faint: #8E97A2;
    --accent-text: var(--a-deep); --accent-soft: rgba(192, 0, 0, .07); --focus: #3D6B99;
    --danger: var(--a-red); --danger-soft: rgba(192, 0, 0, .06); --sky-soft: rgba(61, 107, 153, .08); --ok: #18905A;
    --hl: inset 0 1px 0 rgba(255, 255, 255, .7);
    --shadow-1: 0 1px 2px rgba(11, 16, 23, .06);
    --shadow-2: 0 8px 24px rgba(11, 16, 23, .08), 0 1px 2px rgba(11, 16, 23, .06);
    --shadow-3: 0 24px 64px rgba(11, 16, 23, .16), 0 2px 6px rgba(11, 16, 23, .06);
    --logo-dark: none; --logo-light: block;
    color-scheme: light;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
#app { min-height: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -.005em; font-weight: 650; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 18px; }
h3 { font-size: 15.5px; }
p { margin: 0; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: 13.5px/1.55 var(--mono); }
code { font-family: var(--mono); font-size: .92em; }
kbd { font: 600 11px var(--font-narrow); letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--surface-2); white-space: nowrap; }
::selection { background: rgba(192, 0, 0, .35); color: #fff; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.right { text-align: right; white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.icon { flex: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--line-3); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px;
  border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--hl), var(--shadow-1);
  cursor: pointer; font-weight: 600; font-size: 14.5px; white-space: nowrap; color: var(--text);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .06s, filter .15s;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary {
  background: var(--a-red); border-color: var(--a-red); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(0, 0, 0, .4);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary:active { background: var(--a-deep); }
.btn.danger { background: transparent; border-color: rgba(240, 69, 69, .45); color: var(--danger); box-shadow: none; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.small { height: 32px; padding: 0 11px; font-size: 13.5px; gap: 6px; }
.btn.xl { height: 52px; font-size: 16px; border-radius: var(--r); width: 100%; }
.btn.block { width: 100%; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading > * { visibility: hidden; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); flex: none;
  background: transparent; border: 1px solid transparent; cursor: pointer; color: var(--muted); transition: background .12s, color .12s, border-color .12s;
}
.icon-btn:hover { background: var(--hover); border-color: var(--line); color: var(--text); }
.icon-btn.accent { color: var(--accent-text); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-btn.on { color: var(--warn); }
.link { background: none; border: 0; color: var(--accent-text); cursor: pointer; padding: 0; font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }
.chip-btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font: 600 12px var(--font-narrow); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.chip-btn:hover { background: var(--hover); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.label { font: 600 11.5px/1.2 var(--font-narrow); color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }
.label em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--faint); font-family: var(--font); font-weight: 400; font-size: 12.5px; }
.help { font-size: 13px; color: var(--muted); }
.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line-2);
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s; color: var(--text);
}
.input::placeholder { color: var(--faint); }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:hover { border-color: var(--line-3); }
.input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--sky-soft); background: var(--surface); }
.input:disabled { opacity: .5; }
.input.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.title-input { height: 46px; font-size: 22px; font-weight: 650; background: transparent; border-color: transparent; padding: 0 8px; margin-left: -8px; }
.title-input:hover { border-color: var(--line-2); }
.input-wrap { display: flex; gap: 6px; align-items: flex-start; }
.input-wrap .icon-btn { margin-top: 3px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--a-red); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; padding: 6px 0; }
.switch-row > span:first-child { display: flex; flex-direction: column; }
.switch-row small { color: var(--muted); font-size: 13px; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .18s; pointer-events: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .18s; }
.switch input:checked + .track { background: var(--a-red); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); column-gap: 24px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); gap: 2px; flex-wrap: wrap; }
.seg button { height: 32px; padding: 0 14px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; font-size: 14px; transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: var(--hl), var(--shadow-1); }
input[type=range].range { flex: 1; accent-color: var(--a-red); height: 4px; min-width: 0; }
input.num { width: 64px; height: 34px; text-align: center; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg-2); font-variant-numeric: tabular-nums; }

/* ---------- notices / chips ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: var(--r-sm); background: var(--sky-soft); border: 1px solid rgba(152, 184, 217, .16); color: var(--text); font-size: 14px; }
.notice .icon { margin-top: 2px; color: var(--a-sky); }
.notice-warn { background: var(--warn-soft); border-color: rgba(242, 169, 59, .22); }
.notice-warn .icon { color: var(--warn); }
.status { color: var(--danger); font-size: 14px; }
.status:empty { display: none; }
.hint { font-size: 13px; color: var(--muted); text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.chip.muted { color: var(--muted); background: transparent; }
.badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font: 600 10.5px var(--font-narrow); letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--sky-soft); color: var(--a-sky); vertical-align: middle; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.tag { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); }

/* ---------- auth / public pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; align-content: center; gap: 20px; background: var(--bg); }
.auth-card {
  position: relative; width: min(460px, 100%); padding: 36px 32px 30px; display: flex; flex-direction: column; gap: 20px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px;
}
.brand-block { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.brand-block .muted { font-size: 14.5px; }
.auth-links { display: flex; justify-content: center; }
.bullets { margin: 0; padding-left: 18px; color: var(--text-2); }
.logo-wrap { display: inline-flex; align-items: center; }
.logo { display: block; height: 30px; width: auto; }
.logo-mark { display: none; }
.logo-dark { display: var(--logo-dark); } .logo-light { display: var(--logo-light); }
.brand-block .logo { height: 38px; }
.descriptor { font: 600 12px var(--font-narrow); letter-spacing: .3em; text-transform: uppercase; color: var(--a-sky); }
.recovery-key { font: 600 19px/1.65 var(--mono); letter-spacing: .04em; text-align: center; padding: 18px; border-radius: var(--r); background: var(--bg-2); border: 1px dashed rgba(240, 69, 69, .6); word-break: break-word; user-select: all; }
.share-title { font-size: 22px; margin-top: 8px; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(255, 255, 255, .015); }
.facts .icon { color: var(--a-sky); margin-top: 2px; }
.facts strong { color: var(--text); }
.share-card { width: min(520px, 100%); }
.share-fields { display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.share-field { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; background: var(--bg-2); }
.share-field:last-child { border-bottom: 0; }
.share-field-row { display: flex; align-items: center; gap: 4px; }
.share-value { flex: 1; min-width: 0; word-break: break-all; font-size: 15px; white-space: pre-wrap; }
.share-message { padding: 12px 14px; border-left: 3px solid var(--a-red); background: var(--bg-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; display: flex; flex-direction: column; gap: 4px; }
.public-gen-inner { width: min(640px, 100%); display: flex; flex-direction: column; align-items: center; gap: 18px; }
.public-gen .auth-card { width: 100%; }

/* ---------- shell ---------- */
.shell { height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.topbar {
  position: relative; z-index: 5; height: 60px; flex: none; display: flex; align-items: center; gap: 18px; padding: 0 16px 0 20px;
  background: var(--bg-2); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; width: 236px; flex: none; }
.brand .logo { height: 21px; }
.brand .descriptor { padding-left: 12px; border-left: 1px solid var(--line-2); letter-spacing: .26em; }
.search {
  flex: 1; max-width: 620px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px 0 13px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; color: var(--muted); box-shadow: var(--hl);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--sky-soft); }
.search-input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; height: 100%; color: var(--text); }
.search-input::placeholder { color: var(--faint); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font: 600 12.5px var(--mono); font-variant-numeric: tabular-nums; }
.pill.pill-warn { color: var(--warn); border-color: rgba(242, 169, 59, .5); background: var(--warn-soft); }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-3); background: linear-gradient(135deg, var(--a-steel), var(--a-midnight)); color: var(--text); font: 700 13px var(--font); letter-spacing: .02em; cursor: pointer; box-shadow: var(--hl); }
.avatar:hover { border-color: var(--a-sky); }
.lock-btn { color: var(--text-2); }

.popover { position: absolute; z-index: 60; min-width: 240px; padding: 6px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); animation: pop .12s ease; }
.menu-head { padding: 10px 12px 10px; display: flex; flex-direction: column; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--text-2); cursor: pointer; text-align: left; font-size: 14px; }
.menu-item span { flex: 1; }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); color: var(--text); outline: none; }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* ---------- layout ---------- */
.main { flex: 1; min-height: 0; display: grid; grid-template-columns: 252px 360px 1fr; }
.main:not(.view-vault) { grid-template-columns: 252px 1fr; }
.sidebar { padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; border-right: 1px solid var(--line); background: var(--bg-2); }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-label { font: 600 11px var(--font-narrow); text-transform: uppercase; letter-spacing: .18em; color: var(--faint); padding: 16px 10px 6px; }
.nav-spacer { flex: 1; min-height: 16px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); border: 0; background: transparent; cursor: pointer; color: var(--text-2); text-align: left; font-size: 14.5px; font-weight: 500; transition: background .12s, color .12s; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--select); color: var(--text); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--a-red); }
.nav-ic { width: 22px; height: 22px; display: grid; place-items: center; color: var(--muted); }
.nav-item.active .nav-ic, .nav-item:hover .nav-ic { color: var(--text); }
.nav-ic.t-login { color: #E8676A; } .nav-ic.t-api { color: #4FB8A0; } .nav-ic.t-server { color: #E0A84A; } .nav-ic.t-ssh { color: #B79BE0; } .nav-ic.t-database { color: var(--a-sky); } .nav-ic.t-note { color: var(--a-silver); }
.nav-text { flex: 1; }
.count { font: 600 12px var(--font); color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------- list ---------- */
.list { border-right: 1px solid var(--line); overflow-y: auto; background: var(--bg); }
.list-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 18px 18px 12px; background: linear-gradient(180deg, var(--bg) 75%, transparent); }
.list-head h2 { font-size: 19px; }
.items { list-style: none; margin: 0; padding: 0 10px 16px; display: flex; flex-direction: column; gap: 2px; }
.item-row { position: relative; width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; text-align: left; transition: background .1s, border-color .1s; }
.item-row:hover { background: var(--hover); }
.item-row.selected { background: var(--surface-2); border-color: var(--line-2); box-shadow: var(--hl); }
.item-row.selected::before { content: ""; position: absolute; left: -10px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--a-red); }
.item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.item-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav { color: var(--warn); display: inline-flex; }
.row-quick { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); opacity: 0; transition: opacity .12s, background .12s; }
.item-row:hover .row-quick, .item-row.selected .row-quick, .row-quick:focus-visible { opacity: 1; }
.row-quick:hover { background: var(--surface-3); color: var(--text); }

.tile { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; color: #fff; font: 700 16px var(--font); position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); background: #3A4655; }
.tile.md { width: 40px; height: 40px; }
.tile.xl { width: 60px; height: 60px; border-radius: 15px; font-size: 25px; }
.tile.t-login { background: #B3161B; }
.tile.t-api { background: #1F7A66; }
.tile.t-server { background: #A8701E; }
.tile.t-ssh { background: #6A4BA3; }
.tile.t-database { background: #3D6B99; }
.tile.t-note { background: #4A5563; }
.chip.t-login .icon { color: #E8676A; } .chip.t-api .icon { color: #4FB8A0; } .chip.t-server .icon { color: #E0A84A; } .chip.t-ssh .icon { color: #B79BE0; } .chip.t-database .icon { color: var(--a-sky); }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 56px 28px; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 17px; }
.empty p { max-width: 360px; font-size: 14px; }
.empty .btn { margin-top: 8px; }

/* ---------- detail ---------- */
.detail { overflow-y: auto; background: var(--bg); }
.detail-inner { max-width: 820px; padding: 28px 36px 48px; display: flex; flex-direction: column; gap: 18px; }
.detail-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; color: var(--muted); padding: 24px; }
.detail-empty h3 { color: var(--text); font-size: 18px; }
.detail-empty p { max-width: 320px; font-size: 14px; }
.kbd-hints { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; }
.detail-hero { display: flex; align-items: center; gap: 16px; padding-bottom: 4px; }
.detail-hero .back { display: none; }
.item-title { font-size: 26px; display: flex; align-items: center; gap: 8px; word-break: break-word; }
.hero-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.eyebrow { font: 600 11.5px var(--font-narrow); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); }
.fields { overflow: hidden; }
.f { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label actions" "value actions" "meter meter"; column-gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); transition: background .12s; }
.f:last-child { border-bottom: 0; }
.f:hover { background: var(--hover); }
.f-label { grid-area: label; font: 600 11.5px var(--font-narrow); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.f-value { grid-area: value; min-width: 0; overflow-wrap: anywhere; font-size: 15.5px; display: flex; align-items: center; gap: 12px; }
.f-value a { display: inline-flex; align-items: center; gap: 2px; }
.f-actions { grid-area: actions; display: flex; gap: 2px; align-self: center; opacity: .55; transition: opacity .12s; }
.f:hover .f-actions, .f-actions:focus-within { opacity: 1; }
.f-meter { grid-area: meter; margin-top: 8px; }
.masked { letter-spacing: .16em; color: var(--text-2); font-size: 14px; }
.pw { font-family: var(--mono); font-size: 15px; letter-spacing: .02em; word-break: break-all; }
.pw .c-digit { color: #7FB2E5; }
.pw .c-symbol { color: var(--a-glint); }
.pw .c-space { background: rgba(152, 184, 217, .14); border-radius: 2px; }
.totp-code { font-size: 24px; font-weight: 700; letter-spacing: .08em; color: var(--text); }
.totp-ring { --p: 1; position: relative; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--a-sky) calc(var(--p) * 360deg), var(--line-2) 0); }
.totp-ring::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface); }
.totp-sec { position: relative; font: 600 11px var(--mono); color: var(--muted); }
.totp-ring.low { background: conic-gradient(var(--a-glint) calc(var(--p) * 360deg), var(--line-2) 0); }
.notes { padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; }
.notes-body { white-space: pre-wrap; font-size: 15px; color: var(--text-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--faint); font-size: 12.5px; padding: 2px 4px; }

.meter { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.meter-bars { display: flex; gap: 3px; }
.meter-bars span { width: 22px; height: 5px; border-radius: 3px; background: var(--line-2); }
.meter-label { font-weight: 600; }
.meter-bits { color: var(--faint); font-variant-numeric: tabular-nums; }
.meter.lvl-0 .on { background: var(--a-glint); } .meter.lvl-0 .meter-label { color: var(--a-glint); }
.meter.lvl-1 .on { background: var(--warn); } .meter.lvl-1 .meter-label { color: var(--warn); }
.meter.lvl-2 .on { background: #C9C34A; } .meter.lvl-2 .meter-label { color: #B5AE2E; }
.meter.lvl-3 .on { background: var(--ok); } .meter.lvl-3 .meter-label { color: var(--ok); }
.meter.lvl-4 .on { background: linear-gradient(90deg, var(--ok), #4FD1C5); } .meter.lvl-4 .meter-label { color: #3FBFB3; }

.editor { gap: 16px; }
.form-card { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; }
.custom-fields { display: flex; flex-direction: column; gap: 8px; }
.custom-fields:empty { display: none; }
.custom-row { display: grid; grid-template-columns: 1fr 1.4fr auto auto; gap: 8px; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 0 4px; background: linear-gradient(transparent, var(--bg) 40%); }

/* ---------- generator ---------- */
.gen { display: flex; flex-direction: column; gap: 16px; }
.gen-output { display: flex; align-items: center; gap: 8px; padding: 18px 14px 18px 20px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line-2); box-shadow: inset 0 2px 8px rgba(0, 0, 0, .25); min-height: 76px; }
.gen-display { flex: 1; min-width: 0; }
.gen-display .pw { font-size: 22px; line-height: 1.35; letter-spacing: .03em; word-break: normal; overflow-wrap: anywhere; }
.gen-meter { padding: 0 2px; }
.gen-buttons { display: flex; gap: 8px; }
.gen-buttons .btn { flex: 1; height: 42px; }
.gen-options { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.gen-row { display: flex; align-items: center; gap: 14px; }
.gen-label { width: 96px; flex: none; color: var(--text-2); font-weight: 500; }
.gen-row .input.select { flex: 1; }
.gen .seg { align-self: flex-start; }
.gen-card { padding: 22px; }
.modal.gen-modal { width: min(560px, 100%); }

/* ---------- pages ---------- */
.page { overflow-y: auto; background: var(--bg); }
.page-inner { max-width: 960px; margin: 0 auto; padding: 32px 36px 56px; display: flex; flex-direction: column; gap: 18px; }
.page-inner.narrow { max-width: 680px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.page-head p { margin-top: 6px; max-width: 620px; }
.links-list .card { overflow: hidden; }
.link-name { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
td .status, .status.st-active, .status.st-viewed, .status.st-expired, .status.st-burned { display: inline-flex; align-items: center; gap: 5px; font: 600 12px var(--font-narrow); letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.st-active { color: var(--a-sky); background: var(--sky-soft); }
.st-viewed { color: var(--ok); background: var(--ok-soft); }
.st-expired { color: var(--muted); background: var(--hover); }
.st-burned { color: var(--warn); background: var(--warn-soft); }
tr.dim td { color: var(--muted); }
.skeleton { display: flex; flex-direction: column; gap: 10px; padding: 6px 0; }
.skeleton span { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.skeleton span:nth-child(2) { width: 80%; } .skeleton span:nth-child(3) { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.setting { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.setting-head { display: flex; gap: 14px; align-items: flex-start; }
.setting-head p { margin-top: 3px; font-size: 14px; }
.setting-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text-2); box-shadow: var(--hl); }
.setting-body { display: flex; flex-direction: column; gap: 14px; padding-left: 52px; }
.policy { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.policy > div { position: relative; display: flex; flex-direction: column; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); }
.policy strong { font: 600 24px var(--mono); }
.policy-step { position: absolute; top: 10px; right: 12px; font: 600 11px var(--font-narrow); color: var(--faint); letter-spacing: .1em; }
.table-wrap { overflow-x: auto; width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 600 11px var(--font-narrow); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover td { background: var(--hover); }
.table tr:last-child td { border-bottom: 0; }
.sev-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 9px; background: var(--line-3); vertical-align: middle; }
.audit .sev-notice .sev-dot { background: var(--a-sky); }
.audit .sev-warn .sev-dot { background: var(--warn); }
.audit .sev-crit td { background: var(--danger-soft); }
.audit .sev-crit .sev-dot { background: var(--a-glint); box-shadow: 0 0 8px var(--a-glint); }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(3, 5, 8, .72); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s ease; }
.modal { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--hl), var(--shadow-3); animation: pop .18s cubic-bezier(.2, .8, .2, 1); }
.modal-wide { width: min(640px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 6px; }
.modal-head h2 { font-size: 19px; }
.modal-body { padding: 12px 22px 6px; display: flex; flex-direction: column; gap: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 22px 22px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(6px) scale(.985); opacity: 0; } }
.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.type-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); cursor: pointer; text-align: left; transition: border-color .12s, background .12s, transform .12s; }
.type-card:hover { border-color: var(--line-3); background: var(--surface-3); transform: translateY(-1px); }
.type-card-text { display: flex; flex-direction: column; }
.type-card-text strong { font-size: 15px; }
.type-card-text span { font-size: 13px; color: var(--muted); }
.share-source { display: flex; align-items: center; gap: 12px; }
.share-source > div { display: flex; flex-direction: column; }
.pick-list { display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.pick { display: grid; grid-template-columns: auto 150px 1fr; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; background: var(--bg-2); }
.pick:last-child { border-bottom: 0; }
.pick:hover { background: var(--hover); }
.pick input { width: 16px; height: 16px; accent-color: var(--a-red); }
.pick-label { font: 600 12px var(--font-narrow); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pick-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.option-rows { display: flex; flex-direction: column; gap: 6px; padding: 6px 14px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); }
.link-out { font-size: 13.5px; }
.created-hero { display: flex; align-items: center; gap: 14px; }
.created-hero > div { display: flex; flex-direction: column; }
.created-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(60, 203, 127, .3); }

.idle-modal { width: min(420px, 100%); text-align: center; border-color: rgba(242, 169, 59, .55); }
.idle-modal .modal-body { align-items: center; }
.idle-ring { --p: 1; width: 156px; height: 156px; border-radius: 50%; display: grid; place-items: center; margin: 6px auto 2px; background: conic-gradient(var(--warn) calc(var(--p) * 360deg), var(--line-2) 0); box-shadow: 0 0 40px rgba(242, 169, 59, .18); }
.idle-count { width: 132px; height: 132px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font: 700 34px var(--mono); font-variant-numeric: tabular-nums; }
.idle-modal .modal-actions { justify-content: center; }

.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: calc(100vw - 36px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 15px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); font-size: 14px; animation: pop .18s ease; transition: opacity .25s, transform .25s; }
.toast-ok .icon { color: var(--ok); }
.toast-error { border-color: rgba(240, 69, 69, .55); }
.toast-error .icon { color: var(--danger); }
.toast.leaving { opacity: 0; transform: translateY(6px); }

@media (prefers-color-scheme: light) {
  .auth-card { background: rgba(255, 255, 255, .94); }
  .descriptor { color: var(--a-slate); }
  .card { background: var(--surface); }
  .gen-output { background: var(--bg-2); box-shadow: inset 0 1px 4px rgba(11, 16, 23, .06); }
  .pw .c-digit { color: #2E6BAA; }
  .pw .c-symbol { color: var(--a-red); }
  .nav-ic.t-api { color: #23806C; } .nav-ic.t-server { color: #9A6512; } .nav-ic.t-ssh { color: #6B4BA8; } .nav-ic.t-database { color: #3D6B99; } .nav-ic.t-note { color: var(--a-slate); }
  .avatar { background: linear-gradient(135deg, #DDE3EA, #C9D1DB); color: var(--a-night); }
  .modal { background: var(--surface); }
  .detail, .page { background: var(--bg-2); }
  .list, .sidebar { background: var(--bg); }
  .st-active, .badge { color: #3D6B99; }
}

.mobile-bar { display: none; }
@media (max-width: 1180px) {
  .main { grid-template-columns: 220px 320px 1fr; }
  .main:not(.view-vault) { grid-template-columns: 220px 1fr; }
  .brand { width: auto; }
  .detail-inner, .page-inner { padding: 24px; }
}
@media (max-width: 880px) {
  .hide-sm { display: none !important; }
  .topbar { gap: 10px; padding: 0 12px; height: 56px; }
  .brand .descriptor, .brand .logo-wide { display: none !important; }
  .brand .logo-mark { display: block; height: 28px; }
  .pill { display: none; }
  .main, .main:not(.view-vault) { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main .detail { display: none; }
  .main.has-detail .list { display: none; }
  .main.has-detail .detail { display: block; }
  .detail-hero .back { display: inline-grid; }
  .detail-hero { flex-wrap: wrap; }
  .hero-actions { width: 100%; justify-content: flex-end; }
  .detail-inner, .page-inner { padding: 16px; }
  .mobile-bar { display: flex; gap: 8px; padding: 12px 12px 0; }
  .custom-row { grid-template-columns: 1fr 1fr auto; }
  .custom-row .check { grid-column: 1; }
  .grid2, .type-grid,   .setting-body { padding-left: 0; }
  .pick { grid-template-columns: auto 1fr; }
  .pick-value { grid-column: 2; }
  .page-head { flex-direction: column; align-items: stretch; }
  .item-title { font-size: 22px; }
  .row-quick { opacity: 1; }
  .gen-label { width: 76px; }
}

@media print {
  body * { visibility: hidden; }
  .recovery-key, .recovery-key * { visibility: visible; }
  .recovery-key { position: absolute; top: 40px; left: 0; right: 0; color: #000; border-color: #000; background: #fff; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- signed-out screens: Angstrom blueprint artwork ---------- */
.auth.auth-blueprint {
  --bg: #05080C; --bg-2: #080C12; --surface: #0C121A; --surface-2: #111925; --surface-3: #172131;
  --line: rgba(195, 200, 206, .08); --line-2: rgba(195, 200, 206, .14); --line-3: rgba(195, 200, 206, .22);
  --text: #EEF1F5; --text-2: #C3C8CE; --muted: #8A94A1; --faint: #5F6976; --accent-text: var(--a-glint);
  --focus: var(--a-sky); --sky-soft: rgba(152, 184, 217, .10); --danger: var(--a-glint);
  --logo-dark: block; --logo-light: none;
  color-scheme: dark; color: var(--text);
  display: flex; align-items: center; justify-content: flex-start;
  padding: 48px clamp(24px, 7vw, 132px);
  background: #06090D url(/brand/blueprint-1600.webp) right center / cover no-repeat;
}
@media (min-width: 1700px), (min-resolution: 1.5dppx) {
  .auth.auth-blueprint { background-image: url(/brand/blueprint-2560.webp); }
}
.auth-blueprint .auth-card {
  width: min(420px, 100%); padding: 32px; gap: 18px; border-radius: 14px;
  background: rgba(8, 12, 18, .78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(195, 200, 206, .12); box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.auth-blueprint .auth-card.wide { width: min(480px, 100%); }
.auth-head { display: flex; flex-direction: column; gap: 6px; }
.auth-head h1 { font-size: 26px; line-height: 1.2; }
.auth-head .muted { font-size: 14.5px; }
.auth-head .eyebrow { color: var(--a-sky); margin-bottom: 4px; }
.auth-head .auth-logo { display: inline-flex; margin-bottom: 14px; }
.auth-head .auth-logo .logo { height: 28px; }
.auth-blueprint .auth-links { justify-content: flex-start; }
@media (max-width: 1199px), (orientation: portrait) {
  .auth.auth-blueprint {
    justify-content: center; padding: 32px 16px;
    background: linear-gradient(rgba(6, 9, 13, .74), rgba(6, 9, 13, .74)), url(/brand/blueprint-1600.webp) 66% center / cover no-repeat, #06090D;
  }
}
@media (max-height: 760px) and (min-width: 1200px) {
  .auth.auth-blueprint { align-items: flex-start; }
}
