/* ==========================================================================
   Acil Tıp FOAMed Portalı — FOAM Cortex Editorial Blue Design System
   Tipografi: Literata (Akademik Serif) + Inter (Klinik UI Sans)
   ========================================================================== */

:root,
html[data-theme="light"] {
  --em-bg: #ffffff;
  --em-surface: #ffffff;
  --em-surface-2: #f4f5f7;
  --em-surface-3: #eceef2;
  --em-border: #e5e7eb;
  --em-border-subtle: rgba(15, 23, 42, 0.07);
  --em-border-focus: #93c5fd;

  --em-text: #09090b;
  --em-text-muted: #52525b;
  --em-text-dim: #71717a;

  /* Modern Cobalt Blue Vurgu Paleti */
  --em-blue: #2563eb;
  --em-blue-dark: #1d4ed8;
  --em-blue-soft: #eff6ff;
  --em-blue-glow: rgba(37, 99, 235, 0.16);

  /* FOAM Cortex İç İçe Pastel Kabuk (Shell) Tonları */
  --fc-shell-blue: #eef2f6;
  --fc-shell-warm: #f6ede3;
  --fc-pill-black-bg: #09090b;
  --fc-pill-black-fg: #ffffff;
  --fc-filter-bg: #eceef2;
  --fc-filter-fg: #18181b;
  --fc-query-bg: #f4f4f6;
  --fc-tag-bg: #f4f4f5;
  --fc-tag-fg: #3f3f46;

  /* Klinik Yardımcı Vurgular */
  --em-cyan: #0284c7;
  --em-cyan-soft: #e0f2fe;
  --em-purple: #4f46e5;
  --em-purple-soft: #eef2ff;
  --em-green: #0d9488;
  --em-green-soft: #ccfbf1;
  --em-amber: #b45309;
  --em-amber-soft: #fef3c7;
  --em-red: #dc2626;
  --em-red-dark: #b91c1c;
  --em-red-soft: #fef2f2;

  --em-radius-sm: 8px;
  --em-radius: 16px;
  --em-radius-lg: 22px;
  --em-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --em-shadow: 0 12px 28px -22px rgba(15, 23, 42, 0.32);
  --em-shadow-lg: 0 24px 52px -28px rgba(30, 58, 138, 0.2);

  --fc-halo: radial-gradient(72% 64% at 100% 0%, rgba(147, 197, 253, 0.44) 0%, rgba(219, 234, 254, 0.26) 38%, rgba(255, 255, 255, 0) 74%);
  --em-bottom-bar-height: 60px;
}

[data-theme="dark"] {
  --em-bg: #090d16;
  --em-surface: #111827;
  --em-surface-2: #182234;
  --em-surface-3: #1e293b;
  --em-border: #243047;
  --em-border-subtle: rgba(255, 255, 255, 0.08);
  --em-border-focus: #3b82f6;

  --em-text: #f4f4f5;
  --em-text-muted: #a1a1aa;
  --em-text-dim: #71717a;

  --em-blue: #3b82f6;
  --em-blue-dark: #2563eb;
  --em-blue-soft: rgba(59, 130, 246, 0.16);

  --fc-shell-blue: #131c2e;
  --fc-shell-warm: #1d1917;
  --fc-pill-black-bg: #27272a;
  --fc-pill-black-fg: #fafafa;
  --fc-filter-bg: #1e293b;
  --fc-filter-fg: #e4e4e7;
  --fc-query-bg: #162032;
  --fc-tag-bg: #1e293b;
  --fc-tag-fg: #cbd5e1;

  --em-cyan-soft: rgba(2, 132, 199, 0.16);
  --em-purple-soft: rgba(79, 70, 229, 0.16);
  --em-green-soft: rgba(13, 148, 136, 0.16);
  --em-amber: #f59e0b;
  --em-amber-soft: rgba(245, 158, 11, 0.16);
  --em-red: #f87171;
  --em-red-soft: rgba(239, 68, 68, 0.16);

  --em-shadow: 0 14px 32px -18px rgba(0, 0, 0, 0.65);
  --em-shadow-lg: 0 24px 52px -24px rgba(0, 0, 0, 0.8);
  --fc-halo: radial-gradient(72% 64% at 100% 0%, rgba(37, 99, 235, 0.22) 0%, rgba(30, 58, 138, 0.12) 40%, rgba(9, 13, 22, 0) 74%);
}

/* Temel Sıfırlamalar */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  overflow-x: hidden;   /* eski tarayıcılar için */
  overflow-x: clip;     /* sticky üst alanı bozmaz */
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--em-bg);
  color: var(--em-text);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: calc(var(--em-bottom-bar-height) + 16px);
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 1024px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

/* Sağ Üst FOAM Cortex Yumuşak Buz Mavisi Radyal Halo */
.fc-ambient-halo {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 680px;
  background: var(--fc-halo);
  pointer-events: none;
  z-index: 0;
}

/* Dengeli Editoryal Konteyner (1240px) */
.fc-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

@media (max-width: 640px) {
  .fc-container {
    padding: 0 16px;
  }
}

/* ==========================================================================
   FOAM CORTEX TİPOGRAFİ SİSTEMİ (Literata Serif + Inter Sans)
   ========================================================================== */
.fc-serif,
.fc-hero-title,
.fc-page-title,
.fc-section-title,
.fc-card-title {
  font-family: 'Literata', Georgia, Cambria, "Times New Roman", serif;
  color: var(--em-text);
  font-optical-sizing: auto;
}

.fc-hero-title {
  font-size: clamp(1.85rem, 3vw, 2.45rem);
  font-weight: 400;
  letter-spacing: -0.026em;
  line-height: 1.12;
}

.fc-page-title {
  font-size: clamp(1.48rem, 2.2vw, 1.88rem);
  font-weight: 400;
  letter-spacing: -0.022em;
  line-height: 1.18;
}

.fc-section-title {
  font-size: 1.28rem;
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.25;
}

.fc-card-title {
  font-size: 1.08rem;
  font-weight: 500;
  letter-spacing: -0.014em;
  line-height: 1.32;
}

/* ==========================================================================
   ÜST HEADER & YATAY MODÜL FİLTRE ÇUBUĞU (SOL SIDEBAR YOK)
   ========================================================================== */
.fc-header-wrap {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--em-border-subtle);
}

[data-theme="dark"] .fc-header-wrap {
  background: rgba(9, 13, 22, 0.88);
}

.fc-topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Tipografik Marka Logosu + Yanıp Sönen Mavi İmleç */
.fc-brand {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-family: 'Inter', sans-serif;
  font-size: 1.16rem;
  letter-spacing: -0.03em;
  color: var(--em-text);
  white-space: nowrap;
}

.fc-brand-thin {
  font-weight: 400;
}

.fc-brand-bold {
  font-weight: 700;
}

.fc-brand-cursor {
  display: inline-block;
  width: 7px;
  height: 18px;
  background: var(--em-blue);
  margin-left: 4px;
  border-radius: 1.5px;
  animation: fcCursorBlink 1.15s steps(2, start) infinite;
}

@keyframes fcCursorBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.18; }
}

.fc-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 35px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--em-surface-2);
  border: 1px solid var(--em-border);
  color: var(--em-text-muted);
  font-size: 0.81rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.16s ease;
  min-width: 260px;
}

.fc-search-btn:hover {
  border-color: var(--em-blue);
  background: var(--em-surface);
  color: var(--em-text);
}

.fc-kbd {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  font-size: 0.69rem;
  font-weight: 600;
  color: var(--em-text-dim);
}

@media (max-width: 768px) {
  .fc-search-btn {
    min-width: auto;
    padding: 0 10px;
  }
  .fc-search-btn .fc-search-placeholder,
  .fc-search-btn .fc-kbd {
    display: none;
  }
}

/* Yatay Modül Navigasyon Şeridi */
.fc-module-strip {
  border-top: 1px solid var(--em-border-subtle);
  padding: 8px 0;
}

.fc-module-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.fc-module-nav::-webkit-scrollbar {
  display: none;
}

/* ==========================================================================
   FOAM CORTEX MİKRO-ROZETLER, FİLTRE BUTONLARI & ETİKETLER
   ========================================================================== */
.fc-pill-black,
.fc-pill-blue,
.fc-pill-outline,
.fc-pill-soft,
.fc-pill-red,
.fc-pill-green,
.fc-pill-amber {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  line-height: 1.3;
  white-space: nowrap;
}

.fc-pill-black {
  background: var(--fc-pill-black-bg);
  color: var(--fc-pill-black-fg);
}

.fc-pill-blue {
  background: var(--em-blue);
  color: #ffffff;
}

.fc-pill-outline {
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  color: var(--em-text-muted);
}

.fc-pill-soft {
  background: var(--em-blue-soft);
  color: var(--em-blue);
}

.fc-pill-red {
  background: var(--em-red-soft);
  color: var(--em-red);
}

.fc-pill-green {
  background: var(--em-green-soft);
  color: var(--em-green);
}

.fc-pill-amber {
  background: var(--em-amber-soft);
  color: var(--em-amber);
}

/* Kompakt Filtre / Modül Butonları (FOAM Cortex /examples Stili) */
.fc-filter-btn,
.bento-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  background: var(--fc-filter-bg);
  color: var(--fc-filter-fg);
  border: 1px solid transparent;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.fc-filter-btn:hover,
.bento-chip:hover {
  background: var(--em-surface-3);
  border-color: var(--em-border);
  color: var(--em-text);
}

.fc-filter-btn.active,
.bento-chip.active {
  background: var(--em-blue);
  color: #ffffff;
  border-color: var(--em-blue);
}

.fc-filter-btn.active i,
.bento-chip.active i {
  color: #ffffff !important;
}

/* #etiket Hapları */
.fc-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--fc-tag-bg);
  color: var(--fc-tag-fg);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.4;
}

/* ==========================================================================
   FOAM CORTEX KARTLAR, PASTEL KABUKLAR & KONSOL PENCERESİ
   ========================================================================== */
.fc-card,
.em-card,
.bento-card {
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: var(--em-shadow);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.fc-card:hover,
a.em-card:hover,
a.bento-card:hover {
  border-color: var(--em-border-focus);
  box-shadow: var(--em-shadow-lg);
  transform: translateY(-1px);
}

/* Gri Klinik Soru / Özet Kutusu */
.fc-query-box {
  background: var(--fc-query-bg);
  border: 1px solid var(--em-border-subtle);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 0.81rem;
  color: var(--em-text);
  line-height: 1.52;
}

/* İç İçe Pastel Kabuklar (Nested Clinical Shells) */
.fc-shell-blue {
  background: var(--fc-shell-blue);
  border: 1px solid var(--em-border-subtle);
  border-radius: 24px;
  padding: 10px;
}

.fc-shell-warm {
  background: var(--fc-shell-warm);
  border: 1px solid var(--em-border-subtle);
  border-radius: 24px;
  padding: 10px;
}

.fc-shell-inner {
  background: var(--em-surface);
  border: 1px solid var(--em-border-subtle);
  border-radius: 17px;
  padding: 18px 20px;
  box-shadow: 0 4px 16px -10px rgba(15, 23, 42, 0.12);
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Vitrin Penceresi (FOAM Cortex Browser/Console Showcase Frame) */
.fc-window-frame {
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  border-radius: 22px;
  box-shadow: var(--em-shadow-lg);
  overflow: hidden;
}

.fc-window-bar {
  padding: 10px 18px;
  background: var(--em-surface-2);
  border-bottom: 1px solid var(--em-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fc-window-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fc-window-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--em-border);
}

.fc-window-dots span:nth-child(1) { background: #fca5a5; }
.fc-window-dots span:nth-child(2) { background: #fcd34d; }
.fc-window-dots span:nth-child(3) { background: #93c5fd; }

/* Detay Sayfaları 2 Sütunlu FOAM Cortex Okuma Düzeni */
.fc-split-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.fc-sticky-index {
  position: sticky;
  top: 76px;
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--em-shadow);
}

@media (max-width: 960px) {
  .fc-split-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .fc-sticky-index {
    position: static;
  }
}

/* ==========================================================================
   GRID DÜZENLERİ & KULLANIŞLI YARDIMCI SINIFLAR
   ========================================================================== */
.fc-grid-3,
.em-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.fc-grid-2,
.em-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.fc-grid-4,
.em-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1024px) {
  .fc-grid-3, .em-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fc-grid-4, .em-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .fc-grid-3, .em-grid-3,
  .fc-grid-2, .em-grid-2,
  .fc-grid-4, .em-grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Geriye Dönük Uyumluluk: Rozet & Buton Sınıfları */
.em-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-blue, .badge-info { background: var(--em-blue-soft); color: var(--em-blue); }
.badge-red, .badge-danger { background: var(--em-red-soft); color: var(--em-red); }
.badge-green, .badge-success { background: var(--em-green-soft); color: var(--em-green); }
.badge-amber, .badge-warning { background: var(--em-amber-soft); color: var(--em-amber); }
.badge-purple { background: var(--em-purple-soft); color: var(--em-purple); }

.text-danger  { color: var(--em-red) !important; }
.text-primary { color: var(--em-blue) !important; }
.text-info    { color: var(--em-cyan) !important; }
.text-success { color: var(--em-green) !important; }
.text-warning { color: var(--em-amber) !important; }
.text-purple  { color: var(--em-purple) !important; }
.text-muted   { color: var(--em-text-muted) !important; }

.em-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.81rem;
  cursor: pointer;
  transition: all 0.16s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.em-btn-primary {
  background: var(--em-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--em-blue-glow);
}

.em-btn-primary:hover {
  background: var(--em-blue-dark);
  color: #ffffff;
}

.em-btn-dark {
  background: var(--fc-pill-black-bg);
  color: var(--fc-pill-black-fg);
}

.em-btn-dark:hover {
  opacity: 0.9;
  color: var(--fc-pill-black-fg);
}

.em-btn-secondary {
  background: var(--fc-filter-bg);
  color: var(--fc-filter-fg);
  border: 1px solid var(--em-border);
}

.em-btn-secondary:hover {
  background: var(--em-blue-soft);
  border-color: var(--em-blue);
  color: var(--em-blue);
}

.em-btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--em-surface-2);
  border: 1px solid var(--em-border);
  color: var(--em-text);
  cursor: pointer;
  transition: all 0.16s ease;
}

.em-btn-icon:hover {
  border-color: var(--em-blue);
  color: var(--em-blue);
}

/* Görsel / Trase Çerçevesi */
.bento-media-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--em-border);
  cursor: pointer;
  background: #090d16;
}

.bento-media-frame img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.22s ease;
}

.bento-media-frame:hover img {
  transform: scale(1.012);
}

.bento-media-zoom-badge {
  position: absolute;
  bottom: 9px;
  right: 9px;
  background: rgba(9, 9, 11, 0.84);
  backdrop-filter: blur(6px);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}

/* Hesaplayıcı Seçenek & Canlı Skor Kartı */
.calc-option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--em-border);
  background: var(--em-surface);
  border-radius: 10px;
  color: var(--em-text);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  font-family: inherit;
}

.calc-option-btn:hover {
  background: var(--em-surface-2);
  border-color: var(--em-blue);
}

.calc-option-btn.selected {
  background: var(--em-blue-soft);
  border-color: var(--em-blue);
  color: var(--em-blue);
  font-weight: 600;
}

.live-score-card {
  position: sticky;
  top: 112px;
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--em-shadow-lg);
  text-align: center;
}

.score-display {
  font-family: 'Literata', Georgia, serif;
  font-size: 2.75rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 12px 0 8px;
}

.score-success { color: var(--em-green); }
.score-warning { color: var(--em-amber); }
.score-danger  { color: var(--em-red); }
.score-blue, .score-info { color: var(--em-blue); }

/* Form Elemanları */
.em-form-group {
  margin-bottom: 14px;
}

.em-form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--em-text);
}

.em-form-control, .form-control, .form-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--em-border);
  background: var(--em-surface);
  color: var(--em-text);
  font-family: 'Inter', sans-serif;
  font-size: 0.86rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.em-form-control:focus, .form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--em-blue);
  box-shadow: 0 0 0 3px var(--em-blue-soft);
}

/* Command+K Arama Modalı */
.em-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.48);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 20px 20px;
}

.em-modal-backdrop.open {
  display: flex;
}

.em-search-box {
  width: 100%;
  max-width: 620px;
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(9, 9, 11, 0.24);
  overflow: hidden;
}

.em-search-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--em-border);
  gap: 10px;
}

.em-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.94rem;
  color: var(--em-text);
  font-family: 'Inter', sans-serif;
}

.em-search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.em-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--em-text);
  cursor: pointer;
  transition: background 0.14s ease;
}

.em-search-item:hover {
  background: var(--em-surface-2);
}

/* Sağdan Kayar Hızlı Önizleme Çekmecesi (Slide-Over Drawer) */
.em-slideover-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.42);
  backdrop-filter: blur(3px);
  z-index: 2400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.em-slideover-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.em-slideover-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 640px;
  background: var(--em-surface);
  border-left: 1px solid var(--em-border);
  box-shadow: -18px 0 48px rgba(9, 9, 11, 0.16);
  z-index: 2500;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.em-slideover-backdrop.open .em-slideover-panel {
  transform: translateX(0);
}

.em-slideover-header {
  padding: 16px 22px;
  background: var(--em-surface);
  border-bottom: 1px solid var(--em-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.em-slideover-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.em-slideover-footer {
  padding: 13px 22px;
  background: var(--em-surface-2);
  border-top: 1px solid var(--em-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Footer */
.fc-footer {
  margin-top: auto;
  padding: 28px 0 36px;
  border-top: 1px solid var(--em-border);
  color: var(--em-text-dim);
  font-size: 0.78rem;
}

/* Mobil Alt Gezinme Çubuğu */
.em-bottom-bar {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--em-bottom-bar-height);
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--em-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

[data-theme="dark"] .em-bottom-bar {
  background: rgba(17, 24, 39, 0.94);
}

@media (min-width: 1024px) {
  .em-bottom-bar {
    display: none;
  }
}

.em-bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--em-text-muted);
  gap: 2px;
  flex: 1;
  padding: 6px 0;
}

.em-bottom-item i {
  font-size: 1.1rem;
}

.em-bottom-item.active,
.em-bottom-item:hover {
  color: var(--em-blue);
}

/* Toast Bildirimi */
.em-toast {
  position: fixed;
  bottom: 74px;
  right: 24px;
  background: #09090b;
  color: #ffffff;
  border: 1px solid #27272a;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.81rem;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.em-toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media print {
  .fc-header-wrap, .em-bottom-bar, .fc-ambient-halo {
    display: none !important;
  }
}

/* Geniş ekranda modül şeridi alt satıra kırılır: hiçbir sekme ekran dışında kalmaz */
@media (min-width: 768px) {
  .fc-module-nav { flex-wrap: wrap; overflow-x: visible; row-gap: 6px; }
}

/* Ana sayfa hızlı erişim butonları: eşit genişlikte simetrik ızgara */
.fc-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  max-width: 580px;
}
.fc-quick-grid .fc-filter-btn {
  justify-content: center;
  min-width: 0;
  padding-left: 6px;
  padding-right: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@media (max-width: 560px) {
  .fc-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Ana sayfa EKG kartı: kriter kutusu kalan yüksekliği doldurur, taşan metin yumuşakça kesilir */
.fc-fill-box {
  flex: 1 1 0;
  min-height: 84px;
  overflow: hidden;
  white-space: pre-line;
  margin-bottom: 12px;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 34px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 34px), transparent);
}
/* Tek sütunda doldurulacak boşluk yoktur: kutu kendi yüksekliğini alır, uzun metin sınırlanır */
@media (max-width: 900px) {
  .fc-fill-box { flex: 0 0 auto; max-height: 230px; }
}

/* ==========================================================================
   MOBİL SIĞMA DÜZELTMELERİ
   ========================================================================== */
/* Izgara ve esnek kutu çocukları içeriklerinden dar olabilsin; uzun sözcükler satır sonunda kırılsın */
.fc-split-layout > *, .fc-grid-2 > *, .fc-grid-3 > *, .fc-grid-4 > *,
.em-grid-2 > *, .em-grid-3 > *, .em-grid-4 > *, .fc-showcase-grid > *, .fc-hero-grid > * {
  min-width: 0;
}
.fc-card, .fc-shell-inner, .fc-query-box, .fc-sticky-index {
  overflow-wrap: break-word;
}
@media (max-width: 480px) {
  /* Üst çubuk: etiketi gizle, yalnız simge kalsın; tema düğmesi ekrana sığsın */
  .d-none-mobile { display: none; }
}
@media (max-width: 680px) {
  .fc-card img, .fc-card video, .fc-shell-inner img { max-width: 100%; height: auto; }
  .fc-card table { display: block; max-width: 100%; overflow-x: auto; }
  .fc-card pre { white-space: pre-wrap; }
}
@media (max-width: 680px) {
  /* Uzun etiket ve düğmeler tek satırda kalıp taşmasın: gerektiğinde alt satıra kırılsın */
  main .fc-pill-outline, main .fc-pill-soft, main .fc-pill-blue, main .fc-pill-black,
  main .fc-pill-red, main .fc-pill-green, main .fc-pill-amber, main .fc-tag {
    max-width: 100%;
    white-space: normal;
    height: auto;
    line-height: 1.35;
    padding-top: 3px;
    padding-bottom: 3px;
  }
  main .fc-filter-btn, main .em-btn {
    max-width: 100%;
    white-space: normal;
    height: auto !important;
    min-height: 26px;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    line-height: 1.3;
    text-align: left;
  }
  .fc-quick-grid .fc-filter-btn { white-space: nowrap; text-align: center; }
  /* İki uca yaslanan satırlar dar ekranda sığmazsa alt satıra geçsin */
  main [style*="justify-content: space-between"] { flex-wrap: wrap; }
}
@media (max-width: 400px) {
  /* Çok dar telefonlar: kart iç boşluğu küçülür, kaydırıcılı satırlar kırılabilir */
  main .fc-card, main .fc-shell-inner { padding-left: 14px !important; padding-right: 14px !important; }
  main input[type="range"] { min-width: 0; flex: 1 1 70px; max-width: 100%; }
  main [style*="display: flex"][style*="align-items: center"] { flex-wrap: wrap; max-width: 100%; }
  main .fc-query-box { min-width: 0; }
}
.fc-card > *, .fc-shell-inner > * { min-width: 0; max-width: 100%; }
