/* Wai Sense UI — design system (v3.2.0)
 * Tasarim ekranlarindan (sense_*.html) tek stil dosyasina birlestirildi.
 * Sayfa vurgu rengi: body[data-page] -> --accent. Temalar: html[data-theme]. */

:root {
  --bg-navy: #070b19;
  --card-navy: #0d1527;
  --card-hover: #131d35;
  --border-color: rgba(255, 255, 255, 0.08);
  --accent-indigo: #6366f1;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --text-main: #f8fafc;
  --text-muted: #64748b;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --accent: var(--accent-amber);
  --accent-rgb: 245, 158, 11;
  --on-accent: #000;
}
body[data-page="sos"] { --accent: var(--accent-rose); --accent-rgb: 244, 63, 94; --on-accent: #fff; }
body[data-page="wearables"] { --accent: var(--accent-cyan); --accent-rgb: 6, 182, 212; }
body[data-page="space"], body[data-page="report"] { --accent: var(--accent-indigo); --accent-rgb: 99, 102, 241; --on-accent: #fff; }

/* ---- Temalar (Settings ekranindaki cipler) ---- */
html[data-theme="midnight"] { --bg-navy: #02040a; --card-navy: #070b16; --card-hover: #0d1424; }
html[data-theme="pulse"]    { --bg-navy: #0b0720; --card-navy: #150d33; --card-hover: #1d1445; }
html[data-theme="ocean"]    { --bg-navy: #041a2b; --card-navy: #082c46; --card-hover: #0d3b5c; }
html[data-theme="forest"]   { --bg-navy: #061a12; --card-navy: #0b2a1e; --card-hover: #10382a; }
html[data-theme="sunset"]   { --bg-navy: #1a0b10; --card-navy: #2b1219; --card-hover: #3a1a22; }
html[data-theme="olive"]    { --bg-navy: #12140a; --card-navy: #1c2010; --card-hover: #262b16; }
html[data-theme="wht"], html[data-theme="apple"], html[data-theme="pearl"],
html[data-theme="sky"], html[data-theme="ice"], html[data-theme="sand"] {
  --text-muted: #5b6b82; --border-color: rgba(10, 22, 40, 0.12); --text-main: #0a1628;
}
html[data-theme="wht"]   { --bg-navy: #e8eef7; --card-navy: #ffffff; --card-hover: #f1f5fb; }
html[data-theme="apple"] { --bg-navy: #f2f2f7; --card-navy: #ffffff; --card-hover: #f7f7fa; --text-main: #111827; }
html[data-theme="pearl"] { --bg-navy: #f1f5f9; --card-navy: #ffffff; --card-hover: #f8fafc; --text-main: #0f172a; }
html[data-theme="sky"]   { --bg-navy: #e0f2fe; --card-navy: #f0f9ff; --card-hover: #e0f2fe; --text-main: #0c4a6e; --text-muted: #38607e; }
html[data-theme="ice"]   { --bg-navy: #eaf4f8; --card-navy: #f7fbfd; --card-hover: #e3f0f5; --text-main: #0b3a4a; --text-muted: #4a6b78; }
html[data-theme="sand"]  { --bg-navy: #f4ede0; --card-navy: #fbf7ef; --card-hover: #efe6d4; --text-main: #3b2f1e; --text-muted: #7a6a52; }

/* ---- Temel ---- */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body.sd {
  background-color: var(--bg-navy);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(var(--accent-rgb), 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
}
body.sd a { color: inherit; text-decoration: none; }
body.sd button { font-family: inherit; cursor: pointer; }
body.sd input, body.sd select, body.sd textarea { font-family: inherit; }
:root { --tabbar-h: 84px; }
.sd-frame { display: flex; flex-direction: column; align-items: center; padding: 12px 12px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom, 0px)); min-height: 100vh; }
.app-shell {
  width: 100%;
  max-width: 440px;
  align-self: flex-start;
  background: var(--card-navy);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  padding: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
@media (max-width: 480px) {
  .sd-frame { padding: 0 0 calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom, 0px)); }
  .app-shell { max-width: none; width: 100%; border-radius: 0; border-left: 0; border-right: 0; min-height: 100vh; box-shadow: none; }
}

/* ---- Baslik ---- */
.header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo {
  width: 34px; height: 34px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), 0.7));
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: var(--on-accent); font-weight: 800; font-size: 0.85rem;
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.3);
}
.brand-title { font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-subtitle { font-size: 0.65rem; color: var(--text-muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; }
.header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(var(--accent-rgb), 0.1); border: 1px solid rgba(var(--accent-rgb), 0.25);
  padding: 4px 10px; border-radius: 20px; font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent);
  white-space: nowrap; text-decoration: none;
}
.pill.ok { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.3); color: var(--accent-emerald); }
.pill.warn { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); color: var(--accent-amber); }
.pill.bad { background: rgba(244, 63, 94, 0.12); border-color: rgba(244, 63, 94, 0.3); color: var(--accent-rose); }
.pill.idle { background: rgba(255, 255, 255, 0.05); border-color: var(--border-color); color: var(--text-muted); }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: sdpulse 1.6s infinite; }
.pill.idle .pulse-dot { animation: none; }
@keyframes sdpulse { 0% { opacity: 1; } 50% { opacity: 0.35; } 100% { opacity: 1; } }
.pill-sos { background: rgba(244, 63, 94, 0.12); border-color: rgba(244, 63, 94, 0.35); color: var(--accent-rose); font-weight: 700; }

/* ---- Bilgi cubugu ---- */
.notice {
  font-size: 0.725rem; line-height: 1.4; display: flex; align-items: flex-start; gap: 10px;
  background: rgba(var(--accent-rgb), 0.06); border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 14px; padding: 10px 12px; color: var(--text-main);
}
.notice i, .notice svg { color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.notice.warn { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.25); }
.notice.warn svg { color: var(--accent-amber); }
.notice.bad { background: rgba(244, 63, 94, 0.08); border-color: rgba(244, 63, 94, 0.25); }
.notice.bad svg { color: var(--accent-rose); }

/* ---- Etiketler ---- */
.label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.label svg { width: 12px; height: 12px; }
.head { display: flex; flex-direction: column; gap: 2px; }
.head-title { font-size: 0.85rem; font-weight: 700; }
.head-sub { font-size: 0.68rem; color: var(--text-muted); line-height: 1.3; }
.src { font-size: 0.6rem; color: var(--text-muted); font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }
.link { color: var(--accent-cyan); cursor: pointer; font-size: 0.65rem; text-transform: none; letter-spacing: 0; }

/* ---- Kartlar ---- */
.card { background: var(--bg-navy); border: 1px solid var(--border-color); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card.tight { padding: 10px 12px; gap: 6px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-title { font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.card-title svg { width: 14px; height: 14px; }
.hero {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.14), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(var(--accent-rgb), 0.28); border-radius: 20px; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.hero-tag { font-size: 0.65rem; font-weight: 800; letter-spacing: 0.1em; color: var(--accent); }
.hero-title { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
.hero-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }

/* ---- Izgara ve metrikler ---- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.span2 { grid-column: span 2; }
.stat { background: var(--card-navy); border: 1px solid var(--border-color); border-radius: 12px; padding: 10px 8px; display: flex; flex-direction: column; gap: 3px; text-align: center; min-width: 0; }
.stat.left { text-align: left; padding: 12px; }
.stat .val { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 800; color: var(--text-main); overflow-wrap: anywhere; }
.stat .val small { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); }
.stat .lbl { font-size: 0.6rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.stat .head-row { display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); }
.stat .head-row svg { width: 12px; height: 12px; }
.tone-cyan { color: var(--accent-cyan) !important; }
.tone-amber { color: var(--accent-amber) !important; }
.tone-emerald { color: var(--accent-emerald) !important; }
.tone-rose { color: var(--accent-rose) !important; }
.tone-indigo { color: var(--accent-indigo) !important; }
.tone-muted { color: var(--text-muted) !important; }

.cond {
  font-size: 0.75rem; color: var(--accent-cyan); font-weight: 600; display: flex; align-items: center; gap: 8px;
  background: rgba(6, 182, 212, 0.08); border: 1px solid rgba(6, 182, 212, 0.16); padding: 8px 10px; border-radius: 10px;
}
.cond svg { width: 16px; height: 16px; }

.kv { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 0.75rem; background: var(--card-navy); border: 1px solid var(--border-color); border-radius: 10px; padding: 8px 10px; }
.kv .k { display: flex; align-items: center; gap: 6px; color: var(--text-main); }
.kv .k svg { width: 13px; height: 13px; }
.kv .v { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.05); color: var(--text-muted); text-align: right; }
.kv .v.ok { color: var(--accent-emerald); background: rgba(16, 185, 129, 0.1); }
.kv .v.warn { color: var(--accent-amber); background: rgba(245, 158, 11, 0.1); }
.kv .v.bad { color: var(--accent-rose); background: rgba(244, 63, 94, 0.1); }
.stack { display: flex; flex-direction: column; gap: 8px; }

.insight { display: flex; gap: 10px; align-items: flex-start; background: rgba(99, 102, 241, 0.08); border: 1px solid rgba(99, 102, 241, 0.2); border-radius: 14px; padding: 12px; }
.insight > svg { width: 16px; height: 16px; color: var(--accent-indigo); flex-shrink: 0; margin-top: 2px; }
.insight-title { font-size: 0.72rem; font-weight: 700; margin-bottom: 2px; }
.insight-text { font-size: 0.72rem; line-height: 1.45; color: var(--text-main); opacity: 0.9; }

/* ---- Duğmeler ---- */
.btn {
  border: 1px solid var(--border-color); background: rgba(255, 255, 255, 0.05); color: var(--text-main);
  border-radius: 12px; padding: 10px 12px; font-size: 0.75rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.2s ease; text-decoration: none; min-height: 40px;
}
.btn svg { width: 14px; height: 14px; }
.btn:hover { background: var(--card-hover); border-color: rgba(255, 255, 255, 0.2); }
.btn:disabled, .btn.disabled { opacity: 0.5; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.28); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.go { background: var(--accent-emerald); border-color: var(--accent-emerald); color: #04130d; box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25); }
.btn.stop { background: rgba(244, 63, 94, 0.12); border-color: rgba(244, 63, 94, 0.35); color: var(--accent-rose); }
.btn.pause { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); color: var(--accent-amber); }
.btn.danger { background: linear-gradient(135deg, var(--accent-rose), #be123c); border: 0; color: #fff; box-shadow: 0 6px 20px rgba(244, 63, 94, 0.35); }
.btn.block { width: 100%; }
.btn.tall { padding: 14px; font-size: 0.85rem; }
.btn.sm { min-height: 32px; padding: 6px 10px; font-size: 0.68rem; border-radius: 10px; }
.btn-sub { text-align: center; font-size: 0.65rem; color: var(--text-muted); cursor: pointer; text-decoration: underline; padding: 4px; }
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }

/* ---- Cipler ---- */
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  background: var(--bg-navy); border: 1px solid var(--border-color); border-radius: 20px; padding: 6px 12px;
  font-size: 0.68rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; transition: all 0.2s ease;
}
.chip svg { width: 12px; height: 12px; }
.chip.active, .chip:hover { background: rgba(var(--accent-rgb), 0.14); border-color: var(--accent); color: var(--text-main); }
.actsel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.actsel .chip { flex-direction: column; border-radius: 14px; padding: 10px 4px; gap: 4px; justify-content: center; font-size: 0.65rem; }
.actsel .chip svg { width: 16px; height: 16px; }
.actsel .chip[disabled] { opacity: 0.45; pointer-events: none; }
.badge { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); }
.badge.report { background: rgba(6, 182, 212, 0.14); color: var(--accent-cyan); }
.badge.activity { background: rgba(16, 185, 129, 0.14); color: var(--accent-emerald); }
.badge.ai { background: rgba(245, 158, 11, 0.14); color: var(--accent-amber); }

/* ---- Formlar ---- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 0.65rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.input, .select, .textarea {
  background: var(--card-navy); border: 1px solid var(--border-color); border-radius: 10px; padding: 9px 10px;
  color: var(--text-main); font-size: 0.78rem; outline: none; width: 100%; transition: border-color 0.2s ease; min-width: 0;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); opacity: 0.7; }
.textarea { resize: vertical; min-height: 60px; }
.input-row { display: flex; gap: 8px; align-items: stretch; }
.form-card { background: var(--bg-navy); border: 1px solid var(--border-color); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }

/* ---- Liste / kutuphane ---- */
.list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card-navy); border: 1px solid var(--border-color); border-radius: 12px; padding: 10px 12px; }
.item-title { font-size: 0.75rem; font-weight: 600; overflow-wrap: anywhere; }
.item-meta { font-size: 0.65rem; color: var(--text-muted); font-family: var(--font-mono); display: flex; gap: 6px; flex-wrap: wrap; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-muted); font-family: var(--font-mono); font-size: 0.72rem; text-align: center; padding: 14px 0; }
.empty svg { width: 24px; height: 24px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--card-navy); border: 1px solid var(--border-color); border-radius: 12px; padding: 8px 12px; }
.search input { background: transparent; border: 0; outline: 0; color: var(--text-main); font-size: 0.78rem; flex: 1; min-width: 0; }
.search svg { width: 14px; height: 14px; color: var(--text-muted); }

/* ---- Planlar ---- */
.plan { background: var(--bg-navy); border: 1px solid var(--border-color); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.plan.featured { border-color: var(--accent-amber); box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25), 0 8px 24px rgba(245, 158, 11, 0.1); }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.plan-name { font-size: 0.95rem; font-weight: 800; }
.plan-price { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 800; text-align: right; }
.plan-price small { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); }
.plan-sub { font-size: 0.62rem; color: var(--accent-amber); text-align: right; font-weight: 600; }
.plan-feat { display: flex; flex-direction: column; gap: 5px; font-size: 0.72rem; }
.plan-feat div { display: flex; align-items: flex-start; gap: 6px; }
.plan-feat svg { width: 13px; height: 13px; color: var(--accent-emerald); flex-shrink: 0; margin-top: 2px; }
.ribbon { position: absolute; top: -10px; right: 14px; background: var(--accent-amber); color: #000; font-size: 0.6rem; font-weight: 800; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- Profil ---- */
.avatar-hero { display: flex; align-items: center; gap: 14px; }
.avatar-frame { width: 76px; height: 76px; border-radius: 22px; overflow: hidden; background: var(--bg-navy); border: 2px dashed rgba(var(--accent-rgb), 0.5); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--accent); cursor: pointer; position: relative; flex-shrink: 0; font-size: 0.55rem; font-weight: 700; }
.avatar-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.avatar-frame svg { width: 20px; height: 20px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg .chip { flex: 1; justify-content: center; }

/* ---- Context sahnesi ---- */
.stage { background: var(--bg-navy); border: 1px solid var(--border-color); border-radius: 20px; height: 200px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.stage::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px); background-size: 24px 24px; }
.stage .badge-tl { position: absolute; top: 10px; left: 10px; z-index: 2; font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700; color: var(--accent-amber); background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.25); padding: 3px 8px; border-radius: 8px; display: flex; gap: 5px; align-items: center; }
.stage .badge-tl svg { width: 12px; height: 12px; }
.stage .badge-tr { position: absolute; top: 10px; right: 10px; z-index: 2; font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-muted); }
.scene { perspective: 600px; width: 80px; height: 80px; z-index: 1; }
.cube { width: 80px; height: 80px; position: relative; transform-style: preserve-3d; transition: transform 0.08s linear; }
.cube-face { position: absolute; width: 80px; height: 80px; border: 1px solid rgba(245, 158, 11, 0.6); background: rgba(245, 158, 11, 0.08); color: var(--accent-amber); font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.cube-face.f { transform: translateZ(40px); } .cube-face.b { transform: rotateY(180deg) translateZ(40px); }
.cube-face.r { transform: rotateY(90deg) translateZ(40px); } .cube-face.l { transform: rotateY(-90deg) translateZ(40px); }
.cube-face.t { transform: rotateX(90deg) translateZ(40px); } .cube-face.bt { transform: rotateX(-90deg) translateZ(40px); }
.state-banner { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--bg-navy); border: 1px solid var(--border-color); border-radius: 16px; padding: 12px 14px; }
.state-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em; }
.state-value { font-size: 0.85rem; font-weight: 700; display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.state-value svg { width: 16px; height: 16px; }

/* ---- Canli olcum ---- */
.live-card { background: var(--bg-navy); border: 1px solid var(--border-color); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.live-badge { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; color: var(--accent-amber); background: rgba(245, 158, 11, 0.12); }
.live-badge.active { color: var(--accent-emerald); background: rgba(16, 185, 129, 0.12); }
.live-badge.paused { color: var(--accent-amber); }
.foot { font-size: 0.68rem; color: var(--text-muted); text-align: center; line-height: 1.4; }
.foot svg { width: 12px; height: 12px; vertical-align: -2px; color: var(--accent-amber); }

/* ---- SOS ---- */
.sos-big { width: 100%; padding: 18px; font-size: 1rem; letter-spacing: 0.05em; border-radius: 16px; }
.log-entry { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.7rem; background: var(--card-navy); border: 1px solid var(--border-color); border-radius: 8px; padding: 8px 10px; }
.log-time { font-family: var(--font-mono); color: var(--accent-rose); font-weight: 600; }

/* ---- Alt sekme cubugu ---- */
.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(440px, 100%); z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  background: color-mix(in srgb, var(--card-navy) 92%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-color);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 481px) { .tabbar { bottom: 12px; border: 1px solid var(--border-color); border-radius: 22px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); } }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 14px; color: var(--text-muted); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.02em; }
.tab svg { width: 20px; height: 20px; }
.tab.active { color: var(--accent-amber); }
.tab.go { position: relative; top: -12px; }
.tab.go .go-btn { width: 52px; height: 52px; border-radius: 18px; background: linear-gradient(135deg, var(--accent-amber), #d97706); color: #000; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 22px rgba(245, 158, 11, 0.4); font-weight: 900; font-size: 0.85rem; }
.tab.go span.t { color: var(--text-muted); }
.tab.go.active span.t { color: var(--accent-amber); }

/* ---- AI ---- */
.ai-fab {
  position: fixed; bottom: 92px; right: max(14px, calc((100vw - 440px) / 2 + 14px)); z-index: 60;
  width: 46px; height: 46px; border-radius: 16px; border: 0; color: #000; font-weight: 900; font-size: 0.8rem;
  background: linear-gradient(135deg, var(--accent-amber), #d97706); box-shadow: 0 8px 22px rgba(245, 158, 11, 0.4);
}
@media (min-width: 481px) { .ai-fab { bottom: 104px; } }
.sheet-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 90; display: none; align-items: flex-end; justify-content: center; }
.sheet-back.open { display: flex; }
.sheet { width: min(440px, 100%); max-height: 88vh; overflow-y: auto; background: var(--card-navy); border: 1px solid var(--border-color); border-radius: 24px 24px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 481px) { .sheet-back { align-items: center; } .sheet { border-radius: 24px; } }
.agent-window { background: var(--bg-navy); border: 1px solid var(--border-color); border-radius: 18px; padding: 12px; min-height: 150px; max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.msg { border-radius: 12px; padding: 9px 12px; font-size: 0.75rem; line-height: 1.45; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.msg.user { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.25); align-self: flex-end; max-width: 88%; }
.msg.agent { background: var(--card-navy); border: 1px solid var(--border-color); align-self: flex-start; max-width: 92%; }
.msg-tag { font-family: var(--font-mono); font-size: 0.6rem; color: var(--accent-cyan); font-weight: 700; text-transform: uppercase; }
.inputbar { display: flex; gap: 8px; align-items: center; background: var(--bg-navy); border: 1px solid var(--border-color); border-radius: 16px; padding: 6px 6px 6px 12px; }
.inputbar input { background: transparent; border: 0; outline: 0; color: var(--text-main); font-size: 0.78rem; flex: 1; min-width: 0; }
.send { width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--accent-amber); color: #000; display: flex; align-items: center; justify-content: center; }
.send svg { width: 16px; height: 16px; }

/* ---- Toast / onay ---- */
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 120; max-width: min(400px, 92vw); background: var(--card-hover); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 14px; padding: 10px 14px; font-size: 0.75rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); transition: all 0.25s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { border-color: rgba(244, 63, 94, 0.5); }
.toast.ok { border-color: rgba(16, 185, 129, 0.5); }
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 130; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-back.open { display: flex; }
.modal { width: min(360px, 100%); background: var(--card-navy); border: 1px solid var(--border-color); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.modal h3 { font-size: 0.95rem; }
.modal p { font-size: 0.75rem; line-height: 1.45; color: var(--text-muted); }
.modal .row { display: flex; gap: 8px; }
.modal .row .btn { flex: 1; }

/* ---- Harita cercevesi ---- */
body[data-page="map"] .sd-frame { padding: 0; }
.map-shell { position: fixed; inset: 0 0 68px 0; }
@media (min-width: 481px) { .map-shell { inset: 0; } }
.map-shell iframe { width: 100%; height: 100%; border: 0; background: var(--bg-navy); }

/* ---- Modul izgarasi (Settings) ---- */
.module { background: var(--card-navy); border: 1px solid var(--border-color); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 3px; transition: all 0.2s ease; }
.module:hover { background: var(--card-hover); border-color: rgba(255, 255, 255, 0.2); }
.module-title { font-size: 0.75rem; font-weight: 700; }
.module-sub { font-size: 0.65rem; color: var(--text-muted); }
.legal { background: var(--bg-navy); border: 1px solid var(--border-color); border-radius: 10px; padding: 8px 4px; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.625rem; font-weight: 600; }
.legal svg { width: 14px; height: 14px; }
.legal:hover { color: var(--text-main); }

@media print { .tabbar, .ai-fab, .toast { display: none !important; } .app-shell { box-shadow: none; } }

/* v3.7.0 WAI Brain (copilot) */
.msg.brain{display:flex;flex-direction:column;gap:6px;max-width:100%}
.msg.brain .br-step{font-size:.72rem;line-height:1.35}
.msg.brain .br-step.ok{color:var(--text-main)}
.msg.brain .br-step.bad{color:var(--accent-rose,#f43f5e)}
.msg.brain .br-plan ol{margin:4px 0 0 18px;padding:0;font-size:.72rem}
.msg.brain .br-plan li.done{color:var(--accent-emerald,#10b981)}
.msg.brain .br-plan li.failed{color:var(--accent-rose,#f43f5e)}
.msg.brain .br-plan li.skipped{opacity:.55}
.msg.brain .br-confirm{border:1px solid rgba(245,158,11,.4);border-radius:10px;padding:8px;display:flex;flex-direction:column;gap:6px;font-size:.74rem}
.msg.brain .br-row{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.msg.brain .br-final{font-size:.8rem;line-height:1.45;color:var(--text-main)}
.msg.brain .br-warn{font-size:.72rem;color:var(--accent-amber,#f59e0b)}
.msg.brain .br-okn{font-size:.72rem;color:var(--accent-emerald,#10b981)}

/* ---------- v3.9.0 Faz 1: outdoor map, guidance, safety ---------- */
.out-map { height: 300px; border-radius: 16px; border: 1px solid var(--border-color); overflow: hidden; background: var(--bg-navy); position: relative; }
.out-map .leaflet-control-layers { background: var(--card-navy); color: var(--text-main); border: 1px solid var(--border-color); }
.out-map .leaflet-control-layers label { color: var(--text-main); }
.nav-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.nav-arrow { font-size: 44px; line-height: 1; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 16px; background: rgba(var(--accent-rgb), .14); color: var(--accent); }
.nav-dist { font-family: var(--font-mono); font-size: 26px; font-weight: 700; }
.nav-sub { color: var(--text-muted); font-size: 13px; }
.nav-card.off .nav-arrow { background: rgba(244, 63, 94, .16); color: var(--accent-rose); }
.cond-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cond-flag { font-size: 12px; padding: 3px 8px; border-radius: 999px; border: 1px solid currentColor; }
.cond-flag.warn { color: var(--accent-amber); } .cond-flag.danger { color: var(--accent-rose); } .cond-flag.ok { color: var(--accent-emerald); }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border-color); }
.opt-row:first-child { border-top: 0; }
.opt-row label { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.opt-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.opt-row select { max-width: 9rem; }
.share-link { font-family: var(--font-mono); font-size: 12px; word-break: break-all; color: var(--text-muted); }
.sense-alarm { position: fixed; inset: 0; z-index: 9999; background: rgba(120, 0, 20, .92); display: grid; place-items: center; padding: 24px; padding-top: calc(24px + env(safe-area-inset-top, 0px)); }
.sense-alarm-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; text-align: center; color: #fff; }
.sense-alarm-title { font-size: 26px; font-weight: 800; }
.sense-alarm-q { font-size: 16px; }
.sense-alarm-count { font-family: var(--font-mono); font-size: 64px; font-weight: 800; }
.btn.sos-mini { background: var(--accent-rose); color: #fff; border-color: transparent; }
.pack-bar { height: 6px; border-radius: 3px; background: var(--border-color); overflow: hidden; }
.pack-bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

[hidden] { display: none !important; }

/* v4.6.0 community */
.cm-card{border:1px solid var(--border-color);border-radius:16px;padding:12px;display:flex;flex-direction:column;gap:8px}
.cm-head{display:flex;gap:10px;align-items:center}
.cm-av{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;background:rgba(6,182,212,.18);color:var(--accent-cyan);text-decoration:none;flex:none}
.cm-name{font-weight:700;color:inherit;text-decoration:none}
.cm-sub{color:var(--text-muted);font-size:12px}
.cm-body{display:flex;flex-direction:column;gap:6px;color:inherit;text-decoration:none}
.cm-title{font-weight:700;font-size:16px}
.cm-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.cm-stats div{display:flex;flex-direction:column}
.cm-stats b{font-family:'JetBrains Mono',monospace;font-size:15px}
.cm-stats span{color:var(--text-muted);font-size:11px}
.cm-cover{display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;border-radius:12px;background:rgba(148,163,184,.08)}
.cm-mini{background:rgba(148,163,184,.06);border-radius:12px;max-height:130px}
.cm-actions{display:flex;gap:10px;align-items:center}
.cm-kudo,.cm-com{background:none;border:1px solid var(--border-color);border-radius:999px;padding:5px 12px;color:inherit;font:inherit;font-size:13px;cursor:pointer;text-decoration:none}
.cm-kudo.on{border-color:var(--accent-amber);background:rgba(245,158,11,.12)}
.cm-kudo:disabled{opacity:.55;cursor:default}
.cm-person{display:flex;gap:10px;align-items:center;justify-content:space-between;border:1px solid var(--border-color);border-radius:14px;padding:8px 10px}
.cm-person .cm-who{display:flex;gap:10px;align-items:center;min-width:0}
.cm-person .cm-who a{color:inherit;text-decoration:none;font-weight:600}
.cm-note{display:flex;gap:8px;font-size:14px;padding:8px 0;border-bottom:1px solid var(--border-color)}
.cm-note.unread{font-weight:600}
.cm-note .tm{color:var(--text-muted);font-size:12px;margin-left:auto;flex:none}
.cm-comment{display:flex;gap:10px;padding:8px 0;border-bottom:1px solid var(--border-color)}
.cm-comment .tx{font-size:14px;white-space:pre-wrap;word-break:break-word}
.cm-comment .mt{color:var(--text-muted);font-size:12px;display:flex;gap:10px}
.cm-comment .mt button{background:none;border:0;color:var(--text-muted);cursor:pointer;font:inherit;padding:0;text-decoration:underline}
@media (max-width:380px){.cm-stats{grid-template-columns:repeat(2,1fr)}}

/* v4.11.0 map colour key */
.sense-legend{background:rgba(15,23,42,.86);color:#e2e8f0;border-radius:10px;padding:8px 10px;font-size:12px;line-height:1.35;max-width:200px}
.sense-legend .sl-h{font-weight:700;margin:2px 0 4px}
.sense-legend .sl-h:not(:first-child){margin-top:8px}
.sense-legend .sl-i{display:flex;align-items:center;gap:6px}
.sense-legend .sl-i span{width:14px;height:10px;border-radius:2px;flex:none}
.sense-legend .sl-n{color:#94a3b8;margin-top:4px}
