:root {
  --paper: #fff;
  --ink: #000;
  --soft: #f6f6f4;
  --line: #e4e4e0;
  --mute: #66665f;
  --new: #1f5fbf;
  --good: #0e7a4b;
  --warn: #a15c00;
  --bad: #b3261e;
  --tabs: 64px;
  color-scheme: light dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.45 Onest, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }

.app { max-width: 640px; margin: 0 auto; min-height: 100dvh; padding: 0 16px calc(var(--tabs) + 28px + env(safe-area-inset-bottom)); }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 0 12px;
  background: var(--paper);
}
.top h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.sub { color: var(--mute); font-size: 14px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; flex: none; }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(3, 1fr);
  max-width: 640px; margin: 0 auto;
  height: calc(var(--tabs) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.tabs button { display: grid; justify-items: center; align-content: center; gap: 2px; font-size: 12px; font-weight: 500; color: var(--mute); }
.tabs button[aria-current] { color: var(--ink); font-weight: 700; }
.tabs button[aria-current] svg { stroke-width: 2.3; }

/* Günün çizelgesi: ana ekrandaki tek güçlü öğe */
.ledger { background: var(--ink); color: var(--paper); border-radius: 12px; padding: 4px 16px; }
.ledger button { display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 16px; padding: 13px 0; text-align: left; }
.ledger button + button { border-top: 1px solid color-mix(in srgb, var(--paper) 22%, transparent); }
.ledger .k { font-size: 15px; }
.ledger .k small { display: block; font-size: 13px; opacity: .68; }
.ledger .v { font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }

section.block { margin-top: 28px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.block-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.block-head span, .link { color: var(--mute); font-size: 14px; }
.link { text-decoration: underline; text-underline-offset: 3px; }

.bars { display: flex; align-items: flex-end; gap: 2px; height: 76px; border-bottom: 1px solid var(--line); }
.bars i { flex: 1; min-height: 2px; background: var(--ink); border-radius: 2px 2px 0 0; }
.bars i.today { background: var(--new); }
.bars-foot { display: flex; justify-content: space-between; color: var(--mute); font-size: 13px; margin-top: 6px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; }
.stats > div { padding: 12px 14px; min-width: 0; }
.stats > div:nth-child(even) { border-left: 1px solid var(--line); }
.stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
.stats b { display: block; font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.stats span { color: var(--mute); font-size: 13px; }

.funnel { display: grid; gap: 8px; }
.funnel button { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; width: 100%; text-align: left; font-size: 15px; padding: 2px 0; }
.funnel em { grid-column: 1 / -1; display: block; height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.funnel em i { display: block; height: 100%; background: var(--ink); }

.search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; }
.search svg { color: var(--mute); flex: none; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 16px; }
.search:focus-within { border-color: var(--ink); }

.filters { display: flex; gap: 6px; overflow-x: auto; margin: 10px -16px 2px; padding: 2px 16px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; white-space: nowrap; }
.filters button span { color: var(--mute); margin-left: 3px; }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 600; }
.filters button[aria-pressed="true"] span { color: inherit; opacity: .7; }

.list { border-top: 1px solid var(--line); margin-top: 8px; }
.row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.row .main { flex: 1; min-width: 0; display: block; text-align: left; padding: 12px 0; }
.row .line1 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .when { color: var(--mute); font-size: 13px; flex: none; }
.row .amount { font-weight: 700; flex: none; }
.row .line2 { display: block; min-width: 0; color: var(--mute); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .call { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; flex: none; }
.status { color: var(--ink); font-weight: 500; }
.status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: var(--mute); }
.s-new::before { background: var(--new); } .s-good::before { background: var(--good); }
.s-warn::before { background: var(--warn); } .s-bad::before { background: var(--bad); }
.late { color: var(--bad); font-weight: 600; }

.progress { display: block; height: 4px; margin-top: 7px; background: var(--soft); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--good); }

.more { display: block; width: 100%; min-height: 46px; margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; font-weight: 500; }
.empty, .state { color: var(--mute); padding: 20px 0; }
.state h2 { color: var(--ink); font-size: 18px; margin-bottom: 4px; }
.notice { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--mute); font-size: 14px; }
.skeleton { display: block; height: 58px; margin-top: 8px; border-radius: 8px; background: var(--soft); }

/* Detay penceresi */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet[hidden] { display: none; }
.scrim { position: absolute; inset: 0; width: 100%; background: rgba(0, 0, 0, .45); }
.panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 640px; max-height: 88dvh; margin: 0 auto; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 16px calc(24px + env(safe-area-inset-bottom));
  background: var(--paper); border-radius: 12px 12px 0 0;
  animation: rise .18s ease-out;
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.grip { width: 36px; height: 4px; margin: 2px auto 12px; border-radius: 2px; background: var(--line); }
.panel h2 { font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.panel h3 { font-size: 16px; font-weight: 700; margin: 22px 0 4px; }
.panel .meta { color: var(--mute); font-size: 14px; margin-top: 3px; }
.actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 14px; }
.actions a { display: grid; place-items: center; min-height: 46px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; font-size: 15px; text-decoration: none; }
.actions a:first-child { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0 0; font-size: 15px; }
.facts dt { color: var(--mute); }
.facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.quote { margin-top: 12px; padding: 10px 12px; background: var(--soft); border-radius: 8px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.entry header { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.entry time, .entry .right { color: var(--mute); font-weight: 400; font-size: 14px; flex: none; }
.entry p { color: var(--mute); margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (min-width: 900px) {
  .app { max-width: 760px; padding: 0 24px 40px; }
  .tabs { position: sticky; top: 0; bottom: auto; height: 52px; padding: 0; border-top: 0; border-bottom: 1px solid var(--line); max-width: none; order: -1; margin-bottom: 8px; }
  .tabs button { grid-auto-flow: column; gap: 8px; font-size: 15px; }
  .app { display: flex; flex-direction: column; }
  .top { position: static; }
  .panel { left: auto; top: 0; right: 0; max-width: 460px; width: 100%; max-height: none; border-radius: 0; animation: none; }
  .grip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .panel { animation: none; }
  .icon-btn.spin svg { animation-duration: 3s; }
}

/* Çizgi film görünümü */
:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #1d1a39;
  --soft: #eaf6ff;
  --line: #1d1a39;
  --mute: #55527a;
  --sky: #bfe8ff;
  --sun: #ffd23f;
  --pink: #ff8fb8;
  --mint: #5fe0a8;
  --new: #2f7bff;
  --good: #0a9d63;
  --warn: #d97a00;
  --bad: #e5352b;
  --edge: 3px solid var(--ink);
  --pop: 4px 4px 0 var(--ink);
}
body {
  background: var(--sky) radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .75) 2.5px, transparent 3px) 0 0 / 22px 22px;
  font-family: Nunito, system-ui, sans-serif;
  font-weight: 600;
}
h1, h2, h3, .ledger .v, .stats b, .tabs button, .row .name, .row .amount, .actions a, .more, .filters button {
  font-family: "Baloo 2", Nunito, system-ui, sans-serif;
}
.top { background: transparent; position: static; }
.top h1 { font-size: 36px; font-weight: 800; letter-spacing: 0; text-shadow: 3px 3px 0 #fff; }
.sub { font-weight: 700; color: var(--ink); }
.icon-btn { border: var(--edge); border-radius: 50%; background: var(--sun); box-shadow: 3px 3px 0 var(--ink); }
button:active, .actions a:active, .row .call:active { transform: translate(2px, 2px); }

.tabs { background: #fff; border-top: var(--edge); }
.tabs button { color: var(--mute); font-size: 14px; }
.tabs button[aria-current] { color: var(--ink); font-weight: 800; }
.tabs button[aria-current] svg { background: var(--sun); border-radius: 50%; padding: 3px; width: 30px; height: 30px; border: 2px solid var(--ink); }

.hello { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 16px; }
.hello svg { width: 92px; height: 104px; flex: none; stroke: none; }
.bubble { position: relative; flex: 1; padding: 12px 14px; background: #fff; border: var(--edge); border-radius: 20px; box-shadow: var(--pop); font-weight: 800; font-size: 16px; line-height: 1.3; }
.bubble::before { content: ""; position: absolute; left: -13px; bottom: 16px; width: 18px; height: 18px; background: #fff; border-left: var(--edge); border-bottom: var(--edge); transform: rotate(45deg) skew(12deg, 12deg); }

.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0; background: none; color: var(--ink); border-radius: 0; }
.ledger button { display: flex; flex-direction: column-reverse; align-items: flex-start; justify-content: flex-end; gap: 2px; padding: 12px; border: var(--edge) !important; border-radius: 18px; box-shadow: var(--pop); }
.ledger button:nth-child(1) { background: var(--mint); transform: rotate(-1deg); }
.ledger button:nth-child(2) { background: var(--sun); transform: rotate(1deg); }
.ledger button:nth-child(3) { background: var(--pink); transform: rotate(1deg); }
.ledger button:nth-child(4) { background: #fff; transform: rotate(-1deg); }
.ledger .k { font-weight: 800; font-size: 15px; }
.ledger .k small { opacity: 1; font-weight: 700; }
.ledger .v { font-size: 34px; font-weight: 800; letter-spacing: 0; }

.block-head h2 { font-size: 23px; font-weight: 800; letter-spacing: 0; }
.block-head span, .link { color: var(--ink); font-weight: 700; }
section.block { padding: 14px; background: #fff; border: var(--edge); border-radius: 20px; box-shadow: var(--pop); }
.bars { height: 92px; gap: 3px; border-bottom: var(--edge); }
.bars i { background: var(--new); border: 2px solid var(--ink); border-bottom: 0; border-radius: 5px 5px 0 0; }
.bars i:nth-child(3n) { background: var(--pink); }
.bars i:nth-child(3n+1) { background: var(--mint); }
.bars i.today { background: var(--sun); }
.bars-foot { color: var(--ink); }
.notice { border: var(--edge); border-radius: 14px; background: var(--sun); color: var(--ink); }

.stats { border: var(--edge); border-radius: 20px; background: #fff; box-shadow: var(--pop); overflow: hidden; }
.stats > div:nth-child(1) { background: var(--mint); }
.stats > div:nth-child(2) { background: var(--sun); }
.stats > div:nth-child(3) { background: #fff; }
.stats > div:nth-child(4) { background: var(--pink); }
.stats > div:nth-child(even) { border-left: var(--edge); }
.stats > div:nth-child(n+3) { border-top: var(--edge); }
.stats b { font-size: 26px; font-weight: 800; letter-spacing: 0; }
.stats span { color: var(--ink); font-weight: 700; }

.search { height: 50px; background: #fff; border: var(--edge); border-radius: 25px; box-shadow: var(--pop); }
.search svg { color: var(--ink); }
.filters { margin-top: 14px; padding-bottom: 6px; }
.filters button { background: #fff; border: var(--edge); border-radius: 14px; box-shadow: 2px 2px 0 var(--ink); font-weight: 700; }
.filters button span { color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--sun); border-color: var(--ink); color: var(--ink); font-weight: 800; }

.list { border-top: 0; display: grid; gap: 10px; margin-top: 10px; }
.row { padding: 0 10px 0 12px; background: #fff; border: var(--edge); border-radius: 16px; }
.row .main { padding: 10px 0; }
.row .name { font-size: 18px; font-weight: 700; }
.row .when, .row .line2 { color: var(--mute); font-weight: 600; }
.row .amount { font-size: 18px; font-weight: 800; }
.row .call { border: var(--edge); border-radius: 50%; background: var(--mint); }
section.block .row { border-width: 2px; }
.status { font-weight: 800; color: var(--ink); }
.status::before { width: 11px; height: 11px; border: 2px solid var(--ink); }
.late { font-weight: 800; }
.progress { height: 10px; border: 2px solid var(--ink); border-radius: 6px; background: #fff; }
.progress i { background: var(--mint); }
.more { background: var(--sun); border: var(--edge); border-radius: 16px; box-shadow: var(--pop); font-weight: 800; }
.skeleton { border: var(--edge); border-radius: 16px; background: #fff; }

.scrim { background: rgba(29, 26, 57, .55); }
.panel { background: var(--paper); border: var(--edge); border-bottom: 0; border-radius: 24px 24px 0 0; }
.grip { height: 6px; background: var(--ink); }
.panel h2 { font-size: 28px; font-weight: 800; letter-spacing: 0; }
.panel h3 { font-size: 20px; font-weight: 800; }
.actions a { background: #fff; border: var(--edge); border-radius: 16px; box-shadow: 3px 3px 0 var(--ink); font-weight: 800; }
.actions a:first-child { background: var(--mint); border-color: var(--ink); color: var(--ink); }
.actions a:nth-child(2) { background: var(--sun); }
.quote { background: var(--soft); border: 2px solid var(--ink); border-radius: 16px; font-weight: 600; }
.entry { border-bottom: 2px dashed var(--ink); }
.facts dt { font-weight: 700; }

@media (min-width: 900px) {
  .tabs { border-top: 0; border-bottom: var(--edge); background: #fff; }
  .panel { border-bottom: var(--edge); border-radius: 0; }
}

.demo-note { padding: 7px 16px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 800; text-align: center; }
