/* ShoreGuard Vault — app styles (ShoreGuard palette) */
:root {
  --bg: #f7f5f0; --surface: #ffffff; --surface-2: #f1eee6; --ink: #0f1d2b; --ink-2: #44546a; --ink-3: #6b7a8e;
  --line: #e2ddd1; --navy: #0b2236; --navy-2: #12324d; --accent: #0f8f8a; --accent-2: #0b7773; --accent-ink: #fff;
  --accent-soft: #e3f4f2; --wave: #7fe0d6; --pass: #1f8a4c; --pass-bg: #e5f5ea; --warn: #a86400; --warn-bg: #fdf1dc;
  --fail: #c0362c; --fail-bg: #fde8e6; --info-bg: #eef1f5;
  --radius: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(15,29,43,.05), 0 6px 24px rgba(15,29,43,.07);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #08182a; --surface: #0e2338; --surface-2: #132c45; --ink: #e8eef5; --ink-2: #b4c2d3; --ink-3: #8597ad;
  --line: #1f3a56; --accent: #2fb5ad; --accent-2: #46c9c1; --accent-ink: #04201f; --accent-soft: #0f3a3d;
  --pass: #4cc483; --pass-bg: #113526; --warn: #f0b04a; --warn-bg: #3a2b10; --fail: #ff7a6e; --fail-bg: #3e1a17; --info-bg: #15304a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
ul { margin: 0 0 .8em; padding-left: 1.2em; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small, small { font-size: .85rem; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.pre { white-space: pre-wrap; }
kbd { font: 12px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface-2); }
.ic { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.ic.flip { transform: rotate(180deg); width: 16px; color: var(--ink-3); }
.logo { width: 34px; height: 34px; flex: none; }
.spacer { flex: 1; }
.error { color: var(--fail); font-weight: 600; margin: 0; }
.warn-text { color: var(--warn); font-size: .9rem; display: flex; gap: 6px; align-items: flex-start; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 9px 16px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { background: var(--fail); border-color: var(--fail); color: #fff; }
.btn.ghost { background: transparent; }
.btn.ghost.danger { color: var(--fail); border-color: transparent; }
.btn.ghost.danger:hover { background: var(--fail-bg); }
.btn.small { padding: 6px 12px; font-size: .88rem; }
.btn.small .ic { width: 17px; height: 17px; }
.btn.big { padding: 13px 18px; font-size: 1rem; width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; flex: none; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.on { color: #e0a100; }
.icon-btn.on .ic { fill: currentColor; }
.icon-btn.tiny { width: 26px; height: 26px; border-radius: 7px; }
.icon-btn.tiny .ic { width: 16px; height: 16px; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 4px 0; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.link.small { font-size: .88rem; }
.link.back { margin-bottom: 8px; padding-left: 0; }
.link .ic { width: 16px; height: 16px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: .82rem; font-weight: 700; color: var(--ink-2); letter-spacing: .01em; }
.field.inline { flex-direction: row; align-items: center; margin: 0; }
input:not([type=checkbox]):not([type=range]), select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 10px 12px; outline: none; min-width: 0; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.input-row { display: flex; gap: 4px; align-items: center; }
.input-row input { flex: 1; }
.url-row { margin-bottom: 6px; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; font-size: .92rem; margin-bottom: 10px; }
.check.small { font-size: .82rem; margin: 0; align-items: center; white-space: nowrap; }
.hint { font-size: .82rem; color: var(--ink-3); margin: -6px 0 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* strength meter */
.meter { display: flex; flex-direction: column; gap: 4px; margin: -6px 0 12px; }
.meter-bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.meter-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .25s, background .25s; }
.meter-bar i.s0 { background: var(--fail); } .meter-bar i.s1 { background: #d4621b; } .meter-bar i.s2 { background: #c58a00; }
.meter-bar i.s3 { background: #5b9a1e; } .meter-bar i.s4 { background: var(--pass); }
.meter-label { font-size: .8rem; color: var(--ink-3); min-height: 1.2em; }

/* ---------- auth ---------- */
.auth { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px;
  background: radial-gradient(1200px 500px at 50% -10%, #1b4a6e 0%, transparent 60%), linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: 20px; padding: 28px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.auth-card h1 { font-size: 1.45rem; display: flex; align-items: center; gap: 8px; }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.auth-brand .logo { width: 44px; height: 44px; }
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.brand-name span { color: var(--accent); }
.brand-sub { font-size: .8rem; color: var(--ink-3); }
.auth-foot { color: #b9cde0; font-size: .82rem; margin-top: 18px; display: flex; gap: 6px; align-items: center; text-align: center; max-width: 440px; }
.auth-foot .ic { width: 16px; color: var(--wave); }
.suggested { background: var(--accent-soft); border-radius: var(--r-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; word-break: break-all; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; height: 100dvh; }
.sidebar { background: var(--navy); color: #d5e2ee; display: flex; flex-direction: column; overflow-y: auto; padding: 16px 10px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; }
.side-brand .brand-name span { color: var(--wave); }
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: inherit; padding: 8px 10px; border-radius: 9px; cursor: pointer; text-align: left; font-size: .93rem; }
.nav span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav em { font-style: normal; font-size: .75rem; background: rgba(255,255,255,.1); border-radius: 99px; padding: 0 8px; }
.nav:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav.active { background: rgba(127,224,214,.16); color: #fff; }
.nav.active .ic { color: var(--wave); }
.nav .ic { width: 18px; height: 18px; opacity: .9; }
.nav-head { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: #7f97ae; padding: 16px 10px 4px; display: flex; align-items: center; justify-content: space-between; }
.nav-head .icon-btn { color: #9fb4c8; }
.nav-head .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-empty { font-size: .82rem; color: #6f879d; padding: 2px 10px; margin: 0; }
.side-foot { padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.side-foot .btn { color: #d5e2ee; width: 100%; justify-content: flex-start; border-color: transparent; }
.side-foot .btn:hover { background: rgba(255,255,255,.07); }
.scrim { display: none; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 999px; padding: 0 14px; max-width: 560px; }
.search .ic { color: var(--ink-3); width: 18px; }
.search input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 10px 0 !important; }
.new-btn .ic { width: 18px; }
.content { flex: 1; display: grid; grid-template-columns: minmax(280px, 380px) 1fr; min-height: 0; }
.only-mobile { display: none; }

/* banners */
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 18px; font-size: .9rem; border-bottom: 1px solid var(--line); }
.banner span { flex: 1; }
.banner.warn { background: var(--warn-bg); color: var(--ink); } .banner.warn > .ic { color: var(--warn); }
.banner.info { background: var(--info-bg); }

/* list */
.list { border-right: 1px solid var(--line); overflow-y: auto; background: var(--surface); }
.list-head { display: flex; align-items: baseline; gap: 8px; padding: 16px 18px 8px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.list-head h2 { margin: 0; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items { list-style: none; padding: 0 8px 80px; margin: 0; }
.items.compact { padding: 0; }
.item { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; padding: 9px 10px; border-radius: 12px; cursor: pointer; text-align: left; color: inherit; }
.item:hover { background: var(--surface-2); }
.item.active { background: var(--accent-soft); }
.item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-text b, .item-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-text b { font-weight: 600; }
.item-text small { color: var(--ink-3); }
.fav { color: #e0a100; } .fav .ic { width: 15px; height: 15px; fill: currentColor; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.warn { background: var(--fail); }
.avatar { --hue: 180; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; flex: none; font-size: 1rem;
  background: hsl(var(--hue) 55% 92%); color: hsl(var(--hue) 55% 30%); }
[data-theme="dark"] .avatar { background: hsl(var(--hue) 40% 22%); color: hsl(var(--hue) 70% 80%); }
.avatar .ic { width: 20px; height: 20px; }
.avatar.t-note { background: #fdf1dc; color: #a86400; } .avatar.t-card { background: #e6edfb; color: #2f57b5; } .avatar.t-identity { background: #f1e8fb; color: #7442b5; }
[data-theme="dark"] .avatar.t-note { background: #3a2b10; color: #f0b04a; } [data-theme="dark"] .avatar.t-card { background: #1a2b4e; color: #9db7f2; } [data-theme="dark"] .avatar.t-identity { background: #2d1e45; color: #c9a8f0; }
.empty { text-align: center; padding: 48px 24px; color: var(--ink-2); }
.empty > .ic { width: 42px; height: 42px; color: var(--accent); margin-bottom: 8px; }

/* detail */
.detail { overflow-y: auto; background: var(--bg); }
.detail-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink-3); gap: 10px; }
.detail-empty .logo { width: 64px; height: 64px; opacity: .4; filter: grayscale(.4); }
.detail-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px; position: sticky; top: 0; background: var(--bg); z-index: 2; border-bottom: 1px solid var(--line); }
.detail-title { flex: 1; min-width: 0; }
.detail-title h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-title small { color: var(--ink-3); display: flex; align-items: center; gap: 4px; }
.detail-title small .ic { width: 14px; height: 14px; }
.detail-body { padding: 18px 24px 60px; max-width: 760px; }
.detail-body h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 22px 0 8px; }
.fields { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.frow { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); min-height: 52px; }
.frow:last-child { border-bottom: 0; }
.flabel { font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.fvalue { min-width: 0; overflow-wrap: anywhere; }
.fvalue.mono { letter-spacing: .02em; }
.factions { display: flex; gap: 2px; }
.totp { display: flex; align-items: center; gap: 10px; }
.totp .big { font-size: 1.35rem; font-weight: 700; letter-spacing: .08em; color: var(--accent); }
.ring { width: 26px; height: 26px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; stroke: var(--surface-2); }
.ring #totp-ring { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .9s linear; }
.ring #totp-ring.low { stroke: var(--fail); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--info-bg); }
.chip .ic { width: 14px; height: 14px; }
.chip.s0, .chip.s1, .chip.bad { background: var(--fail-bg); color: var(--fail); }
.chip.s2, .chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.s3, .chip.s4, .chip.good { background: var(--pass-bg); color: var(--pass); }
.files { list-style: none; padding: 0; margin: 0 0 6px; }
.files li { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; }
.files li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files li small { color: var(--ink-3); }
.files li.new { border-style: dashed; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag { border: 0; background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 3px 10px; font-size: .82rem; font-weight: 600; cursor: pointer; }
.history { margin-top: 18px; }
.history summary { cursor: pointer; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: .84rem; color: var(--ink-3); margin: 22px 0 0; }
.meta dd { margin: 0; }
.danger-row { margin-top: 24px; }
.editor .detail-body { max-width: 680px; }
.custom-row { display: grid; grid-template-columns: 1fr 1.3fr auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }

/* pages */
.page { padding: 22px 24px 60px; overflow-y: auto; grid-column: 1 / -1; max-width: 860px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h3 { display: flex; align-items: center; gap: 8px; }
.card h3 em { font-style: normal; font-size: .78rem; background: var(--surface-2); border-radius: 99px; padding: 1px 9px; color: var(--ink-2); }
.set-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-row > div { flex: 1; display: flex; flex-direction: column; }
.set-row small { color: var(--ink-3); }
.set-row select { width: auto; max-width: 200px; }
.danger-card { border-color: color-mix(in srgb, var(--fail) 35%, var(--line)); }
.danger-card h3 { color: var(--fail); }
.good-card { display: flex; align-items: center; gap: 10px; color: var(--pass); font-weight: 600; }
.health-top { display: flex; gap: 22px; align-items: center; }
.score { width: 110px; height: 110px; border-radius: 50%; display: grid; place-content: center; text-align: center; flex: none; border: 8px solid var(--pass); }
.score b { font-size: 2.1rem; line-height: 1; }
.score.ok { border-color: #c58a00; } .score.bad { border-color: var(--fail); }
.gen-out { font-size: 1.35rem; font-weight: 600; background: var(--surface-2); border-radius: var(--r-sm); padding: 16px; word-break: break-all; text-align: center; min-height: 64px; margin-bottom: 8px; }
.gen-info { text-align: center; font-size: .85rem; }
.gen-opts { margin-top: 18px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 99px; padding: 3px; margin-bottom: 14px; }
.seg button { border: 0; background: transparent; padding: 7px 16px; border-radius: 99px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
#gen-m .btn.small { margin: 0 auto; display: flex; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(6,18,30,.55); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 460px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0,0,0,.4); }
.modal.wide { max-width: 560px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 4px 22px; }
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: 8px 22px 6px; overflow-y: auto; }
.modal-body ul { padding-left: 1.1em; }
.modal-body li { margin-bottom: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 16px; }
.type-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 600; color: var(--ink); }
.type-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.type-card .ic { width: 28px; height: 28px; color: var(--accent); }
.steps h3 { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.scanner { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; margin-bottom: 12px; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 14%; border: 3px solid rgba(127,224,214,.9); border-radius: 16px; box-shadow: 0 0 0 999px rgba(0,0,0,.3); }
.qr-box { background: #fff; border-radius: 12px; padding: 8px; max-width: 340px; margin: 0 auto; }
.qr-box svg { display: block; width: 100%; height: auto; }

/* toasts, update bar */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: .9rem; box-shadow: 0 8px 30px rgba(0,0,0,.3); opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s; border-left: 4px solid var(--wave); }
.toast.show { opacity: 1; transform: none; }
.toast.err { border-left-color: #ff7a6e; } .toast.ok { border-left-color: #4cc483; }
.update-bar { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 8px 10px 8px 16px; border-radius: 99px; display: flex; gap: 12px; align-items: center; z-index: 90; box-shadow: 0 8px 30px rgba(0,0,0,.3); font-size: .9rem; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .content { grid-template-columns: minmax(250px, 320px) 1fr; }
  .frow { grid-template-columns: 110px 1fr auto; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .22s ease; padding-top: max(16px, env(safe-area-inset-top)); }
  .shell.drawer .sidebar { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.4); }
  .shell.drawer .scrim { display: block; position: fixed; inset: 0; background: rgba(6,18,30,.5); z-index: 39; }
  .only-mobile { display: inline-grid; }
  .topbar { padding: 10px 10px; padding-top: max(10px, env(safe-area-inset-top)); gap: 6px; }
  .new-btn span { display: none; }
  .new-btn { padding: 9px 11px; }
  .content { grid-template-columns: 1fr; position: relative; }
  .list { border-right: 0; }
  .detail { display: none; }
  .content.show-detail .list { display: none; }
  .content.show-detail .detail { display: block; }
  .detail-head { padding: 10px 12px; gap: 8px; }
  .detail-head .avatar { display: none; }
  .detail-body { padding: 14px 12px 80px; }
  .frow { grid-template-columns: 1fr auto; grid-template-areas: "l a" "v a"; gap: 0 8px; padding: 8px 6px 8px 14px; }
  .flabel { grid-area: l; } .fvalue { grid-area: v; } .factions { grid-area: a; }
  .page { padding: 12px 12px 80px; }
  .page-head h1 { font-size: 1.3rem; }
  .health-top { flex-direction: column; text-align: center; }
  .set-row { flex-wrap: wrap; }
  .set-row select { max-width: none; width: 100%; }
  .custom-row { grid-template-columns: 1fr auto; }
  .custom-row input[name=clabel] { grid-column: 1 / -1; }
  .banner { flex-wrap: wrap; padding: 10px 12px; }
}
@media (max-width: 480px) {
  .grid2 { grid-template-columns: 1fr; }
  .auth-card { padding: 22px 18px; }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92dvh; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
