/* Coffre d'équipe — styles
   Palette : vert « coffre-fort » sur gris minéral, laiton pour les accents secondaires. */

:root {
  color-scheme: light;
  --bg: #eef2f1;
  --surface: #ffffff;
  --surface-2: #f6f8f7;
  --line: #d9e0de;
  --ink: #16211f;
  --ink-2: #56625f;
  --accent: #0f6e5e;
  --accent-hover: #0b5a4d;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe9;
  --brass: #9a6f1c;
  --brass-soft: #f6ecd8;
  --danger: #b42318;
  --danger-soft: #fbe9e7;
  --digit: #1d5fd0;
  --focus: #1d5fd0;
  --radius: 10px;
  --radius-sm: 7px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --tabbar-h: 62px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0e1514;
    --surface: #162120;
    --surface-2: #1c2927;
    --line: #2a3a37;
    --ink: #e3ebe9;
    --ink-2: #9aaaa6;
    --accent: #4cc2a6;
    --accent-hover: #6dd3ba;
    --accent-ink: #062019;
    --accent-soft: #163a32;
    --brass: #d9a84b;
    --brass-soft: #3a2f19;
    --danger: #f07167;
    --danger-soft: #3d1c19;
    --digit: #7fa9ff;
    --focus: #7fa9ff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; display: flex; align-items: center; gap: 6px; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.92em; }
.break { word-break: break-all; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.offscreen { position: fixed; left: -9999px; }
.muted { color: var(--ink-2); }
.small { font-size: 0.85rem; }
.grow { flex: 1; min-width: 0; }
.error { color: var(--danger); }
.pad { padding: 16px; }
.center { text-align: center; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon.big { width: 44px; height: 44px; stroke-width: 1.4; color: var(--accent); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 550; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger.ghost { color: var(--danger); background: transparent; border-color: transparent; }
.btn.danger.ghost:hover { background: var(--danger-soft); }
.btn.compact { min-height: 36px; padding: 0 12px; font-size: 0.92rem; }
.btn.block { display: flex; width: 100%; }
.btn .icon { width: 18px; height: 18px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.small { width: 34px; height: 34px; }
.icon-btn.small .icon { width: 18px; height: 18px; }

/* ---------- Formulaires ---------- */
input, select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 16px; /* évite le zoom automatique sur iOS */
}
textarea { resize: vertical; min-height: 100px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
input[type=checkbox] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex-shrink: 0; }
input[type=range] { padding: 0; border: 0; accent-color: var(--accent); min-height: 32px; background: transparent; }
input[type=password], .cf-value, #pwfield { font-family: var(--mono); letter-spacing: .02em; }
select.compact { min-height: 36px; width: auto; padding: 4px 8px; font-size: 0.9rem; }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > label { font-weight: 560; font-size: 0.92rem; }
.hint { color: var(--ink-2); font-size: 0.86rem; }
.input-group { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding-right: 4px; }
.input-group:focus-within { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.input-group input { border: 0; outline: 0 !important; background: transparent; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.94rem; }
.check.small { font-size: 0.85rem; gap: 6px; white-space: nowrap; }
.check.warning { background: var(--brass-soft); padding: 12px; border-radius: var(--radius-sm); align-items: flex-start; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input, .inline-form .input-group { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.meter-wrap { display: flex; align-items: center; gap: 10px; min-height: 18px; }
.meter { flex: 1; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s; }
.meter[data-level="0"] span { width: 12%; }
.meter[data-level="1"] span { width: 32%; background: #d0701c; }
.meter[data-level="2"] span { width: 56%; background: var(--brass); }
.meter[data-level="3"] span { width: 80%; background: var(--accent); }
.meter[data-level="4"] span { width: 100%; background: var(--accent); }
.meter-label { font-size: 0.8rem; color: var(--ink-2); min-width: 72px; text-align: right; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--radius); border: 1px solid var(--line); }
.segmented button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-2); font: inherit; font-weight: 550; cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.custom-fields { display: grid; gap: 8px; }
.cf-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto auto; gap: 8px; align-items: center; }

/* ---------- Structure ---------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.main { min-width: 0; }

.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; font-weight: 700; font-size: 1.02rem; }
.brand img { border-radius: 8px; }
.nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.stack { display: grid; gap: 14px; }
.nav-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.nav-title { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 4px; color: var(--ink-2); font-size: 0.82rem; font-weight: 600; }
.nav-empty { padding: 4px 10px; color: var(--ink-2); font-size: 0.88rem; }
.nav-link {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink);
  font: inherit; font-size: 0.95rem; text-align: left; cursor: pointer; width: 100%;
}
.nav-link .icon { color: var(--ink-2); width: 19px; height: 19px; }
.nav-link:hover { background: var(--surface-2); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-link.active .icon { color: var(--accent); }
.nav-link .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { color: var(--ink-2); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 0.74rem; font-weight: 700; display: inline-grid; place-items: center; }
.tag { font-size: 0.72rem; padding: 1px 7px; border-radius: 20px; background: var(--brass-soft); color: var(--brass); font-weight: 600; }
.tag.strong { background: var(--accent-soft); color: var(--accent); }
.tag.ok { background: var(--accent-soft); color: var(--accent); }
.tag.warn { background: var(--danger-soft); color: var(--danger); }
.tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }

/* Liste + détail */
.split { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.list-pane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.detail-pane { overflow-y: auto; min-height: 0; }
.pane-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 20px 16px 12px; }
.pane-title { min-width: 0; }
.pane-title h1 { font-size: 1.25rem; overflow-wrap: anywhere; }
.pane-title .muted { font-size: 0.87rem; }
.pane-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.search-wrap { position: relative; margin: 0 16px 8px; }
.search-wrap .icon { position: absolute; left: 12px; top: 12px; color: var(--ink-2); pointer-events: none; }
.search { padding-left: 40px; background: var(--surface-2); }
.list-scroll { flex: 1; overflow-y: auto; padding: 0 8px 16px; }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.item-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--radius-sm); color: var(--ink); }
.item-row:hover { background: var(--surface-2); text-decoration: none; }
.item-row.active { background: var(--accent-soft); }
.item-text { display: grid; min-width: 0; flex: 1; }
.item-title { font-weight: 580; display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.item-title .dot { margin-left: 6px; vertical-align: middle; }
.item-sub { color: var(--ink-2); font-size: 0.87rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.item-vault { font-size: 0.75rem; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 8px; border-radius: 20px; white-space: nowrap; max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brass); flex-shrink: 0; display: inline-block; }
.alert { display: flex; gap: 8px; align-items: flex-start; margin: 0 16px 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 0.87rem; }
.empty-small { padding: 16px; color: var(--ink-2); text-align: center; }

.avatar {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700;
}
.avatar.note { background: var(--brass-soft); color: var(--brass); }
.avatar.large { width: 52px; height: 52px; border-radius: 12px; font-size: 1.3rem; }
.avatar.small { width: 34px; height: 34px; border-radius: 50%; font-size: 0.9rem; }
.avatar.off { background: var(--surface-2); color: var(--ink-2); }
.avatar .icon { width: 20px; height: 20px; }

.chips { display: none; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 0.9rem; cursor: pointer; white-space: nowrap; }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip:hover { text-decoration: none; }

/* Détail d'un élément */
.detail { max-width: 720px; padding: 24px 28px 40px; display: grid; gap: 16px; }
.detail-head { display: flex; align-items: center; gap: 14px; }
.detail-head h2 { font-size: 1.35rem; word-break: break-word; }
.detail-head .back { display: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.fields { padding: 4px 0; }
.drow { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; }
.drow + .drow { border-top: 1px solid var(--line); }
.dlabel { color: var(--ink-2); font-size: 0.87rem; }
.dvalue { min-width: 0; overflow-wrap: anywhere; }
.dactions { display: flex; gap: 2px; }
.multiline { white-space: pre-wrap; }
.secret { font-family: var(--mono); letter-spacing: .08em; }
.pw { font-family: var(--mono); letter-spacing: .03em; word-break: break-all; }
.pw .d { color: var(--digit); }
.pw .s { color: var(--brass); }
.meta { display: grid; gap: 2px; font-size: 0.9rem; }
.meta p:first-child { display: flex; align-items: center; gap: 6px; }
.meta .icon { width: 16px; height: 16px; color: var(--ink-2); }
.history h3 { margin: 4px 0 10px; }
.versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.version { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 0 4px; }
.version > p { padding: 0 16px; }
.version-head { margin-bottom: 2px; }
.danger-zone { padding-top: 12px; border-top: 1px solid var(--line); }

.empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 56px 24px; max-width: 420px; margin: 0 auto; }
.empty p { color: var(--ink-2); }
.empty.placeholder { height: 100%; align-content: center; }
.empty.placeholder .icon.big { color: var(--line); }

/* Pages */
.page { max-width: 880px; padding: 24px 28px 48px; display: grid; gap: 18px; align-content: start; }
.page.narrow { max-width: 640px; }
.page-head { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.page-head h1 { flex: 1; }
.intro { margin-top: -10px; }
.section { display: grid; gap: 10px; }
.form-card { padding: 18px; display: grid; gap: 14px; }
.members { list-style: none; margin: 0; padding: 0; }
.member { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.member + .member { border-top: 1px solid var(--line); }
.member strong { font-weight: 600; }
.member-actions { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.fingerprint code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }
.link-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0; }
.profile { display: flex; align-items: center; gap: 16px; padding: 18px; }
.qr { background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

/* Générateur */
.gen { padding: 20px; display: grid; gap: 16px; }
.gen-output { font-size: 1.35rem; min-height: 3.4em; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; background: var(--surface-2); border-radius: var(--radius-sm); }

/* Fil des mises à jour */
.ev-group { display: grid; gap: 6px; }
.ev-day { font-size: 0.86rem; color: var(--ink-2); font-weight: 600; padding: 8px 4px 0; }
.ev-day::first-letter { text-transform: uppercase; }
.events { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.events li + li { border-top: 1px solid var(--line); }
.event { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--ink); }
a.event:hover { background: var(--surface-2); text-decoration: none; }
.ev-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex-shrink: 0; }
.ev-icon.warn { background: var(--danger-soft); color: var(--danger); }
.ev-icon .icon { width: 16px; height: 16px; }
.ev-text { flex: 1; display: grid; gap: 1px; min-width: 0; }
.ev-text > .muted { font-size: 0.82rem; }

/* Écrans d'accès */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 16px; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: grid; gap: 14px; }
.auth-card .brand { padding: 0 0 8px; }
.auth-card h1 { display: flex; align-items: center; gap: 8px; }
.auth-foot { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 0.85rem; }
.auth-foot .icon { width: 16px; height: 16px; color: var(--accent); }
.loading { display: grid; justify-items: center; gap: 16px; color: var(--ink-2); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Modales et notifications */
.overlay { position: fixed; inset: 0; background: rgba(8, 14, 13, .5); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--surface); border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 4px 20px; }
.modal-body { padding: 8px 20px 12px; display: grid; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 20px 20px; flex-wrap: wrap; }
#toasts { position: fixed; right: 24px; bottom: 24px; display: grid; gap: 8px; z-index: 60; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--ink); color: var(--surface); padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.92rem; box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: opacity .3s, transform .3s; }
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--accent); color: var(--accent-ink); }
.toast.out { opacity: 0; transform: translateY(6px); }
body.offline::before { content: "Hors ligne — les données affichées peuvent ne pas être à jour"; position: fixed; top: 0; left: 0; right: 0; z-index: 70; background: var(--brass); color: #fff; text-align: center; font-size: 0.85rem; padding: 4px; }

.version { font-size: 0.75rem; color: var(--ink-2); padding: 8px 10px 0; }

/* Notes */
.note-filters { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; }
.note-row { align-items: flex-start; }
.note-row .item-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.note-meta-line { display: flex; align-items: center; gap: 2px; font-size: 0.78rem; color: var(--ink-2); margin-top: 2px; }
.note-meta-line .icon { width: 13px; height: 13px; }
.notes-split .detail-pane { display: flex; flex-direction: column; }
.note-editor { flex: 1; display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 820px; padding: 18px 32px 28px; min-height: 0; }
.note-top { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.note-top .back { display: none; }
.note-where-select { max-width: 260px; }
.note-where { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 0.88rem; flex: 1; }
.note-where .icon { width: 15px; height: 15px; }
.note-status { flex: 1; font-size: 0.84rem; color: var(--ink-2); text-align: right; }
.note-status[data-kind="ok"] { color: var(--accent); }
.note-status[data-kind="error"] { color: var(--danger); }
input.note-title {
  border: 0; background: transparent; padding: 4px 0; min-height: 0;
  font-size: 1.6rem; font-weight: 650; letter-spacing: -0.01em;
}
textarea.note-body {
  flex: 1; border: 0; background: transparent; padding: 4px 0; resize: none;
  font-size: 16px; line-height: 1.65; min-height: 55vh;
}
input.note-title:focus, textarea.note-body:focus { outline: none; }
.note-editor:focus-within { box-shadow: none; }
.note-title-view { font-size: 1.6rem; }
.note-body-view { white-space: pre-wrap; line-height: 1.65; overflow-wrap: anywhere; }

/* Barre d'onglets (mobile) */
.tabbar { display: none; }
.show-sm { display: none !important; }

/* ---------- Tablette ---------- */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  .split { grid-template-columns: 300px minmax(0, 1fr); }
  .detail, .page { padding-left: 20px; padding-right: 20px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tab { display: grid; justify-items: center; align-content: center; gap: 2px; color: var(--ink-2); font-size: 0.72rem; font-weight: 550; }
  .tab:hover { text-decoration: none; }
  .tab.active { color: var(--accent); }
  .tab-icon { position: relative; }
  .tab-icon .badge { position: absolute; top: -6px; left: 14px; height: 17px; min-width: 17px; font-size: 0.66rem; padding: 0 4px; }
  .show-sm { display: flex !important; }
  .hide-sm { display: none; }

  .split { grid-template-columns: minmax(0, 1fr); height: auto; }
  .list-pane { border-right: 0; background: transparent; }
  .list-scroll { overflow: visible; padding: 0 8px 16px; }
  .items { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; }
  .items:empty { display: none; }
  .split .detail-pane { display: none; }
  .split.has-detail .list-pane { display: none; }
  .split.has-detail .detail-pane { display: block; overflow: visible; }
  .chips { display: flex; }
  .item-vault { display: none; }
  .pane-head { padding: 18px 16px 12px; padding-top: calc(18px + env(safe-area-inset-top)); }

  .detail { padding: 12px 16px 32px; padding-top: calc(12px + env(safe-area-inset-top)); }
  .detail-head { flex-wrap: nowrap; }
  .detail-head .back { display: inline-grid; margin-left: -8px; }
  .note-top .back { display: inline-grid; margin-left: -8px; }
  .note-editor { padding: 12px 16px 24px; padding-top: calc(12px + env(safe-area-inset-top)); }
  .note-where-select { max-width: 170px; }
  input.note-title { font-size: 1.35rem; }
  .tab { font-size: 0.66rem; }
  .detail-head .avatar.large { width: 44px; height: 44px; font-size: 1.1rem; }
  .drow { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding: 10px 8px 10px 14px; }
  .dlabel { grid-column: 1 / -1; font-size: 0.8rem; }

  .page { padding: 16px 16px 32px; padding-top: calc(16px + env(safe-area-inset-top)); }
  .grid-2 { grid-template-columns: 1fr; }
  .cf-row { grid-template-columns: 1fr auto; }
  .cf-row .cf-label { grid-column: 1 / -1; }
  .inline-form { flex-wrap: wrap; }
  .inline-form .btn { width: 100%; }
  .form-actions .btn { flex: 1; }
  .member-actions { width: 100%; padding-left: 46px; }
  #toasts { right: 16px; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); }
  .auth-card { padding: 22px; }
  .gen-output { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; }
}
