:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --border-strong: #cfd4dc;
  --text: #1b2230;
  --muted: #667085;
  --faint: #98a1b0;
  --accent: #0f766e;
  --accent-hover: #0b5f59;
  --accent-soft: #e3f3f1;
  --accent-text: #ffffff;
  --good: #14804a;
  --good-soft: #e5f5ec;
  --warn: #b25e00;
  --warn-soft: #fdf0e0;
  --bad: #c4312c;
  --bad-soft: #fde8e7;
  --info: #2f5bd3;
  --info-soft: #e8eefc;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --radius: 12px;
  --radius-sm: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161b;
    --surface: #1c1f26;
    --surface-2: #242832;
    --border: #2d323d;
    --border-strong: #3b4150;
    --text: #e8eaef;
    --muted: #9ba3b4;
    --faint: #6f7889;
    --accent: #2bb3a3;
    --accent-hover: #3cc7b6;
    --accent-soft: #173733;
    --accent-text: #08201d;
    --good: #3fbf7f;
    --good-soft: #17301f;
    --warn: #e59a3c;
    --warn-soft: #3a2a14;
    --bad: #f0706a;
    --bad-soft: #3d1d1c;
    --info: #7c9cf5;
    --info-soft: #1e2744;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Leelawadee UI", "Segoe UI", "Noto Sans Thai", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.mono { font-family: "Cascadia Mono", Consolas, monospace; letter-spacing: .02em; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; font-weight: 600; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: none; background: transparent; color: var(--muted); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); outline: none;
}
textarea.input { height: auto; min-height: 76px; padding: 9px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.invalid { border-color: var(--bad); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-weight: 600; font-size: 13px; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 76px; }
.input-group .addons { position: absolute; right: 4px; display: flex; gap: 2px; }
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: var(--border-strong); cursor: pointer; transition: background .15s; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--text); font-size: 13px; }
.notice svg { color: var(--info); margin-top: 1px; }
.notice.warn { background: var(--warn-soft); }
.notice.warn svg { color: var(--warn); }
.notice.bad { background: var(--bad-soft); }
.notice.bad svg { color: var(--bad); }
.notice.good { background: var(--good-soft); }
.notice.good svg { color: var(--good); }
.error-text { color: var(--bad); font-size: 13px; min-height: 18px; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; font-weight: 700; font-size: 16px; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; }
.nav { padding: 4px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--radius-sm);
  border: none; background: transparent; cursor: pointer; text-align: left; color: var(--text);
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--faint); font-weight: 600; }
.nav-item.active .count { color: var(--accent); }
.nav-section { padding: 16px 20px 6px; font-size: 11.5px; font-weight: 700; color: var(--faint); letter-spacing: .04em; display: flex; align-items: center; }
.sidebar .scroll { flex: 1; overflow-y: auto; padding-bottom: 8px; }
.vault-item .lock-state { margin-left: auto; color: var(--faint); }
.vault-item.locked { color: var(--muted); }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.sidebar-foot .btn { width: 100%; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--border); background: var(--surface); }
.search { position: relative; flex: 1; max-width: 560px; }
.search svg { position: absolute; left: 12px; top: 10px; color: var(--faint); }
.search .input { padding-left: 38px; height: 40px; background: var(--surface-2); border-color: transparent; }
.search .input:focus { background: var(--surface); }
.search kbd { position: absolute; right: 10px; top: 10px; font: 11px/18px "Segoe UI", sans-serif; padding: 0 6px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--faint); }
.view { flex: 1; overflow-y: auto; padding: 24px 28px 40px; }
.view-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.view-head .grow p { margin-top: 4px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.card-body { padding: 14px 18px 18px; }

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: 1.75fr repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.score .label { white-space: nowrap; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; cursor: default; }
.stat.clickable { cursor: pointer; }
.stat.clickable:hover { border-color: var(--border-strong); }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat .sub { font-size: 12.5px; color: var(--muted); }
.score { flex-direction: row; align-items: center; gap: 16px; }
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: var(--surface-2); }
.ring .bar { stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; font-weight: 700; }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.tabs { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-2); width: fit-content; flex-wrap: wrap; }
.tab { border: none; background: transparent; padding: 5px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 13px; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tab .n { margin-left: 4px; font-size: 12px; color: var(--faint); }
.issue-list { display: flex; flex-direction: column; margin-top: 10px; }
.issue-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 6px; }
.issue-row:last-child { border-bottom: none; }
.issue-row:hover { background: var(--surface-2); }
.empty { padding: 28px 10px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty svg { color: var(--good); width: 28px; height: 28px; }
.cat-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 6px; cursor: pointer; border-radius: 6px; }
.cat-row:hover { background: var(--surface-2); }
.cat-bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.cat-bar span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.activity { display: flex; flex-direction: column; }
.act-row { display: flex; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 6px; }
.act-row.clickable { cursor: pointer; }
.act-row.clickable:hover { background: var(--surface-2); }
.act-dot { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.act-dot.add { background: var(--good-soft); color: var(--good); }
.act-dot.edit { background: var(--info-soft); color: var(--info); }
.act-dot.delete { background: var(--bad-soft); color: var(--bad); }

/* ---------- entries ---------- */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters select.input { width: auto; height: 34px; min-width: 150px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px; }
.chip button { border: none; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.chip button:hover { background: rgba(0, 0, 0, .08); }
.list { overflow: hidden; }
.list-head, .entry-row { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(160px, 1.5fr) minmax(130px, 1fr) 110px 150px; align-items: center; gap: 14px; padding: 0 16px; }
.list-head { height: 40px; font-size: 12px; font-weight: 700; color: var(--faint); border-bottom: 1px solid var(--border); letter-spacing: .02em; }
.entry-row { min-height: 60px; border-bottom: 1px solid var(--border); cursor: pointer; }
.entry-row:last-child { border-bottom: none; }
.entry-row:hover { background: var(--surface-2); }
.entry-row.selected { background: var(--accent-soft); }
.entry-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.entry-title .t { font-weight: 700; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; flex: none; text-transform: uppercase; }
.avatar.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 22px; }
.strength { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.s0, .s1 { --c: var(--bad); }
.s2 { --c: var(--warn); }
.s3, .s4 { --c: var(--good); }
.dot.s0, .dot.s1, .dot.s2, .dot.s3, .dot.s4 { background: var(--c); }
.meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.meter span { height: 5px; border-radius: 4px; background: var(--surface-2); }
.meter span.on { background: var(--c); }
.otp-mini { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 20, 30, .18); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 92vw; z-index: 21;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slide .16s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; gap: 14px; align-items: center; padding: 20px 20px 16px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px 20px; }
.drawer-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.kv { padding: 12px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: none; }
.kv .k { font-size: 12px; font-weight: 700; color: var(--faint); margin-bottom: 4px; letter-spacing: .02em; }
.kv .v { display: flex; align-items: center; gap: 4px; min-height: 32px; }
.kv .v .val { flex: 1; min-width: 0; word-break: break-all; }
.kv .v .val.secret { font-family: "Cascadia Mono", Consolas, monospace; letter-spacing: .06em; }
.kv .notes { white-space: pre-wrap; word-break: break-word; }
.otp-big { display: flex; align-items: center; gap: 12px; }
.otp-code { font-family: "Cascadia Mono", Consolas, monospace; font-size: 26px; font-weight: 700; letter-spacing: .12em; color: var(--accent); }
.otp-timer { width: 26px; height: 26px; transform: rotate(-90deg); }
.otp-timer circle { fill: none; stroke-width: 3.5; }
.otp-timer .track { stroke: var(--surface-2); }
.otp-timer .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.warn-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 20, 30, .45); z-index: 40; display: grid; place-items: center; padding: 24px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 560px; max-width: 100%; max-height: calc(100vh - 48px); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .14s ease-out; }
.modal.wide { width: 720px; }
.modal.narrow { width: 420px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 20px 22px 6px; }
.modal-body { padding: 14px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gen-box { padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.gen-box .opts { display: flex; flex-wrap: wrap; gap: 14px; }
.gen-box input[type=range] { accent-color: var(--accent); flex: 1; }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; background: var(--surface); text-align: left; width: 100%; }
.choice:hover { border-color: var(--accent); }
.choice.active { border-color: var(--accent); background: var(--accent-soft); }
.choice .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); flex: none; }
.path-box { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; }
.path-box .p { flex: 1; min-width: 0; word-break: break-all; }

/* ---------- lock / welcome ---------- */
.center-screen { height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px; overflow-y: auto; }
.lock-card { width: 440px; max-width: 100%; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.lock-card .logo-lg { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; }
.lock-card .logo-lg svg { width: 28px; height: 28px; }
.welcome { width: 720px; max-width: 100%; padding: 36px; display: flex; flex-direction: column; gap: 22px; }
.welcome .options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.big-choice { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); cursor: pointer; text-align: left; }
.big-choice:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.big-choice .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.point { display: flex; gap: 10px; font-size: 13px; }
.point svg { color: var(--accent); margin-top: 2px; }

/* ---------- import ---------- */
.import-table-wrap { overflow: auto; max-height: 460px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.import { border-collapse: collapse; width: 100%; font-size: 13px; }
table.import th { position: sticky; top: 0; background: var(--surface-2); text-align: left; padding: 8px; font-size: 12px; color: var(--muted); z-index: 1; }
table.import td { padding: 4px; border-top: 1px solid var(--border); }
table.import td input.cell { min-width: 130px; width: 100%; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; outline: none; }
table.import td input.cell:focus { border-color: var(--accent); background: var(--surface); }
table.import td input.cell.need { background: var(--warn-soft); }
table.import tr.off td { opacity: .4; }
.map-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.steps { display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.steps li { list-style: none; display: flex; gap: 10px; }
.steps li::before { counter-increment: s; content: counter(s); width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; margin-top: 1px; }
.steps { padding: 0; margin: 0; }

/* ---------- settings ---------- */
.settings { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.set-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: none; }
.set-row select.input { width: 160px; }
.vault-card { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: 10px; }
.vault-card .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- toast ---------- */
#toast-root { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 10px; background: #1f2533; color: #fff; box-shadow: var(--shadow-lg); font-weight: 600; animation: pop .14s ease-out; pointer-events: auto; }
.toast svg { color: #5fd3c4; }
.toast.error svg { color: #ff8a84; }
.toast .sec { color: #9aa6bb; font-weight: 400; }

.modal-backdrop.top { z-index: 70; }
.m-only { display: none !important; }
.nav-backdrop { display: none; }

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats .score { grid-column: span 2; }
  .dash-grid { grid-template-columns: 1fr; }
  .list-head, .entry-row { grid-template-columns: minmax(200px, 2fr) minmax(150px, 1.4fr) 100px 140px; }
  .list-head .c-cat, .entry-row .c-cat { display: none; }
}

/* ---------- phones (web version) ---------- */
@media (max-width: 760px) {
  .m-only { display: block !important; }
  .icon-btn.m-only { display: inline-grid !important; }
  .d-only { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 280px; max-width: 84vw; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); padding-top: env(safe-area-inset-top); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 20, 30, .35); z-index: 29; }
  .topbar { padding: 10px 12px; gap: 8px; padding-top: max(10px, env(safe-area-inset-top)); }
  .search { max-width: none; flex: 1; }
  .search kbd { display: none; }
  .search svg { top: 12px; }
  .search .input { height: 44px; }
  .input, select.input, textarea.input { font-size: 16px; } /* 16px stops iOS from zooming into inputs */
  .topbar .btn.primary { width: 44px; height: 44px; padding: 0; flex: none; }
  .view { padding: 16px 14px 90px; }
  h1 { font-size: 20px; }
  .view-head { margin-bottom: 14px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats .score { grid-column: span 2; }
  .stat { padding: 14px; }
  .stat .value { font-size: 24px; }
  .card-head { flex-wrap: wrap; }
  .tabs { width: 100%; }
  .issue-row .btn { display: none; }
  .list-head { display: none; }
  .entry-row { grid-template-columns: minmax(0, 1fr) auto; padding: 0 10px 0 12px; gap: 8px; min-height: 66px; }
  .entry-row .c-user, .entry-row .c-cat, .entry-row .c-str { display: none; }
  .row-actions .icon-btn { width: 42px; height: 42px; }
  .drawer { width: 100vw; max-width: 100vw; }
  .drawer-head { padding-top: max(20px, env(safe-area-inset-top)); }
  .drawer-foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .kv .icon-btn { width: 42px; height: 42px; }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal, .modal.wide, .modal.narrow { width: 100%; max-height: 94vh; border-radius: 16px 16px 0 0; }
  .modal-foot { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .grid-2 { grid-template-columns: 1fr; }
  .welcome { padding: 22px 18px; }
  .points { grid-template-columns: 1fr; }
  .lock-card { padding: 24px 20px; }
  .center-screen { padding: 14px; }
  .set-row { flex-wrap: wrap; }
  .set-row select.input { width: 100%; }
  .path-box { flex-wrap: wrap; }
  .import-table-wrap { max-height: 60vh; }
  #toast-root { bottom: max(18px, env(safe-area-inset-bottom)); width: calc(100% - 24px); }
  .toast { flex-wrap: wrap; justify-content: center; text-align: center; }
}
