/* Qubyt Core — Algoritma sayfa modülü
 * Bağımlı: css/main.css (token'lar, renk değişkenleri).
 * Yalnızca algoritma sayfalarında yüklenir. */

/* ───────────────────────────── Hero ──────────────────────────── */

.algo-hero {
  padding: clamp(2.5rem, 6vw, 4.25rem) 0 clamp(2rem, 5vw, 3rem);
}

.algo-hero__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin: 0 0 1.35rem;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.algo-hero__breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.algo-hero__breadcrumb a:hover {
  color: var(--accent-strong);
}

.algo-hero__breadcrumb li[aria-current="page"] {
  color: var(--text);
}

.algo-hero__breadcrumb li+li::before {
  content: "›";
  margin-right: 0.55rem;
  color: rgba(154, 163, 181, 0.6);
}

.algo-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.28);
  background: linear-gradient(120deg, rgba(167, 139, 250, 0.14), rgba(56, 189, 248, 0.08));
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.algo-hero__eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #c4b5fd, #8b5cf6 65%);
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.55);
}

.algo-hero__title {
  margin: 0 0 1rem;
  max-width: 22ch;
  font-size: clamp(2.05rem, 4.6vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.algo-hero__title-accent {
  background: linear-gradient(105deg, var(--accent-strong) 0%, #7dd3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.algo-hero__lead {
  margin: 0 0 1.65rem;
  max-width: 60ch;
  font-size: 1.06rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.algo-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.algo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.78rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(20, 22, 32, 0.7);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text);
}

.algo-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.7);
}

.algo-chip--qiskit .algo-chip__dot {
  background: #c084fc;
}

.algo-chip--cirq .algo-chip__dot {
  background: #38bdf8;
}

.algo-chip--pl .algo-chip__dot {
  background: #34d399;
}

.algo-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

/* ───────────────────────── İçindekiler ──────────────────────── */

.algo-toc {
  position: relative;
  margin: 0 0 clamp(2.25rem, 5vw, 3.5rem);
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid rgba(167, 139, 250, 0.16);
  background:
    linear-gradient(160deg, rgba(167, 139, 250, 0.08), transparent 55%),
    rgba(12, 14, 22, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 44px rgba(0, 0, 0, 0.32);
}

.algo-toc__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.algo-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
  counter-reset: algotoc;
}

@media (min-width: 720px) {
  .algo-toc__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1.25rem;
  }
}

.algo-toc__item a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  font-size: 0.92rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.algo-toc__item a::before {
  counter-increment: algotoc;
  content: counter(algotoc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-strong);
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 8px;
  padding: 0.18rem 0.42rem;
}

.algo-toc__item a:hover,
.algo-toc__item a.is-active {
  background: rgba(167, 139, 250, 0.07);
  border-color: rgba(167, 139, 250, 0.22);
}

/* ──────────────────── Numaralı bölüm başlığı ─────────────────── */

.algo-section {
  position: relative;
  padding: clamp(1.5rem, 3.5vw, 2.5rem) 0 clamp(1rem, 2.5vw, 1.5rem);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.algo-section+.algo-section {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: clamp(1rem, 3vw, 1.75rem);
}

.algo-section__head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.algo-section__badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-strong);
  background:
    radial-gradient(circle at 30% 25%, rgba(196, 181, 253, 0.18), transparent 65%),
    rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.32);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.06);
}

.algo-section__heading {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.algo-section__rule {
  height: 1px;
  margin: 0.25rem 0 1.25rem;
  background: linear-gradient(90deg,
      rgba(167, 139, 250, 0.4) 0%,
      rgba(56, 189, 248, 0.22) 35%,
      transparent 100%);
}

.algo-section__lead {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.78;
}

.algo-section__lead strong {
  color: var(--text);
  font-weight: 600;
}

.algo-section__lead em {
  color: var(--accent-strong);
  font-style: normal;
  font-weight: 500;
}

.algo-tri {
  position: relative;
  margin: 0 0 1rem;
  padding-left: 1.35rem;
  font-size: 1rem;
  line-height: 1.78;
  color: var(--text-muted);
}

.algo-tri::before {
  content: "▸";
  position: absolute;
  left: 0;
  top: 0.05rem;
  color: var(--accent);
  font-size: 0.85rem;
}

.algo-tri strong {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.003em;
}

/* Paragrafın "tema kelimesi": başlangıçtaki strong, mini başlık gibi davranır.
 * Renk ve hafif bir tracking ile öne çıkar; ek kutu/dolgu vermeden sade kalır.
 * Sondaki nokta kaldırıldığı için margin-right ile devam metniyle arasına
 * tipografik bir nefes payı veriyoruz. */
.algo-tri>strong:first-of-type {
  color: var(--accent-strong);
  margin-right: 0.35rem;
}

/* İçinde sadece kod parçası taşıyan tema-strong'larda (örn. <strong><span class="algo-token">qc.cx</span></strong>)
 * algo-token kendi paletini kullandığı için renk zaten korunur; burada sadece
 * üstüne ferah bir nefes payı bırakıyoruz. */
.algo-tri>strong:first-of-type:has(> .algo-token:only-child) {
  color: inherit;
}

.algo-tri em {
  color: var(--accent-strong);
  font-style: normal;
  font-weight: 500;
}

.algo-sub {
  margin: 1.4rem 0 0.55rem;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.algo-sub::before {
  content: "›";
  margin-right: 0.45rem;
  color: var(--accent-strong);
  font-weight: 600;
}

/* ─────────────────── Inline kod / kapı tokenları ──────────────── */

.algo-token {
  display: inline-flex;
  align-items: center;
  padding: 0.08em 0.45em;
  margin: 0 0.05em;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.86em;
  font-weight: 500;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.algo-token--gate {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.22);
}

.algo-token--ket {
  color: #ddd6fe;
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.28);
  font-style: italic;
}

/* ─────────────────────── Anahtar fikir kutusu ─────────────────── */

.algo-callout {
  position: relative;
  margin: 1.25rem 0;
  padding: 1rem 1.2rem 1.05rem 2.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(167, 139, 250, 0.22);
  background:
    linear-gradient(155deg, rgba(167, 139, 250, 0.1), transparent 55%),
    rgba(20, 22, 32, 0.6);
  font-size: 0.97rem;
  line-height: 1.7;
  color: var(--text);
}

.algo-callout::before {
  content: "✦";
  position: absolute;
  left: 1.05rem;
  top: 0.95rem;
  font-size: 1.1rem;
  color: var(--accent-strong);
}

.algo-callout strong {
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: -0.003em;
}

/* Run-in başlık ile devam metni arasında ferah bir nefes payı */
.algo-callout>strong:first-of-type,
.algo-warn>strong:first-of-type,
.algo-meali>strong:first-of-type,
.algo-note>strong:first-of-type {
  margin-right: 0.35rem;
}

/* ───────────────── Dört Bell durumu ızgara kartları ───────────── */

.algo-states {
  display: grid;
  gap: 0.85rem;
  margin: 0.6rem 0 0.6rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .algo-states {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

.algo-state {
  position: relative;
  padding: 1rem 1.2rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(167, 139, 250, 0.18);
  background:
    linear-gradient(165deg, rgba(167, 139, 250, 0.08), transparent 50%),
    rgba(15, 17, 26, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 36px rgba(0, 0, 0, 0.32);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.algo-state:hover {
  border-color: rgba(167, 139, 250, 0.4);
  transform: translateY(-2px);
}

.algo-state__name {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.algo-state__name::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.algo-state__formula {
  font-size: 1.15rem;
  margin: 0.2rem 0 0.35rem;
  color: var(--text);
}

.algo-state__formula .katex {
  font-size: 1.1em;
}

.algo-state__desc {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Alt blok (içindekiler için çapa; tam bölüm değil) */

.algo-subblock {
  margin-top: 0.15rem;
  padding-top: 1.25rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.algo-meali {
  margin: 0.45rem 0 0.65rem;
  padding: 0.65rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.88rem;
  line-height: 1.62;
  color: rgba(154, 163, 181, 0.98);
}

.algo-meali strong {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.003em;
}

.algo-meali .katex {
  font-size: 0.95em;
}

.algo-meali--block {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(167, 139, 250, 0.14);
  border-top: 1px solid rgba(167, 139, 250, 0.14);
  background: rgba(167, 139, 250, 0.04);
}

/* Kapı kapı durum evrimi */

.algo-evolution {
  margin: 1.15rem 0 0.25rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

.algo-evolution__step {
  margin: 0;
  padding: 0.85rem 1rem 0.95rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background:
    linear-gradient(165deg, rgba(167, 139, 250, 0.06), transparent 55%),
    rgba(18, 21, 30, 0.65);
}

.algo-evolution__label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.algo-evolution__step p {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.62;
  color: var(--text-muted);
}

.algo-evolution__math {
  margin: 0.45rem 0 0.35rem;
}

.algo-evolution__math .katex-display {
  margin: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: rgba(167, 139, 250, 0.05);
  border: 1px solid rgba(167, 139, 250, 0.1);
  font-size: 0.92em;
}

.algo-evolution__step strong {
  color: var(--text);
}

/* Deep Dive — ileri seviye not kutusu */

.algo-deepdive {
  position: relative;
  margin: 1.4rem 0 0.5rem;
  padding: 1.05rem 1.2rem 1.15rem 3.05rem;
  border-radius: var(--radius);
  border: 1px solid rgba(56, 189, 248, 0.28);
  background:
    linear-gradient(150deg, rgba(56, 189, 248, 0.1) 0%, rgba(167, 139, 250, 0.06) 60%, transparent 100%),
    rgba(14, 17, 26, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 14px 36px rgba(0, 0, 0, 0.3);
}

.algo-deepdive::before {
  content: "↯";
  position: absolute;
  left: 1rem;
  top: 0.95rem;
  width: 1.65rem;
  height: 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.32);
}

.algo-deepdive__label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7dd3fc;
}

.algo-deepdive p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text);
}

.algo-deepdive p+p {
  margin-top: 0.55rem;
}

.algo-deepdive strong {
  color: var(--accent-strong);
  font-weight: 600;
}

/* Uyarı kutusu — kritik bilgi */

.algo-warn {
  position: relative;
  margin: 1.25rem 0;
  padding: 0.95rem 1.1rem 1rem 2.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(251, 146, 60, 0.32);
  background:
    linear-gradient(155deg, rgba(251, 146, 60, 0.1), transparent 55%),
    rgba(20, 18, 14, 0.7);
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text);
}

.algo-warn::before {
  content: "!";
  position: absolute;
  left: 0.95rem;
  top: 0.85rem;
  width: 1.45rem;
  height: 1.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fb923c;
  background: rgba(251, 146, 60, 0.14);
  border: 1px solid rgba(251, 146, 60, 0.45);
}

.algo-warn strong {
  color: #fdba74;
  font-weight: 700;
  letter-spacing: -0.003em;
}

/* Sözlük: erişilebilir ipucu */

abbr.algo-term {
  text-decoration: underline dotted rgba(167, 139, 250, 0.55);
  text-underline-offset: 0.15em;
  cursor: help;
}

.algo-state--singlet {
  border-color: rgba(56, 189, 248, 0.3);
}

.algo-state--singlet .algo-state__name::before {
  background: #38bdf8;
}

/* ─────────────────── Tarif (Hadamard + CNOT) ─────────────────── */

.algo-recipe {
  position: relative;
  margin: 1.5rem 0 0.5rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.algo-recipe::before {
  content: "";
  position: absolute;
  left: 1.05rem;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 1px;
  background: linear-gradient(180deg,
      rgba(167, 139, 250, 0.45),
      rgba(56, 189, 248, 0.25));
}

.algo-recipe__step {
  position: relative;
  padding: 0.95rem 1.2rem 1rem 3rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(165deg, rgba(167, 139, 250, 0.06), transparent 55%),
    rgba(18, 21, 30, 0.72);
}

.algo-recipe__marker {
  position: absolute;
  left: 0.4rem;
  top: 0.85rem;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--bg-deep);
  background: linear-gradient(135deg, #c4b5fd, #8b5cf6);
  box-shadow:
    0 0 0 3px rgba(12, 14, 22, 1),
    0 0 0 4px rgba(167, 139, 250, 0.45);
}

.algo-recipe__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.algo-recipe__title .algo-token--gate {
  margin-left: 0.45rem;
}

.algo-recipe__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-muted);
}

/* ─────────────────────── Mini devre çerçevesi ─────────────────── */

.algo-circuit-frame {
  margin: 1.5rem 0 0.25rem;
  padding: 1.25rem 1.35rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid rgba(167, 139, 250, 0.2);
  background:
    radial-gradient(ellipse 70% 90% at 8% 20%, rgba(167, 139, 250, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 80% at 92% 80%, rgba(56, 189, 248, 0.06), transparent 55%),
    rgba(12, 14, 22, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 48px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.algo-circuit-frame__caption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  align-items: baseline;
  margin-bottom: 0.85rem;
}

.algo-circuit-frame__caption strong {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.algo-circuit-frame__caption span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(154, 163, 181, 0.85);
}

.algo-circuit-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 139, 250, 0.5) transparent;
}

.algo-circuit-scroll::-webkit-scrollbar {
  height: 8px;
}

.algo-circuit-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.algo-circuit-scroll::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.45);
  border-radius: 999px;
}

.algo-circuit-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(196, 181, 253, 0.62);
}

.algo-circuit-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: clamp(280px, 38vw, 380px);
}

/* ───────────────────── Şema altı doğrulama bandı ───────────────── */

.algo-verify {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.85rem 1rem;
  margin: 1rem 0 1.35rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid rgba(56, 189, 248, 0.22);
  background:
    linear-gradient(105deg, rgba(56, 189, 248, 0.08) 0%, rgba(167, 139, 250, 0.06) 45%, transparent 85%),
    rgba(14, 16, 24, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 36px rgba(0, 0, 0, 0.28);
}

.algo-verify__badge {
  flex: 0 0 auto;
  align-self: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.algo-verify__body {
  flex: 1 1 min(100%, 18rem);
  min-width: 0;
}

.algo-verify__formula-line {
  margin: 0 0 0.65rem;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text);
}

.algo-verify__formula-line .katex {
  font-size: 1em;
}

.algo-verify__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.algo-verify__stats li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.algo-verify__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  padding: 0.18rem 0.42rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: #86efac;
  background: rgba(134, 239, 172, 0.1);
  border: 1px solid rgba(134, 239, 172, 0.28);
}

.algo-verify__chip--mute {
  color: #9aa3b5;
  background: rgba(154, 163, 181, 0.08);
  border-color: rgba(154, 163, 181, 0.2);
}

@media (min-width: 720px) {
  .algo-verify {
    align-items: center;
  }
}

/* ───────────────────────── Pratik notlar ──────────────────────── */

.algo-notes {
  display: grid;
  gap: 0.85rem;
  margin: 1.25rem 0 0.5rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .algo-notes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.algo-note {
  padding: 0.95rem 1.1rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(165deg, rgba(56, 189, 248, 0.06), transparent 50%),
    rgba(18, 21, 30, 0.72);
}

.algo-note__title {
  margin: 0 0 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.algo-note__text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ──────────────────── KaTeX karanlık tema ince ayar ──────────── */

.katex {
  color: var(--text);
}

.algo-section .katex-display {
  margin: 0.85rem 0;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: rgba(167, 139, 250, 0.04);
  border: 1px solid rgba(167, 139, 250, 0.12);
  overflow-x: auto;
}

/* ───────────────── İleri/geri sayfa navigasyonu ──────────────── */

.algo-pager {
  display: grid;
  gap: 0.85rem;
  margin: clamp(2rem, 5vw, 3rem) 0 1rem;
}

@media (min-width: 720px) {
  .algo-pager {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.algo-pager__link {
  display: block;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(18, 21, 30, 0.72);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.algo-pager__link:hover {
  border-color: rgba(167, 139, 250, 0.35);
  transform: translateY(-2px);
}

.algo-pager__dir {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.algo-pager__title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.algo-pager__link--next {
  text-align: right;
}

/* ─────────────────────── Responsive ince ayar ───────────────────
 * Hedefler:
 *  · Mobilde sayfa kenarı ↔ kutu arasında minimum boşluk
 *  · Kutu içinde metin ↔ kenar arasında dinlenmiş (ama dar) padding
 *  · Tüm okuma alanı için makul, kararlı bir genişlik
 *
 * .algo-page kapsamı ile sınırlıdır; ortak .wrap kuralı bozulmaz. */

.algo-page {
  --algo-edge: 1.5rem;
  --algo-pad-y: 1rem;
  --algo-pad-x: 1.15rem;
  --algo-measure: 100%;
}

.algo-page .wrap {
  width: min(1120px, calc(100% - var(--algo-edge) * 2));
}

/* İçerik blokları sayfanın okuma kolonunu tam kaplar; hizalama section'ın
 * kendi genişliğine (.wrap) bırakılır. Eski 72ch kısıtı kaldırıldı çünkü
 * class'lı paragraflar (algo-tri, algo-section__lead) ile class'sız
 * paragraflar arasında genişlik farkı oluşturuyordu. */
.algo-page .algo-section__lead,
.algo-page .algo-tri,
.algo-page .algo-meali,
.algo-page .algo-callout,
.algo-page .algo-evolution__step p,
.algo-page .algo-recipe__text,
.algo-page .algo-state__desc {
  max-width: var(--algo-measure);
}

@media (max-width: 720px) {
  .algo-page {
    --algo-edge: 1rem;
    --algo-pad-y: 0.85rem;
    --algo-pad-x: 0.95rem;
  }

  .algo-page .algo-hero {
    padding: 2.25rem 0 1.5rem;
  }

  .algo-page .algo-hero__breadcrumb {
    margin-bottom: 0.85rem;
    font-size: 0.7rem;
  }

  .algo-page .algo-hero__lead {
    margin-bottom: 1.25rem;
    font-size: 1rem;
    line-height: 1.65;
  }

  .algo-page .algo-toc {
    padding: 0.95rem var(--algo-pad-x);
  }

  .algo-page .algo-toc__item a {
    padding: 0.5rem 0.55rem;
    gap: 0.55rem;
  }

  .algo-page .algo-section {
    padding: 1.25rem 0 0.85rem;
  }

  .algo-page .algo-section__head {
    gap: 0.7rem;
    margin-bottom: 0.6rem;
  }

  .algo-page .algo-section__badge {
    width: 1.85rem;
    height: 1.85rem;
    font-size: 0.78rem;
  }

  .algo-page .algo-section__heading {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  .algo-page .algo-callout {
    padding: 0.85rem var(--algo-pad-x) 0.9rem 2.55rem;
    font-size: 0.95rem;
  }

  .algo-page .algo-callout::before {
    left: 0.85rem;
    top: 0.85rem;
  }

  .algo-page .algo-state,
  .algo-page .algo-evolution__step,
  .algo-page .algo-recipe__step,
  .algo-page .algo-note,
  .algo-page .algo-circuit-frame,
  .algo-page .algo-verify,
  .algo-page .algo-meali--block,
  .algo-page .algo-pager__link {
    padding: var(--algo-pad-y) var(--algo-pad-x);
  }

  .algo-page .algo-recipe::before {
    left: 0.85rem;
  }

  .algo-page .algo-recipe__step {
    padding-left: 2.6rem;
  }

  .algo-page .algo-recipe__marker {
    left: 0.25rem;
    top: 0.85rem;
    width: 1.4rem;
    height: 1.4rem;
    font-size: 0.66rem;
  }

  .algo-page .algo-state__formula,
  .algo-page .algo-evolution__math {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .algo-page .algo-evolution__math .katex-display,
  .algo-page .algo-section .katex-display {
    padding: 0.4rem 0.5rem;
    font-size: 0.85em;
  }

  .algo-page .algo-circuit-frame {
    padding: 1rem var(--algo-pad-x) 1.1rem;
  }

  .algo-page .algo-circuit-frame__caption {
    min-width: 100%;
  }

  .algo-page .algo-circuit-svg {
    max-height: none;
    min-width: 640px;
  }

  .algo-page .algo-verify__formula-line {
    font-size: 0.92rem;
  }

  .algo-page .algo-pager__link {
    padding: 0.85rem var(--algo-pad-x);
  }
}

@media (max-width: 480px) {
  .algo-page {
    --algo-edge: 0.75rem;
    --algo-pad-y: 0.75rem;
    --algo-pad-x: 0.8rem;
  }

  .algo-page .algo-hero__title {
    font-size: 1.85rem;
  }

  .algo-page .algo-hero__lead {
    font-size: 0.96rem;
  }

  .algo-page .algo-section__heading {
    font-size: 1.15rem;
  }

  .algo-page .algo-callout {
    padding-left: 2.3rem;
    font-size: 0.93rem;
  }

  .algo-page .algo-callout::before {
    left: 0.7rem;
  }

  .algo-page .algo-recipe::before {
    left: 0.7rem;
  }

  .algo-page .algo-recipe__step {
    padding-left: 2.35rem;
  }

  .algo-page .algo-toc__item a {
    font-size: 0.88rem;
  }

  .algo-page .algo-state__name,
  .algo-page .algo-evolution__label,
  .algo-page .algo-note__title,
  .algo-page .algo-pager__dir {
    font-size: 0.66rem;
  }
}

/* ────────────────────── Pre-rendered LaTeX (MathML) ────────────────────── */
/* LaTeX ifadeleri build-time'da KaTeX tarafından MathML'e dönüştürülür
 * (tools/render-latex.mjs). Bu blok, modern tarayıcıların yerel MathML
 * desteği için minimum tipografi sağlar — KaTeX CSS / font / JS yüklemez. */

.qbyt-math {
  font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math",
    "Times New Roman", serif;
  font-style: normal;
  color: inherit;
}

.qbyt-math--inline {
  display: inline;
  white-space: nowrap;
  vertical-align: baseline;
  font-size: 1.02em;
  line-height: 1;
}

.qbyt-math--display {
  display: block;
  margin: 1.1rem auto;
  text-align: center;
  font-size: 1.1em;
  line-height: 1.25;
  overflow-x: auto;
  max-width: 100%;
}

.qbyt-math math {
  font-family: inherit;
}

.qbyt-math .katex {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.qbyt-math .katex annotation {
  display: none;
}

@supports not (display: math) {
  .qbyt-math math {
    font-feature-settings: "ssty";
  }
}