/* Op Pad – Afrika Reisebuch */
:root {
  --bg: #f5efe4;
  --surface: #fffcf6;
  --surface-2: #efe6d6;
  --text: #2a231c;
  --muted: #776a5c;
  --border: #e2d6c3;
  --primary: #b9531c;
  --primary-ink: #ffffff;
  --primary-soft: #f6dcc9;
  --accent: #55723a;
  --accent-soft: #e1ead3;
  --danger: #b3261e;
  --danger-soft: #f7dcd9;
  --warn: #9a6200;
  --warn-soft: #f7e7c4;
  --ok: #3b7a36;
  --ok-soft: #dcefd6;
  --info: #2f6690;
  --info-soft: #d9e7f2;
  --shadow: 0 1px 2px rgba(60, 40, 20, .08), 0 4px 14px rgba(60, 40, 20, .07);
  --radius: 14px;
  --tabbar-h: 62px;
  --topbar-h: 54px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16130f;
    --surface: #211c17;
    --surface-2: #2b241d;
    --text: #efe7da;
    --muted: #a79a8a;
    --border: #3a3128;
    --primary: #e37b3e;
    --primary-ink: #1b120b;
    --primary-soft: #4a2a17;
    --accent: #93b56d;
    --accent-soft: #2c3621;
    --danger: #ef7a70;
    --danger-soft: #4a1f1b;
    --warn: #e0a940;
    --warn-soft: #45351a;
    --ok: #7fc276;
    --ok-soft: #213a1f;
    --info: #7fb2dc;
    --info-soft: #1d2f3f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #16130f;
  --surface: #211c17;
  --surface-2: #2b241d;
  --text: #efe7da;
  --muted: #a79a8a;
  --border: #3a3128;
  --primary: #e37b3e;
  --primary-ink: #1b120b;
  --primary-soft: #4a2a17;
  --accent: #93b56d;
  --accent-soft: #2c3621;
  --danger: #ef7a70;
  --danger-soft: #4a1f1b;
  --warn: #e0a940;
  --warn-soft: #45351a;
  --ok: #7fc276;
  --ok-soft: #213a1f;
  --info: #7fb2dc;
  --info-soft: #1d2f3f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  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;
}
body.no-scroll { overflow: hidden; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; }
h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
img { max-width: 100%; }
.ico { flex: none; display: block; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.stack > * + * { margin-top: 10px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.space-between { justify-content: space-between; }

/* ---------- Splash ---------- */
.splash { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 2px;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 6px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-title {
  flex: 1; min-width: 0; padding: 0 8px;
  font-weight: 700; font-size: 18px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  border: 0; background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.96); }
.sync-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 10px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer;
}
.sync-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync-pill.ok .dot { background: var(--ok); }
.sync-pill.syncing .dot { background: var(--info); animation: pulse 1s infinite alternate; }
.sync-pill.offline .dot { background: var(--warn); }
.sync-pill.error .dot, .sync-pill.auth .dot { background: var(--danger); }
@keyframes pulse { from { opacity: .3; } to { opacity: 1; } }

/* ---------- Main + Tabbar ---------- */
#view {
  max-width: 820px; margin: 0 auto;
  padding: 14px 16px calc(var(--tabbar-h) + 96px + env(safe-area-inset-bottom));
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  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(--border);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
}
.tab.active { color: var(--primary); }
.tab .badge-dot {
  position: absolute; transform: translate(12px, -10px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px;
  background: var(--primary); color: var(--primary-ink); font-size: 10px; line-height: 16px; text-align: center;
}

/* ---------- Page elements ---------- */
.page-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.page-head h1 { flex: 1; margin: 0; }
.section-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 22px 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px;
}
.card + .card { margin-top: 10px; }
a.card { display: block; color: inherit; text-decoration: none; }
.card-title { font-weight: 700; font-size: 17px; margin: 0 0 4px; }
.card-sub { color: var(--muted); font-size: 14px; }
.card.hero { background: linear-gradient(135deg, var(--primary) 0%, #8a3a12 100%); color: #fff; border: 0; }
.card.hero .card-sub, .card.hero .muted { color: rgba(255, 255, 255, .85); }
.card.hero a { color: #fff; }
.card.hero .info-line .ico { color: rgba(255, 255, 255, .85); }

.alert { padding: 12px 14px; border-radius: 12px; margin: 0 0 12px; font-size: 15px; }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--surface-2); color: var(--muted);
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: 14px; border-radius: 10px; }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row > .btn { flex: 1 1 auto; }

.fab {
  position: fixed; z-index: 25;
  right: max(16px, calc(50% - 394px));
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  width: 58px; height: 58px; border-radius: 18px; border: 0;
  display: grid; place-items: center;
  background: var(--primary); color: var(--primary-ink);
  box-shadow: 0 6px 20px rgba(120, 50, 10, .35); cursor: pointer;
}
.fab:active { transform: scale(.95); }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 12px; }
.field-label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.hint { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 16px;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }
fieldset.group { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 12px 2px; margin: 0 0 14px; }
fieldset.group legend { font-weight: 700; padding: 0 6px; color: var(--primary); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }

.search { position: relative; margin-bottom: 10px; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 40px; border-radius: 99px; }

/* ---------- Chips + Segmented ---------- */
.chips { position: relative; display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
/* Handy: wischbar, rechts ausgeblendet, solange weitere Filter folgen */
.chips.more {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
}
.chips.wrap { flex-wrap: wrap; overflow: visible; }
/* PC mit Maus: seitlich wischen geht nicht → alle Filter umbrechen */
@media (hover: hover) and (pointer: fine) {
  .chips { flex-wrap: wrap; overflow: visible; }
}
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 13px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count { font-size: 12px; opacity: .65; }
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px;
  padding: 3px; margin-bottom: 14px; border-radius: 12px; background: var(--surface-2);
}
.seg a, .seg button {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 36px; border-radius: 10px; border: 0; background: transparent;
  color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.seg .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list + .list { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 56px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.list > .row:first-child, .list > li:first-child > .row { border-top: 0; }
.row-main { flex: 1; min-width: 0; cursor: pointer; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.row-end { flex: none; display: flex; align-items: center; gap: 6px; }
.row.done .row-title { text-decoration: line-through; color: var(--muted); }
.row.stacked { flex-wrap: wrap; row-gap: 6px; padding-left: 12px; }
.row.stacked .row-main { flex: 1 1 calc(100% - 20px); }
.row.stacked .row-end { flex: 1 1 100%; justify-content: flex-end; gap: 10px; }
.row.stacked .status-bar { align-self: stretch; margin: 0; }
.row .status-bar { align-self: stretch; width: 4px; border-radius: 4px; margin: -2px 0; flex: none; background: var(--border); }
.status-ok .status-bar { background: var(--ok); }
.status-low .status-bar { background: var(--warn); }
.status-empty .status-bar, .status-buy .status-bar { background: var(--danger); }
.group-title {
  position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top)); z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  margin: 16px -16px 6px; padding: 7px 16px;
  background: var(--bg); font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.group-title:first-child { margin-top: 0; }
.group-title > span:last-child:not(:first-child) { text-transform: none; letter-spacing: 0; font-weight: 600; }
.qty { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); white-space: nowrap; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; background: var(--surface); }
.stepper button { width: 38px; height: 38px; border: 0; background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer; font: inherit; }
.stepper button:active { background: var(--surface-2); }
.stepper .stepper-val { width: auto; min-width: 40px; padding: 0 4px; font-weight: 800; font-variant-numeric: tabular-nums; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.checkbtn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); color: transparent; display: grid; place-items: center; cursor: pointer; flex: none; }
.checkbtn.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.checkbtn.buybtn { color: var(--muted); }
.checkbtn.buybtn.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.row-end .checkbtn { width: 36px; height: 36px; }
@media (max-width: 380px) {
  .stepper button { width: 32px; }
  .stepper .stepper-val { min-width: 34px; }
}
.tick { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--border); display: grid; place-items: center; color: transparent; flex: none; cursor: pointer; background: var(--surface); }
.tick.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

.progress { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; background: var(--ok); transition: width .3s; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ico { margin: 0 auto 12px; opacity: .6; }
.empty h3 { color: var(--text); }

/* ---------- Cards grid (recipes, facts) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
.tcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none; box-shadow: var(--shadow); }
.tcard .cover { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.tcard .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tcard .body { padding: 9px 11px 11px; }
.tcard .title { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.tcard .meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.fact-card { display: block; }
.fact-card .excerpt { color: var(--muted); font-size: 14px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Detail ---------- */
.hero-img { margin: -14px -16px 14px; max-height: 50vh; overflow: hidden; background: var(--surface-2); }
.hero-img img { width: 100%; max-height: 50vh; object-fit: cover; display: block; cursor: zoom-in; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.ing-list { list-style: none; padding: 0; margin: 0; }
.ing-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--border); cursor: pointer; }
.ing-list li.head { font-weight: 800; color: var(--primary); cursor: default; padding-top: 14px; }
.ing-list li .tick { width: 22px; height: 22px; border-radius: 6px; margin-top: 1px; }
.ing-list li.checked span { text-decoration: line-through; color: var(--muted); }
.steps { padding-left: 0; list-style: none; counter-reset: step; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 10px 10px 10px 46px; border-radius: 12px; cursor: pointer; }
.steps li::before { content: counter(step); position: absolute; left: 8px; top: 9px; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.steps li.current { background: var(--primary-soft); }
.steps li.current::before { background: var(--primary); color: var(--primary-ink); }

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); border: 1px solid var(--border); cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .rm { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumb-add { border-style: dashed; background: transparent; font-size: 12px; flex-direction: column; gap: 2px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 6px; cursor: pointer; }
.file-row .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Timeline (Route) ---------- */
.timeline { position: relative; }
.tl-item { display: flex; gap: 12px; position: relative; }
.tl-date { flex: none; width: 54px; text-align: center; padding: 8px 0 4px; margin-top: 2px; align-self: flex-start; position: relative; z-index: 1; background: var(--bg); }
.tl-date .wd { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.tl-date .d { font-size: 22px; font-weight: 800; line-height: 1.1; }
.tl-date .m { font-size: 12px; color: var(--muted); }
.tl-body { flex: 1; min-width: 0; margin-bottom: 10px; }
.tl-item.today .tl-body .card { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow); }
.tl-item.past { opacity: .62; }
.tl-line { position: absolute; left: 26px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.tl-day { font-size: 12px; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; }
.tl-extra { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.info-line { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; margin-top: 6px; }
.info-line .ico { margin-top: 1px; color: var(--muted); }

/* ---------- Home tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none; box-shadow: var(--shadow); }
.tile .ico { color: var(--primary); }
.tile .big { font-size: 22px; font-weight: 800; line-height: 1; }
.tile .lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.fact-box { border-left: 4px solid var(--accent); }

/* ---------- Sheet (modal) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 12, 5, .45);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .18s;
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  width: 100%; max-width: 640px; max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 20px 20px 0 0;
  transform: translateY(30px); transition: transform .2s;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet-backdrop.open .sheet { transform: none; }
.sheet-full { height: 100vh; height: 100dvh; max-height: none; border-radius: 0; padding-top: env(safe-area-inset-top); }
.sheet-head { display: flex; align-items: center; gap: 6px; padding: 10px 8px 6px 18px; border-bottom: 1px solid var(--border); }
.sheet-head h2 { flex: 1; margin: 0; font-size: 18px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px 18px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 8px; padding: 10px 18px 12px; border-top: 1px solid var(--border); }
.sheet-foot .btn { flex: 1; }
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 20px; max-height: 88vh; }
  .sheet-full { height: auto; max-height: 92vh; border-radius: 20px; padding-top: 0; }
}

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); z-index: 200; 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: 12px; max-width: 520px; padding: 11px 14px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 15px; box-shadow: var(--shadow); animation: toastIn .2s; }
.toast button { border: 0; background: none; color: var(--primary-soft); font: inherit; font-weight: 800; cursor: pointer; padding: 0; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 300; background: #000; display: flex; align-items: center; justify-content: center; touch-action: pinch-zoom; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .icon-btn { position: absolute; color: #fff; background: rgba(255, 255, 255, .15); }
.lightbox .lb-close { top: calc(10px + env(safe-area-inset-top)); right: 10px; }
.lightbox .lb-prev { left: 10px; top: 50%; }
.lightbox .lb-next { right: 10px; top: 50%; }

/* ---------- Banner (Update) ---------- */
.banner { position: fixed; left: 12px; right: 12px; top: calc(var(--topbar-h) + 8px + env(safe-area-inset-top)); z-index: 150; display: flex; align-items: center; gap: 10px; max-width: 600px; margin: 0 auto; padding: 10px 12px; border-radius: 14px; background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.banner .grow { font-size: 14px; font-weight: 600; }
.banner .btn { min-height: 34px; background: #fff; color: var(--accent); border: 0; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; max-width: 400px; margin: 0 auto; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); text-align: center; }
.login-logo img { width: 96px; height: 96px; border-radius: 24px; box-shadow: var(--shadow); }
.login-wrap h1 { margin-top: 14px; font-size: 30px; }
.login-card { text-align: left; margin-top: 18px; }

/* ---------- Misc ---------- */
.menu-list .row { cursor: pointer; }
.menu-list .row .ico:first-child { color: var(--primary); }
.picker-list { max-height: 50vh; overflow-y: auto; }
.table-wrap { overflow-x: auto; }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th, table.simple td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.simple th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
table.simple td.num, table.simple th.num { text-align: right; font-variant-numeric: tabular-nums; }
.star.on { color: #e0a100; }
.star.on svg { fill: currentColor; }
.offline-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 18px; }
