:root {
  --bg: #F3F2EC;
  --panel: #ffffff;
  --border: #cccccc;
  --txt: #202124;
  --muted: #4a4a4a;
  --brand: #1D3E2F;
  --shadow: 0 8px 24px rgba(0, 0, 0, .12);
  --topbar: 56px;
  --chip: #e7e9e5;
  --ls-footer: 30px;
}

html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

body.fa-report-mode {
  overflow: hidden;
  background: var(--bg);
}

body {
  opacity: 1;
  transition: opacity .25s ease-out;
}

#fa-reportShell {
  position: fixed;
  inset: 0;
  display: none;
  background: var(--bg);
  box-sizing: border-box;
  z-index: 5;
}

#fa-reportShell.visible {
  display: flex;
}

#fa-reportRow {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0; /* Boşluk kaldırıldı */
  padding: 0; /* Padding sıfırlandı ki rapor tam ekrana otursun */
  box-sizing: border-box;
  width: 100%;
  height: 100%;
}

#fa-reportLeft {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  width: 100%;
}

/* --- HEADER BÖLÜNMESİ (%20 YEŞİL / %80 BEYAZ) --- */

/* 1. Header'ın Ana Zemini */
#fa-top {
  flex: 0 0 var(--topbar);
  display: flex;
  align-items: stretch;
  background: #ffffff !important;
  border-bottom: 1px solid var(--border);
  padding: 0; 
  box-sizing: border-box;
}

/* 2. Sol %20 Alan (Logo ve Buton Burada) */

#fa-brand-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #203B57 !important; 
}

/* 3. Sponsor Alanı (%80 Beyaz Kısım) */
#fa-sponsor {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Banner'ı ortalar */
  padding: 0 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.fa-sponsor-banner {
  max-height: calc(var(--topbar) - 16px);
  width: auto;
  object-fit: contain;
  display: block;
}

/* --- HEADER İÇİ BUTONLAR (Beyaz Zemine Uyumlu Koyu İkonlar) --- */
#fa-brand {
  flex: 0 0 20%;
  max-width: 20%;
  display: flex;
  align-items: center;
  padding: 0 15px; /* Sol ve sağdan 15px boşluk bırakır */
  background: #ffffff !important;
  color: #203B57 !important;
  border-right: 1px solid #666666 !important; /* AÇIK GRİ YERİNE KOYU GRİ ÇİZGİ EKLENDİ */
  box-sizing: border-box;
}

/* 3. Tam Ekran Butonunu Barındıran Alan */
#fa-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto !important; /* İKONU YAZIDAN KOPARIP EN SAĞA (ÇİZGİYE DOĞRU) İTER */
  padding-right: 0 !important;
}

/* 4. Sağ %80 Alan (Banner Konteynırı) */
#fa-top-right {
  flex: 0 0 80% !important;
  max-width: 80% !important;
  display: flex !important;
  align-items: stretch !important; /* İçindeki görselin dikeyde uzamasını sağlar */
  padding: 0 !important;
  background: #ffffff;
  overflow: hidden;
  box-sizing: border-box;
}

/* Banner Görselinin Tam Kaplama Ayarı */
.fa-sponsor-banner {
  width: 100% !important;
  height: 100% !important; /* Yüksekliği konteynırın tamamına zorlar */
  min-height: 100% !important; /* Bazı tarayıcılarda boşluk kalmaması için garanti */
  object-fit: cover !important; /* Görseli bozmadan alanı kaplayacak şekilde kırpar */
  display: block !important;
}

.fa-select-wrap {
  display: block;
  position: relative;
  order: 3;
}

.fa-select {
  appearance: none;
  -webkit-appearance: none;
  height: 26px;
  border-radius: 9px;
  border: 1px solid var(--border);
  color: var(--txt);
  background: transparent;
  padding: 0 24px 0 8px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  line-height: 26px;
  min-width: 100px;
  width: auto;
}

.fa-select:focus {
  outline: 2px solid rgba(0, 0, 0, .2);
}

.fa-top-btn {
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #203B57; /* İkon rengi güncellendi */
  background: transparent;
  border: 1px solid #203B57; /* Yeni border eklendi ve rengi ayarlandı */
  border-radius: 4px; /* Border'ın daha şık durması için hafif kavis eklendi (isteğe bağlı) */
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  margin-bottom: 0;
}

.fa-top-btn::before {
  content: "⛶";
  font-size: 18px;
  line-height: 1;
}

.fa-top-btn:hover {
  background: rgba(0, 0, 0, .05);
}

/* Tooltip Ayarları */
.fa-top-btn::after {
  content: "Tam Ekran";
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .8);
  color: #ffffff;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}

.fa-top-btn:hover::after {
  opacity: 1;
}

/* Menü İkonu Çözünürlüğü */
#pageMenu.fa-select {
  width: 28px;
  min-width: 28px;
  padding: 0;
  border: none;
  color: transparent;
  background-image:
    radial-gradient(circle, var(--txt) 2px, transparent 2.2px),
    radial-gradient(circle, var(--txt) 2px, transparent 2.2px),
    radial-gradient(circle, var(--txt) 2px, transparent 2.2px);
  background-repeat: no-repeat;
  background-size: 4px 4px;
  background-position: center 8px, center 14px, center 20px;
}

#pageMenu.fa-select:hover {
  background-color: rgba(0, 0, 0, .05);
}

/* --- ANA RAPOR GÖRÜNÜMÜ --- */
#fa-reportMain {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  background: var(--bg);
}

#fa-reportMain iframe#fa-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
  z-index: 1;
}

#fa-lsMask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--ls-footer);
  background: var(--bg);
  z-index: 2;
  pointer-events: auto;
  display: none;
}

body.fa-report-mode #fa-lsMask,
body.fs #fa-lsMask,
body.pfs #fa-lsMask {
  display: block;
}

/* Tam Ekran (PFS) Ayarları */
body.pfs {
  overflow: hidden;
}

body.pfs #fa-top {
  display: none;
}

body.pfs #fa-reportRow {
  padding: 0;
}

body.pfs #fa-reportMain iframe#fa-frame {
  width: 100vw;
  height: 100vh;
}

#fa-fsExit {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 10000;
  display: none;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid #ffffff;
  color: #ffffff;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(4px);
}

body.fs #fa-fsExit {
  display: block;
}

/* --- RESPONSIVE TASARIM --- */
@media (min-width: 821px) {
  .fa-select-wrap {
    display: none !important;
  }

  #fa-actions {
    position: relative;
    height: var(--topbar);
  }

  #full.fa-top-btn {
    position: static !important;
    margin: 0;
  }

  #full.fa-top-btn::after {
    top: 50%;
    right: calc(100% + 12px);
    transform: translateY(-50%);
    background: rgba(32, 59, 87, 0.95); /* Tooltip arka planı #203B57 tonuna çekildi */
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
}

@media (max-width: 820px) {
  :root {
    --topbar: 48px;
  }

  #fa-reportRow {
    padding-right: 0;
    padding-left: 0;
  }

  #fa-brand {
    flex: 0 0 30%;
    max-width: 30%;
  }

  #fa-brand-title {
    font-size: 12px;
  }

  #fa-sponsor {
    padding: 0 10px;
  }

  .fa-sponsor-banner {
    max-height: calc(var(--topbar) - 24px);
  }

  #fa-actions {
    position: static !important;
    height: var(--topbar);
    padding-right: 10px;
  }

  .fa-select-wrap {
    position: absolute;
    top: 50% !important;
    right: 8px;
    transform: translateY(-50%);
  }

  #full.fa-top-btn {
    position: absolute;
    top: 50% !important;
    right: 36px;
    transform: translateY(-50%);
  }

  .fa-top-btn,
  #pageMenu.fa-select {
    width: 22px;
    height: 22px;
  }

  #pageMenu.fa-select {
    background-size: 14px 2px;
    background-position: center 6px, center 10px, center 14px;
  }

  #full.fa-top-btn::after {
    display: none !important;
  }
}