/* Borç Takip — sade, modern arayüz */
:root {
  --bg: #F6F5F1;
  --surface: #FFFFFF;
  --surface-2: #EFEDE7;
  --line: #E6E3DC;
  --line-2: #D6D3CA;
  --ink: #16181D;
  --ink-2: #565C6A;
  --ink-3: #7D8290;
  --accent: #0F766E;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3F1EF;
  --accent-soft-ink: #134E4A;
  --warn: #B45309;
  --warn-soft: #FDF0E6;
  --warn-ink: #9A3412;
  --danger: #B91C1C;
  --danger-soft: #FDECEC;
  --income: #15803D;
  --income-soft: #E7F5EC;
  --hero: #FFFFFF;
  --hero-2: #F4F2ED;
  --hero-ink: #16181D;
  --hero-ink-2: #565C6A;
  --hero-track: #E9E6DF;
  --shadow: 0 1px 2px rgba(22, 24, 29, .04), 0 8px 24px rgba(22, 24, 29, .06);
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, sans-serif;
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
/* Dark theme: data-theme is set by theme.js from the user's choice (Açık / Koyu / Sistem). */
:root[data-theme="dark"] {
    --bg: #0E0F12;
    --surface: #17191E;
    --surface-2: #20232A;
    --line: #262A32;
    --line-2: #353A44;
    --ink: #F2F3F5;
    --ink-2: #A6ACB8;
    --ink-3: #8A909C;
    --accent: #2BB3A3;
    --accent-ink: #06201D;
    --accent-soft: #123430;
    --accent-soft-ink: #A7E8DF;
    --warn: #F59E0B;
    --warn-soft: #2E2210;
    --warn-ink: #FBC27A;
    --danger: #F87171;
    --danger-soft: #2F1616;
    --income: #4ADE80;
    --income-soft: #12301E;
    --hero: #1B1E24;
    --hero-2: #252932;
    --hero-ink: #F2F3F5;
    --hero-ink-2: #A6ACB8;
    --hero-track: #353A44;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { flex-shrink: 0; }

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(var(--safe-t) + 8px) 20px calc(var(--nav-h) + var(--safe-b) + 96px);
}

/* ---------- Header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; }
.top h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.top .hello { font-size: 13px; color: var(--ink-2); }
/* Fixed heights so showing/hiding "Bugün" never shifts the layout. */
.hello-row { display: flex; align-items: center; gap: 8px; height: 28px; }
.day-title { min-height: 36px; }
.today-btn {
  position: relative; height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--accent); font-size: 13px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
  animation: fade .18s ease;
}
.today-btn::after { content: ""; position: absolute; inset: -8px -4px; } /* 44px dokunma alanı */
.today-btn:active { transform: scale(.96); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.month { display: flex; align-items: center; gap: 0; margin-left: -12px; }
.month h1 { min-width: 0; font-size: 24px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 22px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink); position: relative;
}
.icon-btn.round { background: var(--surface); border: 1px solid var(--line); }
.icon-btn:active { transform: scale(.96); }
.badge {
  position: absolute; top: 5px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--warn); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* ---------- Hero ---------- */
.hero {
  margin-top: 8px; padding: 22px 20px 20px; border-radius: 26px; background: var(--hero); color: var(--hero-ink);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px;
}
.hero-label { font-size: 13px; color: var(--hero-ink-2); }
.hero-total { font-size: 40px; font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
.hero-total small { font-size: 22px; color: var(--hero-ink-2); font-weight: 600; }
.bar { height: 8px; border-radius: 4px; background: var(--hero-track); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .4s ease; }
.bar > i.over { background: var(--warn); }
.hero-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--hero-ink-2); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { padding: 12px 14px; border-radius: 16px; background: var(--hero-2); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile span:first-child { font-size: 12px; color: var(--hero-ink-2); }
.tile .num { font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-link { align-self: flex-start; border: 0; background: var(--hero-2); color: var(--hero-ink); border-radius: 12px; padding: 0 14px; min-height: 40px; font-size: 13px; font-weight: 600; }

/* ---------- Sections ---------- */
.section { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.section-head a, .link-btn {
  font-size: 14px; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 12px 0; min-height: 44px;
}
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.list { display: flex; flex-direction: column; overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 60px; width: 100%;
  border: 0; background: transparent; text-align: left; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
button.row:active { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-amt { font-size: 15px; font-weight: 600; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.empty {
  padding: 22px 18px; border-radius: var(--radius); border: 1px dashed var(--line-2); color: var(--ink-2);
  font-size: 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px;
}

/* ---------- Upcoming payments ---------- */
.pay { padding: 14px 14px 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.pay-top { display: flex; align-items: center; gap: 12px; }
.pay-ico {
  width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink-2); flex-shrink: 0;
}
.pay-ico.card-ico { background: var(--accent-soft); color: var(--accent); }
.pay-ico.urgent { background: var(--warn-soft); color: var(--warn-ink); }
.pay-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pill { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.ok { background: var(--accent-soft); color: var(--accent-soft-ink); }

.btn {
  min-height: 44px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.danger { color: var(--danger); border-color: var(--line-2); }
.btn.block { width: 100%; min-height: 54px; border-radius: 16px; font-size: 16px; }
.btn.sm { min-height: 38px; padding: 0 12px; border-radius: 12px; font-size: 13px; }

/* ---------- Category breakdown ---------- */
.cats { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; }
.stack > i { display: block; height: 100%; min-width: 3px; }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; font-size: 13px; }
.legend > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.legend .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .num { font-weight: 600; }

/* ---------- FAB & nav ---------- */
.fab {
  position: fixed; right: max(20px, calc(50% - 280px + 20px)); bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  width: 58px; height: 58px; border-radius: 20px; border: 0; background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(15, 118, 110, .35); z-index: 20;
}
.fab:active { transform: scale(.95); }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.nav-inner { max-width: 560px; margin: 0 auto; height: var(--nav-h); display: flex; justify-content: space-around; align-items: center; }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 76px; min-height: 52px; font-size: 11px; font-weight: 600; color: var(--ink-3);
}
.tab[aria-current="page"] { color: var(--accent); }

/* ---------- Calendar ---------- */
.cal { padding: 14px 10px 12px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.cal-head { font-size: 12px; font-weight: 600; color: var(--ink-2); padding-bottom: 8px; }
.cal-grid { gap: 4px 2px; }
.day {
  height: 46px; border-radius: 12px; border: 0; background: transparent; color: var(--ink); padding: 0;
  font-size: 14px; font-weight: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.day.past { color: var(--ink-3); }
.day.today { box-shadow: inset 0 0 0 1.5px var(--ink); font-weight: 700; }
.day.sel { background: var(--ink); color: var(--bg); font-weight: 700; }
.day .dots { display: flex; gap: 3px; height: 6px; }
.day .dots i { width: 6px; height: 6px; border-radius: 3px; display: block; }
.day.sel .dots i { background: var(--bg) !important; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; padding-top: 12px; font-size: 12px; color: var(--ink-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 8px; height: 8px; border-radius: 4px; display: inline-block; }
.c-due { background: var(--warn); }
.c-cut { background: var(--accent); }
.c-bill { background: #7B8494; }
.c-exp { background: var(--line-2); }
.ev { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.ev-bar { width: 4px; align-self: stretch; border-radius: 2px; flex-shrink: 0; }

/* ---------- Credit cards ---------- */
.ccard { overflow: hidden; }
.ccard-head { padding: 18px 18px 20px; color: #fff; display: flex; flex-direction: column; gap: 18px; }
.ccard-head .top-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ccard-head .name { font-size: 15px; font-weight: 600; }
.ccard-head .sub { font-size: 12px; opacity: .8; }
.ccard-head .debt { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.ccard-head .pill { background: rgba(255, 255, 255, .16); color: #fff; }
.ccard-head .pill.warn { background: #FDF0E6; color: #9A3412; }
.ccard-head .pill.danger { background: #FDECEC; color: #B91C1C; }
.ccard-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.facts div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.facts span:first-child { font-size: 12px; color: var(--ink-2); }
.facts span:last-child { font-size: 14px; font-weight: 600; }
.hr { height: 1px; background: var(--line); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.switch {
  width: 52px; height: 32px; border-radius: 16px; border: 0; padding: 3px; display: flex; background: var(--line-2);
  justify-content: flex-start; transition: background .2s; flex-shrink: 0;
}
.switch[aria-checked="true"] { background: var(--accent); justify-content: flex-end; }
.switch::after { content: ""; width: 26px; height: 26px; border-radius: 13px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink-2); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center;
}
.chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-soft-ink); border-color: var(--accent); }
.actions { display: flex; gap: 8px; }
.actions .btn { flex: 1; }

.notice {
  margin-top: 12px; padding: 14px 16px; border-radius: 18px; background: var(--warn-soft); color: var(--warn-ink);
  display: flex; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 1.45;
}
.notice p { margin: 0 0 8px; }
.notice .btn { background: var(--warn-ink); border-color: var(--warn-ink); color: var(--warn-soft); }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; margin: 8px -20px 0; padding: 4px 20px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .chip { flex-shrink: 0; }
.day-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 4px; margin-top: 8px; }

/* ---------- Sheet ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(10, 11, 14, .45);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease;
}
.sheet {
  width: 100%; max-width: 560px; max-height: calc(100dvh - var(--safe-t) - 12px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 26px 26px 0 0; padding: 8px 20px calc(var(--safe-b) + 20px);
  animation: up .24s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 600px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 26px; max-height: 90dvh; }
}
.overlay.closing { animation: fade .16s ease reverse forwards; }
.overlay.closing .sheet { animation: up .16s ease reverse forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 4px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; margin: 0 -12px; }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.form { display: flex; flex-direction: column; gap: 20px; padding-top: 4px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field > .lbl, legend.lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.input {
  min-height: 52px; width: 100%; padding: 0 16px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); font-size: 16px; font-weight: 500; outline: none; appearance: none; -webkit-appearance: none;
}
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[type="date"] { display: flex; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.help { font-size: 12.5px; color: var(--ink-2); margin: 0; }

.amount { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 4px; }
.amount label { font-size: 13px; color: var(--ink-2); }
.amount-wrap { display: flex; align-items: baseline; justify-content: center; gap: 4px; font-size: 46px; font-weight: 700; letter-spacing: -0.03em; }
.amount-wrap span { font-size: 30px; color: var(--ink-3); }
.amount-wrap input { width: 5ch; field-sizing: content; min-width: 3ch; max-width: 10ch; border: 0; background: transparent; text-align: center; outline: none; font: inherit; letter-spacing: inherit; padding: 0; }
.amount-wrap input::placeholder { color: var(--line-2); }

.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface-2); }
.seg label { position: relative; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.opt input, .seg input, .swatch input { position: absolute; opacity: 0; pointer-events: none; }

.opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.opt { position: relative; }
.opt span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 46px; padding: 4px 6px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; line-height: 1.15;
}
.opt input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.opts.days { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.methods { display: flex; flex-direction: column; gap: 8px; }
.method { position: relative; display: block; }
.method input { position: absolute; opacity: 0; pointer-events: none; }
.method > span {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
}
.method .radio { width: 20px; height: 20px; border-radius: 10px; border: 2px solid var(--line-2); flex-shrink: 0; }
.method input:checked + span { border: 2px solid var(--accent); padding: 9px 15px; }
.method input:checked + span .radio { border: 6px solid var(--accent); }
.method input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-soft-ink); font-size: 13px; line-height: 1.45; }
.hint:empty { display: none; }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { position: relative; }
.swatch span { display: block; width: 44px; height: 44px; border-radius: 14px; border: 3px solid transparent; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .0); }
.swatch input:checked + span { border-color: var(--bg); box-shadow: 0 0 0 2px var(--ink); }
.swatch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 15px; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; }

.settings-group { display: flex; flex-direction: column; gap: 10px; }
.settings-group h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.settings-group .card { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.file-label { position: relative; overflow: hidden; }
.file-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 88px); z-index: 60;
  max-width: calc(100% - 32px); width: max-content; padding: 10px 10px 10px 16px; border-radius: 14px; background: var(--ink); color: var(--bg);
  display: flex; align-items: center; gap: 12px; font-size: 14px; box-shadow: var(--shadow);
}
.toast[hidden] { display: none; }
.toast button { border: 0; background: transparent; color: #5EEAD4; font-weight: 700; min-height: 36px; padding: 0 8px; white-space: nowrap; flex-shrink: 0; }
:root[data-theme="dark"] .toast button { color: #0F766E; }
.seg.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
:root[data-theme="dark"] .seg input:checked + span { background: var(--line-2); }

@media (max-width: 360px) {
  .app { padding-left: 16px; padding-right: 16px; }
  .hero-total { font-size: 34px; }
  .opts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Income ---------- */
.pos { color: var(--income); }
.neg { color: var(--danger); }
.tile .num.pos { color: var(--income); }
.c-inc { background: var(--income); }
.amount.is-inc .amount-wrap { color: var(--income); }
.amount.is-inc .amount-wrap span { color: var(--income); opacity: .7; }
.kind-seg .kind {
  border: 0; background: transparent; min-height: 42px; border-radius: 12px; font-size: 15px; font-weight: 700; color: var(--ink-2);
}
.kind-seg .kind[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.kind-seg .kind.inc[aria-pressed="true"] { color: var(--income); }
:root[data-theme="dark"] .kind-seg .kind[aria-pressed="true"] { background: var(--line-2); }
.opts.subs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.overlay.noanim, .overlay.noanim .sheet { animation: none; }

/* ---------- Demo ---------- */
.demo-bar {
  position: sticky; top: calc(var(--safe-t) + 4px); z-index: 25; margin: 0 0 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--warn-ink); font-size: 13px;
  box-shadow: var(--shadow);
}
.demo-bar .btn { background: var(--warn-ink); border-color: var(--warn-ink); color: var(--warn-soft); min-height: 34px; }
.demo-invite { padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--accent-soft); border-color: transparent; color: var(--accent-soft-ink); }
.demo-invite .help { color: var(--accent-soft-ink); margin-top: 4px; }
.demo-invite .btn { align-self: flex-start; }

.month-title { margin: 0; }
