/* ============================================================
   Exchange Ledger — warm paper / travel-journal theme
   Palette validated with the dataviz six-checks validator.
   ============================================================ */

:root {
  color-scheme: light;

  /* surfaces & ink */
  --paper:        #FBF7F0;
  --surface:      #FFFDF9;
  --surface-sunk: #F4EEE3;
  --ink:          #1A1713;
  --ink-2:        #554E44;
  --ink-3:        #8B8175;
  --rule:         #E3DACB;
  --rule-soft:    #EDE6DA;

  /* accent — terracotta, the single-hue magnitude ramp */
  --accent:       #B3502E;
  --accent-soft:  #EBD9CF;
  --accent-ink:   #8E3E22;

  /* validated categorical slots (status breakdown only) */
  --series-1:     #0B7A5C;  /* Paid         */
  --series-2:     #B87514;  /* Pending      */
  --series-3:     #2F5D9E;  /* Reimbursable */

  --good:         #0B7A5C;
  --over:         #B3302E;

  --radius:       14px;
  --radius-sm:    10px;
  --shadow:       0 1px 2px rgba(26,23,19,.05), 0 8px 24px -14px rgba(26,23,19,.18);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;

  --tabbar-h: 56px;
}

:root[data-theme="dark"],
:root[data-theme="auto"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] { color-scheme: dark; }
}

/* dark values, declared once and applied under both scopes */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper:        #16130F;
  --surface:      #201C17;
  --surface-sunk: #292420;
  --ink:          #F6F1E8;
  --ink-2:        #C0B6A7;
  --ink-3:        #8E8477;
  --rule:         #332D26;
  --rule-soft:    #2A2520;
  --accent:       #E0794F;
  --accent-soft:  #40291F;
  --accent-ink:   #EE9670;
  --series-1:     #18A47C;
  --series-2:     #C08420;
  --series-3:     #5A8BDB;
  --good:         #18A47C;
  --over:         #E36159;
  --shadow:       0 1px 2px rgba(0,0,0,.4), 0 8px 24px -14px rgba(0,0,0,.7);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --paper:        #16130F;
    --surface:      #201C17;
    --surface-sunk: #292420;
    --ink:          #F6F1E8;
    --ink-2:        #C0B6A7;
    --ink-3:        #8E8477;
    --rule:         #332D26;
    --rule-soft:    #2A2520;
    --accent:       #E0794F;
    --accent-soft:  #40291F;
    --accent-ink:   #EE9670;
    --series-1:     #18A47C;
    --series-2:     #C08420;
    --series-3:     #5A8BDB;
    --good:         #18A47C;
    --over:         #E36159;
    --shadow:       0 1px 2px rgba(0,0,0,.4), 0 8px 24px -14px rgba(0,0,0,.7);
  }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background-color: var(--paper);
  /* faint paper grain — keeps flat colour from reading as a template */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { list-style: none; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7;
      stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- boot veil (prevents flash of unstyled data) ---------- */
.boot {
  position: fixed; inset: 0; z-index: 999;
  background: var(--paper);
  display: grid; place-items: center;
  transition: opacity .25s ease;
}
.boot.is-gone { opacity: 0; pointer-events: none; }
.boot-mark {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--rule); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 18px 8px;
  max-width: 720px; margin-inline: auto;
}
.brand-title {
  font-family: var(--serif);
  font-size: 21px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1;
}
.brand-sub {
  font-size: 11px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .1em; margin-top: 3px;
}
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-2);
}
.icon-btn:active { background: var(--surface-sunk); }

.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.sync-dot[data-state="local"]   { background: var(--ink-3); }
.sync-dot[data-state="synced"]  { background: var(--good); }
.sync-dot[data-state="pending"] { background: var(--series-2); animation: pulse 1.4s ease-in-out infinite; }
.sync-dot[data-state="error"]   { background: var(--over); }
@keyframes pulse { 50% { opacity: .3; } }

/* dashed "route" hairline — the one overt travel motif */
.route-rule {
  height: 1px; max-width: 720px; margin-inline: auto;
  background-image: linear-gradient(to right, var(--rule) 60%, transparent 0);
  background-size: 7px 1px; background-repeat: repeat-x;
}

/* ============================================================
   Layout
   ============================================================ */
main {
  max-width: 720px; margin-inline: auto;
  padding: 18px 18px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 34px);
}
.view { display: grid; gap: 14px; }
.view[hidden] { display: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow);
}
.hero--compact { padding: 18px 20px 16px; }
.hero-label {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
}
.hero-figure {
  font-size: 40px; font-weight: 600; letter-spacing: -.025em;
  line-height: 1.05; margin-top: 6px;
}
.hero-context { font-size: 13.5px; color: var(--ink-2); margin-top: 5px; }

/* passport stamp — deliberately imperfect, used exactly once */
.hero-stamp {
  position: absolute; top: 14px; right: 12px;
  width: 76px; height: 76px; border-radius: 50%;
  border: 2px solid var(--accent); color: var(--accent);
  display: grid; place-content: center; text-align: center;
  transform: rotate(-11deg); opacity: .42;
  font-variant-numeric: tabular-nums;
}
.hero-stamp::after {
  content: ""; position: absolute; inset: 4px;
  border: 1px dashed currentColor; border-radius: 50%; opacity: .55;
}
.stamp-top, .stamp-bot { font-size: 7.5px; letter-spacing: .16em; font-weight: 700; }
.stamp-mid { font-size: 23px; font-weight: 700; line-height: 1; margin: 1px 0; }

.meter {
  height: 6px; border-radius: 999px; background: var(--surface-sunk);
  margin-top: 14px; overflow: hidden;
}
.meter-fill {
  height: 100%; border-radius: 999px; background: var(--accent);
  transition: width .5s cubic-bezier(.22,.61,.36,1);
}
.meter-fill.is-over { background: var(--over); }

/* ---------- stat tiles ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 560px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.stat {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-sm); padding: 11px 12px;
}
.stat-label {
  font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); line-height: 1.3;
}
.stat-value {
  font-size: 19px; font-weight: 600; margin-top: 4px;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.stat-value--sm { font-size: 13.5px; font-weight: 550; letter-spacing: 0; line-height: 1.3; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 16px 16px 14px;
}
.card--flush { padding-bottom: 4px; }
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card-head h2 {
  font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: -.005em;
}
.card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .card-row { grid-template-columns: 1fr; } }

/* min-height keeps these thumb-sized on a phone; the negative margin stops
   that height from inflating the rows they sit in */
.link-btn {
  font-size: 13px; color: var(--ink-3); flex: none;
  display: inline-flex; align-items: center;
  min-height: 40px; padding: 0 4px; margin-block: -8px;
}
.link-btn--strong { color: var(--accent-ink); font-weight: 600; }
.link-btn:active { opacity: .5; }

/* ============================================================
   Charts (all marks drawn in plain HTML)
   ============================================================ */
.chart { display: grid; gap: 11px; }
.chart-empty { font-size: 13px; color: var(--ink-3); padding: 6px 0 10px; }

.bar-row { display: grid; gap: 5px; }
.bar-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.bar-name { font-size: 13px; color: var(--ink-2); min-width: 0;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-val  { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.bar-track { height: 8px; background: var(--surface-sunk); border-radius: 4px; overflow: hidden; }
.bar-fill {
  height: 100%; background: var(--accent); border-radius: 4px;
  transition: width .5s cubic-bezier(.22,.61,.36,1);
}
.bar-fill[data-series="1"] { background: var(--series-1); }
.bar-fill[data-series="2"] { background: var(--series-2); }
.bar-fill[data-series="3"] { background: var(--series-3); }

/* vertical columns — months */
.col-chart {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 8px; align-items: end; height: 132px;
}
.col { display: grid; align-content: end; gap: 6px; height: 100%; text-align: center; }
.col-bar-wrap { display: grid; align-content: end; height: 100%; }
.col-bar {
  background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px;
  transition: height .5s cubic-bezier(.22,.61,.36,1);
}
.col-bar.is-empty { background: var(--rule-soft); }
.col-label { font-size: 10px; color: var(--ink-3); letter-spacing: .02em; }
.col-value {
  font-size: 10px; color: var(--ink-2); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* table fallback view */
.chart-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.chart-table th, .chart-table td {
  text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--rule-soft);
}
.chart-table th { color: var(--ink-3); font-weight: 500; font-size: 11px;
                  text-transform: uppercase; letter-spacing: .07em; }
.chart-table td:last-child, .chart-table th:last-child {
  text-align: right; font-variant-numeric: tabular-nums;
}

/* legend swatch — identity never rests on colour alone */
.swatch {
  width: 9px; height: 9px; border-radius: 2px; display: inline-block;
  margin-right: 7px; vertical-align: baseline; flex: none;
}
.swatch[data-series="1"] { background: var(--series-1); }
.swatch[data-series="2"] { background: var(--series-2); }
.swatch[data-series="3"] { background: var(--series-3); }

/* ============================================================
   Transaction list
   ============================================================ */
.tx-list { display: grid; }
.day-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 16px 2px 7px; gap: 12px;
}
.day-head:first-child { padding-top: 2px; }
.day-date {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.day-total { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.tx {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px; border-top: 1px solid var(--rule-soft);
  width: 100%; text-align: left;
}
.tx:first-child { border-top: 0; }
.tx-list--grouped .tx { border-top: 1px solid var(--rule-soft); }

.tx-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 12px; font-weight: 700; letter-spacing: -.02em;
}
.tx-body { flex: 1; min-width: 0; }
.tx-title {
  font-size: 14.5px; font-weight: 550; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tx-meta {
  font-size: 11.5px; color: var(--ink-3); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tx-amounts { text-align: right; flex: none; }
.tx-inr { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tx-orig { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: 2px; }
.tx:active { background: var(--surface-sunk); }

.pill {
  display: inline-block; font-size: 10px; font-weight: 650;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px; vertical-align: 1px;
}
.pill[data-status="Paid"]         { background: color-mix(in srgb, var(--series-1) 15%, transparent); color: var(--series-1); }
.pill[data-status="Pending"]      { background: color-mix(in srgb, var(--series-2) 17%, transparent); color: var(--series-2); }
.pill[data-status="Reimbursable"] { background: color-mix(in srgb, var(--series-3) 15%, transparent); color: var(--series-3); }

.empty { text-align: center; color: var(--ink-3); font-size: 14px; padding: 40px 20px; }

/* ============================================================
   Toolbar / filters
   ============================================================ */
.toolbar { display: grid; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-sm); padding: 0 12px; height: 42px;
  color: var(--ink-3);
}
.search input {
  flex: 1; border: 0; background: none; outline: none;
  font-size: 16px; min-width: 0; color: var(--ink);
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters select {
  flex: none; -webkit-appearance: none; appearance: none;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 999px; padding: 7px 30px 7px 13px;
  font-size: 13px; color: var(--ink-2); outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B8175' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 13px;
}
.filters select.is-set { border-color: var(--accent); color: var(--accent-ink); font-weight: 550; }
.result-line { font-size: 12.5px; color: var(--ink-3); padding-left: 2px; }
.result-line strong { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ============================================================
   Budget list
   ============================================================ */
.budget-list { display: grid; }
.budget-row { padding: 12px 0; border-top: 1px solid var(--rule-soft); }
.budget-row:first-child { border-top: 0; }
.budget-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.budget-name { font-size: 14px; font-weight: 550; min-width: 0;
               overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.budget-nums { font-size: 12.5px; color: var(--ink-3); flex: none;
               font-variant-numeric: tabular-nums; }
.budget-input {
  width: 92px; text-align: right; border: 1px solid transparent;
  background: var(--surface-sunk); border-radius: 6px;
  padding: 3px 7px; font-size: 12.5px; outline: none;
  font-variant-numeric: tabular-nums; color: var(--ink-2);
}
.budget-input:focus { border-color: var(--accent); background: var(--surface); color: var(--ink); }
.budget-track { height: 6px; background: var(--surface-sunk); border-radius: 3px;
                margin-top: 8px; overflow: hidden; }
.budget-fill { height: 100%; border-radius: 3px; background: var(--accent);
               transition: width .45s cubic-bezier(.22,.61,.36,1); }
.budget-fill.is-over { background: var(--over); }
.budget-foot { font-size: 11.5px; color: var(--ink-3); margin-top: 5px;
               font-variant-numeric: tabular-nums; }
.budget-foot.is-over { color: var(--over); }
.hint { font-size: 12px; color: var(--ink-3); text-align: center; padding: 2px 20px; }
.hint--tight { text-align: left; padding: 6px 0 0; }

/* ============================================================
   Tab bar & FAB
   ============================================================ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--rule);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  height: var(--tabbar-h);
  display: grid; place-items: center; gap: 2px;
  color: var(--ink-3); font-size: 10px; letter-spacing: .02em;
}
.tab svg { width: 21px; height: 21px; }
.tab.is-active { color: var(--accent-ink); font-weight: 600; }

.fab {
  position: fixed; right: 18px; z-index: 46;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px -3px rgba(179,80,46,.5);
  transition: transform .15s ease;
}
.fab svg { width: 25px; height: 25px; stroke-width: 2.1; }
.fab:active { transform: scale(.92); }

/* ============================================================
   Sheets
   ============================================================ */
.scrim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(26,23,19,.42);
  opacity: 0; transition: opacity .28s ease;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.scrim.is-open { opacity: 1; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--paper);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--rule);
  box-shadow: 0 -8px 40px -12px rgba(26,23,19,.3);
  transform: translateY(100%);
  transition: transform .34s cubic-bezier(.32,.72,0,1);
  max-width: 720px; margin-inline: auto;
}
.sheet.is-open { transform: translateY(0); }
.sheet-grab {
  width: 36px; height: 4px; border-radius: 2px; background: var(--rule);
  margin: 8px auto 0; flex: none;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 16px 12px; flex: none;
  border-bottom: 1px solid var(--rule-soft);
}
.sheet-head h2 { font-family: var(--serif); font-size: 16.5px; font-weight: 600; }
.sheet-body {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px 18px calc(env(safe-area-inset-bottom) + 28px);
  display: grid; gap: 13px; align-content: start;
}

/* ---------- form fields ---------- */
.field { display: grid; gap: 5px; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.field-label {
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius-sm);
  padding: 11px 12px; font-size: 16px; outline: none;
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease;
}
.field textarea { resize: vertical; min-height: 44px; font-family: inherit; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B8175' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 15px;
}
.field input[type="date"] { min-height: 44px; }
.field input.is-invalid { border-color: var(--over); }

.computed {
  display: block; padding: 11px 12px; font-size: 16px; font-weight: 600;
  background: var(--surface-sunk); border: 1px solid transparent;
  border-radius: var(--radius-sm); font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.group-head {
  font-family: var(--serif); font-size: 13px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3);
  margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--rule-soft);
}
.group-head:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.btn-row { display: flex; gap: 9px; }
.btn-row--wrap { flex-wrap: wrap; }
.btn {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600;
  text-align: center; white-space: nowrap;
}
.btn--ghost { background: var(--surface); color: var(--ink-2); border: 1px solid var(--rule); }
.btn:active { opacity: .75; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.danger-btn {
  width: 100%; padding: 12px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--over) 10%, transparent);
  color: var(--over); font-size: 14px; font-weight: 600; margin-top: 6px;
}
.danger-btn:active { opacity: .7; }

.seg {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px;
  background: var(--surface-sunk); border-radius: var(--radius-sm); padding: 3px;
}
.seg-btn {
  padding: 8px; border-radius: 7px; font-size: 13.5px; color: var(--ink-2);
  text-align: center;
}
.seg-btn.is-active { background: var(--surface); color: var(--ink); font-weight: 600;
                     box-shadow: 0 1px 2px rgba(26,23,19,.08); }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 90; left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
  transform: translate(-50%, 12px);
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 550;
  opacity: 0; transition: opacity .22s ease, transform .22s ease;
  max-width: calc(100vw - 40px); text-align: center;
}
.toast.is-open { opacity: 1; transform: translate(-50%, 0); }

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