/* CarLog web demosu — iOS uygulamasının "Precision Cockpit" tasarım sistemi.
   Renkler/ölçüler CarLog/Utils/CockpitTheme.swift ve görünümlerin SwiftUI
   kaynağından alınmıştır. 1 CSS px = 1 iOS pt. */
:root {
  --canvas: #F4F6FB; --surface: #FFFFFF; --sunken: #F8FAFC;
  --primary: #0066FF; --toll: #FF9500; --savings: #10B981; --danger: #BA1A1A;
  --text: #0F172A; --text-2: #334155; --muted: #64748B;
  --border: #E2E8F0; --border35: rgba(226, 232, 240, .35); --border60: rgba(226, 232, 240, .6);
  --speed-0: #94A3B8; --speed-1: #0EA5E9; --speed-2: #0066FF; --speed-3: #6366F1; --speed-4: #A855F7;
  --glass: rgba(255, 255, 255, .78); --glass-line: rgba(0, 0, 0, .07);
  --sys-bg: #FFFFFF; --sys-label: #000; --sys-fill: rgba(118, 118, 128, .12);
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;
  --font-sg: "Space Grotesk", ui-rounded, -apple-system, system-ui, sans-serif;
  --sat: 62px; --sab: 34px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0B0F17; --surface: #151A23; --sunken: #1D2430;
    --primary: #3B8BFF; --toll: #FFA733; --savings: #34D399; --danger: #FF6B6B;
    --text: #E8ECF3; --text-2: #A8B3C4; --muted: #6F7C8F;
    --border: rgba(255, 255, 255, .08); --border35: rgba(255, 255, 255, .028); --border60: rgba(255, 255, 255, .048);
    --speed-0: #64748B; --speed-1: #38BDF8; --speed-2: #3B8BFF; --speed-3: #818CF8; --speed-4: #C084FC;
    --glass: rgba(30, 36, 48, .78); --glass-line: rgba(255, 255, 255, .1);
    --sys-bg: #000; --sys-label: #fff; --sys-fill: rgba(120, 120, 128, .32);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--canvas); color: var(--text); font-family: var(--font-body); font-size: 17px; line-height: 22px; -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }
input { font: inherit; color: inherit; }
svg.ic { display: inline-block; flex-shrink: 0; vertical-align: middle; }
[hidden] { display: none !important; }

/* ── Yazı ─────────────────────────────────────────────────────────────── */
.sg { font-family: var(--font-sg); font-weight: 500; }
.sgb { font-family: var(--font-sg); font-weight: 700; font-variant-numeric: tabular-nums; }
.lbl { font-family: var(--font-round); font-weight: 600; font-size: 11px; line-height: 13px; text-transform: uppercase; color: var(--muted); }
.k8 { letter-spacing: .8px; } .k6 { letter-spacing: .6px; } .k5 { letter-spacing: .5px; } .k4 { letter-spacing: .4px; }
.c2 { font-size: 11px; line-height: 13px; } .c1 { font-size: 12px; line-height: 16px; }
.fn { font-size: 13px; line-height: 18px; } .sub { font-size: 15px; line-height: 20px; }
.m { color: var(--muted); } .t2 { color: var(--text-2); } .tp { color: var(--text); }
.toll { color: var(--toll) !important; } .savings { color: var(--savings) !important; } .primary { color: var(--primary) !important; } .danger { color: var(--danger); }
.w5 { font-weight: 500; } .w6 { font-weight: 600; } .w7 { font-weight: 700; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mono { font-variant-numeric: tabular-nums; }
.cur { color: var(--primary); }

/* ── Kabuk ────────────────────────────────────────────────────────────── */
.app { position: relative; width: 100%; height: 100%; max-width: 440px; margin: 0 auto; background: var(--canvas); overflow: hidden; }
.status { position: absolute; z-index: 60; top: 0; left: 0; right: 0; height: var(--sat); display: flex; align-items: flex-start; justify-content: space-between; padding: 21px 34px 0 62px; pointer-events: none; font-weight: 600; font-size: 17px; line-height: 22px; color: var(--sys-label); }
.status .r { display: flex; gap: 7px; align-items: center; padding-top: 5px; }
.real-status .status { display: none; }
.real-status { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); }
@media (min-width: 700px) { body:not(.framed) { background: #dfe3ec; } body:not(.framed) .app { box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 30px 80px rgba(0, 0, 0, .18); } }

.navbar { position: absolute; z-index: 20; top: 0; left: 0; right: 0; height: calc(var(--sat) + 44px); padding-top: var(--sat); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: linear-gradient(var(--canvas) 55%, transparent); }
.navbar::before { content: ''; position: absolute; inset: 0; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); mask-image: linear-gradient(#000 60%, transparent); -webkit-mask-image: linear-gradient(#000 60%, transparent); pointer-events: none; }
.navbar > * { position: relative; }
.navbar h1 { font-size: 17px; line-height: 22px; font-weight: 600; text-align: center; color: var(--sys-label); }
.nav-l { justify-self: start; padding-left: 16px; display: flex; align-items: center; }
.nav-r { justify-self: end; padding-right: 20px; display: flex; align-items: center; }
.nav-menu { width: 44px; height: 44px; display: flex; align-items: center; justify-content: flex-start; color: var(--primary); }
.glass-btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; min-width: 44px; border-radius: 22px; background: var(--glass); color: var(--primary); box-shadow: 0 0 0 1px var(--glass-line), 0 6px 20px rgba(0, 0, 0, .08); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); }
.glass-btn.txt { padding: 0 20px; font-size: 17px; color: var(--sys-label); }
.glass-btn.txt.blue { color: var(--primary); }
.fab { width: 44px; height: 44px; border-radius: 22px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #0A84FF, #32ADE6); box-shadow: 0 0 0 4px var(--glass), 0 6px 18px rgba(10, 132, 255, .3); }

.scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; padding-top: calc(var(--sat) + 44px + 26px); padding-bottom: calc(var(--sab) + 130px); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.scroll::-webkit-scrollbar { display: none; }
.stack { display: flex; flex-direction: column; }
.gap24 { gap: 24px; } .gap12 { gap: 12px; }
.mx { margin-inline: 16px; }
.pad-h { padding-inline: 16px; }

/* ── Kart / kutu ──────────────────────────────────────────────────────── */
.card { position: relative; padding: var(--p, 16px); background: var(--surface); border-radius: 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, .04); }
.card::after, .frame::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--border); pointer-events: none; }
.card.sel::after { box-shadow: inset 0 0 0 2px var(--primary); }
.tile { padding: 12px; background: var(--sunken); border-radius: 12px; min-width: 0; }
.tile.p10 { padding: 10px; }
.div { height: 1px; background: var(--border); border: 0; }
.div.v { width: 1px; height: 30px; }
.split { display: flex; height: var(--h, 8px); border-radius: 999px; overflow: hidden; }
.split i { display: block; height: 100%; }
.split .f { background: var(--primary); } .split .t { background: var(--toll); }
.legend { display: flex; gap: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; line-height: 13px; font-weight: 500; color: var(--text-2); }
.legend span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.legend span.t::before { background: var(--toll); }
.dot7 { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }

.metric { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.metric .h { display: flex; align-items: center; gap: 4px; min-width: 0; }
/* Kaynakta minimumScaleFactor(0.75) var (etiket sığmazsa küçülür); web'de
   karşılığı yok, bu yüzden sert kesim yerine üç nokta ile bozulmadan biter. */
.metric .h .lbl { letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.metric .v { display: flex; align-items: baseline; gap: 3px; }
.metric .v b { font-family: var(--font-sg); font-weight: 700; font-size: 22px; line-height: 28px; font-variant-numeric: tabular-nums; }
.metric .v small { font-size: 12px; font-weight: 500; color: var(--muted); }
.row2 { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 10px; }

/* ── Kontroller ───────────────────────────────────────────────────────── */
.pills { display: flex; align-items: center; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 7px 15px; border-radius: 999px; background: var(--border35); color: var(--text-2); font-family: var(--font-sg); font-weight: 500; font-size: 13px; line-height: 16px; white-space: nowrap; }
.pill.on { background: var(--primary); color: #fff; }
.chips { display: flex; gap: 8px; padding-inline: 16px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .pill { padding: 8px 14px; flex-shrink: 0; }
.date-row { display: flex; align-items: center; gap: 8px; }
.arrow-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--border35); color: var(--text-2); flex-shrink: 0; }
.arrow-btn:disabled { color: rgba(100, 116, 139, .3); cursor: default; }
.date-row .mid { flex: 1; display: flex; justify-content: center; align-items: center; gap: 5px; font-family: var(--font-sg); font-weight: 500; font-size: 15px; line-height: 20px; }
.section-h { padding-left: 4px; font-family: var(--font-round); font-weight: 600; font-size: 11px; line-height: 13px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }

.seg { display: flex; height: 32px; padding: 2px; border-radius: 16px; background: var(--sys-fill); position: relative; }
.seg button { flex: 1; border-radius: 14px; font-size: 15px; line-height: 20px; font-weight: 500; color: var(--sys-label); text-align: center; }
.seg button.on { background: var(--sys-bg); box-shadow: 0 2px 6px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); font-weight: 600; }
.pseg { display: flex; border-radius: 14px; background: rgba(120, 120, 128, .06); overflow: hidden; }
.pseg button { flex: 1; padding: 10px 0; text-align: center; font-size: 15px; line-height: 20px; font-weight: 700; color: var(--text); }
.pseg button.on { background: #3B82F6; color: #fff; }
.toggle { width: 51px; height: 31px; border-radius: 16px; background: rgba(120, 120, 128, .16); position: relative; flex-shrink: 0; transition: background .2s; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .2s; }
.toggle.on { background: #34C759; }
.toggle.on::after { transform: translateX(20px); }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 0; border-radius: 12px; font-family: var(--font-sg); font-weight: 500; font-size: 16px; line-height: 22px; background: var(--primary); color: #fff; }
.btn.soft { background: rgba(0, 102, 255, .08); color: var(--primary); font-size: 15px; padding: 13px 0; }
.btn.line { background: var(--surface); color: var(--text); font-size: 13px; padding: 12px 0; position: relative; }
.btn.line::after { content: ''; position: absolute; inset: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--border); }
.btn.danger { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); font-size: 14px; min-height: 44px; padding: 0; position: relative; }
.btn.danger::after { content: ''; position: absolute; inset: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent); }

/* ── Sekme çubuğu ────────────────────────────────────────────────────── */
.tabbar { position: absolute; z-index: 30; left: 50%; bottom: calc(var(--sab) - 13px); transform: translateX(-50%); width: 281px; height: 62px; padding: 4px; display: flex; border-radius: 31px; background: var(--glass); box-shadow: 0 0 0 1px var(--glass-line), 0 8px 30px rgba(0, 0, 0, .12); backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6); }
.tabbar button { flex: 1; border-radius: 27px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; line-height: 14px; font-weight: 600; color: var(--sys-label); }
.tabbar button.on { color: var(--primary); background: rgba(120, 120, 128, .14); }

/* ── Sayfalar (sheet) ────────────────────────────────────────────────── */
.dim { position: absolute; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0); pointer-events: none; transition: background .3s ease; }
.dim.on { background: rgba(0, 0, 0, .2); pointer-events: auto; }
.sheet { position: absolute; z-index: 41; left: 0; right: 0; bottom: 0; top: var(--sat); border-radius: 40px 40px 0 0; background: var(--canvas); overflow: hidden; transform: translateY(105%); transition: transform .42s cubic-bezier(.2, .9, .25, 1); box-shadow: 0 -10px 40px rgba(0, 0, 0, .12); will-change: transform; }
.sheet.on { transform: none; }
.sheet .navbar { top: 0; padding-top: 20px; height: 64px; grid-template-columns: 1fr auto 1fr; background: linear-gradient(var(--canvas) 60%, transparent); }
.sheet .scroll { padding-top: 86px; padding-bottom: calc(var(--sab) + 24px); }
.sheet.stack2 { z-index: 43; }
.sheet .nav-l { padding-left: 20px; }
.sheet .navbar h1 { font-weight: 600; }
.sheet .grab { position: absolute; z-index: 25; top: 0; left: 0; right: 0; height: 20px; }

.menu-panel { position: absolute; z-index: 45; top: 0; bottom: 0; left: 0; width: 288px; background: var(--surface); transform: translateX(-102%); transition: transform .3s cubic-bezier(.3, .9, .3, 1); display: flex; flex-direction: column; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
.menu-panel.on { transform: none; }
.menu-head { padding: 60px 16px 12px; }
.menu-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 0 16px; }
.menu-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.pro-tag { font-family: var(--font-body); font-size: 9px; line-height: 11px; font-weight: 800; letter-spacing: .5px; padding: 2px 5px; border-radius: 4px; background: color-mix(in srgb, var(--savings) 15%, transparent); color: var(--savings); }

.toast { position: absolute; z-index: 70; left: 50%; bottom: calc(var(--sab) + 90px); transform: translate(-50%, 16px); max-width: 84%; padding: 11px 16px; border-radius: 14px; background: rgba(15, 23, 42, .94); color: #fff; font-size: 13px; line-height: 18px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ── Özet ────────────────────────────────────────────────────────────── */
.trip-card { --p: 16px; display: flex; flex-direction: column; gap: 12px; width: 100%; text-align: left; }
.trip-card .hd { display: flex; align-items: flex-start; gap: 10px; }
.trip-card .hd .name { flex: 1; font-family: var(--font-sg); font-weight: 500; font-size: 16px; line-height: 22px; }
.trip-card .hd .amt { display: flex; align-items: baseline; gap: 2px; flex-shrink: 0; }
.trip-card .hd .amt b { font-family: var(--font-sg); font-weight: 700; font-size: 20px; line-height: 26px; font-variant-numeric: tabular-nums; }
.trip-card .hd .amt i { font-style: normal; font-family: var(--font-sg); font-weight: 700; font-size: 13px; color: var(--primary); }
.cost-strip { display: flex; align-items: center; padding: 10px; background: var(--sunken); border-radius: 12px; }
.cost-strip .half { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.cost-strip .half b { font-family: var(--font-sg); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.cost-strip .sep { width: 1px; height: 22px; background: var(--border); }
.acc-row { display: flex; align-items: center; gap: 6px; font-size: 11px; line-height: 13px; font-weight: 600; color: var(--primary); }

.cmp-row { display: flex; align-items: center; gap: 11px; font-size: 15px; line-height: 20px; }
.cmp-row .ico { width: 20px; display: grid; place-items: center; }

/* ── Yolculuk özeti ──────────────────────────────────────────────────── */
.mcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mcol .h { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.mcol .h .lbl { font-size: 9px; line-height: 11px; letter-spacing: .5px; }
.mcol .v { display: flex; align-items: baseline; gap: 2px; }
.mcol .v b { font-family: var(--font-sg); font-weight: 700; font-size: 19px; line-height: 24px; font-variant-numeric: tabular-nums; }
.attr-tile { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 12px; background: var(--sunken); position: relative; flex: 1; min-width: 0; }
.attr-tile::after { content: ''; position: absolute; inset: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--border); }
.callout { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 14px; }
.map { position: relative; height: 200px; border-radius: 16px; overflow: hidden; background: #ECEFF3; }
.map svg { display: block; width: 100%; height: 100%; }
.map-chip { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 999px; background: rgba(255, 255, 255, .8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-size: 11px; font-weight: 600; color: #000; }

/* ── Grafikler ───────────────────────────────────────────────────────── */
.chart text { font-family: var(--font-body); font-size: 9px; fill: var(--muted); }
.chart .big text { font-size: 11px; }

/* ── Canlı sürüş ─────────────────────────────────────────────────────── */
.live-actions { position: absolute; left: 0; right: 0; bottom: 0; z-index: 25; padding: 10px 16px calc(var(--sab) + 76px); background: color-mix(in srgb, var(--canvas) 80%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 -.5px 0 var(--border); }
.live-actions .btn { padding: 14px 0; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--savings); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid rgba(100, 116, 139, .5); flex-shrink: 0; }
.radio.on { border: 5px solid var(--primary); }

/* ── Hesapla ─────────────────────────────────────────────────────────── */
.coll { position: relative; background: var(--surface); border-radius: 16px; margin-inline: 16px; }
.coll::after { content: ''; position: absolute; inset: 0; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--border); pointer-events: none; }
.coll > button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 16px; font-family: var(--font-sg); font-weight: 500; font-size: 15px; line-height: 20px; }
.coll > button svg { color: var(--muted); transition: transform .22s; }
.coll.open > button svg { transform: rotate(180deg); }
.grad { background: linear-gradient(135deg, #007AFF, #5AC8FA); color: #fff; }
.fuelseg { display: flex; gap: 3px; border-radius: 14px; overflow: hidden; }
.fuelseg button { flex: 1; height: 46px; display: grid; place-items: center; font-family: var(--font-round); font-weight: 800; font-size: 14px; background: rgba(0, 0, 0, .07); color: var(--muted); }
.fuelseg button.on { color: #fff; }
.route-opt { display: block; width: 100%; padding: 14px; text-align: left; background: var(--surface); border-radius: 16px; position: relative; }
.route-opt::after { content: ''; position: absolute; inset: 0; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--border); pointer-events: none; }
.route-opt.on::after { box-shadow: inset 0 0 0 2px var(--primary); }
.badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-family: var(--font-round); font-weight: 600; font-size: 10px; line-height: 12px; letter-spacing: .6px; text-transform: uppercase; }
.rcard { flex: 0 0 200px; padding: 20px; border-radius: 24px; background: var(--sys-bg); text-align: left; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05); transform: scale(.95); transition: transform .3s; }
.rcard.on { box-shadow: inset 0 0 0 3px #007AFF; transform: none; }
.tag { display: inline-block; padding: 2px 6px; border-radius: 999px; font-size: 10px; line-height: 12px; font-weight: 900; color: #fff; }
.rsheet { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 32px 32px 0 0; background: color-mix(in srgb, var(--canvas) 78%, transparent); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); padding-bottom: 24px; }

@media (prefers-reduced-motion: reduce) { .sheet, .dim, .menu-panel, .toast, .toggle::after { transition: none; } .rec-dot { animation: none; } }

/* Dar gömme (site içindeki telefon çerçevesi ~300-320px iç genişlik): kaynak
   uygulama burada minimumScaleFactor(0.75) ile etiketi küçültüyor; web'de
   karşılığı olmadığı için üç sütunlu metrik satırında boşluk/etiket boyutu
   sıkılaştırılır — "tam ekran aç" görünümünde (>360px) bu kural geçerli değil. */
@media (max-width: 336px) {
  .row2 { gap: 6px; }
  .tile { padding: 10px 8px; }
  .metric .h { gap: 3px; }
  .metric .h .lbl { font-size: 9.5px; }
  .metric .v b { font-size: 19px; }
}
