/* Colors come from themes.css. These names are the ones styles.css already uses. */
:root {
  --r-card: 22px;
  --r-btn: 16px;
  --radius: var(--r-card);
  --r-chip: 999px;
  --r-icon: 40px;
  --on-acc: #141413; /* text on a bright accent fill; not a theme surface */
  --ink: var(--tx);
  --muted: var(--mu);
  --accent: var(--acc);
  --accent-2: var(--acc);
  --on-accent: var(--on-acc);
  --bg2: var(--s1);
  --surface: var(--s1);
  --surface-solid: var(--s1);
  --danger: var(--orange-ink);
  --ok: var(--green-ink);
  --green: var(--green-ink);
  --red: var(--orange-ink);
  --font: "Onest", "Segoe UI", sans-serif;
  --display: "Unbounded", "Onest", sans-serif;
  --max: 1080px;
  color-scheme: dark;
}
html[data-theme="white"],
html[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
  color: var(--ink);
  font-family: var(--font);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  overflow-x: clip;
  letter-spacing: 0;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  background: transparent;
  transform: translateZ(0);
}

.bg.is-live {
  background: transparent;
}

.bg.is-static,
.bg:not(.is-live) {
  background: linear-gradient(
    180deg,
    var(--bg) 0%,
    var(--bg) 48%,
    var(--bg) 100%
  );
}

/* Light theme: keep static page color — no WebGL rays */
/* page color is --bg from the active theme */

.bg canvas,
.bg .light-rays-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

button, input, select { font: inherit; color: inherit; }

.onboarding,
.backup-banner {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  display: grid;
  gap: 0.45rem;
}
.onboarding[hidden],
.backup-banner[hidden] { display: none; }
.onboard-step {
  appearance: none;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  color: inherit;
  min-height: 44px;
  cursor: pointer;
}
.onboard-sheet {
  display: grid;
  gap: 0.45rem;
}
.onboard-sheet[hidden] { display: none !important; }
.onboard-step.is-done::before { content: "✓ "; color: var(--accent); }
.chat-confirm-actions { display: flex; gap: 0.4rem; margin-top: 0.55rem; flex-wrap: wrap; }
.chat-confirm-actions button, .chat-bubble button {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  min-height: 44px;
}
.progress-block.is-empty .progress-track { display: none; }

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem clamp(1rem, 3vw, 1.5rem);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  min-width: max-content;
  min-height: 44px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 0;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  background: none;
  box-shadow: none;
}

.about-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.onboarding > .brand-mark {
  width: 48px;
  height: 48px;
  margin-bottom: 0.75rem;
}

.brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  flex: 1;
  justify-content: center;
}

/* Legacy flat nav styles — GooeyNav owns active look */
.nav-link {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  min-height: 44px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in oklab, var(--foreground) 6%, transparent);
  gap: 2px;
}

.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

.lang-btn:hover { color: var(--ink); }
.lang-btn.is-active {
  background: var(--accent);
  color: var(--on-accent);
}

.theme-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--foreground) 6%, transparent);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

.btn-chat,
.btn-primary {
  appearance: none;
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-chat {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.chat-icon { display: none; flex-shrink: 0; }

.btn-chat:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary.sm { padding: 0.5rem 0.85rem; min-width: 2.75rem; }

/* ——— Main ——— */
.site {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem clamp(1rem, 3vw, 1.5rem) 4rem;
  min-height: calc(100dvh - 140px);
}

.panel[hidden] { display: none !important; }
.panel.is-active { animation: rise 0.28s ease both; }

.page-hero {
  margin-bottom: 2rem;
  max-width: 36rem;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.65rem;
}

.page-hero h1,
.page-head h1,
#tasksTitle {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.lede {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 34rem;
}

.lede.tight {
  margin-top: 0.35rem;
  font-size: 0.98rem;
}

.page-head {
  margin-bottom: 1.5rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.section-head h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-head.page-head {
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.text-link {
  appearance: none;
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  padding: 0;
}

.back-link { margin-bottom: 1rem; display: inline-block; }

/* Progress */
.progress-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (max-width: 720px) {
  .progress-board { grid-template-columns: 1fr; }
}

.progress-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
}

.progress-block.as-btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.progress-block.as-btn:hover { border-color: color-mix(in oklab, var(--accent) 35%, transparent); }

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.progress-meta strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-track > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green-ink), var(--acc));
  border-radius: inherit;
  transition: width 0.35s ease;
}

.progress-track.accent > span {
  background: linear-gradient(90deg, var(--acc), var(--acc-soft));
}

.split-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.tile {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.tile:hover {
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
  transform: translateY(-2px);
}

.tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  background: color-mix(in oklab, var(--accent) 12%, transparent);
}

.tile-icon.spend { background: rgba(255, 107, 90, 0.12); }
.tile-icon.folder { background: color-mix(in oklab, var(--accent-2) 12%, transparent); }
.tile-icon.invest { background: color-mix(in oklab, var(--accent) 16%, transparent); }

.tile-title {
  font-weight: 700;
  font-size: 1rem;
}

.tile-sub {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.tile-sub.pos { color: var(--ok); }
.tile-sub.neg { color: var(--danger); }

/* Finance */
.balance-banner {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--accent) 10%, transparent), transparent 55%),
    var(--surface);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.6rem 1.4rem;
  margin-bottom: 1.25rem;
}

.balance-banner-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.money-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.btn-money {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-money.in {
  border-color: color-mix(in oklab, var(--accent) 45%, transparent);
  color: var(--ok);
}

.btn-money.out {
  border-color: rgba(255, 107, 90, 0.45);
  color: var(--danger);
}

.btn-money:hover { border-color: var(--accent); }

.wallet-groups {
  display: grid;
  gap: 1rem;
}

.wallet-group-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.wallet-group-head strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.7rem;
}

.wallet-card {
  border: 1px solid var(--line);
  background: var(--s1);
  border-radius: var(--r-card);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.wallet-card.is-primary {
  border-color: var(--line);
}

.wallet-card-top {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.wallet-emoji {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--wallet-color, var(--accent));
  font-size: 1.1rem;
  flex-shrink: 0;
}

.wallet-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.wallet-name em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
  padding: 0.08rem 0.4rem;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.wallet-amount {
  margin-top: 0.2rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  overflow: visible;
  white-space: nowrap;
}

.wallet-amount .mc-currency {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.wallet-actions {
  display: flex;
  gap: 0.7rem;
  padding-left: calc(40px + 0.85rem);
}

.wallet-action {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-radius: 12px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.wallet-action:hover { border-color: var(--accent); color: var(--accent); }
.wallet-action.danger:hover { border-color: var(--danger); color: var(--danger); }

.wallet-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.wallet-preset {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.wallet-preset:hover {
  border-color: var(--accent);
}

.wallet-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  grid-column: 1 / -1;
}

.wallet-form-hint {
  color: var(--muted);
  font-size: 0.88rem;
  grid-column: 1 / -1;
}

.balance-banner-top .btn-primary.sm {
  font-size: 0.88rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.balance-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.balance-value {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.balance-value.mc-root,
.balance-value .mc-root {
  font-family: var(--display);
}

.balance-sub {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.3rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 1.1rem;
}

.seg-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}

.seg-btn.is-active {
  background: var(--accent);
  color: var(--on-accent);
}

.add-sheet {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.add-sheet[hidden] { display: none !important; }

.add-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.add-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
}

.add-fields input,
.add-fields select,
.inline-add input {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  outline: none;
}

.add-fields input:focus,
.add-fields select:focus,
.inline-add input:focus {
  border-color: var(--accent);
}

.list-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.menu-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border: none;
  background: transparent;
  overflow: visible;
}

.report-period {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.report-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 9.5rem;
  flex: 1;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.report-field input {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font: inherit;
  font-weight: 500;
  color-scheme: inherit;
}

.report-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.tx-list, .folder-list, .check-list { list-style: none; }

.folder-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tx-item, .folder-item, .check-item, .menu-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--line);
  width: 100%;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.folder-item {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.tx-item:last-child,
.check-item:last-child { border-bottom: none; }

.folder-item:last-child,
.menu-panel .menu-row {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
}

.menu-panel .menu-row:last-child {
  border-bottom: 1px solid var(--line);
}

.folder-item:hover,
.menu-row:hover,
.tx-item:hover { background: rgba(255, 255, 255, 0.03); }

.tx-icon, .folder-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  font-size: 1rem;
}

.tx-body, .folder-body, .check-body { flex: 1; min-width: 0; }

.tx-title, .folder-title, .check-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.check-title.done {
  color: var(--muted);
  text-decoration: line-through;
}

.tx-meta, .folder-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.tx-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tx-amount.pos { color: var(--ok); }
.tx-amount.neg { color: var(--danger); }

.tx-del, .check-del {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
}

.tx-del:hover, .check-del:hover { color: var(--danger); }

.folder-chev, .chev { color: var(--muted); margin-left: auto; }

.empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

.check-toggle {
  appearance: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 0;
}

.check-toggle.is-on {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.check-toggle.is-on::after {
  content: "✓";
  font-size: 12px;
  font-weight: 600;
}

.inline-add {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

.inline-add input { flex: 1; }

.spend-board {
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: color-mix(in oklab, var(--card) 88%, transparent);
}

.report-board {
  margin-bottom: 1.25rem;
  padding: 1.2rem 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  background: color-mix(in oklab, var(--card) 92%, transparent);
}

.report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.report-head h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.report-viz {
  display: grid;
  place-items: center;
  min-height: 260px;
  margin: 0.35rem 0 0.75rem;
}

.report-donut {
  width: min(100%, 300px);
}

.report-donut .donut-center-value {
  font-size: 22px;
}

.month-trend {
  margin: 0.25rem 0 1rem;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 72px;
  padding: 0.35rem 0.15rem;
}

.trend-col {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  min-width: 0;
  padding: 0;
}

.trend-bar {
  width: 100%;
  max-width: 28px;
  border-radius: 8px 8px 4px 4px;
  background: color-mix(in oklab, var(--muted) 35%, transparent);
}

.trend-col.is-active .trend-bar {
  background: var(--accent);
}

.trend-col.is-active .trend-label {
  color: var(--ink);
}

.trend-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: lowercase;
}

.bubble-field {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.5rem 0.25rem 0.75rem;
  min-height: 260px;
}

.bubble {
  width: var(--bubble, 96px);
  height: var(--bubble, 96px);
  border-radius: 999px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--on-acc);
  padding: 0.55rem;
  box-shadow: 0 10px 28px hsl(0 0% 0% / 0.28);
  line-height: 1.15;
}

.bubble strong {
  font-size: clamp(0.65rem, 2.2vw, 0.82rem);
  font-weight: 600;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  justify-self: center;
}

.bubble span {
  font-size: clamp(0.62rem, 2vw, 0.78rem);
  font-weight: 700;
  opacity: 0.85;
  margin-top: 0.2rem;
}

.report-cats {
  list-style: none;
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
}

.report-cat {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.55rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
}

.report-cat:hover {
  border-color: var(--line);
  background: color-mix(in oklab, var(--foreground) 3%, transparent);
}

.cat-ring {
  width: 40px;
  height: 40px;
}

.cat-ring text {
  fill: var(--ink);
  font-size: 9px;
  font-weight: 600;
  font-family: var(--font);
}

.report-cat-name {
  font-weight: 700;
  color: var(--ink);
}

.report-cat-hint {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.report-cat-amt {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}

.flow-board {
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: color-mix(in oklab, var(--card) 88%, transparent);
}

.flow-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0 1rem;
}

.flow-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--foreground) 3%, var(--card));
  padding: 0.9rem 1rem;
}

.flow-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: center;
  gap: 0.75rem;
}

.flow-card-copy { min-width: 0; }

.flow-card-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flow-card-value {
  margin-top: 0.35rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
}
.flow-card-value.pos { color: var(--ok); }
.flow-card-value.neg { color: var(--danger); }

.flow-card-delta {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.flow-spark {
  width: 120px;
  height: 44px;
  display: block;
  justify-self: end;
}

.flow-chart-wrap {
  width: 100%;
  min-height: 200px;
  display: grid;
  place-items: center;
}

.flow-line {
  width: 100%;
  height: auto;
  max-height: 240px;
}

.flow-path {
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.flow-path.income { stroke: var(--accent); }
.flow-path.expense { stroke: color-mix(in oklab, var(--muted) 75%, var(--foreground)); }

.flow-dot.income { fill: var(--accent); }
.flow-dot.expense { fill: color-mix(in oklab, var(--muted) 55%, var(--foreground)); }

.flow-x {
  fill: var(--muted);
  font-size: 10px;
  font-family: var(--font);
}

.flow-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.flow-leg {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.flow-leg i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}
.flow-leg.income i { background: var(--accent); }
.flow-leg.expense i { background: color-mix(in oklab, var(--muted) 55%, var(--foreground)); }

@media (max-width: 640px) {
  .flow-cards { grid-template-columns: 1fr; }
  .flow-card-top { grid-template-columns: minmax(0, 1fr) 108px; }
  .flow-spark { width: 108px; }
}

.spend-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.spend-board-head h2 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.spend-sub {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.2rem;
}

.chart-toggle {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.chart-toggle-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chart-toggle-btn.is-active {
  background: var(--accent);
  color: var(--on-accent);
}

.month-strip {
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
}

.month-chip {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.45rem 0.7rem;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.month-chip.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.spend-chart-wrap {
  display: grid;
  place-items: center;
  min-height: 240px;
  margin-bottom: 0.5rem;
}

.spend-donut {
  width: min(100%, 280px);
  aspect-ratio: 1;
}

.spend-donut text {
  fill: var(--ink);
  font-family: var(--font);
  font-weight: 700;
  font-size: 11px;
  pointer-events: none;
}

.spend-donut .donut-center-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.spend-donut .donut-center-value {
  fill: var(--ink);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
}

.spend-bars {
  width: 100%;
  display: grid;
  gap: 0.65rem;
  padding: 0.25rem 0.15rem 0.5rem;
}

.spend-bar-row {
  display: grid;
  grid-template-columns: minmax(72px, 28%) 1fr auto;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.88rem;
}

.spend-bar-row .name {
  color: var(--ink);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spend-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.spend-bar-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  min-width: 2px;
}

.spend-bar-row .pct {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 3.4rem;
  text-align: right;
}

.spend-cats {
  list-style: none;
  display: grid;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.spend-cat {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem 0.55rem;
  border-radius: 12px;
  border: 1px solid transparent;
}

.spend-cat:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
}

.spend-cat .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.spend-cat .meta {
  min-width: 0;
}

.spend-cat .cat-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.spend-cat .cat-pct {
  color: var(--muted);
  font-size: 0.82rem;
}

.spend-cat .cat-amt {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.spend-empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.time-scale {
  display: flex;
  gap: 0.35rem;
  margin: -0.35rem 0 0.85rem;
}

.scale-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  min-height: 44px;
}

.scale-btn.is-active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.time-bars {
  width: 100%;
  min-height: 180px;
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  padding: 0.5rem 0.15rem 0;
  overflow-x: auto;
}

.time-bar-col {
  flex: 1;
  min-width: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.time-bar {
  width: 100%;
  max-width: 28px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}

.time-bar-col span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.plan-board {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
}

.plan-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.plan-board-head h2 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
}

.budget-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem 0.65rem;
  align-items: center;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}

.budget-row.total {
  border-top: none;
  padding-top: 0;
}

.budget-row .budget-track {
  grid-column: 1 / -1;
}

.budget-row .wallet-action {
  grid-row: 1;
  grid-column: 2;
}

.budget-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.budget-meta span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.budget-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.budget-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-ink), var(--acc));
}

.budget-row.is-over .budget-track > span {
  background: linear-gradient(90deg, var(--orange-ink), var(--danger));
}

.goal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.goal-card {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  border-radius: 14px;
  padding: 0.95rem;
  display: grid;
  gap: 0.65rem;
}

.goal-card-top {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.goal-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.stat-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
}

.stat-card .label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
}

.stat-card .value {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-card .rows {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.3rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.stat-card .rows span {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.menu-row { text-decoration: none; position: relative; }
.menu-row input[type="file"] { display: none; }

.footnote {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 1.5rem) 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid transparent;
}

/* Chat */
.chat {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: end center;
  padding: 1rem;
}

.chat[hidden] { display: none !important; }

.chat-panel {
  width: min(100%, 420px);
  height: min(70vh, 520px);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: rise 0.2s ease both;
}

.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.chat-head-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.chat-head-text strong { font-family: var(--display); }
.chat-head-text span { font-size: 0.8rem; color: var(--muted); }

.chat-close {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  font-size: 1.15rem;
  cursor: pointer;
  line-height: 1;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.chat-bubble {
  max-width: 90%;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble--bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border-left: 2px solid var(--accent);
}

.chat-bubble--user {
  align-self: flex-end;
  background: color-mix(in oklab, var(--accent) 18%, transparent);
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem;
  border-top: 1px solid var(--line);
}

.chat-form input {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  outline: none;
}

.chat-form input:focus { border-color: var(--accent); }

.chat-form button,
.chat-confirm button,
.add-sheet input,
.add-sheet select,
.add-sheet button,
.onboard-sheet input,
.onboard-sheet button {
  min-height: 44px;
  min-width: 44px;
}

.undo-bar {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.5rem 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--s2);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.app-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: end center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.45);
}
.app-sheet[hidden] { display: none; }
.app-sheet-card {
  width: min(100%, 420px);
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border-radius: 18px;
  background: var(--s2);
  border: 1px solid var(--line);
}
.app-sheet-card input {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 0.6rem 0.8rem;
}
.currency-field, [data-currency-filter] { min-height: 44px; }

.undo-bar button {
  min-height: 44px;
  min-width: 44px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  padding: 0 0.9rem;
  cursor: pointer;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding-top: env(safe-area-inset-top, 0px);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--s0);
  }
  .site {
    padding-top: calc(var(--header-h, 10.5rem) + 0.85rem);
  }
  .gooey-nav-container.site-nav,
  .site-nav {
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }
  .gooey-nav-container nav ul { flex-wrap: nowrap; justify-content: flex-start; }
  .header-actions { margin-left: auto; flex-wrap: wrap; }
  .progress-board,
  .split-sections { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .balance-banner { padding: 1.45rem 1.1rem 1.15rem; }
  .balance-label { margin-bottom: 0.55rem; }
  .balance-banner-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.7rem;
    align-items: start;
  }
  .balance-banner-top .btn-primary.sm {
    justify-self: start;
    max-width: 100%;
  }
  .balance-value { font-size: 2.15rem; }
  .balance-sub { overflow-wrap: anywhere; }
  .money-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .btn-money {
    min-width: 0;
    padding: 0.55rem 0.2rem;
    font-size: 0.78rem;
    text-align: center;
  }
  .wallet-group-head { align-items: baseline; }
  .wallet-group-head span {
    min-width: 0;
    text-align: right;
    white-space: nowrap;
  }
  .wallet-grid { grid-template-columns: minmax(0, 1fr); }
  .wallet-card { width: 100%; min-width: 0; }
  .wallet-card-text { min-width: 0; flex: 1; }
  .wallet-amount { white-space: nowrap; }
  .wallet-actions { justify-content: flex-start; }
  .seg {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
    gap: 0.2rem;
    padding: 0.28rem;
    border-radius: 16px;
  }
  .seg-btn {
    min-width: 0;
    padding: 0.55rem 0.1rem;
    font-size: 0.7rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 560px) {
  .tile-grid { grid-template-columns: 1fr; }
  .brand-name { font-size: 1.05rem; }
  .site-header-inner { gap: 0.65rem; }
  .header-actions { width: auto; margin-left: auto; gap: 0.4rem; justify-content: flex-end; }
  .chat-icon { display: block; }
  .btn-chat { width: 2.45rem; height: 2.45rem; padding: 0; justify-content: center; }
  .btn-chat-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* ——— Mobile app shell (?app=1 / PWA standalone) ——— */
html.is-app,
html.is-app body {
  height: 100%;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior: none;
}

html.is-app body {
  padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
}

html.is-app .site-header {
  position: sticky;
  top: 0;
  padding-top: env(safe-area-inset-top, 0px);
  /* backdrop-filter would trap the fixed tab bar inside the header */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--bg);
}

html.is-app .site-header-inner {
  flex-wrap: wrap;
  padding: 0.65rem 0.9rem;
  gap: 0.55rem 0.6rem;
}

html.is-app .brand { min-width: 0; }
html.is-app .brand-name { font-size: 1.05rem; }

html.is-app .chat-icon { display: none; }
html.is-app .btn-chat { width: auto; height: auto; padding: 0.45rem 0.75rem; }
html.is-app .btn-chat-label {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
}

html.is-app .header-actions {
  flex: 1 0 100%;
  width: 100%;
  margin-left: 0;
  gap: 0.4rem;
  justify-content: flex-end;
}

html.is-app .gooey-nav-container.site-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  order: initial;
  flex: none;
  width: auto;
  min-width: 0;
  justify-content: center;
  overflow: hidden;
  padding: 0.45rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
}

html.is-app .gooey-nav-container nav ul {
  width: 100%;
  flex-wrap: nowrap;
  justify-content: space-around;
  gap: 0.1em;
  padding: 0;
}

html.is-app .gooey-nav-container .effect { display: none; }

html.is-app .gooey-nav-container nav ul li .nav-link {
  font-size: 0.68rem;
  padding: 0.5rem 0.28rem;
  line-height: 1.15;
  white-space: nowrap;
}

html.is-app .site-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  order: initial;
  width: auto;
  justify-content: space-around;
  gap: 0;
  padding: 0.4rem 0.35rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
  background: rgba(10, 16, 14, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
}

html.is-app .nav-link {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.55rem 0.2rem;
  border-radius: 12px;
  line-height: 1.15;
}

html.is-app .header-actions {
  margin-left: auto;
  width: auto;
  flex-shrink: 0;
}

html.is-app .lang-switch { transform: scale(0.92); transform-origin: right center; }

html.is-app .site {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  padding: 1rem 0.9rem 1.5rem;
}

html.is-app .page-hero h1 {
  font-size: clamp(1.75rem, 8vw, 2.35rem);
}

html.is-app .site-footer {
  display: none;
}

html.is-app .chat-panel {
  width: min(100%, 100vw);
  max-height: min(88dvh, 720px);
  border-radius: 18px 18px 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .panel.is-active, .chat-panel, .tile, .progress-track > span {
    animation: none !important;
    transition: none !important;
  }
}

/* ——— Category picker sheet ——— */
.cat-picker-btn {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.cat-picker-btn:hover {
  border-color: var(--accent);
}

.cat-picker-ico {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  background: color-mix(in oklab, var(--accent) 18%, transparent);
}

.cat-picker-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-picker-label.is-ph {
  color: var(--muted);
  font-weight: 500;
}

.cat-picker-chev {
  color: var(--muted);
  font-size: 0.85rem;
}

.cat-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.cat-sheet[hidden] {
  display: none !important;
}

.cat-sheet-backdrop {
  appearance: none;
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.cat-sheet-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(88dvh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--surface-solid, var(--card));
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 0.85rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.4);
}

html[data-theme="white"] .cat-sheet-panel, html[data-theme="light"] .cat-sheet-panel {
  background: var(--card);
}

.cat-sheet-head {
  display: grid;
  grid-template-columns: 2.4rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.cat-sheet-head strong {
  text-align: center;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.cat-round-btn,
.cat-tool-btn {
  appearance: none;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--foreground) 6%, transparent);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.cat-head-tools {
  display: flex;
  gap: 0.35rem;
  padding: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in oklab, var(--foreground) 4%, transparent);
}

.cat-tool-btn {
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  background: transparent;
  font-weight: 600;
}

.cat-search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: color-mix(in oklab, var(--foreground) 5%, transparent);
  margin-bottom: 0.35rem;
}

.cat-search-ico {
  color: var(--muted);
  font-size: 1rem;
}

.cat-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
  font: inherit;
  min-width: 0;
}

.cat-list {
  list-style: none;
  overflow: auto;
  margin: 0.25rem 0 0;
  padding: 0;
  flex: 1;
  min-height: 0;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 0.35rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.cat-item:last-child {
  border-bottom: 0;
}

.cat-item-ico {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.cat-item-name {
  flex: 1;
}

.cat-item-check {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1.5px solid color-mix(in oklab, var(--accent) 55%, transparent);
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.cat-item.is-selected .cat-item-check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.cat-add-form {
  display: grid;
  grid-template-columns: 3.2rem 1fr auto auto;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.cat-add-form[hidden] {
  display: none !important;
}

.cat-add-form input {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.7rem;
  color: var(--ink);
  font: inherit;
  outline: none;
}

html[data-theme="white"] .cat-add-form input,
html[data-theme="light"] .cat-add-form input,
html[data-theme="white"] .cat-picker-btn,
html[data-theme="light"] .cat-picker-btn {
  background: var(--muted-token, oklch(0.97 0 0));
}

@media (min-width: 720px) {
  .cat-sheet {
    align-items: center;
  }
  .cat-sheet-panel {
    border-radius: 22px;
    max-height: min(80vh, 620px);
  }
}


.tx-list, .folder-list, .check-list, .goal-grid { font-variant-numeric: tabular-nums; }
/* Live themes must not draw a plate around the top menu. */
[data-theme="aurora"] nav:not(.tabbar),
[data-theme="glass"] nav:not(.tabbar),
[data-theme="clear"] nav:not(.tabbar) {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  height: auto !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0 !important;
}

html[data-theme="aurora"] .site-header,
html[data-theme="glass"] .site-header,
html[data-theme="clear"] .site-header {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.appearance { margin: 0 0 1.2rem; display: grid; gap: 0.7rem; }
.appearance-themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.appearance-card, .appearance-dot {
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--r-btn);
  border: 1px solid var(--line);
  background: var(--s1);
  color: var(--tx);
}
.appearance-card.is-on { border-color: var(--acc); box-shadow: inset 0 0 0 1px var(--acc); }
.appearance-accents { display: flex; gap: 0.6rem; }
.appearance-dot { width: 44px; height: 44px; border-radius: var(--r-chip); padding: 0; }
/* Accent swatches show the accent color itself, so the hex stays here. */
.appearance-dot.accent-yellow { background: #F2D24B; }
.appearance-dot.accent-mint { background: #63E6BE; }
.appearance-dot.accent-blue { background: #74A7FF; }
.appearance-dot.accent-coral { background: #FF8E72; }
.appearance-dot.accent-lilac { background: #B197FC; }
.appearance-dot.is-on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--tx); }

.site-header,
html[data-theme] .site-header,
html.is-app .site-header {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.site-header.is-scrolled,
html[data-theme] .site-header.is-scrolled,
html[data-theme="glass"] .site-header.is-scrolled,
html[data-theme="aurora"] .site-header.is-scrolled,
html[data-theme="clear"] .site-header.is-scrolled,
html.is-app .site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 55%, transparent) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}
.app-top { display: flex; align-items: center; gap: 0.45rem; width: 100%; }
.header-float {
  position: fixed;
  z-index: 45;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  max-width: var(--max, 480px);
  margin: 0 auto;
  padding: 0.85rem clamp(1rem, 3vw, 1.5rem);
  padding-top: calc(0.85rem + env(safe-area-inset-top, 0px));
  pointer-events: none;
  color: #fff;
}
html.is-app .header-float {
  padding: 0.65rem 0.9rem;
  padding-top: calc(0.65rem + env(safe-area-inset-top, 0px));
}
.header-float > * { pointer-events: auto; }
.float-gap { flex: 1; pointer-events: none; min-width: 8px; }
html[data-live-logo="1"] .header-float { mix-blend-mode: difference; color: #fff; }
html[data-live-logo="1"] .header-float .brand,
html[data-live-logo="1"] .header-float .brand-name,
html[data-live-logo="1"] .header-float .icon-btn { color: #fff; }
html[data-live-logo="0"] .header-float { mix-blend-mode: normal; color: var(--ink); }
html[data-live-logo="0"] .header-float .brand,
html[data-live-logo="0"] .header-float .brand-name,
html[data-live-logo="0"] .header-float .icon-btn { color: var(--ink); }
.brand-reserve { width: 118px; flex: 0 0 118px; height: 44px; }
.icon-reserve { width: 96px; flex: 0 0 96px; height: 44px; }
html.is-app .brand-reserve { width: 108px; flex-basis: 108px; }
button.search-open,
button.search-close { display: none; }
@media (max-width: 399px) {
  button.search-open { display: grid; }
  .top-search { display: none; }
  .app-top.is-searching .brand,
  .app-top.is-searching button.search-open,
  .app-top.is-searching [data-go="stats"],
  .app-top.is-searching [data-go="more"] { display: none; }
  .app-top.is-searching .top-search { display: block; flex: 1; }
  .app-top.is-searching button.search-close { display: grid; }
}
.top-search input {
  width: 100%;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  color: var(--ink);
  padding: 0 0.9rem;
}
.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.header-float .brand-name,
.header-float .icon-btn { color: inherit; }
.brand-name { font-family: var(--display); font-weight: 600; letter-spacing: 0.04em; }
.home-balance { text-align: center; padding: 0.4rem 0 0.8rem; }
.balance-kicker { color: var(--muted); margin: 0; }
.balance-hero { font-family: var(--display); font-size: clamp(1.35rem, 7.2vw, 2.4rem); margin: 0.2rem 0; white-space: nowrap; }
.balance-hero .is-frac { font-size: 0.62em; color: var(--muted); }
.month-chip {
  display: inline-flex;
  margin: 0;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok, #3dd68c) 18%, transparent);
  color: var(--ok, #3dd68c);
}
.month-chip.is-down { background: color-mix(in srgb, #ff8e72 18%, transparent); color: #ff8e72; }
.home-empty { color: var(--muted); }
.wallet-scroller { display: flex; gap: 0.6rem; overflow-x: auto; padding-bottom: 0.4rem; }
.wallet-pill {
  min-width: 132px;
  min-height: 84px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--s1);
  color: var(--ink);
  text-align: left;
  padding: 0.75rem;
  display: grid;
  gap: 0.25rem;
}
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; margin: 0.8rem 0; }
.qa { background: none; border: 0; color: var(--ink); display: grid; justify-items: center; gap: 0.3rem; min-height: 44px; font-size: 0.78rem; }
.qa-ico {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--s1); border: 1px solid var(--line); font-size: 1.2rem;
}
.qa-add { background: var(--acc); color: #141413; border: 0; }
.home-card { background: var(--s1); border: 1px solid var(--line); border-radius: 22px; padding: 0.9rem 1rem; margin: 0.7rem 0; }
.home-card-head, .feed-row { display: flex; justify-content: space-between; gap: 0.5rem; }
.home-cats { display: grid; gap: 0.35rem; }
.home-cats span { display: flex; justify-content: space-between; gap: 0.75rem; align-items: baseline; }
.home-spent { font-family: var(--display); font-size: 1.5rem; margin: 0.3rem 0; }
.home-left { margin: 0; color: var(--muted); text-align: right; }
.home-bar { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 12%, transparent); margin: 0.6rem 0; }
.home-bar span { display: block; height: 100%; border-radius: 99px; background: var(--acc); }
.feed-day { margin: 0.6rem 0 0.2rem; color: var(--muted); }
.feed-day.pos { color: var(--ok, #3dd68c); }
.feed-day.neg { color: #ff8e72; }
.feed-row { width: 100%; background: none; border: 0; color: inherit; min-height: 44px; padding: 0; }
.tabbar,
html[data-theme="glass"] nav.tabbar,
html[data-theme="clear"] nav.tabbar,
html[data-theme="aurora"] nav.tabbar,
html[data-theme="light"] nav.tabbar {
  position: fixed !important;
  left: 6px !important;
  right: 6px !important;
  bottom: 8px !important;
  z-index: 60;
  height: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
  padding: 0 0 env(safe-area-inset-bottom, 0px) !important;
  display: flex !important;
  align-items: flex-end;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 28px;
  box-sizing: border-box;
}
.tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--muted);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  font-size: 10px;
  white-space: nowrap;
  padding-bottom: 8px;
  overflow: hidden;
}
.tab { padding-left: 0; padding-right: 0; }
.tab span { max-width: 100%; overflow: hidden; white-space: nowrap; font-size: 10px; letter-spacing: -0.01em; }
@media (max-width: 379px) {
  .tab span { font-size: 10px; letter-spacing: -0.01em; }
}
.tab.is-active { color: var(--acc-ink); }
.tab-plus {
  flex: 0 0 52px;
  width: 52px;
  height: 58px;
  margin: -22px 0 10px;
  border-radius: 50%;
  background: var(--acc);
  color: #141413;
  font-size: 2rem;
  line-height: 1;
  place-self: center;
  overflow: visible;
}
.progress-board[hidden] { display: none !important; }
.site { padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px)); }
.panel.is-active { animation: screen-in 200ms ease; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
button:active { transform: scale(0.96); }
body.is-assistant .chat {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  top: var(--header-h, 4.5rem);
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
@media (prefers-reduced-motion: reduce) {
  .panel.is-active { animation: none; }
  button:active { transform: none; }
}

.qa-sheet[hidden] { display: none !important; }
.qa-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
}
.qa-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
}
.qa-panel {
  position: relative;
  width: min(520px, 100%);
  height: auto;
  max-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
  color: var(--tx);
  border-radius: 24px 24px 0 0;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qa-scroll { flex: 0 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 8px; }
.qa-grab {
  width: 48px;
  height: 18px;
  margin: 0 auto;
  border: 0;
  background: transparent;
  position: relative;
}
.qa-grab::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  height: 4px;
  border-radius: 99px;
  background: var(--line);
}
.qa-head, .qa-modes, .qa-wallets, .qa-cats, .qa-dates, .qa-meta { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.qa-cats, .qa-dates, .qa-wallets { overflow-x: auto; }
.qa-meta { min-width: 0; overflow: hidden; }
.qa-dates { flex: 1 1 auto; min-width: 0; overflow-x: auto; }
.qa-head { justify-content: space-between; }
.qa-x, .qa-key, .qa-chip, .qa-mode, .qa-delete, .hist-chip, .swipe-del {
  min-width: 44px;
  min-height: 44px;
}
.qa-x { border: 0; background: transparent; color: var(--tx); font-size: 1.4rem; }
.qa-mode, .qa-chip, .hist-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  line-height: 1.2;
  white-space: nowrap;
  box-sizing: border-box;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--tx);
  border-radius: 999px;
}
.qa-mode.is-on, .qa-chip.is-on, .hist-chip.is-on { background: var(--acc, var(--accent)); color: #1a1500; }
.qa-amount {
  font-family: var(--display);
  font-size: clamp(2.4rem, 10vw, 3.4rem);
  text-align: center;
  line-height: 1.1;
}
.qa-dates label.qa-chip { position: relative; overflow: hidden; }
.qa-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; flex: 0 0 auto; }
.qa-key, .qa-delete {
  border: 0;
  border-radius: 16px;
  background: var(--s2);
  color: var(--tx);
  font-size: 1.3rem;
  height: 48px;
  min-height: 48px;
}
.qa-save { flex: 0 0 auto; min-height: 48px; }
.qa-save:disabled { opacity: 0.4; }
.qa-note { flex: 0 1 120px; min-width: 88px; width: auto; min-height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--tx); padding: 0 12px; }
.qa-pick, .hist-wallet-list { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.qa-dates input, .hist-month input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hist-tools { margin-bottom: 0.8rem; }
.hist-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.day-head { margin: 0.8rem 0 0.3rem; font-size: 0.92rem; color: var(--muted); }
.day-list { list-style: none; margin: 0; padding: 0; }
.tx-swipe { position: relative; overflow: hidden; }
.swipe-del {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  border: 0;
  background: #c43b3b;
  color: #fff;
  padding: 0 16px;
}
.undo-bar { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.undo-bar[hidden] { display: none !important; }
.swipe-main { width: 100%; text-align: left; border: 0; background: var(--bg); color: inherit; display: flex; gap: 10px; align-items: center; position: relative; z-index: 1; }
.header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--acc, var(--accent));
  color: #141413;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.settings-head { display: flex; align-items: center; gap: 8px; }
.settings-head h1 { margin: 0; }
.settings-group { margin: 16px 4px 6px; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.settings-profile, .settings-row {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  padding: 8px 12px;
  box-sizing: border-box;
}
.settings-profile { border-radius: 16px; background: color-mix(in srgb, var(--acc, var(--accent)) 18%, transparent); margin-bottom: 8px; }
.settings-profile small, .settings-row small { display: block; color: var(--muted); font-size: 0.8rem; }
.settings-row-text { flex: 1; min-width: 0; }
.settings-row-value { color: var(--muted); }
.settings-row.is-on strong { color: var(--acc-ink, var(--accent)); }
.settings-row.is-disabled { opacity: 0.55; }
.settings-switch { width: 44px; height: 44px; flex: 0 0 44px; }
.switch {
  width: 51px;
  height: 31px;
  border: 0;
  border-radius: 999px;
  background: #8e8e93;
  position: relative;
  flex: 0 0 51px;
  padding: 0;
}
.switch::after {
  content: "";
  position: absolute;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
}
.switch.is-on { background: var(--acc, var(--accent)); }
.switch.is-on::after { transform: translateX(20px); }
.settings-search { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--tx); padding: 0 12px; margin-bottom: 8px; }
.settings-days { display: flex; flex-wrap: wrap; gap: 8px; }
.menu-row.is-danger, #backupWipeBtn { color: #e15b64; }
#settingsStash { display: none !important; }
@media (min-width: 400px) {
  button.search-open, button.search-close { display: none; }
}
@media (max-width: 399px) {
  button.search-open { display: grid; }
  button.search-close { display: none; }
  .top-search { display: none; }
  .icon-reserve { width: 140px; flex-basis: 140px; }
  body.is-searching .header-float .brand,
  body.is-searching .header-float button.search-open,
  body.is-searching .header-float [data-go="stats"],
  body.is-searching .header-float [data-go="more"] { display: none; }
  body.is-searching button.search-close { display: grid; }
  body.is-searching .top-search { display: block; flex: 1; }
}
@media (max-height: 640px) {
  .qa-panel { gap: 4px; padding-top: 4px; }
  .qa-amount { font-size: 1.7rem; }
  .qa-head { min-height: 36px; }
}
