/* Brand Pest Control – dark grey with dark blue highlights, plus a light mode */
:root, :root[data-theme="dark"] {
  --bg: #14171c;
  --surface: #1c2027;
  --surface-2: #232933;
  --surface-3: #2b323e;
  --border: #323a47;
  --text: #e9edf2;
  --muted: #9aa5b5;
  --faint: #6c7686;
  --accent: #2f6fd6;
  --accent-strong: #2459b5;
  --accent-text: #6ea2f5;
  --accent-soft: rgba(47, 111, 214, .16);
  --ok: #2fa36b; --ok-soft: rgba(47, 163, 107, .16);
  --warn: #e3a42b; --warn-soft: rgba(227, 164, 43, .16);
  --danger: #e05555; --danger-soft: rgba(224, 85, 85, .15);
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  --radius: 14px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --surface-3: #e7ebf1;
  --border: #d5dbe4;
  --text: #18202c;
  --muted: #5a6677;
  --faint: #8a95a5;
  --accent: #1f56b8;
  --accent-strong: #19479a;
  --accent-text: #1f56b8;
  --accent-soft: rgba(31, 86, 184, .1);
  --ok: #1d8a55; --ok-soft: rgba(29, 138, 85, .12);
  --warn: #b97a00; --warn-soft: rgba(185, 122, 0, .12);
  --danger: #c43c3c; --danger-soft: rgba(196, 60, 60, .1);
  --shadow: 0 8px 28px rgba(20, 30, 50, .16);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.35rem; font-weight: 700; }
h2 { font-size: 1.12rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .86rem; }
.tiny { font-size: .76rem; }
.bold { font-weight: 650; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.gap-s { gap: 6px; } .gap-l { gap: 16px; }
.mt { margin-top: 12px; } .mt-l { margin-top: 22px; } .mb { margin-bottom: 12px; }

/* ---------- Layout ---------- */
.app { display: flex; height: 100dvh; }
.sidebar {
  width: 228px; flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand b { font-size: 1.02rem; line-height: 1.15; display: block; }
.brand span { font-size: .78rem; color: var(--muted); }
.nav-btn {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
  background: none; border: 0; text-align: left; cursor: pointer; color: var(--muted); font-weight: 550; width: 100%;
  position: relative;
}
.nav-btn svg { width: 22px; height: 22px; flex: none; }
.nav-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-btn.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-badge { margin-left: auto; background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem; padding: 1px 7px; font-weight: 700; }
.nav-badge.warn { background: var(--warn); color: #1b1300; }
.sidebar .spacer { flex: 1; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border);
  background: var(--surface); min-height: 62px; flex: none;
}
.topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { flex: 1; overflow: auto; padding: 18px; -webkit-overflow-scrolling: touch; }
.content.flush { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.page { max-width: 880px; margin: 0 auto; }
.tabbar { display: none; }

@media (max-width: 820px) {
  .sidebar { display: none; }
  .topbar { padding: 10px 12px; min-height: 56px; padding-top: max(10px, env(safe-area-inset-top)); }
  .content { padding: 12px 12px 90px; }
  .content.flush { padding-bottom: 0; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 4px 4px max(6px, env(safe-area-inset-bottom));
  }
  .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px;
    background: none; border: 0; color: var(--muted); font-size: .7rem; font-weight: 600; position: relative; cursor: pointer;
  }
  .tab svg { width: 24px; height: 24px; }
  .tab.active { color: var(--accent-text); }
  .tab .nav-badge { position: absolute; top: 0; left: 55%; margin: 0; }
  .app.with-tabs .content.flush { padding-bottom: 74px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-weight: 600; min-height: 44px; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.block { width: 100%; }
.btn.big { min-height: 56px; font-size: 1.05rem; border-radius: 13px; }
.btn.sm { min-height: 34px; padding: 6px 11px; font-size: .88rem; border-radius: 9px; }
.icon-btn {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; flex: none; padding: 0;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.plain { border-color: transparent; background: none; }
.help-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent-text);
  background: var(--accent-soft); font-weight: 800; cursor: pointer; flex: none; font-size: 1rem;
}
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 13px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); min-height: 36px; }
.seg button.on { background: var(--accent); color: #fff; }

/* ---------- Cards & lists ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.card + .card { margin-top: 10px; }
.card.tight { padding: 10px 12px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 18px 2px 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.section-title:first-child { margin-top: 0; }
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; cursor: pointer; text-align: left; width: 100%;
}
.list-item:hover { border-color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.empty svg { width: 46px; height: 46px; opacity: .5; margin-bottom: 6px; }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; border: 1px solid transparent; cursor: pointer; }
.banner svg { width: 22px; height: 22px; flex: none; }
.banner.warn { background: var(--warn-soft); border-color: rgba(227, 164, 43, .35); }
.banner.warn svg { color: var(--warn); }
.banner.info { background: var(--accent-soft); border-color: rgba(47, 111, 214, .35); }
.banner.info svg { color: var(--accent-text); }
.banner.danger { background: var(--danger-soft); border-color: rgba(224, 85, 85, .35); }
.banner.danger svg { color: var(--danger); }
.banner.ok { background: var(--ok-soft); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 650; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.pill.blue { background: var(--accent-soft); color: var(--accent-text); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- Visit cards ---------- */
.vcard {
  position: relative; display: flex; gap: 10px; align-items: stretch; background: var(--surface-2);
  border: 1px solid var(--border); border-left: 4px solid var(--pc, var(--accent)); border-radius: 11px;
  padding: 9px 10px; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: pan-y;
}
.vcard:hover { border-color: var(--accent); border-left-color: var(--pc, var(--accent)); }
.vcard.done { opacity: .62; }
.vcard.done .v-title { text-decoration: line-through; }
.vcard.notdone { border-style: dashed; }
.vcard .v-body { flex: 1; min-width: 0; }
.v-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-sub { font-size: .84rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.v-time { font-weight: 700; font-size: .84rem; color: var(--accent-text); }
.v-actions { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.tick {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex: none;
}
.tick svg { width: 22px; height: 22px; }
.tick.yes { color: var(--ok); } .tick.yes:hover, .tick.yes.on { background: var(--ok); color: #fff; border-color: var(--ok); }
.tick.no { color: var(--danger); } .tick.no:hover, .tick.no.on { background: var(--danger); color: #fff; border-color: var(--danger); }
.vcard.compact { padding: 5px 7px; border-left-width: 3px; border-radius: 8px; gap: 6px; }
.vcard.compact .v-title { font-size: .82rem; }
.vcard.compact .v-sub { font-size: .74rem; }
.vcard.half { min-height: 0; }

/* ---------- Day (Today) view ---------- */
.day-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.day-head .date-big { font-size: 1.25rem; font-weight: 700; }
.anytime-strip {
  background: var(--surface); border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 10px; margin-bottom: 14px; min-height: 62px;
}
.anytime-strip .strip-title { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.anytime-strip .list { gap: 7px; }
.slots { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.slot { display: flex; min-height: 66px; border-top: 1px solid var(--border); }
.slot:first-child { border-top: 0; }
.slot .slot-time { width: 58px; flex: none; padding: 8px 6px 8px 10px; font-size: .82rem; color: var(--muted); font-weight: 650; }
.slot .slot-body { flex: 1; padding: 6px 8px 6px 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.slot.out { background: var(--surface-2); }
.slot .slot-add { flex: 1; min-height: 50px; border-radius: 9px; border: 0; background: none; cursor: pointer; color: transparent; text-align: left; padding: 0 10px; }
.slot .slot-add:hover { color: var(--faint); background: var(--surface-2); }
.drop-hot { outline: 2.5px solid var(--accent) !important; outline-offset: -2px; background: var(--accent-soft) !important; }

/* ---------- Week view ---------- */
.week-wrap { flex: 1; overflow: auto; position: relative; }
.week { display: grid; grid-template-columns: 54px repeat(7, minmax(132px, 1fr)); min-width: 980px; }
.week .wh { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 6px; text-align: center; cursor: pointer; }
.week .wh.today { background: var(--accent-soft); }
.week .wh b { display: block; font-size: 1.15rem; }
.week .wh span { font-size: .76rem; color: var(--muted); text-transform: uppercase; font-weight: 700; letter-spacing: .05em; }
.week .wh.today b, .week .wh.today span { color: var(--accent-text); }
.week .corner { position: sticky; top: 0; left: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--border); }
.week .wa { background: var(--surface-2); border-bottom: 2px solid var(--border); border-left: 1px solid var(--border); padding: 5px; min-height: 64px; display: flex; flex-direction: column; gap: 4px; }
.week .wa-label { position: sticky; left: 0; z-index: 4; background: var(--surface-2); border-bottom: 2px solid var(--border); font-size: .68rem; color: var(--muted); font-weight: 700; padding: 6px 4px; text-transform: uppercase; text-align: right; }
.week .wt { position: sticky; left: 0; z-index: 4; background: var(--bg); font-size: .76rem; color: var(--muted); text-align: right; padding: 3px 6px 0 0; border-top: 1px solid var(--border); font-weight: 650; }
.week .wc { border-left: 1px solid var(--border); border-top: 1px solid var(--border); min-height: 74px; padding: 3px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.week .wc:hover { background: var(--surface); }
.week .wc.today, .week .wa.today { background-color: rgba(47, 111, 214, .06); }
.week .wc.out { background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(127, 127, 127, .05) 8px 16px); }

/* ---------- Month view ---------- */
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.month .mh { text-align: center; font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.mday { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; min-height: 96px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.mday.other { opacity: .45; }
.mday.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mday .mnum { font-weight: 700; font-size: .9rem; }
.mday .mchip { font-size: .72rem; padding: 2px 5px; border-radius: 5px; background: var(--surface-2); border-left: 3px solid var(--pc, var(--accent)); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mday .mchip.done { opacity: .55; text-decoration: line-through; }
@media (max-width: 820px) {
  .month { gap: 3px; }
  .mday { min-height: 62px; padding: 4px; border-radius: 7px; }
  .mday .mchip { display: none; }
  .mday .mdots { display: flex !important; }
}
.mdots { display: none; gap: 3px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: .86rem; font-weight: 650; color: var(--muted); }
.field .hint { font-size: .8rem; color: var(--faint); }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface-2); min-height: 46px; outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 80px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 8px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; min-height: 38px;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.on .dot { box-shadow: 0 0 0 2px #fff; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 6px 0; }
.switch input { display: none; }
.switch .track { width: 46px; height: 27px; border-radius: 99px; background: var(--surface-3); position: relative; flex: none; transition: background .15s; border: 1px solid var(--border); }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { left: 21px; }
.suggest { position: relative; }
.suggest-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); max-height: 300px; overflow: auto;
}
.suggest-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover, .suggest-item.hi { background: var(--accent-soft); }

/* ---------- Sheets (pop-up panels) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(5, 8, 12, .6); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
.sheet {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; width: 100%; max-width: 560px;
  max-height: calc(100dvh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .18s;
}
.sheet.wide { max-width: 760px; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.sheet-head h2 { flex: 1; }
.sheet-body { padding: 16px; overflow: auto; flex: 1; }
.sheet-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 820px) {
  .overlay { align-items: flex-end; padding: 0; }
  .sheet, .sheet.wide { max-width: none; border-radius: 18px 18px 0 0; max-height: 94dvh; animation: up .2s; }
  .sheet-foot { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .sheet-foot .btn { flex: 1; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border-radius: 13px;
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; text-align: left; min-height: 72px;
}
.choice:hover { border-color: var(--accent); }
.choice b { font-size: 1rem; }
.choice span { font-size: .8rem; color: var(--muted); }
.choice.primary { background: var(--ok-soft); border-color: rgba(47, 163, 107, .5); grid-column: 1 / -1; }
.choice.primary b { color: var(--ok); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); pointer-events: auto; display: flex; gap: 12px; align-items: center; animation: up .2s; }
.toast button { background: none; border: 0; color: var(--accent); font-weight: 800; cursor: pointer; text-transform: uppercase; font-size: .84rem; }
:root[data-theme="dark"] .toast button, :root:not([data-theme]) .toast button { color: var(--accent-strong); }
@media (max-width: 820px) { .toasts { bottom: 92px; } }

/* ---------- Drag ---------- */
.drag-ghost { position: fixed; z-index: 300; pointer-events: none; opacity: .92; transform: rotate(2deg) scale(1.03); box-shadow: var(--shadow); width: 240px; }
.dragging-src { opacity: .3; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none !important; }

/* ---------- Status bar ---------- */
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; cursor: pointer; }
.sync .dot { background: var(--ok); }
.sync.off .dot { background: var(--warn); }
.sync.err .dot { background: var(--danger); }

/* ---------- Walkthrough ---------- */
.wt-spot { position: fixed; z-index: 400; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(4, 7, 12, .72); pointer-events: none; transition: all .25s; outline: 3px solid var(--accent); }
.wt-box { position: fixed; z-index: 401; background: var(--surface); border: 1px solid var(--accent); border-radius: 16px; padding: 18px; width: min(380px, calc(100vw - 24px)); box-shadow: var(--shadow); }
.wt-box h3 { margin-bottom: 6px; font-size: 1.1rem; }
.wt-box p { margin: 0 0 14px; color: var(--muted); }
.wt-steps { display: flex; gap: 5px; }
.wt-steps i { width: 7px; height: 7px; border-radius: 50%; background: var(--surface-3); }
.wt-steps i.on { background: var(--accent); }

/* ---------- Help text ---------- */
.help-body h3 { margin: 16px 0 6px; }
.help-body p, .help-body li { color: var(--muted); }
.help-body p { margin: 0 0 10px; }
.help-body ul, .help-body ol { margin: 0 0 10px; padding-left: 22px; }
.help-body b { color: var(--text); }
.faq { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 8px; }
.faq summary { padding: 13px 14px; cursor: pointer; font-weight: 650; list-style: none; display: flex; gap: 10px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--accent-text); font-size: 1.3rem; line-height: 1; }
.faq[open] summary::after { content: "–"; }
.faq .faq-a { padding: 0 14px 14px; color: var(--muted); }
.faq .faq-a ol, .faq .faq-a ul { padding-left: 20px; margin: 0; }
.faq .faq-a li { margin-bottom: 4px; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .card { width: 100%; max-width: 400px; padding: 26px; }
.login svg.logo { width: 84px; height: 84px; display: block; margin: 0 auto 10px; }

/* ---------- Map ---------- */
.map-box { height: 46dvh; min-height: 280px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.leaflet-container { background: var(--surface-2); font: inherit; }
.map-num { background: var(--accent); color: #fff; border-radius: 50%; width: 28px !important; height: 28px !important; display: flex; align-items: center; justify-content: center; font-weight: 800; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); font-size: .85rem; }
.map-home { background: #111; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.inv-line { display: grid; grid-template-columns: 1fr 110px 38px; gap: 8px; align-items: start; padding: 10px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border); }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; justify-content: end; text-align: right; font-size: .95rem; }
.totals .grand { font-weight: 800; font-size: 1.12rem; }

.kbd { font-size: .78rem; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface-2); }
.spin { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media print { .sidebar, .tabbar, .topbar { display: none; } }

/* icon default size */
.ic { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.2em; }
.pill .ic { width: 1em; height: 1em; }
.strip-title .ic { width: 16px; height: 16px; }
.empty .ic { width: 46px; height: 46px; }
@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar > .seg { order: 10; width: 100%; }
  .topbar > .seg button { flex: 1; }
  .sync .sync-label { display: none; }
  .sync { padding: 8px; }
}
@media (max-width: 560px) {
  .inv-line { grid-template-columns: 1fr 42px; grid-template-areas: "d d" "a t"; }
  .inv-line .il-d { grid-area: d; } .inv-line .il-a { grid-area: a; } .inv-line .il-t { grid-area: t; }
}
a.btn, a.btn:visited { text-decoration: none; color: inherit; }
a.btn.primary { color: #fff; }
