/* AURA — web arayüzü (macOS uygulamasının koyu cam teması) */
@font-face { font-family: "Inter"; src: url("/assets/Inter.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0c0c18;
  --panel: rgba(14, 14, 30, 0.72);
  --panel-solid: #111122;
  --card: rgba(255, 255, 255, 0.07);
  --card-dark: rgba(255, 255, 255, 0.045);
  --s800: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.13);
  --divider: rgba(255, 255, 255, 0.07);
  --text: #e2e8f0;
  --muted: #d5dde8;
  --muted2: #e8edf4;
  --dim: #b4bfce;
  --faint: #7c8798;
  --red: #ef4444;
  --green: #22c55e;
  --orange: #f97316;
  --acc: #38bdf8;
  --acc2: #7dd3fc;
  --acc-soft: rgba(56, 189, 248, 0.16);
  --radius: 18px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; overscroll-behavior: none; }
body { font: 13px/1.4 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; opacity: .45; }
[hidden] { display: none !important; }
svg.i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.glass {
  background: var(--panel);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ---------- Harita ---------- */
#map { position: fixed; inset: 0; background: #05060c; z-index: 0; }
.leaflet-container { background: #05060c; font: inherit; }
.leaflet-control-attribution { background: rgba(10, 10, 20, .55) !important; color: #8b95a5 !important; font-size: 10px; border-radius: 6px 0 0 0; }
.leaflet-control-attribution a { color: #a5b0c0 !important; }
.leaflet-control-zoom { border: 0 !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-control-zoom a { background: var(--panel) !important; color: var(--text) !important; border-color: var(--divider) !important;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); width: 34px !important; height: 34px !important; line-height: 34px !important; }
.leaflet-bottom.leaflet-right { margin-bottom: var(--safe-b); }
.heat-img { image-rendering: auto; filter: blur(.6px); }
.spread-img { image-rendering: auto; filter: blur(1.4px); }
.drawn { stroke-dasharray: 6 5; transition: stroke-opacity .6s ease, fill-opacity .6s ease; }
.has-result .drawn { stroke-opacity: 0; fill-opacity: 0; }
.handle-icon { width: 18px !important; height: 18px !important; margin: -9px 0 0 -9px !important; border-radius: 50%;
  background: #fff; border: 3px solid var(--acc); box-shadow: 0 0 0 4px rgba(56,189,248,.25), 0 2px 8px rgba(0,0,0,.5); }

/* ---------- Üst çubuk ---------- */
#topbar {
  position: fixed; z-index: 1000; top: calc(8px + var(--safe-t)); left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r));
  height: 46px; border-radius: 16px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 10px;
}
.iconbtn { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--muted2); transition: background .15s; }
.iconbtn:hover { background: var(--s800); }
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { width: 28px; height: 28px; margin: 0 -3px; }
.brand b { font-weight: 700; letter-spacing: 2px; font-size: 15px; }
.web { font-weight: 500; letter-spacing: .5px; color: var(--acc); margin-left: -3px; font-size: 15px; }
.login h1 .web { font-size: 22px; letter-spacing: 1px; margin-left: 2px; }
.subtitle { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 6px var(--acc); transition: background .25s, box-shadow .25s; flex: none; }
.dot.busy { background: #facc15; box-shadow: 0 0 9px #facc15; animation: pulse 1.1s ease-in-out infinite; }
.dot.error { background: var(--red); box-shadow: 0 0 7px var(--red); }
@keyframes pulse { 50% { transform: scale(1.3); } }
.spacer { flex: 1; min-width: 4px; }
.search { position: relative; width: 260px; }
.search input { width: 100%; height: 32px; border-radius: 10px; border: 1px solid var(--border); background: var(--card-dark);
  padding: 0 10px 0 30px; outline: none; font-size: 12px; }
.search input:focus { border-color: var(--acc); background: var(--card); }
.search svg { position: absolute; left: 9px; top: 8px; color: var(--dim); }
#searchResults { position: absolute; top: 38px; left: 0; right: 0; border-radius: 12px; padding: 4px; max-height: 300px; overflow: auto; }
#searchResults button { display: block; width: 100%; text-align: left; padding: 7px 9px; border-radius: 8px; font-size: 12px; color: var(--muted2); }
#searchResults button:hover, #searchResults button:focus { background: var(--s800); outline: none; }
#searchResults small { display: block; color: var(--dim); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { height: 30px; padding: 0 12px; border-radius: 15px; background: var(--s800); color: var(--muted2); font-size: 11.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pill:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.menu { position: absolute; top: 40px; right: 0; border-radius: 12px; padding: 4px; min-width: 170px; z-index: 5; }
.menu button { display: flex; width: 100%; padding: 8px 10px; border-radius: 8px; font-size: 12px; text-align: left; }
.menu button:hover { background: var(--s800); }

/* ---------- Kenar çubuğu ---------- */
#sidebar {
  position: fixed; z-index: 900; top: calc(64px + var(--safe-t)); left: calc(12px + var(--safe-l)); bottom: calc(14px + var(--safe-b));
  width: 300px; border-radius: 20px; display: flex; flex-direction: column; overflow: hidden;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1), opacity .25s;
}
#sidebar.collapsed { transform: translateX(-330px); opacity: 0; pointer-events: none; }
.sheet-handle { display: none; }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: none; padding-bottom: 10px;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 18px), transparent); mask-image: linear-gradient(#000 calc(100% - 18px), transparent); }
.scroll::-webkit-scrollbar { display: none; }
.sec { padding: 11px 13px; border-bottom: 1px solid var(--divider); }
.sec.thin { padding: 9px 13px; }
.sec-h { font-size: 10px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.hint { font-size: 11px; color: var(--dim); margin: -2px 0 8px; }
.row { display: flex; gap: 6px; }
.row > * { flex: 1 1 0; min-width: 0; }
.row.dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.slider-row output { flex: none; }
.fl { font-size: 10.5px; color: var(--dim); margin: 4px 0 3px; display: block; }
.field { width: 100%; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-dark); padding: 0 8px;
  outline: none; font-size: 12.5px; transition: border-color .15s, background .15s; }
.field:focus { border-color: var(--acc); background: var(--card); }
input[type=date].field { padding: 0 8px; font-size: 12px; -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; }
input[type=date]::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type=date]::-webkit-calendar-picker-indicator { opacity: .6; }
#sidebar, .sec, .row, .row > * { min-width: 0; max-width: 100%; }
.tabs { position: relative; display: flex; gap: 2px; background: var(--card-dark); padding: 2px; border-radius: 999px; }
.tabs .ind { position: absolute; left: 2px; top: 2px; bottom: 2px; border-radius: 999px; background: var(--acc); box-shadow: 0 2px 10px rgba(56,189,248,.35); }
.tabs.ready .ind { transition: transform .38s cubic-bezier(.3,1.25,.4,1), width .38s cubic-bezier(.3,1.25,.4,1); }
.tabs button { position: relative; flex: 1; padding: 6px 0; border-radius: 999px; font-size: 11.5px; color: var(--muted2); transition: color .25s; }
.tabs button.on { color: #fff; font-weight: 600; }
.slider-row { display: flex; align-items: center; gap: 8px; }
.slider-row output { font-weight: 600; font-size: 12.5px; min-width: 52px; text-align: right; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--acc) var(--p, 50%), var(--s800) var(--p, 50%)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--s800); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--acc); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; margin-top: -6px;
  box-shadow: 0 1px 6px rgba(0,0,0,.5); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.5); }
.sub { font-size: 10.5px; color: var(--dim); margin-top: 5px; }
.switch { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; }
.switch span { font-size: 10px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); }
.switch.on span { color: var(--acc); }
.switch i { width: 30px; height: 18px; border-radius: 9px; background: var(--s800); position: relative; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on i { background: var(--acc); }
.switch.on i::after { transform: translateX(12px); }
.runwrap { padding: 9px 13px; }
#run { width: 100%; height: 40px; border-radius: 20px; background: var(--acc); color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 4px 18px rgba(56,189,248,.35); transition: background .15s, box-shadow .15s; }
#run:hover:not(:disabled) { background: #52c7fa; }
#run.stop { background: var(--s800); color: var(--red); border: 1px solid var(--red); box-shadow: none; }
#run.stop:hover { background: var(--red); color: #fff; }
#status { font-size: 11.5px; color: var(--muted); padding: 2px 13px 4px; min-height: 18px; }
#status.err { color: #fca5a5; }
.progress { padding: 9px 2px 0; }
.bar { height: 4px; border-radius: 3px; background: var(--card); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .6s ease-out;
  background: linear-gradient(90deg, var(--acc), var(--acc2), var(--acc)); background-size: 200% 100%; animation: flow 1.4s linear infinite; }
@keyframes flow { to { background-position: -200% 0; } }
.progress small { display: block; font-size: 10.5px; color: var(--dim); margin-top: 4px; }
#results { padding: 0 13px 6px; display: flex; flex-direction: column; gap: 6px; }
.risk { position: relative; padding: 8px 10px 9px 13px; background: var(--card); border-radius: 8px; overflow: hidden; }
.risk::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.risk .v { font-size: 19px; font-weight: 700; }
.risk .s { font-size: 11px; color: var(--muted); margin-top: 1px; }
.risk .b { height: 4px; border-radius: 3px; background: var(--bg); margin-top: 7px; overflow: hidden; }
.risk .b i { display: block; height: 100%; width: 0; background: var(--c); transition: width 1s cubic-bezier(.2,.9,.3,1); }
.risk.click { cursor: pointer; }
.risk.click:hover { background: rgba(255,255,255,.1); }
.days-h { font-size: 10px; color: var(--dim); margin: 2px 0 -2px; }
.day { display: flex; justify-content: space-between; align-items: center; padding: 4px 7px 4px 10px; background: var(--card-dark);
  border-radius: 0 4px 4px 0; border-left: 3px solid var(--c); font-size: 11.5px; color: var(--muted2); }
.day b { font-size: 13px; }
.explain { padding: 8px 10px; background: var(--card-dark); border-radius: 7px; font-size: 11.5px; color: var(--muted2); line-height: 1.5; }
.explain .txt { margin: 0; }
/* Metin yukarıdan aşağı akan bir maskeyle açılır */
.reveal { -webkit-mask-image: linear-gradient(#000 40%, transparent 60%); mask-image: linear-gradient(#000 40%, transparent 60%);
  -webkit-mask-size: 100% 250%; mask-size: 100% 250%; -webkit-mask-position: 0 100%; mask-position: 0 100%;
  animation: reveal 1.1s cubic-bezier(.3,.7,.3,1) forwards; }
@keyframes reveal { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
#results > .enter { animation: rise .55s cubic-bezier(.2,.9,.3,1) both; }
#results > .leaving { animation: leave .25s ease-in forwards; }
@keyframes leave { to { opacity: 0; transform: translateY(-4px); } }
#results .day { animation: rise .45s cubic-bezier(.2,.9,.3,1) both; animation-delay: calc(var(--i, 0) * 35ms + 120ms); }
#results .days { display: flex; flex-direction: column; gap: 3px; }
#results .note { margin-top: -2px; }
.click-wrap { cursor: pointer; }
.click-wrap .risk { transition: background .2s, transform .2s; }
.click-wrap:hover .risk { background: rgba(255,255,255,.1); }
.click-wrap:active .risk { transform: scale(.985); }
.tap-hint { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--acc2); padding: 6px 2px; }
.tap-hint svg { width: 18px; height: 18px; animation: tap 1.8s ease-in-out infinite; }
@keyframes tap { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(2px) scale(.92); } 55% { transform: translateY(0) scale(1); } }
#spreadPanel:not([hidden]) > * { animation: rise .5s cubic-bezier(.2,.9,.3,1) both; }
#spreadPanel > :nth-child(2) { animation-delay: 50ms; } #spreadPanel > :nth-child(3) { animation-delay: 100ms; }
#spreadPanel > :nth-child(4) { animation-delay: 150ms; } #spreadPanel > :nth-child(5) { animation-delay: 200ms; }
.spreadbtn:not([hidden]), #threshSec:not([hidden]) { animation: rise .45s cubic-bezier(.2,.9,.3,1) both; }
.ign-pulse { transform-box: fill-box; transform-origin: center; animation: ign 1.6s ease-out infinite; }
@keyframes ign { from { transform: scale(.35); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.lava-cv { filter: blur(5px); }
.heat-img, .spread-img { will-change: opacity; }
.progress { animation: fade .25s; }
.explain h6 { margin: 0 0 4px; font-size: 9.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); }
.explain .sk { height: 7px; border-radius: 3px; background: var(--s800); margin: 4px 0; animation: sk .9s ease-in-out infinite alternate; }
@keyframes sk { to { opacity: .4; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); filter: blur(5px); } }
.spreadbtn { margin: 9px 13px 6px; width: calc(100% - 26px); height: 32px; border-radius: 7px; border: 1px solid var(--acc); color: var(--acc);
  background: var(--s800); font-weight: 600; font-size: 13px; }
.spreadbtn:hover:not(:disabled) { background: var(--acc); color: #fff; }
#spreadPanel { padding: 0 13px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sc { padding: 9px 11px; background: rgba(255,255,255,.055); border: 1px solid var(--s800); border-radius: 7px; }
.sc.w { grid-column: 1 / -1; }
.sc h6 { margin: 0 0 4px; font-size: 9.5px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); }
.sc .v { font-size: 17px; font-weight: 700; color: var(--acc); }
.sc small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.sp-hint { grid-column: 1 / -1; font-size: 10px; color: #64748b; }

/* ---------- Çizim araçları / lejant ---------- */
#drawbar { position: fixed; z-index: 950; top: calc(64px + var(--safe-t)); left: calc(322px + var(--safe-l)); display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  transition: left .35s cubic-bezier(.2,.9,.3,1); }
body.sb-collapsed #drawbar { left: calc(12px + var(--safe-l)); }
.tool { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--text); }
.tool.on { background: var(--acc); color: #fff; border-color: transparent; }
.tool svg { width: 18px; height: 18px; }
.drawpills { display: flex; gap: 4px; flex-wrap: wrap; }
.drawpills button { height: 30px; padding: 0 11px; border-radius: 15px; font-size: 11.5px; font-weight: 600; color: #fff; }
#legend { position: fixed; z-index: 800; top: calc(64px + var(--safe-t)); right: calc(12px + var(--safe-r)); border-radius: 14px; padding: 10px 12px; pointer-events: none; }
#legend h6 { margin: 0 0 6px; font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 500; }
#legend div { display: flex; align-items: center; gap: 7px; font-size: 11px; color: #cbd5e1; margin-top: 3px; }
#legend i { width: 14px; height: 9px; border-radius: 2px; }
#toast { position: fixed; z-index: 3000; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%); padding: 9px 14px; border-radius: 12px;
  font-size: 12px; max-width: min(420px, calc(100vw - 32px)); text-align: center; animation: rise .3s; }

/* ---------- Ayarlar ---------- */
.overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(400px, 100%); border-radius: 20px; padding: 20px; max-height: calc(100dvh - 32px); overflow: auto; }
.modal h3 { margin: 0 0 16px; font-size: 15px; font-weight: 600; color: var(--acc); }
.mrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.mrow:last-of-type { border-bottom: 0; }
.mrow label { font-size: 12.5px; }
.mrow .field { width: auto; min-width: 150px; }
.mnote { font-size: 10.5px; color: var(--dim); margin: 4px 0 0; }
.mfoot { display: flex; gap: 8px; margin-top: 16px; }
.mfoot button { flex: 1; height: 36px; border-radius: 10px; font-weight: 600; }
.btn-ghost { background: var(--s800); }
.btn-ghost:hover { background: rgba(255,255,255,.14); }
.btn-danger { background: rgba(239,68,68,.14); color: #fca5a5; }
.btn-danger:hover { background: var(--red); color: #fff; }

/* ---------- Giriş ---------- */
.login-bg { position: fixed; inset: 0; background:
  radial-gradient(1200px 700px at 50% -10%, rgba(56,189,248,.16), transparent 60%),
  radial-gradient(900px 600px at 50% 120%, rgba(249,115,22,.14), transparent 60%), var(--bg); }
.login-bg::after { content: ""; position: absolute; inset: 0; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16zM28 64l28 16v32M28 64L0 80v32' fill='none' stroke='%23ffffff' stroke-opacity='.05'/%3E%3C/svg%3E");
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%); }
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; overflow: auto; }
.login form { width: min(360px, 100%); border-radius: 24px; padding: 30px 26px 24px; text-align: center; animation: rise .6s cubic-bezier(.2,.9,.3,1); }
.login img { width: 92px; height: 92px; margin: -8px 0 -6px; filter: drop-shadow(0 10px 26px rgba(56,189,248,.28)); }
.login h1 { margin: 14px 0 2px; font-size: 22px; letter-spacing: 4px; font-weight: 700; }
.login p { margin: 0 0 22px; font-size: 11.5px; color: var(--dim); }
.login .field { height: 42px; font-size: 14px; border-radius: 12px; padding: 0 14px; text-align: left; }
.login .remember { display: flex; align-items: center; gap: 9px; margin: 14px 2px 18px; font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none; }
.login .remember input { width: 17px; height: 17px; accent-color: var(--acc); margin: 0; }
.login button[type=submit] { width: 100%; height: 44px; border-radius: 22px; background: var(--acc); color: #fff; font-size: 14.5px; font-weight: 700;
  box-shadow: 0 6px 22px rgba(56,189,248,.35); }
.login button[type=submit]:hover:not(:disabled) { background: #52c7fa; }
.login .err { min-height: 18px; margin-top: 12px; font-size: 12px; color: #fca5a5; }
.login footer { margin-top: 14px; font-size: 10px; color: var(--faint); }
.login .guest { margin-top: 6px; }
.login .or { height: 1px; background: var(--divider); margin: 4px 0 16px; }
.login #guestBtn { width: 100%; height: 42px; border-radius: 21px; background: var(--s800); border: 1px solid var(--border); color: var(--text);
  font-size: 14px; font-weight: 600; transition: background .15s, border-color .15s; }
.login #guestBtn:hover:not(:disabled) { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); }
.login .guest small { display: block; margin-top: 8px; font-size: 11px; color: var(--dim); }
/* Kullanım göstergesi (üst çubuk) — Claude'daki gibi: dolan yüzde, mavi → turuncu → kırmızı */
.usage-wrap { position: relative; }
.quota { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 11px 0 9px; border-radius: 15px; background: var(--s800);
  font-size: 12px; color: var(--muted2); white-space: nowrap; transition: background .15s; }
.quota:hover, .quota[aria-expanded=true] { background: rgba(255,255,255,.14); }
.quota b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.quota .ring { width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--qc) calc(var(--q, 0) * 360deg), rgba(255,255,255,.14) 0);
  -webkit-mask: radial-gradient(circle, transparent 4.5px, #000 5px); mask: radial-gradient(circle, transparent 4.5px, #000 5px); }
:root { --qc-ok: #38bdf8; --qc-warn: #f59e0b; --qc-crit: #ef4444; }
.quota, .usage .meter { --qc: var(--qc-ok); }
.quota.warn, .usage .meter.warn { --qc: var(--qc-warn); }
.quota.crit, .usage .meter.crit { --qc: var(--qc-crit); }
.quota.crit b { color: #fca5a5; }
.quota.live .ring { animation: qpulse 1s ease-in-out infinite; }
@keyframes qpulse { 50% { opacity: .55; } }
.usage { position: absolute; top: 40px; right: 0; width: 340px; border-radius: 16px; padding: 14px 16px 12px; z-index: 6;
  background: #10101f !important;
  animation: pop .22s cubic-bezier(.2,.9,.3,1); transform-origin: top right; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.usage h4 { margin: 0 0 12px; font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.usage h4 span { font-size: 10.5px; font-weight: 600; color: var(--acc); background: var(--acc-soft); padding: 2px 8px; border-radius: 999px; }
.usage .meter { margin-bottom: 12px; }
.usage .meter .top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted2); }
.usage .meter .top b { color: var(--text); font-variant-numeric: tabular-nums; }
.usage .meter .bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); margin: 6px 0 4px; overflow: hidden; }
.usage .meter .bar i { display: block; height: 100%; border-radius: 3px; background: var(--qc); width: var(--w, 0); transition: width .6s cubic-bezier(.2,.9,.3,1), background .3s; }
.usage .meter small { font-size: 10.5px; color: var(--dim); }
.usage .load { font-size: 11px; color: var(--dim); padding: 2px 0 10px; display: flex; align-items: center; gap: 6px; }
.usage .load i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.usage .load.busy i { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.usage .sep { height: 1px; background: var(--divider); margin: 2px -16px 10px; }
.usage .st-h { display: flex; justify-content: space-between; font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
.usage .st-h span { text-transform: none; letter-spacing: 0; font-weight: 400; }
.usage dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; font-size: 11.5px; }
.usage dt { color: var(--muted); }
.usage dd { margin: 0; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.usage dd small { color: var(--dim); font-size: 10.5px; }
.usage .model { font-size: 10.5px; color: var(--faint); margin-top: 10px; line-height: 1.45; }
.quota.live b { font-variant-numeric: tabular-nums; }
.quota.live .ring { animation: qpulse 1s ease-in-out infinite; }
@keyframes qpulse { 50% { opacity: .55; } }
.pw { position: relative; }
.pw button { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border-radius: 8px; color: var(--dim); display: grid; place-items: center; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { -webkit-mask-image: none; mask-image: none; }
}

/* ---------- Telefon ---------- */
@media (max-width: 760px) {
  #topbar { left: calc(8px + var(--safe-l)); right: calc(8px + var(--safe-r)); top: calc(6px + var(--safe-t)); gap: 4px; padding: 0 4px 0 8px; }
  .subtitle, #sbToggle, .pill .lbl { display: none; }
  .quota { padding: 0 9px; }
  .usage { position: fixed; top: calc(58px + var(--safe-t)); left: calc(8px + var(--safe-l)); right: calc(8px + var(--safe-r)); width: auto;
    max-height: calc(100dvh - 80px); overflow: auto; transform-origin: top center; }
  .search { width: 34px; flex: none; transition: width .25s; }
  .search input { padding: 0 0 0 30px; color: transparent; cursor: pointer; }
  .search input::placeholder { color: transparent; }
  .search:focus-within { flex: 1; width: auto; }
  .search:focus-within input { color: inherit; padding-right: 10px; cursor: text; }
  .search:focus-within input::placeholder { color: var(--dim); }
  #topbar:has(.search:focus-within) .brand, #topbar:has(.search:focus-within) .spacer { display: none; }
  #sidebar { top: auto; left: calc(8px + var(--safe-l)); right: calc(8px + var(--safe-r)); bottom: calc(8px + var(--safe-b));
    width: auto; border-radius: 26px; height: var(--sheet-h, 190px); overflow: hidden;
    transition: height .42s cubic-bezier(.2,.9,.25,1); }
  #sidebar.dragging { transition: none; }
  #sidebar.collapsed { transform: none; opacity: 1; pointer-events: auto; }
  /* Tutamaç: geniş dokunma alanı (tam genişlik, 34 px), çubuk dokununca belirginleşir */
  .sheet-handle { display: flex; justify-content: center; align-items: center; height: 34px; flex: none; cursor: grab; touch-action: none;
    position: relative; z-index: 3; }
  .sheet-handle i { width: 46px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.32); transition: width .2s, background .2s; }
  .sheet-handle:active i, #sidebar.dragging .sheet-handle i { width: 58px; background: rgba(255,255,255,.6); }
  /* İçerik üstte ve altta yumuşakça kaybolur */
  .scroll { margin-top: -10px; padding-top: 10px; padding-bottom: 0;
    -webkit-mask-image: linear-gradient(transparent, #000 14px); mask-image: linear-gradient(transparent, #000 14px); }
  /* Çalıştır düğmesi altta sabit; arkasındaki içerik bulanıklaşarak kaybolur */
  .runwrap { position: sticky; bottom: 0; z-index: 2; padding: 26px 13px 12px; isolation: isolate; }
  /* İçerik düğmenin arkasından kayıyorsa (yapışık): arkası koyulaşır, yazılar üst üste binmez */
  .runwrap.stuck::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(rgba(19,19,36,0), rgba(19,19,36,.97) 18px, #131324 26px);
    border-radius: 0 0 26px 26px; }
  .runwrap::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    -webkit-mask-image: linear-gradient(transparent, #000 55%); mask-image: linear-gradient(transparent, #000 55%); }
  #drawbar, body.sb-collapsed #drawbar { left: auto; right: calc(8px + var(--safe-r)); top: calc(60px + var(--safe-t)); align-items: flex-end; }
  #legend { top: auto; right: auto; left: calc(8px + var(--safe-l)); bottom: calc(var(--sheet-h, 190px) + 38px + var(--safe-b)); padding: 7px 9px; transition: bottom .42s cubic-bezier(.2,.9,.25,1); }
  .leaflet-control-attribution { font-size: 8.5px; max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #legend h6 { display: none; }
  #legend div { font-size: 10px; margin-top: 2px; }
  #legend:has(+ #drawbar:not([hidden])) { }
  .leaflet-control-zoom { display: none; }
  .leaflet-bottom.leaflet-right { bottom: calc(var(--sheet-h, 190px) + 8px + var(--safe-b)); transition: bottom .42s cubic-bezier(.2,.9,.25,1); }
  #toast { bottom: calc(var(--sheet-h, 190px) + 20px + var(--safe-b)); }
  input, select, .field { font-size: 16px !important; } /* iOS: odakta yakınlaştırma yok */
  .field { height: 36px; }
  .tabs button { padding: 9px 0; font-size: 12.5px; }
  .tool { width: 46px; height: 46px; }
  .drawpills button { height: 38px; padding: 0 14px; font-size: 13px; }
  .leaflet-marker-icon.handle-icon { width: 26px !important; height: 26px !important; margin: -13px 0 0 -13px !important; }
  #spreadPanel input[type=range] { height: 32px; }
  input[type=range]::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -9px; }
}
