/* Ledger. In the style of Apple's current design language (iOS 26): glass materials for bars and
   buttons, a floating tab bar, capsule controls, generous corner radii and SF Pro Rounded figures.
   Our own colour and icons. Sizes are in rem so they follow Dynamic Type. */

:root {
  --bg: #f2f2f7;
  --bg-glow: rgba(0, 163, 135, 0.1);
  --card: #ffffff;
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.6);
  --label-3: rgba(60, 60, 67, 0.3);
  --sep: rgba(60, 60, 67, 0.18);
  --fill: rgba(120, 120, 128, 0.2);
  --fill-2: rgba(118, 118, 128, 0.12);
  --tint: #00a387;
  --tint-2: #00c3a0;
  --tint-ink: #007a65;
  --tint-soft: rgba(0, 163, 135, 0.13);
  --on-tint: #ffffff;
  --red: #ff3b30;
  --red-ink: #d70015;
  --red-soft: rgba(255, 59, 48, 0.12);
  --orange: #ff9500;
  --orange-soft: rgba(255, 149, 0, 0.14);
  --orange-ink: #c26a00;
  --green: #34c759;
  --glass: rgba(255, 255, 255, 0.66);
  --glass-strong: rgba(250, 250, 252, 0.82);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --glass-shine: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 rgba(0, 0, 0, 0.03);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
  --thumb: #ffffff;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --rounded: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --r-card: 24px;
  --r-group: 22px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-glow: rgba(48, 213, 180, 0.12);
    --card: #1c1c1e;
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, 0.6);
    --label-3: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.55);
    --fill: rgba(120, 120, 128, 0.36);
    --fill-2: rgba(118, 118, 128, 0.24);
    --tint: #30d5b4;
    --tint-2: #66e8cc;
    --tint-ink: #30d5b4;
    --tint-soft: rgba(48, 213, 180, 0.17);
    --on-tint: #002a22;
    --red: #ff453a;
    --red-ink: #ff6961;
    --red-soft: rgba(255, 69, 58, 0.18);
    --orange: #ff9f0a;
    --orange-soft: rgba(255, 159, 10, 0.18);
    --orange-ink: #ffb340;
    --green: #30d158;
    --glass: rgba(44, 44, 48, 0.58);
    --glass-strong: rgba(30, 30, 34, 0.82);
    --glass-edge: rgba(255, 255, 255, 0.12);
    --glass-shine: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
    --thumb: #636366;
    --card-shadow: none;
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 106.25%; /* 17px, the iOS body size */
  line-height: 1.29;
  -webkit-text-size-adjust: 100%;
}
@supports (font: -apple-system-body) {
  html {
    font: -apple-system-body;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--label);
  letter-spacing: -0.012em;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
/* A soft wash of the brand colour behind the top of every screen. */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 340px;
  background: radial-gradient(120% 100% at 50% 0%, var(--bg-glow), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
[hidden] {
  display: none !important;
}
:focus {
  outline: none;
}
:focus-visible {
  outline: 2.5px solid var(--tint);
  outline-offset: 2px;
}

.icon {
  width: 1.4em;
  height: 1.4em;
  flex: none;
}
.muted {
  color: var(--label-2);
}
.small {
  font-size: 0.765rem;
}
.block {
  display: block;
}
.center {
  text-align: center;
}
.neg {
  color: var(--red-ink);
}

/* ---------- glass ---------- */

.glass-btn,
.tabbar,
.month-pill {
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  backdrop-filter: blur(22px) saturate(190%);
}

.glass-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 2px;
  padding: 0;
  border: 0.5px solid var(--glass-edge);
  border-radius: 50%;
  background: var(--glass);
  box-shadow: var(--glass-shine), var(--glass-shadow);
  color: var(--label);
  transition: transform 0.25s var(--spring), opacity 0.2s;
}
.glass-btn .icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.1;
}
.glass-btn:active:not(:disabled) {
  transform: scale(0.88);
}
.glass-btn.confirm {
  border-color: transparent;
  background: linear-gradient(180deg, var(--tint-2), var(--tint));
  color: var(--on-tint);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 16px color-mix(in srgb, var(--tint) 35%, transparent);
}
.glass-btn.confirm .icon {
  stroke-width: 2.6;
}
.glass-btn:disabled {
  opacity: 0.4;
  box-shadow: var(--glass-shine);
}
.glass-btn.confirm:disabled {
  background: var(--fill);
  color: var(--label-2);
  opacity: 1;
}

/* ---------- navigation bar and large title ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
}
/* iOS 26 has no hard bar edge: content fades softly under a blurred band. */
.nav::before {
  content: '';
  position: absolute;
  inset: 0 0 -18px 0;
  z-index: -1;
  opacity: 0;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 90%, transparent) 55%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
  mask-image: linear-gradient(to bottom, #000 60%, transparent);
  transition: opacity 0.25s;
  pointer-events: none;
}
.nav.solid::before {
  opacity: 1;
}
.nav-title {
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.25s var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 56vw;
}
.nav.solid .nav-title {
  opacity: 1;
  transform: none;
}
.nav-side {
  display: flex;
  align-items: center;
  min-width: 0;
}
.nav-side.end {
  justify-content: flex-end;
}
.nav-btn {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: var(--tint-ink);
  white-space: nowrap;
}
.nav-btn.bold {
  font-weight: 600;
}
.nav-btn:disabled {
  color: var(--label-3);
}

.page {
  padding: 0 max(16px, env(safe-area-inset-right)) calc(120px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.page.push {
  animation: push-in 0.42s var(--ease);
}
.large-title {
  margin: 0 4px 16px;
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.005em;
  overflow-wrap: anywhere;
}
.section-title {
  margin: 30px 4px 10px;
  font-size: 1.3rem;
  font-weight: 700;
}

/* ---------- floating glass tab bar ---------- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  width: min(calc(100% - 32px), calc(var(--n) * 104px));
  padding: 5px;
  transform: translateX(-50%);
  border: 0.5px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--glass);
  box-shadow: var(--glass-shine), var(--glass-shadow);
}
.tab-lens {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc((100% - 10px) / var(--n));
  border-radius: 999px;
  background: var(--fill-2);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform 0.45s var(--spring);
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 54px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--label);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0;
}
.tab .icon {
  width: 1.55rem;
  height: 1.55rem;
  transition: transform 0.25s var(--spring);
}
.tab.active {
  color: var(--tint-ink);
}
.tab:active .icon {
  transform: scale(0.88);
}

/* ---------- inset grouped lists ---------- */

.group {
  margin: 0 0 30px;
}
.group-header {
  margin: 0;
  padding: 0 4px 10px;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sheet .group-header,
.auth .group-header {
  padding: 0 18px 7px;
  font-size: 0.765rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--label-2);
}
.group-body {
  background: var(--card);
  border-radius: var(--r-group);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.group-footer {
  margin: 0;
  padding: 8px 18px 0;
  font-size: 0.765rem;
  color: var(--label-2);
  letter-spacing: 0;
}

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 11px 18px;
  border: 0;
  background: none;
  text-align: left;
}
.row + .row::before,
.row + .add-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18px;
  right: 0;
  border-top: 0.5px solid var(--sep);
}
.row:has(.row-leading) + .row::before,
.row:has(.row-leading) + .add-row::before,
.add-row + .row::before {
  left: 64px;
}
.row.tappable {
  transition: background-color 0.15s;
}
.row.tappable:active {
  background: var(--fill-2);
}
.row-leading {
  display: flex;
  align-items: center;
  flex: none;
}
.row-main {
  flex: 1;
  min-width: 0;
}
.row-title {
  overflow-wrap: anywhere;
}
.row-sub {
  margin-top: 2px;
  font-size: 0.882rem;
  color: var(--label-2);
  overflow-wrap: anywhere;
}
.row-trailing {
  flex: none;
  max-width: 50%;
  color: var(--label-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.row-chevron {
  width: 0.95rem;
  height: 0.95rem;
  margin-right: -6px;
  color: var(--label-3);
  stroke-width: 2.6;
}
.plain-icon {
  color: var(--tint-ink);
}
.destructive-row {
  justify-content: center;
  color: var(--red-ink);
  font-weight: 500;
}
.add-row {
  color: var(--tint-ink);
  font-weight: 500;
}
.add-row .icon {
  width: 1.3rem;
  height: 1.3rem;
  margin: 0 4px;
  stroke-width: 2.3;
}
.link-text {
  color: var(--tint-ink);
  font-size: 0.882rem;
  font-weight: 500;
}
.tx-amount {
  color: var(--label);
  font-family: var(--rounded);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* App-icon-like category tiles: the colour with a gentle top light. */
.tile {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c));
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.4);
  color: #fff;
}
.tile .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 22%, var(--card)), color-mix(in srgb, var(--tint) 12%, var(--card)));
  color: var(--tint-ink);
  font-family: var(--rounded);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0;
}
.avatar.small {
  width: 34px;
  height: 34px;
  font-size: 0.74rem;
}
.avatar.joined {
  background: linear-gradient(180deg, var(--tint-2), var(--tint));
  color: var(--on-tint);
}
.avatar .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.6;
}
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
}
.badge.red {
  background: var(--red-soft);
  color: var(--red-ink);
}
.badge.gray {
  background: var(--fill-2);
  color: var(--label-2);
}
.badge.amber {
  background: var(--orange-soft);
  color: var(--orange-ink);
}
.badge.tint {
  background: var(--tint-soft);
  color: var(--tint-ink);
}

/* ---------- cards and the overview ---------- */

.card {
  margin: 0 0 22px;
  padding: 20px;
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: var(--card-shadow);
}
.card-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
}
.card-sub {
  margin: 10px 0 0;
  font-size: 0.765rem;
  color: var(--label-2);
}
.card p {
  margin: 0;
}

.hero-label {
  font-size: 0.882rem;
  font-weight: 600;
  color: var(--label-2);
}
.hero-amount {
  margin: 4px 0 2px;
  font-family: var(--rounded);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.amt-int {
  font-size: 2.9rem;
}
.amt-dec {
  font-size: 1.6rem;
}
.amt-cur {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--label-2);
}
.hero-amount.neg .amt-int,
.hero-amount.neg .amt-dec {
  color: var(--red-ink);
}
.hero-sub {
  color: var(--label-2);
  font-size: 0.882rem;
}
.hero-body {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 18px;
}
.hero-stats {
  display: grid;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.stat {
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--label-2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.stat-value {
  font-family: var(--rounded);
  font-size: 1.3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.stat-value.accent {
  color: var(--tint-ink);
}
.hero-note {
  margin: 18px 0 0 !important;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--tint-soft);
  color: var(--tint-ink);
  font-size: 0.882rem;
  font-weight: 500;
}
.hero.is-over .hero-note {
  background: var(--red-soft);
  color: var(--red-ink);
}

/* Activity-style ring */
.ring {
  position: relative;
  flex: none;
}
.ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-track {
  fill: none;
  stroke: var(--fill-2);
}
.ring-fill {
  fill: none;
  stroke: var(--tint);
  stroke-linecap: round;
  animation: ring-in 1.1s var(--ease) both;
}
.ring-fill.warn {
  stroke: var(--orange);
}
.ring-fill.over {
  stroke: var(--red);
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-pct {
  font-family: var(--rounded);
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ring-cap {
  margin-top: 2px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--label-2);
}

.bar {
  height: 7px;
  border-radius: 99px;
  background: var(--fill-2);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c, var(--tint)) 70%, #fff), var(--c, var(--tint)));
  transition: width 0.6s var(--ease);
  animation: grow 0.8s var(--ease);
  transform-origin: left;
}
.bar.over .bar-fill {
  background: var(--red);
}
.budget-row .bar {
  margin: 9px 0 7px;
}
.budget-row .row-leading {
  align-self: flex-start;
  margin-top: 1px;
}
.split {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.split-main {
  min-width: 0;
  overflow-wrap: break-word;
  hyphens: auto;
  font-weight: 500;
}
.split-end {
  flex: none;
  font-family: var(--rounded);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.split.row-sub {
  flex-wrap: wrap;
  column-gap: 10px;
  row-gap: 2px;
  margin-top: 0;
  font-size: 0.8rem;
}
.split.row-sub span {
  white-space: nowrap;
}

.month-switcher {
  display: flex;
  justify-content: center;
  margin: 0 0 18px;
}
.month-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 0.5px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--glass);
  box-shadow: var(--glass-shine), 0 2px 10px rgba(0, 0, 0, 0.05);
}
.month-label {
  min-width: 10.5em;
  font-weight: 600;
  text-align: center;
}
.round-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--label);
  transition: background-color 0.15s, transform 0.2s var(--spring);
}
.round-btn .icon {
  width: 1.15rem;
  height: 1.15rem;
  stroke-width: 2.5;
}
.round-btn:disabled {
  color: var(--label-3);
}
.round-btn:active:not(:disabled) {
  background: var(--fill-2);
  transform: scale(0.9);
}

.day-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 1rem;
  font-weight: 700;
}
.day-header span:last-child {
  font-family: var(--rounded);
  color: var(--label-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.filter-chip-row {
  margin: 0 0 16px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 99px;
  background: var(--card);
  box-shadow: var(--card-shadow), inset 0 0 0 0.5px var(--sep);
  font-size: 0.882rem;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
}
.chip.on {
  background: var(--tint);
  color: var(--on-tint);
  box-shadow: none;
}
.chip-x {
  width: 1rem;
  height: 1rem;
  stroke-width: 2.6;
}

.empty {
  padding: 48px 24px;
  text-align: center;
}
.empty-icon {
  width: 3.2rem;
  height: 3.2rem;
  color: var(--label-3);
  stroke-width: 1.4;
}
.empty h2 {
  margin: 12px 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
}
.empty p {
  margin: 0 0 22px;
  color: var(--label-2);
}
.empty .btn {
  width: auto;
  display: inline-flex;
  padding: 0 26px;
}

/* ---------- controls ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.25s var(--spring), opacity 0.2s;
}
.btn.filled {
  background: linear-gradient(180deg, var(--tint-2), var(--tint));
  color: var(--on-tint);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 20px color-mix(in srgb, var(--tint) 30%, transparent);
}
.btn.tinted {
  background: var(--tint-soft);
  color: var(--tint-ink);
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.4;
}
.button-row {
  display: flex;
  gap: 12px;
}

.segmented {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  padding: 3px;
  border-radius: 999px;
  background: var(--fill-2);
  min-width: 0;
}
.seg-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / var(--n));
  border-radius: 999px;
  background: var(--thumb);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform 0.4s var(--spring);
}
.segmented button {
  position: relative;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  background: none;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.segmented button.on {
  font-weight: 600;
}
.seg-wrap {
  margin: 0 0 20px;
}
.seg-wrap .segmented button {
  min-height: 36px;
}
.lang-switch {
  margin: 26px auto 0;
  max-width: 260px;
}
.row .segmented {
  flex: 1;
  max-width: 260px;
  margin-left: auto;
}

.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 62px;
  height: 28px;
  margin: 0;
  border-radius: 99px;
  background: var(--fill);
  transition: background-color 0.25s;
  cursor: pointer;
}
.switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 37px;
  height: 24px;
  border-radius: 99px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.35s var(--spring);
}
.switch:checked {
  background: var(--green);
}
.switch:checked::before {
  transform: translateX(21px);
}

.stepper-amount {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.amount-wrap {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.amount-field {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font-family: var(--rounded);
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.amount-cur {
  color: var(--label-2);
  font-weight: 600;
}
.stepper {
  display: flex;
  align-items: center;
  flex: none;
  border-radius: 999px;
  background: var(--fill-2);
}
.stepper button {
  width: 48px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 1.35rem;
  line-height: 1;
}
.stepper button:active {
  background: var(--fill);
}
.stepper-sep {
  width: 0.5px;
  height: 18px;
  background: var(--sep);
}

.field {
  cursor: text;
}
.field-label {
  flex: none;
  max-width: 45%;
}
.field input,
.field select {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  text-align: right;
  color: var(--label-2);
  outline: none;
}
.field input:focus {
  color: var(--label);
}
.field input::placeholder {
  color: var(--label-3);
}
.field input[type='date'] {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  justify-content: flex-end;
  min-height: 1.4em;
}
.field input[type='date']::-webkit-date-and-time-value {
  text-align: right;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  direction: rtl;
  cursor: pointer;
}
.field .row-leading + input {
  text-align: left;
  color: var(--label);
}

.cat-edit {
  gap: 10px;
}
.cat-edit input {
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
}
.cat-name {
  flex: 1;
}
.cat-limit {
  width: 6.5rem;
  text-align: right;
  color: var(--label-2);
  font-family: var(--rounded);
  font-variant-numeric: tabular-nums;
}
.cat-limit::placeholder {
  color: var(--label-3);
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: -6px;
  border: 0;
  border-radius: 50%;
  background: var(--fill-2);
  color: var(--label-2);
}
.icon-btn .icon {
  width: 0.95rem;
  height: 0.95rem;
  stroke-width: 2.6;
}

.form-error:empty {
  display: none;
}
.form-error {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--red-soft);
  color: var(--red-ink);
  font-size: 0.882rem;
  font-weight: 500;
}

/* payment sheet */
.amount-hero {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 26px;
  cursor: text;
}
.big-amount {
  min-width: 0.6em;
  max-width: calc(100% - 5rem);
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--rounded);
  font-size: 3.6rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  outline: none;
  caret-color: var(--tint);
}
.big-amount::placeholder {
  color: var(--label-3);
}
.amount-hero-cur {
  flex: none;
  font-family: var(--rounded);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--label-2);
}
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px 0 6px;
  border: 0;
  border-radius: 99px;
  background: var(--fill-2);
  font-size: 0.882rem;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s, transform 0.25s var(--spring);
}
.cat-chip:active {
  transform: scale(0.95);
}
.cat-chip-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c));
  color: #fff;
}
.cat-chip-icon .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}
.cat-chip.on {
  background: var(--c);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 35%, transparent);
}
.cat-chip.on .cat-chip-icon {
  background: rgba(255, 255, 255, 0.25);
}

/* category sheet */
.picker-row {
  display: block;
}
.icon-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.icon-pick {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-height: 54px;
  border: 0;
  border-radius: 16px;
  background: var(--fill-2);
  color: var(--label);
}
.icon-pick.on {
  background: linear-gradient(180deg, var(--tint-2), var(--tint));
  color: var(--on-tint);
}
.color-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}
.color-dot {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c));
}
.color-dot.on {
  box-shadow: 0 0 0 2.5px var(--card), 0 0 0 5px var(--c);
}

/* ---------- sheets ---------- */

dialog.sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 640px;
  max-height: calc(100dvh - env(safe-area-inset-top) - 10px);
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 34px 34px 0 0;
  background: var(--bg);
  color: var(--label);
  overflow: hidden;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  animation: sheet-up 0.5s var(--ease);
}
/* A short sheet floats, inset from the edges, like iOS 26. */
dialog.sheet:not(.tall) {
  bottom: max(8px, env(safe-area-inset-bottom));
  width: calc(100% - 16px);
  border-radius: 34px;
}
dialog.sheet.tall {
  height: calc(100dvh - env(safe-area-inset-top) - 10px);
}
dialog.sheet[open] {
  display: flex;
  flex-direction: column;
}
dialog.sheet::backdrop {
  background: rgba(0, 0, 0, 0.32);
  animation: fade-in 0.35s ease;
}
dialog.sheet.closing {
  animation: sheet-down 0.32s var(--ease) forwards;
}
.grabber {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 36px;
  height: 5px;
  margin-left: -18px;
  border-radius: 3px;
  background: var(--label-3);
  z-index: 3;
}
.sheet-nav {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 12px 8px;
  flex: none;
  transition: box-shadow 0.2s, background-color 0.2s;
}
.sheet-nav.scrolled {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 0.5px 0 var(--sep);
}
.sheet-title {
  margin: 0;
  padding: 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  max-width: 58vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* Extra room at the bottom: Safari's floating toolbar sits over the lowest part of the page. */
  padding: 10px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
dialog.sheet:not(.tall) .sheet-body {
  padding-bottom: 24px;
}
.sheet-text {
  margin: 0 6px 18px;
  color: var(--label-2);
  font-size: 0.882rem;
}
.link-card {
  padding: 16px 18px;
  margin-bottom: 16px;
}
.link-code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.8rem;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}

/* ---------- alert ---------- */

dialog.alert {
  width: min(300px, calc(100% - 48px));
  padding: 22px 18px 16px;
  border: 0.5px solid var(--glass-edge);
  border-radius: 34px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  backdrop-filter: blur(30px) saturate(190%);
  box-shadow: var(--glass-shine), 0 20px 60px rgba(0, 0, 0, 0.25);
  color: var(--label);
  text-align: center;
  animation: alert-in 0.4s var(--spring);
}
dialog.alert::backdrop {
  background: rgba(0, 0, 0, 0.28);
}
.alert-text {
  padding: 0 6px 18px;
}
.alert-text h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
}
.alert-text p {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 500;
}
.alert-actions {
  display: flex;
  gap: 10px;
}
.alert-actions button {
  flex: 1;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--fill-2);
  color: var(--label);
  font-weight: 600;
  transition: transform 0.25s var(--spring);
}
.alert-actions .bold {
  background: var(--tint);
  color: var(--on-tint);
}
.alert-actions .destructive {
  background: var(--red);
  color: #fff;
}
.alert-actions button:active {
  transform: scale(0.96);
}

#toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 10px);
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border: 0.5px solid var(--glass-edge);
  border-radius: 99px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  backdrop-filter: blur(24px) saturate(190%);
  box-shadow: var(--glass-shine), var(--glass-shadow);
  color: var(--label);
  font-size: 0.882rem;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -16px) scale(0.94);
  transition: opacity 0.25s, transform 0.45s var(--spring);
  pointer-events: none;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* ---------- sign-in, setup and joining ---------- */

.auth {
  max-width: 440px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 64px) max(20px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  text-align: center;
}
.auth .group,
.auth .privacy,
.auth .card {
  text-align: left;
}
.app-icon {
  display: block;
  margin: 0 auto 22px;
  border-radius: 22.5%;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--tint) 30%, transparent), 0 2px 6px rgba(0, 0, 0, 0.12);
}
.auth-title {
  margin: 0 0 8px;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.15;
}
.auth-body {
  margin: 0 0 30px;
  color: var(--label-2);
}
.auth-actions {
  display: grid;
  gap: 12px;
  margin: 8px 0 20px;
}
.auth-actions p {
  margin: 0;
}
.auth-actions .form-error {
  margin: 0;
}
.auth-help {
  margin: 0 0 28px;
}
.success-mark {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--tint-2), var(--tint));
  color: var(--on-tint);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--tint) 40%, transparent);
  animation: pop 0.6s var(--spring);
}
.success-mark .icon {
  width: 44px;
  height: 44px;
  stroke-width: 2.6;
}
.install h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
}
.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.94rem;
}
.steps .icon {
  color: var(--tint-ink);
}

.privacy {
  max-height: 46vh;
  overflow-y: auto;
  margin: 0 0 20px;
  padding: 18px;
  border-radius: var(--r-card);
  background: var(--card);
}
.sheet .privacy {
  max-height: none;
}
.privacy h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 700;
}
.privacy h3 {
  margin: 0 0 2px;
  font-size: 0.882rem;
  font-weight: 600;
}
.privacy p {
  margin: 0;
  font-size: 0.882rem;
  color: var(--label-2);
}
.privacy-part + .privacy-part {
  margin-top: 12px;
}

.version {
  margin: 0;
  text-align: center;
  font-size: 0.765rem;
  color: var(--label-3);
}

/* ---------- Apple Pay: to sort, guide ---------- */

.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0 0 18px;
  padding: 14px 18px;
  border: 0;
  text-align: left;
}
.banner:active {
  background: var(--fill-2);
}
.banner-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--tint-2), var(--tint));
  color: var(--on-tint);
  font-family: var(--rounded);
  font-weight: 700;
}
.banner-text {
  flex: 1;
  min-width: 0;
}
.sort-card {
  margin-bottom: 14px;
  padding: 16px 16px 4px;
}
.sort-card .chip-grid {
  padding: 12px 0 10px;
}
.sort-head strong {
  font-weight: 600;
}
.card .btn {
  margin-top: 14px;
}
.guide {
  margin: 0 0 20px;
  padding: 0 0 0 1.5em;
}
.guide li {
  margin: 0 0 16px;
  padding-left: 4px;
  font-size: 0.94rem;
}
.guide li::marker {
  color: var(--tint-ink);
  font-family: var(--rounded);
  font-weight: 700;
}
.guide .copy-box,
.guide .kv,
.guide p {
  margin-top: 8px;
}
.copy-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 8px 8px 8px 14px;
  border-radius: 16px;
  background: var(--card);
}
.card .copy-box {
  background: var(--fill-2);
}
.copy-box code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.8rem;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 99px;
  background: var(--tint-soft);
  color: var(--tint-ink);
  font-size: 0.82rem;
  font-weight: 600;
}
.copy-btn .icon {
  width: 1rem;
  height: 1rem;
}
.kv {
  width: 100%;
  border-collapse: collapse;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
  font-size: 0.85rem;
}
.kv th,
.kv td {
  padding: 9px 14px;
  text-align: left;
}
.kv th {
  font-weight: 500;
  color: var(--label-2);
  font-size: 0.75rem;
}
.kv tbody tr td {
  border-top: 0.5px solid var(--sep);
}
.kv code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ---------- consultant: dashboard, charts, notes ---------- */

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 22px;
}
.summary-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  border: 0;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  text-align: left;
  min-width: 0;
  transition: transform 0.25s var(--spring), box-shadow 0.2s;
}
.summary-tile .tile {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}
.summary-tile .tile .icon {
  width: 17px;
  height: 17px;
}
.summary-tile .num {
  font-family: var(--rounded);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.summary-tile .lbl {
  font-size: 0.74rem;
  color: var(--label-2);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.summary-tile.on {
  box-shadow: inset 0 0 0 2.5px var(--tint);
}
.summary-tile:active {
  transform: scale(0.96);
}
.search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 18px;
  padding: 0 14px;
  min-height: 42px;
  border-radius: 999px;
  background: var(--fill-2);
  color: var(--label-2);
}
.search-icon {
  width: 1.1rem;
  height: 1.1rem;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  color: var(--label);
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder {
  color: var(--label-2);
}
.client-row .row-trailing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.flags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.spark {
  width: 51px;
  height: 22px;
}
.spark-bar {
  fill: var(--tint);
}
.spark-over {
  fill: var(--red);
}
.spark-empty {
  fill: var(--fill);
}
.chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 4px;
}
.bar-ok {
  fill: var(--tint);
}
.bar-over {
  fill: var(--red);
}
.chart-budget {
  stroke: var(--label-2);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
.chart-label {
  fill: var(--label-2);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
}
.card.note-card {
  margin-bottom: 14px;
}
.note-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.note-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.note-meta {
  margin-top: 10px;
  font-size: 0.765rem;
  color: var(--label-2);
}
button.card:not(.banner) {
  display: block;
  width: 100%;
  border: 0;
  text-align: left;
}
button.card:active {
  background: var(--fill-2);
}
.note-text {
  width: 100%;
  min-height: 10rem;
  border: 0;
  border-radius: var(--r-card);
  padding: 16px 18px;
  background: var(--card);
  resize: vertical;
  outline: none;
  line-height: 1.35;
}
.unread-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tint);
  box-shadow: 0 0 0 4px var(--tint-soft);
  flex: none;
}
.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tpl-picker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}
.tpl-picker::-webkit-scrollbar {
  display: none;
}
.tpl-picker .chip {
  flex: none;
}

/* ---------- motion ---------- */

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}
@keyframes sheet-down {
  to {
    transform: translateY(110%);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes alert-in {
  from {
    opacity: 0;
    transform: scale(1.15);
  }
}
@keyframes push-in {
  from {
    opacity: 0;
    transform: translateX(14%);
  }
}
@keyframes grow {
  from {
    transform: scaleX(0);
  }
}
@keyframes ring-in {
  from {
    stroke-dashoffset: var(--c0);
  }
}
@keyframes pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  dialog::backdrop {
    animation: none !important;
    transition: none !important;
  }
}
/* Glass needs a backdrop filter; without one, or with Reduce Transparency on, use solid surfaces. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --glass: var(--card);
    --glass-strong: var(--card);
  }
}
@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass: var(--card);
    --glass-strong: var(--card);
  }
}

/* ---------- goals ---------- */

.goal-wrap {
  margin: 0 0 18px;
}
.goal-wrap .goal-card {
  margin: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.goal-card {
  display: block;
  width: 100%;
  border: 0;
  text-align: left;
}
.goal-card .ring-fill {
  stroke: var(--c);
}
.goal-top {
  display: flex;
  align-items: center;
  gap: 16px;
}
.goal-ring-icon {
  display: grid;
  place-items: center;
  color: var(--c);
}
.goal-ring-icon .icon {
  width: 24px;
  height: 24px;
}
.goal-text {
  flex: 1;
  min-width: 0;
}
.goal-name {
  font-size: 1.05rem;
  font-weight: 700;
  overflow-wrap: break-word;
}
.goal-amounts {
  margin-top: 2px;
  font-family: var(--rounded);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.goal-plan {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--c) 13%, transparent);
  color: color-mix(in srgb, var(--c) 75%, var(--label));
  font-size: 0.882rem;
  font-weight: 600;
}
.goal-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.goal-done .icon {
  width: 1.1rem;
  height: 1.1rem;
  stroke-width: 2.6;
}
.goal-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-top: 0.5px solid var(--sep);
  border-radius: 0 0 var(--r-card) var(--r-card);
  background: var(--card);
  color: var(--tint-ink);
  font-weight: 600;
}
.goal-add:active {
  background: var(--fill-2);
}
.goal-add .icon {
  width: 1.15rem;
  height: 1.15rem;
  stroke-width: 2.4;
}

/* ---------- month in review ---------- */

.review-btn {
  min-height: 44px;
  margin: 0 0 18px;
}
.review-btn .icon {
  width: 1.2rem;
  height: 1.2rem;
}
.banner-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(180deg, #7d84f2, #5b63e8);
  color: #fff;
}
.banner-icon .icon {
  width: 20px;
  height: 20px;
}
.hero-body.top {
  margin-top: 0;
}
.stat-value.big {
  font-size: 1.9rem;
  line-height: 1.1;
}
.cmp-row {
  margin-top: 12px;
}
.cmp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.882rem;
  font-weight: 600;
}
.cmp .icon {
  width: 1rem;
  height: 1rem;
  stroke-width: 2.6;
}
.cmp.down {
  color: var(--green);
}
.cmp.up {
  color: var(--red-ink);
}
.cmp.same {
  color: var(--label-2);
}
.rank {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--fill-2);
  font-family: var(--rounded);
  font-weight: 700;
}
.summary-body .group-header {
  margin-top: 6px;
}
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-row .section-title {
  margin-bottom: 10px;
}
.glass-btn.small {
  width: 36px;
  height: 36px;
  margin-top: 20px;
}
.glass-btn.small .icon {
  width: 18px;
  height: 18px;
}
.pad {
  margin: 0 4px 18px;
}

/* ---------- printable report ---------- */

.report {
  padding: calc(env(safe-area-inset-top) + 16px) max(16px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.report-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.report-bar .btn {
  flex: 1;
  min-height: 44px;
}
.report-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 4px 22px;
}
.report-head h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}
.report-head p {
  margin: 2px 0 0;
  font-size: 0.82rem;
}
.report-logo {
  border-radius: 22.5%;
  flex: none;
}
.table-card {
  padding: 6px 4px;
  overflow-x: auto;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.report-table th,
.report-table td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.report-table th {
  color: var(--label-2);
  font-weight: 600;
  font-size: 0.72rem;
}
.report-table tbody td {
  border-top: 0.5px solid var(--sep);
}
.report-table .num {
  text-align: right;
  white-space: nowrap;
  font-family: var(--rounded);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.report .version {
  margin-top: 24px;
}

@media print {
  :root {
    --bg: #fff;
    --card: #fff;
    --label: #000;
    --label-2: #555;
    --sep: #ddd;
    --fill-2: #eee;
    --card-shadow: none;
  }
  body::before,
  .no-print,
  .tabbar,
  .nav {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .report {
    padding: 0;
  }
  .card,
  .group-body {
    border: 0.5px solid #ddd;
    break-inside: avoid;
  }
  .table-card {
    overflow: visible;
  }
  .report-table tr {
    break-inside: avoid;
  }
  * {
    animation: none !important;
    transition: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
a.row {
  color: inherit;
  text-decoration: none;
}
.report-table .nowrap {
  white-space: nowrap;
}
.report-table td {
  overflow-wrap: break-word;
  hyphens: auto;
}
