/* CukkA — arayüz. Mobil öncelikli, koyu/açık tema, sıfır bağımlılık. */

:root {
  color-scheme: light;
  --plane: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f2f2ee;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --income: #1baf7a;
  --expense: #e34948;
  --good: #0ca30c;
  --warn: #fab219;
  --critical: #d03b3b;
  --shadow: 0 1px 2px rgba(11,11,11,.05), 0 8px 24px rgba(11,11,11,.06);
  --r: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --nav-h: 60px;
  /* Ekran genişliğine göre esneyen ölçüler */
  --pad: clamp(10px, 3.2vw, 16px);
  --gap: clamp(8px, 2.6vw, 12px);
  --fs-hero: clamp(23px, 7.2vw, 32px);
  --fs-amount: clamp(27px, 8.6vw, 40px);
  --fs-stat: clamp(16px, 4.8vw, 20px);
  --fs-key: clamp(17px, 5.2vw, 22px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --plane: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232322;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --income: #199e70;
    --expense: #e66767;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --plane: #0d0d0d; --surface: #1a1a19; --surface-2: #232322;
  --text: #fff; --text-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,.10);
  --accent: #3987e5; --income: #199e70; --expense: #e66767;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--plane);
  color: var(--text);
  font: clamp(14px, 3.9vw, 15px)/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Hiçbir ekranda yatay kaydırma olmasın */
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--accent); text-decoration: none; }
.ic { flex: none; vertical-align: -3px; }

/* ---------- düzen ---------- */
#app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
  padding: 10px calc(12px + var(--safe-r)) 10px calc(12px + var(--safe-l));
  background: color-mix(in srgb, var(--plane) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
  padding-top: max(10px, env(safe-area-inset-top));
}
.topbar h1 { font-size: clamp(15.5px, 4.6vw, 17px); font-weight: 680; margin: 0;
  letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .grow { min-width: 0; }
.topbar .btn { flex: none; }
.topbar .sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.topbar .grow { flex: 1; }

main {
  flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; min-width: 0;
  padding: var(--gap) calc(var(--pad) + var(--safe-r)) calc(var(--nav-h) + 84px + var(--safe-b))
           calc(var(--pad) + var(--safe-l));
}

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-b);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; height: var(--nav-h); font-size: clamp(9px, 2.8vw, 10.5px); color: var(--muted);
  font-weight: 550; transition: color .12s; min-width: 0; padding: 0 2px;
}
.nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a.on { color: var(--accent); }
.nav a:active { background: var(--surface-2); }

.fab {
  position: fixed; right: 16px; z-index: 51;
  bottom: calc(var(--nav-h) + 16px + var(--safe-b));
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent);
  transition: transform .12s;
}
.fab:active { transform: scale(.93); }

/* ---------- kartlar ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: var(--pad); margin-bottom: var(--gap);
  box-shadow: var(--shadow); min-width: 0;
}
/* İçinde geniş tablo olan kartlar kendi içinde yatay kayar */
.card:has(> table.data) { overflow-x: auto; }
.card h2, .card h3 { margin: 0 0 10px; font-size: 13px; font-weight: 640;
  color: var(--text-2); letter-spacing: .02em; text-transform: uppercase; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--gap); }
.muted { color: var(--muted); }
.sec { color: var(--text-2); }
.small { font-size: 12.5px; }
.tiny { font-size: 11px; }
.right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }
.pos { color: var(--income); }
.neg { color: var(--expense); }

/* ---------- özet kutuları ---------- */
.hero { padding: 16px; }
.hero .label { font-size: 12px; color: var(--muted); font-weight: 550; }
.hero .value { font-size: var(--fs-hero); font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; margin: 2px 0 4px; overflow-wrap: anywhere; }
.stat { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 12px; }
.stat .k { font-size: 11.5px; color: var(--muted); font-weight: 550;
  display: flex; align-items: center; gap: 5px; }
.stat .v { font-size: var(--fs-stat); font-weight: 680; margin-top: 3px;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
.stat { min-width: 0; }

/* ---------- listeler ---------- */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 11px; padding: 10px 2px;
  border-bottom: 1px solid var(--grid); text-align: left; width: 100%;
}
.item:last-child { border-bottom: 0; }
.item:active { background: var(--surface-2); }
.avatar {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  flex: none; color: #fff;
}
.item .t { flex: 1; min-width: 0; }
.item .t b { font-weight: 580; font-size: clamp(13.5px, 4.1vw, 14.5px); display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t span { font-size: 12px; color: var(--muted); }
.item .amt { font-weight: 640; font-variant-numeric: tabular-nums; white-space: nowrap;
  font-size: clamp(13.5px, 4.1vw, 15px); }
.item .right { min-width: 0; }
.day-head { font-size: 11.5px; color: var(--muted); font-weight: 600;
  padding: 12px 2px 4px; display: flex; justify-content: space-between; }

/* ---------- grafik ---------- */
.chart-bars, .chart-line { width: 100%; }
.bar-labels { display: flex; margin-top: 4px; }
.bar-labels .bx { flex: 1; text-align: center; font-size: 10px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.donut { display: block; margin: 0 auto; }
.arc { transition: opacity .15s; }
.donut:hover .arc { opacity: .45; }
.donut .arc:hover { opacity: 1; }
.bar { position: relative; height: 7px; border-radius: 99px; background: var(--grid);
  overflow: hidden; margin-top: 7px; }
.bar span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; transition: width .3s; }
.bar-over { position: absolute; right: 0; top: 0; bottom: 0; width: 3px; background: var(--critical); }
.empty-mini { color: var(--muted); font-size: 12.5px; padding: 12px 0; text-align: center; }

/* ---------- form ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 580; color: var(--text-2);
  margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
select { appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--muted) 50%),
  linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
textarea { min-height: 70px; resize: vertical; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 16px; border-radius: 12px; font-weight: 620; font-size: 14.5px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  transition: transform .1s, opacity .1s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.danger { background: transparent; color: var(--critical); border-color: var(--border); }
.btn.wide { width: 100%; }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 4px;
  scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 7px 12px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border); font-size: 13px; font-weight: 550;
  white-space: nowrap; color: var(--text-2);
}
.chip.on { background: var(--accent); border-color: transparent; color: #fff; }

.seg { display: grid; grid-auto-flow: column; gap: 4px; background: var(--surface-2);
  padding: 4px; border-radius: 12px; }
.seg button { padding: 9px 6px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
  color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button.on.inc { color: var(--income); }
.seg button.on.exp { color: var(--expense); }

/* ---------- modal / sheet ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(18px); opacity: .6 } }
.sheet {
  width: 100%; max-width: 520px; overflow-y: auto; overscroll-behavior: contain;
  /* Ekranın tamamını kaplamaz: üstte her zaman kapatılabilir bir boşluk kalır.
     dvh, iOS'ta adres çubuğu açılıp kapandığında da doğru çalışır. */
  max-height: 86vh; max-height: 86dvh;
  background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 0 16px calc(20px + var(--safe-b));
  animation: up .18s cubic-bezier(.2,.8,.3,1);
  border: 1px solid var(--border); border-bottom: 0;
  transition: transform .12s ease-out;
}
.sheet-head { position: sticky; top: 0; z-index: 5; background: var(--surface);
  padding: 6px 0 10px; margin: 0 -16px 4px; padding-left: 16px; padding-right: 16px;
  border-bottom: 1px solid transparent; }
.sheet-head .handle { width: 38px; height: 4px; border-radius: 99px; background: var(--axis);
  margin: 4px auto 10px; }
.sheet-head-row { display: flex; align-items: center; gap: 10px; }
.sheet-head-row .grow { flex: 1; }
.sheet-close { width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--surface-2); color: var(--text-2); display: grid; place-items: center;
  border: 1px solid var(--border); }
.sheet-close:active { background: var(--accent); color: #fff; }
.sheet h2 { font-size: 17px; margin: 0; flex: 1; font-weight: 680; text-transform: none;
  letter-spacing: -.01em; color: var(--text); }
.sheet-actions { display: flex; gap: 8px; margin-top: 16px; }
.sheet-actions.sticky-actions {
  position: sticky; bottom: 0; z-index: 4;
  margin: 16px -16px 0; padding: 10px 16px calc(4px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--grid);
}
.sheet-actions .btn { flex: 1; }

/* ---------- tuş takımı ---------- */
.amount-display { text-align: center; padding: 10px 0 4px; }
.amount-display .big { font-size: var(--fs-amount); font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(5px, 1.6vw, 8px); margin-top: 10px; }
.pad button { padding: clamp(9px, 1.7vh, 15px) 0; border-radius: 12px;
  background: var(--surface-2); font-size: var(--fs-key); font-weight: 600; }
.pad button:active { background: var(--accent); color: #fff; }

/* ---------- diğer ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 200;
  bottom: calc(var(--nav-h) + 26px + var(--safe-b));
  background: var(--text); color: var(--plane);
  padding: 11px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 560;
  box-shadow: var(--shadow); animation: up .18s;
  display: flex; align-items: center; gap: 8px; max-width: 90vw;
}
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { opacity: .4; margin-bottom: 10px; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }
.sync-dot.off { background: var(--muted); }
.sync-dot.pending { background: var(--warn); }
.sync-dot.err { background: var(--critical); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

.auth-wrap { max-width: 380px; margin: 0 auto; padding: 40px 20px; }
.brand { text-align: center; margin-bottom: 26px; }
.brand .logo { width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 12px;
  display: block; object-fit: cover; }
.brand h1 { font-size: 25px; margin: 0; letter-spacing: -.02em; }
.brand p { color: var(--muted); font-size: 13.5px; margin: 5px 0 0; }
.err { color: var(--critical); font-size: 13px; margin-bottom: 10px; }

table.data { width: 100%; border-collapse: collapse; font-size: clamp(12px, 3.5vw, 13px); }
table.data th { text-align: left; color: var(--muted); font-weight: 580; font-size: 11.5px;
  padding: 6px 4px; border-bottom: 1px solid var(--grid); text-transform: uppercase; }
table.data td { padding: 7px 4px; border-bottom: 1px solid var(--grid);
  font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }

/* ---------- geniş ekran ---------- */
@media (min-width: 860px) {
  body { --nav-h: 0px; }
  #app { flex-direction: row; }
  .nav {
    position: sticky; top: 0; left: 0; bottom: auto; height: 100vh; width: 216px;
    grid-template-columns: 1fr; grid-auto-rows: max-content; gap: 2px;
    align-content: start; padding: 18px 10px; border-top: 0;
    border-right: 1px solid var(--border); background: var(--surface);
  }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 11px; height: 42px;
    padding: 0 12px; border-radius: 10px; font-size: 14px; font-weight: 570; }
  .nav a.on { background: color-mix(in srgb, var(--accent) 14%, transparent); }
  .nav .navbrand { display: flex; align-items: center; gap: 9px; padding: 0 12px 16px;
    font-weight: 700; font-size: 18px; color: var(--text); }
  .app-body { flex: 1; min-width: 0; }
  main { padding: 16px 22px 60px; }
  .fab { bottom: 26px; right: 26px; }
  .grid2 { grid-template-columns: repeat(2, 1fr); }
  .cols { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; align-items: start; }
  .backdrop { align-items: center; }
  .sheet { border-radius: 18px; max-height: 86vh; max-height: 86dvh;
    border-bottom: 1px solid var(--border); }
}
.nav .more-btn { display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; height: var(--nav-h); font-size: 10.5px;
  color: var(--muted); font-weight: 550; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding-bottom: 6px; }
.more-item { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; padding: 16px 6px; border-radius: 13px; background: var(--surface-2);
  color: var(--text); font-size: 12.5px; font-weight: 560; }
.more-item:active { background: var(--accent); color: #fff; }

@media (max-width: 859px) {
  .navbrand { display: none; }
  /* Mobil alt çubukta 4 ana bölüm + "Daha" menüsü */
  .nav { grid-template-columns: repeat(5, 1fr); }
  .nav a.more-nav { display: none; }
}
@media (min-width: 860px) {
  .nav .more-btn { display: none; }
}

/* ---------- açılış perdesi ---------- */
#boot { position: fixed; inset: 0; display: grid; place-items: center; gap: 14px;
  background: var(--plane); z-index: 999; }
#boot .logo { width: 64px; height: 64px; border-radius: 19px; display: block;
  object-fit: cover; }
#boot.hide { display: none; }

/* ---------- takvim ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 10.5px; color: var(--muted); font-weight: 600;
  padding-bottom: 4px; }
.cal-day { position: relative; aspect-ratio: 1; border-radius: 9px; background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: 2px; min-height: 40px; }
.cal-day.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-day.future { opacity: .55; }
.cal-n { font-size: 12px; font-weight: 620; }
.cal-v { font-size: 9px; color: var(--text-2); font-variant-numeric: tabular-nums;
  line-height: 1; }
.cal-dot { position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); }

/* ---------- PIN kilidi ---------- */
.lock { position: fixed; inset: 0; z-index: 300; background: var(--plane);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; }
.lock-logo { width: 62px; height: 62px; border-radius: 18px; display: block;
  object-fit: cover; }
.lock-title { font-size: 17px; font-weight: 650; }
.lock-dots { display: flex; gap: 11px; margin: 6px 0 2px; }
.lock-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--grid);
  display: block; transition: background .12s; }
.lock-dots i.on { background: var(--accent); }
.lock-err { color: var(--critical); font-size: 13px; height: 18px; }
.lock-pad { width: min(300px, 82vw); }

/* ---------- toplu seçim ---------- */
.item.selected { background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 10px; }
.selbar { position: sticky; top: 58px; z-index: 30; display: flex; align-items: center;
  gap: 8px; padding: 9px 11px; border-radius: 12px; margin-bottom: 10px;
  background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.selbar .btn { background: rgba(255,255,255,.18); border-color: transparent; color: #fff; }

/* ---------- komut paleti ---------- */
.palette { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.45);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.palette-box { width: min(560px, 92vw); background: var(--surface); border-radius: 16px;
  border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden;
  animation: up .16s; }
.palette-box input { border: 0; border-radius: 0; background: transparent;
  padding: 15px 16px; font-size: 16px; border-bottom: 1px solid var(--grid); }
.palette-box input:focus { box-shadow: none; border-color: var(--grid); }
.palette-list { max-height: 56vh; overflow-y: auto; padding: 6px; }
.palette-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 11px;
  border-radius: 10px; text-align: left; font-size: 14px; }
.palette-item.on, .palette-item:hover { background: var(--surface-2); }
.palette-item .k { margin-left: auto; font-size: 11px; color: var(--muted); }

/* ---------- ek dosyalar ---------- */
.atts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.att { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2); display: grid;
  place-items: center; }
.att img { width: 100%; height: 100%; object-fit: cover; }
.att button { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.6);
  color: #fff; border-radius: 50%; width: 20px; height: 20px; display: grid;
  place-items: center; }

/* ---------- bölünmüş işlem ---------- */
.split-row { display: grid; grid-template-columns: 1fr 110px 34px; gap: 7px; margin-bottom: 7px;
  align-items: center; }
.split-sum { display: flex; justify-content: space-between; font-size: 12.5px;
  padding: 7px 2px; border-top: 1px solid var(--grid); }
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px;
  padding: 1px 6px; border-radius: 99px; background: var(--surface-2); color: var(--muted);
  margin-left: 6px; }
.badge.who { background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--text); font-weight: 600; }


/* ---------- güncelleme çubuğu ---------- */
.updatebar {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 210;
  bottom: calc(var(--nav-h) + 26px + var(--safe-b));
  display: flex; align-items: center; gap: 9px; max-width: 92vw;
  background: var(--accent); color: #fff; padding: 9px 10px 9px 14px;
  border-radius: 13px; font-size: 13.5px; font-weight: 570; box-shadow: var(--shadow);
  animation: up .18s;
}
.updatebar .btn { background: rgba(255,255,255,.2); border-color: transparent; color: #fff; }


/* ---------- sahiplik / imza ---------- */
.owner-line { display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--grid);
  font-size: 12px; color: var(--text-2); font-weight: 560; letter-spacing: .02em; }
.owner-line .tiny { font-weight: 500; }
.navowner { font-size: 10.5px; color: var(--muted); font-weight: 500; padding-left: 31px;
  margin-top: -6px; letter-spacing: .02em; }
.about-card .who { display: flex; align-items: center; gap: 12px; }
.about-card .who .avatar { font-size: 17px; font-weight: 700; }

/* ============================================================================
   EKRAN UYUMU — küçük telefondan tablete kadar
   Ölçüler clamp() ile sürekli ölçeklenir; aşağıdaki kırılımlar yalnız
   düzenin değişmesi gereken yerleri ayarlar.
   ========================================================================== */

/* --- çok küçük telefonlar (iPhone SE, ≤359px) --- */
@media (max-width: 359px) {
  :root { --nav-h: 54px; }
  .nav a span { font-size: 9px; }
  .seg button { padding: 8px 3px; font-size: 12.5px; }
  .chip { padding: 6px 10px; font-size: 12px; }
  .avatar { width: 32px !important; height: 32px !important; }
  .btn { padding: 10px 12px; font-size: 13.5px; }
  .sheet-actions { gap: 6px; }
  .cal { gap: 3px; }
  .cal-day { min-height: 34px; border-radius: 7px; }
  .cal-v { font-size: 8px; }
  .more-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- alçak ekranlar ve yatay mod: tuş takımı ekranı boğmasın --- */
@media (max-height: 560px), (orientation: landscape) and (max-height: 520px) {
  .sheet { max-height: 94vh; max-height: 94dvh; }
  .amount-display { padding: 4px 0 2px; }
  .amount-display .big { font-size: clamp(22px, 6vw, 30px); }
  .pad { gap: 4px; margin-top: 6px; }
  .pad button { padding: 7px 0; font-size: 17px; border-radius: 9px; }
  .field { margin-bottom: 8px; }
  .lock-pad button { padding: 8px 0; }
}

/* --- yatay modda geniş telefon: tuş takımı solda, alanlar sağda --- */
@media (orientation: landscape) and (min-width: 700px) and (max-width: 859px) {
  .sheet { max-width: 92vw; }
  .fab { bottom: calc(var(--nav-h) + 10px + var(--safe-b)); }
}

/* --- büyük telefon / küçük tablet --- */
@media (min-width: 600px) and (max-width: 859px) {
  main { max-width: 640px; }
  .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols { display: grid; grid-template-columns: 200px 1fr; gap: 14px; align-items: center; }
  .more-grid { grid-template-columns: repeat(4, 1fr); }
}

/* --- tablet ve üstü: iki sütunlu özet --- */
@media (min-width: 1000px) {
  main { max-width: 1180px; }
  .dash-2col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap);
    align-items: start; }
}

/* --- çentik / yan güvenli alanlar (yatay modda) --- */
.nav { padding-left: var(--safe-l); padding-right: var(--safe-r); }
.fab { right: calc(16px + var(--safe-r)); }

/* --- hiçbir yerde taşma olmasın --- */
.item, .between, .row, .card, .stat, .t { min-width: 0; }
.item .t b, .item .t span { overflow-wrap: anywhere; }
img, svg, table { max-width: 100%; }
input, select, textarea { max-width: 100%; }
/* iOS'ta 16px altı yazı tipi odaklanınca ekranı yakınlaştırır — engelle */
@supports (-webkit-touch-callout: none) {
  input, select, textarea { font-size: max(16px, 1em); }
}


/* ---------- satır: tamamı tıklanabilir + ayrı düzenle düğmesi ---------- */
.row-main {
  display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0;
  background: none; text-align: left; padding: 2px 0; border-radius: 10px;
}
.row-main:active { background: var(--surface-2); }
.row-edit {
  flex: none; width: 40px; height: 40px; border-radius: 12px; margin-left: 4px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  display: grid; place-items: center;
}
.row-edit:active { background: var(--accent); color: #fff; }
