@font-face {
  font-family: 'Permanent Marker';
  src: url('assets/permanent-marker.ttf') format('truetype');
  font-display: swap;
}

:root {
  --bg: #161718;
  --panel-hi: #303236;
  --panel-lo: #26282b;
  --well: #121314;
  --line: rgba(255, 255, 255, .07);
  --text: #e7e8ea;
  --muted: #8b8f96;
  --accent: #ffb43a;
  --accent-deep: #e0902a;
  --good: #6fcf8a;
  --warn: #e8b04a;
  --bad: #e5645a;
  --r: 14px;
  --raise: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 -1px 0 rgba(0, 0, 0, .45), 0 1px 2px rgba(0, 0, 0, .5), 0 6px 14px -6px rgba(0, 0, 0, .6);
  --sink: inset 0 2px 6px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(0, 0, 0, .35), 0 1px 0 rgba(255, 255, 255, .05);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  font-family: Inter, 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background:
    radial-gradient(1200px 700px at 50% -10%, #2a2c30 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
#app { height: 100%; }
.hidden { display: none !important; }
.screen { height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
kbd { background: var(--well); border-radius: 5px; padding: 1px 6px; box-shadow: var(--sink); font-size: .85em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(255, 180, 58, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3a3d42; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #4a4e54; background-clip: content-box; border: 2px solid transparent; }

/* ───────── surfaces ───────── */
.panel {
  background: linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  border-radius: var(--r);
  box-shadow: var(--raise);
}
.field {
  display: flex; align-items: center; gap: 4px;
  background: var(--well);
  border-radius: 10px;
  box-shadow: var(--sink);
  padding: 0 6px 0 12px;
  transition: box-shadow .2s;
}
.field:focus-within { box-shadow: var(--sink), 0 0 0 2px rgba(255, 180, 58, .55); }
.field input, .field textarea {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: 10px 0; color: var(--text);
}
.field textarea { resize: vertical; padding: 10px 0; min-height: 70px; line-height: 1.5; }
.field.area { align-items: flex-start; }
.field input::placeholder, .field textarea::placeholder { color: #5f6369; }
.field input[type=search]::-webkit-search-cancel-button { filter: invert(.6); }
.field > .ico { color: var(--muted); flex: none; margin-right: 6px; }
.search { padding-left: 12px; }

.select {
  appearance: none; border: 0; outline: 0; cursor: pointer;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  box-shadow: var(--raise);
  border-radius: 9px; padding: 7px 28px 7px 11px;
  background-image: linear-gradient(45deg, transparent 50%, #aaa 50%), linear-gradient(135deg, #aaa 50%, transparent 50%), linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%, 0 0;
  background-size: 5px 5px, 5px 5px, 100% 100%;
  background-repeat: no-repeat;
}
.select option { background: #26282b; }

.ico { width: 18px; height: 18px; flex: none; }
.ico.mini { width: 12px; height: 12px; vertical-align: -1px; }
.ico.fav { color: var(--accent); fill: var(--accent); width: 15px; height: 15px; }
.muted { color: var(--muted); }
.pad { padding: 16px; }

/* ───────── buttons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 600; color: var(--text);
  background: linear-gradient(180deg, #3a3d41, #2b2d30);
  box-shadow: var(--raise);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .5);
  transition: transform .09s var(--ease), box-shadow .09s, filter .15s;
  user-select: none;
}
.btn:hover { filter: brightness(1.12); }
.btn:active, .btn.pressed {
  transform: translateY(1px);
  background: linear-gradient(180deg, #2a2c2f, #2f3134);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .65), 0 1px 0 rgba(255, 255, 255, .05);
}
.btn.primary {
  color: #2a1a02; text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
  background: linear-gradient(180deg, #ffc867, var(--accent) 45%, var(--accent-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(120, 60, 0, .5), 0 1px 2px rgba(0, 0, 0, .6), 0 6px 14px -6px rgba(255, 150, 20, .45);
}
.btn.primary:active { background: linear-gradient(180deg, var(--accent-deep), #f0a132); box-shadow: inset 0 2px 5px rgba(100, 50, 0, .6); }
.btn.danger { color: #ffd9d5; background: linear-gradient(180deg, #8a3a34, #6d2c28); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.wide { width: 100%; padding: 12px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.busy::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none;
  background: none; border: 0; border-radius: 9px; color: var(--muted);
  transition: color .15s, background .15s, transform .09s;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.icon-btn:active { transform: scale(.88); }
.icon-btn.danger:hover { color: var(--bad); }
.field .icon-btn { width: 30px; height: 30px; }
.link { background: none; border: 0; color: var(--muted); padding: 4px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }

/* ───────── brand ───────── */
.wordmark {
  font-family: 'Permanent Marker', 'Segoe Print', cursive; font-weight: 400; letter-spacing: .01em;
  color: #f1efe9; transform: rotate(-2deg); display: inline-block; white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .12), 0 -1px 1px rgba(0, 0, 0, .7), 0 3px 8px rgba(0, 0, 0, .4);
}
.wordmark.xl { font-size: 38px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
.brand .wordmark { font-size: 21px; }
.logo-mark { width: 50px; height: 46px; flex: none; overflow: visible; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .55)); }
.logo-mark.lg { width: 84px; height: 77px; }
.logo-mark.xl { width: 88px; height: 81px; }
.logo-mark .key { transform-box: fill-box; transform-origin: 50% 50%; transition: transform .6s var(--spring); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.brand:hover .key, .lock-brand:hover .key { transform: rotate(-24deg); }

/* ───────── lock screen ───────── */
#lock { display: grid; place-items: center; padding: 20px; }
.lock-card {
  width: min(400px, 100%); padding: 34px 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .012) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #34363a, #232528);
  border-radius: 22px;
  box-shadow: var(--raise), 0 40px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .6);
  animation: rise .6s var(--ease) both;
  transition: transform .5s var(--ease), opacity .45s;
}
.lock-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 2px; }
.lock-card form { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.tagline { color: var(--muted); margin-top: -4px; }
.hint { font-size: 12px; color: var(--muted); }
.error { color: var(--bad); font-size: 13px; min-height: 1px; }
.error:empty { display: none; }
.fine { font-size: 11.5px; color: #6d7178; text-align: center; letter-spacing: .02em; }
.fine.left { text-align: left; line-height: 1.7; }
.lock-links { min-height: 24px; }
.lock-card.unlocking { transform: translateY(-14px) scale(.97); opacity: 0; transition-delay: .35s; }
.lock-card.unlocking .key { transform: rotate(90deg) scale(1.1); transition: transform .45s var(--ease); }
.lock-card.unlocking .penguin { animation: hop .45s var(--ease); }
.shake { animation: shake .4s; }

#main.entering { animation: appIn .55s var(--ease) both; }

/* ───────── app shell ───────── */
#main { display: flex; height: 100%; }
#sidebar {
  width: 232px; flex: none; display: flex; flex-direction: column; padding: 18px 12px 12px; gap: 2px; overflow-y: auto;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .014) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #232527, #1b1c1e);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .05), 1px 0 0 rgba(0, 0, 0, .6), 8px 0 24px -12px rgba(0, 0, 0, .6);
  z-index: 2;
}
#sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #666a71; padding: 16px 12px 6px; }
.nav {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 10px; padding: 9px 12px; color: #b4b7bd;
  transition: background .15s, color .15s, box-shadow .15s, transform .08s;
}
.nav span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav:hover { color: var(--text); background: rgba(255, 255, 255, .045); }
.nav:active { transform: scale(.98); }
.nav.active {
  color: var(--text);
  background: linear-gradient(180deg, #0f1011, #17181a);
  box-shadow: var(--sink);
}
.nav.active .ico { color: var(--accent); filter: drop-shadow(0 0 5px rgba(255, 180, 58, .5)); }
.nav em { font-style: normal; font-size: 11.5px; color: var(--muted); background: rgba(0, 0, 0, .3); padding: 1px 8px; border-radius: 99px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); }
.nav em.warn { color: #2a1a02; background: var(--warn); box-shadow: 0 0 8px rgba(232, 176, 74, .45); }
.side-bottom { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
#content { flex: 1; min-width: 0; height: 100%; }

/* ───────── vault: list + detail ───────── */
.vault { display: grid; grid-template-columns: 340px 1fr; height: 100%; }
.listpane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid rgba(0, 0, 0, .55); box-shadow: 1px 0 0 var(--line); background: rgba(0, 0, 0, .12); }
.list-head { padding: 16px 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.list-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.items { flex: 1; overflow-y: auto; padding: 4px 10px 16px; display: flex; flex-direction: column; gap: 3px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: none;
  padding: 9px 10px; border-radius: 12px; color: var(--text);
  transition: background .15s, box-shadow .15s, transform .08s;
}
.items.fresh .row { animation: rowIn .38s var(--ease) both; animation-delay: calc(var(--i) * 28ms); }
.row:hover { background: rgba(255, 255, 255, .045); }
.row:active { transform: scale(.985); }
.row.active { background: linear-gradient(180deg, #0f1011, #17181a); box-shadow: var(--sink); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-text b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-text small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flag { color: var(--warn); display: inline-flex; }
.flag .ico { width: 15px; height: 15px; }
.chev { transform: rotate(180deg); color: var(--muted); }
.tile {
  --h: 30; width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px;
  font-weight: 700; font-size: 16px; color: hsl(var(--h) 55% 82%);
  background: linear-gradient(180deg, hsl(var(--h) 22% 36%), hsl(var(--h) 24% 25%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -1px 0 rgba(0, 0, 0, .4), 0 2px 4px rgba(0, 0, 0, .5);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .5);
}
.tile.t-card { --h: 210; color: #bcd4ee; } .tile.t-note { --h: 45; color: #ecd9a4; }
.tile.t-card, .tile.t-note { background: linear-gradient(180deg, hsl(var(--h) 20% 34%), hsl(var(--h) 22% 24%)); }
.empty-list, .empty-detail { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: var(--muted); padding: 40px 24px; }
.empty-list h3, .empty-detail h3 { color: var(--text); }
.empty-list .btn { margin-top: 10px; }
.empty-pen, .empty-detail .logo-mark { opacity: .9; margin-bottom: 8px; }
.empty-detail { height: 100%; }
.empty-detail .logo-mark { filter: grayscale(.4) drop-shadow(0 4px 6px rgba(0, 0, 0, .6)); opacity: .55; }

.detailpane { overflow-y: auto; min-width: 0; }
.detail-card { max-width: 720px; margin: 0 auto; padding: 28px 32px 40px; }
.detail-card.enter { animation: rise .35s var(--ease) both; }
.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.detail-head .tile { width: 52px; height: 52px; font-size: 22px; border-radius: 13px; }
.head-text { flex: 1; min-width: 0; }
.head-text h2 { font-size: 22px; overflow: hidden; text-overflow: ellipsis; }
.head-text p { color: var(--muted); }
.head-actions { display: flex; align-items: center; gap: 6px; }
.fav-btn.fav-on { color: var(--accent); }
.fav-btn.fav-on .ico { fill: var(--accent); filter: drop-shadow(0 0 5px rgba(255, 180, 58, .55)); }
.fav-btn:active .ico { animation: pop .3s var(--spring); }
.back-btn { display: none; }

.plates { display: flex; flex-direction: column; gap: 10px; }
.plate {
  display: flex; align-items: center; gap: 8px; padding: 12px 10px 12px 16px;
  background: linear-gradient(180deg, #2a2c2f, #242628);
  border-radius: 12px; box-shadow: var(--raise);
}
.plate-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.plate-label { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.plate-val { font-size: 15px; word-break: break-word; }
.plate-val.mono { font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace; font-size: 14.5px; letter-spacing: .02em; }
.plate-val.ml { white-space: pre-wrap; line-height: 1.6; }
.plate-actions { display: flex; }
.c-d { color: #7fb4f0; } .c-s { color: var(--accent); }
.totp { font-size: 24px !important; letter-spacing: .14em; color: var(--accent); text-shadow: 0 0 12px rgba(255, 180, 58, .35); }
.ring { position: relative; width: 34px; height: 34px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring-bg { stroke: #121314; }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 69.12; transition: stroke-dashoffset .5s linear; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--muted); }
.hist { display: block; padding: 0; }
.hist summary { padding: 12px 16px; cursor: pointer; color: var(--muted); display: flex; align-items: center; gap: 8px; list-style: none; }
.hist summary::-webkit-details-marker { display: none; }
.hist summary .ico { width: 15px; height: 15px; }
.hist summary em { font-style: normal; margin-left: auto; }
.hist-row { display: flex; justify-content: space-between; align-items: center; padding: 2px 10px 2px 16px; color: var(--muted); border-top: 1px solid var(--line); }
.detail-foot { display: flex; gap: 20px; justify-content: center; margin-top: 24px; font-size: 12px; color: #6d7178; }

/* strength meter — five little LEDs */
.meter { display: flex; align-items: center; gap: 4px; margin-top: 6px; --c: #3a3d42; }
.meter i { width: 22px; height: 6px; border-radius: 3px; background: #111214; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .05); transition: background .25s, box-shadow .25s; }
.meter span { margin-left: 8px; font-size: 12px; color: var(--c); font-weight: 600; letter-spacing: .02em; }
.meter.s1 { --c: var(--bad); } .meter.s2 { --c: #e88a4a; } .meter.s3 { --c: var(--warn); } .meter.s4 { --c: #9ccf6f; } .meter.s5 { --c: var(--good); }
.meter.s1 i:nth-child(-n+1), .meter.s2 i:nth-child(-n+2), .meter.s3 i:nth-child(-n+3), .meter.s4 i:nth-child(-n+4), .meter.s5 i:nth-child(-n+5) {
  background: var(--c); box-shadow: 0 0 8px var(--c), inset 0 1px 0 rgba(255, 255, 255, .45);
}
#mp-meter, #ed-meter, #gen-meter { min-height: 22px; }

/* ───────── editor ───────── */
.editor-body { display: flex; flex-direction: column; gap: 14px; }
.lbl { display: flex; flex-direction: column; gap: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.lbl .field { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--well); border-radius: 12px; box-shadow: var(--sink); align-self: flex-start; }
.seg.wide { width: 100%; }
.seg button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: none; color: var(--muted);
  padding: 8px 16px; border-radius: 9px; font-weight: 600; transition: all .2s var(--ease);
}
.seg button .ico { width: 16px; height: 16px; }
.seg button.on { color: var(--text); background: linear-gradient(180deg, #3d4044, #2d2f33); box-shadow: var(--raise); }
.seg button.on .ico { color: var(--accent); }

/* physical toggle switch */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; cursor: pointer; }
.switch { position: relative; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.track { display: block; width: 46px; height: 26px; border-radius: 99px; background: var(--well); box-shadow: var(--sink); position: relative; transition: background .25s; }
.knob {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #5a5d62, #34363a 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 4px rgba(0, 0, 0, .7);
  transition: transform .28s var(--spring), background .25s;
}
.switch input:checked + .track { background: #2b1f0a; box-shadow: var(--sink), inset 0 0 12px rgba(255, 180, 58, .25); }
.switch input:checked + .track .knob { transform: translateX(20px); background: radial-gradient(circle at 35% 30%, #ffd58a, var(--accent) 70%); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ───────── pages (watchtower / generator / settings) ───────── */
.page-scroll { height: 100%; overflow-y: auto; }
.page { max-width: 720px; margin: 0 auto; padding: 32px 32px 56px; display: flex; flex-direction: column; gap: 16px; animation: rise .35s var(--ease) both; }
.page > h2 { font-size: 26px; margin-bottom: 4px; }
.page section { padding: 20px 22px; }
.page section h3 { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.page section h3 em { font-style: normal; font-size: 12px; background: var(--well); padding: 1px 9px; border-radius: 99px; box-shadow: var(--sink); color: var(--muted); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); cursor: default; }
.set-row:first-of-type { border-top: 0; }
.set-row small { display: block; color: var(--muted); }
.danger-zone h3 { color: var(--bad); }

.health-top { display: flex; align-items: center; gap: 28px; padding: 24px 28px !important; }
.health-info { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.gauge { position: relative; width: 250px; flex: none; }
.gauge svg { width: 100%; display: block; overflow: visible; }
.g-track { fill: none; stroke: #0e0f10; stroke-width: 16; stroke-linecap: round; }
.g-arc { fill: none; stroke-width: 7; stroke-linecap: round; }
.g-ticks line { stroke: #6a6e75; stroke-width: 1.6; }
.needle { transform-origin: 120px 120px; transition: transform 1.3s var(--spring); }
.needle path { fill: #ececec; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
.needle circle { fill: #3a3d41; stroke: #111; stroke-width: 1.5; }
.needle .cap { fill: var(--accent); stroke: none; }
.g-read { text-align: center; margin-top: -4px; font-variant-numeric: tabular-nums; }
.g-read b { font-size: 30px; font-weight: 700; } .g-read span { color: var(--muted); margin-left: 4px; }
.issue .row { padding: 8px 6px; }
.issue p.muted { margin: -4px 0 10px; }
.ok-line { color: var(--good); display: flex; align-items: center; gap: 8px; }

.display {
  font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace; font-size: 24px; letter-spacing: .04em; line-height: 1.5;
  padding: 24px 24px; border-radius: 14px; word-break: break-all; min-height: 92px; display: flex; align-items: center;
}
.inset { background: var(--well); box-shadow: var(--sink); }
.gen-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dice.rolling { animation: roll .55s var(--ease); }
.controls { display: flex; flex-direction: column; gap: 10px; padding: 18px 22px !important; }
.slider-row { display: grid; grid-template-columns: 70px 40px 1fr; align-items: center; gap: 10px; padding-bottom: 8px; }
.slider-row output { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
input[type=range] { appearance: none; width: 100%; height: 22px; background: none; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: var(--well); box-shadow: var(--sink); }
input[type=range]::-moz-range-track { height: 8px; border-radius: 99px; background: var(--well); box-shadow: var(--sink); }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 22px; height: 22px; margin-top: -7px; border-radius: 50%; border: 0; background: radial-gradient(circle at 35% 30%, #ffd58a, var(--accent) 70%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 2px 5px rgba(0, 0, 0, .7); transition: transform .12s; }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; border: 0; background: radial-gradient(circle at 35% 30%, #ffd58a, var(--accent) 70%); box-shadow: 0 2px 5px rgba(0, 0, 0, .7); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.12); }

/* ───────── toasts & modals ───────── */
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 50; pointer-events: none; }
.toast {
  position: relative; overflow: hidden; pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 11px 18px; border-radius: 12px;
  background: linear-gradient(180deg, #3a3d41, #2a2c2f); box-shadow: var(--raise), 0 14px 30px -10px rgba(0, 0, 0, .8);
  animation: toastIn .35s var(--spring) both;
}
.toast.out { animation: toastOut .22s forwards; }
.toast.ok::before, .toast.error::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--good); box-shadow: 0 0 8px var(--good); }
.toast.error::before { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.toast-act { background: none; border: 0; color: var(--accent); font-weight: 700; padding: 2px 4px; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; animation: shrink linear forwards; }

.scrim { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(8, 8, 9, .62); backdrop-filter: blur(4px); opacity: 0; transition: opacity .18s; }
.scrim.in { opacity: 1; }
.modal { width: min(420px, 100%); padding: 24px; display: flex; flex-direction: column; gap: 14px; transform: scale(.94) translateY(8px); transition: transform .28s var(--spring); }
.scrim.in .modal { transform: none; }
.modal-body { display: flex; flex-direction: column; gap: 12px; color: #c4c7cc; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ───────── animation ───────── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes appIn { from { opacity: 0; transform: scale(1.015); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 50% { transform: scale(1.4); } }
@keyframes roll { 0% { transform: rotate(0) scale(1); } 40% { transform: rotate(200deg) scale(1.25); } 100% { transform: rotate(360deg) scale(1); } }
@keyframes hop { 40% { transform: translateY(-3px); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.95); } }
@keyframes shrink { to { transform: scaleX(0); } }

/* ───────── responsive ───────── */
@media (max-width: 960px) {
  #sidebar { width: 68px; align-items: stretch; padding: 14px 8px; }
  .brand { justify-content: center; padding: 2px 0 14px; } .brand .wordmark, .nav span, .nav-label { display: none; }
  .nav { justify-content: center; padding: 11px 0; position: relative; }
  .nav em { position: absolute; top: 2px; right: 4px; font-size: 10px; padding: 0 6px; }
  .nav em:not(.warn) { display: none; }
  .vault { grid-template-columns: 300px 1fr; }
  .logo-mark { width: 44px; height: 40px; }
}
@media (max-width: 720px) {
  .vault { grid-template-columns: 1fr; }
  .vault.has-detail .listpane { display: none; }
  .vault:not(.has-detail) .detailpane { display: none; }
  .back-btn { display: inline-grid; }
  .detail-card { padding: 18px 16px 32px; }
  .page { padding: 20px 16px 40px; }
  .health-top { flex-direction: column; align-items: center; text-align: center; } .health-info { align-items: center; }
  .head-actions .btn span { display: none; }
  .two { grid-template-columns: 1fr; }
  .lock-card { padding: 28px 22px 20px; }
  .wordmark.xl { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ───────── account screens ───────── */
.acct-chip { padding: 7px 16px; border-radius: 99px; background: var(--well); box-shadow: var(--sink); font-size: 13px; color: #c9ccd1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -4px; }
.lock-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.lock-card .seg { align-self: stretch; }
.field input[type=email] { color: var(--text); }
