/* Kurumsal erişim flaması: navbar SATIRININ içinde değil, barın alt kenarına
   yapışık, ismin (ya da giriş butonlarının) altında asılı bir bayrak.
   Sarmalayıcı (.kb-host) bar yüksekliğine gerilir; .kb-anchor position:absolute
   ile akışın dışına çıkar, bar yüksekliğini büyütmez.
   Hesap menüsü açılınca flama gizlenir; kart açılınca da flama kalkar.
   Ölçü/renk --kb-* ile değişir. */

.kb-host {
  position: relative;
  align-self: stretch;
  align-items: center;
  height: 100%;
}

/* Taşan flama, sonraki <main> tarafından örtülmesin.
   position'a dokunma: ana navbar sticky kalmalı; hub header zaten relative. */
header:has(.kb-anchor) {
  z-index: 50;
}

.kb-anchor {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 40;
  width: max-content;
  max-width: calc(100vw - 1.5rem);
}

.kb-flag {
  position: relative;
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: 11rem;
  min-height: 8.75rem;
  margin: 0;
  padding: 1rem 0.85rem 2rem;
  border: 0;
  background-color: #f6f6f5;
  background-image: linear-gradient(#e3e5e2, #e3e5e2);
  background-size: 100% 6px;
  background-repeat: no-repeat;
  color: #24302a;
  text-align: center;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% 80%, 50% 100%, 0 80%);
  filter: drop-shadow(2px 6px 8px rgba(1, 22, 50, 0.1));
  transition: background-color 0.15s ease;
}
.kb-flag:hover { background-color: #f0f1ef; }
.kb-flag:focus-visible { outline: 2px solid #011632; outline-offset: 3px; }
.kb-flag.hidden { display: none; }
.kb-flag--sabit,
.kb-flag--sabit:hover,
.kb-flag:disabled {
  opacity: 1;
  cursor: default;
  pointer-events: none;
  background-color: #f6f6f5;
}

.kb-flag__logo {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #e4e6e3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 5px;
}
.kb-flag__img { width: 100%; height: 100%; object-fit: contain; }
.kb-flag__fallback { width: 62%; height: 62%; color: #4d6b5c; }

.kb-flag__ad {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kb {
  --kb-width: 19rem;
  --kb-accent: #019c61;
  --kb-accent-dark: #017e4e;
  --kb-ink: #011632;
  --kb-muted: #5b6573;
  --kb-line: #e8edf2;
  --kb-paper: #fff;
  --kb-desc-max: 8rem;
  position: absolute;
  top: 0;
  right: 0;
  margin-top: 0;
  width: var(--kb-width);
  max-width: calc(100vw - 2rem);
  z-index: 60;
}

.kb__card {
  width: 100%;
  background: var(--kb-paper);
  border: 1px solid var(--kb-line);
  border-radius: 0 0 14px 14px;
  border-top: 0;
  box-shadow: 0 16px 36px -14px rgba(1, 22, 50, 0.3);
  padding: 0.9rem 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.35rem;
  position: relative;
}

.kb__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 3;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #6b7280;
  background: #f3f4f6;
  transition: background 0.15s ease, color 0.15s ease;
}
.kb__close:hover {
  background: #e5e7eb;
  color: var(--kb-ink);
}
.kb__close:focus-visible {
  outline: 2px solid var(--kb-accent);
  outline-offset: 2px;
}

.kb__brand {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  padding-right: 1.4rem;
}
.kb__brand-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}
.kb__logo {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: #f4faf7;
  border: 1px solid #e3eee8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
}
.kb__logo-img { width: 100%; height: 100%; object-fit: contain; }
.kb__logo-fallback { width: 62%; height: 62%; color: #019c61; }
.kb__brand .kb__title { padding-right: 0; }

.kb__title {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--kb-ink);
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-right: 1.5rem;
}

.kb__hint {
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--kb-muted);
  margin: 0;
}

.kb__status {
  display: inline-flex;
  align-items: center;
  margin: 0.1rem 0 0;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: #eef1f4;
  color: #4b5563;
}
.kb[data-durum="abone"] .kb__status {
  background: #e6f8f0;
  color: var(--kb-accent-dark);
}
.kb[data-durum="deneme"] .kb__status {
  background: #fff6e5;
  color: #b45309;
}
.kb[data-durum="aboneDegil"] .kb__status {
  background: #f3f4f6;
  color: #4b5563;
}

.kb__desc {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--kb-muted);
  margin: 0.15rem 0 0;
  max-height: var(--kb-desc-max);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.kb__desc strong {
  color: var(--kb-ink);
  font-weight: 700;
}

.kb__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  margin-top: 0.45rem;
}

.kb__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  height: 2.25rem;
  border-radius: 9999px;
  background: var(--kb-accent);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  transition: background 0.15s ease;
}
.kb__cta:hover { background: var(--kb-accent-dark); }
.kb__cta:focus-visible {
  outline: 2px solid var(--kb-ink);
  outline-offset: 2px;
}
.kb__cta svg { width: 0.85rem; height: 0.85rem; }

.kb__secondary {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--kb-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.kb__secondary:hover { color: var(--kb-accent); }

.kb__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.45rem;
}

.kb__check-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  font-size: 0.625rem;
  color: #9ca3af;
  text-align: left;
}
.kb__check-row:hover { color: var(--kb-muted); }
.kb__check {
  width: 0.75rem;
  height: 0.75rem;
  accent-color: var(--kb-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.kb__ip {
  font-size: 0.5625rem;
  font-style: italic;
  color: #9ca3af;
  white-space: nowrap;
}

.kb__footnote {
  font-size: 0.5625rem;
  line-height: 1.4;
  color: #9ca3af;
  margin: 0.35rem 0 0;
  padding-top: 0.4rem;
  border-top: 1px solid var(--kb-line);
  width: 100%;
}

@media (max-width: 380px) {
  .kb { --kb-width: calc(100vw - 1.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  .kb,
  .kb-flag,
  .kb__close,
  .kb__cta {
    transition: none;
  }
}
