/* Demir Konut v12.3 – Yapay zekâ her yerde: Veri Asistanı, otonom içgörüler, Görev & Modeller, 7/24 İşçi, AI düğmesi */
:root { --ai-1: #7C3AED; --ai-2: #4F46E5; --ai-3: #06B6D4; --ai-grad: linear-gradient(135deg, #7C3AED 0%, #4F46E5 55%, #06B6D4 100%); --ai-soft: color-mix(in srgb, #7C3AED 9%, var(--surface)); }

/* ---------- ağ geçidi ekranı ekleri */
.aig-tag.think { background: rgba(118, 185, 0, .16); color: #3F7D0B; }
.aig-tag.pin { background: rgba(79, 70, 229, .14); color: #4338CA; }
[data-theme="dark"] .aig-tag.think { color: #A3E35C; }
[data-theme="dark"] .aig-tag.pin { color: #A5B4FC; }
.aig-pick { margin-top: 6px; justify-self: start; }
.btn-ai { background: var(--ai-grad); color: #fff; border: 0; box-shadow: 0 6px 18px -8px rgba(124, 58, 237, .6); }
.btn-ai:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ai svg { width: 15px; height: 15px; }

/* ---------- asistan: başlık */
.aix-hero { position: relative; overflow: hidden; border: 1px solid color-mix(in srgb, var(--ai-1) 22%, var(--line));
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--ai-3) 14%, transparent) 0%, transparent 55%),
              radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--ai-1) 16%, transparent) 0%, transparent 60%), var(--surface); }
.aix-hero-row { display: flex; align-items: center; gap: 12px; }
.aix-hero-row .grow { flex: 1; min-width: 0; }
.aix-title { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.aix-orb { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #94A3B8, #64748B); }
.aix-orb.live { background: var(--ai-grad); box-shadow: 0 0 0 0 rgba(124, 58, 237, .45); animation: aixGlow 2.8s var(--ease) infinite; }
.aix-orb svg { width: 20px; height: 20px; }
@keyframes aixGlow { 0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, .45); } 70% { box-shadow: 0 0 0 12px rgba(124, 58, 237, 0); } 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); } }
.seg.seg-sm button { padding: 6px 12px; font-size: 13px; }

/* ---------- asistan: sohbet */
.aix-chat { margin-top: 14px; }
.aix-chat .bubble { animation: aixIn .28s var(--ease-out) both; }
@keyframes aixIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bubble.aix-ai { border: 1px solid color-mix(in srgb, var(--ai-1) 28%, var(--line)); background: linear-gradient(180deg, var(--ai-soft), var(--surface) 70%); max-width: 96%; }
.aix-tag { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; color: var(--ai-1); margin-bottom: 6px; }
[data-theme="dark"] .aix-tag { color: #C4B5FD; }
.aix-tag svg { width: 13px; height: 13px; }
.aix-model { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--muted); letter-spacing: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aix-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.aix-md p { margin: 0 0 6px; } .aix-md p:last-child { margin-bottom: 0; }
.aix-md b { font-weight: 750; }
.aix-md code { font-size: .92em; }
.aix-ul { margin: 4px 0 6px; padding-left: 18px; display: grid; gap: 3px; }
.aix-ul li::marker { color: var(--ai-1); }
.aix-h { font-weight: 750; margin: 6px 0 4px; }
.aix-local { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 6px; }
.aix-local summary { cursor: pointer; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.aix-sugg .chip, .chip.chip-ai { border-color: color-mix(in srgb, var(--ai-1) 35%, var(--line)); color: color-mix(in srgb, var(--ai-1) 80%, var(--ink)); background: color-mix(in srgb, var(--ai-1) 6%, var(--surface)); }
[data-theme="dark"] .aix-sugg .chip, [data-theme="dark"] .chip.chip-ai { color: #DDD6FE; }
.aix-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ai-1); }
.aix-sub svg { width: 13px; height: 13px; }
.aix-typing { align-items: center; }
.aix-typing em { font-style: normal; font-size: 12.5px; color: var(--muted); margin-left: 8px; }
.aix-typing span { background: var(--ai-1) !important; }

/* ---------- içgörüler */
.aix-sec { display: flex; align-items: center; gap: 6px; font-size: 15px; margin: 0; }
.aix-sec svg { width: 15px; height: 15px; color: var(--ai-1); }
.aix-ins-grid { display: grid; gap: 10px; margin-top: 10px; }
@media (min-width: 900px) { .aix-ins-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.aix-ins { position: relative; padding: 12px 14px 10px 16px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); transition: opacity .25s, transform .25s; overflow: hidden; }
.aix-ins::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--ai-grad); }
.aix-ins.lvl-warn::before { background: linear-gradient(180deg, #F59E0B, #D97706); }
.aix-ins.lvl-crit::before { background: linear-gradient(180deg, #EF4444, #B91C1C); }
.aix-ins.brief { margin-top: 10px; border-color: color-mix(in srgb, var(--ai-1) 26%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--ai-1) 10%, var(--surface)), var(--surface) 65%); }
.aix-ins.unseen header b::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ai-1); margin-left: 6px; vertical-align: 2px; }
.aix-ins.gone { opacity: 0; transform: translateX(16px); }
.aix-ins header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.aix-ins header b { flex: 1; min-width: 0; font-size: 14px; }
.aix-ins footer { margin-top: 8px; }
.aix-ins .list .li { padding-left: 0; padding-right: 0; }
.aix-wk-off { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.aix-wk-off svg { width: 16px; height: 16px; color: var(--ai-1); flex: none; }

/* ---------- görev & modeller */
.aix-route .aix-ric, .aix-tic { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--ai-soft); color: var(--ai-1); font-size: 17px; }
.aix-route .aix-ric svg { width: 16px; height: 16px; }
.aix-mbtn { width: 100%; justify-content: flex-start; gap: 8px; text-align: left; overflow: hidden; }
.aix-mbtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aix-mid { display: block; margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; background: none; padding: 0; }

/* ---------- 7/24 işçi */
.aix-pulse { flex: none; width: 14px; height: 14px; border-radius: 50%; background: #94A3B8; margin: 0 6px; position: relative; }
.aix-pulse.green { background: #22A06B; } .aix-pulse.amber { background: #E8A33D; } .aix-pulse.red { background: #D64545; }
.aix-pulse.green::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid #22A06B; opacity: 0; animation: aixPing 2s ease-out infinite; }
@keyframes aixPing { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.4); opacity: 0; } }
.aix-wk-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 700px) { .aix-wk-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.aix-wk-kpis > div { padding: 9px 11px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; gap: 2px; min-width: 0; }
.aix-wk-kpis span { font-size: 11.5px; color: var(--muted); }
.aix-wk-kpis b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aix-tasks { display: grid; gap: 2px; }
.aix-task { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.aix-task:last-child { border-bottom: 0; }
.aix-task.off { opacity: .55; }
.aix-task .grow { flex: 1; min-width: 0; }
.aix-tname { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.aix-tact { display: grid; gap: 6px; justify-items: end; flex: none; }
.aix-wx { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.aix-code pre { margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; background: #0F172A; color: #E2E8F0; font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; }

/* ---------- her ekranda ATLAS Asistan düğmesi (Yeni Kayıt butonu ile çakışmaz) */
.aix-fab { position: fixed; z-index: 60; right: 14px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); height: 46px; padding: 0 16px 0 12px; border: 0; border-radius: 23px;
  display: inline-flex; align-items: center; gap: 7px; color: #fff; font: 800 13px/1 inherit; letter-spacing: 0.5px;
  background: linear-gradient(135deg, #4338CA 0%, #6366F1 50%, #06B6D4 100%); cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, .6), 0 2px 6px rgba(15, 23, 42, .2);
  transition: transform .2s var(--ease), box-shadow .2s; }
.aix-fab svg { width: 19px; height: 19px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.aix-fab:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 14px 30px -5px rgba(99, 102, 241, .75), 0 4px 10px rgba(15, 23, 42, .25); }
.aix-fab:active { transform: scale(.95); }
.aix-fab[hidden] { display: none !important; }

/* Masaüstü ve tablette (.fab-desktop 60px ve bottom: 28px) -> ATLAS'ı tam üstüne (104px) alıyoruz, asla çakışmaz */
@media (min-width: 768px) {
  .aix-fab { bottom: 104px !important; right: 28px !important; height: 48px; border-radius: 24px; padding: 0 18px 0 14px; }
}

/* ATLAS Bildirim Rozeti */
.aix-fab-badge { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: #EF4444; color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, .6); border: 2px solid #fff; animation: atlasBadgePulse 2s infinite; }
@keyframes atlasBadgePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ATLAS Proaktif Canlı Bildirim Kartı */
.atlas-banner { position: fixed; z-index: 59; right: 20px; bottom: 165px; max-width: 380px; width: calc(100vw - 40px);
  background: rgba(15, 23, 42, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(99, 102, 241, 0.4); border-radius: 16px; padding: 14px 16px; color: #F8FAFC;
  box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.25);
  animation: atlasSlideIn .35s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 767px) {
  .atlas-banner { right: 14px; left: 14px; width: auto; bottom: calc(var(--tabbar-h) + var(--safe-b) + 70px); }
}
@keyframes atlasSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.atlas-banner-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; color: #818CF8; }
.atlas-banner-body { font-size: 13px; line-height: 1.5; color: #E2E8F0; }
.atlas-banner-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.atlas-banner-actions button { font-size: 12px; padding: 5px 12px; border-radius: 8px; font-weight: 600; cursor: pointer; }

.kb-open .aix-fab, .noscroll .aix-fab, .kb-open .atlas-banner, .noscroll .atlas-banner { display: none !important; }
.aix-qf textarea { width: 100%; resize: vertical; min-height: 76px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; }
.aix-qf .btn-row { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) { .aix-orb.live, .aix-pulse.green::after, .aix-chat .bubble { animation: none !important; } }
body.perf-low-end .aix-orb.live, body.perf-low-end .aix-pulse.green::after { animation: none; }

/* ================================================================ NİHAİ ÇOKLU EKRAN & CİHAZ UYUMLULUK KATMANI */

/* 1. Sesli Komut & Mikrofon Canlı Animasyonu */
.icon-btn.rec, button.rec {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.16) !important;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6) !important;
  animation: dkMicPulse 1.4s ease-out infinite !important;
}
@keyframes dkMicPulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* 2. TV Modu & Klavye / Uzaktan Kumanda Erişilebilirliği (:focus-visible) */
:focus-visible {
  outline: 3px solid #3B82F6 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.35) !important;
}

/* 3. Yatay Telefon (Landscape Mobile / Tablet Küçük) */
@media (max-width: 900px) and (orientation: landscape) {
  :root { --topbar-h: 50px; --tabbar-h: 56px; }
  .topbar { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  #tabbar { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .view { padding: calc(var(--topbar-h) + 8px) max(14px, env(safe-area-inset-right)) calc(var(--tabbar-h) + var(--safe-b) + 12px) max(14px, env(safe-area-inset-left)) !important; }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .aix-hero { padding: 10px 14px; }
  .aix-hero .aix-orb { width: 36px; height: 36px; }
  .aix-hero-row { gap: 8px; }
  .aix-title { font-size: 16px; }
  .aix-chat { max-height: calc(100vh - 170px); overflow-y: auto; }
  .aix-sugg { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .aix-sugg .chip { flex-shrink: 0; font-size: 11.5px; padding: 4px 10px; }
  .aix-fab { bottom: calc(var(--tabbar-h) + 8px) !important; right: 10px !important; height: 38px; padding: 0 12px 0 10px; font-size: 12px; }
  .atlas-banner { bottom: calc(var(--tabbar-h) + 54px) !important; max-width: 480px; }
}

/* 4. Tabletler (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .view { padding: calc(var(--topbar-h) + 16px) 20px calc(var(--tabbar-h) + 20px) 20px !important; }
  .aix-chat { max-width: 900px; margin-left: auto; margin-right: auto; }
  .aix-hero { max-width: 900px; margin-left: auto; margin-right: auto; }
}

/* 5. Laptop & Standart Masaüstü (1025px - 1440px) */
@media (min-width: 1025px) {
  .view { max-width: 1400px; margin: 0 auto; width: 100%; }
}

/* 6. Ultra Geniş Monitörler & 2K / 4K / Televizyon (1441px+) */
@media (min-width: 1441px) {
  .view { max-width: 1720px; margin: 0 auto; width: 100%; }
  .kpi-grid { grid-template-columns: repeat(8, minmax(0, 1fr)) !important; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .card { padding: 18px 22px; }
}

/* 7. Akıllı TV / Büyük Ekran (4K / 1920px+ Büyük Ölçek) */
@media (min-width: 1921px) {
  html { font-size: 16.5px; }
  .topbar { height: 68px; }
  .view { max-width: 1960px; }
  .btn { min-height: 44px; font-size: 14px; }
}

/* 8. PWA Donanım İzin Kartları & Canlı Durum Stilleri */
.pwa-perm-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
}
.pwa-perm-info { display: flex; align-items: center; gap: 10px; }
.pwa-perm-ico { font-size: 22px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); }

/* 9. Eşzamanlı Çoklu Model Arenası & NVIDIA NIM 80+ Stilleri */
.arena-hero {
  border-radius: var(--radius-md);
  padding: 16px 20px;
  background: radial-gradient(130% 150% at 100% 0%, rgba(118, 185, 0, .14) 0%, transparent 55%),
              radial-gradient(130% 150% at 0% 0%, rgba(124, 58, 237, .12) 0%, transparent 60%), var(--surface);
  border: 1px solid color-mix(in srgb, var(--ai-1) 22%, var(--line));
  margin-bottom: 16px;
}
.arena-badge-nv {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(118, 185, 0, .15);
  color: #76B900;
  border: 1px solid rgba(118, 185, 0, .35);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.arena-add-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
  margin-top: 10px;
}
.arena-add-box select, .arena-add-box input {
  height: 38px;
  border-radius: var(--radius-sm);
}
.arena-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.arena-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.arena-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .15);
}
.arena-card.rank-1 {
  border-color: #F59E0B;
  box-shadow: 0 0 0 1px #F59E0B, 0 8px 20px -8px rgba(245, 158, 11, .35);
}
.arena-card.rank-1::before {
  content: '🥇 EN HIZLI';
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-bottom-left-radius: 8px;
  letter-spacing: .03em;
}
.arena-card.rank-2 {
  border-color: #94A3B8;
}
.arena-card.rank-2::before {
  content: '🥈 2. SIRA';
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #94A3B8, #64748B);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-bottom-left-radius: 8px;
}
.arena-card.rank-3 {
  border-color: #B45309;
}
.arena-card.rank-3::before {
  content: '🥉 3. SIRA';
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #B45309, #78350F);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-bottom-left-radius: 8px;
}
.arena-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.arena-card-body {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}
.arena-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}
.arena-lead-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}
.arena-lead-table th, .arena-lead-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.arena-lead-table th {
  background: var(--surface-2);
  font-weight: 700;
}
.arena-meter-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
  width: 100px;
}
.arena-meter-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s var(--ease);
}

