/* TripShare mockup styles. Phone first, light and dark. */

:root {
  --bg: #f5f5f3;
  --surface: #ffffff;
  --surface-2: #efefec;
  --surface-3: #e6e6e2;
  --text: #17171a;
  --text-2: #55555c;
  --text-3: #8b8b93;
  --border: rgba(20, 20, 30, 0.08);
  --border-strong: rgba(20, 20, 30, 0.16);
  --accent: #0b7a63;
  --accent-press: #08624f;
  --accent-text: #ffffff;
  --accent-soft: #e2f1ec;
  --pos: #0f7a55;
  --neg: #c23d0c;
  --danger: #d12a2a;
  --danger-soft: #fbe7e6;
  --warn-soft: #fdf3dc;
  --warn-text: #7a5300;
  --chrome: rgba(245, 245, 243, 0.78);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-2: 0 8px 28px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  --scrim: rgba(10, 10, 12, 0.36);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --radius: 14px;
  --radius-sm: 10px;
  --tabbar-h: 58px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0f;
    --surface: #18181b;
    --surface-2: #222226;
    --surface-3: #2c2c31;
    --text: #f3f3f5;
    --text-2: #a8a8b0;
    --text-3: #75757e;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);
    --accent: #3cc3a2;
    --accent-press: #31a68a;
    --accent-text: #04140f;
    --accent-soft: #10302a;
    --pos: #4fd39c;
    --neg: #ff8f5a;
    --danger: #ff6b66;
    --danger-soft: #3a1514;
    --warn-soft: #33270a;
    --warn-text: #f3cf74;
    --chrome: rgba(13, 13, 15, 0.74);
    --shadow-1: 0 0 0 1px rgba(255, 255, 255, 0.04);
    --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --scrim: rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0f;
  --surface: #18181b;
  --surface-2: #222226;
  --surface-3: #2c2c31;
  --text: #f3f3f5;
  --text-2: #a8a8b0;
  --text-3: #75757e;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent: #3cc3a2;
  --accent-press: #31a68a;
  --accent-text: #04140f;
  --accent-soft: #10302a;
  --pos: #4fd39c;
  --neg: #ff8f5a;
  --danger: #ff6b66;
  --danger-soft: #3a1514;
  --warn-soft: #33270a;
  --warn-text: #f3cf74;
  --chrome: rgba(13, 13, 15, 0.74);
  --shadow-1: 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --scrim: rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* ---------- base (mobile-native baseline) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
input, textarea, select { font: inherit; font-size: 16px; color: inherit; }
button, a, [role="button"], label, summary { touch-action: manipulation; }
button, [role="button"], .tab, .seg button, .chip {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- app shell ---------- */
.shell { max-width: 640px; margin: 0 auto; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--chrome);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
}
.topbar-inner {
  height: 52px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 8px;
}
.topbar-title { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.topbar .left { justify-self: start; display: flex; }
.topbar .right { justify-self: end; display: flex; gap: 4px; }
.topbar.scrolled { box-shadow: 0 1px 0 var(--border); }

.page { padding: 8px 16px calc(var(--tabbar-h) + 96px + env(safe-area-inset-bottom, 0px)); }
.page.no-tabs { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
.page-enter { animation: pageIn 220ms var(--ease-out); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }

.large-title { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; margin: 8px 0 4px; }
.subtle { color: var(--text-2); }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.section-label {
  font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em;
  margin: 24px 4px 8px; display: flex; justify-content: space-between; align-items: baseline;
}
.section-label .note { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 12px;
  font-size: 16px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap;
  background: var(--surface-2); color: var(--text);
  transition: transform 140ms var(--ease-out), background-color 140ms ease, opacity 140ms ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.primary:active { background: var(--accent-press); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.ghost { background: transparent; color: var(--accent); padding: 0 10px; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.icon-btn {
  appearance: none; border: 0; background: transparent; color: var(--accent); cursor: pointer;
  min-width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 17px; padding: 0 8px;
  transition: transform 140ms var(--ease-out), background-color 140ms ease;
}
.icon-btn:active { transform: scale(0.94); background: var(--surface-2); }
.icon-btn svg.i { width: 22px; height: 22px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { filter: brightness(0.97); }
  .btn.primary:hover { filter: brightness(1.05); }
  .icon-btn:hover { background: var(--surface-2); }
  .row.tappable:hover { background: var(--surface-2); }
  .trip-card:hover { box-shadow: var(--shadow-2); }
}

/* ---------- grouped lists ---------- */
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px;
  position: relative; color: inherit; width: 100%; text-align: left; background: transparent; border: 0; font: inherit;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--border); }
.row.has-avatar + .row::before, .row + .row.has-avatar::before { left: 62px; }
.row.tappable { cursor: pointer; transition: background-color 120ms ease; }
.row.tappable:active { background: var(--surface-2); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { text-align: right; flex: none; }
.row .chev { color: var(--text-3); width: 16px; height: 16px; }
.amount { font-weight: 600; white-space: nowrap; }
.amount-sub { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: 15px; color: #fff;
}
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.ic-circle {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-2);
}

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 16px; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.summary .card .label { font-size: 13px; color: var(--text-3); }
.summary .card .value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.trip-card {
  display: block; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-1); padding: 16px; color: inherit;
  transition: transform 140ms var(--ease-out), box-shadow 200ms ease;
}
.trip-card:active { transform: scale(0.985); }
.trip-card + .trip-card { margin-top: 10px; }
.trip-card .name { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.trip-card .meta { color: var(--text-3); font-size: 14px; margin-top: 2px; }
.trip-card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.stack { display: flex; }
.stack .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.stack .avatar:first-child { margin-left: 0; }

.banner { border-radius: 12px; padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.banner.info { background: var(--accent-soft); color: var(--text); }
.banner.warn { background: var(--warn-soft); color: var(--warn-text); }
.banner svg.i { margin-top: 1px; }

.empty { text-align: center; padding: 48px 24px; color: var(--text-3); }
.empty .ic-circle { width: 56px; height: 56px; margin-bottom: 12px; }

/* ---------- forms ---------- */
.field { display: block; padding: 10px 14px; position: relative; }
.field + .field::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--border); }
.field .label { display: block; font-size: 13px; color: var(--text-3); margin-bottom: 2px; }
.field input:not(.switch), .field select, .field textarea {
  width: 100%; border: 0; background: transparent; outline: none; padding: 4px 0; min-height: 32px;
}
.field select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.field.inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.field.inline .label { margin: 0; font-size: 16px; color: var(--text); }
.field.inline input:not(.switch), .field.inline select { width: auto; text-align: right; color: var(--text-2); }
.field-error { color: var(--danger); font-size: 13px; margin: 6px 4px 0; min-height: 18px; }
.help { color: var(--text-3); font-size: 13px; margin: 6px 4px 0; }

.amount-hero { text-align: center; padding: 18px 12px 14px; }
.amount-hero .row-in { display: flex; align-items: center; justify-content: center; gap: 8px; }
.amount-hero input {
  width: 100%; max-width: 260px; border: 0; background: transparent; outline: none; text-align: center;
  font-size: 44px; font-weight: 700; letter-spacing: -0.03em; padding: 0; color: var(--text);
}
.amount-hero input::placeholder { color: var(--text-3); }
.cur-select {
  appearance: none; -webkit-appearance: none; border: 0; cursor: pointer;
  background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 6px 30px 6px 14px; font-weight: 600; font-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8b93' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
}
.equiv { color: var(--text-3); font-size: 14px; margin-top: 6px; min-height: 20px; }

/* segmented control */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; position: relative; }
.seg button {
  appearance: none; border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 15px; font-weight: 550;
  min-height: 38px; border-radius: 9px; cursor: pointer; position: relative; z-index: 1;
  transition: color 160ms ease;
}
.seg button[aria-pressed="true"] { color: var(--text); }
.seg .thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; border-radius: 9px; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: transform 240ms var(--ease-out);
}

/* participant split rows */
.prow { display: flex; align-items: center; gap: 12px; padding: 8px 14px; min-height: 56px; position: relative; }
.prow + .prow::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; height: 1px; background: var(--border); }
.prow .name { flex: 1; font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .name.off { color: var(--text-3); }
.prow .val { width: 112px; text-align: right; }
.prow .val input {
  width: 100%; text-align: right; border: 0; border-radius: 9px; background: var(--surface-2); padding: 7px 10px; outline: none; min-height: 38px;
}
.prow .val input:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.prow .val .calc { color: var(--text-2); }
.check {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; display: inline-flex; align-items: center; justify-content: center;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms var(--ease-out);
  cursor: pointer; background: transparent; padding: 0; color: transparent;
}
.check:active { transform: scale(0.9); }
.check[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.check svg.i { width: 15px; height: 15px; stroke-width: 3; }

.remaining {
  display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; font-weight: 600; font-size: 15px;
  border-top: 1px solid var(--border); transition: color 160ms ease, background-color 160ms ease;
}
.remaining.bad { color: var(--neg); background: color-mix(in srgb, var(--neg) 8%, transparent); }
.remaining.ok { color: var(--pos); }

/* chips (members while creating a trip) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 999px; padding: 4px 6px 4px 4px; font-size: 15px; font-weight: 550; }
.chip button { appearance: none; border: 0; background: transparent; color: var(--text-3); width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.chip button svg.i { width: 14px; height: 14px; }
.add-row { display: flex; gap: 8px; padding: 0 14px 12px; }
.add-row input { flex: 1; border: 0; background: var(--surface-2); border-radius: 10px; padding: 8px 12px; outline: none; min-height: 42px; }

/* toggle switch */
.switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; flex: none; transition: background-color 200ms ease; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: transform 240ms var(--ease-out); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }

/* ---------- tab bar + floating button ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--chrome);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  box-shadow: 0 -1px 0 var(--border);
}
.tabbar-inner { max-width: 640px; margin: 0 auto; height: var(--tabbar-h); display: grid; grid-template-columns: repeat(4, 1fr); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-3); font-size: 11px; font-weight: 600; }
.tab svg.i { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent); }
.tab:active svg { transform: scale(0.9); }
.tab svg { transition: transform 120ms var(--ease-out); }
.fab-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px); z-index: 25; pointer-events: none; }
.fab-wrap .inner { max-width: 640px; margin: 0 auto; padding: 0 16px; display: flex; justify-content: flex-end; }
.fab {
  pointer-events: auto; box-shadow: var(--shadow-2); border-radius: 999px; min-height: 54px; padding: 0 22px 0 18px; font-size: 16px;
}
.fab svg.i { width: 22px; height: 22px; stroke-width: 2.2; }
.bottom-action { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--chrome); backdrop-filter: blur(20px) saturate(170%); -webkit-backdrop-filter: blur(20px) saturate(170%); box-shadow: 0 -1px 0 var(--border); }
.bottom-action .inner { max-width: 608px; margin: 0 auto; display: flex; gap: 10px; }

/* ---------- day groups ---------- */
.day-head { display: flex; justify-content: space-between; align-items: baseline; margin: 20px 4px 8px; font-size: 14px; }
.day-head .d { font-weight: 650; color: var(--text-2); }
.day-head .t { color: var(--text-3); }

/* ---------- report bars (simple, not charts) ---------- */
.kv { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 16px; align-items: center; padding: 12px 14px; }
.kv .h { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.kv .r { text-align: right; }
.table-wrap { overflow-x: auto; }
table.report { width: 100%; border-collapse: collapse; font-size: 14px; }
table.report th { text-align: right; font-size: 12px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 12px 10px 6px; }
table.report th:first-child, table.report td:first-child { padding-left: 14px; }
table.report th:last-child, table.report td:last-child { padding-right: 14px; }
table.report th:first-child, table.report td:first-child { text-align: left; }
table.report td { text-align: right; padding: 10px 10px; border-top: 1px solid var(--border); white-space: nowrap; }
table.report tfoot td { font-weight: 700; }

/* ---------- share / QR ---------- */
.qr-box { background: #fff; border-radius: 16px; padding: 14px; width: 220px; height: 220px; margin: 8px auto 0; display: flex; align-items: center; justify-content: center; }
.qr-box svg { width: 100%; height: 100%; }
.link-box { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 6px 6px 6px 12px; margin-top: 14px; }
.link-box code { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; user-select: all; }

/* ---------- dialog ---------- */
dialog.sheet {
  border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; margin: 0;
}
dialog.sheet::backdrop { background: transparent; }
dialog.sheet .scrim { position: fixed; inset: 0; background: var(--scrim); opacity: 0; transition: opacity 240ms ease; }
dialog.sheet .panel {
  position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 520px;
  background: var(--surface); border-radius: 22px 22px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%); transition: transform 380ms var(--ease-drawer);
  box-shadow: var(--shadow-2);
}
dialog.sheet[data-open] .scrim { opacity: 1; }
dialog.sheet[data-open] .panel { transform: translateY(0); }
dialog.sheet[data-closing] .panel { transition-duration: 220ms; }
dialog.sheet .grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 0 auto 12px; }
dialog.sheet h3 { font-size: 18px; text-align: center; margin-bottom: 6px; }
dialog.sheet p { text-align: center; color: var(--text-2); margin: 0 0 16px; }
dialog.sheet .actions { display: grid; gap: 8px; }
@media (min-width: 700px) {
  dialog.sheet .panel { bottom: auto; top: 50%; border-radius: 20px; transform: translateY(-46%) scale(0.96); opacity: 0; transition: transform 220ms var(--ease-out), opacity 180ms ease; }
  dialog.sheet[data-open] .panel { transform: translateY(-50%) scale(1); opacity: 1; }
  dialog.sheet .grabber { display: none; }
}

/* ---------- toast ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 84px); z-index: 60; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; background: var(--text); color: var(--bg); border-radius: 14px; padding: 10px 10px 10px 16px; display: flex; gap: 12px; align-items: center;
  box-shadow: var(--shadow-2); font-size: 15px; font-weight: 550; max-width: 420px;
  opacity: 0; transform: translateY(12px); transition: opacity 300ms ease, transform 300ms var(--ease-out);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.hide { opacity: 0; transform: translateY(8px); transition-duration: 180ms; }
.toast button { appearance: none; border: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 700; padding: 6px 8px; cursor: pointer; border-radius: 8px; }
:root:not([data-theme="dark"]) .toast button { color: #5fe0bf; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast button { color: var(--accent-press); } }
:root[data-theme="dark"] .toast button { color: var(--accent-press); }

/* ---------- mock + offline ribbons ---------- */
.mock-ribbon { font-size: 12px; text-align: center; padding: 6px 12px; background: var(--warn-soft); color: var(--warn-text); }
.mock-ribbon button { appearance: none; border: 0; background: transparent; color: inherit; text-decoration: underline; font: inherit; cursor: pointer; padding: 0 2px; }
.offline-ribbon { font-size: 13px; text-align: center; padding: 6px 12px; background: var(--surface-3); color: var(--text-2); display: none; }
body.offline .offline-ribbon { display: block; }

/* ---------- reduced motion / transparency ---------- */
@media (prefers-reduced-motion: reduce) {
  .page-enter { animation: fadeOnly 160ms ease; }
  @keyframes fadeOnly { from { opacity: 0; } }
  dialog.sheet .panel { transition: opacity 200ms ease; transform: none !important; opacity: 0; }
  dialog.sheet[data-open] .panel { opacity: 1; }
  .toast { transform: none !important; }
  .seg .thumb, .switch::after { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .tabbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ---------- print (Export to PDF) ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --text-2: #333; --text-3: #555; --border: #ddd; }
  .topbar, .tabbar, .fab-wrap, .mock-ribbon, .offline-ribbon, .no-print, .toasts { display: none !important; }
  .page { padding: 0; }
  .list, .card { box-shadow: none; border: 1px solid #ddd; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
dialog.sheet p.field-error { color: var(--danger); margin: 8px 0 12px; }
