/* Reasontra — admin-dashboard style UI */
:root {
  color-scheme: light;
  --brand: #E85C1A;
  --brand-600: #E85C1A;
  --brand-50: #FFF3EC;
  --brand-100: #FFE3D3;
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #F1F3F6;
  --text: #111827;
  --text-2: #374151;
  --muted: #6B7280;
  --line: #E5E7EB;
  --line-2: #EEF0F3;
  --income: #1F7A4D;
  --income-bg: #E8F5EE;
  --spend: #E85C1A;
  --spend-bg: #FDEEE6;
  --save: #4F46C8;
  --save-bg: #EEEDFB;
  --debt: #8A5A00;
  --debt-bg: #FBF2DE;
  --warn: #B42318;
  --warn-bg: #FEECEB;
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4; --c-other: #9CA3AF;
  --bill: #B4235F; --bill-bg: #FCE8F0; --lent: #1D6FB8; --lent-bg: #E4EFFA; --bal: #0E7490; --bal-bg: #E0F2F6;
  --ok: #1F7A4D;
  --ok-bg: #E8F5EE;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .14);
  --r: 12px;
  --r-sm: 8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Sinhala", "Noto Sans Tamil", sans-serif;
  --side-w: 256px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --brand: #F07033; --brand-600: #FF8A4F; --brand-50: #2A1A12; --brand-100: #3A2214;
    --bg: #0E1116; --surface: #161A21; --surface-2: #1D232C; --text: #F3F4F6; --text-2: #D1D5DB; --muted: #9CA3AF;
    --line: #262D38; --line-2: #212833;
    --income: #2F9862; --income-bg: #12291D; --spend: #D9622B; --spend-bg: #2E1A10; --save: #7A73E3; --save-bg: #1E1D3A;
    --debt: #D9A441; --debt-bg: #2B230F; --warn: #F97066; --warn-bg: #351716; --ok: #3FB27A; --ok-bg: #12291D; --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c-other: #6B7280; --bill: #EC6A9E; --bill-bg: #36131F; --lent: #5AA2E6; --lent-bg: #13243A; --bal: #3BB3CF; --bal-bg: #0F2A31;
    --shadow-sm: none; --shadow: 0 10px 30px -14px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #F07033; --brand-600: #FF8A4F; --brand-50: #2A1A12; --brand-100: #3A2214;
  --bg: #0E1116; --surface: #161A21; --surface-2: #1D232C; --text: #F3F4F6; --text-2: #D1D5DB; --muted: #9CA3AF;
  --line: #262D38; --line-2: #212833;
  --income: #2F9862; --income-bg: #12291D; --spend: #D9622B; --spend-bg: #2E1A10; --save: #7A73E3; --save-bg: #1E1D3A;
  --debt: #D9A441; --debt-bg: #2B230F; --warn: #F97066; --warn-bg: #351716; --ok: #3FB27A; --ok-bg: #12291D; --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c-other: #6B7280; --bill: #EC6A9E; --bill-bg: #36131F; --lent: #5AA2E6; --lent-bg: #13243A; --bal: #3BB3CF; --bal-bg: #0F2A31;
  --shadow-sm: none; --shadow: 0 10px 30px -14px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; min-height: 100svh; overflow-x: clip; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.num, .tbl td.n, .kpi-val { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
svg.ri { width: 18px; height: 18px; flex: none; }
.ri .f { fill: currentColor; opacity: .2; stroke: none; }

.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-mark, .logo-mark {
  width: 34px; height: 34px; border-radius: 28%; background: var(--brand); color: #fff; display: block; flex: none; overflow: hidden;
}
.boot-mark svg, .logo-mark svg { display: block; width: 100%; height: 100%; }
.boot-mark { width: 56px; height: 56px; }
/* the wordmark: reasontra. in lower case, the full stop in brand orange */
.logo-word { font-size: 1.13em; font-weight: 800; letter-spacing: -.035em; white-space: nowrap; }
.logo-word b { color: var(--brand); font-weight: 800; }

/* ---------- buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border-radius: var(--r-sm); border: 1px solid transparent; background: var(--brand); color: #fff; font-weight: 600; font-size: .925rem;
  white-space: nowrap; text-decoration: none; box-shadow: var(--shadow-sm);
}
/* the brand orange #E85C1A, a touch darker only while the pointer is on the button */
.btn:hover { background: color-mix(in srgb, var(--brand) 91%, #000); text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--text-2); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--text-2); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--surface); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.btn.danger:hover { background: var(--warn-bg); }
.btn.block { width: 100%; white-space: normal; }
.btn.sm { min-height: 32px; padding: 5px 12px; font-size: .85rem; }
.btn.lg { min-height: 46px; padding: 10px 22px; font-size: 1rem; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 17px; height: 17px; }
.icon-btn { width: 36px; height: 36px; border-radius: var(--r-sm); border: 0; background: transparent; display: inline-grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: .85rem; font-weight: 600; margin: 0 0 6px; color: var(--text-2); }
.field small { display: block; color: var(--muted); font-size: .8rem; margin-top: 5px; }
.input, .field input, .field select, .field textarea {
  display: block; width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm);
}
.field textarea { min-height: 88px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.check { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; font-size: .925rem; color: var(--text-2); }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.row2 input { min-width: 0; }
.err-msg { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: var(--r-sm); margin: 0 0 14px; font-size: .9rem; }
.ok-msg { background: var(--ok-bg); color: var(--ok); padding: 10px 12px; border-radius: var(--r-sm); margin: 0 0 14px; font-size: .9rem; }

.seg { display: flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--line-2); }
.seg button { flex: 1; min-height: 34px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; font-size: .875rem; color: var(--muted); padding: 0 10px; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .875rem; font-weight: 500; color: var(--text-2); }
.chip:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.chip[aria-pressed="true"] { background: var(--brand-50); border-color: var(--brand); color: var(--brand-600); font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge svg { width: 12px; height: 12px; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.brand { background: var(--brand-50); color: var(--brand-600); }
.badge.income { background: var(--income-bg); color: var(--income); }
.badge.expense { background: var(--spend-bg); color: var(--spend); }
.badge.saving { background: var(--save-bg); color: var(--save); }
.badge.debt { background: var(--debt-bg); color: var(--debt); }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }

/* ---------- public pages ---------- */
.pub { min-height: 100dvh; display: flex; flex-direction: column; }
.pub-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; max-width: 1200px; width: 100%; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -.01em; text-decoration: none; }
.logo:hover { text-decoration: none; }
.pub-top nav { display: flex; gap: 8px; }
.pub-main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px 24px 64px; }
.hero { display: grid; gap: 40px; align-items: center; padding: 24px 0 8px; }
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 16px; font-weight: 800; max-width: 15ch; }
.hero p { font-size: 1.125rem; color: var(--muted); max-width: 48ch; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.preview { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 18px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-weight: 700; }
.preview .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 12px; }
.features { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); margin: 56px 0 0; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.feature .fi { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin-bottom: 12px; }
.feature .fi svg { width: 20px; height: 20px; }
.feature h3 { font-size: 1rem; margin: 0 0 6px; }
.feature p { margin: 0; color: var(--muted); font-size: .925rem; }
.pub-foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px; }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.1fr .9fr; }
  .features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.auth { display: grid; place-items: start center; padding: 24px 0; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 28px 24px; }
.auth-card h1 { font-size: 1.5rem; margin: 0 0 4px; letter-spacing: -.02em; }
.auth-card .sub { color: var(--muted); margin: 0 0 22px; }
.auth-alt { text-align: center; margin: 18px 0 0; color: var(--muted); font-size: .925rem; }

/* ---------- app layout ---------- */
.layout { min-height: 100dvh; }
.sidebar { display: none; }
.content { min-width: 0; }
.appbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; justify-content: space-between;
  height: 60px; padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.appbar .logo-text { display: none; }
.book-switch {
  display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); text-align: left; color: var(--text);
}
.book-switch:hover { background: var(--surface-2); }
.book-switch .bs-t { min-width: 0; flex: 1; }
.book-switch .bs-name { display: block; font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-switch .bs-sub { display: block; font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-switch svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.appbar .book-switch { flex: 1; max-width: 260px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-100); color: var(--brand-600); display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; border: 0; }

.main { padding: 18px 14px calc(var(--tab-h) + var(--safe-b) + 28px); max-width: 1320px; margin: 0 auto; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: .7rem; font-weight: 600; text-decoration: none; padding: 6px 0; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--brand); }
.tabbar .fab { justify-self: center; width: 52px; height: 52px; border-radius: 16px; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px -8px var(--brand); }
.tabbar .fab svg { width: 26px; height: 26px; }

/* tablet: icon rail */
@media (min-width: 768px) {
  .layout { display: grid; grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    padding: 14px 12px; background: var(--surface); border-right: 1px solid var(--line);
  }
  .sidebar .logo { justify-content: center; padding: 4px 0 12px; }
  .sidebar .logo-text, .sidebar .nav-t, .sidebar .su-t, .sidebar .su-chev { display: none; }
  .sidebar .side-book { justify-content: center; padding: 10px 0; margin: 0 0 8px; }
  .sidebar .side-book .bs-t, .sidebar .side-book svg { display: none; }
  .sidebar .side-book .dot { width: 14px; height: 14px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav a { display: flex; align-items: center; justify-content: center; gap: 12px; height: 42px; border-radius: 10px; color: var(--text-2); font-weight: 500; text-decoration: none; position: relative; }
  .side-nav a svg { width: 20px; height: 20px; color: var(--muted); }
  .side-nav a:hover { background: var(--surface-2); }
  .side-nav a[aria-current="page"] { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
  .side-nav a[aria-current="page"] svg { color: var(--brand); }
  .side-user { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 6px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); text-align: left; width: 100%; border-radius: 0; }
  .side-user:hover { background: var(--surface-2); border-radius: 10px; }
  .appbar { display: none; }
  .tabbar { display: none; }
  .main { padding: 24px 24px 48px; }
}
/* desktop: full sidebar */
@media (min-width: 1100px) {
  .layout { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .sidebar { padding: 18px 14px; }
  .sidebar .logo { justify-content: flex-start; padding: 2px 8px 16px; }
  .sidebar .logo-text, .sidebar .nav-t, .sidebar .su-t { display: inline; }
  .sidebar .su-chev { display: block; }
  .sidebar .side-book { justify-content: flex-start; padding: 6px 10px; margin: 0 0 14px; }
  .sidebar .side-book .bs-t, .sidebar .side-book svg { display: block; }
  .sidebar .side-book .dot { width: 10px; height: 10px; }
  .side-nav a { justify-content: flex-start; padding: 0 12px; }
  .side-nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
  .side-user { justify-content: flex-start; padding: 10px 8px; }
  .side-user .su-t { display: block; min-width: 0; flex: 1; }
  .side-user .su-t b { display: block; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-user .su-t span { display: block; font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main { padding: 28px 32px 48px; }
}

/* ---------- page header ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 0 0 20px; }
.ph h1 { font-size: 1.5rem; line-height: 1.25; margin: 0; letter-spacing: -.02em; font-weight: 700; }
.ph p { margin: 4px 0 0; color: var(--muted); font-size: .925rem; }
.ph-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.month-pick { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-sm); height: 40px; }
.month-pick .icon-btn { width: 36px; height: 38px; border-radius: 0; }
.month-pick .lbl { font-weight: 600; font-size: .9rem; padding: 0 8px; min-width: 9em; text-align: center; white-space: nowrap; border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); line-height: 38px; }
@media (max-width: 767px) {
  .ph { align-items: flex-start; }
  .ph h1 { font-size: 1.3rem; }
  .ph-tools { width: 100%; }
  .ph-tools .month-pick { flex: 1; justify-content: space-between; }
  .ph-tools .add-btn { display: none; }
}

.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--r-sm); background: var(--brand-50); color: var(--text-2); font-size: .9rem; margin: 0 0 16px; border: 1px solid var(--brand-100); }
.banner svg { width: 18px; height: 18px; color: var(--brand); }

/* ---------- KPI cards ---------- */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 18px; }
@media (min-width: 1000px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.kpi-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.kpi-label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.kpi-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.kpi-ico svg { width: 16px; height: 16px; }
.kpi-ico.income { background: var(--income-bg); color: var(--income); }
.kpi-ico.expense { background: var(--spend-bg); color: var(--spend); }
.kpi-ico.saving { background: var(--save-bg); color: var(--save); }
.kpi-ico.balance { background: var(--brand-50); color: var(--brand); }
.kpi-val { font-size: clamp(1.2rem, 2.6vw, 1.65rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.kpi-val.neg { color: var(--warn); }
.kpi-sub { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.kpi .meter { margin-top: 10px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 12px; }
.card-head h2 { font-size: 1rem; margin: 0; font-weight: 650; }
.card-head .sub { font-size: .8rem; color: var(--muted); font-weight: 500; }
.card-head a { font-size: .85rem; font-weight: 600; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }
.card + .card { margin-top: 16px; }

.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; margin: 0 !important; }
@media (min-width: 1000px) {
  .grid.g2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid.g32 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}
.col { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-content: start; }
.col > * { margin: 0 !important; }

/* flow bar on the balance card */
.flow { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.flow i { display: block; height: 100%; min-width: 0; }

/* progress meters */
.meter { position: relative; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter > i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--spend); }
.meter.income > i { background: var(--income); }
.meter.saving > i { background: var(--save); }
.meter.over > i { background: repeating-linear-gradient(135deg, var(--warn) 0 6px, color-mix(in srgb, var(--warn) 65%, var(--surface)) 6px 10px); }

.bars { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.bar-row { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
.bar-top { display: flex; align-items: baseline; gap: 8px; justify-content: space-between; }
.cat { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 550; }
.ci { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--spend-bg); color: var(--spend); }
.ci svg { width: 18px; height: 18px; }
.ci.k-income { background: var(--income-bg); color: var(--income); }
.ci.k-bill { background: var(--bill-bg); color: var(--bill); }
.ci.k-saving { background: var(--save-bg); color: var(--save); }
.ci.k-debt { background: var(--debt-bg); color: var(--debt); }
.cat .ct { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bar-top .amt { font-size: .875rem; white-space: nowrap; color: var(--muted); }
.bar-top .amt b { color: var(--text); font-weight: 650; }
.bar-note { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.bar-note.over { color: var(--warn); font-weight: 600; }
.bar-note svg { width: 14px; height: 14px; }

.rank { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.rank-row .v { text-align: right; font-weight: 650; font-size: .9rem; white-space: nowrap; }
.rank-row .v small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.rank-row .meter { grid-column: 1 / -1; height: 6px; }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
/* the day chart on phones: every day readable, swiped sideways */
.chart-swipe { overflow-x: auto; overflow-y: hidden; margin: 0 -4px; padding: 0 4px 2px; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.chart-swipe .chart svg { width: 100%; }
.swipe-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 0; font-size: .78rem; color: var(--muted); }
/* a finger that slides left and right: this chart moves sideways */
.sw-hand { position: relative; width: 34px; height: 14px; flex: none; }
.sw-hand::before { content: ""; position: absolute; left: 2px; right: 2px; top: 6px; height: 2px; border-radius: 2px; background: var(--line); }
.sw-hand i { position: absolute; top: 2px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); animation: sw-slide 1.8s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes sw-slide { 0%, 100% { transform: translateX(22px); } 50% { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .sw-hand i { animation: none; } }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid line { stroke: var(--line-2); stroke-width: 1; }
.chart .hit { fill: transparent; }
.tip { position: absolute; left: 0; top: 0; pointer-events: none; background: #111827; color: #fff; padding: 8px 10px; border-radius: 8px; font-size: .8rem; line-height: 1.4; transform: translate(-50%, -110%); white-space: nowrap; z-index: 5; display: none; }
.tip.on { display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--muted); margin: 0 0 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .75rem; font-weight: 600; color: var(--muted); padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.tbl .n { text-align: right; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-left: 18px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 18px; }
@media (min-width: 1400px) { .tbl .note-c .clip { max-width: 40ch; } }
.tbl th.n { text-align: right; }
.tbl .note-c { color: var(--muted); }
.tbl .note-c .clip { display: block; max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .cat .ct { max-width: 26ch; }
.tbl .date-c { white-space: nowrap; color: var(--text-2); }
.tbl tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; }
.tbl .acts { text-align: right; white-space: nowrap; }
.amt-income { color: var(--income); font-weight: 650; }
.amt-expense { color: var(--text); font-weight: 650; }
.amt-saving { color: var(--save); font-weight: 650; }
.amt-debt { color: var(--debt); font-weight: 650; }
.tbl tr.day-row td { background: var(--surface-2); font-size: .8rem; font-weight: 600; color: var(--muted); padding: 7px 18px; }

/* phone: tables become stacked rows */
@media (max-width: 767px) {
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tfoot { display: block; }
  .tbl.stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
  .tbl.stack tr.day-row { display: block; padding: 0; }
  .tbl.stack tr.day-row td { display: block; padding: 7px 16px; }
  .tbl.stack td { display: block; padding: 0; border: 0; }
  .tbl.stack td.c-main { grid-column: 1; grid-row: 1; }
  .tbl.stack td.c-amt { grid-column: 2; grid-row: 1; text-align: right; }
  .tbl.stack td.c-sub { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); max-width: none; }
  .tbl.stack td.c-sub .clip { max-width: none; white-space: normal; }
  .tbl.stack td.c-sub.n { text-align: left; }
  .tbl.stack tr.click:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
  .tbl.stack tr.click:hover td { background: transparent; }
  .tbl.stack td.note-c:has(.clip:empty) { display: none; }
  .tbl.stack td.c-hide { display: none; }
  .tbl.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-weight: 500; }
  .tbl.stack td.c-amt[data-label]::before, .tbl.stack td.c-main[data-label]::before { content: none; }
  .tbl.stack td.acts { grid-column: 1 / -1; text-align: left; padding-top: 6px; }
  .tbl.stack tfoot { display: none; }
}

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .e-ico { width: 48px; height: 48px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin: 0 auto 12px; }
.empty .e-ico svg { width: 24px; height: 24px; }
.empty p { margin: 0 0 14px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.toolbar .search { position: relative; flex: 1 1 240px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.toolbar .search input { padding-left: 34px; min-height: 38px; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: 0; }
.list-row .t { flex: 1; min-width: 0; }
.list-row .t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .t span { display: block; font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* plan */
.plan-amt { border: 1px dashed var(--line); background: var(--surface); border-radius: 8px; padding: 5px 10px; font-weight: 650; min-width: 96px; text-align: right; color: var(--text); }
.plan-amt:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-600); }
.plan-amt.unset { color: var(--muted); font-weight: 500; }
.plan-amt:disabled { cursor: default; }
.cat-btn { border: 0; background: none; padding: 0; text-align: left; color: inherit; min-width: 0; max-width: 100%; }
.cat-btn:hover .ct { text-decoration: underline; }
.tbl .meter-c { min-width: 120px; }
@media (min-width: 768px) {
  .plan-tbl { table-layout: fixed; }
  .plan-tbl th:nth-child(1) { width: 34%; } .plan-tbl th:nth-child(2) { width: 16%; } .plan-tbl th:nth-child(3), .plan-tbl th:nth-child(4) { width: 15%; }
  .plan-tbl td { overflow: hidden; }
}
@media (max-width: 767px) {
  .tbl.stack td.c-plan { grid-column: 2; grid-row: 1; }
  /* Budget plan on phones: Actual on the left, Remaining on the right of the same line */
  .plan-tbl.stack td.c-act { grid-column: 1; grid-row: 2; }
  .plan-tbl.stack td.c-rem { grid-column: 2; grid-row: 2; text-align: right; white-space: nowrap; }
  .plan-tbl.stack td.c-rem.is-over::before { color: var(--warn); }
  .tbl.stack td.meter-c { grid-column: 1 / -1; width: auto; padding-top: 6px; }
}

/* notes */
.note-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.note-row:last-child { border-bottom: 0; }
.note-row input[type="checkbox"] { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex: none; }
.note-row .t { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; }
.note-row.done .t { color: var(--muted); text-decoration: line-through; }
.note-row .d { font-size: .78rem; color: var(--muted); display: block; margin-top: 2px; text-decoration: none; }
details.card > summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 1.2rem; }
details.card[open] > summary { border-bottom: 1px solid var(--line-2); }
details.card[open] > summary::after { content: "–"; }

/* settings */
.set-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .set-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.card-body > p.desc { margin: -4px 0 14px; color: var(--muted); font-size: .9rem; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- menus & sheets ---------- */
.menu { position: absolute; z-index: 90; min-width: 240px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 8px; text-align: left; color: var(--text); font-size: .9rem; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); }
.menu button[aria-current="true"] { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 6px 0; }
.menu .sub { margin-left: auto; font-size: .72rem; color: var(--muted); }

.scrim { position: fixed; inset: 0; z-index: 100; background: rgba(17, 24, 39, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease-out; }
.sheet { width: 100%; min-width: 0; max-width: 480px; max-height: 94dvh; overflow: auto; background: var(--surface); border-radius: 18px 18px 0 0; padding: 8px 20px calc(20px + var(--safe-b)); animation: rise .2s cubic-bezier(.2, .8, .2, 1); }
.sheet .grab { width: 38px; height: 4px; border-radius: 9px; background: var(--line); margin: 2px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 16px; }
.sheet-head h2 { font-size: 1.1rem; margin: 0; font-weight: 700; }
.sheet-foot { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.sheet-foot .btn { flex: 1; }
@media (min-width: 700px) {
  .scrim { align-items: center; padding: 20px; }
  .sheet { border-radius: 16px; padding: 20px 24px 24px; box-shadow: var(--shadow); }
  .sheet .grab { display: none; }
}
@keyframes rise { from { transform: translateY(20px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* quick add */
.qa-kinds button[data-k="expense"][aria-pressed="true"] { color: var(--spend); }
.qa-kinds button[data-k="income"][aria-pressed="true"] { color: var(--income); }
.qa-kinds button[data-k="saving"][aria-pressed="true"] { color: var(--save); }
.qa-kinds button[data-k="debt"][aria-pressed="true"] { color: var(--debt); }
.qa-amount { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 18px 0 2px; min-height: 58px; }
.qa-amount .cur { font-size: 1.1rem; font-weight: 600; color: var(--muted); }
.qa-amount input { border: 0; background: transparent; text-align: center; width: 100%; max-width: 330px; padding: 0; font-size: clamp(2.2rem, 11vw, 3rem); font-weight: 750; letter-spacing: -.03em; line-height: 1.1; color: var(--text); caret-color: var(--brand); font-variant-numeric: tabular-nums; }
@supports (field-sizing: content) { .qa-amount input { field-sizing: content; width: auto; min-width: 1.2ch; max-width: 100%; text-align: left; } }
.qa-amount input:focus { outline: none; }
.qa-amount input::placeholder { color: var(--line); }
.qa[data-k="expense"] .qa-amount input { color: var(--spend); }
.qa[data-k="income"] .qa-amount input { color: var(--income); }
.qa[data-k="saving"] .qa-amount input { color: var(--save); }
.qa[data-k="debt"] .qa-amount input { color: var(--debt); }
.qa-calc { text-align: center; min-height: 20px; font-size: .875rem; color: var(--muted); margin-bottom: 8px; }
.qa-section { margin: 14px 0 0; }
.qa-section > .lbl { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.cat-grid { display: flex; flex-wrap: wrap; gap: 6px; max-height: 164px; overflow: auto; padding: 2px; }
.qa-dates { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.qa-dates input[type="date"] { min-height: 34px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; background: var(--surface); font-size: .875rem; }
.qa .sheet-foot { position: sticky; bottom: calc(-20px - var(--safe-b)); margin: 16px -20px calc(-20px - var(--safe-b)); padding: 12px 20px calc(12px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line-2); }
@media (min-width: 700px) { .qa .sheet-foot { bottom: -24px; margin: 16px -24px -24px; padding: 12px 24px; border-radius: 0 0 16px 16px; } }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text); }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px; }
.tpl-grid button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; }
.tpl-grid button b { display: block; font-size: .9rem; }
.tpl-grid button span { font-size: .78rem; color: var(--muted); }
.tpl-grid button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-50); }

#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); transform: translate(-50%, 16px); z-index: 120; background: #111827; color: #fff; padding: 11px 16px; border-radius: 10px; font-weight: 500; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; max-width: calc(100vw - 32px); text-align: center; box-shadow: var(--shadow); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 768px) { #toast { bottom: 24px; } }

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

/* ---------- v1.3: simpler overview, tabs ---------- */
.card-head + .card-body { padding-top: 4px; }
.card-head + .card-body.flush { padding-top: 0; border-top: 1px solid var(--line-2); }
.crows { display: grid; grid-template-columns: minmax(0, 1fr); }
.crow { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line-2); grid-template-columns: minmax(0, 1fr); }
.crow:last-child { border-bottom: 0; }
.crow[hidden] { display: none; }
.crow-top { display: flex; align-items: center; gap: 8px; }
.crow-top .cat { flex: 1; }
.crow-amt { white-space: nowrap; text-align: right; }
.crow-amt b { font-weight: 650; }
.crow-amt small { color: var(--muted); margin-left: 6px; font-size: .78rem; display: inline-block; min-width: 2.6em; }
.crow .meter { height: 6px; margin-left: 40px; }
.crow-note { font-size: .8rem; color: var(--muted); margin-left: 40px; display: flex; align-items: center; gap: 5px; }
.crow-note.over { color: var(--warn); font-weight: 600; }
.crow-note svg { width: 13px; height: 13px; }
.more-btn { display: block; width: 100%; margin-top: 6px; padding: 10px; border: 1px dashed var(--line); border-radius: var(--r-sm); background: none; color: var(--brand-600); font-weight: 600; font-size: .875rem; }
.more-btn:hover { background: var(--brand-50); border-color: var(--brand-100); }
.seg-sm button { min-height: 30px; font-size: .8rem; }

.ptabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.ptab { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow-sm); min-width: 0; color: var(--text); position: relative; }
.ptab:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.ptab[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.ptab-name { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.ptab-name::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--spend); }
.ptab.income .ptab-name::before { background: var(--income); }
.ptab.saving .ptab-name::before { background: var(--save); }
.ptab.bill .ptab-name::before { background: var(--bill); }
.ptab-val { display: block; font-size: 1.1rem; font-weight: 700; margin: 4px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptab-sub { display: block; font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767px) { .ptabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.settings-tabs { margin: 0 0 16px; max-width: 640px; overflow-x: auto; }
.settings-col { max-width: 760px; }
@media (max-width: 600px) { .settings-tabs button { font-size: .78rem; padding: 0 6px; white-space: normal; line-height: 1.2; } }
.list-row.click { cursor: pointer; }
.list-row.click:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }

/* ---------- v1.4: drawn icons, spending overview ---------- */
.chip-i { width: 16px; height: 16px; }
.chip[aria-pressed="true"] .chip-i { color: var(--brand); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; margin: 0 0 12px; max-height: 196px; overflow: auto; padding: 2px; }
.icon-grid button { aspect-ratio: 1; border: 1px solid transparent; border-radius: 9px; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; padding: 0; }
.icon-grid button svg { width: 20px; height: 20px; }
.icon-grid button:hover { border-color: var(--line); }
.icon-grid button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-50); color: var(--brand-600); }

.home-grid { align-items: stretch; }
.home-grid > .card { display: flex; flex-direction: column; }
.home-grid > .card > .card-body { flex: 1; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { position: relative; width: 168px; height: 168px; flex: none; margin: 0 auto; }
.donut svg { width: 100%; height: 100%; display: block; }
.donut .slice { transition: opacity .15s; }
.donut svg:hover .slice { opacity: .55; }
.donut svg .slice:hover { opacity: 1; }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.donut-c b { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; max-width: 110px; overflow-wrap: anywhere; line-height: 1.2; }
.donut-c span { font-size: .75rem; color: var(--muted); }
.donut-legend { flex: 1; min-width: 210px; display: grid; gap: 2px; }
.dl-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 3.2em; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: .875rem; }
.dl-row:last-child { border-bottom: 0; }
.dl-row i { width: 10px; height: 10px; border-radius: 3px; }
.dl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-val { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dl-pct { color: var(--muted); font-size: .8rem; text-align: right; font-variant-numeric: tabular-nums; }
.donut-note { margin: 14px 0 0; font-size: .8rem; color: var(--muted); }
.donut-note .over { color: var(--warn); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.donut-note svg { width: 13px; height: 13px; }

/* ---------- v1.5 ---------- */
.su-chev { width: 16px; height: 16px; color: var(--muted); flex: none; }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 4px; }
.menu-head b { display: block; font-size: .9rem; }
.menu-head span span { display: block; font-size: .78rem; color: var(--muted); }
.menu-theme { display: flex; gap: 2px; padding: 3px; margin: 2px 4px; background: var(--surface-2); border-radius: 9px; }
.menu .menu-theme button { flex: 1; justify-content: center; padding: 6px 4px; font-size: .78rem; font-weight: 600; color: var(--muted); border-radius: 7px; }
.menu .menu-theme button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.1); }
.menu .menu-danger { color: var(--warn); }
.menu button svg { width: 17px; height: 17px; }

.card-head h2 a.card-title-link { color: inherit; text-decoration: none; font-size: inherit; font-weight: inherit; }
.card-head h2 a.card-title-link:hover { color: var(--brand-600); text-decoration: none; }
.pane-arrow { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.pane-arrow:hover { border-color: var(--brand); color: var(--brand-600); background: var(--brand-50); }
.pane-arrow svg { width: 18px; height: 18px; }
.cheer { display: flex; align-items: center; gap: 12px; margin: 12px 18px 4px; padding: 12px 14px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); }
.cheer svg { width: 26px; height: 26px; flex: none; }
.cheer b { display: block; font-size: .95rem; }
.cheer span { display: block; font-size: .85rem; color: var(--text-2); }
.cheer-page { margin: 0 0 16px; }
.list-row.paid-off .t b { color: var(--ok); }
.list-row.paid-off .t span { color: var(--text-2); }

.over-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: var(--warn-bg); color: var(--warn); font: inherit; font-weight: 600; padding: 2px 8px; border-radius: 999px; cursor: pointer; }
.over-btn svg { width: 13px; height: 13px; }
.over-btn .chev { transition: transform .15s; }
.over-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.over-list { margin-top: 10px; border: 1px solid color-mix(in srgb, var(--warn) 25%, var(--line)); border-radius: 10px; overflow: hidden; }
.over-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.over-row:last-child { border-bottom: 0; }
.over-row .cat { flex: 1; min-width: 0; }
.over-amt { text-align: right; white-space: nowrap; }
.over-amt b { display: block; color: var(--warn); font-size: .875rem; }
.over-amt span { display: block; font-size: .75rem; color: var(--muted); }

.chart .hit.click { cursor: pointer; }
.chart .sel-band { fill: var(--brand-50); }
.chart .axis text.today { font-weight: 700; fill: var(--text); }
.chart .axis text.sel { font-weight: 700; fill: var(--brand-600); }
.day-box { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.day-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.day-head b { flex: 1; font-size: .9rem; }
.day-head span { font-size: .85rem; color: var(--muted); }
.day-head .icon-btn { width: 30px; height: 30px; }
.day-list .list-row { padding: 9px 0; }

.date-field { display: inline-flex; max-width: 100%; }
.date-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 500; font-size: .875rem; box-shadow: var(--shadow-sm); max-width: 100%; }
.field .date-btn { border-radius: var(--r-sm); min-height: 42px; width: 100%; }
.date-btn:hover { border-color: var(--brand); }
.date-btn svg { width: 17px; height: 17px; color: var(--brand); flex: none; }
.date-btn .chev { width: 14px; height: 14px; color: var(--muted); margin-left: auto; }
.date-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp { position: fixed; z-index: 130; width: 296px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 10px; animation: fade .12s ease-out; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-head b { font-size: .95rem; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-names span { text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); padding: 4px 0; }
.dp-day { aspect-ratio: 1; border: 0; border-radius: 9px; background: none; color: var(--text); font-size: .875rem; font-variant-numeric: tabular-nums; }
.dp-day:hover { background: var(--surface-2); }
.dp-day.today { color: var(--brand-600); font-weight: 700; box-shadow: inset 0 0 0 1px var(--brand-100); }
.dp-day.sel { background: var(--brand); color: #fff; font-weight: 700; box-shadow: none; }
.dp-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); }

.drag-hint { font-weight: 400; color: var(--muted); font-size: .75rem; }
@media (pointer: coarse) { .drag-hint::after { content: " (hold, then drag)"; } }
.cat-grid { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.cat-grid .chip { cursor: grab; }
.cat-grid.dragging .chip { cursor: grabbing; }
.chip-placeholder { opacity: .35; border-style: dashed !important; }
.chip-ghost { position: fixed; left: 0; top: 0; z-index: 140; pointer-events: none; box-shadow: var(--shadow); background: var(--surface); border-color: var(--brand) !important; opacity: .95; }

.icon-search { position: relative; display: block; margin: 0 0 8px; }
.icon-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.field .icon-search input { padding-left: 32px; min-height: 38px; }

/* ---------- v1.6 ---------- */
.avatar { position: relative; }
.av-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--surface); }
.side-user .su-t span { display: flex; align-items: center; gap: 6px; }
.side-user .su-t .dot { width: 8px; height: 8px; }
.acct-btn { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 70vw; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); text-align: right; }
.acct-btn:hover { background: var(--surface-2); }
.acct-btn .bs-t { min-width: 0; }
.acct-btn .bs-name { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-weight: 600; font-size: .85rem; overflow: hidden; white-space: nowrap; }
.acct-btn .bs-name .dot { width: 8px; height: 8px; }
.acct-btn .bs-sub { display: block; font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { max-height: calc(100vh - 24px); overflow-y: auto; }
.menu-label { padding: 6px 10px 2px; font-size: .75rem; font-weight: 600; color: var(--muted); }
/* someone with many books (up to 30): the list scrolls inside the menu, so New book and Log out stay in view */
.menu-books.many { max-height: min(304px, 40vh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 18px), transparent); mask-image: linear-gradient(#000 calc(100% - 18px), transparent); padding-bottom: 6px; }
.menu .mb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu .sub { margin-left: 0; }
.menu .mb-check { color: var(--brand); width: 16px; height: 16px; }
.sub-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px 6px; font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.sub-head a { font-size: .78rem; font-weight: 600; }
.cheer-row { background: var(--ok-bg); }
.cheer-row .t b { color: var(--ok); white-space: normal; }
.cheer-row .t span { color: var(--text-2); }
.donut-c b.long { font-size: .9rem; }
.cheer-row .ci { background: var(--surface); }

/* ---------- v1.7 ---------- */
/* donut: hover / tap a slice to see what it is */
.donut .slice { cursor: pointer; transition: opacity .15s, stroke-width .15s; }
.donut svg:hover .slice { opacity: 1; }
.donut-wrap.focus .slice { opacity: .35; }
.donut-wrap.focus .slice.on { opacity: 1; stroke-width: 26px; }
.donut-c { padding: 0 34px; }
.donut-c em { font-style: normal; font-size: .75rem; font-weight: 600; color: var(--text-2); max-width: 104px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 2px; }
.dl-row.on { background: var(--surface-2); }
.dl-row { padding-left: 6px; padding-right: 6px; }

/* debts & bills: plain white section labels */
.sub-head { background: transparent; border-bottom: 0; padding: 14px 18px 2px; font-size: .75rem; font-weight: 600; color: var(--muted); }
.sub-head + .list-row { padding-top: 8px; }
.list-row + .sub-head { border-top: 1px solid var(--line-2); }

/* profile: only the avatar carries the book colour */
.side-user .su-t span { display: block; }

/* budget plan: no Status column */
.plan-notes { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 0 46px; }
.plan-notes .pn { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--muted); }
.plan-notes .pn svg { width: 13px; height: 13px; }
.plan-notes .pn.over { color: var(--warn); font-weight: 600; }
@media (min-width: 768px) {
  .plan-tbl th:nth-child(1) { width: auto; }
  .plan-tbl th:nth-child(2), .plan-tbl th:nth-child(3), .plan-tbl th:nth-child(4) { width: 19%; }
}

/* budget amount: quiet text button with a pencil; "Add budget" as a small brand link */
.plan-amt { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; border: 0; background: none; padding: 6px 8px; margin-right: -8px; border-radius: 8px; font: inherit; font-weight: 650; color: var(--text); white-space: nowrap; cursor: pointer; }
.plan-amt .pa-ico { width: 14px; height: 14px; color: var(--muted); opacity: 0; transition: opacity .12s; flex: none; }
.plan-amt:hover:not(:disabled) { background: var(--surface-2); color: var(--text); border-color: transparent; }
.plan-amt:hover:not(:disabled) .pa-ico, .plan-amt:focus-visible .pa-ico { opacity: 1; }
.plan-amt.unset { color: var(--brand-600); font-weight: 600; font-size: .85rem; }
.plan-amt.unset .pa-ico { opacity: 1; color: var(--brand); }
.plan-amt.unset:hover { background: var(--brand-50); color: var(--brand-600); }
@media (hover: none) { .plan-amt .pa-ico { opacity: 1; } }

/* icon picker: taken icons */
.icon-grid button.taken { opacity: .28; cursor: not-allowed; filter: grayscale(1); background: var(--surface-2); }
.icon-grid button.taken:hover { border-color: transparent; }
.icon-note { display: block; margin-top: 6px; color: var(--muted); font-size: .75rem; }
@media (max-width: 767px) { .ph-tools .cat-add-btn { flex: none; } }
.cat-group-note { display: flex; align-items: center; gap: 6px; margin: -4px 0 14px; font-size: .85rem; color: var(--muted); }
.cat-group-note svg { width: 15px; height: 15px; color: var(--brand); }
@media (max-width: 767px) { .plan-notes { margin-left: 0; } }

/* ---------- v1.8 ---------- */
.ci.k-lent { background: var(--lent-bg); color: var(--lent); }
.badge.lent { background: var(--lent-bg); color: var(--lent); }
.badge.bill { background: var(--bill-bg); color: var(--bill); }
.amt-lent { color: var(--lent); font-weight: 650; }
.btn.lent-btn { background: var(--lent); border-color: var(--lent); }
.btn.lent-btn:hover { filter: brightness(1.08); }

/* money overview: every item its own colour; a thin outer ring shows the type */
.donut .slice:focus { outline: none; }
.donut .slice:focus-visible { stroke-width: 26px; }
.donut .kind-arc { pointer-events: none; }
.donut-side { flex: 1; min-width: 220px; display: grid; gap: 8px; }
.kind-key { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .75rem; color: var(--muted); }
.kind-key .kk { display: inline-flex; align-items: center; gap: 6px; }
.kind-key .kk i { width: 14px; height: 4px; border-radius: 2px; background: var(--spend); }
.kk.k-bill i { background: var(--bill); } .kk.k-debt i { background: var(--debt); } .kk.k-saving i { background: var(--save); }
.dl-row { cursor: default; border-radius: 6px; padding: 7px 6px; transition: background .12s; }
.dl-row.on { background: var(--surface-2); }
.dl-row .dl-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dl-row .dl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kind-tag { flex: none; font-size: .68rem; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: var(--spend-bg); color: var(--spend); }
.kind-tag.k-bill { background: var(--bill-bg); color: var(--bill); }
.kind-tag.k-debt { background: var(--debt-bg); color: var(--debt); }
.kind-tag.k-saving { background: var(--save-bg); color: var(--save); }

/* Income / Spent / Saved switch above charts */
.series-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.series-pick button { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: .8rem; font-weight: 600; }
.series-pick button i { width: 9px; height: 9px; border-radius: 3px; }
.series-pick button:hover { background: var(--surface-2); }
.series-pick button[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: var(--surface); }

/* late payments */
.late { display: inline-flex !important; align-items: center; gap: 4px; margin-top: 3px; font-size: .75rem !important; font-weight: 600; color: var(--warn) !important; white-space: nowrap; }
.late svg { width: 13px; height: 13px; }
td .late { display: flex !important; }
.late-row { background: color-mix(in srgb, var(--warn-bg) 55%, transparent); }
.pay-head { display: flex; align-items: center; gap: 12px; padding: 12px; margin: 0 0 16px; border-radius: 12px; background: var(--surface-2); }
.pay-head b { display: block; }
.pay-head span { font-size: .82rem; color: var(--muted); }

/* debts page */
.debt-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 16px; }
.debt-sum .ds { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r, 14px); padding: 14px 18px; box-shadow: var(--shadow-sm); }
.debt-sum .ds span { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); font-weight: 600; }
.debt-sum .ds span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--debt); }
.debt-sum .ds.k-lent span::before { background: var(--lent); }
.debt-sum .ds b { display: block; font-size: 1.35rem; margin-top: 4px; letter-spacing: -.01em; }
.debt-sum .ds.k-debt b { color: var(--debt); } .debt-sum .ds.k-lent b { color: var(--lent); }
.debt-tbl .acts { white-space: nowrap; text-align: right; }
.debt-tbl .acts .btn svg { width: 15px; height: 15px; }

/* notebook */
.note-row { align-items: center; gap: 12px; padding: 12px 12px 12px 18px; }
.note-row input[type="checkbox"] { margin-top: 0; width: 20px; height: 20px; cursor: pointer; }
.note-row .nb { flex: 1; min-width: 0; cursor: pointer; display: grid; gap: 3px; }
.note-row .nt { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.note-row .nmeta { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.note-row .nm { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; color: var(--muted); }
.note-row .nm svg { width: 13px; height: 13px; }
.note-row .nm.late-d { color: var(--warn); font-weight: 600; }
.note-row.done .nt { color: var(--muted); text-decoration: line-through; }
.note-row .n-edit { flex: none; color: var(--muted); }
.note-row .n-edit svg { width: 16px; height: 16px; }
.note-row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
details.done-card > summary { justify-content: flex-start; gap: 10px; }
details.done-card > summary::after { content: none; }
details.done-card > summary .sum-chev { margin-left: auto; width: 18px; height: 18px; color: var(--muted); transition: transform .15s; }
details.done-card[open] > summary .sum-chev { transform: rotate(180deg); }
.sheet textarea { min-height: 110px; resize: vertical; }

/* reports */
.rep-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: -4px 0 18px; }
.rep-presets { flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; }
.rep-presets button { flex: none; }
.rep-bar .month-pick .lbl { min-width: 11em; }
.rep-lbl.static { font-weight: 600; }
.rep-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rep-custom .date-btn { min-height: 38px; }
.rank-row.zero { opacity: .55; }
.rep-tbl tr.click { cursor: pointer; }
.rep-tbl tr.click:hover td { background: var(--surface-2); }
.rep-tbl tr.empty-row td { color: var(--muted); }
.rep-grid { align-items: start; }
/* no box that scrolls on its own inside the page: on a phone or a tablet a swipe that starts in one scrolls only that
   box, stops at its end and springs back, so the page seems stuck */
.rep-tbl thead th { position: sticky; top: 0; z-index: 1; }
@media (max-width: 767px) {
  .rep-bar { flex-direction: column; align-items: stretch; }
  .rep-bar .month-pick { justify-content: space-between; }
  .rep-presets { width: 100%; }
  .debt-sum .ds b { font-size: 1.1rem; }
}

/* settings: full width like the other pages */
.settings-tabs { max-width: none; }
.settings-col { max-width: none; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.dl-group { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 6px 4px; font-size: .75rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.dl-group:first-child { padding-top: 0; }
.dl-group span { display: inline-flex; align-items: center; gap: 7px; }
.dl-group span::before { content: ""; width: 14px; height: 4px; border-radius: 2px; background: var(--spend); }
.dl-group.k-bill span::before { background: var(--bill); } .dl-group.k-debt span::before { background: var(--debt); } .dl-group.k-saving span::before { background: var(--save); }
.dl-group b { font-weight: 650; color: var(--text-2); }
.rep-tbl td, .rep-tbl th { white-space: nowrap; }

/* ---------- v1.9 ---------- */
.dl-row .dl-name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: visible; }
.dl-row .dl-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-row.extra { background: var(--surface-2); animation: dl-in .18s ease-out; }
@keyframes dl-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .dl-row.extra { animation: none; } }
.dl-other { color: var(--text-2); }
.dl-other .dots { display: grid; grid-template-columns: 4px 4px; gap: 2px; width: 10px; }
.dl-other .dots i { width: 4px !important; height: 4px !important; border-radius: 1px !important; }
.tip-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.sub-head .sh-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: var(--debt); }
.sub-head .sh-dot.k-lent { background: var(--lent); }
.sub-head > span { display: inline-flex; align-items: center; }
.sub-head > span + span { color: var(--text-2); font-weight: 650; }
.note-row .nm.today-d { color: var(--debt); font-weight: 600; }
.note-row .nm.due { color: var(--text-2); }
.note-row .nm.due.late-d { color: var(--warn); }

/* reports: one tidy bar — period type on the left, the period itself on the right */
.rep-bar { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 8px; margin: 0 0 18px; gap: 8px; }
.rep-bar .rep-presets { border: 0; background: var(--surface-2); }
.rep-bar .rep-presets button { min-height: 36px; padding: 0 14px; }
.rep-when { display: flex; align-items: center; justify-content: flex-end; min-height: 42px; }
.rep-when .month-pick { box-shadow: none; height: 42px; }
.rep-when .month-pick .icon-btn { height: 40px; }
.rep-when .month-pick .lbl { line-height: 40px; min-width: 12em; }
.rep-when .rep-lbl.static { padding: 0 12px; }
@media (max-width: 767px) {
  .rep-when { justify-content: stretch; }
  .rep-when .month-pick, .rep-when .rep-custom { width: 100%; }
  .rep-when .month-pick { justify-content: space-between; }
}
/* settings: one page */
.settings-page { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings-page .set-col { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); scroll-margin-top: 16px; }
@media (max-width: 1000px) { .settings-page { grid-template-columns: minmax(0, 1fr); } }
.donut-wrap { align-items: flex-start; }
.donut { margin-top: 4px; }
/* settings: two balanced columns on wide screens */
.settings-page { display: block; columns: 2; column-gap: 16px; }
.settings-page .set-col { break-inside: avoid; margin: 0 0 16px; }
@media (max-width: 1000px) { .settings-page { columns: 1; } }

/* ---------- v2.0: colours that mean one thing each ---------- */
.kpi-ico.balance { background: var(--bal-bg); color: var(--bal); }
.kpi { position: relative; overflow: hidden; }
.kpi-val.neg { color: var(--warn); }

.kind-tag.k-saving { background: var(--save-bg); color: var(--save); }

/* ---------- motion: quiet, and only where it explains something ---------- */
#view.enter { animation: view-in .24s ease-out both; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } }
#view.enter .chart .mark { transform-box: fill-box; transform-origin: 50% 100%; animation: bar-grow .45s cubic-bezier(.25, .8, .25, 1) both; }
@keyframes bar-grow { from { transform: scaleY(0); } }
#view.enter .donut svg { animation: donut-in .4s ease-out both; }
@keyframes donut-in { from { opacity: 0; transform: rotate(-20deg); } }
#view.enter .meter > i { transform-origin: left center; animation: meter-in .5s cubic-bezier(.25, .8, .25, 1) both; }
@keyframes meter-in { from { transform: scaleX(0); } }
.menu { transform-origin: top left; animation: menu-in .14s ease-out; }
.menu.from-bottom { transform-origin: bottom left; animation-name: menu-up; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes menu-up { from { opacity: 0; transform: translateY(4px); } }
.scrim.closing { animation: fade-out .16s ease-in forwards; pointer-events: none; }
.scrim.closing .sheet { animation: sink .16s ease-in forwards; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sink { to { transform: translateY(12px); opacity: 0; } }
@media (min-width: 700px) {
  .sheet { animation-name: pop-in; animation-duration: .18s; }
  @keyframes pop-in { from { transform: translateY(6px); opacity: 0; } }
}
.btn, .icon-btn, .chip, .seg button, .series-pick button, .ptab, .plan-amt { transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s; }
.list-row, .tbl tr.click td, .note-row { transition: background-color .15s; }
.cheer, .cheer-row { animation: fade .3s ease-out both; }
.cheer.leaving, .cheer-row.leaving { animation: fold .4s ease-in forwards; overflow: hidden; }
@keyframes fold { to { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; } }
.cheer, .cheer-row { max-height: 200px; }
.cheer { position: relative; padding-right: 44px; }
.cheer .cheer-x { position: absolute; right: 6px; top: 6px; color: var(--muted); }
.note-row.ticking, .note-row.unticking { animation: fade-out .3s ease-in forwards; }
@media (prefers-reduced-motion: reduce) {
  #view.enter, #view.enter .chart .mark, #view.enter .donut svg, #view.enter .meter > i, .menu, .cheer, .cheer-row { animation: none !important; }
}

/* ---------- v2.0: responsive fixes ---------- */
.card-head a, .card-head .btn { white-space: nowrap; flex: none; }
.donut-legend { min-width: min(100%, 280px); }
.dl-row .dl-name { flex-wrap: wrap; row-gap: 2px; }
.list-row .t > span:not(.late) { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 767px) {
  /* title on the left, the page's main button on the right, period picker underneath */
  .ph { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; }
  .ph-tools { display: contents; }
  .ph-tools .cat-add-btn { grid-column: 2; grid-row: 1; min-height: 40px; padding: 0 14px; }
  .ph-tools .month-pick, .ph-tools > .btn.secondary, .ph-tools > a.btn { grid-column: 1 / -1; }
  .ph h1 { font-size: 1.35rem; }
  .ph p { font-size: .875rem; }
  .series-pick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -4px; }
  .series-pick::-webkit-scrollbar { display: none; }
  .series-pick button { flex: none; min-height: 32px; padding: 0 11px; }
  .rep-presets { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
  .rep-presets button { padding: 0 4px; font-size: .8rem; }
  .kpi { padding: 14px; }
  .kpi-sub { font-size: .75rem; }
}
@media (max-width: 420px) {
  .pub-top { padding: 12px 14px; gap: 8px; }
  .pub-top nav { gap: 4px; }
  .pub-top nav .btn { min-height: 36px; padding: 0 12px; font-size: .85rem; }
  .pub-top .logo span:last-child { font-size: 1.05rem; }
}
.donut-c b { white-space: nowrap; overflow-wrap: normal; max-width: none; }
.donut-c b.long { font-size: .92rem; } .donut-c b.xlong { font-size: .8rem; }

/* ---------- sidebar: hide / show ---------- */
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.side-top .logo { min-width: 0; }
.side-toggle { display: none; flex: none; width: 34px; height: 34px; color: var(--muted); border-radius: 9px; }
.side-toggle:hover { color: var(--text); background: var(--surface-2); }
.side-toggle svg { width: 19px; height: 19px; }
@media (min-width: 768px) {
  .sidebar .side-top { flex-direction: column; }
}
@media (min-width: 1100px) {
  .layout { transition: grid-template-columns .2s ease; }
  .sidebar .side-top { flex-direction: row; margin: 0 0 4px; }
  .sidebar .side-top .logo { padding-bottom: 12px; }
  .side-toggle { display: grid; place-items: center; margin: -10px 0 0; }
  /* folded: the same icon rail the tablet uses */
  .side-min .layout { grid-template-columns: 76px minmax(0, 1fr); }
  .side-min .sidebar { padding: 14px 12px; }
  .side-min .sidebar .side-top { flex-direction: column; gap: 2px; margin: 0 0 6px; }
  .side-min .sidebar .logo { justify-content: center; padding: 4px 0 6px; }
  .side-min .side-toggle { margin: 0; }
  .side-min .sidebar .logo-text, .side-min .sidebar .nav-t, .side-min .sidebar .su-t, .side-min .sidebar .su-chev { display: none; }
  .side-min .side-nav a { justify-content: center; padding: 0; }
  .side-min .side-nav a[aria-current="page"]::before { display: none; }
  .side-min .side-user { justify-content: center; padding: 10px 6px; }
  .side-min .side-user .su-t { display: none; }
}

/* ---------- v2.2: phones & tablets ---------- */
/* steady page height while the browser bars slide in and out, and no rubber-band jump at the ends */
html { -webkit-tap-highlight-color: transparent; }
html.standalone { overscroll-behavior-y: none; }
.layout, .pub, .boot { min-height: 100vh; min-height: 100svh; }
@media (min-width: 768px) { .sidebar { height: 100vh; height: 100svh; } }
.sheet { max-height: 92vh; max-height: 92svh; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.menu { max-height: calc(100svh - 24px); overscroll-behavior: contain; }
/* phones must not turn names, e-mails or numbers into links */
a[x-apple-data-detectors], a[href^="tel:"], a[href^="mailto:"] { color: inherit !important; text-decoration: none !important; font: inherit !important; pointer-events: none; }
.menu-head > span { min-width: 0; }
.menu-head b, .menu-head span span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the month switcher is one control: arrows inside the same pill, no dividers */
.month-pick { border-radius: 999px; padding: 0 3px; gap: 0; }
.month-pick .icon-btn { width: 34px; height: 34px; border-radius: 999px; color: var(--muted); }
.month-pick .icon-btn:hover { background: var(--surface-2); color: var(--text); }
.month-pick .lbl { border: 0; line-height: 1; padding: 0 6px; flex: 1; }
.rep-when .month-pick .lbl { line-height: 1; }
.rep-when .month-pick .icon-btn { height: 34px; }

/* amount: the device keyboard does the typing */
.qa-amount { margin: 14px 0 4px; }
.qa-amount input { font-size: clamp(2.2rem, 10vw, 2.8rem); }
.qa-calc { min-height: 1.2em; }

@media (max-width: 600px) {
  .btn-row { display: grid; grid-template-columns: minmax(0, 1fr); }
  .btn-row > .btn { width: 100%; justify-content: center; }
}
@media (min-width: 601px) and (max-width: 1023px) {
  .btn-row > .btn { flex: 1 1 auto; justify-content: center; }
}

/* dialogs follow the visible area, so the on-screen keyboard never hides Save */
.scrim { inset: auto 0 auto 0; top: var(--vvt, 0px); height: var(--vvh, 100vh); }
@media (max-width: 699px) { .sheet { max-height: calc(var(--vvh, 100svh) - 10px); } }

/* ---------- v2.3 ---------- */
/* nothing may push the page sideways on a phone */
.layout, .pub { overflow-x: clip; }

/* over-budget list: the category name gets the full line */
.over-row { display: block; padding: 10px 12px; }
.over-row .or-top { display: flex; align-items: center; gap: 10px; }
.over-row .or-top .cat { flex: 1; min-width: 0; }
.over-row .or-top .ct { white-space: normal; }
.over-row .or-top b { color: var(--warn); font-size: .875rem; white-space: nowrap; }
.over-row .or-sub { display: block; margin: 2px 0 0 42px; font-size: .78rem; color: var(--muted); }
.over-btn { margin-top: 10px; padding: 4px 10px; }
.donut-note { margin-bottom: 0; }

/* add record: today / yesterday / other day as one control */
.qa-dates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; }
.qa-dates > button, .qa-dates .date-btn { min-height: 38px; width: 100%; border: 0; border-radius: 8px; background: transparent; font-weight: 600; font-size: .875rem; color: var(--muted); padding: 0 6px; display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; box-shadow: none; }
.qa-dates .date-field { display: block; min-width: 0; }
.qa-dates .date-btn .chev { display: none; }
.qa-dates .date-btn svg { width: 16px; height: 16px; }
.qa-dates .date-lbl { overflow: hidden; text-overflow: ellipsis; }
.qa-dates > button[aria-pressed="true"], .qa-dates .date-btn[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.qa .qa-section > .lbl { margin-bottom: 8px; }
#qa-note { min-height: 44px; }

/* debts: one clear card per debt on phones */
.debt-list { display: none; }
/* up to small laptops: the table's last column (Edit) did not fit next to the side menu at about 820px */
@media (max-width: 979px) {
  .debt-wrap { display: none; }
  .debt-list { display: block; }
}
.debt-item { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: grid; gap: 8px; }
.debt-item:last-child { border-bottom: 0; }
.di-top { display: flex; align-items: center; gap: 12px; }
.di-top .t { flex: 1; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.di-top .t b { font-weight: 600; overflow-wrap: anywhere; }
.di-top .badge { font-size: .72rem; }
.di-amt { text-align: right; font-weight: 700; white-space: nowrap; line-height: 1.2; }
.di-amt small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
.debt-item .meter { height: 6px; }
.meter.debt > i { background: var(--debt); } .meter.lent > i { background: var(--lent); }
.di-meta { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; color: var(--muted); }
.di-note { margin: 0; font-size: .8rem; color: var(--text-2); }
.di-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin-top: 2px; }
.di-acts .btn { min-height: 40px; justify-content: center; }
.debt-item .late { margin-top: 0; }

/* reports & records on phones: every choice in view, nothing hidden off the side
   (the periods in two rows of four, the record types squeezed into one row) */
@media (max-width: 767px) {
  .rep-presets { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; width: 100%; }
  .rep-presets button { flex: none; min-width: 0; padding: 0 4px; font-size: .82rem; }
  .toolbar .seg { width: 100%; max-width: 100%; overflow: visible; }
  .toolbar .seg button { flex: 1 1 auto; min-width: 0; padding: 0 6px; font-size: .82rem; }
}

/* ---------- v2.4 ---------- */
/* the record you just saved glows for a moment */
.just-saved, .just-saved td { animation: saved-glow 2.4s ease-out; }
@keyframes saved-glow { 0%, 35% { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .just-saved, .just-saved td { animation: none; background: color-mix(in srgb, var(--brand) 10%, var(--surface)); } }

/* report totals: a table on wide screens, a simple list on phones */
.rep-list { display: none; }
@media (max-width: 767px) {
  .rep-grid .tbl-wrap { display: none; }
  .rep-list { display: block; }
}
.rl-row { padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.rl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rl-head > b { font-weight: 650; font-size: .95rem; line-height: 1.3; }
.rl-head > b small { display: block; font-size: .75rem; font-weight: 500; color: var(--muted); }
.rl-today { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--brand-50); color: var(--brand-600); font-size: .7rem; font-weight: 600; vertical-align: 2px; }
.rl-bal { display: grid; justify-items: end; line-height: 1.2; }
.rl-bal small { font-size: .7rem; font-weight: 500; color: var(--muted); }
.rl-bal b { font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rl-bal.pos b { color: var(--income); } .rl-bal.neg b { color: var(--warn); }
.rl-lines { display: grid; gap: 6px; margin-top: 10px; }
.rl-line { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: .875rem; }
.rl-line i { width: 10px; height: 10px; border-radius: 3px; background: var(--spend); }
.rl-line.in i { background: var(--income); } .rl-line.sv i { background: var(--save); }
.rl-line span { color: var(--text-2); }
.rl-line b { font-weight: 650; font-variant-numeric: tabular-nums; }
.rl-none { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 18px; }
.rl-none b { font-weight: 500; font-size: .9rem; color: var(--muted); }
.rl-none span { font-size: .78rem; color: var(--muted); }
.rl-total { background: var(--surface-2); }
.rl-total .rl-line span { color: var(--text-2); }

/* pull down to refresh when Reasontra runs as an installed app (browsers already do this themselves) */
.ptr { position: fixed; left: 50%; top: calc(8px + env(safe-area-inset-top, 0px)); z-index: 60; width: 38px; height: 38px; margin-left: -19px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--brand); opacity: 0; transform: translateY(-50px); pointer-events: none; }
.ptr svg { width: 20px; height: 20px; }
.ptr.spin svg { animation: ptr-spin .7s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ---------- v2.6: landing page ---------- */
.pub-top nav { align-items: center; }
.pub-link { color: var(--text-2); font-weight: 500; font-size: .925rem; padding: 0 10px; display: none; }
.pub-link:hover { color: var(--text); text-decoration: none; }
@media (min-width: 1000px) { .pub-link { display: inline; } }
.pub-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.pub-landing .pub-main { max-width: 1160px; }

.lp-hero { display: grid; gap: 44px; align-items: center; padding: 28px 0 12px; }
.lp-hero h1 { font-size: clamp(2.4rem, 6.2vw, 4.3rem); line-height: 1.02; letter-spacing: -.035em; margin: 0 0 20px; font-weight: 800; max-width: 11ch; }
.lp-lead { font-size: clamp(1.02rem, 1.6vw, 1.15rem); color: var(--text-2); max-width: 52ch; margin: 0 0 28px; line-height: 1.6; }
.lp-note { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; font-size: .85rem; color: var(--muted); }
.lp-note svg { width: 15px; height: 15px; color: var(--income); }
.lp-visual { position: relative; padding: 0 0 92px; }
.lp-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.lp-mini div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.lp-mini small { display: block; font-size: .72rem; color: var(--muted); }
.lp-mini b { font-size: 1.05rem; letter-spacing: -.01em; }
.lp-streak { position: absolute; left: -18px; bottom: 0; display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 18px 12px 12px; }
.lp-streak svg { width: 64px; height: 64px; flex: none; }
.lp-streak .trk, .plan-banner .trk { fill: none; stroke: var(--surface-2); stroke-width: 7; }
.lp-streak .val, .plan-banner .val { fill: none; stroke: var(--brand); stroke-width: 7; stroke-linecap: round; }
.lp-streak-n { position: absolute; left: 12px; top: 12px; width: 64px; height: 64px; display: grid; place-content: center; text-align: center; line-height: 1; }
.lp-streak-n b { font-size: 1.15rem; } .lp-streak-n span { font-size: .62rem; color: var(--muted); margin-top: 2px; }
.lp-streak-t { display: grid; gap: 2px; font-size: .8rem; color: var(--muted); }
.lp-streak-t b { color: var(--text); font-size: .9rem; margin-bottom: 2px; }
.lp-streak-t span { display: inline-flex; align-items: center; gap: 6px; }
.lp-streak-t span svg { width: 13px; height: 13px; }
.lp-streak-t .ok { color: var(--text-2); } .lp-streak-t .ok svg { color: var(--income); }

.lp-facts { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; margin: 56px 0 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--text-2); font-size: .9rem; }
.lp-facts span { display: inline-flex; align-items: center; gap: 8px; }
.lp-facts svg { width: 18px; height: 18px; color: var(--brand); }

.lp-pain, .lp-habits, .lp-plan, .lp-tour, .lp-price, .lp-faq { margin: 88px 0 0; }
.lp-pain h2, .lp-head h2, .lp-price h2, .lp-end h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.15; letter-spacing: -.025em; margin: 0 0 10px; font-weight: 750; }
.lp-pain h2 { max-width: 22ch; margin-bottom: 28px; }
.lp-head { margin: 0 0 28px; max-width: 60ch; }
.lp-head p { margin: 0; color: var(--muted); font-size: 1.02rem; }
.lp-pain-grid { display: grid; gap: 24px; }
.lp-pain-grid div { border-top: 3px solid var(--brand); padding-top: 14px; }
.lp-pain-grid b { display: block; font-size: 1.05rem; margin-bottom: 6px; }
.lp-pain-grid p { margin: 0; color: var(--muted); }

.lp-habit-list { display: grid; gap: 14px; }
.lp-habit { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.lp-habit .fi { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; flex: none; }
.lp-habit .fi svg { width: 21px; height: 21px; }
.lp-habit h3 { margin: 0 0 4px; font-size: 1.02rem; }
.lp-habit p { margin: 0; color: var(--muted); font-size: .925rem; }

.lp-weeks { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: wk; }
.lp-weeks li { display: flex; gap: 16px; align-items: flex-start; }
.lp-wk { width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; flex: none; }
.lp-weeks small { display: block; color: var(--brand-600); font-weight: 600; font-size: .8rem; }
.lp-weeks h3 { margin: 2px 0 6px; font-size: 1.15rem; }
.lp-weeks p { margin: 0; color: var(--muted); max-width: 40ch; }

.lp-price-card { display: grid; gap: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 32px 28px; }
.lp-price-card p { color: var(--muted); max-width: 44ch; margin: 0 0 22px; }
.lp-price-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; align-content: center; }
.lp-price-card li { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.lp-price-card li svg { width: 18px; height: 18px; color: var(--income); flex: none; }

.lp-faq { max-width: 760px; }
.lp-faq details { border-bottom: 1px solid var(--line); }
.lp-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; font-weight: 600; font-size: 1.02rem; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary .sum-chev { width: 18px; height: 18px; color: var(--muted); transition: transform .15s; flex: none; }
.lp-faq details[open] summary .sum-chev { transform: rotate(180deg); }
.lp-faq details p { margin: 0 0 18px; color: var(--text-2); max-width: 62ch; }

.lp-end { margin: 96px 0 0; text-align: center; background: var(--brand); color: #fff; border-radius: 24px; padding: 48px 24px; }
.lp-end p { color: rgba(255, 255, 255, .88); max-width: 46ch; margin: 0 auto 24px; }
.lp-end .btn { background: #fff; color: var(--brand-600); border-color: #fff; }
.lp-end .btn:hover { background: #FFF3EC; }

@media (min-width: 900px) {
  .lp-hero { grid-template-columns: 1.05fr .95fr; padding-top: 48px; }
  .lp-pain-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; }
  .lp-habit-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-habit:last-child { grid-column: 1 / -1; }
  .lp-weeks { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; position: relative; }
  .lp-weeks:not(.compact)::before { content: ""; position: absolute; left: 22px; right: 22px; top: 22px; height: 2px; background: var(--brand-100); z-index: 0; }
  .lp-weeks:not(.compact) li { flex-direction: column; position: relative; z-index: 1; }
  .lp-price-card { grid-template-columns: 1.1fr .9fr; padding: 44px; }
  .lp-tour .features { margin: 0; }
}
@media (max-width: 899px) {
  .lp-visual { padding-bottom: 104px; }
  .lp-streak { left: 12px; right: 12px; }
  .lp-tour .features { margin: 0; }
}

/* sign up: what you get, next to the form */
.auth-split { display: grid; gap: 24px; align-items: start; justify-items: center; padding: 8px 0; }
.auth-split .auth { padding: 0; width: 100%; }
.auth-side { max-width: 420px; width: 100%; }
.auth-side h2 { font-size: 1.5rem; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-side > p { color: var(--muted); margin: 0 0 20px; }
.lp-weeks.compact { gap: 14px; margin-bottom: 20px; }
.lp-weeks.compact .lp-wk { width: 34px; height: 34px; font-size: .95rem; }
.lp-weeks.compact h3 { font-size: 1rem; margin: 0; }
.auth-perks { list-style: none; margin: 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.auth-perks li { display: flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--text-2); }
.auth-perks li svg { width: 16px; height: 16px; color: var(--income); }
@media (min-width: 900px) {
  .auth-split { grid-template-columns: minmax(0, 1fr) 420px; max-width: 900px; margin: 24px auto 0; gap: 56px; justify-items: stretch; }
  .auth-side { padding-top: 24px; }
}
@media (max-width: 899px) { .auth-split .auth-side { order: 2; } }

/* in the app: the 21-day plan for new accounts */
.plan-banner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 12px 12px 14px; margin: 0 0 16px; box-shadow: var(--shadow-sm); }
.pb-ring { position: relative; width: 50px; height: 50px; }
.pb-ring svg { width: 50px; height: 50px; }
.pb-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .95rem; }
.pb-t { display: grid; gap: 2px; min-width: 0; }
.pb-t b { font-size: .92rem; }
.pb-t span { font-size: .82rem; color: var(--muted); }
.pb-trial { grid-column: 2; font-size: .75rem; font-weight: 600; color: var(--brand-600); }
.pb-x { grid-column: 3; grid-row: 1; color: var(--muted); }
.plan-banner.leaving { animation: fold .4s ease-in forwards; overflow: hidden; }
.trial-note { display: flex; align-items: center; gap: 6px; margin: -6px 0 14px; font-size: .82rem; color: var(--brand-600); font-weight: 600; }
.trial-note svg { width: 15px; height: 15px; }

/* ---------- v2.8: the marketing site (home, features, 21-day plan, pricing, about, privacy, terms) ---------- */
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.pub { --hdr: 64px; --amber: #F5A524; position: relative; isolation: isolate; }
@media (max-width: 560px) { .pub { --hdr: 58px; } }
.pub-site { background: var(--surface); }
.pub-site .pub-main { max-width: none; padding: 0; margin-top: calc(-1 * var(--hdr)); }

/* header: clear over the hero, frosted once you scroll */
.pub .pub-top { display: block; padding: 0; max-width: none; position: sticky; top: 0; z-index: 40; background: transparent; border-bottom: 1px solid transparent; transition: background-color .3s ease, border-color .3s ease, box-shadow .3s ease; }
.pub .pub-top.scrolled, .pub .pub-top.menu-open { background: color-mix(in srgb, var(--surface) 84%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px); border-bottom-color: var(--line-2); box-shadow: 0 6px 24px -18px rgba(16, 24, 40, .35); }
.pub-top-in { display: flex; align-items: center; gap: 28px; max-width: 1208px; height: var(--hdr); margin: 0 auto; padding: 0 24px; }
.pub-top .logo-mark { transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.pub-top .logo:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }
.pub-top .pub-nav { display: none; gap: 2px; }
.pub-nav .pub-link { position: relative; display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border-radius: 10px; transition: color .2s, background-color .2s; }
.pub-nav .pub-link:hover { background: color-mix(in srgb, var(--surface-2) 80%, transparent); color: var(--text); }
.pub-nav .pub-link.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--brand); }
.pub-link.on { color: var(--text); font-weight: 600; }
.pub-acts { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pub-acts .btn { min-height: 40px; }
.pub-burger { display: inline-grid; place-content: center; gap: 4px; width: 42px; height: 42px; padding: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.pub-burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); transition: transform .3s ease, opacity .2s ease; }
.menu-open .pub-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .pub-burger span:nth-child(2) { opacity: 0; }
.menu-open .pub-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.pub-top .pub-menu { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; }
.pub-top.menu-open .pub-menu { grid-template-rows: 1fr; }
.pub-menu-in { overflow: hidden; min-height: 0; }
/* a short screen (a phone on its side): the open menu scrolls on its own, so every link and the buttons can be reached */
.pub-top.menu-open .pub-menu-in { max-height: calc(100vh - var(--hdr, 64px)); max-height: calc(100dvh - var(--hdr, 64px)); overflow-y: auto; overscroll-behavior: contain; }
.pub-top .pub-menu nav { display: grid; padding: 4px 18px 0; }
.pub-menu .pub-link { display: block; padding: 14px 4px; font-size: 1.05rem; border-bottom: 1px solid var(--line-2); }
.pub-menu-acts { display: grid; gap: 10px; padding: 16px 18px 20px; }
.menu-open .pub-menu .pub-link, .menu-open .pub-menu-acts { animation: mk-up .45s cubic-bezier(.2, .7, .2, 1) both; }
.menu-open .pub-menu .pub-link:nth-child(2) { animation-delay: .04s; } .menu-open .pub-menu .pub-link:nth-child(3) { animation-delay: .08s; }
.menu-open .pub-menu .pub-link:nth-child(4) { animation-delay: .12s; } .menu-open .pub-menu-acts { animation-delay: .16s; }
.pub-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--brand), var(--amber)); transform: scaleX(var(--progress, 0)); transform-origin: left; opacity: 0; transition: opacity .3s; pointer-events: none; }
.pub-site .scrolled .pub-progress { opacity: 1; }
@media (min-width: 1000px) {
  .pub-top .pub-nav { display: flex; }
  .pub-burger, .pub-top .pub-menu { display: none; }
}
@media (max-width: 560px) {
  .pub-top-in { padding: 0 14px; gap: 10px; }
  .pub-acts .pub-login { display: none; }
  .pub-acts .btn { min-height: 40px; padding: 0 14px; font-size: .9rem; }
}

/* moving light behind the hero, page heads, sign-in pages and dark bands */
.mk-bg { --g1: rgba(232, 92, 26, .24); --g2: rgba(245, 165, 36, .26); --g3: rgba(99, 91, 255, .13); --dot: rgba(17, 24, 39, .1); position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
:root[data-theme="dark"] .mk-bg { --g1: rgba(240, 112, 51, .2); --g2: rgba(245, 165, 36, .12); --g3: rgba(122, 115, 227, .16); --dot: rgba(255, 255, 255, .07); }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .mk-bg { --g1: rgba(240, 112, 51, .2); --g2: rgba(245, 165, 36, .12); --g3: rgba(122, 115, 227, .16); --dot: rgba(255, 255, 255, .07); } }
.mk-bg span { position: absolute; border-radius: 50%; aspect-ratio: 1; }
.mk-bg .b1 { width: min(72vw, 900px); top: -34%; left: -14%; background: radial-gradient(closest-side, var(--g1), transparent); --dx: 7vw; --dy: 6vh; animation: mk-drift 19s ease-in-out infinite alternate; }
.mk-bg .b2 { width: min(64vw, 820px); top: -26%; right: -16%; background: radial-gradient(closest-side, var(--g2), transparent); --dx: -6vw; --dy: 9vh; animation: mk-drift 23s ease-in-out infinite alternate; }
.mk-bg .b3 { width: min(58vw, 760px); top: 34%; left: 28%; background: radial-gradient(closest-side, var(--g3), transparent); --dx: 5vw; --dy: -7vh; animation: mk-drift 27s ease-in-out infinite alternate; }
.mk-bg .dots { inset: 0; width: auto; aspect-ratio: auto; border-radius: 0; background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 24px 24px; -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 10%, transparent 75%); mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 10%, transparent 75%); }
.mk-bg.soft .b1, .mk-bg.soft .b2 { opacity: .75; }
.mk-bg.night { --g1: rgba(240, 112, 51, .32); --g2: rgba(122, 115, 227, .3); --g3: rgba(245, 165, 36, .12); --dot: rgba(255, 255, 255, .07); }
.mk-bg.warm { --g1: rgba(255, 255, 255, .2); --g2: rgba(255, 196, 92, .4); --g3: rgba(110, 22, 0, .3); --dot: rgba(255, 255, 255, .12); }
.mk-bg.stage .b1 { top: -40%; left: -30%; } .mk-bg.stage .b2 { top: 30%; right: -30%; } .mk-bg.stage .b3 { display: none; }
.mk-bg.stage .dots { -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 20%, transparent 80%); mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 20%, transparent 80%); }
.pub-auth > .mk-bg { position: fixed; }
@keyframes mk-drift { to { transform: translate(var(--dx), var(--dy)) scale(1.12); } }

/* layout bits */
.mk-wrap { max-width: 1208px; margin: 0 auto; padding: 0 24px; }
.mk-narrow { max-width: 840px; }
.mk-center { text-align: center; margin: 44px 0 0; }
.mk-note { display: inline-flex; align-items: center; gap: 6px; margin: 14px 0 0; font-size: .875rem; color: var(--muted); }
.mk-note svg { width: 15px; height: 15px; color: var(--income); }
.mk-note.light { color: rgba(255, 255, 255, .88); } .mk-note.light svg { color: #fff; }
.mk-ctas { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.mk-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--brand-600); }
.mk-link svg { width: 17px; height: 17px; transition: transform .25s; }
.mk-link:hover { text-decoration: none; } .mk-link:hover svg { transform: translateX(4px); }
section[id], .mk-feature[id] { scroll-margin-top: calc(var(--hdr) + 16px); }

/* buttons: a soft light passes across the main call to action now and then */
.mk-btn { position: relative; overflow: hidden; isolation: isolate; box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 10px 24px -12px color-mix(in srgb, var(--brand) 70%, transparent); transition: transform .2s ease, box-shadow .2s ease, background-color .2s; }
.mk-btn:hover { transform: translateY(-1px); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 16px 30px -14px color-mix(in srgb, var(--brand) 80%, transparent); }
.mk-btn:active { transform: translateY(0); }
.mk-btn svg { transition: transform .25s ease; }
.mk-btn:hover svg { transform: translateX(3px); }
.mk-btn::after { content: ""; position: absolute; top: 0; bottom: 0; left: -70%; width: 45%; z-index: -1; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent); transform: skewX(-20deg); animation: mk-shine 5s 2.4s ease-in-out infinite; }
.btn.light { background: #fff; color: #E85C1A; border-color: #fff; }
.btn.light:hover { background: #FFF3EC; }
.btn.light::after { background: linear-gradient(100deg, transparent, rgba(232, 92, 26, .16), transparent); }
@keyframes mk-shine { 0% { left: -70%; } 28%, 100% { left: 130%; } }

/* reveal on scroll */
.mk-live [data-r] { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .9s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--d, 0) * 90ms); }
.mk-live [data-r].in { opacity: 1; transform: none; }
.mk-live .mk-hero [data-r] { transition-delay: calc(var(--d, 0) * 110ms + 150ms); }
@keyframes mk-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* hero */
.mk-hero { position: relative; isolation: isolate; overflow: clip; padding: calc(var(--hdr) + 64px) 0 120px; text-align: center; }
.mk-hero-in { display: flex; flex-direction: column; align-items: center; }
.mk-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line)); border-radius: 999px; background: color-mix(in srgb, var(--surface) 75%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--text-2); font-size: .875rem; transition: border-color .2s, transform .2s; }
.mk-pill:hover { text-decoration: none; border-color: var(--brand); }
.mk-pill:hover svg { transform: translateX(3px); }
.mk-pill b { background: var(--brand); color: #fff; border-radius: 999px; padding: 2px 9px; font-size: .75rem; font-weight: 600; }
.mk-pill svg { width: 14px; height: 14px; color: var(--muted); transition: transform .2s; }
.mk-h1 { font-size: clamp(2.5rem, 7.6vw, 5.6rem); line-height: 1; letter-spacing: -.048em; font-weight: 800; margin: 26px 0 18px; }
.mk-h1 .w { display: inline-block; }
.mk-live .mk-h1 .w { animation: mk-word .9s cubic-bezier(.2, .7, .2, 1) calc(var(--i) * 75ms + 60ms) both; }
@keyframes mk-word { from { opacity: 0; transform: translateY(.42em); filter: blur(10px); } to { opacity: 1; transform: none; filter: blur(0); } }
.mk-ul { position: relative; white-space: nowrap; }
.mk-ul svg { position: absolute; left: -2%; bottom: -.16em; width: 104%; height: .3em; overflow: visible; }
.mk-ul path { fill: none; stroke: var(--brand); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 320; stroke-dashoffset: 0; vector-effect: non-scaling-stroke; }
.mk-live .mk-ul path { animation: mk-draw 1s cubic-bezier(.6, 0, .2, 1) .75s both; }
@keyframes mk-draw { from { stroke-dashoffset: 320; } to { stroke-dashoffset: 0; } }
.mk-tag { font-size: clamp(1.08rem, 2.2vw, 1.4rem); color: var(--brand-600); font-weight: 600; margin: 0 0 18px; letter-spacing: -.01em; }
.mk-lead { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--text-2); line-height: 1.65; max-width: 62ch; margin: 0 auto 30px; }

.mk-hero-visual { position: relative; margin-top: 72px; perspective: 1800px; }
.mk-live .mk-hero-visual { animation: mk-rise 1.2s cubic-bezier(.2, .7, .2, 1) .55s both; }
@keyframes mk-rise { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }
.mk-stage3d { position: relative; transform: translateY(var(--lift, 0)) rotateX(var(--tilt, 0deg)); transform-origin: 50% 0; will-change: transform; }
.mk-stage3d::before { content: ""; position: absolute; inset: 8% 6% -6%; z-index: -1; border-radius: 40px; background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 40%, transparent), transparent); filter: blur(40px); opacity: .55; }
.mk-hero-visual .mk-shot { width: 88%; }
.mk-hero-visual .mk-phone { position: absolute; right: 0; bottom: -52px; width: 20%; max-width: 250px; }
.mk-float { position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; text-align: left; border-radius: 16px; background: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); box-shadow: 0 20px 40px -22px rgba(16, 24, 40, .45), 0 2px 6px rgba(16, 24, 40, .06); font-size: .8rem; color: var(--muted); line-height: 1.3; }
.mk-float b { display: block; color: var(--text); font-size: .95rem; }
.mk-float small { display: block; font-size: .78rem; }
.mk-float-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.mk-float-ic svg { width: 19px; height: 19px; }
.mk-float-ic.save { background: var(--save-bg); color: var(--save); }
.mk-float-ic.ok { background: var(--ok-bg); color: var(--ok); }
.mk-float.f1 { top: 12%; left: -3%; }
.mk-float.f2 { bottom: 9%; left: -4%; }
.mk-float.f3 { top: -4%; right: 9%; }
.mk-live .mk-float { animation: mk-pop .7s cubic-bezier(.3, 1.4, .5, 1) both, mk-bob 6s ease-in-out infinite alternate; }
.mk-live .mk-float.f1 { animation-delay: 1.3s, 2s; } .mk-live .mk-float.f2 { animation-delay: 1.5s, 2.6s; } .mk-live .mk-float.f3 { animation-delay: 1.7s, 3.2s; }
@keyframes mk-pop { from { opacity: 0; scale: .8; } to { opacity: 1; scale: 1; } }
@keyframes mk-bob { from { translate: 0 0; } to { translate: 0 -10px; } }
.mk-ring { width: 38px; height: 38px; flex: none; }
.mk-ring .trk { fill: none; stroke: var(--surface-2); stroke-width: 5; }
.mk-ring .val { fill: none; stroke: var(--brand); stroke-width: 5; stroke-linecap: round; stroke-dasharray: var(--len) var(--c); }
.mk-live .mk-ring .val { animation: mk-ring 1.2s cubic-bezier(.4, 0, .2, 1) 1.7s both; }
@keyframes mk-ring { from { stroke-dasharray: 0 var(--c); } }

@media (min-width: 701px) and (max-width: 1180px) {
  .mk-float.f1 { left: 1%; } .mk-float.f2 { left: 1%; } .mk-float.f3 { right: 18%; }
  .mk-hero-visual .mk-phone { right: 2%; }
}

/* product pictures */
.mk-shot { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 2px 6px rgba(16, 24, 40, .05), 0 40px 80px -36px rgba(16, 24, 40, .45); }
.mk-shot img, .mk-phone img { display: block; width: 100%; height: auto; }

/* the moving strip */
.mk-strip { border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 20px 0; }
.mk-marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.mk-marquee-track { display: flex; width: max-content; animation: mk-marq 42s linear infinite; }
.mk-marquee:hover .mk-marquee-track { animation-play-state: paused; }
.mk-marquee-set { display: flex; gap: 44px; padding-right: 44px; }
.mk-marquee-set > span { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; color: var(--text-2); font-size: .95rem; font-weight: 500; }
.mk-marquee-set svg { width: 18px; height: 18px; color: var(--brand); }
@keyframes mk-marq { to { transform: translateX(-50%); } }

/* numbers */
.mk-stats { padding: 72px 0 8px; }
.mk-stats .mk-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
.mk-stat { text-align: center; }
.mk-stat b { display: block; font-size: clamp(2.4rem, 5.4vw, 3.6rem); line-height: 1; font-weight: 800; letter-spacing: -.05em; font-variant-numeric: tabular-nums; color: var(--brand); padding-bottom: 6px; }
.mk-stat > span { color: var(--muted); font-size: .95rem; }
@media (min-width: 760px) { .mk-stats .mk-wrap { grid-template-columns: repeat(4, minmax(0, 1fr)); } .mk-stat + .mk-stat { border-left: 1px solid var(--line-2); } }

/* sections */
.mk-sec { padding: 112px 0; position: relative; }
.mk-sec.pt0 { padding-top: 0; }
.mk-sec.tint { background: var(--bg); }
.mk-head { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.mk-head h2, .mk-h { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.08; letter-spacing: -.04em; font-weight: 800; margin: 0 0 14px; }
.mk-head p { margin: 0; color: var(--muted); font-size: 1.08rem; line-height: 1.6; }
.mk-h { margin-bottom: 24px; }

.mk-two { display: grid; gap: 20px; }
.mk-pane { border-radius: 26px; padding: 40px; border: 1px solid var(--line-2); }
.mk-pane.bad { background: var(--bg); }
.mk-pane.good { background: linear-gradient(160deg, var(--brand-50), color-mix(in srgb, var(--brand-50) 40%, var(--surface))); border-color: var(--brand-100); }
.mk-two .mk-h { font-size: clamp(1.5rem, 3vw, 2.15rem); }
.mk-x, .mk-ok { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.mk-x li, .mk-ok li { display: flex; gap: 14px; align-items: flex-start; color: var(--text-2); font-size: 1.03rem; line-height: 1.55; }
.mk-x b, .mk-ok b { color: var(--text); }
.mk-x svg, .mk-ok svg { flex: none; width: 28px; height: 28px; padding: 6px; border-radius: 50%; }
.mk-x svg { background: var(--warn-bg); color: var(--warn); }
.mk-ok svg { background: var(--ok-bg); color: var(--ok); }
.mk-live .mk-pane li { opacity: 0; transform: translateX(-10px); transition: opacity .5s ease, transform .6s ease; }
.mk-live .mk-pane.in li { opacity: 1; transform: none; }
.mk-live .mk-pane.in li:nth-child(2) { transition-delay: .15s; } .mk-live .mk-pane.in li:nth-child(3) { transition-delay: .3s; }
.mk-live .mk-pane.good.in li { transition-delay: .35s; } .mk-live .mk-pane.good.in li:nth-child(2) { transition-delay: .5s; } .mk-live .mk-pane.good.in li:nth-child(3) { transition-delay: .65s; }
@media (min-width: 860px) { .mk-two { grid-template-columns: 1fr 1fr; } .mk-pane { padding: 48px; } }

.mk-quote { position: relative; isolation: isolate; overflow: clip; padding: 120px 0; background: #0F1218; color: #fff; }
.mk-quote .mk-wrap { max-width: 940px; text-align: center; }
.mk-quote-intro { margin: 0 0 28px; font-size: 1.05rem; color: rgba(255, 255, 255, .62); }
.mk-quote blockquote { margin: 0; font-size: clamp(1.6rem, 4.4vw, 2.9rem); line-height: 1.18; letter-spacing: -.03em; font-weight: 700; }
.mk-quote blockquote.small { margin-top: 22px; font-size: clamp(1.1rem, 2.4vw, 1.5rem); font-weight: 500; color: rgba(255, 255, 255, .8); }
.mk-quote cite { display: inline-block; margin-top: 30px; font-style: normal; font-size: .95rem; font-weight: 600; color: #E85C1A; }

/* feature tabs on the home page */
.mk-show { display: grid; gap: 24px; }
.mk-show-tabs { display: grid; gap: 6px; }
.mk-tab { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 0 14px; width: 100%; padding: 14px 16px; text-align: left; font: inherit; color: var(--text-2); background: transparent; border: 1px solid transparent; border-radius: 18px; cursor: pointer; transition: background-color .3s, border-color .3s, box-shadow .3s; }
.mk-tab:hover { background: var(--surface-2); }
.mk-tab.on { background: var(--surface); border-color: var(--line); box-shadow: 0 18px 40px -26px rgba(16, 24, 40, .4); }
.mk-tab-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); transition: background-color .3s, color .3s, transform .3s; }
.mk-tab-ic svg { width: 20px; height: 20px; }
.mk-tab.on .mk-tab-ic { background: var(--brand); color: #fff; transform: scale(1.04); }
.mk-tab-t b { display: flex; align-items: center; min-height: 42px; color: var(--text); font-size: 1.04rem; letter-spacing: -.01em; }
.mk-tab-p { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s ease; }
.mk-tab-p > span { overflow: hidden; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.mk-tab.on .mk-tab-p { grid-template-rows: 1fr; }
.mk-tab.on .mk-tab-p > span { padding: 2px 0 6px; }
.mk-tab-bar { position: absolute; left: 18px; right: 18px; bottom: 8px; height: 3px; border-radius: 3px; overflow: hidden; background: var(--surface-2); opacity: 0; transition: opacity .3s; }
.mk-tab-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--amber)); transform: scaleX(0); transform-origin: left; }
/* the bar under the active habit fills as you scroll (see setupTabs) */
.mk-tab-bar i { transform: scaleX(var(--p, 0)); transition: transform .12s linear; }
.mk-show-track.pinned .mk-tab.on .mk-tab-bar { opacity: 1; }
.mk-show-track.pinned .mk-show { position: sticky; top: calc(var(--hdr) + 16px); }
.mk-show-dots { display: none; }
@keyframes mk-bar { to { transform: scaleX(1); } }
.mk-show-stage { order: -1; position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 5 / 4; border-radius: 28px; background: var(--bg); border: 1px solid var(--line-2); }
.mk-slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 7%; opacity: 0; transform: translateY(16px) scale(.97); transition: opacity .6s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.mk-slide.on { opacity: 1; transform: none; }
.mk-slide .mk-shot { width: 100%; }
.mk-slide.is-phone { padding: 5% 7%; }
@media (max-width: 959px) {
  /* phones and tablets: the picture on top, only the active habit under it, and a row of steps */
  .mk-show-track.pinned .mk-show { gap: 14px; }
  .mk-show-track.pinned .mk-show-stage { aspect-ratio: 4 / 3; max-height: 46vh; max-height: 46svh; width: 100%; margin: 0 auto; }
  .mk-show-track.pinned .mk-show-tabs { display: grid; }
  .mk-show-track.pinned .mk-tab { grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease, visibility 0s .35s; }
  .mk-show-track.pinned .mk-tab.on { opacity: 1; visibility: visible; transform: none; transition: opacity .35s ease, transform .35s ease; }
  .mk-show-track.pinned .mk-tab .mk-tab-p { grid-template-rows: 1fr; }
  .mk-show-track.pinned .mk-tab .mk-tab-p > span { padding: 2px 0 6px; }
  .mk-show-track.pinned .mk-show-dots { display: flex; justify-content: center; gap: 6px; }
  .mk-show-dots i { width: 22px; height: 4px; border-radius: 4px; background: var(--line); cursor: pointer; transition: background-color .3s; }
  .mk-show-dots i.on { background: var(--brand); }
}
@media (min-width: 960px) {
  .mk-show { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 48px; align-items: center; }
  .mk-show-stage { order: 0; aspect-ratio: 16 / 12; }
}

/* features page rows */
.mk-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; border-radius: 999px; background: var(--brand-50); color: var(--brand-600); font-size: .85rem; font-weight: 600; margin-bottom: 16px; }
.mk-chip svg { width: 16px; height: 16px; }
.mk-feature { display: grid; gap: 32px; align-items: center; padding: 48px 0; }
.mk-feature-t h3, .mk-feature-t h2 { font-size: clamp(1.55rem, 3.2vw, 2.3rem); line-height: 1.12; letter-spacing: -.035em; font-weight: 800; margin: 0 0 14px; }
.mk-feature-t p { margin: 0 0 22px; color: var(--text-2); font-size: 1.08rem; line-height: 1.6; max-width: 46ch; }
.mk-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.mk-checks li { display: flex; gap: 10px; color: var(--text-2); }
.mk-checks li svg { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--ok); }
.mk-feature-v { display: flex; justify-content: center; align-items: center; border-radius: 28px; padding: 40px; background: radial-gradient(120% 90% at 0% 0%, var(--brand-50), transparent 60%), var(--bg); border: 1px solid var(--line-2); }
.mk-feature-v.is-phone { background: radial-gradient(100% 80% at 100% 0%, color-mix(in srgb, var(--amber) 22%, transparent), transparent 60%), var(--brand-50); padding: 48px 24px; }
.mk-feature-v .mk-shot { width: 100%; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.mk-feature-v .mk-phone { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.mk-feature-v:hover .mk-shot, .mk-feature-v:hover .mk-phone { transform: translateY(-6px); }
@media (min-width: 900px) {
  .mk-feature { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; padding: 64px 0; }
  .mk-feature.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .mk-feature.flip .mk-feature-t { order: 2; }
}

/* 21-day plan, short version */
.mk-weeks { display: grid; gap: 20px; }
.mk-week { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 30px; transition: transform .35s ease, box-shadow .35s ease, border-color .35s; }
.mk-week:hover { transform: translateY(-4px); border-color: var(--brand-100); box-shadow: 0 28px 50px -34px rgba(16, 24, 40, .45); }
.mk-week-n { position: relative; width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--amber)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; margin-bottom: 20px; flex: none; }
.mk-live .in .mk-week-n::after, .mk-live .mk-week.in .mk-week-n::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--brand); animation: mk-ping 1.6s ease-out .3s 2 both; }
@keyframes mk-ping { from { opacity: .7; transform: scale(.8); } to { opacity: 0; transform: scale(1.35); } }
.mk-week small { display: block; color: var(--brand-600); font-weight: 600; font-size: .875rem; }
.mk-week h3 { margin: 4px 0 8px; font-size: 1.4rem; letter-spacing: -.02em; }
.mk-week > p { margin: 0; color: var(--muted); }
@media (min-width: 860px) { .mk-weeks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 21-day plan page: a timeline that fills as you read */
.mk-tl { position: relative; }
.mk-tl-line { position: absolute; left: 22px; top: 24px; bottom: 24px; width: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.mk-tl-line i { display: block; height: 100%; background: linear-gradient(var(--brand), var(--amber)); transform: scaleY(var(--fill, 0)); transform-origin: top; }
.mk-tl-week { padding-bottom: 52px; }
.mk-tl-week:last-child { padding-bottom: 0; }
.mk-tl-head { position: relative; z-index: 1; display: flex; gap: 18px; align-items: flex-start; }
.mk-tl-head .mk-week-n { margin: 0; box-shadow: 0 0 0 6px var(--surface); }
.mk-tl-head small { display: block; color: var(--brand-600); font-weight: 600; font-size: .875rem; padding-top: 2px; }
.mk-tl-head h2 { margin: 2px 0 6px; font-size: clamp(1.4rem, 3vw, 1.8rem); letter-spacing: -.03em; }
.mk-tl-head p { margin: 0; color: var(--muted); }
.mk-tl-days { list-style: none; margin: 24px 0 0; padding: 0 0 0 64px; display: grid; gap: 12px; }
.mk-tl-days li { position: relative; display: grid; gap: 4px; padding: 15px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; transition: border-color .3s, transform .3s; }
.mk-tl-days li:hover { border-color: var(--brand-100); transform: translateX(4px); }
.mk-tl-days li::before { content: ""; position: absolute; left: -47px; top: 20px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.mk-tl-day { font-weight: 700; color: var(--brand-600); font-size: .82rem; }
.mk-tl-days p { margin: 0; color: var(--text-2); line-height: 1.55; }

/* comparison */
.mk-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 30px 60px -44px rgba(16, 24, 40, .35); }
.mk-compare { width: 100%; min-width: 660px; border-collapse: collapse; }
.mk-compare th, .mk-compare td { padding: 16px; text-align: center; border-bottom: 1px solid var(--line-2); }
.mk-compare th:first-child, .mk-compare td:first-child { text-align: left; color: var(--text-2); position: sticky; left: 0; z-index: 3; background: var(--surface); min-width: 200px; }
.mk-compare thead th { font-size: .92rem; color: var(--text); padding-top: 20px; padding-bottom: 20px; }
.mk-compare .us { background: var(--brand-50); }
.mk-compare thead .us { color: var(--brand-600); }
.mk-compare tbody tr { transition: background-color .2s; }
/* row highlight only with a mouse (a tap on a phone used to leave a see-through row behind the fixed first column) */
@media (hover: hover) {
  .mk-compare tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
  .mk-compare tbody tr:hover td.us { background: var(--brand-100); }
}
.mk-compare tbody tr:last-child td { border-bottom: 0; }
.mk-compare .yes svg { width: 24px; height: 24px; padding: 4px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); vertical-align: middle; }
.mk-compare .no svg { width: 16px; height: 16px; color: var(--c-other); vertical-align: middle; }
.mk-live .mk-table-wrap .yes svg { transform: scale(0); transition: transform .45s cubic-bezier(.3, 1.6, .5, 1); }
.mk-live .mk-table-wrap.in .yes svg { transform: none; }
.mk-live .mk-table-wrap.in tr:nth-child(2) .yes svg { transition-delay: .06s; } .mk-live .mk-table-wrap.in tr:nth-child(3) .yes svg { transition-delay: .12s; }
.mk-live .mk-table-wrap.in tr:nth-child(4) .yes svg { transition-delay: .18s; } .mk-live .mk-table-wrap.in tr:nth-child(5) .yes svg { transition-delay: .24s; }
.mk-live .mk-table-wrap.in tr:nth-child(6) .yes svg { transition-delay: .3s; } .mk-live .mk-table-wrap.in tr:nth-child(7) .yes svg { transition-delay: .36s; }
.mk-live .mk-table-wrap.in tr:nth-child(8) .yes svg { transition-delay: .42s; }
.mk-swipe { display: none; align-items: center; justify-content: center; gap: 8px; margin: -8px 0 14px; color: var(--muted); font-size: .85rem; font-weight: 500; transition: opacity .4s, transform .4s; }
.mk-swipe svg { width: 14px; height: 14px; animation: mk-swipe-arrow 1.6s ease-in-out infinite; }
.mk-swipe.done { opacity: 0; transform: translateY(-4px); pointer-events: none; }
/* a little track with a dot that slides left, like a finger swiping */
.mk-swipe-hint { position: relative; width: 34px; height: 18px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.mk-swipe-hint i { position: absolute; top: 3px; right: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); animation: mk-swipe-dot 1.6s ease-in-out infinite; }
@keyframes mk-swipe-dot { 0% { transform: translateX(0); opacity: 0; } 15% { opacity: 1; } 70% { transform: translateX(-16px); opacity: 1; } 100% { transform: translateX(-16px); opacity: 0; } }
@keyframes mk-swipe-arrow { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .mk-swipe svg, .mk-swipe-hint i { animation: none; } }


/* cards and the bento grid */
.mk-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
@media (min-width: 860px) { .mk-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mk-card { position: relative; overflow: hidden; isolation: isolate; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 26px; transition: transform .35s ease, border-color .35s, box-shadow .35s; }
.mk-card:hover { transform: translateY(-4px); border-color: var(--brand-100); box-shadow: 0 30px 50px -36px rgba(16, 24, 40, .45); }
.mk-spot::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--brand) 12%, transparent), transparent 60%); opacity: 0; transition: opacity .35s; }
.mk-spot:hover::before { opacity: 1; }
.mk-ic { width: 44px; height: 44px; border-radius: 13px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; margin-bottom: 18px; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.mk-card:hover .mk-ic { transform: rotate(-6deg) scale(1.06); }
.mk-ic svg { width: 21px; height: 21px; }
.mk-card h3 { margin: 0 0 6px; font-size: 1.08rem; }
.mk-card p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.55; max-width: 44ch; }
.mk-bento { display: grid; gap: 16px; grid-template-columns: 1fr; grid-auto-flow: dense; }
@media (min-width: 640px) { .mk-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mk-bento .wide { grid-column: span 2; } }
@media (min-width: 1000px) { .mk-bento { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mk-bento .mk-card { display: flex; flex-direction: column; min-height: 220px; }
.mk-mini { margin-top: auto; padding-top: 22px; }
.mk-mini.books { display: flex; gap: 10px; }
.mk-mini.books > span { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); transition: transform .4s cubic-bezier(.2, .7, .2, 1); }
.mk-mini.books b { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-mini.books em { font-style: normal; font-size: .78rem; color: var(--muted); }
.mk-card:hover .mk-mini.books > span:nth-child(1) { transform: translateY(-4px); } .mk-card:hover .mk-mini.books > span:nth-child(2) { transform: translateY(-8px); } .mk-card:hover .mk-mini.books > span:nth-child(3) { transform: translateY(-4px); }
.mk-mini.avatars { display: flex; }
.mk-mini.avatars span { width: 38px; height: 38px; margin-left: -8px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: #fff; border: 2px solid var(--surface); transition: margin .35s ease; }
.mk-mini.avatars span:first-child { margin-left: 0; background: var(--brand); }
.mk-mini.avatars span:nth-child(2) { background: var(--save); } .mk-mini.avatars span:nth-child(3) { background: var(--income); }
.mk-mini.avatars .add { background: var(--surface-2); color: var(--muted); border-style: dashed; border-color: var(--line); }
.mk-mini.avatars .add svg { width: 16px; height: 16px; }
.mk-card:hover .mk-mini.avatars span + span { margin-left: 4px; }
.mk-mini.codes { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.mk-codes-track { display: flex; gap: 8px; width: max-content; animation: mk-marq 26s linear infinite; }
.mk-codes-track > span:not(.cur-chip) { padding: 6px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; color: var(--text-2); }
.mk-mini.todo { display: grid; gap: 8px; }
.mk-mini.todo span { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: var(--bg); font-size: .86rem; color: var(--text-2); }
.mk-mini.todo svg { width: 16px; height: 16px; color: var(--brand); flex: none; }
.mk-mini.todo .done { color: var(--muted); text-decoration: line-through; } .mk-mini.todo .done svg { color: var(--ok); }
.mk-mini.todo em { margin-left: auto; font-style: normal; font-size: .75rem; font-weight: 600; color: var(--debt); white-space: nowrap; }
.mk-mini.themes { display: flex; padding-left: 4px; }
.mk-mini.themes span { width: 86px; height: 56px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(#fff 0 30%, #F1F3F6 30% 34%, #fff 34%); box-shadow: 0 10px 20px -14px rgba(16, 24, 40, .4); transition: transform .4s ease; }
.mk-mini.themes .dk { margin-left: -26px; margin-top: 14px; background: linear-gradient(#161A21 0 30%, #262D38 30% 34%, #161A21 34%); border-color: #262D38; }
.mk-card:hover .mk-mini.themes .lt { transform: rotate(-5deg); } .mk-card:hover .mk-mini.themes .dk { transform: rotate(5deg) translateX(8px); }
.mk-mini.sync { position: relative; width: 56px; height: 56px; display: grid; place-items: center; color: var(--brand); }
.mk-mini.sync svg { width: 26px; height: 26px; position: relative; z-index: 1; }
.mk-mini.sync i { position: absolute; inset: 22px 0 0; border-radius: 50%; border: 2px solid var(--brand-100); animation: mk-ping 2.6s ease-out infinite; }
.mk-mini.sync i + i { animation-delay: 1.3s; }

.mk-mini.file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); margin-top: auto; }
.mk-bento .mk-mini.file { margin-top: 22px; }
.mk-file-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); flex: none; overflow: hidden; }
.mk-file-ic svg { width: 17px; height: 17px; }
.mk-card:hover .mk-file-ic svg { animation: mk-drop .9s ease-in-out infinite; }
@keyframes mk-drop { 0% { transform: translateY(-140%); } 45%, 60% { transform: none; } 100% { transform: translateY(140%); } }
.mk-mini.file b { display: block; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-mini.file span:last-child { min-width: 0; }
.mk-mini.file em { font-style: normal; font-size: .76rem; color: var(--muted); }
.mk-mini.devices { display: flex; align-items: flex-end; gap: 14px; }
.mk-mini.devices span { display: block; border: 2px solid var(--text-2); border-radius: 8px; background: linear-gradient(var(--brand-50), var(--surface)); transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.mk-mini.devices .ph { width: 26px; height: 46px; border-radius: 7px; }
.mk-mini.devices .tb { width: 50px; height: 64px; }
.mk-mini.devices .lp { width: 96px; height: 58px; position: relative; border-bottom-width: 2px; border-radius: 8px 8px 2px 2px; }
.mk-mini.devices .lp i { position: absolute; left: -12px; right: -12px; bottom: -8px; height: 6px; border-radius: 0 0 6px 6px; background: var(--text-2); }
.mk-card:hover .mk-mini.devices .ph { transform: translateY(-6px); } .mk-card:hover .mk-mini.devices .tb { transform: translateY(-4px); } .mk-card:hover .mk-mini.devices .lp { transform: translateY(-2px); }

/* free month: a slowly turning border of light */
.mk-glow { position: relative; z-index: 0; border-radius: 32px; padding: 2px; background: conic-gradient(from var(--ang), var(--brand-100), var(--brand), var(--amber), var(--save), var(--brand-100)); animation: mk-spin 9s linear infinite; }
.mk-glow::after { content: ""; position: absolute; inset: 18px; z-index: -1; border-radius: inherit; background: inherit; filter: blur(34px); opacity: .32; }
.mk-glow.narrow { max-width: 920px; margin: 0 auto; }
@keyframes mk-spin { to { --ang: 360deg; } }
.mk-price-teaser { display: grid; gap: 32px; align-items: center; padding: 52px; border-radius: 30px; background: radial-gradient(120% 120% at 0% 0%, var(--brand-50), var(--surface) 55%); }
.mk-price-teaser p { margin: 0 0 26px; color: var(--text-2); font-size: 1.08rem; max-width: 44ch; line-height: 1.6; }
.mk-price-teaser .mk-badge { margin-bottom: 14px; }
.mk-price-teaser .mk-note, .mk-plan-card .mk-note { display: flex; }
@media (min-width: 860px) { .mk-price-teaser { grid-template-columns: 1.2fr 1fr; padding: 64px; } }
.mk-plan-card { display: grid; gap: 32px; padding: 48px; border-radius: 30px; background: radial-gradient(120% 120% at 0% 0%, var(--brand-50), var(--surface) 55%); }
.mk-badge { display: inline-block; background: var(--brand-50); color: var(--brand-600); font-weight: 600; font-size: .85rem; border-radius: 999px; padding: 4px 12px; border: 1px solid var(--brand-100); }
.mk-price { margin: 18px 0 24px; }
.mk-price > b { display: block; white-space: nowrap; font-size: clamp(2.8rem, 6vw, 3.8rem); line-height: 1; letter-spacing: -.05em; font-weight: 800; }
.mk-price > span { display: block; margin-top: 6px; color: var(--muted); }
.mk-fine { color: var(--muted); font-size: .92rem; max-width: 62ch; margin: 32px auto 0; }
@media (min-width: 800px) { .mk-plan-card { grid-template-columns: 1fr 1fr; align-items: center; gap: 56px; } }

/* questions */
.mk-faq details { border-bottom: 1px solid var(--line); }
.mk-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0; font-weight: 600; font-size: 1.06rem; transition: color .2s; }
.mk-faq summary:hover { color: var(--brand-600); }
.mk-faq summary::-webkit-details-marker { display: none; }
.mk-plus { position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); transition: background-color .3s, transform .4s ease; }
.mk-plus::before, .mk-plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px; border-radius: 2px; background: var(--text-2); transition: transform .4s ease, background-color .3s; }
.mk-plus::after { transform: rotate(90deg); }
.mk-faq details[open] .mk-plus { background: var(--brand); transform: rotate(180deg); }
.mk-faq details[open] .mk-plus::before, .mk-faq details[open] .mk-plus::after { background: #fff; }
.mk-faq details[open] .mk-plus::after { transform: rotate(0deg); }
.mk-faq p { margin: 0 0 24px; color: var(--text-2); line-height: 1.7; max-width: 68ch; }
.mk-faq details[open] .mk-faq-a { animation: mk-up .45s cubic-bezier(.2, .7, .2, 1); }

/* last call to action */
.mk-end { position: relative; isolation: isolate; overflow: clip; background: #E85C1A; color: #fff; text-align: center; padding: 96px 0; }
.mk-end h2 { font-size: clamp(2.1rem, 5.4vw, 3.8rem); letter-spacing: -.045em; line-height: 1.02; font-weight: 800; margin: 0 0 16px; }
.mk-end p { font-size: 1.1rem; max-width: 52ch; margin: 0 auto 30px; color: rgba(255, 255, 255, .92); line-height: 1.6; }
.mk-end .mk-note { display: flex; justify-content: center; }

/* inner page heads and text pages */
.mk-page-hero { position: relative; isolation: isolate; overflow: clip; padding: calc(var(--hdr) + 88px) 0 72px; text-align: center; }
.mk-page-hero h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); line-height: 1.02; letter-spacing: -.045em; font-weight: 800; margin: 0 auto 18px; max-width: 16ch; }
.mk-page-hero .mk-note { display: flex; justify-content: center; }
.mk-prose { font-size: 1.07rem; line-height: 1.8; color: var(--text-2); }
.mk-prose p { margin: 0 0 18px; }
.mk-doc { background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 44px; box-shadow: 0 30px 60px -48px rgba(16, 24, 40, .4); }
.mk-doc h3, .mk-doc h2 { color: var(--text); font-size: 1.15rem; margin: 30px 0 6px; letter-spacing: -.01em; }
.mk-doc h3:first-child, .mk-doc .mk-updated + h2 { margin-top: 0; }
.mk-doc p:last-child { margin-bottom: 0; }

/* footer with a big quiet name at the bottom */
.pub .pub-foot { position: relative; overflow: hidden; display: block; text-align: left; padding: 0; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.pub-auth .pub-foot { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.pub-foot-in { display: grid; gap: 32px; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 1208px; margin: 0 auto; padding: 56px 24px 32px; }
.pub-foot-brand { grid-column: 1 / -1; }
.pub-foot-brand p { margin: 12px 0 18px; font-size: .95rem; }
.pub-foot-col h4, .pub-foot-col h2 { margin: 0 0 12px; font-size: .9rem; color: var(--text); }
.pub-foot-col a { display: block; width: fit-content; color: var(--muted); padding: 5px 0; font-size: .93rem; transition: color .2s, transform .2s; }
.pub-foot-col a:hover { color: var(--brand-600); text-decoration: none; transform: translateX(3px); }
.pub-foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; max-width: 1208px; margin: 0 auto; padding: 20px 24px 28px; border-top: 1px solid var(--line-2); font-size: .85rem; }
@media (min-width: 900px) { .pub-foot-in { grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); } .pub-foot-brand { grid-column: auto; } }

/* small screens */
@media (max-width: 700px) {
  .mk-wrap { padding: 0 18px; }
  .mk-hero { padding: calc(var(--hdr) + 40px) 0 80px; }
  .mk-hero-visual { margin-top: 48px; }
  .mk-hero-visual .mk-shot { width: 100%; }
  .mk-hero-visual .mk-phone { width: 30%; right: 0; bottom: -40px; }
  .mk-float { padding: 7px 11px 7px 7px; gap: 8px; border-radius: 13px; }
  .mk-float b { font-size: .8rem; } .mk-float small { font-size: .68rem; }
  .mk-float-ic { width: 28px; height: 28px; border-radius: 9px; } .mk-float-ic svg { width: 15px; height: 15px; }
  .mk-ring { width: 30px; height: 30px; }
  .mk-float.f1 { top: -22px; left: 4px; }
  .mk-float.f2 { bottom: -30px; left: 4px; }
  .mk-float.f3 { display: none; }
  .mk-strip { padding: 16px 0; }
  .mk-stats { padding: 56px 0 0; }
  .mk-sec, .mk-quote, .mk-end { padding: 72px 0; }
  .mk-end { padding-bottom: 84px; }
  .mk-sec.pt0 { padding-top: 0; }
  .mk-page-hero { padding: calc(var(--hdr) + 48px) 0 44px; }
  .mk-head { margin-bottom: 36px; }
  .mk-pane { padding: 28px 22px; border-radius: 22px; }
  .mk-tab { padding: 12px; }
  .mk-show-stage { border-radius: 22px; }
  .mk-feature { padding: 28px 0; gap: 24px; }
  .mk-feature-v { padding: 16px; border-radius: 22px; }
  .mk-feature-v.is-phone { padding: 28px 16px; }
  .mk-price-teaser, .mk-plan-card { padding: 30px 22px; border-radius: 26px; }
  .mk-glow { border-radius: 28px; }
  .mk-week { padding: 24px; }
  .mk-ctas .btn { flex: 1 1 100%; }
  .mk-compare { min-width: 540px; font-size: .88rem; }
  .mk-compare th, .mk-compare td { padding: 12px 10px; }
  .mk-compare th:first-child, .mk-compare td:first-child { min-width: 148px; box-shadow: 1px 0 0 var(--line-2); }
  .mk-swipe { display: flex; }
  .mk-grid .mk-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 14px; padding: 20px; }
  .mk-grid .mk-card .mk-ic { grid-row: span 2; margin: 0; }
  .mk-bento .mk-card { min-height: 0; padding: 22px; }
  .mk-doc { padding: 26px 20px; border-radius: 22px; }
  .mk-tl-line { left: 17px; }
  .mk-tl-head .mk-week-n { width: 36px; height: 36px; font-size: 1rem; }
  .mk-tl-head { gap: 14px; }
  .mk-tl-days { padding-left: 46px; }
  .mk-tl-days li::before { left: -35px; }
  .pub-foot-in { padding-top: 44px; }
}
@media (max-width: 360px) {
  .mk-h1 { font-size: 2.3rem; }
  .mk-mini.books > span { padding: 10px; }
  .mk-mini.books > span:nth-child(3) { display: none; }
}

/* calm mode: everything is simply there */
@media (prefers-reduced-motion: reduce) {
  .mk-bg span, .mk-marquee-track, .mk-codes-track, .mk-glow, .mk-btn::after, .mk-mini.sync i { animation: none !important; }
  .mk-marquee-track { flex-wrap: wrap; justify-content: center; width: auto; }
  .mk-marquee-set[aria-hidden] { display: none; }
  .mk-live [data-r], .mk-live .mk-pane li, .mk-live .mk-table-wrap .yes svg { opacity: 1 !important; transform: none !important; transition: none !important; }
  .mk-live .mk-h1 .w, .mk-live .mk-ul path, .mk-live .mk-hero-visual, .mk-live .mk-float, .mk-live .mk-ring .val { animation: none !important; }
  .mk-tl-line i { transform: none; }
}

/* ---------- v2.9: phone frame, currencies, calculator, contact, legal pages, sign-up ---------- */
/* a modern large phone: metal band, thin bezel, camera island and status bar */
.mk-phone { position: relative; margin: 0; width: 100%; max-width: 290px; container-type: inline-size; }
.mk-frame { padding: 1.1cqw; border-radius: 16.5cqw; background: linear-gradient(150deg, #b9bbc1, #5b5e66 16%, #2f3137 48%, #62656d 84%, #c3c5ca); box-shadow: 0 2px 6px rgba(16, 24, 40, .12), 0 44px 70px -32px rgba(16, 24, 40, .6); }
.mk-bezel { padding: 2.2cqw; border-radius: 15.4cqw; background: #07080a; }
.mk-screen { position: relative; overflow: hidden; border-radius: 13cqw; background: #fff; }
.mk-sb { position: relative; height: 11.6cqw; display: flex; align-items: center; justify-content: space-between; padding: 1.4cqw 7cqw 0 9.5cqw; color: #0b0c0f; font: 600 3.9cqw/1 var(--font); letter-spacing: -.01em; }
.mk-island { position: absolute; left: 50%; top: 2.5cqw; width: 27cqw; height: 7.8cqw; margin-left: -13.5cqw; border-radius: 6cqw; background: #000; }
.mk-sbi { display: inline-flex; align-items: center; gap: 1.3cqw; }
.mk-sbi svg { height: 2.9cqw; width: auto; fill: currentColor; }
.mk-sbi svg:last-child { height: 3.1cqw; }
.mk-screen img { display: block; width: 100%; height: auto; }
.mk-phone::before, .mk-phone::after { content: ""; position: absolute; width: 3px; background: linear-gradient(90deg, #6b6e75, #a7a9ae); }
.mk-phone::before { right: -2px; top: 27%; height: 11%; border-radius: 0 3px 3px 0; }
.mk-phone::after { left: -2px; top: 19%; height: 20%; border-radius: 3px 0 0 3px; background: linear-gradient(#80838a 0 22%, transparent 22% 32%, #80838a 32% 62%, transparent 62% 70%, #80838a 70%); }
.mk-slide.is-phone { padding: 5% 7%; }
.mk-slide.is-phone .mk-phone { width: 36%; max-width: none; }
@media (max-width: 959px) { .mk-slide.is-phone .mk-phone { width: 38%; } }
.mk-feature-v.is-phone .mk-phone { max-width: 290px; }
@media (max-width: 700px) { .mk-feature-v.is-phone .mk-phone { max-width: 240px; } }

/* currency badges */
.cur-ic { --h: 214; display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; font: 700 .82rem/1 var(--font); color: #fff; letter-spacing: -.02em; background: radial-gradient(120% 120% at 30% 20%, hsl(var(--h) 75% 62%), hsl(var(--h) 70% 42%)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 2px 6px -2px hsl(var(--h) 60% 30% / .5); }
.cur-ic[data-long] { font-size: .62rem; }
.cur-ic.sm { width: 20px; height: 20px; font-size: .64rem; } .cur-ic.sm[data-long] { font-size: .5rem; }
.cur-ic.lg { width: 44px; height: 44px; font-size: 1.1rem; } .cur-ic.lg[data-long] { font-size: .82rem; }
.cur-ic.plus { background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); font-size: .85rem; }
.cur-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: .84rem; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.mk-codes-track { gap: 8px; }
.mk-marquee-set .cur-ic { margin-right: -1px; }
.mk-mini.books > span { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; align-items: center; }
.mk-mini.books .cur-ic { grid-row: span 2; }
.mk-cur-wall { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.mk-cur { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; transition: transform .3s ease, border-color .3s; }
.mk-cur:hover { transform: translateY(-3px); border-color: var(--brand-100); }
.mk-cur b { display: block; font-size: .98rem; }
.mk-cur em { display: block; font-style: normal; color: var(--muted); font-size: .85rem; }
.mk-cur.more { border-style: dashed; }

/* small promises next to calls to action */
.mk-promise { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin: 16px 0 0; padding: 0; color: var(--muted); font-size: .88rem; }
.mk-promise li { display: inline-flex; align-items: center; gap: 6px; }
.mk-promise svg { width: 15px; height: 15px; color: var(--ok); }
.mk-promise.light { color: rgba(255, 255, 255, .9); } .mk-promise.light svg { color: #fff; }
.mk-price-teaser .mk-promise, .mk-plan-card .mk-promise { justify-content: flex-start; }

.mk-head-ic { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; margin-bottom: 16px; background: var(--brand-50); color: var(--brand-600); border: 1px solid var(--brand-100); }
.mk-head-ic svg { width: 22px; height: 22px; }
@media (min-width: 1000px) { .mk-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 640px) and (max-width: 999px) { .mk-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mk-pill.static { pointer-events: none; padding: 5px 14px 5px 10px; margin-bottom: 22px; color: var(--brand-600); font-weight: 600; }
.mk-pill.static svg { width: 16px; height: 16px; color: var(--brand); }

/* the small leak calculator */
.mk-leak { display: grid; gap: 0; border-radius: 30px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 40px 80px -50px rgba(16, 24, 40, .45); }
.mk-leak-in { padding: 40px; }
.mk-leak-l { display: block; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.mk-leak-val { display: flex; align-items: baseline; gap: 2px; font-size: clamp(3rem, 7vw, 4.4rem); font-weight: 800; letter-spacing: -.05em; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.mk-leak-val span { font-size: 1rem; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 10px; }
.mk-leak input[type=range] { --pct: 14%; -webkit-appearance: none; appearance: none; width: 100%; height: 8px; margin: 26px 0 22px; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--amber)) 0 / var(--pct) 100% no-repeat, var(--surface-2); outline: none; cursor: pointer; }
.mk-leak input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 4px 12px -2px rgba(232, 92, 26, .5); transition: transform .15s; }
.mk-leak input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 4px 12px -2px rgba(232, 92, 26, .5); }
.mk-leak input[type=range]:active::-webkit-slider-thumb { transform: scale(1.12); }
.mk-leak input[type=range]:focus-visible { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent); }
.mk-leak-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-leak-p { font: inherit; font-size: .88rem; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; transition: border-color .2s, background-color .2s, color .2s; }
.mk-leak-p b { color: var(--text); font-weight: 700; }
.mk-leak-p:hover { border-color: var(--brand-100); background: var(--brand-50); }
.mk-leak-p[aria-pressed=true] { border-color: var(--brand); background: var(--brand-50); color: var(--brand-600); }
.mk-leak-hint { margin: 16px 0 0; color: var(--muted); font-size: .9rem; }
.mk-leak-out { display: grid; gap: 12px; align-content: center; padding: 40px; background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--amber) 18%, transparent), transparent 60%), var(--brand-50); }
.mk-leak-out > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 18px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 80%, transparent); }
.mk-leak-out > div span { color: var(--text-2); }
.mk-leak-out > div b { font-size: 1.35rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mk-leak-out > div.big { background: var(--surface); box-shadow: 0 16px 30px -24px rgba(16, 24, 40, .5); }
.mk-leak-out > div.big b { font-size: clamp(1.8rem, 4vw, 2.4rem); color: var(--brand-600); }
.mk-leak-save { margin: 6px 0 12px; color: var(--text-2); }
.mk-leak-save b { color: var(--ok); }
@media (min-width: 900px) { .mk-leak { grid-template-columns: 1.1fr 1fr; } .mk-leak-in, .mk-leak-out { padding: 52px; } }
@media (max-width: 700px) { .mk-leak-in, .mk-leak-out { padding: 26px 20px; } .mk-leak { border-radius: 24px; } .mk-leak-out .btn { width: 100%; } }

/* how-it-works steps */
.mk-steps { display: grid; gap: 16px; counter-reset: st; }
@media (min-width: 760px) { .mk-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mk-steps.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .mk-steps.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mk-step { position: relative; padding: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.mk-step .mk-ic { margin-bottom: 14px; }
.mk-step-n { position: absolute; top: 18px; right: 20px; font-size: 2.6rem; font-weight: 800; letter-spacing: -.05em; line-height: 1; color: var(--surface-2); }
.mk-step small { display: block; color: var(--brand-600); font-weight: 700; font-size: .85rem; margin-bottom: 4px; }
.mk-step h3 { margin: 0 0 6px; font-size: 1.1rem; }
.mk-step p { margin: 0; color: var(--muted); line-height: 1.55; }
.mk-callout { display: flex; gap: 16px; align-items: flex-start; margin-top: 44px; padding: 24px; border-radius: 22px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.mk-callout .mk-ic { margin: 0; background: var(--surface); }
.mk-callout h3 { margin: 2px 0 4px; font-size: 1.1rem; }
.mk-callout p { margin: 0; color: var(--text-2); line-height: 1.6; }

/* jump links on the features page */
.mk-jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 32px; }
.mk-jump a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--line); color: var(--text-2); font-size: .9rem; font-weight: 500; transition: border-color .2s, color .2s, transform .2s; }
.mk-jump a:hover { text-decoration: none; border-color: var(--brand); color: var(--brand-600); transform: translateY(-2px); }
.mk-jump svg { width: 16px; height: 16px; color: var(--brand); }
@media (max-width: 700px) { .mk-jump { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 26px -18px 0; padding: 0 18px 6px; scrollbar-width: none; } .mk-jump::-webkit-scrollbar { display: none; } .mk-jump a { flex: none; } }

/* about */
.mk-about { display: grid; gap: 32px; align-items: start; }
.mk-mission { padding: 32px; border-radius: 26px; color: #fff; background: #E85C1A; box-shadow: 0 30px 60px -36px rgba(232, 92, 26, .7); }
.mk-mission small { display: block; font-weight: 600; opacity: .85; margin-bottom: 10px; }
.mk-mission p { margin: 0; font-size: clamp(1.35rem, 2.6vw, 1.7rem); font-weight: 700; line-height: 1.3; letter-spacing: -.02em; }
@media (min-width: 900px) { .mk-about { grid-template-columns: 1.5fr 1fr; gap: 56px; } .mk-mission { position: sticky; top: calc(var(--hdr) + 24px); } }
.mk-stats.about { padding: 8px 0 96px; }
.mk-cost { display: grid; gap: 24px; align-items: center; padding: 40px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); }
.mk-cost p { margin: 0; color: var(--text-2); font-size: 1.05rem; line-height: 1.6; max-width: 56ch; }
.mk-cost .mk-h { margin-bottom: 10px; }
@media (min-width: 860px) { .mk-cost { grid-template-columns: 1fr auto; padding: 48px 52px; } }
@media (max-width: 700px) { .mk-cost { padding: 26px 22px; } .mk-cost .btn { width: 100%; } }
.mk-center-block { text-align: center; }
.mk-center-block .mk-lead { margin-bottom: 24px; }

/* contact */
.mk-contact { display: grid; gap: 24px; align-items: start; }
@media (min-width: 960px) { .mk-contact { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 40px; } }
.mk-contact-side { display: grid; gap: 14px; }
.mk-contact-side .mk-card { padding: 22px; }
.mk-contact-side .mk-card .mk-ic { margin-bottom: 12px; }
.mk-form-card { padding: 36px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 40px 80px -56px rgba(16, 24, 40, .5); }
.mk-form-card h2 { margin: 0 0 20px; font-size: 1.5rem; letter-spacing: -.02em; }
.mk-form-row { display: grid; gap: 0 14px; }
@media (min-width: 640px) { .mk-form-row { grid-template-columns: 1fr 1fr; } }
.mk-form-card .field input, .mk-form-card .field textarea { min-height: 48px; border-radius: 12px; }
.mk-form-card .field textarea { min-height: 150px; }
.mk-topics { border: 0; margin: 0 0 16px; padding: 0; }
.mk-topics legend { font-size: .85rem; font-weight: 600; color: var(--text-2); margin-bottom: 8px; padding: 0; }
.mk-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-topic { position: relative; }
.mk-topic input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mk-topic span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: .88rem; color: var(--text-2); background: var(--surface); transition: border-color .2s, background-color .2s, color .2s; }
.mk-topic input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.mk-topic input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.mk-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mk-form-note { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: .85rem; }
.mk-sent { text-align: center; padding: 28px 8px; }
.mk-sent-ic { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); margin-bottom: 14px; animation: mk-pop .6s cubic-bezier(.3, 1.4, .5, 1) both; }
.mk-sent-ic svg { width: 30px; height: 30px; }
.mk-sent h2 { margin: 0 0 8px; }
.mk-sent p { color: var(--text-2); margin: 0 0 20px; }
@media (max-width: 700px) { .mk-form-card { padding: 24px 18px; border-radius: 22px; } }

/* privacy and terms */
.mk-summary { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.mk-summary span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .9rem; font-weight: 500; color: var(--text-2); }
.mk-summary svg { width: 16px; height: 16px; color: var(--ok); }
.mk-legal { display: grid; gap: 24px; align-items: start; }
@media (min-width: 960px) { .mk-legal { grid-template-columns: 250px minmax(0, 1fr); gap: 40px; max-width: 1100px; } .mk-toc { position: sticky; top: calc(var(--hdr) + 24px); } }
.mk-toc { display: grid; gap: 2px; padding: 18px; border-radius: 20px; background: var(--bg); border: 1px solid var(--line-2); font-size: .9rem; }
.mk-toc b { font-size: .85rem; color: var(--text); margin: 0 0 6px 10px; }
.mk-toc a { padding: 7px 10px; border-radius: 10px; color: var(--text-2); }
.mk-toc a:hover { background: var(--surface); color: var(--brand-600); text-decoration: none; }
@media (max-width: 959px) { .mk-toc { display: flex; flex-wrap: wrap; gap: 6px; } .mk-toc b { width: 100%; margin-left: 4px; } .mk-toc a { background: var(--surface); border: 1px solid var(--line-2); } }
.mk-updated { display: inline-block; margin: 0 0 24px !important; padding: 5px 12px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: .85rem; }
.mk-doc h3, .mk-doc h2 { scroll-margin-top: calc(var(--hdr) + 20px); }

/* footer bits */
.pub-foot-note { display: block; margin-top: 10px; color: var(--muted); font-size: .82rem; }
.pub-foot-mail { display: inline-flex; align-items: center; gap: 8px; }
.pub-foot-mail svg { width: 16px; height: 16px; }
.pub-foot-mail a { color: var(--text-2); }

/* call to action that follows you on a phone */
.mk-sticky-cta { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 45; display: none; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--line); box-shadow: 0 20px 40px -18px rgba(16, 24, 40, .45); transform: translateY(140%); transition: transform .4s cubic-bezier(.2, .7, .2, 1); }
.mk-sticky-cta.show { transform: none; }
.mk-sticky-cta b { display: block; font-size: .95rem; }
.mk-sticky-cta small { color: var(--muted); font-size: .8rem; }
.mk-sticky-cta .btn { min-height: 44px; padding: 0 20px; }
@media (max-width: 700px) { .mk-sticky-cta { display: flex; } }

/* sign up and log in */
.pub-auth .pub-main { max-width: 1208px; padding: 28px 24px 72px; }
.auth2 { display: grid; gap: 28px; align-items: start; }
.auth2-main { display: flex; flex-direction: column; align-items: center; }
.auth2-card { width: 100%; max-width: 470px; padding: 36px 34px 30px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 40px 80px -50px rgba(16, 24, 40, .5); animation: mk-up .6s cubic-bezier(.2, .7, .2, 1) both; }
.auth2-card h1 { font-size: clamp(1.65rem, 3.2vw, 2.1rem); line-height: 1.1; letter-spacing: -.035em; font-weight: 800; margin: 0 0 6px; }
.auth2-card .sub { color: var(--muted); margin: 0 0 26px; }
.auth2-card .field { margin-bottom: 16px; }
.auth2-card .field > span, .auth2-card .field > label, .field-top { display: block; font-size: .87rem; font-weight: 600; margin: 0 0 7px; color: var(--text-2); }
.auth2-card .field > .field-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.field-top label { font: inherit; color: inherit; }
.field-top a { font-weight: 500; }
.auth2-card .field input { min-height: 50px; border-radius: 13px; padding: 12px 14px; font-size: 1rem; }
.auth2-card .btn.lg { min-height: 52px; border-radius: 13px; font-size: 1.02rem; margin-top: 6px; }
.auth2-card .auth-alt { margin-top: 22px; }
.auth2-step { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 14px; padding: 5px 12px 5px 9px; border-radius: 999px; background: var(--brand-50); color: var(--brand-600); font-size: .82rem; font-weight: 600; border: 1px solid var(--brand-100); }
.auth2-step svg { width: 15px; height: 15px; }
.auth2-remember { margin: 2px 0 16px; font-size: .9rem; }
.auth2-legal { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.auth2-trust { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin: 18px 0 0; padding: 0; color: var(--muted); font-size: .86rem; }
.auth2-trust li { display: inline-flex; align-items: center; gap: 6px; }
.auth2-trust svg { width: 15px; height: 15px; color: var(--ok); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px !important; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.pw-eye:hover { background: var(--surface-2); color: var(--text); }
.pw-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-eye[aria-pressed=false] .slash { display: none; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 9px; }
.pw-meter i { height: 4px; border-radius: 4px; background: var(--surface-2); transition: background-color .3s; }
.pw-meter[data-lv="1"] i:nth-child(-n+1) { background: var(--warn); }
.pw-meter[data-lv="2"] i:nth-child(-n+2) { background: var(--amber); }
.pw-meter[data-lv="3"] i:nth-child(-n+3) { background: #6CB33F; }
.pw-meter[data-lv="4"] i { background: var(--ok); }
.pw-label { margin-top: 6px !important; }
/* currency picker */
.cur-pick { position: relative; }
.cur-pick input[type=hidden] { display: none; }
.cur-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 14px 8px 10px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); text-align: left; font: inherit; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.cur-btn:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.cur-pick.open .cur-btn, .cur-btn:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.cur-btn .cur-ic { width: 34px; height: 34px; font-size: .95rem; }
.cur-btn .cur-ic[data-long] { font-size: .7rem; }
.cur-btn > span:not(.cur-ic) { flex: 1; min-width: 0; line-height: 1.25; }
.cur-btn b { display: block; font-size: .98rem; }
.cur-btn em, .cur-pop em { display: block; font-style: normal; color: var(--muted); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cur-btn .chev { width: 18px; height: 18px; color: var(--muted); transition: transform .25s; }
.cur-pick.open .cur-btn .chev { transform: rotate(180deg); }
.cur-pop { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; padding: 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 60px -20px rgba(16, 24, 40, .4); animation: mk-up .25s ease both; }
.cur-search { position: relative; margin-bottom: 6px; }
.cur-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.auth2-card .cur-search input { min-height: 44px; padding-left: 38px; border-radius: 11px; font-size: .95rem; box-shadow: none; background: var(--bg); }
.cur-pop ul { list-style: none; margin: 0; padding: 0; max-height: 264px; overflow-y: auto; outline: none; overscroll-behavior: contain; }
.cur-pop li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 11px; cursor: pointer; }
.cur-pop li > span:not(.cur-ic) { flex: 1; min-width: 0; line-height: 1.25; }
.cur-pop li b { display: block; font-size: .92rem; }
.cur-pop li:hover, .cur-pop li.act { background: var(--surface-2); }
.cur-pop li .tick { width: 17px; height: 17px; color: var(--brand); visibility: hidden; }
.cur-pop li[aria-selected=true] .tick { visibility: visible; }
.cur-pop li[aria-selected=true] b { color: var(--brand-600); }
/* the side panel with the phone */
.auth2-side { position: relative; isolation: isolate; overflow: hidden; display: none; border-radius: 30px; background: #E85C1A; color: #fff; min-height: 640px; }
.auth2-side-in { position: relative; padding: 48px 48px 0; height: 100%; display: flex; flex-direction: column; }
.auth2-badge { align-self: flex-start; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); font-size: .85rem; font-weight: 600; }
.auth2-side h2 { margin: 18px 0 18px; font-size: clamp(1.7rem, 2.6vw, 2.3rem); line-height: 1.12; letter-spacing: -.035em; font-weight: 800; max-width: 16ch; }
.auth2-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.auth2-list li { display: flex; gap: 10px; align-items: center; font-size: .98rem; color: rgba(255, 255, 255, .94); }
.auth2-list svg { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: rgba(255, 255, 255, .2); flex: none; }
.auth2-quote { margin: 0; font-size: 1.15rem; line-height: 1.5; color: rgba(255, 255, 255, .92); max-width: 30ch; }
.auth2-quote small { display: block; margin-top: 8px; font-size: .85rem; opacity: .8; }
.auth2-phone { margin-top: auto; padding-top: 36px; display: flex; justify-content: center; }
.auth2-phone .mk-phone { width: 62%; max-width: 300px; margin-bottom: -38%; animation: mk-rise 1s cubic-bezier(.2, .7, .2, 1) .2s both; }
.auth2.single { justify-items: center; }
.auth2.single .auth2-card { margin-top: 24px; }
@media (min-width: 980px) {
  .auth2:not(.single) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: stretch; }
  .auth2:not(.single) .auth2-main { justify-content: center; }
  .auth2-side { display: block; }
}
@media (max-width: 560px) {
  .pub-auth .pub-main { padding: 16px 14px 56px; }
  .auth2-card { padding: 26px 20px 22px; border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) { .auth2-card, .auth2-phone .mk-phone, .cur-pop { animation: none; } }
@media (max-width: 560px) {
  .mk-mini.books > span { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; }
  .mk-mini.books > span:nth-child(3) { display: flex; }
}
@media (max-width: 959px) { .mk-contact .mk-form-card { order: -1; } }

/* ---------- v2.10: about page story, mission cards, footer ---------- */
.mk-story { display: grid; gap: 40px; align-items: start; }
@media (min-width: 960px) { .mk-story { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 64px; } }
.mk-story .mk-h { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-bottom: 18px; }
.mk-miles { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 14px; }
.mk-miles::before { content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 2px; background: linear-gradient(var(--brand-100), var(--line)); }
.mk-miles li { position: relative; display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px 16px 0; }
.mk-miles .mk-ic { position: relative; z-index: 1; margin: 0; flex: none; box-shadow: 0 0 0 6px var(--surface); }
.mk-miles li:last-child .mk-ic { background: var(--brand); color: #fff; }
.mk-miles h3 { margin: 2px 0 4px; font-size: 1.05rem; }
.mk-miles p { margin: 0; color: var(--muted); line-height: 1.55; }
@media (min-width: 960px) { .mk-miles { padding: 22px 24px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 60px -48px rgba(16, 24, 40, .45); } .mk-miles::before { left: 45px; } }
.mk-mv { display: grid; gap: 16px; }
@media (min-width: 860px) { .mk-mv { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mk-mv-card { position: relative; overflow: hidden; padding: 30px 28px 32px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); transition: transform .35s ease, box-shadow .35s ease, border-color .35s; }
.mk-mv-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--brand), var(--amber)); }
.mk-mv-card:hover { transform: translateY(-4px); border-color: var(--brand-100); box-shadow: 0 30px 50px -36px rgba(16, 24, 40, .45); }
.mk-mv-label { display: inline-flex; align-items: center; gap: 8px; color: var(--brand-600); font-weight: 700; font-size: .9rem; margin-bottom: 14px; }
.mk-mv-label svg { width: 18px; height: 18px; }
.mk-mv-card p { margin: 0; font-size: clamp(1.12rem, 1.8vw, 1.3rem); line-height: 1.4; font-weight: 700; letter-spacing: -.015em; color: var(--text); }
.mk-mv-card:first-child { background: linear-gradient(160deg, var(--brand-50), var(--surface) 70%); border-color: var(--brand-100); }
.pub-foot-free { display: inline-flex; align-items: center; gap: 6px; margin: 0 !important; font-size: .88rem; color: var(--text-2); }
.pub-foot-free svg { width: 15px; height: 15px; color: var(--ok); }
.pub-social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.pub-social a { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); transition: color .2s, border-color .2s, background .2s, transform .2s; }
.pub-social a:hover { color: #fff; background: var(--brand); border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
.pub-social a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pub-social svg { width: 19px; height: 19px; }

/* ---------- v2.11: plan & billing, secure card form, paywall ---------- */
.bl { display: grid; gap: 18px; max-width: 980px; }
.bl-status { overflow: hidden; }
.bl-status-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; padding: 22px 22px 24px; }
.bl-status h2 { margin: 10px 0 6px; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.03em; }
.bl-status p { margin: 0; color: var(--text-2); max-width: 60ch; line-height: 1.55; }
.bl-status .badge { font-size: .8rem; padding: 4px 10px; }
.bl-status.active, .bl-status.admin { background: linear-gradient(150deg, var(--ok-bg), var(--surface) 55%); }
.bl-status.trial { background: linear-gradient(150deg, var(--brand-50), var(--surface) 55%); }
.bl-status.expired, .bl-status.past_due { background: linear-gradient(150deg, var(--warn-bg), var(--surface) 55%); }
.bl-card { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .88rem; color: var(--text-2); }
.bl-card svg { width: 16px; height: 16px; color: var(--muted); }
.bl-thanks { display: flex; gap: 12px; align-items: center; margin: 0 22px 22px; padding: 14px 16px; border-radius: 14px; background: var(--ok-bg); color: var(--ok); animation: mk-up .5s ease both; }
.bl-thanks > svg { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--ok); color: #fff; flex: none; }
.bl-thanks b { display: block; color: var(--text); }
.bl-thanks span { color: var(--text-2); font-size: .9rem; }
.bl-thanks > div { flex: 1; min-width: 0; }
.bl-thanks-x { margin-left: auto; flex: none; color: var(--text-2); }
.bl-checkout { display: grid; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
@media (min-width: 860px) { .bl-checkout { grid-template-columns: 1fr 1.1fr; } }
.bl-summary { padding: 26px; background: radial-gradient(120% 100% at 0% 0%, var(--brand-50), transparent 60%), var(--surface-2); }
.bl-logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1rem; }
.bl-logo .logo-mark { width: 26px; height: 26px; }
.bl-summary h2 { margin: 18px 0 6px; font-size: 1.05rem; color: var(--text-2); font-weight: 600; }
.bl-price { margin: 0 0 18px; display: flex; align-items: baseline; gap: 4px; }
.bl-price b { font-size: 2.6rem; letter-spacing: -.04em; line-height: 1; }
.bl-price span { color: var(--muted); }
.bl-summary ul { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 9px; }
.bl-summary li { display: flex; gap: 9px; align-items: flex-start; color: var(--text-2); font-size: .93rem; }
.bl-summary li svg { width: 18px; height: 18px; color: var(--ok); flex: none; margin-top: 1px; }
.bl-lines { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.bl-lines div { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; color: var(--text-2); }
.bl-lines div:first-child b { font-size: 1.05rem; color: var(--text); }
.bl-small { margin: 14px 0 0; font-size: .82rem; color: var(--muted); }
.bl-form { padding: 26px; display: grid; gap: 14px; align-content: start; }
.bl-form-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bl-form-head h3 { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.bl-form-head h3 .lk { width: 20px; height: 20px; color: var(--brand); }
.lk { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }
.bl-fields { display: grid; gap: 10px; }
.bl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bl-field { display: block; }
.bl-field > span { display: block; font-size: .84rem; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.bl-host { min-height: 50px; }
.bl-host iframe { width: 100% !important; }
.bl-input { display: block; width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 16px; color: var(--text); }
.bl-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.bl-loading { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: .9rem; }
.bl-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: ptr-spin .8s linear infinite; }
.bl-consent { margin: 0; font-size: .82rem; color: var(--muted); line-height: 1.5; }
.bl-pay { min-height: 52px; font-size: 1rem; border-radius: 13px; gap: 8px; }
.bl-pay .lk { width: 17px; height: 17px; }
.bl-pay.busy { position: relative; color: transparent !important; }
.bl-pay.busy::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: ptr-spin .8s linear infinite; }
.bl-hist { display: grid; }
.bl-hrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.bl-hrow:last-child { border-bottom: 0; }
.bl-hrow .t b { display: block; font-size: .95rem; }
.bl-hrow .t span { color: var(--muted); font-size: .82rem; }
.bl-hrow .amt { font-variant-numeric: tabular-nums; }
.bl-help { margin: 0; color: var(--muted); font-size: .88rem; }
.set-plan { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.set-plan .t b { display: block; }
.set-plan .t span { color: var(--muted); font-size: .88rem; }
a.trial-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; text-decoration: none; color: var(--brand-600); }
a.trial-note span { color: var(--text-2); font-weight: 400; }
a.trial-note > svg:last-child { margin-left: auto; width: 16px; height: 16px; }
a.pb-trial { text-decoration: none; }
a.pb-trial:hover { text-decoration: underline; }
/* paywall */
.pw { display: grid; place-items: center; padding: 24px 0 48px; }
.pw-in { width: 100%; max-width: 560px; text-align: center; padding: 36px 28px; border-radius: 24px; background: radial-gradient(120% 90% at 50% 0%, var(--brand-50), var(--surface) 60%); border: 1px solid var(--line); box-shadow: var(--shadow); animation: mk-up .5s ease both; }
.pw-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--surface); color: var(--brand); border: 1px solid var(--brand-100); }
.pw-ic svg { width: 26px; height: 26px; }
.pw h1 { margin: 16px 0 10px; font-size: clamp(1.5rem, 3.4vw, 2rem); letter-spacing: -.03em; line-height: 1.15; }
.pw-lead { margin: 0 auto 20px; max-width: 46ch; color: var(--text-2); line-height: 1.6; }
.pw-list { list-style: none; margin: 0 auto 22px; padding: 0; display: grid; gap: 8px; max-width: 340px; text-align: left; }
.pw-list li { display: flex; gap: 9px; align-items: center; color: var(--text-2); font-size: .94rem; }
.pw-list svg { width: 18px; height: 18px; color: var(--ok); flex: none; }
.pw-cta { width: 100%; max-width: 360px; }
.pw-note { display: inline-flex; align-items: center; gap: 6px; margin: 12px 0 0; color: var(--muted); font-size: .86rem; }
.pw-note svg { width: 15px; height: 15px; color: var(--ok); }
.pw-alt { margin: 18px 0 0; font-size: .88rem; color: var(--muted); }
@media (max-width: 560px) { .bl-form, .bl-summary { padding: 20px 16px; } .pw-in { padding: 28px 18px; } .bl-hrow { grid-template-columns: minmax(0, 1fr) auto; } .bl-hrow .badge { grid-column: 2; grid-row: 1; } .bl-hrow .amt { grid-column: 2; } .bl-hrow .bl-inv { grid-column: 1 / -1; justify-self: start; } .bl-hrow .bl-inv.none { display: none; } }
.mk-price > b small { font-size: .38em; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-left: 4px; }
.mk-price > span b { color: var(--text); font-weight: 700; }

/* v2.12 invoices & test mode */
.bl-inv { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line); color: var(--ink); font-size: .82rem; font-weight: 600; text-decoration: none; }
.bl-inv:hover { border-color: var(--brand); color: var(--brand); }
.bl-inv svg { width: 15px; height: 15px; }
.bl-inv.none { border: 0; padding: 0; }
.bl-test { margin: 0 0 12px; padding: 9px 12px; border-radius: 10px; background: #FFF7E6; color: #8A5300; font-size: .85rem; font-weight: 600; }

/* v2.13 company line in the footer */
.pub-foot-legal { max-width: 1208px; margin: 0 auto; padding: 0 24px 16px; font-size: .8rem; line-height: 1.55; color: var(--muted); }

/* v2.14 second card form: the hosts look like the other inputs */
.bl-sf .bl-host:not(#bl-name):not(.bl-host-name) { min-height: 50px; padding: 15px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.bl-sf .bl-host.StripeElement--focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.bl-sf .bl-host.StripeElement--invalid { border-color: #B42318; }

/* v2.15 e-mail confirmation note */
.verify-note { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.verify-note > svg { width: 22px; height: 22px; flex: none; color: var(--brand); }
.verify-note > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.verify-note span { color: var(--muted); font-size: .86rem; }
@media (max-width: 560px) { .verify-note { flex-wrap: wrap; } .verify-note .btn { width: 100%; } }

/* ===================== the blog (reasontra.com/blog) ===================== */
.blog-hero { padding: calc(var(--hdr) + 64px) 0 28px; }
.blog-hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.05; letter-spacing: -.04em; font-weight: 800; margin: 0 0 12px; max-width: 18ch; }
.blog-lead { font-size: 1.12rem; line-height: 1.6; color: var(--text-2); max-width: 60ch; margin: 0 0 22px; }
.blog-loading { color: var(--muted); }
.blog-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.blog-cats a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: .92rem; font-weight: 500; text-decoration: none; }
.blog-cats a:hover { border-color: var(--brand); color: var(--brand); }
.blog-cats a.on { background: var(--text); border-color: var(--text); color: var(--surface); }
.blog-list { padding: 18px 0 96px; }
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.blog-card { min-width: 0; }
.blog-card-a { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; transition: border-color .2s, transform .2s; }
.blog-card-a:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); transform: translateY(-2px); }
/* a card is one big link: no underline under its text; the title turns orange and the arrow moves instead */
.blog-card-a:hover, .blog-cats a:hover, .blog-tags a:hover, .blog-crumbs a:hover, .blog-by a:hover, .blog-share a:hover, .blog-toc a:hover, .blog-nextprev a:hover { text-decoration: none; }
.blog-card-a h2 { transition: color .2s; }
.blog-card-a:hover h2 { color: var(--brand-600); }
.blog-img img { transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.blog-card-a:hover .blog-img img { transform: scale(1.025); }
.blog-more { transition: transform .2s; }
.blog-card-a:hover .blog-more { transform: translateX(4px); }
.blog-card-a:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .blog-card-a, .blog-img img, .blog-more { transition: none; } .blog-card-a:hover, .blog-card-a:hover .blog-img img, .blog-card-a:hover .blog-more { transform: none; } }
.blog-img { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.blog-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-img-empty { display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-50), var(--surface-2)); }
.blog-img-empty span { font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; color: var(--brand); padding: 0 20px; text-align: center; }
.blog-card-b { padding: 18px 20px 22px; }
.blog-card h2 { font-size: 1.18rem; line-height: 1.3; letter-spacing: -.015em; margin: 8px 0 8px; color: var(--text); }
.blog-card p { margin: 0; color: var(--text-2); line-height: 1.55; font-size: .97rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-card.big { margin-bottom: 22px; }
.blog-card.big .blog-card-a { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.blog-card.big .blog-img { aspect-ratio: auto; min-height: 300px; }
.blog-card.big .blog-card-b { padding: 34px; align-self: center; }
.blog-card.big h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.15; letter-spacing: -.03em; }
.blog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: .86rem; }
.blog-tag { color: var(--brand); font-weight: 600; text-decoration: none; }
.blog-empty { text-align: center; padding: 60px 20px; border: 1px dashed var(--line); border-radius: 22px; background: var(--surface); }
.blog-empty h2 { margin: 0 0 8px; font-size: 1.4rem; }
.blog-empty p { color: var(--text-2); margin: 0 0 20px; }
.blog-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 34px; color: var(--muted); }
.blog-h2 { font-size: 1.4rem; letter-spacing: -.02em; margin: 0 0 18px; }

.blog-post { padding-bottom: 40px; }
.blog-read { max-width: 760px; }
.blog-post-h { padding: calc(var(--hdr) + 48px) 0 26px; }
.blog-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .92rem; text-decoration: none; margin-bottom: 18px; }
.blog-back svg { width: 16px; height: 16px; }
.blog-post-h h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.08; letter-spacing: -.04em; font-weight: 800; margin: 12px 0 14px; }
.blog-by { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: .95rem; }
.blog-by img, .blog-by-mark { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.blog-by-mark { display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-weight: 800; }
.blog-by .blog-by-logo { width: 36px; height: 36px; }
.blog-cover { margin: 8px auto 34px; max-width: 1000px; }
.blog-cover img { width: 100%; height: auto; max-height: 520px; object-fit: cover; border-radius: 22px; display: block; }
.blog-body { font-size: 1.1rem; line-height: 1.8; color: var(--text-2); overflow-wrap: anywhere; }
.blog-body > * { margin: 0 0 1.15em; }
.blog-body h2, .blog-body h3, .blog-body h4 { color: var(--text); letter-spacing: -.02em; line-height: 1.25; margin: 1.8em 0 .55em; scroll-margin-top: calc(var(--hdr) + 16px); }
.blog-body h2 { font-size: 1.6rem; } .blog-body h3 { font-size: 1.3rem; } .blog-body h4 { font-size: 1.12rem; }
.blog-body a { color: var(--brand); text-underline-offset: 3px; }
.blog-body strong { color: var(--text); }
.blog-body img { max-width: 100%; height: auto; border-radius: 16px; display: block; margin: 1.6em auto; }
.blog-body ul, .blog-body ol { padding-left: 1.3em; }
.blog-body li { margin: .3em 0; }
.blog-body blockquote { margin: 1.4em 0; padding: 6px 0 6px 20px; border-left: 3px solid var(--brand); color: var(--text); font-size: 1.15rem; }
.blog-body blockquote p { margin: 0; }
.blog-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.blog-body code { font-size: .9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.blog-body pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; overflow-x: auto; font-size: .92rem; line-height: 1.6; }
.blog-body pre code { background: none; padding: 0; }
.blog-author { display: flex; gap: 16px; align-items: flex-start; margin: 40px 0 0; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.blog-author img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.blog-author p { margin: 4px 0 0; color: var(--text-2); line-height: 1.6; }
.blog-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin: 26px 0 0; padding: 24px; border-radius: 20px; background: var(--brand-50); }
.blog-cta b { font-size: 1.1rem; color: var(--text); }
.blog-cta p { margin: 4px 0 0; color: var(--text-2); }
.blog-comments { margin-top: 56px; padding-top: 36px; border-top: 1px solid var(--line); }
.blog-c { padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.blog-c-h { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.blog-c-h span { color: var(--muted); font-size: .86rem; }
.blog-c p { margin: 6px 0 0; color: var(--text-2); line-height: 1.65; overflow-wrap: anywhere; }
.blog-form { margin-top: 26px; display: grid; gap: 14px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.blog-form h3 { margin: 0; font-size: 1.15rem; }
.blog-form label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; color: var(--text-2); }
.blog-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.blog-form .btn { justify-self: start; }
.blog-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.blog-form-msg { margin: 0; font-size: .95rem; }
.blog-form-msg:empty { display: none; }
.blog-form-msg.ok { color: var(--ok); }
.blog-form-msg.bad { color: #B42318; }
.blog-small { margin: 0; color: var(--muted); font-size: .85rem; }
.blog-related { padding-top: 40px; background: var(--bg); }
/* blog: search, tags, breadcrumbs, table of contents, sharing, next/previous, threaded comments */
.blog-hero-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.blog-search { position: relative; display: flex; align-items: center; flex: 0 1 320px; min-width: 220px; }
.blog-search svg { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.blog-search .input { width: 100%; padding-left: 38px; padding-right: 34px; border-radius: 999px; }
.blog-search-x { position: absolute; right: 10px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); text-decoration: none; font-size: 18px; }
.blog-search-x:hover { background: var(--surface-2); color: var(--text); }
.blog-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.blog-tags a { padding: 5px 12px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: .86rem; text-decoration: none; }
.blog-tags a:hover, .blog-tags a.on { background: var(--brand-50); color: var(--brand); }
.blog-tags-row { margin-top: 16px; }
.blog-post .blog-tags { margin: 28px 0 0; }
.blog-author-hero { display: flex; align-items: center; gap: 18px; }
.blog-author-hero img, .blog-author-hero .blog-by-mark { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; font-size: 1.6rem; flex: none; }
.blog-author-hero h1 { margin-bottom: 6px; }
.blog-author-hero .blog-lead { margin-bottom: 0; }
.blog-card.featured .blog-card-a { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.blog-pin { padding: 2px 9px; border-radius: 999px; background: var(--brand-50); color: var(--brand); font-weight: 700; font-size: .78rem; }
.blog-more { display: inline-block; margin-top: 14px; color: var(--brand); font-weight: 600; }
.blog-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 18px; font-size: .9rem; color: var(--muted); }
.blog-crumbs a { color: var(--muted); text-decoration: none; }
.blog-crumbs a:hover { color: var(--brand); }
.blog-crumbs a + a::before { content: "›"; margin-right: 6px; color: var(--muted); }
.blog-post-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.blog-by a { color: inherit; text-decoration: none; }
.blog-by a:hover b { color: var(--brand); }
.blog-by small { display: block; font-size: .8rem; color: var(--muted); }
.blog-share { display: flex; align-items: center; gap: 4px; }
.blog-share > span { font-size: .86rem; color: var(--muted); margin-right: 4px; }
.blog-share a, .blog-share button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; text-decoration: none; }
.blog-share a:hover, .blog-share button:hover { border-color: var(--brand); color: var(--brand); }
.blog-share button.ok { border-color: var(--ok); color: var(--ok); }
.blog-share svg { width: 17px; height: 17px; }
.blog-foot-share { margin-top: 22px; }
.blog-progress { position: sticky; top: var(--hdr); height: 3px; margin: 0 0 24px; background: var(--line-2); border-radius: 3px; overflow: hidden; z-index: 5; }
.blog-progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .15s linear; }
.blog-toc { margin: 0 0 32px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.blog-toc b { display: block; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.blog-toc ol { margin: 0; padding-left: 0; list-style: none; counter-reset: toc; }
.blog-toc li { margin: 4px 0; }
@media (max-width: 640px) { .blog-toc li.l3 { display: none; } .blog-toc { padding: 14px 18px; margin-bottom: 26px; } } /* on a phone: the main sections only, so the article starts sooner */
.blog-toc li.l3 { padding-left: 18px; font-size: .95rem; }
.blog-toc a { color: var(--text); text-decoration: none; }
.blog-toc a:hover { color: var(--brand); }
.blog-body .md-table { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: 14px; }
.blog-body table { width: 100%; border-collapse: collapse; font-size: .97rem; }
/* words in a table stay whole: a table too wide for a phone slides sideways (drag or swipe) instead of breaking "Balance" into "Bala-nce" */
.blog-body th, .blog-body td { overflow-wrap: normal; word-break: normal; hyphens: manual; min-width: 6.5em; }
.blog-body td:first-child, .blog-body th:first-child { min-width: 8.5em; }
.blog-body td { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .blog-body table { font-size: .92rem; }
  .blog-body .md-table { margin-left: -2px; margin-right: -2px; }
}
.blog-body th, .blog-body td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.blog-body th { background: var(--surface-2); color: var(--text); font-weight: 600; }
.blog-body tr:last-child td { border-bottom: 0; }
.blog-author a { display: inline-block; margin-top: 8px; color: var(--brand); font-weight: 600; text-decoration: none; }
.blog-nextprev { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.blog-nextprev a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; line-height: 1.35; }
.blog-nextprev a:hover { border-color: var(--brand); }
.blog-nextprev a.next { text-align: right; }
.blog-nextprev small { display: flex; align-items: center; gap: 4px; font-weight: 500; color: var(--muted); font-size: .82rem; margin-bottom: 6px; }
.blog-nextprev a.next small { justify-content: flex-end; }
.blog-nextprev small svg { width: 14px; height: 14px; }
.blog-c-h time { color: var(--muted); font-size: .86rem; }
.blog-c-badge { padding: 1px 8px; border-radius: 999px; background: var(--brand-50); color: var(--brand); font-size: .75rem; font-weight: 700; }
.blog-c.admin > .blog-c-h b { color: var(--brand); }
.blog-c-replies { margin: 10px 0 0 22px; padding-left: 16px; border-left: 2px solid var(--line); }
.blog-c.reply { padding: 12px 0; }
.blog-link { border: 0; background: none; padding: 0; color: var(--brand); font-size: .86rem; font-weight: 600; cursor: pointer; }
.blog-replying { margin: 0; font-size: .9rem; color: var(--text-2); }
.blog-replying:empty { display: none; }
@media (max-width: 640px) { .blog-nextprev { grid-template-columns: 1fr; } .blog-nextprev a.next { text-align: left; } .blog-nextprev a.next small { justify-content: flex-start; } .blog-search { flex-basis: 100%; } .blog-share > span { display: none; } }
@media (max-width: 980px) { .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .blog-card.big .blog-card-a { grid-template-columns: 1fr; } .blog-card.big .blog-img { min-height: 0; aspect-ratio: 16 / 9; } .blog-card.big .blog-card-b { padding: 22px; } }
@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; gap: 16px; }
  .blog-hero { padding: calc(var(--hdr) + 36px) 0 18px; }
  .blog-list { padding-bottom: 64px; }
  .blog-post-h { padding-top: calc(var(--hdr) + 28px); }
  .blog-body { font-size: 1.04rem; }
  .blog-cover img { border-radius: 0; }
  .blog-cover { margin: 4px 0 26px; padding: 0; width: 100%; max-width: none; } /* edge to edge on a phone, never wider than the screen */
  .blog-form-row { grid-template-columns: 1fr; }
  .blog-form { padding: 18px; }
  .blog-pager { flex-wrap: wrap; justify-content: center; }
}
.news-row { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.news-row input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.mail-prefs { display: grid; gap: 14px; }
.mail-prefs .news-row { align-items: flex-start; }
.mail-prefs .news-row input { margin-top: 2px; }
.mail-prefs .news-row span { display: grid; gap: 2px; min-width: 0; }
.mail-prefs .news-row small { font-weight: 400; font-size: 13px; line-height: 1.45; }

/* the analytics question (only when Google Analytics is set in the admin) */
.consent { position: fixed; z-index: 90; left: 16px; bottom: 16px; max-width: 400px; padding: 16px 18px; border-radius: 18px; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: 0 18px 50px -12px rgba(16, 24, 40, .35); animation: consent-in .3s ease both; }
.consent p { margin: 0 0 12px; font-size: .92rem; line-height: 1.5; color: var(--text-2); }
.consent p b { color: var(--text); display: block; margin-bottom: 2px; }
.consent-acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.consent-acts .btn { min-height: 40px; }
.consent { z-index: 120; } /* above the phone "Start free" bar */
.consent-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.consent-head b { font-size: 1rem; }
.consent-x { width: 32px; height: 32px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.consent-x:hover { background: var(--surface-2); color: var(--text); }
.consent-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; margin: 0 0 12px; border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.consent-row span { display: grid; gap: 2px; }
.consent-row b { font-size: .92rem; }
.consent-row small { color: var(--muted); font-size: .8rem; }
/* the on/off switch */
.consent-row input { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 44px; height: 26px; margin: 0; border-radius: 999px; background: var(--line); cursor: pointer; transition: background-color .2s; }
.consent-row input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.consent-row input:checked { background: var(--brand); }
.consent-row input:checked::after { transform: translateX(18px); }
.consent-row input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@keyframes consent-in { from { opacity: 0; transform: translateY(12px); } }
@media (max-width: 560px) { .consent { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); max-width: none; } }
@media (prefers-reduced-motion: reduce) { .consent { animation: none; } }
.pub-foot-cookie { background: none; border: 0; padding: 0 0 0 10px; font: inherit; color: inherit; text-decoration: none; cursor: pointer; transition: color .2s; }
.pub-foot-cookie:hover, .pub-foot-cookie:focus-visible { color: var(--brand-600); }

/* Plan & billing: pay now with the kept card, change card */
.bl-status-act { display: flex; flex-wrap: wrap; gap: 10px; }
.bl-paynow { min-height: 46px; font-size: .95rem; }
.bl-status .bl-paynote { margin: -8px 22px 18px; font-size: .85rem; }
.bl-status-err { margin: 0 22px 20px; }
.sheet .bl-cardform { padding: 0; }
.sheet .bl-cardform .sheet-foot { margin-top: 4px; }

/* Pages that open with a page hero (About, Contact, Privacy, Terms and the rest): room between the hero and the first
   card, and the hero colour fades out instead of ending in a hard line right at the card's top edge */
.mk-page-hero > .mk-bg { -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.mk-page-hero + .mk-sec.pt0 { padding-top: clamp(32px, 5vw, 64px); }

/* Small leak calculator: currency, your own items and the biggest leak */
.mk-leak-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.mk-leak-top .mk-leak-l { margin: 0; }
.mk-leak-cur { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.mk-leak-cur select { font: inherit; font-weight: 600; color: var(--text); padding: 7px 30px 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center / 11px; -webkit-appearance: none; appearance: none; cursor: pointer; }
.mk-leak-val output { font: inherit; }
.mk-leak .mk-leak-presets { margin-top: 24px; }
.mk-leak-p small { font-size: .78rem; color: var(--muted); margin-left: 2px; }
.mk-leak-own { display: inline-flex; align-items: center; border-radius: 999px; }
.mk-leak-own .mk-leak-p { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.mk-leak-x { font: inherit; font-size: 1.05rem; line-height: 1; width: 34px; align-self: stretch; border: 1px solid var(--line); border-left: 1px dashed var(--line); border-radius: 0 999px 999px 0; background: var(--surface); color: var(--muted); cursor: pointer; }
.mk-leak-x:hover { color: var(--spend); background: var(--surface-2); }
.mk-leak-own .mk-leak-p[aria-pressed=true] + .mk-leak-x { border-color: var(--brand); border-left-style: dashed; }
.mk-leak-add { margin-top: 22px; padding: 16px; border: 1px dashed var(--line); border-radius: 18px; background: var(--surface-2); }
.mk-leak-add-t { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-weight: 600; font-size: .92rem; color: var(--text); }
.mk-leak-add-t svg { width: 16px; height: 16px; color: var(--brand); }
.mk-leak-add-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, .9fr) auto auto; gap: 8px; }
.mk-leak-add-row input, .mk-leak-add-row select { font: inherit; font-size: .92rem; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.mk-leak-add-row select { padding-right: 10px; }
.mk-leak-add-row input:focus-visible, .mk-leak-add-row select:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.mk-leak-add-row .btn { padding: 10px 16px; }
.mk-leak-err { margin: 8px 0 0; font-size: .86rem; color: var(--spend); }
.mk-leak-most { margin: 2px 0 0; color: var(--text-2); }
.mk-leak-most b { color: var(--text); }
.mk-leak.empty .mk-leak-save { opacity: .5; }
@media (max-width: 560px) {
  .mk-leak-add-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mk-leak-add-row input[name=what] { grid-column: 1 / -1; }
  .mk-leak-add-row .btn { grid-column: 1 / -1; }
}

/* sign-up from an invitation e-mail */
.auth2-invite { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; background: var(--brand-50); color: var(--text-2); font-size: .92rem; line-height: 1.5; }
.auth2-invite svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--brand); }
.auth2-invite b { color: var(--text); word-break: break-all; }
/* "Welcome back": an account made again with the e-mail of a deleted one */
.back-note { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 16px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.back-note > svg { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--brand); }
.back-note p { margin: 0; color: var(--text-2); line-height: 1.55; }
.back-note p b { color: var(--text); }
.back-note .icon-btn { margin-left: auto; flex: none; }

/* 404: an address that is not one of our pages */
.nf { position: relative; max-width: 560px; margin: 0 auto; padding: 72px 20px 88px; text-align: center; }
.nf-code { display: block; font-size: clamp(5rem, 22vw, 8.5rem); font-weight: 800; line-height: 1; letter-spacing: -.04em; background: linear-gradient(135deg, var(--brand) 0%, #F59E0B 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nf h1 { margin: 14px 0 10px; font-size: clamp(1.6rem, 6vw, 2.2rem); letter-spacing: -.02em; }
.nf p { margin: 0 auto 26px; max-width: 440px; color: var(--muted); line-height: 1.6; }
.nf-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.nf-acts .btn svg { width: 18px; height: 18px; }
@media (max-width: 480px) { .nf { padding: 48px 16px 64px; } .nf-acts .btn { width: 100%; justify-content: center; } }

/* phones: no automatic underlines on names, e-mail addresses or numbers (iOS data detectors) */
a[x-apple-data-detectors] { color: inherit !important; text-decoration: none !important; font: inherit !important; }

/* sideways areas: no scrollbar (drag with the mouse, swipe on touch); a soft edge shows there is more */
.chart-swipe, .tbl-wrap, .settings-tabs, .rep-presets, .series-pick, .md-table, .mk-table-wrap, .mk-jump { scrollbar-width: none; -ms-overflow-style: none; }
.chart-swipe::-webkit-scrollbar, .tbl-wrap::-webkit-scrollbar, .settings-tabs::-webkit-scrollbar, .rep-presets::-webkit-scrollbar, .series-pick::-webkit-scrollbar, .md-table::-webkit-scrollbar, .mk-table-wrap::-webkit-scrollbar, .mk-jump::-webkit-scrollbar { display: none; width: 0; height: 0; }
.hs-over { cursor: grab; }
.hs-over.hs-drag { cursor: grabbing; user-select: none; scroll-behavior: auto !important; }
.hs-over.hs-right:not(.hs-left) { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.hs-over.hs-left:not(.hs-right) { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px); mask-image: linear-gradient(90deg, transparent, #000 28px); }
.hs-over.hs-left.hs-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }

/* ---------- v2.19.28 ---------- */
/* blog list on phones: topics and tags each sit in one tidy row that swipes sideways,
   instead of piling up into two-three rows of chips above the articles */
.blog-cats::-webkit-scrollbar, .blog-tags-row::-webkit-scrollbar { display: none; width: 0; height: 0; }
@media (max-width: 640px) {
  .blog-hero-row { gap: 12px; }
  .blog-hero-row > .blog-cats { flex: 0 0 calc(100% + 36px); }
  .blog-cats, .blog-tags-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -18px; padding: 2px 18px; scroll-padding-inline: 18px; overscroll-behavior-x: contain; }
  .blog-cats a, .blog-tags-row a { flex: none; white-space: nowrap; }
  .blog-tags-row { margin-top: 12px; }
  .blog-tags-row a { padding: 5px 11px; font-size: .84rem; }
}

/* reports: the seven periods share the width evenly (four, then three), with room for "6 months" */
@media (max-width: 767px) {
  .rep-bar .rep-presets { display: grid !important; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; overflow: visible; }
  .rep-bar .rep-presets button { grid-column: span 3; min-width: 0; padding: 0 2px; font-size: .82rem; }
  .rep-bar .rep-presets button:nth-child(n+5) { grid-column: span 4; }
}
/* reports, custom range: two dates side by side in one row, like the month stepper */
.rep-custom { flex-wrap: nowrap; gap: 6px; }
.rep-custom .date-field { min-width: 0; }
.rep-custom .date-btn { box-shadow: none; white-space: nowrap; }
.rep-custom .date-lbl { overflow: hidden; text-overflow: ellipsis; }
.rep-dash { color: var(--muted); flex: none; }
@media (max-width: 767px) {
  .rep-when .rep-custom { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .rep-custom .date-field { display: block; }
  .rep-custom .date-btn { width: 100%; min-height: 42px; padding: 6px 10px; gap: 6px; }
}

/* settings: Save, Add person and the other form buttons sit on the right of their card (as in the admin) */
.settings-page form[data-form] > .btn[type="submit"] { display: flex; width: fit-content; margin-left: auto; justify-content: center; }
@media (max-width: 600px) { .settings-page form[data-form] > .btn[type="submit"] { min-width: 132px; min-height: 44px; } }

/* ---------- v2.19.32 ---------- */
/* a button that reads as a link (Forgot your password?, Cookie settings on the Privacy page) */
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-600); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
button.link:hover { color: var(--brand); }
button.link:disabled { opacity: .55; cursor: default; }
.cf-forgot { margin: -6px 0 14px; font-size: .86rem; }
/* the invited address on the invitation page cannot be changed */
.field input[readonly] { background: var(--surface-2); color: var(--text-2); cursor: default; }

/* A page the server already drew (its snapshot) is not hidden again by the entrance animations when the app takes over. */
.mk-live.mk-instant .mk-h1 .w, .mk-live.mk-instant .mk-ul path, .mk-live.mk-instant .mk-hero-visual, .mk-live.mk-instant .mk-float, .mk-live.mk-instant .mk-ring .val { animation: none !important; }
.mk-live.mk-instant [data-r], .mk-live.mk-instant .mk-pane li { transition: none !important; }

/* ---------- v2.19.34: public pages, readability and accessibility ----------
   Only inside the public pages (.pub): the app itself keeps its own colours. The public pages are always light. */
.pub {
  /* grey text a little darker, so small grey words are easy to read (the orange is the brand #E85C1A everywhere) */
  --muted: #5F6774;
}
/* links inside sentences are underlined, so they do not rely on colour alone */
.pub .blog-body p a, .pub .blog-body li a, .pub .blog-body td a, .pub .mk-prose p a, .pub .mk-prose li a, .pub .mk-card p a, .pub .mk-faq-a a, .pub .auth2-legal a, .pub .auth-alt a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
/* the comparison table: row names are headers now, and keep the look they had */
.mk-compare tbody th { font-weight: 400; border-bottom: 1px solid var(--line-2); }
.mk-compare tbody tr:last-child th { border-bottom: 0; }
/* tables a keyboard can scroll show where the focus is */
.mk-table-wrap:focus-visible, .md-table:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
/* small links get a finger-sized target (at least 24px tall) */
.pub .mk-link, .pub .blog-crumbs a, .pub .pub-foot-mail a, .pub .blog-toc a, .pub .blog-tag { display: inline-flex; align-items: center; min-height: 24px; }
.pub .blog-toc li { padding: 2px 0; }
/* blog tables on a phone: readable columns that scroll sideways, instead of one word per line */
@media (max-width: 640px) { .blog-body .md-table table { min-width: 560px; } }
/* the phone "Start free" bar never covers a form being filled in */
.pub:has(input:focus, textarea:focus, select:focus) .mk-sticky-cta { display: none; }
.pub a.small { display: inline-flex; align-items: center; min-height: 24px; }
.pub-nav .pub-link { white-space: nowrap; }

/* v2.19.35 motion: smooth, light and complete */
/* the phone menu: each of the six links comes in on its own beat, then the buttons */
.menu-open .pub-menu .pub-link:nth-child(5) { animation-delay: .16s; } .menu-open .pub-menu .pub-link:nth-child(6) { animation-delay: .2s; }
.menu-open .pub-menu .pub-link:nth-child(7) { animation-delay: .24s; } .menu-open .pub-menu-acts { animation-delay: .26s; }
/* looping animations rest while off screen (site.js watchLoops) */
.mk-paused, .mk-paused *, .mk-paused::before, .mk-paused::after, .mk-paused *::before, .mk-paused *::after { animation-play-state: paused !important; }
/* the shine on buttons moves by transform (drawn by the graphics chip) instead of "left" (the page re-measured each frame) */
.mk-btn::after { left: -70%; }
@keyframes mk-shine { 0% { transform: skewX(-20deg) translateX(0); } 28%, 100% { transform: skewX(-20deg) translateX(445%); } }
/* the soft glow under the free-month card stays still: before, a blurred copy of the turning border was painted again every frame */
.mk-glow::after { background: conic-gradient(var(--brand-100), var(--brand), var(--amber), var(--save), var(--brand-100)); }
/* phones: the big title's words rise without the blur, which is heavy to draw on a phone */
@media (max-width: 700px) { @keyframes mk-word { from { opacity: 0; transform: translateY(.42em); } to { opacity: 1; transform: none; } } }
/* a page the server already showed: what starts below the screen comes in as you scroll to it */
.mk-live.mk-instant [data-r].mk-later { transition: opacity .7s ease, transform .9s cubic-bezier(.2, .7, .2, 1) !important; transition-delay: calc(var(--d, 0) * 90ms) !important; }
.mk-live.mk-instant .mk-pane.mk-later li { transition: opacity .5s ease, transform .6s ease !important; }
.mk-live.mk-instant .mk-pane.mk-later.in li:nth-child(2) { transition-delay: .15s !important; } .mk-live.mk-instant .mk-pane.mk-later.in li:nth-child(3) { transition-delay: .3s !important; }
.mk-live.mk-instant .mk-pane.good.mk-later.in li { transition-delay: .35s !important; } .mk-live.mk-instant .mk-pane.good.mk-later.in li:nth-child(2) { transition-delay: .5s !important; }
.mk-live.mk-instant .mk-pane.good.mk-later.in li:nth-child(3) { transition-delay: .65s !important; }
@media (prefers-reduced-motion: no-preference) {
  /* the small cards beside the hero picture keep their gentle float on a page the server showed */
  .mk-live.mk-instant .mk-float { animation: mk-bob 6s ease-in-out 1s infinite alternate !important; }
  .mk-live .mk-paused .mk-float, .mk-live.mk-instant .mk-paused .mk-float { animation-play-state: paused !important; }
}
/* the swipe hint stops moving once the table has been swiped (it was still animating while invisible) */
.mk-swipe.done svg, .mk-swipe.done .mk-swipe-hint i { animation: none; }
/* calm mode, everywhere on the public pages: every movement is skipped, not only the listed ones (loading spinners still turn) */
@media (prefers-reduced-motion: reduce) {
  .pub *, .pub *::before, .pub *::after { animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .pub .bl-spin, .pub .bl-pay.busy::after { animation-duration: .8s !important; animation-iteration-count: infinite !important; }
}
/* printing a page prints all of it, including sections not scrolled to yet */
@media print {
  .mk-live [data-r], .mk-live .mk-pane li, .mk-live .mk-table-wrap .yes svg { opacity: 1 !important; transform: none !important; }
  .mk-sticky-cta, .mk-bg { display: none !important; }
}

/* v2.19.36 sign-in pages: the links in "New to Reasontra?", "Remembered it?" and the terms line carry no underline.
   They stay easy to tell apart from the words around them without relying on colour: they are bold (WCAG 1.4.1). */
.pub .auth-alt a, .pub .auth2-legal a { text-decoration: none; font-weight: 600; }
.pub .auth-alt a:hover, .pub .auth2-legal a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
/* a box with a mistake in it */
.pub .auth2-card input[aria-invalid="true"] { border-color: var(--warn, #B42318); }

/* v2.19.37 the home page opening plays on every visit, also when the server sent the page: it starts with the first
   paint (no waiting for the app), and app.js carries the same moment over when it draws the page (no restart, no flash) */
@media (prefers-reduced-motion: no-preference) {
  #app .mk-hero .mk-h1 .w { animation: mk-word .9s cubic-bezier(.2, .7, .2, 1) calc(var(--i) * 75ms + 60ms) both !important; }
  #app .mk-hero .mk-ul path { animation: mk-draw 1s cubic-bezier(.6, 0, .2, 1) .75s both !important; }
  #app .mk-hero .mk-hero-visual { animation: mk-rise 1.2s cubic-bezier(.2, .7, .2, 1) .55s both !important; }
  #app .mk-hero .mk-float { animation: mk-pop .7s cubic-bezier(.3, 1.4, .5, 1) both, mk-bob 6s ease-in-out infinite alternate !important; }
  #app .mk-hero .mk-float.f1 { animation-delay: 1.3s, 2s !important; } #app .mk-hero .mk-float.f2 { animation-delay: 1.5s, 2.6s !important; } #app .mk-hero .mk-float.f3 { animation-delay: 1.7s, 3.2s !important; }
  #app .mk-hero .mk-ring .val { animation: mk-ring 1.2s cubic-bezier(.4, 0, .2, 1) 1.7s both !important; }
  #app .mk-hero [data-r] { animation: mk-hero-in .9s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * 110ms + 150ms) both !important; transition: border-color .2s, transform .2s !important; }
  /* off screen (scrolled away) the floating cards rest, as the other loops do */
  #app .mk-hero .mk-paused .mk-float, #app .mk-hero .mk-paused.mk-hero-visual { animation-play-state: paused !important; }
}
@keyframes mk-hero-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* v2.19.37 app: links that are buttons ("Forgot it? E-mail me a link…") without the underline; bold and orange instead */
button.link { text-decoration: none; font-weight: 600; }
button.link:hover { color: var(--brand); text-decoration: none; }
/* Reports, "Spending by category": the whole list in the card, moving with the page like the other cards (no inner scroll bar) */
.rep-grid .rank { max-height: none; overflow: visible; padding-right: 0; }

/* v2.19.37 app: small links big enough to tap on a phone (24 px or more) */
.card-head > a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 2px; }
button.link { min-height: 24px; }
/* the terms link in the payment consent is bold, so it stands apart from the words around it without colour */
.bl-consent a { font-weight: 600; }
/* v2.19.38: a renewal that needs paying, shown on the Overview */
.verify-note.pay-note { border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); background: var(--warn-bg); }
.verify-note.pay-note > svg { color: var(--warn); }
/* the free-month countdown in the 21-day card is easy to tap on a phone */
.pb-trial { display: inline-flex; align-items: center; min-height: 24px; }
/* a phone on its side or a short window: the whole menu, Settings and the account button included, fits without
   scrolling inside the side bar (at 390 px high they were below the edge) */
@media (min-width: 768px) and (max-height: 520px) {
  .sidebar { gap: 2px; padding-top: 8px; padding-bottom: 8px; }
  .sidebar .logo { padding-top: 0; padding-bottom: 4px; }
  .side-nav { gap: 0; }
  .side-nav a { height: 34px; }
  .side-user { padding-top: 6px; padding-bottom: 6px; }
}

/* v2.19.41 About: the four numbers sit in one card on the same light background as the sections around it,
   with the same space above and below, so the band is balanced (it was a white strip with the numbers at the top). */
.mk-stats.about { background: var(--bg); padding: 0; margin: calc(-1 * clamp(16px, 3.6vw, 44px)) 0; position: relative; z-index: 1; }
.mk-stats.about .mk-wrap { display: block; }
.mk-stats-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 28px 12px; padding: 34px 18px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 24px 48px -34px rgba(16, 24, 40, .22); }
.mk-stats-card .mk-stat > span { display: block; margin-top: 4px; }
@media (min-width: 760px) { .mk-stats-card { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 44px 12px; } }

/* v2.19.42 blog: one reading-progress line only, the one under the site header (it follows the article) */
.blog-progress { display: none !important; }

/* v2.19.44 blog: comes in like the other pages (headings, cards and sections rise into place as they reach the screen),
   and while an article loads a placeholder of the same shape is shown (no "Loading…" line, no footer jumping up) */
.blog-sk { padding: calc(var(--hdr, 64px) + 40px) 0 64px; min-height: 80vh; }
.blog-sk .mk-wrap { display: grid; gap: 14px; }
.blog-sk .blog-read + .mk-wrap, .blog-sk .mk-wrap + .blog-read { margin-top: 26px; }
.sk { display: block; height: 16px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 55%, #fff) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk-shine 1.3s ease infinite; }
.sk.sm { height: 12px; }
.sk.h { height: 34px; border-radius: 10px; }
.sk-cover { height: clamp(180px, 38vw, 460px); border-radius: 22px; }
.sk-grid { display: grid; gap: 22px; margin-top: 24px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.sk-card { display: grid; gap: 12px; padding: 0 0 18px; }
.sk-img { height: 170px; border-radius: 18px; }
@keyframes sk-shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
/* the hero lines of a blog page follow each other a little more closely than long sections do */
.mk-live .blog-hero [data-r], .mk-live .blog-post-h [data-r] { transition-delay: calc(var(--d, 0) * 80ms + 60ms); }
.mk-live .blog-grid > [data-r] { transition-delay: calc(var(--d, 0) * 70ms); }

/* v2.19.45 phones and tablets: the whole amount row is the place to tap for the amount */
.qa-amount.tap { cursor: text; padding: 10px 0; margin-top: 8px; -webkit-tap-highlight-color: transparent; }
/* phones and tablets: every typing box uses at least 16px text, so tapping one never zooms the whole page in
   and leaves it sliding sideways (iPhone / iPad). The big amount in Add record keeps its own size. */
@media (pointer: coarse) {
  body :is(input:not([type=checkbox], [type=radio], [type=range], [type=color], [type=file], [type=submit], [type=button]), select, textarea):not(.qa-amount input) { font-size: 16px; }
}
/* v2.19.47 Reports: on a short screen (a phone on its side) the day-by-day table moves with the page instead of
   being its own scroll box taller than the screen, where a finger got stuck scrolling the table */
@media (max-height: 700px) { .rep-grid .tbl-wrap { max-height: none; } .rep-tbl thead th { position: static; } }

/* budget plan: drag a category by its handle to reorder (replaces Move up / Move down) */
.plan-cat { display: flex; align-items: center; gap: 4px; min-width: 0; }
.plan-cat .cat-btn { min-width: 0; }
.row-grip { flex: none; width: 22px; height: 32px; margin-left: -6px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: grab; touch-action: none; opacity: .7; transition: opacity .12s, background .12s; }
.row-grip svg { width: 16px; height: 16px; }
.plan-tbl tr:hover .row-grip, .row-grip:focus-visible { opacity: 1; }
.row-grip:hover { background: var(--surface-2); color: var(--text); }
@media (hover: none) { .row-grip { opacity: .85; } }
.has-grip .plan-notes { margin-left: 66px; }
@media (max-width: 767px) { .has-grip .plan-notes { margin-left: 0; } }
.plan-tbl tr.row-dragging, .plan-tbl tr.row-dragging td { background: var(--brand-50); }
.plan-tbl tr.row-dragging .row-grip { opacity: 1; color: var(--brand-600); }
body.no-select { user-select: none; -webkit-user-select: none; }
body.no-select, body.no-select * { cursor: grabbing !important; }

/* add record: category search and the Budget plan groups */
.qa-find { margin: 0 0 8px; }
.qa-find .icon-search { margin: 0; }
.qa-find input { width: 100%; }
.qa-find input::-webkit-search-cancel-button { cursor: pointer; }
.cat-grid.grouped { display: block; }
.cat-grid .cg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-grid .cg + .cg { margin-top: 8px; }
.cat-grid .cg-lbl { margin: 0 2px 6px; font-size: .72rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.cat-grid .cg-none { flex: 0 0 100%; margin: 2px 2px 4px; }
.cat-grid .cg-chips.dragging .chip { cursor: grabbing; }

/* records: while a search or filter loads, the old list stays (dimmed only if it takes a moment) */
#rec-list { transition: opacity .15s; }
#rec-list.is-loading { opacity: .55; transition-delay: .15s; }

/* goals: a target amount by a month, filled with Saving records */
.goal-month { padding: 14px 18px; margin-bottom: 16px; }
.goal-month .gm-t { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .9rem; color: var(--text-2); }
.goal-month .gm-t svg { width: 18px; height: 18px; color: var(--save); flex: none; }
.goal-month .gm-t span { flex: 1; min-width: 0; }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.goal-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
/* a reached goal is a plain card with its green badge and bar; the green glow around it shows once, when it has just
   been reached, and fades out with the well-done note */
.goal-card { transition: background-color .9s ease, border-color .9s ease, box-shadow .9s ease; }
.goal-card.just-reached { background-color: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 16%, transparent); }
.gc-head { display: flex; align-items: flex-start; gap: 12px; }
.gc-head .cat { flex: none; }
.gc-head .ci { width: 40px; height: 40px; border-radius: 12px; }
.gc-t { flex: 1; min-width: 0; }
.gc-t b { display: block; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-t span { display: block; font-size: .8rem; color: var(--muted); }
.gc-amt { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gc-amt b { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; }
.gc-amt span { font-size: .85rem; color: var(--muted); font-weight: 600; }
.gc-meter { height: 10px; }
.gc-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 0 0; }
.gc-facts div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.gc-facts dt { font-size: .72rem; color: var(--muted); margin: 0 0 2px; }
.gc-facts dd { margin: 0; font-weight: 650; font-size: .9rem; overflow-wrap: anywhere; }
.gc-msg { margin: 0; font-size: .85rem; color: var(--text-2); }
.gc-msg.warn { color: var(--warn); }
.goal-done { margin-top: 16px; padding: 0 16px 16px; }
.goal-done > summary { cursor: pointer; padding: 14px 2px; font-weight: 600; display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
.goal-done > summary::after { margin-left: auto; }
.goal-grid > .card + .card, .goal-grid > .card { margin-top: 0; }
.goal-done > summary svg { width: 18px; height: 18px; color: var(--save); }
.goal-empty { padding: 36px 20px; max-width: 520px; margin: 0 auto; }
.goal-empty h2 { margin: 6px 0 4px; font-size: 1.1rem; }
.goal-empty p { color: var(--text-2); line-height: 1.55; }
.goal-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.goal-quick .chip { min-height: 30px; padding: 3px 11px; font-size: .8rem; }
.plan-notes .pn.ok { color: var(--ok); font-weight: 600; }
@media (max-width: 767px) { .goal-grid { grid-template-columns: 1fr; } .goal-card { padding: 16px; } }
.gc-facts .gc-wide { grid-column: 1 / -1; }

/* goal form: quick picks and a calendar for any other day */
.goal-quick .chip svg { width: 15px; height: 15px; }
.goal-date .date-field, .goal-date .date-btn { width: 100%; }
/* records: money put aside for a goal is marked Goal (on phones under the name, where there is no Type column) */
.goal-tag { display: none; }
@media (max-width: 767px) { .tbl.stack .goal-tag { display: inline-block; margin: 4px 0 0 42px; } }
.list-row .t b .kind-tag { vertical-align: 1px; margin-left: 4px; }
.kind-tag.k-saving { background: var(--save-bg); color: var(--save); }
.goal-date .date-btn { border-radius: 10px; min-height: 44px; box-shadow: none; }
.gc-facts dd small { display: block; margin-top: 2px; font-size: .72rem; font-weight: 500; color: var(--muted); }

/* goal card: this month's saving */
.gc-of { font-weight: 500; color: var(--muted); font-size: .85rem; }
.gc-mini { height: 6px; margin-top: 8px; }
.gc-facts .meter { background: var(--surface); }

/* goal card head: name, goal and status on the left, Edit on the right */
.gc-sub { display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.gc-sub .badge { font-size: .72rem; padding: 1px 8px; }
.gc-edit { flex: none; gap: 6px; }
.gc-edit svg { width: 15px; height: 15px; }
@media (max-width: 380px) { .gc-edit span { display: none; } .gc-edit { padding: 6px 9px; } }

/* Reports: savings goals */
.rg-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.rg-row { display: grid; gap: 8px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.rg-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rg-t { flex: 1; min-width: 0; display: grid; gap: 3px; }
.rg-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-t > span { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rg-t .badge { font-size: .72rem; padding: 1px 8px; }
.rg-t small, .rg-in small, .rg-foot { color: var(--muted); font-size: .78rem; }
.rg-in { flex: none; display: grid; text-align: right; }
.rg-in b { font-size: .95rem; white-space: nowrap; }
.rg-row .meter { height: 6px; }
.rg-foot { display: flex; justify-content: space-between; gap: 2px 8px; flex-wrap: wrap; }
.rg-foot span:last-child { margin-left: auto; }
.rank-row .cat .kind-tag { margin-left: -2px; }

/* Goals: reached in this month, and moving cards */
.meter.done > i { background: var(--ok); }
.gc-ok { display: inline-flex; align-items: center; gap: 5px; color: var(--ok) !important; }
.gc-ok svg { width: 16px; height: 16px; }
.goal-card.just-reached .gc-facts div { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.goal-card .gc-facts div { transition: background-color .9s ease; }
.gc-msg.ok { color: var(--ok); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .goal-card, .goal-card .gc-facts div { transition: none; } }
.gc-grip { flex: none; width: 22px; height: 40px; margin: 0 -4px 0 -8px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: grab; touch-action: none; opacity: .7; transition: opacity .12s, background .12s; }
.gc-grip svg { width: 16px; height: 16px; }
.goal-card:hover .gc-grip, .gc-grip:focus-visible { opacity: 1; }
.gc-grip:hover { background: var(--surface-2); color: var(--text); }
@media (hover: none) { .gc-grip { opacity: .85; } }
.goal-card.gc-placeholder { opacity: .35; outline: 2px dashed var(--line); outline-offset: -2px; box-shadow: none; }
.gc-ghost { position: fixed; left: 0; top: 0; z-index: 1000; margin: 0; pointer-events: none; box-shadow: 0 18px 40px rgba(16, 24, 40, .22); opacity: .96; rotate: 1.2deg; }
.goal-tip { margin: 12px 2px 0; }

/* Scrolling on phones and tablets.
   - A part that scrolls sideways (tables, charts, chips) never scrolls up and down as well: with overflow-x: auto the
     browser makes it a vertical scroller too, and a few pixels of extra height (rounding on a phone) were enough to
     catch an up/down swipe that started on it: the page stopped and sprang back up. clip keeps it sideways only
     (and changes nothing where the part does not scroll sideways).
   - The bottom bar keeps its colour below its edge, so while Safari's own toolbar slides in and out (or the page
     springs at its end) no gap opens under it, and it sits on its own layer so it moves in one piece. */
.chart-swipe, .tbl-wrap { overflow-y: hidden; } /* older Safari, without clip */
.chart-swipe, .tbl-wrap, .settings-tabs, .rep-presets, .series-pick, .md-table, .mk-table-wrap, .mk-jump, .blog-cats, .blog-tags-row { overflow-y: clip; }
.tabbar { transform: translateZ(0); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.tabbar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 120px; background: var(--surface); pointer-events: none; }

/* Website: savings goals (Home, Features, the 21-day plan) */
.mk-callout.goal { margin-top: 16px; }
.mk-callout .mk-ic { flex: none; } /* the icon keeps its size next to long text */
.mk-callout .mk-link { display: inline-flex; margin-top: 10px; }
.mk-goals-home .mk-feature { padding-top: 16px; padding-bottom: 32px; }

/* ---------- v2.32: Notebook notes and debts are put in order by dragging (the same handle as the Budget plan) ---------- */
.note-list { display: block; }
.note-row .row-grip { margin: 0 -6px 0 -10px; align-self: center; }
.note-row:hover .row-grip, .debt-tbl tr:hover .row-grip, .debt-item:hover .row-grip { opacity: 1; }
.debt-cell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.debt-tbl td.has-grip .small.muted { margin-left: 66px !important; }
.di-top .row-grip { margin: 0 -6px 0 -8px; }
.note-row.row-dragging, .debt-item.row-dragging, .debt-tbl tr.row-dragging td { background: var(--brand-50); }
.note-row.row-dragging .row-grip, .debt-item.row-dragging .row-grip, .debt-tbl tr.row-dragging .row-grip { opacity: 1; color: var(--brand-600); }
.note-row.row-dragging, .debt-item.row-dragging { box-shadow: inset 3px 0 0 var(--brand); }
@media (hover: none) { .note-row .row-grip, .debt-item .row-grip { width: 30px; height: 36px; } }
/* touch: a handle is held a moment before it picks a row or card up, so a swipe that starts on it scrolls the page */
.row-grip, .gc-grip { touch-action: pan-y; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
