/* Reusable pieces. Everything tappable is at least 44 by 44 points. */

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px;
  border-radius: 12px;
  font-weight: 650; font-size: var(--fs);
  white-space: nowrap;
  transition: background var(--fast), border-color var(--fast), transform var(--fast), opacity var(--fast);
  user-select: none;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; }
.btn-primary { background: var(--accent-strong); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); }
.btn-danger { background: var(--negative); color: #fff; }
.btn-danger-soft { background: var(--negative-soft); color: var(--negative); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: var(--fs-sm); border-radius: 10px; }
.btn .icon { width: 18px; height: 18px; }

.icon-btn {
  width: var(--tap); height: var(--tap); flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--text-2);
  transition: background var(--fast);
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn:active { transform: scale(0.95); }

.link-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; min-width: 44px; color: var(--accent-strong); font-weight: 600; font-size: var(--fs-sm); padding: 0 8px; }

/* ─── Cards and tiles ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: var(--s4);
  min-width: 0;
}
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.card-head h2, .card-head h3 { font-size: var(--fs-md); }
.card-head .sub { color: var(--muted); font-size: var(--fs-sm); }
a.card, button.card { display: block; text-align: left; color: inherit; text-decoration: none; width: 100%; }
a.card:hover, button.card:hover { border-color: var(--line-strong); }

.hero {
  position: relative; overflow: hidden;
  padding: var(--s5) var(--s5) var(--s4);
  border-radius: var(--r-lg);
  color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(150deg, #f97316 0%, #ea580c 45%, #9a3412 100%);
  box-shadow: 0 10px 30px rgba(194, 65, 12, 0.25);
}
.hero-label { font-size: var(--fs-sm); font-weight: 600; opacity: 0.9; display: flex; align-items: center; gap: 6px; }
.hero-value { font-size: var(--fs-hero); font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; margin: 6px 0 2px; }
.hero-sub { font-size: var(--fs-sm); opacity: 0.92; }
.hero-row { display: flex; gap: var(--s3); margin-top: var(--s4); flex-wrap: wrap; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: inherit;
  padding: 6px 14px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.16); font-size: var(--fs-sm); font-weight: 600;
}
.hero-chip.negative-amount { background: rgba(127, 29, 29, 0.35); }

.tiles { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; min-width: 0; box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 4px;
}
.tile-label { font-size: var(--fs-sm); color: var(--text-2); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.tile-value { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; overflow-wrap: anywhere; }
.tile-delta { font-size: var(--fs-xs); color: var(--muted); display: flex; align-items: center; gap: 4px; }
.tile-delta.up-good, .tile-delta.down-good { color: var(--positive); }
.tile-delta.up-bad, .tile-delta.down-bad { color: var(--negative); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }

/* ─── Lists ───────────────────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 10px var(--s4);
  border-top: 1px solid var(--line);
  color: inherit; text-decoration: none !important; text-align: left; width: 100%;
  background: transparent;
  transition: background var(--fast);
}
.list > .list-item:first-child, .list > :first-child .list-item { border-top: 0; }
button.list-item:hover, a.list-item:hover { background: var(--surface-2); }
button.list-item:active, a.list-item:active { background: var(--surface-3); }
.list-body { flex: 1 1 auto; min-width: 0; }
.list-title { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-sub { display: block; font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-end { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.list-amount { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-amount.in { color: var(--positive); }
.list-group-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px var(--s4) 6px; font-size: var(--fs-sm); font-weight: 650; color: var(--text-2);
  background: var(--surface-2); border-top: 1px solid var(--line);
}
.list > .list-group-head:first-child { border-top: 0; }

.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px; line-height: 1;
  background: color-mix(in srgb, var(--tint, var(--k-cash)) 14%, transparent);
  color: var(--tint, var(--k-cash));
}
.avatar .icon { width: 20px; height: 20px; }
.avatar-sm { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 650; letter-spacing: 0.01em;
  background: color-mix(in srgb, var(--tint, var(--k-cash)) 13%, transparent);
  color: var(--tint, var(--text-2));
  white-space: nowrap;
}

/* ─── Chips and segmented choices ─────────────────────────────────────────── */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 40px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line-strong);
  font-weight: 600; font-size: var(--fs-sm); color: var(--text-2);
  transition: background var(--fast), border-color var(--fast), color var(--fast);
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"], .chip.on {
  background: var(--text); border-color: var(--text); color: var(--surface);
}
.chip .icon { width: 16px; height: 16px; }

.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface-3); border-radius: 12px; padding: 3px; gap: 3px;
}
.segmented button {
  min-height: 38px; border-radius: 9px; font-weight: 600; font-size: var(--fs-sm); color: var(--text-2);
  padding: 0 8px; white-space: nowrap;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* Choice tiles (categories, pots) */
.pick-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.pick {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 72px; padding: 8px 6px; border-radius: 14px;
  background: var(--surface-2); border: 1.5px solid transparent;
  font-size: 12.5px; font-weight: 600; color: var(--text-2); text-align: center; line-height: 1.2;
}
.pick .emoji { font-size: 22px; line-height: 1; }
.pick .pick-sub { font-size: 12px; color: var(--muted); font-weight: 550; }
.pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.pick:active { transform: scale(0.97); }
.pick.add { border: 1.5px dashed var(--line-strong); background: transparent; color: var(--muted); }

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.field-hint { font-size: var(--fs-xs); color: var(--muted); }
.field-error { font-size: var(--fs-sm); color: var(--negative); font-weight: 550; }
.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: 16px;               /* 16px stops phones from zooming in */
  transition: border-color var(--fast), box-shadow var(--fast);
  appearance: none;
}
.textarea { padding: 12px 14px; min-height: 88px; resize: vertical; line-height: 1.4; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='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 12px center; padding-right: 38px;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input[aria-invalid="true"] { border-color: var(--negative); }
.input-wrap { position: relative; }
.input-wrap .input { padding-left: 40px; }
.input-wrap .lead { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

.amount-field {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 14px 12px; border-radius: 16px; background: var(--surface-2);
  border: 1.5px solid transparent;
}
.amount-field:focus-within { border-color: var(--accent); background: var(--surface); }
.amount-field .currency { font-size: 28px; font-weight: 650; color: var(--muted); }
.amount-field input {
  width: 100%; min-width: 0; max-width: 260px;
  border: 0; outline: 0; background: transparent;
  font-size: 40px; font-weight: 750; letter-spacing: -0.02em; text-align: center;
  font-variant-numeric: tabular-nums;
}
.amount-field input::placeholder { color: var(--line-strong); }

.form { display: flex; flex-direction: column; gap: var(--s4); }
.form-row { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-actions { display: flex; gap: var(--s3); }
.form-actions .btn { flex: 1 1 0; }

.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span {
  position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: background var(--fast);
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform var(--fast) var(--ease);
}
.switch input:checked + span { background: var(--positive); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px; font-size: var(--fs-sm);
  background: var(--surface-3); color: var(--text-2);
}
.alert.error { background: var(--negative-soft); color: var(--negative); }
.alert.success { background: var(--positive-soft); color: var(--positive); }
.alert.warn { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--text); }
.alert .icon { width: 18px; height: 18px; margin-top: 1px; }

/* ─── Sheets and dialogs ──────────────────────────────────────────────────── */
.scrim {
  position: fixed; inset: 0; z-index: 90; background: var(--scrim);
  animation: fade-in var(--med) var(--ease);
}
.sheet {
  position: fixed; z-index: 91;
  left: 0; right: 0; bottom: 0;
  max-height: calc(100dvh - env(safe-area-inset-top) - 24px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-3);
  padding-bottom: env(safe-area-inset-bottom);
  animation: sheet-up 260ms var(--ease);
  outline: none;
}
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 2px; flex: none; }
.sheet-head {
  display: flex; align-items: center; gap: var(--s2);
  padding: 4px 8px 4px max(var(--s4), env(safe-area-inset-left));
  flex: none;
}
.sheet-head h2 { font-size: var(--fs-md); flex: 1 1 auto; min-width: 0; }
.sheet-body {
  overflow-y: auto; overscroll-behavior: contain;
  padding: var(--s2) max(var(--s4), env(safe-area-inset-right)) var(--s4) max(var(--s4), env(safe-area-inset-left));
  flex: 1 1 auto; min-height: 0;
}
.sheet-foot {
  flex: none; padding: var(--s3) max(var(--s4), env(safe-area-inset-right)) var(--s3) max(var(--s4), env(safe-area-inset-left));
  border-top: 1px solid var(--line); background: var(--surface);
}
@media (min-width: 640px) and (min-height: 521px) {
  .sheet {
    left: 50%; top: 50%; bottom: auto; right: auto;
    width: min(560px, calc(100vw - 48px));
    max-height: min(820px, calc(100vh - 64px));
    transform: translate(-50%, -50%);
    border-radius: 22px;
    padding-bottom: 0;
    animation: dialog-in var(--med) var(--ease);
  }
  .sheet-grab { display: none; }
  .sheet-head { padding-top: 12px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .sheet { left: 50%; right: auto; width: min(620px, calc(100vw - 32px)); transform: translateX(-50%);
           max-height: calc(100dvh - 12px); animation: sheet-up-center 260ms var(--ease); }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-up-center { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes dialog-in { from { opacity: 0; transform: translate(-50%, -46%) scale(0.98); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* ─── Toasts ──────────────────────────────────────────────────────────────── */
.toasts {
  position: fixed; z-index: 120; left: 0; right: 0;
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 12px);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; padding: 0 12px;
}
@media (min-width: 640px), (orientation: landscape) and (max-height: 520px) {
  .toasts { bottom: calc(env(safe-area-inset-bottom) + 20px); }
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  max-width: 520px; width: max-content; min-height: 48px;
  padding: 6px 6px 6px 16px; border-radius: 14px;
  background: #101828; color: #f2f4f7; box-shadow: var(--shadow-3);
  font-weight: 550; font-size: var(--fs-sm);
  animation: toast-in var(--med) var(--ease);
}
:root[data-theme="dark"] .toast { background: #f2f4f7; color: #101828; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .toast { background: #f2f4f7; color: #101828; } }
.toast .msg { padding: 6px 0; }
.toast .icon { width: 18px; height: 18px; flex: none; }
.toast button { color: #fdba74; font-weight: 700; padding: 8px 12px; border-radius: 10px; min-height: 40px; }
:root[data-theme="dark"] .toast button { color: #c2410c; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .toast button { color: #c2410c; } }
.toast.error { background: var(--negative); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }

/* ─── Progress and budgets ────────────────────────────────────────────────── */
.meter { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--good); transition: width 500ms var(--ease); }
.meter.yellow > span { background: var(--warning); }
.meter.red > span { background: var(--critical); }
.meter.neutral > span { background: var(--accent); }
.status { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 650; white-space: nowrap; }
.status .icon { width: 14px; height: 14px; }
.status.green .icon { color: var(--good); }
.status.yellow .icon { color: #b54708; }
.status.red .icon { color: var(--critical); }

/* ─── Empty, loading, error ───────────────────────────────────────────────── */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 36px 20px; color: var(--muted);
}
.empty .bubble { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center;
                 background: var(--surface-3); color: var(--text-2); margin-bottom: 4px; }
.empty h3 { color: var(--text); font-size: var(--fs-md); }
.empty p { max-width: 340px; font-size: var(--fs-sm); }
.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ─── Month switcher ──────────────────────────────────────────────────────── */
.month-switch {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 2px;
}
.month-switch .label { min-width: 112px; text-align: center; font-weight: 650; font-size: var(--fs-sm); padding: 0 4px; white-space: nowrap; }
.month-switch .icon-btn { width: 44px; height: 44px; border-radius: 10px; }

/* ─── Charts ──────────────────────────────────────────────────────────────── */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; touch-action: pan-y; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .end-dot { stroke: var(--surface); stroke-width: 2; }
.chart .end-label { fill: var(--text-2); font-size: 12px; font-weight: 650; }
.chart .crosshair { stroke: var(--line-strong); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .col { fill: var(--series-1); }
.chart .col:hover, .chart .col.active { opacity: 0.8; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-sm); color: var(--text-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none;
  min-width: 132px; padding: 8px 10px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-2);
  font-size: var(--fs-xs); color: var(--text-2);
}
.chart-tip b { color: var(--text); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.chart-tip .row { justify-content: space-between; gap: 12px; }
.chart-tip i { width: 10px; height: 2px; display: inline-block; border-radius: 2px; }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.bar-row .name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--fs-sm); font-weight: 600; }
.bar-row .val { font-size: var(--fs-sm); font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.bar-row .track { display: block; grid-column: 1 / -1; height: 8px; border-radius: 0 4px 4px 0; background: var(--track); overflow: hidden; }
.bar-row .fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1); }
.bar-row .meta { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--muted); margin-top: -2px; }

.data-table { font-size: var(--fs-sm); }
.data-table th { text-align: left; font-weight: 650; color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase;
                 letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.data-table td.r, .data-table th.r { text-align: right; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ─── Calendar ────────────────────────────────────────────────────────────── */
/* Each day fills its whole grid cell, so even on a small phone it is at least 44 points to tap; the clear
   2px border keeps the coloured squares visibly apart. The grid reaches a little into the card's padding. */
.cal {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0;
  margin-inline: calc(6px - var(--s4));
}
.cal .dow { text-align: center; font-size: 12px; font-weight: 650; color: var(--muted); padding: 4px 0; }
.cal .day {
  aspect-ratio: 1 / 1; min-height: 44px; border-radius: 12px;
  border: 2px solid transparent; background-clip: padding-box;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); background-color: var(--surface-2);
}
.cal .day[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal .day.today { background-color: var(--accent-strong); color: var(--on-accent); }
.cal .day.has { box-shadow: inset 0 0 0 1.5px var(--k-bill); color: var(--text); }
.cal .day i { width: 5px; height: 5px; border-radius: 50%; background: var(--k-bill); }
.cal .day.today i { background: var(--on-accent); }
.cal .day.blank { background: transparent; }

/* ─── Menus ───────────────────────────────────────────────────────────────── */
.menu-list { display: flex; flex-direction: column; }
.menu-link {
  display: flex; align-items: center; gap: 14px;
  min-height: 56px; padding: 8px var(--s4);
  border-top: 1px solid var(--line); color: var(--text); text-decoration: none !important; width: 100%; text-align: left;
}
.menu-link:first-child { border-top: 0; }
.menu-link:hover { background: var(--surface-2); }
.menu-link .chev { color: var(--muted); margin-left: auto; }
.menu-link .avatar { width: 36px; height: 36px; border-radius: 11px; }

/* Things that can be moved up and down */
.reorder { display: flex; flex-direction: column; gap: 0; }
.drag-handle { color: var(--muted); }

.emoji-chip { min-width: 44px; padding: 0; justify-content: center; font-size: 20px; }

/* Sideways phones: a slimmer cash card, so more fits on the first screen */
@media (orientation: landscape) and (max-height: 520px) {
  .hero { padding: 14px 18px; }
  .hero-value { font-size: 32px; margin: 2px 0 0; }
  .hero-row { margin-top: 10px; }
}
/* With the side navigation showing, the logo is already there */
@media (min-width: 640px), (orientation: landscape) and (max-height: 520px) {
  .topbar .brand-mark { display: none; }
}

/* Phones, tablets and touch screens: everything tappable is at least 44 by 44 points */
@media (max-width: 1023px), (pointer: coarse) {
  .btn-sm, .chip, .segmented button { min-height: 44px; }
  .icon-btn { min-width: 44px; min-height: 44px; }
}
