:root {
  --bg: #05060f;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef0ff;
  --muted: #9aa0c3;
  --dim: #6b7099;
  --violet: #8b7bff;
  --pink: #ff6fb1;
  --teal: #3de0d8;
  --gold: #ffc861;
  --red: #ff6b7d;
  --green: #4ee0a0;
  --grad: linear-gradient(135deg, #8b7bff 0%, #c56cf0 50%, #ff6fb1 100%);
  --radius: 20px;
  --nav-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }

/* ---------- Uzay arka planı ---------- */
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.nebula-bg { position: fixed; inset: -20%; z-index: 0; pointer-events: none; filter: blur(60px); opacity: .55; }
.nebula-bg::before, .nebula-bg::after, .nebula-bg span {
  content: ''; position: absolute; border-radius: 50%;
}
.nebula-bg::before { width: 55vmax; height: 55vmax; left: -5%; top: 5%; background: radial-gradient(circle, rgba(123, 92, 255, .55), transparent 65%); animation: drift 26s ease-in-out infinite alternate; }
.nebula-bg::after { width: 50vmax; height: 50vmax; right: -10%; top: 30%; background: radial-gradient(circle, rgba(255, 95, 162, .38), transparent 65%); animation: drift 32s ease-in-out infinite alternate-reverse; }
.nebula-bg span { width: 40vmax; height: 40vmax; left: 25%; bottom: -10%; background: radial-gradient(circle, rgba(45, 226, 230, .22), transparent 65%); animation: drift 38s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(6%, -5%) scale(1.08); } }

/* ---------- Yerleşim ---------- */
.app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; min-height: 100%; padding: calc(var(--safe-t) + 8px) 16px calc(var(--nav-h) + var(--safe-b) + 24px); }
.hidden { display: none !important; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 2px 14px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { width: 30px; height: 30px; }
.brand-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 24px; letter-spacing: -.5px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: -3px; }
.top-actions { display: flex; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.icon-btn:active { transform: scale(.95); }
.icon-btn svg { width: 20px; height: 20px; }
.spin svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.num { font-family: 'Space Grotesk', sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Kahraman: yolculuk ---------- */
.hero { padding: 14px 14px 16px; position: relative; overflow: hidden; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.hero-pct { font-size: 44px; font-weight: 700; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-label { font-size: 13px; color: var(--muted); }
.hero-amount { text-align: right; }
.hero-amount .big { font-size: 22px; font-weight: 600; }
.trajectory { width: 100%; height: auto; display: block; margin: 6px 0 2px; }
.traj-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 19px; font-weight: 600; margin-top: 2px; }
.stat .s { font-size: 12px; color: var(--dim); }

/* ---------- Aylık hedef kartı ---------- */
.month-head { display: flex; justify-content: space-between; align-items: baseline; }
.bar { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; margin: 10px 0 8px; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--grad); width: 0; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.bar.ok > i { background: linear-gradient(90deg, #3de0d8, #4ee0a0); }
.msg { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; font-size: 14px; margin-top: 10px; }
.msg.warn { background: rgba(255, 107, 125, .1); border: 1px solid rgba(255, 107, 125, .25); }
.msg.ok { background: rgba(78, 224, 160, .1); border: 1px solid rgba(78, 224, 160, .25); }
.msg.info { background: rgba(139, 123, 255, .1); border: 1px solid rgba(139, 123, 255, .25); }
.msg .ico { font-size: 18px; line-height: 1.2; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }

/* ---------- Butonlar & formlar ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 18px; border-radius: 15px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 8px 24px -8px rgba(197, 108, 240, .6); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }

.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.seg button { height: 40px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--panel-2); color: var(--text); }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; height: 50px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); padding: 0 14px; outline: none; }
textarea.input { height: auto; padding: 12px 14px; resize: none; }
.input:focus { border-color: rgba(139, 123, 255, .6); box-shadow: 0 0 0 3px rgba(139, 123, 255, .15); }
.input.amount { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 600; height: 60px; }
.amount-wrap { position: relative; }
.amount-wrap::after { content: '€'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 20px; font-family: 'Space Grotesk', sans-serif; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 12px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.chip.on { background: rgba(139, 123, 255, .18); border-color: rgba(139, 123, 255, .5); color: var(--text); }
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; }
.switch { width: 50px; height: 30px; border-radius: 99px; background: rgba(255, 255, 255, .12); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; width: 24px; height: 24px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .2s; }
.switch.on { background: var(--violet); }
.switch.on::after { transform: translateX(20px); }

/* ---------- Listeler ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .dot { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--panel-2); font-size: 17px; flex: none; }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .d { font-size: 12px; color: var(--muted); }
.item .amt { font-family: 'Space Grotesk', sans-serif; font-weight: 600; }
.item .amt.plus { color: var(--green); }
.item .del { width: 32px; height: 32px; border-radius: 10px; color: var(--dim); display: grid; place-items: center; }
.item .del:active { background: rgba(255, 107, 125, .15); color: var(--red); }
.empty { text-align: center; color: var(--muted); padding: 22px 8px; font-size: 14px; }

/* ---------- Yörünge (aylık) ---------- */
.month-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.month-row:last-child { border-bottom: 0; }
.month-row .top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.mbar { position: relative; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .06); margin-top: 8px; }
.mbar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--grad); }
.mbar > i.ok { background: linear-gradient(90deg, #3de0d8, #4ee0a0); }
.mbar > b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--gold); border-radius: 2px; }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 99px; font-weight: 600; }
.badge.ok { background: rgba(78, 224, 160, .15); color: var(--green); }
.badge.warn { background: rgba(255, 107, 125, .15); color: var(--red); }
.badge.run { background: rgba(139, 123, 255, .18); color: #b9afff; }
.cat-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.cat-row .mbar { margin: 0; }

/* ---------- 2036 sohbet ---------- */
.chat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffd7ef, #c56cf0 45%, #3b2a8a 100%); box-shadow: 0 0 0 2px rgba(255, 255, 255, .1), 0 0 30px rgba(197, 108, 240, .5); display: grid; place-items: center; font-family: 'Space Grotesk', sans-serif; font-weight: 700; flex: none; }
.chat-head .name { font-weight: 700; font-size: 17px; }
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.bubble { max-width: 86%; padding: 11px 14px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; font-size: 15px; }
.bubble.me { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 6px; }
.bubble.her { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.typing { color: var(--muted); }
.typing-dots span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 5; padding: 10px 16px; background: linear-gradient(to top, var(--bg) 60%, transparent); }
.composer-in { max-width: 488px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; max-height: 120px; min-height: 48px; border-radius: 16px; }
.send { width: 48px; height: 48px; border-radius: 16px; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; }
.send svg { width: 20px; height: 20px; }
.view-ai { padding-bottom: 80px; }

/* ---------- Alt menü ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding-bottom: var(--safe-b); background: rgba(8, 9, 22, .82); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.nav-in { max-width: 520px; margin: 0 auto; height: var(--nav-h); display: grid; grid-template-columns: repeat(4, 1fr); }
.nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--dim); font-size: 11px; font-weight: 600; }
.nav button svg { width: 24px; height: 24px; }
.nav button.on { color: var(--text); }
.nav button.on svg { filter: drop-shadow(0 0 8px rgba(197, 108, 240, .8)); color: #d9a8ff; }

/* ---------- Katmanlar: PIN, anket, ayarlar ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5, 6, 15, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; flex-direction: column; overflow-y: auto; }
.overlay-in { width: 100%; max-width: 440px; margin: auto; padding: calc(var(--safe-t) + 28px) 22px calc(var(--safe-b) + 28px); }
.center { text-align: center; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 26px 0 30px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots i.on { background: var(--grad); border-color: transparent; box-shadow: 0 0 12px rgba(197, 108, 240, .7); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px; justify-content: center; }
.keypad button { width: 76px; height: 76px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); font-size: 26px; font-family: 'Space Grotesk', sans-serif; }
.keypad button:active { background: var(--panel-2); }
.keypad button.blank { visibility: hidden; }

.survey-step { animation: rise .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.step-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 28px; }
.step-dots i { width: 22px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); }
.step-dots i.on { background: var(--grad); }
h1.title { font-family: 'Space Grotesk', sans-serif; font-size: 28px; line-height: 1.15; margin: 0 0 10px; letter-spacing: -.5px; }
.lead { color: var(--muted); margin: 0 0 24px; }
.planet-hero { width: 140px; height: 140px; margin: 0 auto 20px; display: block; }

.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; background: rgba(0, 0, 0, .55); }
.sheet-in { width: 100%; max-width: 520px; margin: 0 auto; max-height: 90vh; overflow-y: auto; background: #0d0f22; border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 10px 18px calc(var(--safe-b) + 20px); animation: up .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.grabber { width: 40px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .2); margin: 4px auto 14px; }
.sheet h2 { font-family: 'Space Grotesk', sans-serif; margin: 0 0 14px; font-size: 21px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); transform: translateX(-50%) translateY(20px); z-index: 60; background: #1a1d3a; border: 1px solid var(--line); padding: 12px 16px; border-radius: 14px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(255, 107, 125, .5); }

.foot { text-align: center; font-size: 12px; color: var(--dim); margin-top: 6px; }
.skeleton { opacity: .5; }
