@import url("/fonts/fonts.css");

/* ============ Tasarım token'ları — sıcak editöryel fintech ============ */
:root {
  /* renk */
  --bg: #ece6d9;
  --surface: #faf6ed;
  --surface-2: #f3ecde;
  --ink: #1b1a16;
  --muted: #78736a;
  --faint: #a59e90;
  --line: #e3dccb;
  --line-2: #d6ccb7;
  --accent: #1f6b46;
  --accent-deep: #143f2b;
  --accent-soft: #e6efe7;
  --pos: #1f6b46;
  --neg: #b0402f;
  --neg-soft: #f6e7e2;
  --warn: #ad7720;
  --warn-soft: #f6ecd9;
  /* tipografi */
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  /* form */
  --r: 18px; --r-sm: 12px; --r-lg: 24px;
  --shadow-pop: 0 12px 40px -12px rgba(27, 26, 22, .28);
  --tnum: "tnum" 1, "lnum" 1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
html { overscroll-behavior: none; }
.hidden { display: none !important; }
.view { min-height: 100dvh; display: flex; flex-direction: column; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: var(--tnum); }
.num { font-feature-settings: var(--tnum); font-variant-numeric: tabular-nums; }

/* ikonlar */
.ic { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 24px; height: 24px; }

button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ============ Login / PIN / yeni üye ============ */
.login-wrap, .pin-wrap {
  margin: auto; width: min(420px, 92vw); padding: 40px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
}
.brand { font-family: var(--serif); font-size: 44px; font-weight: 400; letter-spacing: -0.01em; color: var(--ink); line-height: 1; }
.brand-sub { color: var(--muted); font-size: 15px; }
.user-list { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 8px; }
.user-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  font-size: 17px; font-weight: 600; transition: border-color .15s ease, transform .12s ease;
}
.user-row:hover { border-color: var(--line-2); }
.user-row:active { transform: scale(.99); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.02em;
}
.avatar.lg { width: 68px; height: 68px; font-size: 27px; }

.ghost-btn {
  background: none; border: 1px solid var(--line-2); color: var(--muted);
  padding: 12px 18px; border-radius: var(--r); font-size: 15px; font-weight: 500;
  transition: border-color .15s, color .15s;
}
.ghost-btn:hover { border-color: var(--accent); color: var(--accent); }
.ghost-btn.sm { padding: 8px 12px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }

.back {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 10px; background: none; border: none;
  color: var(--accent); font: 600 16px/1 var(--sans); padding: 0 14px; min-height: 44px; min-width: 44px; border-radius: 12px;
  display: flex; align-items: center; gap: 4px; cursor: pointer;
}
.back:hover, .back:active { color: var(--accent-deep); background: var(--surface-2); }
.pin-dots { display: flex; gap: 16px; margin: 4px 0; }
.pin-dots span { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--accent); transition: background .15s; }
.pin-dots span.on { background: var(--accent); }
.err { color: var(--neg); font-size: 14px; min-height: 18px; }

.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 320px; margin-top: 8px; }
.numpad button {
  height: 62px; font-size: 23px; font-weight: 500; font-feature-settings: var(--tnum);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 14px;
  transition: background .12s, border-color .12s;
}
.numpad button:hover { border-color: var(--line-2); }
.numpad button:active { background: var(--surface-2); }
.numpad button.act { color: var(--accent); font-size: 17px; }

.text-input {
  width: 100%; padding: 14px 16px; font-size: 16px; font-family: inherit;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); outline: none;
  transition: border-color .15s;
}
.text-input::placeholder { color: var(--faint); }
.text-input:focus { border-color: var(--accent); }
.text-input.flat { background: #fff; }
.color-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.color-row .swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; outline: 1px solid var(--line); outline-offset: -1px; }
.color-row .swatch.sel { border-color: var(--ink); }

/* ============ Uygulama kabuğu ============ */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 16px 18px 10px; padding-top: max(16px, env(safe-area-inset-top));
}
.who { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-nav { display: flex; align-items: center; gap: 2px; }
.month-nav span { font-size: 13px; color: var(--ink); text-transform: capitalize; min-width: 104px; text-align: center; font-weight: 600; }
.month-nav button { background: none; border: none; color: var(--accent); width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; transition: background .12s; }
.month-nav button:hover { background: var(--surface-2); }
.month-nav button:disabled { color: var(--line-2); }

/* aile/ben kapsam barı */
.scope-bar { display: flex; gap: 4px; margin: 2px 18px 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 4px; }
.scope-bar button {
  flex: 1; padding: 8px; border: none; background: none; border-radius: 9px; font-size: 13.5px; color: var(--muted);
  font-weight: 600; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: color .12s;
}
.scope-bar button .ic { width: 16px; height: 16px; }
.scope-bar button.act { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(27,26,22,.06); }

.content { flex: 1; padding: 12px 18px 132px; overflow-y: auto; }
.content h3 {
  font-size: 12px; color: var(--muted); margin: 26px 0 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; justify-content: space-between;
}
.tab-intro { font-size: 13px; color: var(--muted); margin: 8px 2px 2px; line-height: 1.5; text-wrap: pretty; }
/* sekme geçişi anlık — fade kaldırıldı (her geçişte tekrar oynayıp titreme yapıyordu) */

.link-btn { background: none; border: none; color: var(--accent); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; text-transform: none; letter-spacing: 0; }
.link-btn .ic { width: 14px; height: 14px; }
.muted-note { color: var(--muted); font-size: 12px; }
.eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ============ Net değer (hero) — açık, editöryel ============ */
.hero {
  margin: 8px 0 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px 22px 18px;
}
.hero.compact { padding: 18px 22px; margin: 8px 0 16px; }
.hero-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hero-total {
  font-family: var(--serif); font-weight: 400; font-size: 56px; line-height: .98; letter-spacing: -0.01em;
  color: var(--ink); margin: 6px 0 14px; font-feature-settings: var(--tnum);
}
.hero.compact .hero-total { margin-bottom: 0; }
.hero-total small { font-family: var(--serif); font-size: 24px; color: var(--faint); }
.hero-foreign {
  font-family: var(--mono); font-size: 15px; font-weight: 600; color: #c8893f;
  margin: -8px 0 12px; letter-spacing: .01em; font-feature-settings: var(--tnum);
}
.hero.compact .hero-foreign { margin-bottom: 0; }
.split { display: flex; gap: 3px; height: 7px; border-radius: 4px; overflow: hidden; margin-bottom: 12px; background: var(--surface-2); }
.split i { display: block; height: 100%; border-radius: 4px; }
.split i.cash { background: var(--accent); }
.split i.inv { background: #c8893f; }
.hero-sub { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.hero-sub .leg { display: inline-flex; align-items: center; gap: 6px; }
.hero-sub .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.hero-sub b { color: var(--ink); font-weight: 600; font-feature-settings: var(--tnum); }

/* mini istatistik kartları */
.two-card { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.mini-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 15px; display: flex; flex-direction: column; gap: 3px; }
.mini-card.wide { margin: 6px 0; }
.mini-card span { font-size: 12px; color: var(--muted); }
.mini-card b { font-size: 23px; letter-spacing: -.01em; font-weight: 600; font-feature-settings: var(--tnum); }
.mini-card small { font-size: 11.5px; color: var(--faint); font-feature-settings: var(--tnum); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* ============ Listeler ============ */
.row-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.exp, .row {
  display: flex; align-items: center; gap: 13px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px;
  transition: border-color .12s;
}
.exp:hover, .row:hover { border-color: var(--line-2); }
.ico-badge { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); color: var(--ink); display: grid; place-items: center; flex: none; }
.ico-badge .ic { width: 19px; height: 19px; }
.exp .mid, .row .mid { flex: 1; min-width: 0; }
.exp-cat, .row .t { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.exp .meta, .row .s { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.exp .meta .imp { color: var(--warn); }
.amt, .row .v { font-weight: 600; font-feature-settings: var(--tnum); font-size: 15px; }
.row .v.pos { color: var(--pos); }
.row.soon { border-color: #ecdcc0; background: var(--warn-soft); }
.row.soon .s { color: var(--warn); font-weight: 500; }
.edit-hint { color: var(--faint); display: inline-flex; }
.edit-hint .ic { width: 13px; height: 13px; }
.icon-btn { background: none; border: none; color: var(--faint); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; transition: color .12s, background .12s; }
.icon-btn:hover { color: var(--neg); background: var(--neg-soft); }
.icon-btn .ic { width: 17px; height: 17px; }
.empty { color: var(--muted); font-size: 14px; padding: 18px 4px; text-wrap: pretty; }

/* ============ Trend ============ */
.chart-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; height: 300px; }
.chart-wrap canvas { max-height: 268px; }
.bud { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; }
.bud-top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin-bottom: 9px; }
.bud-top span { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.bud-top .r { color: var(--muted); font-feature-settings: var(--tnum); font-weight: 400; }
.bud-right { display: inline-flex; align-items: center; gap: 4px; }
.bud-right .icon-btn { width: 28px; height: 28px; }
.bar { height: 8px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.bar.warn i { background: var(--warn); }
.bar.over i { background: var(--neg); }

/* ============ Hedef / sızıntı ============ */
.goal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 15px; }
.goal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.goal-top .gn { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.goal-top .gp { font-size: 14px; color: var(--accent); font-weight: 600; font-feature-settings: var(--tnum); }
.goal-card .bar { margin: 10px 0 7px; }
.goal-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); }
.goal-meta .edit-cur { cursor: pointer; }
.goal-meta .end { display: inline-flex; align-items: center; gap: 8px; }

.leak { background: var(--warn-soft); border: 1px solid #ecdcc0; border-radius: var(--r); padding: 13px 15px; font-size: 13.5px; line-height: 1.5; display: flex; gap: 11px; align-items: flex-start; }
.leak .ic { color: var(--warn); margin-top: 1px; }
.leak.green { background: var(--accent-soft); border-color: #cfe2d3; }
.leak.green .ic { color: var(--accent); }
.leak b { font-weight: 600; }

/* ============ AI ============ */
.ai-head { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 12px; }
.ai-head h3 { margin: 0; }
.ai-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; white-space: pre-wrap; line-height: 1.65; font-size: 15px; min-height: 120px; text-wrap: pretty; }

/* ============ Bottom nav ============ */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 30;
}
.nav-btn {
  background: none; border: none; padding: 10px 0 11px; font-size: 10.5px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 4px; transition: color .12s; font-weight: 500;
}
.nav-btn .ic { width: 21px; height: 21px; }
.nav-btn.act { color: var(--accent); font-weight: 600; }

.fab {
  position: fixed; right: 20px; bottom: calc(84px + env(safe-area-inset-bottom));
  width: 58px; height: 58px; border-radius: 18px; border: none;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow-pop); z-index: 25; transition: transform .12s;
}
.fab .ic { width: 26px; height: 26px; stroke-width: 2; }
.fab:hover { background: var(--accent-deep); }
.fab:active { transform: scale(.95); }

.install-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom));
  background: var(--accent-deep); color: #eef3ec; border-radius: var(--r); padding: 13px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px;
  box-shadow: var(--shadow-pop); z-index: 28;
}
.install-banner .link-btn { color: #a7e0c0; min-height: 40px; }

/* ============ Bottom sheet ============ */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 28, 22, .42); animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet-card {
  position: absolute; left: 0; right: 0; bottom: 0; background: var(--bg);
  max-height: 94dvh; overflow-y: auto;
  border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(20,28,22,.22); animation: rise .24s cubic-bezier(.16,1,.3,1); overscroll-behavior: contain;
}
@media (prefers-reduced-motion: no-preference) { @keyframes rise { from { transform: translateY(100%); } to { transform: translateY(0); } } }
.sheet-grip { width: 38px; height: 4px; background: var(--line-2); border-radius: 3px; margin: 2px auto 14px; }
.mode-toggle { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 4px; margin-bottom: 14px; }
.mode-toggle .mode { flex: 1; border: none; background: none; padding: 10px; border-radius: 9px; font-size: 15px; font-weight: 600; color: var(--muted); min-height: 44px; transition: color .12s; }
.mode-toggle .mode.act { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(27,26,22,.06); }
.amount-display { text-align: center; font-family: var(--serif); font-size: 50px; line-height: 1.1; color: var(--ink); font-feature-settings: var(--tnum); }
.amount-display .cur { font-size: 24px; color: var(--faint); margin-left: 4px; }
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 16px 0; }
.cat {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 2px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 10px; color: var(--muted);
  transition: border-color .12s, background .12s; min-height: 60px; justify-content: center;
}
.cat .ic { width: 20px; height: 20px; color: var(--ink); }
.cat.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cat.sel .ic { color: var(--accent); }
.sheet-row { display: flex; gap: 10px; margin-bottom: 12px; }
.sheet-row .text-input { flex: 1; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-sm); padding: 0 16px; font-size: 13px; white-space: nowrap; color: var(--muted); transition: .12s; }
.chip[data-essential="0"] { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.pad-amount button { height: 52px; font-size: 21px; }
.primary-btn {
  width: 100%; margin-top: 12px; padding: 16px; border: none; border-radius: var(--r-sm);
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; transition: background .12s;
}
.primary-btn:hover { background: var(--accent-deep); }
.primary-btn:disabled { background: var(--line-2); color: var(--surface); }

/* genel form sheet */
.form-fields { display: flex; flex-direction: column; gap: 12px; }
.form-fields label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.form-fields input, .form-fields select { padding: 12px 14px; font-size: 16px; font-family: inherit; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; color: var(--ink); }
.form-fields input:focus { outline: none; border-color: var(--accent); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1; min-width: 58px; padding: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; font-size: 13px; color: var(--muted); transition: .12s; }
.seg button.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }

#confirm { z-index: 56; } /* hane/profil sheet'lerinin üstünde açılsın */

/* ============ Oyunlaştırma: seri çubuğu, günlük kart, kutlama, ödüller ============ */
.bar.thin { height: 6px; }
.gamebar { display: flex; align-items: center; gap: 14px; margin: 6px 0 10px; padding: 11px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; min-height: 60px; }
.gamebar:active { border-color: var(--line-2); }
.gb-streak { display: flex; align-items: center; gap: 8px; flex: none; }
.gb-streak > span:last-child { display: flex; flex-direction: column; }
.gb-flame .ic { width: 28px; height: 28px; color: var(--faint); }
.gb-flame.on .ic { color: #c8893f; fill: #f6dca4; }
.gb-flame.risk .ic { color: var(--warn); animation: flamePulse 1.6s ease-in-out infinite; }
@keyframes flamePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.gb-n { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1; font-feature-settings: var(--tnum); }
.gb-streak small { font-size: 11px; color: var(--muted); margin-top: 1px; }
.gb-level { flex: 1; min-width: 0; }
.gb-lv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.gb-lv-top small { font-weight: 400; color: var(--muted); font-size: 11.5px; font-feature-settings: var(--tnum); white-space: nowrap; }
.gb-shield { flex: none; display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 12px; font-weight: 600; }
.gb-shield .ic { width: 20px; height: 20px; }
.bar i { transition: width .5s cubic-bezier(.16, 1, .3, 1); }

.dailycard { display: flex; gap: 12px; align-items: center; margin: 0 0 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.dailycard.risk { background: var(--warn-soft); border-color: #ecdcc0; }
.dc-mascot { flex: none; line-height: 0; }
.dc-body { flex: 1; min-width: 0; }
.dc-title { font-family: var(--serif); font-size: 23px; line-height: 1.1; }
.dc-text { font-size: 13px; color: var(--muted); margin: 3px 0 10px; line-height: 1.4; text-wrap: pretty; }
.dc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dc-primary { background: var(--accent); color: #fff; border: none; border-radius: var(--r-sm); padding: 0 14px; min-height: 42px; font-weight: 600; font-size: 14px; }
.dc-primary:active { background: var(--accent-deep); }
.dc-ghost { background: none; border: 1px solid var(--line-2); color: var(--ink); border-radius: var(--r-sm); padding: 0 12px; min-height: 42px; font-size: 14px; }
.pushcard { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 12px 14px; background: var(--accent-soft); border: 1px solid #cfe2d3; border-radius: var(--r); }
.pc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.pc-text b { color: var(--ink); font-size: 14px; }
.pc-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.pc-actions button { min-height: 36px; font-size: 13px; }

.cele { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(20, 28, 22, .5); animation: fadeIn .2s ease; }
.cele-card { width: min(340px, 88vw); background: var(--bg); border-radius: var(--r-lg); padding: 20px 18px 16px; text-align: center; box-shadow: var(--shadow-pop); animation: celePop .4s cubic-bezier(.16, 1, .3, 1); }
@keyframes celePop { from { transform: scale(.82); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cele-title { font-family: var(--serif); font-size: 34px; line-height: 1.05; margin-top: 4px; }
.cele-text { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.cele-lines { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; text-align: left; }
.cele-line { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14px; }
.cele-line .ic { color: #c8893f; flex: none; }
.cele-line b { font-weight: 600; }
.cele-line small { color: var(--muted); display: block; font-size: 12px; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 75; pointer-events: none; }

.gs-head { display: flex; align-items: center; gap: 14px; }
.gs-head > div:first-child { line-height: 0; flex: none; }
.gs-level { font-family: var(--serif); font-size: 30px; line-height: 1.05; }
.gs-xp { color: var(--muted); font-size: 13px; font-feature-settings: var(--tnum); }
.gs-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 4px; }
.gs-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 6px; text-align: center; }
.gs-stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.1; font-feature-settings: var(--tnum); }
.gs-stat span { font-size: 11.5px; color: var(--muted); }
.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wk { text-align: center; font-size: 11px; color: var(--muted); }
.wk i { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 4px; border-radius: 50%; border: 1.5px solid var(--line-2); color: #fff; }
.wk i .ic { width: 16px; height: 16px; }
.wk.done i { background: var(--accent); border-color: var(--accent); }
.wk.today i { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wk.future { opacity: .4; }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bd { text-align: center; padding: 12px 6px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); opacity: .72; }
.bd.earned { opacity: 1; }
.bd i { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 6px; border-radius: 50%; background: var(--surface-2); color: var(--faint); }
.bd.earned i { background: #f6e6c3; color: #a8702a; }
.bd i .ic { width: 22px; height: 22px; }
.bd b { display: block; font-size: 12.5px; line-height: 1.2; }
.bd small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; line-height: 1.3; }
.form-fields textarea { padding: 12px 14px; font-size: 16px; font-family: inherit; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; color: var(--ink); min-height: 96px; resize: vertical; }
.form-fields textarea:focus { outline: none; border-color: var(--accent); }

/* yönetici paneli */
.adm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.adm-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 6px; text-align: center; }
.adm-tile b { display: block; font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.1; }
.adm-tile span { font-size: 11px; color: var(--muted); }
.adm-bars { display: flex; align-items: flex-end; gap: 4px; height: 70px; padding: 6px 4px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.adm-bars div { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.adm-bars div.zero { background: var(--line-2); }
.adm-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.adm-row:last-child { border-bottom: none; }
.adm-row b { font-feature-settings: var(--tnum); font-weight: 600; }
.adm-row small { color: var(--muted); }
.adm-fb { padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13px; margin-bottom: 6px; line-height: 1.4; }
.adm-fb small { display: block; color: var(--muted); margin-top: 2px; }
/* ============ Hane (giriş / kod paylaşma) ============ */
.code-input { text-align: center; text-transform: uppercase; letter-spacing: .14em; font-family: var(--mono); font-weight: 500; }
.code-input::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--sans); }
.fine-print { font-size: 12.5px; color: var(--muted); line-height: 1.5; text-wrap: pretty; max-width: 320px; }
.code-tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--ink); }
.code-big { font-family: var(--mono); font-size: 34px; font-weight: 600; letter-spacing: .12em; text-align: center; padding: 16px 8px; margin: 10px 0 14px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--ink); user-select: all; }
.sub-h { font-size: 12px; color: var(--muted); margin: 18px 0 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.role-tag { font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 6px; margin-left: 6px; font-weight: 600; }

/* ============ Hızlı ekle çipleri ============ */
.quick-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.quick-row::-webkit-scrollbar { display: none; }
.quick-chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 13px; max-width: 220px; min-height: 40px;
}
.quick-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-chip b { font-weight: 600; color: var(--accent); font-feature-settings: var(--tnum); }
.quick-chip:active { background: var(--accent-soft); border-color: var(--accent); }

/* ============ Özet kartı butonu + önizleme ============ */
.share-btn {
  width: 100%; margin: 6px 0 2px; padding: 12px; border-radius: var(--r-sm); border: 1px dashed var(--line-2);
  background: none; color: var(--accent); font-size: 14px; font-weight: 600; min-height: 44px;
}
.share-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.card-preview { display: block; width: 100%; max-height: 62dvh; object-fit: contain; border-radius: 14px; margin: 0 auto 14px; border: 1px solid var(--line); }

/* ============ AI'ya sor ============ */
.ask-box { display: flex; gap: 8px; }
.ask-box .text-input { flex: 1; min-width: 0; }
.ask-go { flex: none; padding: 0 18px; border: none; border-radius: var(--r-sm); background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; min-height: 48px; }
.ask-go:disabled { background: var(--line-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.chips button { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font-size: 12.5px; min-height: 36px; }
.chips button:active { border-color: var(--accent); color: var(--accent); }
.ask-answer { margin-top: 4px; min-height: 0; }

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--accent-deep); color: #eef3ec; padding: 12px 18px; border-radius: var(--r-sm); font-size: 14px;
  box-shadow: var(--shadow-pop); z-index: 60; max-width: 88vw; text-align: center; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px; animation: toastIn .2s ease;
}
.toast .ic { width: 16px; height: 16px; }
.toast.err { background: var(--neg); }
.toast.ok { background: var(--accent); }
.toast.warn { background: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============ Fotoğraf kırpıcı ============ */
.crop-view { position: relative; width: min(78vw, 300px); height: min(78vw, 300px); margin: 0 auto; overflow: hidden; border-radius: 16px; background: #d8d2c4; touch-action: none; cursor: grab; }
.crop-view:active { cursor: grabbing; }
#crop-img { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 2000px rgba(20, 28, 22, .45); pointer-events: none; }
.crop-zoom { width: 100%; margin: 16px 0; accent-color: var(--accent); }
.avatar { background-size: cover; background-position: center; overflow: hidden; }

/* ============ Skeleton (yükleniyor) ============ */
.skeleton { background: linear-gradient(100deg, var(--surface-2) 30%, #eadfca 50%, var(--surface-2) 70%); background-size: 220% 100%; animation: shimmer 1.3s ease-in-out infinite; border-radius: var(--r); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -20% 0; } }
.skel-row { height: 66px; margin-bottom: 8px; }
.skel-line { height: 14px; border-radius: 6px; }
.skel-card { height: 96px; }

/* ============ Onay sheet'i ============ */
.confirm-card { text-align: center; }
.confirm-msg { font-size: 16px; line-height: 1.5; color: var(--ink); margin: 8px 6px 18px; text-wrap: pretty; }
.confirm-actions { display: flex; gap: 10px; }
.btn-ghost, .btn-danger { flex: 1; padding: 15px; border-radius: var(--r-sm); font-size: 15px; font-weight: 600; border: 1px solid var(--line-2); }
.btn-ghost { background: var(--surface); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-danger { background: var(--neg); color: #fff; border-color: var(--neg); }
.btn-danger:hover { filter: brightness(.94); }

/* ============ Trend: orta toplam + legend ============ */
.chart-wrap { position: relative; }
.chart-center { position: absolute; inset: 16px 16px auto; top: 50%; transform: translateY(-50%); text-align: center; pointer-events: none; }
.chart-center .cc-label { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; color: var(--muted); }
.chart-center b { font-family: var(--serif); font-size: 30px; color: var(--ink); font-feature-settings: var(--tnum); }
.chart-center b small { font-size: 14px; color: var(--faint); }
.cat-legend { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.leg-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.leg-row:last-child { border-bottom: none; }
.leg-row .swatch-sq { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.leg-row .ln { flex: 1; font-size: 14px; }
.leg-row .lp { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.leg-row .lv { font-weight: 600; font-feature-settings: var(--tnum); font-size: 14px; min-width: 78px; text-align: right; }

/* ============ Boş durum + CTA ============ */
.empty-state { text-align: center; padding: 30px 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty-state p { color: var(--muted); font-size: 14px; text-wrap: pretty; max-width: 240px; }
.empty-cta { display: inline-flex; align-items: center; gap: 7px; padding: 11px 18px; border-radius: var(--r-sm); border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; }
.empty-cta:hover { background: var(--accent); color: #fff; }
.empty-cta .ic { width: 16px; height: 16px; }

/* ============ Masaüstü: ortalı çerçeve ============ */
@media (min-width: 560px) {
  body { background: #e1dac9; }
  #view-app { background: var(--bg); max-width: 480px; margin: 0 auto; min-height: 100dvh; border-left: 1px solid var(--line); border-right: 1px solid var(--line); position: relative; }
  .bottom-nav { left: 50%; transform: translateX(-50%); width: 480px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .install-banner { left: 50%; transform: translateX(-50%); right: auto; width: 456px; }
  .fab { left: 50%; right: auto; margin-left: 162px; }
  .sheet-card { left: 50%; right: auto; margin-left: -240px; width: 480px; border-radius: var(--r-lg); bottom: 14px; }
  .toast { bottom: 28px; }
}

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

/* Yazarak giriş ("dün 250 migros") + tarih etiketi */
.smart-row .chip { color: var(--accent); border-color: var(--accent); font-weight: 600; min-height: 44px; }
.smart-msg { font-size: 13px; color: var(--muted); margin: -6px 2px 10px; }
.date-chip { display: block; margin: 0 auto 10px; min-height: 32px; padding: 0 12px; color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
/* Harcama ekleme: Kaydet düğmesi hep görünsün (sheet uzun, küçük telefonlarda numpad'in altında kalıyordu) */
#sheet #save-expense { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 2; box-shadow: 0 0 0 8px var(--bg); }
