/* ============================================================
   Zwei kleine Mäuse auf großer Tour – clean, Apple-like system
   System font (SF Pro on Apple devices), grouped lists, hairlines.
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #f2f2f7;
  --bg-2: #e9e9ef;
  --surface: #ffffff;
  --surface-2: #f7f7fa;
  --surface-3: #eeeef3;
  --ink: #1c1c1e;
  --ink-2: #3c3c43;
  --ink-3: #8a8a8e;
  --line: #e5e5ea;
  --line-2: #d1d1d6;
  --sun: #ffcc00;
  --sun-2: #fff4c2;
  --sun-ink: #5c4a00;
  --navy: #007aff;
  --accent: #007aff;
  --coral: #ff6b4a;
  --ok: #248a3d;
  --ok-bg: #e5f6ea;
  --warn: #b25e00;
  --warn-bg: #fff2df;
  --err: #d70015;
  --err-bg: #ffe8e6;
  --info-bg: #eaf2ff;
  /* map (calm, Apple-Maps-like) */
  --map-water: #d4e6f5;
  --map-water-2: #d4e6f5;
  --map-land: #f5f4f0;
  --map-land-edge: #d6d4cc;
  --map-border: #d0cec6;
  --map-state: #e6e4de;
  --map-grat: transparent;
  --route: #007aff;
  --route-plan: #8a8a8e;
  --label-halo: #ffffff;

  --font-ui: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: var(--font-ui);
  --r-xl: 16px;
  --r-l: 14px;
  --r: 12px;
  --r-s: 10px;
  --sh-1: none;
  --sh-2: 0 4px 16px rgba(0, 0, 0, 0.08);
  --sh-3: 0 12px 40px rgba(0, 0, 0, 0.18);
  --focus: 0 0 0 3px var(--surface), 0 0 0 5px #007aff;
  --tabbar-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --gutter: 16px;
  --maxw: 680px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #000000;
    --bg-2: #0c0c0e;
    --surface: #1c1c1e;
    --surface-2: #232325;
    --surface-3: #2c2c2e;
    --ink: #ffffff;
    --ink-2: #d1d1d6;
    --ink-3: #8e8e93;
    --line: #38383a;
    --line-2: #48484a;
    --sun: #ffd60a;
    --sun-2: #3a3210;
    --sun-ink: #ffe680;
    --navy: #0a84ff;
    --accent: #0a84ff;
    --coral: #ff7a5c;
    --ok: #30d158;
    --ok-bg: #12301b;
    --warn: #ffb340;
    --warn-bg: #3a2a10;
    --err: #ff453a;
    --err-bg: #3a1614;
    --info-bg: #0f2540;
    --map-water: #1b2a3a;
    --map-water-2: #1b2a3a;
    --map-land: #2a2a2c;
    --map-land-edge: #3a3a3c;
    --map-border: #48484a;
    --map-state: #3a3a3c;
    --map-grat: transparent;
    --route: #0a84ff;
    --route-plan: #98989d;
    --label-halo: #1c1c1e;
    --sh-1: none;
    --sh-2: 0 6px 22px rgba(0, 0, 0, 0.45);
    --focus: 0 0 0 3px var(--bg), 0 0 0 5px #0a84ff;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #000000;
  --bg-2: #0c0c0e;
  --surface: #1c1c1e;
  --surface-2: #232325;
  --surface-3: #2c2c2e;
  --ink: #ffffff;
  --ink-2: #d1d1d6;
  --ink-3: #8e8e93;
  --line: #38383a;
  --line-2: #48484a;
  --sun: #ffd60a;
  --sun-2: #3a3210;
  --sun-ink: #ffe680;
  --navy: #0a84ff;
  --accent: #0a84ff;
  --coral: #ff7a5c;
  --ok: #30d158;
  --ok-bg: #12301b;
  --warn: #ffb340;
  --warn-bg: #3a2a10;
  --err: #ff453a;
  --err-bg: #3a1614;
  --info-bg: #0f2540;
  --map-water: #1b2a3a;
  --map-water-2: #1b2a3a;
  --map-land: #2a2a2c;
  --map-land-edge: #3a3a3c;
  --map-border: #48484a;
  --map-state: #3a3a3c;
  --map-grat: transparent;
  --route: #0a84ff;
  --route-plan: #98989d;
  --label-halo: #1c1c1e;
  --sh-1: none;
  --sh-2: 0 6px 22px rgba(0, 0, 0, 0.45);
  --focus: 0 0 0 3px var(--bg), 0 0 0 5px #0a84ff;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 var(--font-ui); font-feature-settings: 'ss01', 'tnum' 0;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100dvh;
}
body.no-scroll { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.tnum { font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); font-optical-sizing: auto; letter-spacing: -0.01em; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
.stack > * + * { margin-top: 12px; }
.stack-s > * + * { margin-top: 8px; }
.stack-l > * + * { margin-top: 20px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-2 > .span-2 { grid-column: 1 / -1; }
@media (max-width: 359px) { .grid-2 { grid-template-columns: 1fr; } }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- app shell ---------- */
.app { max-width: var(--maxw); margin: 0 auto; padding: calc(var(--safe-t) + 8px) var(--gutter) calc(var(--tabbar-h) + var(--safe-b) + 28px); min-height: 100dvh; }
.app.detail { padding-top: 0; }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; text-decoration: none; }
.brand-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); flex: none; overflow: hidden; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--accent); }
.brand-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.brand-text { min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.brand-title { display: block; font-family: var(--font-display);  font-weight: 600; font-size: 17px; line-height: 1.15; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-title { font-family: var(--font-display); font-weight: 650; font-size: 26px; letter-spacing: -0.02em; margin: 6px 0 4px; }
.page-sub { color: var(--ink-2); font-size: 14px; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 22px 2px 8px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + var(--safe-b)) max(8px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar-inner { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; border-radius: 14px; text-decoration: none; color: var(--ink-3);
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em; position: relative; -webkit-tap-highlight-color: transparent;
}
.tab .icon { transition: transform .25s var(--ease); }
.tab[aria-current='page'] { color: var(--ink); }
.tab[aria-current='page'] .tab-ico { background: var(--accent); color: #fff; }
.tab-ico { width: 46px; height: 28px; border-radius: 999px; display: grid; place-items: center; transition: background .2s; }
.tab:active .icon { transform: scale(.92); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 650; font-size: 15px; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: transform .12s, background .15s, border-color .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: var(--surface); }
:root[data-theme='dark'] .btn-primary { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .btn-primary { color: #fff; } }
.btn-sun { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--err); }
.btn-s { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn.is-loading span::after { content: '…'; }
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.icon-btn:hover { background: var(--surface-3); }
.icon-btn-filled { background: var(--surface); box-shadow: var(--sh-1); }
.icon-btn-glass { background: rgba(255, 252, 246, .88); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.icon-btn:disabled { opacity: .35; }
.text-btn { border: 0; background: none; padding: 10px 4px; min-height: 44px; font-weight: 650; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-1); }
.card-pad { padding: 14px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 52px; }

/* ---------- chips / notes ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; border: 1px solid transparent; }
.chip-neutral { background: var(--surface-3); color: var(--ink-2); }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-err { background: var(--err-bg); color: var(--err); }
.chip-sun { background: var(--accent); color: #fff; }
.chip-plan { background: transparent; color: var(--ink-2); border: 1px dashed var(--line-2); }
.chip-info { background: var(--info-bg); color: var(--ink); }
.note { display: flex; gap: 8px; padding: 8px 12px; border-radius: var(--r); font-size: 14px; line-height: 1.4; }
.note .icon { flex: none; margin-top: 1px; }
.note-info { background: var(--info-bg); }
.note-warn { background: var(--warn-bg); color: var(--ink); }
.note-warn .icon { color: var(--warn); }
.note-error { background: var(--err-bg); }
.note-error .icon { color: var(--err); }
.note-ok { background: var(--ok-bg); }
.note-ok .icon { color: var(--ok); }
.empty { text-align: center; padding: 16px 12px; color: var(--ink-2); }
.empty-icon { width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.empty-title { font-weight: 700; color: var(--ink); }
.empty-text { font-size: 14px; margin-top: 2px; }
.empty .btn { margin-top: 10px; }
.spinner { display: inline-block; border-radius: 50%; border: 2.5px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.demo-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--info-bg); color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.field-hint { font-size: 12.5px; color: var(--ink-3); display: block; }
.field-error { font-size: 12.5px; color: var(--err); font-weight: 600; }
.input {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-size: 16px; /* iOS: no zoom */ line-height: 1.3; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); }
.has-error .input { border-color: var(--err); }
.textarea { resize: vertical; min-height: 88px; line-height: 1.45; }
input[type='date'].input, input[type='time'].input, input[type='datetime-local'].input { min-height: 46px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-suffix { position: absolute; right: 12px; color: var(--ink-3); font-size: 14px; pointer-events: none; }
.input-wrap .input { padding-right: 56px; }
.select-wrap { position: relative; }
.select { padding-right: 36px; }
.select-chev { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink-3); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.toggle-label { font-weight: 600; font-size: 15px; display: flex; flex-direction: column; gap: 2px; }
.switch { width: 52px; height: 32px; flex: none; border-radius: 999px; border: 0; padding: 3px; background: var(--line-2); transition: background .2s; position: relative; }
.switch::after { content: ''; position: absolute; inset: -6px -4px; }
.switch span { display: block; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .22s var(--ease); }
.switch.on { background: var(--ok); }
.switch.on span { transform: translateX(20px); }
.check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box { width: 24px; height: 24px; flex: none; border-radius: 8px; border: 2px solid var(--line-2); display: grid; place-items: center; color: transparent; transition: all .15s; background: var(--surface); }
.check input:checked + .check-box { background: var(--ok); border-color: var(--ok); color: #fff; }
.check input:focus-visible + .check-box { box-shadow: var(--focus); }
.check-label { padding-top: 2px; line-height: 1.35; overflow-wrap: anywhere; }
.check.is-done .check-label { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-3); border-radius: 999px; padding: 3px; }
.stepper-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface); display: grid; place-items: center; box-shadow: var(--sh-1); }
.stepper-btn:disabled { opacity: .4; box-shadow: none; }
.stepper-val { min-width: 76px; text-align: center; font-size: 14px; }
.stepper-val strong { font-size: 17px; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-btn { flex: 1 0 auto; min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font-weight: 650; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg-btn.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* ---------- accordion ---------- */
.acc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: clip; }
.acc + .acc { margin-top: 10px; }
.acc-h { font-size: inherit; font-weight: inherit; }
.acc-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 12px; min-height: 54px; border: 0; background: none; text-align: left; -webkit-tap-highlight-color: transparent; }
.acc-icon { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink); }
.acc.is-open .acc-icon { background: var(--accent); color: #fff; }
.acc-title { font-weight: 700; font-size: 15.5px; line-height: 1.25; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.acc-summary { flex: 0 3 auto; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42%; }
.acc-chev { color: var(--ink-3); transition: transform .25s var(--ease); flex: none; }
.acc.is-open .acc-chev { transform: rotate(180deg); }
.acc-body { padding: 2px 12px 14px; animation: accIn .25s var(--ease); }
@keyframes accIn { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(12, 16, 36, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet {
  width: 100%; max-width: 560px; max-height: calc(100dvh - 24px - var(--safe-t)); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: var(--sh-3); animation: sheetUp .32s var(--ease);
  padding-bottom: var(--safe-b); outline: none;
}
.sheet-sm { max-width: 440px; }
.sheet-lg { max-width: 680px; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 8px 6px 18px; }
.sheet-head::before { content: ''; position: absolute; left: 50%; transform: translateX(-50%); margin-top: -26px; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); }
.sheet-title { flex: 1; font-family: var(--font-display); font-weight: 650; font-size: 21px; letter-spacing: -0.01em; }
.sheet-body { padding: 6px 18px 18px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sheet-foot .btn { flex: 1 1 auto; }
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 24px; max-height: 86dvh; }
  .sheet-head::before { display: none; }
  .sheet-foot .btn { flex: 0 0 auto; }
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.conflict-lead { color: var(--ink-2); font-size: 14.5px; overflow-wrap: anywhere; }
.conflict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.conflict-merge { margin-top: 10px; }
.conflict-merge .btn { align-self: flex-start; }
.conflict-col { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface-2); min-width: 0; }
.conflict-col.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.conflict-h { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.conflict-v { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; max-height: 140px; overflow: auto; }

/* ---------- toasts & sync ---------- */
.toasts { position: fixed; z-index: 120; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(520px, 100%); width: fit-content; min-height: 44px; padding: 6px 6px 6px 14px; border-radius: 14px; background: #1c2445; color: #fff; box-shadow: var(--sh-3); font-size: 14px; font-weight: 550; animation: sheetUp .28s var(--ease); }
.toast { border: 1px solid rgba(255, 255, 255, .10); }
.toast-error { background: #9c2c1d; }
.toast-warn { background: #7a5210; }
.toast-action { flex: none; border: 0; background: var(--accent); color: #fff; font-weight: 750; border-radius: 10px; min-height: 36px; padding: 0 12px; position: relative; }
.toast-action::after { content: ''; position: absolute; inset: -4px -4px; }
.sync-slot { min-width: 0; display: flex; justify-content: flex-end; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 5px 9px; border-radius: 999px; white-space: nowrap; animation: fade .2s; }
.sync-saving { color: var(--ink-3); }
.sync-off { background: var(--warn-bg); color: var(--warn); }
.sync-err { background: var(--err-bg); color: var(--err); }
.sync-remote { background: var(--info-bg); color: var(--ink-2); max-width: 120px; }
.sync-name { overflow: hidden; text-overflow: ellipsis; }
.dot-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.7); } }

/* ---------- place image ---------- */
.place-fallback { display: grid; place-items: center; background: linear-gradient(135deg, hsl(var(--h) 45% 72%), hsl(calc(var(--h) + 40) 50% 58%)); color: rgba(255,255,255,.95); font-family: var(--font-display); font-weight: 700; font-size: 18px; }

/* ---------- auth screens ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--safe-t) + 20px) 20px calc(var(--safe-b) + 20px); }
.auth-card { width: 100%; max-width: 400px; }
.auth-hero { width: 150px; margin: 0 auto 6px; filter: drop-shadow(0 12px 18px rgba(28,36,69,.18)); animation: floaty 5s ease-in-out infinite; }
.auth-title { font-family: var(--font-display);  font-weight: 650; font-size: 28px; text-align: center; letter-spacing: -0.02em; line-height: 1.1; }
.auth-sub { text-align: center; color: var(--ink-2); margin: 8px 0 20px; font-size: 14.5px; }
@keyframes floaty { 50% { transform: translateY(-6px) rotate(-1deg); } }

.loading-screen { min-height: 100dvh; display: grid; place-items: center; color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- touch-target floor (≈44 px) ---------- */
.btn-s { min-height: 44px; }
.seg-btn { min-height: 44px; }
.stepper-btn { width: 44px; height: 44px; }
.brand { min-height: 44px; }
.text-btn { min-height: 44px; }

/* ---------- InfoTip ---------- */
.infotip { display: inline; }
.infotip-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -12px -10px; vertical-align: middle; border: 0; background: none; color: var(--ink-3); border-radius: 50%; }
.infotip-btn[aria-expanded='true'] { color: var(--ink); }
.infotip-pop { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--info-bg); color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.4; text-transform: none; letter-spacing: 0; }

/* ---------- phones: calmer, shorter screens ---------- */
@media (max-width: 480px) {
  .page-title { font-size: 24px; margin: 4px 0 2px; }
  .page-sub { font-size: 13.5px; }
  .section-title { margin: 18px 4px 6px; }
  .acc + .acc { margin-top: 8px; }
  .sheet-head { padding: 12px 6px 4px 16px; }
  .sheet-title { font-size: 20px; }
  .sheet-body { padding: 4px 16px 14px; }
  .sheet-foot { padding: 10px 16px 12px; }
  .toasts { padding: 0 12px; }
}

/* ============================================================
   Apple-like overrides (clean, minimal). Later rules win.
   ============================================================ */
body { font-size: 16px; line-height: 1.4; letter-spacing: -0.011em; }
h1, h2, h3, h4 { letter-spacing: -0.02em; }
.brand-title { font-weight: 600; font-size: 17px; letter-spacing: -0.022em; }
.brand-avatar { box-shadow: none; background: var(--surface-3); }
.page-title { font-weight: 700; font-size: 28px; letter-spacing: -0.028em; margin: 4px 0 2px; }
.sheet-title { font-weight: 600; font-size: 17px; letter-spacing: -0.022em; }
.auth-title { font-weight: 700; font-size: 26px; letter-spacing: -0.028em; }
.section-title { font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: uppercase; color: var(--ink-3); margin: 24px 16px 6px; }
.card, .list, .acc { border-color: transparent; box-shadow: none; border-radius: 12px; }
.list > * + * { border-top: .5px solid var(--line); }
.acc + .acc { margin-top: 10px; }
.acc-btn { min-height: 52px; padding: 10px 14px; }
.acc-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-3); color: var(--ink-2); }
.acc.is-open .acc-icon { background: var(--surface-3); color: var(--accent); }
.acc-title { font-weight: 600; font-size: 16px; }
.acc-summary { font-size: 15px; color: var(--ink-3); }

.btn { border-radius: 12px; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.btn-s { border-radius: 10px; font-size: 15px; }
.btn-primary, .btn-sun { background: var(--accent); color: #fff !important; border-color: transparent; }
.btn-secondary { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); border-color: transparent; }
.btn-ghost { color: var(--accent); }
.btn-ghost:hover, .icon-btn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.icon-btn-filled { box-shadow: none; background: var(--surface); }
.text-btn { color: var(--accent); text-decoration: none; font-weight: 500; }

.chip { border-radius: 6px; height: 20px; font-size: 12px; font-weight: 600; letter-spacing: 0; }
.chip-neutral, .chip-plan { background: var(--surface-3); color: var(--ink-3); border: 0; }
.chip-sun { background: var(--info-bg); color: var(--accent); }
.demo-badge { background: var(--surface-3); color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: .02em; border-radius: 6px; padding: 2px 6px; }

.input { border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field-label { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.seg { background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 9px; padding: 2px; }
.seg-btn { border-radius: 7px; font-weight: 500; }
.seg-btn.on { box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.switch.on { background: #34c759; }
.check-box { border-radius: 50%; border-width: 1.5px; }
.check input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.stepper { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.stepper-btn { box-shadow: none; }

.tabbar { background: color-mix(in srgb, var(--surface) 86%, transparent); border-top: .5px solid var(--line-2); }
.tab { font-size: 10.5px; font-weight: 500; color: var(--ink-3); }
.tab-ico { width: auto; height: 26px; background: none !important; }
.tab[aria-current='page'], .tab[aria-current='page'] .tab-ico { color: var(--accent) !important; }

.toast { background: rgba(28, 28, 30, .94); border-radius: 14px; font-weight: 500; }
.toast-action { background: none; color: #64d2ff; font-weight: 600; }
.sheet { border-radius: 14px 14px 0 0; }
.sheet-head { padding: 10px 6px 4px 16px; }
.note { border-radius: 10px; }
.place-fallback { font-weight: 600; }

/* ============================================================
   Apple-like pass 2 – shared pieces for all detail screens
   ============================================================ */
/* translucent round buttons on photos */
.icon-btn-glass { width: 44px; height: 44px; background: none; color: #fff; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; position: relative; }
.icon-btn-glass::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: rgba(0, 0, 0, .36); backdrop-filter: blur(12px) saturate(1.4); -webkit-backdrop-filter: blur(12px) saturate(1.4); z-index: -1; }
.icon-btn-glass { isolation: isolate; }
.icon-btn-glass:hover { background: none; }

/* accordion rows: plain gray glyph, no tile */
.acc-icon, .acc.is-open .acc-icon { width: 24px; height: 24px; border-radius: 0; background: none; color: var(--ink-3); }
.acc-btn { gap: 12px; padding: 10px 16px; min-height: 52px; }
.acc-title { font-weight: 500; font-size: 16px; }
.acc.is-open > .acc-h .acc-title { font-weight: 600; }
.acc-summary { font-size: 15px; font-weight: 400; }
.acc-body { padding: 0 16px 16px; }

/* notes / chips / empties */
.note { font-size: 15px; }
.empty-icon { background: none; color: var(--ink-3); }
.empty-title { font-weight: 600; }
.empty-text { font-size: 15px; color: var(--ink-3); }
.check-label { font-size: 16px; }
.field-hint { font-size: 13px; }
.toggle-label { font-weight: 400; font-size: 16px; }
.stepper-val strong { font-weight: 600; }

/* sheets */
.sheet-backdrop { background: rgba(0, 0, 0, .4); }
.sheet-head { min-height: 56px; }
.sheet-foot { border-top: .5px solid var(--line); }
.sheet-close { color: var(--ink-3); }

/* confirm + conflict dialogs */
.confirm-text { color: var(--ink-3); font-size: 15px; }
.conflict-lead { font-size: 15px; color: var(--ink-3); }
.conflict-lead strong { color: var(--ink); font-weight: 600; }
.conflict-col { border: 0; border-radius: 10px; background: var(--fill-group); padding: 10px 12px; }
.conflict-col.mine { border: 0; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--accent); }
.conflict-h { font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--ink-3); }
.conflict-col.mine .conflict-h { color: var(--accent); }
.conflict-v { font-size: 15px; }

/* shared tab header */
.tab-head { margin: 4px 0 16px; align-items: flex-end; }
.tab-head .page-sub { font-size: 15px; color: var(--ink-3); margin-top: 2px; }
.tab-kpi { font-size: 17px; font-weight: 600; padding-bottom: 1px; }
.tab-kpi .kpi-pre, .kpi-pre { font-size: 13px; font-weight: 400; color: var(--ink-3); }
.page-title .demo-badge { vertical-align: 6px; margin-left: 4px; }
@keyframes focusFlash { 0%, 40% { box-shadow: 0 0 0 2px var(--accent); } }

/* auth screens */
.auth { background: var(--bg); }
.auth-hero { width: 128px; height: auto; margin: 0 auto 14px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.12)); animation: none; }
.auth-title { font-size: 28px; line-height: 1.12; }
.auth-sub { color: var(--ink-3); font-size: 15px; }
.auth-card > .card { margin-top: 24px; padding: 16px; border-radius: 12px; }
.auth-card .sheet-title { font-size: 20px; font-weight: 600; }
.auth-foot { text-align: center; }

/* iOS-style stepper: one gray capsule, glyph buttons */
.stepper { gap: 0; padding: 0; border-radius: 10px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.stepper-btn { width: 44px; height: 44px; border-radius: 10px; background: transparent; color: var(--ink); }
.stepper-btn:disabled { color: var(--ink-3); opacity: .5; }
.stepper-btn:active:not(:disabled) { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.stepper-val { min-width: 84px; font-size: 15px; color: var(--ink-2); border-left: .5px solid var(--line-2); border-right: .5px solid var(--line-2); line-height: 22px; }
.stepper-val strong { font-size: 16px; color: var(--ink); }

/* inset hairlines between rows of grouped lists (iOS style) */
.pl-group > .acc + .acc, .sd-group > .acc + .acc { border-top: 0 !important; position: relative; }
.pl-group > .acc + .acc::before, .sd-group > .acc + .acc::before { content: ''; position: absolute; top: 0; left: 52px; right: 0; border-top: .5px solid var(--line); }

/* inset group fill inside white cells/sheets */
:root { --fill-group: #f2f2f7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --fill-group: #2c2c2e; } }
:root[data-theme='dark'] { --fill-group: #2c2c2e; }
