@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Lora:ital,wght@0,400;0,600;1,400&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

/* ════════════════════════════════════════════════════════════════════
   ALGORITMI — stile condiviso delle dispense
   File generato unificando le ~25 copie ridondanti che le singole
   dispense avevano (ognuna incollava lo stesso blocco .cb/.qr).
   Ogni selettore condiviso qui sotto è definito UNA SOLA VOLTA.
   Non duplicare queste regole nei singoli file .md.
   ════════════════════════════════════════════════════════════════════ */


/* ── p ── */
p {
  color: #1e293b !important;
}
.dark p {
  color: rgba(255,255,255,0.75) !important;
}

/* ── Retrieval practice: il titolo interno non deve ereditare il margine
   superiore generico degli h3 della pagina dispensa (3.75rem), che lasciava
   un grande spazio vuoto in cima al riquadro. ── */
.dispensa-article .qr .qr-retrieval > h3:first-child {
  margin-top: 0 !important;
}

/* ── qr ── */
.qr {
  font-family: 'Lora', Georgia, serif;
  color: #1e293b;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 2rem 7rem;
  line-height: 1.85;
  font-size: 1.075rem;
}
.qr p {
  margin-bottom: 1.6rem;
  color: #1e293b;
  line-height: 1.75;
}
.qr-hero {
  text-align: center;
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid rgba(99,102,241,0.14);
  margin-bottom: 3.5rem;
  width: 100%;
  max-width: 720px;
  display: block;
  margin: 0 auto 2rem;
}
.qr-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #6366f1 !important;
  display: block;
  margin-bottom: 1.5rem;
  text-align: center;
}
.qr-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 900;
  line-height: 1.05;
  color: #6366f1 !important;
  margin: 0 0 1.25rem;
  letter-spacing: -0.025em;
  text-align: center;
}
.qr-subtitle {
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  color: #64748b !important;
  max-width: 560px;
  margin: 0 auto 3rem;
  line-height: 1.7;
  font-style: italic;
  text-align: center;
}
.qr-hero-diagram {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: block;
}
.qr-h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  margin: 4rem 0 0.5rem;
  line-height: 1.2;
}
.qr-lead {
  font-size: 1rem;
  color: #64748b !important;
  font-style: italic;
  margin: 0 0 2rem;
}
.qr-dropcap > p:first-of-type::first-letter {
  font-family: 'Playfair Display', serif;
  font-size: 5rem;
  font-weight: 900;
  line-height: 0.78;
  float: left;
  margin: 0.06em 0.1em 0 0;
  color: #6366f1;
}
.qr-dropcap p {
  color: #1e293b !important;
}
.qr-def {
  border-left: 3px solid #6366f1;
  background: rgba(99,102,241,0.06);
  padding: 1.2rem 1.5rem;
  border-radius: 0 8px 8px 0;
  margin: 1rem 0;
  font-style: italic;
  color: #1e293b !important;
}
.qr-tip {
  border-left: 3px solid #10b981;
  background: rgba(16,185,129,0.07);
  padding: 1.1rem 1.4rem;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
  color: #064e3b !important;
  font-size: 0.95rem;
}
.qr-warn {
  border-left: 3px solid #f59e0b;
  background: rgba(245,158,11,0.08);
  padding: 1.1rem 1.4rem;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
  color: #78350f !important;
  font-size: 0.95rem;
}
.qr-retrieval {
  background: linear-gradient(135deg, rgba(99,102,241,0.07) 0%, rgba(139,92,246,0.05) 100%);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 16px;
  padding: 2.5rem 3rem;
  margin: 4rem 0 2rem;
  margin-top: 2rem;
}
.qr-retrieval-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 1.8rem;
}
.qr-retrieval ol {
  padding-left: 1.4rem;
  margin: 0;
}
.qr-retrieval li {
  color: #1e293b !important;
  margin-bottom: 1rem;
  line-height: 1.6;
  font-size: 0.97rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(99,102,241,0.07);
  font-family: 'Lora', serif;
  margin: .5rem 0;
}
.dark .qr {
  color: #e2e8f0;
}
.dark .qr p {
  color: #e2e8f0 !important;
}
.dark .qr-h2 {
  color: #e2e8f0;
}
.dark .qr-lead {
  color: #94a3b8 !important;
}
.dark .qr strong {
  color: #a5b4fc;
}
.dark .qr code {
  background: #1e1b4b;
  color: #a5b4fc;
}
.dark .qr-title {
  color: #818cf8 !important;
}
.dark .qr-subtitle {
  color: #94a3b8 !important;
}
.dark .qr-eyebrow {
  color: #818cf8 !important;
}
.dark .qr-def {
  background: rgba(99,102,241,0.13);
  border-left-color: #818cf8;
  color: #e2e8f0 !important;
}
.dark .qr-tip {
  background: rgba(16,185,129,0.12);
  color: #d1fae5 !important;
}
.dark .qr-warn {
  background: rgba(245,158,11,0.11);
  color: #fde68a !important;
}
.dark .qr-dropcap p {
  color: #e2e8f0 !important;
}
.dark .qr-pullquote-text {
  color: #e2e8f0;
}
.dark .qr-retrieval {
  background: rgba(99,102,241,0.08);
  border-color: rgba(99,102,241,0.25);
}
.dark .qr-retrieval-title {
  color: #e2e8f0;
}
.dark .qr-retrieval li {
  color: #e2e8f0 !important;
  border-bottom-color: rgba(99,102,241,0.06);
}
.dark .qr-dropcap > p {
  color: rgba(255,255,255,0.75) !important;
}
.qr-h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #6366f1 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 2.5rem 0 0.5rem;
}
.qr-def-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6366f1 !important;
  margin-bottom: 0.6rem;
}
.qr-def > p {
  margin: 0;
  font-size: 1rem;
  color: #000 !important;
  line-height: 1.75;
}
.dark .qr-def p {
  color: #fff !important;
}
.dark .qr-def li {
  color: #fff !important;
}
.qr-def strong {
  color: #6366f1 !important;
  font-weight: 600;
  display: inline;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
}
.qr-trace {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0 1.8rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
}
.qr-trace th {
  background: rgba(99,102,241,0.08);
  color: #6366f1 !important;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 2px solid rgba(99,102,241,0.2);
}
.qr-trace td {
  padding: 0.55rem 1rem;
  color: #1e293b;
  border-bottom: 1px solid rgba(99,102,241,0.07);
  vertical-align: middle;
}
.dark .qr-trace td {
  color: rgba(255,255,255,0.75);
  border-bottom-color: rgba(99,102,241,0.08);
}
.qr-trace tr:last-child td {
  border-bottom: none;
}
.qr-trace tr:hover td {
  background: rgba(99,102,241,0.03);
}
.qr-trace .changed {
  color: #6366f1 !important;
  font-weight: 600;
}
.qr-trace .note {
  font-size: 0.72rem;
  color: #94a3b8;
  font-family: 'Lora', serif;
}
.qr-pullquote {
  text-align: center;
  padding: 3rem 1.5rem;
  margin: 2rem 0;
  border-top: 1px solid rgba(99,102,241,0.1);
  border-bottom: 1px solid rgba(99,102,241,0.1);
}
.qr-pullquote-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.45;
  color: #0f172a;
  max-width: 640px;
  margin: 0 auto 1rem;
}
.qr-pullquote-source {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6366f1;
}
.qr-esercizi {
  margin: 3rem 0;
}
.qr-esercizio {
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  margin: 1.2rem 0;
  background: rgba(99,102,241,0.02);
}
.qr-esercizio-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6366f1 !important;
  margin-bottom: 0.5rem;
}
.qr-esercizio p {
  margin: 0;
  color: #334155 !important;
  font-size: 0.95rem;
  line-height: 1.6;
}
.dark .qr-esercizio p {
  color: rgba(255,255,255,0.75) !important;
}
.qr-esercizio-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.6rem !important;
  font-style: italic;
}
.qr-retrieval-head {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a !important;
  margin-bottom: 1.25rem;
}
.qr-retrieval li:last-child {
  border-bottom: none;
}
.dark .qr-hero {
  border-bottom-color: rgba(99,102,241,0.1);
}
.dark .qr-def strong {
  color: #a5b4fc !important;
}
.dark .qr-pullquote {
  border-color: rgba(99,102,241,0.08);
}
.dark .qr-retrieval-head {
  color: #e2e8f0 !important;
}
.dark .qr-esercizio {
  background: rgba(99,102,241,0.04);
  border-color: rgba(99,102,241,0.12);
}
.dark .qr-trace th {
  background: rgba(99,102,241,0.12);
}
.qr h2 {
  font-family: 'Playfair Display', Georgia, serif !important;
  color: #1e1b4b !important;
}
.qr h3 {
  font-family: 'Playfair Display', Georgia, serif !important;
  color: #1e1b4b !important;
}
.qr li {
  line-height: 1.75;
}
.qr code {
  font-family: 'JetBrains Mono', monospace;
  background: #ede9fe;
  color: #4c1d95;
  padding: .1em .35em;
  border-radius: 4px;
  font-size: .88em;
}
.qr strong {
  color: #4338ca;
}
.qr-tip strong {
  display: block;
  margin-bottom: .3rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
}
.qr-warn strong {
  display: block;
  margin-bottom: .3rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
}
.qr-retrieval h3 {
  font-family: 'Playfair Display',serif;
  color: #4338ca;
  margin: 0 0 .75rem;
}
.dark .qr h2 {
  color: #e2e8f0 !important;
}
.dark .qr h3 {
  color: #e2e8f0 !important;
}
.dark .qr li {
  color: #e2e8f0 !important;
}
.dark .qr-tip strong {
  color: #4ade80;
}
.dark .qr-warn strong {
  color: #fbbf24;
}
.dark .qr-retrieval h3 {
  color: #e2e8f0 !important;
}
.qr-hero-top {
  text-align: center;
  padding: 3rem 0 0;
  border-bottom: 1px solid rgba(99,102,241,0.12);
  margin-bottom: 2rem;
}

/* ── img ── */
.img-placeholder {
  border: 2px dashed rgba(99,102,241,0.3);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
  background: rgba(99,102,241,0.02);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #94a3b8;
}
.img-placeholder strong {
  color: #6366f1 !important;
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}
.dark .img-placeholder {
  border-color: rgba(99,102,241,0.2);
  background: rgba(99,102,241,0.04);
}

/* ── cb ── */
.cb {
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
  margin: 1.8rem 0;
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
  color: #fff !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
}
.cb-bar {
  background: #1e293b;
  padding: .55rem 1rem;
  display: flex;
  gap: 6px;
  align-items: center;
}
.cb-bar span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.cb-bar span:nth-child(1) {
  background: #ef4444;
}
.cb-bar span:nth-child(2) {
  background: #f59e0b;
}
.cb-bar span:nth-child(3) {
  background: #22c55e;
}
.cb pre {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 1.2rem 1.5rem !important;
  margin: 0 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: .85rem !important;
  line-height: 1.7 !important;
  overflow-x: auto;
  white-space: pre;
}
.cb pre code {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 1.2rem 1.5rem !important;
  margin: 0 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: .85rem !important;
  line-height: 1.7 !important;
  overflow-x: auto;
}
.cb-kw {
  color: #a5b4fc;
}
.cb-num {
  color: #6ee7b7;
}
.cb-str {
  color: #fcd34d;
}
.cb-cmt {
  color: #64748b;
  font-style: italic;
}
.cb-out {
  color: #f9a8d4;
}
.cb-type {
  color: #7dd3fc;
}
.cb-op {
  color: #fb923c;
  font-weight: 700;
}
.cb-bar .cb-title {
  color: #94a3b8;
  font-size: .78rem;
  margin-left: .5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb pre code .cb-kw {
  color: #a5b4fc !important;
  font-weight: 600;
}
.cb pre code .cb-type {
  color: #7dd3fc !important;
}
.cb pre code .cb-num {
  color: #6ee7b7 !important;
}
.cb pre code .cb-cmt {
  color: #64748b !important;
  font-style: italic;
}
.cb pre code .cb-op {
  color: #fb923c !important;
  font-weight: 700;
}
.cb pre code .cb-out {
  color: #f9a8d4 !important;
}

/* ── algo ── */
.dark .algo-prop {
  background: rgba(99,102,241,0.04);
  border-color: rgba(99,102,241,0.14);
}
.dark .algo-example {
  background: rgba(99,102,241,0.04);
  border-color: rgba(99,102,241,0.12);
}
.algo-steps-wrong {
  list-style: none;
  padding: 0;
  margin: 0;
  display: block;
}
.algo-steps-ok {
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
}

/* ── badge ── */
.badge-wrong {
  background: rgba(220,38,38,0.1);
  color: #dc2626;
  border: 1px solid rgba(220,38,38,0.2);
}
.badge-ok {
  background: rgba(34,197,94,0.1);
  color: #16a34a;
  border: 1px solid rgba(34,197,94,0.2);
}

/* ── result ── */
.result-wrong {
  background: rgba(220,38,38,0.07);
  color: #dc2626;
  border: 1px solid rgba(220,38,38,0.2);
}
.result-ok {
  background: rgba(34,197,94,0.07);
  color: #16a34a;
  border: 1px solid rgba(34,197,94,0.2);
}

/* ── ps ── */
.ps-step ul {
  margin: 0;
  font-size: .85rem;
  line-height: 1.55;
  padding-left: 1rem;
}

/* ── ss ── */
.ss-pass {
  margin: 1rem 0 1.5rem;
}
.ss-pass-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  color: #6366f1;
  font-weight: 700;
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ss-arr {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  margin: .3rem 0;
}
.ss-cell {
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.1rem;
  border: 2px solid transparent;
  width: 48px;
  height: 48px;
  flex-direction: column;
  gap: 1px;
}
.ss-cell.neutral {
  background: #ede9fe;
  border-color: #a5b4fc;
  color: #3730a3;
}
.ss-arr-label {
  font-size: .76rem;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
  margin: .15rem 0 .6rem;
}
.ss-trace {
  overflow-x: auto;
  margin: 1.25rem 0;
}
.ss-trace table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
}
.ss-trace th {
  background: #4338ca;
  color: white;
  padding: .5rem .75rem;
  text-align: center;
}
.ss-trace td {
  padding: .45rem .75rem;
  text-align: center;
  border-bottom: 1px solid #e0e7ff;
}
.ss-trace tr:nth-child(even) td {
  background: #f5f3ff;
}
.dark .ss-cell.neutral {
  background: #1e1b4b;
  border-color: #4338ca;
  color: #c7d2fe;
}
.dark .ss-arr-label {
  color: #64748b;
}
.dark .ss-pass-label {
  color: #818cf8;
}
.dark .ss-trace td {
  border-bottom-color: #1e293b;
  color: #e2e8f0;
}
.dark .ss-trace tr:nth-child(even) td {
  background: #1e1b4b;
}


/* ════════════════════════════════════════════════════════════════════
   Stili specifici di singole dispense (non duplicati altrove)
   ════════════════════════════════════════════════════════════════════ */

.m2-grid {
  display: block;
  gap: 3px;
  margin: 1.5rem auto;
  width: fit-content;
}
.m2-row {
  display: flex;
  gap: 3px;
}
.m2-cell {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  position: relative;
  flex-direction: column;
}
.m2-cell.header-row {
  background: #1e293b;
  color: #a5b4fc;
  border-color: #334155;
  font-size: 0.75rem;
}
.m2-cell.header-col {
  background: #1e293b;
  color: #6ee7b7;
  border-color: #334155;
  font-size: 0.75rem;
}
.m2-cell.diag {
  background: #eff6ff;
  border-color: #6366f1;
}
.m2-cell.corner {
  background: #0f172a;
  border-color: #0f172a;
}
.m2-cell .m2-idx {
  font-size: 0.6rem;
  color: #94a3b8;
  font-weight: 400;
  position: absolute;
  top: 2px;
  left: 3px;
}
.m2-patterns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  margin: 2rem 0;
}
.m2-pat {
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
}
.m2-pat-header {
  background: #1e293b;
  padding: 0.6rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #a5b4fc !important;
}
.m2-pat pre {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 1rem 1.2rem !important;
  margin: 0 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.8rem !important;
  line-height: 1.65 !important;
}
.m2-pat pre code {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 1rem 1.2rem !important;
  margin: 0 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.8rem !important;
  line-height: 1.65 !important;
}
.m2-apps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}
.m2-app {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.2rem 1rem;
  background: #fafafa;
  text-align: center;
}
.m2-app-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.5rem;
}
.m2-app-name {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: #0f172a;
  display: block;
  margin-bottom: 0.3rem;
}
.m2-app-desc {
  font-size: 0.82rem;
  color: #64748b !important;
  line-height: 1.4;
}
.qr-array-vis {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 2rem 0;
  overflow-x: auto;
}
.qr-array-cell {
  flex: 1;
  min-width: 60px;
  max-width: 80px;
  text-align: center;
}
.qr-array-box {
  border: 2px solid rgba(99,102,241,0.4);
  border-right-width: 0;
  padding: 0.8rem 0.4rem;
  background: rgba(99,102,241,0.04);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 600;
  color: #6366f1;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-array-cell:last-child .qr-array-box {
  border-right-width: 2px;
  border-radius: 0 8px 8px 0;
}
.qr-array-cell:first-child .qr-array-box {
  border-radius: 8px 0 0 8px;
}
.qr-array-idx {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.3rem;
}
.dark .qr-array-box {
  background: rgba(99,102,241,0.08);
  border-color: rgba(99,102,241,0.3);
}
.qr-array-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #6366f1;
  margin-bottom: 0.4rem;
  text-align: left;
}
.qr-esempio {
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 14px;
  margin: 2rem 0;
  overflow: hidden;
}
.qr-esempio-header {
  background: rgba(99,102,241,0.07);
  padding: 0.9rem 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid rgba(99,102,241,0.1);
}
.dark .qr-esempio-header {
  background: rgba(99,102,241,0.1);
}
.qr-esempio-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: #6366f1;
  color: #fff !important;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
}
.qr-esempio-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}
.dark .qr-esempio-title {
  color: #f1f5f9;
}
.qr-esempio-body {
  padding: 1.4rem 1.6rem;
}
.ao-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin: 2rem 0;
}
.ao-arr {
  border-radius: 10px;
  padding: 1.2rem;
  border: 1.5px solid transparent;
}
.ao-arr.sorted {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.ao-arr.unsorted {
  background: #fef2f2;
  border-color: #fecaca;
}
.ao-arr-title {
  font-family: 'Inter',sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  display: block;
  margin-bottom: 0.8rem;
}
.ao-arr.sorted .ao-arr-title {
  color: #15803d;
}
.ao-arr.unsorted .ao-arr-title {
  color: #b91c1c;
}
.ao-cells {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.ao-cell {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono',monospace;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #1e293b;
}
.ao-cell.ok {
  border-color: #16a34a;
  background: #dcfce7;
  color: #15803d;
}
.ao-cell.err {
  border-color: #ef4444;
  background: #fee2e2;
  color: #b91c1c;
}
.ao-cell.neutral {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #374151;
}
.ao-invariant {
  background: #fafafa;
  border: 1.5px dashed #6366f1;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.8rem 0;
  font-size: 0.92rem;
  color: #1e293b !important;
}
.dark .ao-arr.sorted {
  background: #052e16;
  border-color: #22c55e;
}
.dark .ao-arr.sorted .ao-arr-title {
  color: #4ade80;
}
.dark .ao-arr.unsorted {
  background: #200a0a;
  border-color: #dc2626;
}
.dark .ao-arr.unsorted .ao-arr-title {
  color: #f87171;
}
.dark .ao-cell.ok {
  border-color: #22c55e;
  background: #052e16;
  color: #86efac;
}
.dark .ao-cell.err {
  border-color: #ef4444;
  background: #200a0a;
  color: #fca5a5;
}
.dark .ao-cell.neutral {
  border-color: #334155;
  background: #1e293b;
  color: #94a3b8;
}
.dark .ao-invariant {
  background: #1e1b4b;
  border-color: #6366f1;
  color: #e2e8f0 !important;
}
.bs-pass {
  margin: 1rem 0 1.5rem;
}
.bs-pass-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  color: #6366f1;
  font-weight: 700;
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.bs-arr {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  margin: .3rem 0;
}
.bs-cell {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.1rem;
  border: 2px solid transparent;
}
.bs-cell.neutral {
  background: #ede9fe;
  border-color: #a5b4fc;
  color: #3730a3;
}
.bs-cell.comparing {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}
.bs-cell.swapping {
  background: #fee2e2;
  border-color: #ef4444;
  color: #7f1d1d;
}
.bs-cell.sorted {
  background: #dcfce7;
  border-color: #22c55e;
  color: #14532d;
}
.bs-arr-label {
  font-size: .76rem;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
  margin: .15rem 0 .6rem;
}
.bs-swap-arrow {
  color: #ef4444;
  font-size: 1.1rem;
}
.bs-counter {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.bs-pass-chip {
  background: #312e81;
  color: white;
  border-radius: 20px;
  padding: .3rem .8rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
}
.bs-pass-chip.done {
  background: #22c55e;
}
.bs-trace {
  overflow-x: auto;
  margin: 1.25rem 0;
}
.bs-trace table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
}
.bs-trace th {
  background: #4338ca;
  color: white;
  padding: .5rem .75rem;
  text-align: center;
}
.bs-trace td {
  padding: .45rem .75rem;
  text-align: center;
  border-bottom: 1px solid #e0e7ff;
}
.bs-trace tr:nth-child(even) td {
  background: #f5f3ff;
}
.bs-trace tr.sorted-row td {
  background: #dcfce7;
  color: #14532d;
  font-weight: 700;
}
.bs-trace .swap-yes {
  color: #dc2626;
  font-weight: 700;
}
.bs-trace .swap-no {
  color: #94a3b8;
}
.bs-ops {
  background: #0f172a;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  color: white;
  font-family: 'JetBrains Mono', monospace;
}
.bs-ops-title {
  color: #a5b4fc;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .75rem;
}
.bs-ops-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: .4rem 0;
  font-size: .88rem;
}
.bs-ops-n {
  color: #fbbf24;
  min-width: 80px;
}
.bs-ops-bar {
  height: 16px;
  background: #6366f1;
  border-radius: 3px;
}
.bs-ops-val {
  color: #94a3b8;
}
.bs-opt {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0;
}
.bs-opt-card {
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.bs-opt-card.before {
  background: #fef3c7;
  border: 2px solid #f59e0b;
}
.bs-opt-card.after {
  background: #dcfce7;
  border: 2px solid #22c55e;
}
.bs-opt-card h4 {
  margin: 0 0 .5rem;
  font-family: 'Playfair Display', serif;
  font-size: .95rem;
}
.bs-opt-card.before h4 {
  color: #92400e;
}
.bs-opt-card.after h4 {
  color: #14532d;
}
.bs-opt-card p {
  margin: 0;
  font-size: .85rem;
  line-height: 1.6;
}
.bs-step {
  position: relative;
  border-radius: 10px;
  border: 2px solid;
  padding: 1.4rem 1.4rem 1.4rem;
  margin: 1.8rem 0 0.4rem;
}
.bs-step.v0 {
  border-color: #94a3b8;
  background: #f8fafc;
}
.bs-step.v1 {
  border-color: #f59e0b;
  background: #fffbeb;
}
.bs-step.v2 {
  border-color: #22c55e;
  background: #f0fdf4;
}
.bs-step-badge {
  position: absolute;
  top: -13px;
  left: 16px;
  color: white;
  font-family: 'JetBrains Mono',monospace;
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .75rem;
  border-radius: 20px;
  letter-spacing: .06em;
}
.bs-step.v0 .bs-step-badge {
  background: #64748b;
}
.bs-step.v1 .bs-step-badge {
  background: #d97706;
}
.bs-step.v2 .bs-step-badge {
  background: #16a34a;
}
.bs-step h4 {
  margin: .4rem 0 .9rem;
  font-family: 'Playfair Display',serif;
  font-size: 1.05rem;
}
.bs-step.v0 h4 {
  color: #475569;
}
.bs-step.v1 h4 {
  color: #92400e;
}
.bs-step.v2 h4 {
  color: #14532d;
}
.bs-step-arrow {
  text-align: center;
  font-size: 1.6rem;
  color: #94a3b8;
  margin: .15rem 0;
  line-height: 1;
}
.bs-delta {
  border-left: 3px solid;
  padding: .55rem .9rem;
  border-radius: 0 6px 6px 0;
  margin: .9rem 0 0;
  font-size: .87rem;
  line-height: 1.55;
}
.bs-delta.warn {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}
.bs-delta.good {
  background: #dcfce7;
  border-color: #22c55e;
  color: #14532d;
}
.bs-delta.great {
  background: #ede9fe;
  border-color: #6366f1;
  color: #3730a3;
}
.bs-delta strong {
  font-family: 'Playfair Display',serif;
  display: block;
  margin-bottom: .25rem;
}
.cb-hi {
  color: #fbbf24;
  font-weight: 700;
}
.dark .bs-step.v0 {
  background: #1e293b;
  border-color: #475569;
}
.dark .bs-step.v1 {
  background: #1c1400;
  border-color: #d97706;
}
.dark .bs-step.v2 {
  background: #052e16;
  border-color: #22c55e;
}
.dark .bs-step.v0 h4 {
  color: #94a3b8;
}
.dark .bs-step.v1 h4 {
  color: #fbbf24;
}
.dark .bs-step.v2 h4 {
  color: #4ade80;
}
.dark .bs-delta.warn {
  background: #1c1400;
  color: #fde68a;
}
.dark .bs-delta.good {
  background: #052e16;
  color: #bbf7d0;
}
.dark .bs-delta.great {
  background: #1e1b4b;
  color: #c7d2fe;
}
.dark .bs-cell.neutral {
  background: #1e1b4b;
  border-color: #4338ca;
  color: #c7d2fe;
}
.dark .bs-cell.comparing {
  background: #1c1400;
  border-color: #d97706;
  color: #fde68a;
}
.dark .bs-cell.swapping {
  background: #200a0a;
  border-color: #dc2626;
  color: #fca5a5;
}
.dark .bs-cell.sorted {
  background: #052e16;
  border-color: #22c55e;
  color: #86efac;
}
.dark .bs-arr-label {
  color: #64748b;
}
.dark .bs-pass-label {
  color: #818cf8;
}
.dark .bs-trace td {
  border-bottom-color: #1e293b;
  color: #e2e8f0;
}
.dark .bs-trace tr:nth-child(even) td {
  background: #1e1b4b;
}
.dark .bs-trace tr.sorted-row td {
  background: #052e16;
  color: #86efac;
}
.dark .bs-opt-card.before {
  background: #1c1400;
  border-color: #d97706;
}
.dark .bs-opt-card.before h4 {
  color: #fbbf24;
}
.dark .bs-opt-card.before p {
  color: #fde68a;
}
.dark .bs-opt-card.after {
  background: #052e16;
  border-color: #22c55e;
}
.dark .bs-opt-card.after h4 {
  color: #4ade80;
}
.dark .bs-opt-card.after p {
  color: #bbf7d0;
}
.dark .bs-pass-chip {
  background: #1e293b;
}
.dark .bs-pass-chip.done {
  background: #14532d;
}
.cy-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}
.cy-card {
  border-radius: 12px;
  padding: 1.3rem 1rem;
  border: 1.5px solid transparent;
  text-align: center;
}
.cy-card.while {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.cy-card.dowhile {
  background: #fdf4ff;
  border-color: #e9d5ff;
}
.cy-card.for {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.cy-card-kw {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  display: block;
  margin-bottom: 0.5rem;
}
.cy-card.while .cy-card-kw {
  color: #1d4ed8;
}
.cy-card.dowhile .cy-card-kw {
  color: #7c3aed;
}
.cy-card.for .cy-card-kw {
  color: #15803d;
}
.cy-card-when {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.5rem;
}
.cy-card.while .cy-card-when {
  color: #1d4ed8;
}
.cy-card.dowhile .cy-card-when {
  color: #7c3aed;
}
.cy-card.for .cy-card-when {
  color: #15803d;
}
.cy-card-desc {
  font-size: 0.84rem;
  color: #374151 !important;
  line-height: 1.5;
}
.cy-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
  margin: 2rem 0;
}
.cy-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6366f1 !important;
  margin-bottom: 0.6rem;
  display: block;
}
.cy-img-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 1rem;
  text-align: center;
}
.cy-img-wrap img {
  max-width: 100%;
  border-radius: 6px;
}
.cy-trace {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
}
.cy-trace th {
  background: #1e293b;
  color: #e2e8f0 !important;
  padding: 0.5rem 0.9rem;
  text-align: center;
  font-weight: 600;
}
.cy-trace td {
  padding: 0.45rem 0.9rem;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b !important;
}
.cy-trace tr:last-child td {
  border-bottom: none;
}
.cy-trace tr:nth-child(even) td {
  background: #f8fafc;
}
.cy-true {
  color: #15803d !important;
  font-weight: 700;
}
.cy-false {
  color: #ef4444 !important;
  font-weight: 700;
}
.cy-guide {
  background: #0f172a;
  border-radius: 10px;
  padding: 1.8rem 2rem;
  margin: 2rem 0;
}
.cy-guide-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6366f1 !important;
  margin-bottom: 1rem;
  display: block;
}
.cy-guide-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.cy-guide-q {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: #cbd5e1 !important;
  flex: 1;
  line-height: 1.5;
}
.cy-guide-a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 80px;
  text-align: right;
}
.cy-guide-a.for {
  color: #6ee7b7 !important;
}
.cy-guide-a.while {
  color: #a5b4fc !important;
}
.cy-guide-a.dowhile {
  color: #d8b4fe !important;
}
.cy-val {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin: 1.8rem 0;
}
.cy-val-card {
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid #e2e8f0;
}
.cy-val-header {
  background: #1e293b;
  padding: 0.6rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: #e2e8f0 !important;
}
.cy-val-body {
  background: #fff;
  padding: 1rem;
}
.cy-val-body img {
  max-width: 100%;
}
.cy-exercises {
  margin: 4rem 0 2rem;
}
.cy-exercises-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.4rem;
  line-height: 1.2;
}
.cy-exercises-lead {
  font-size: 1rem;
  color: #64748b !important;
  font-style: italic;
  margin: 0 0 2rem;
}
.cy-ex-grid {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.cy-ex {
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.cy-ex-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1.3rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.cy-ex-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6366f1 !important;
  min-width: 1.8rem;
}
.cy-ex-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.93rem;
  font-weight: 700;
  color: #0f172a !important;
  flex: 1;
}
.cy-ex-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.67rem;
  font-weight: 700;
  padding: 0.18rem 0.65rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.cy-ex-badge.d1 {
  background: #dcfce7;
  color: #15803d !important;
}
.cy-ex-badge.d2 {
  background: #dbeafe;
  color: #1d4ed8 !important;
}
.cy-ex-badge.d3 {
  background: #fef3c7;
  color: #92400e !important;
}
.cy-ex-badge.d4 {
  background: #fce7f3;
  color: #be185d !important;
}
.cy-ex-badge.d5 {
  background: #ede9fe;
  color: #6d28d9 !important;
}
.cy-ex-body {
  padding: 1.2rem 1.3rem 1.3rem;
}
.cy-ex-problem {
  font-family: 'Lora', serif;
  font-size: 0.97rem;
  color: #1e293b !important;
  line-height: 1.75;
  margin: 0 0 0.8rem;
}
.cy-ex-hint {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: #475569 !important;
  font-style: italic;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  margin: 0 0 1rem;
  display: block;
}
.sol-block {
  display: none;
  border-top: 1px solid #e2e8f0;
  padding-top: 1rem;
  margin-top: 0.3rem;
}
.sol-block.sol-revealed {
  display: block;
}
.sol-block-placeholder {
  display: block !important;
  margin-top: 0.8rem;
}
.sol-block-placeholder.sol-revealed {
  display: none !important;
}
.sol-block-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 1rem;
  background: #6366f1 !important;
  color: #fff !important;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.18s;
  -webkit-appearance: none;
  appearance: none;
}
.sol-block-btn:hover {
  background: #4f46e5 !important;
}
.sol-block-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6366f1 !important;
  display: block;
  margin-bottom: 0.55rem;
}
.sol-block-explain {
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  color: #475569 !important;
  line-height: 1.65;
  margin: 0.6rem 0 0;
  padding: 0.6rem 0.9rem;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #6366f1;
}
.dark .cy-exercises-title {
  color: #e2e8f0;
}
.dark .cy-ex {
  border-color: #334155;
}
.dark .cy-ex-header {
  background: #1e293b;
  border-color: #334155;
}
.dark .cy-ex-title {
  color: #e2e8f0 !important;
}
.dark .cy-ex-problem {
  color: #cbd5e1 !important;
}
.dark .cy-ex-hint {
  background: #0f172a;
  color: #94a3b8 !important;
}
.dark .sol-block {
  border-color: #334155;
}
.dark .sol-block-explain {
  background: #0f172a;
  color: #94a3b8 !important;
}
.dark .cy-ex-badge.d1 {
  background: rgba(21,128,61,.25);
}
.dark .cy-ex-badge.d2 {
  background: rgba(29,78,216,.25);
}
.dark .cy-ex-badge.d3 {
  background: rgba(146,64,14,.25);
  color: #fcd34d !important;
}
.dark .cy-ex-badge.d4 {
  background: rgba(190,24,93,.25);
  color: #f9a8d4 !important;
}
.dark .cy-ex-badge.d5 {
  background: rgba(109,40,217,.25);
  color: #c4b5fd !important;
}
.ca-classes {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}
.ca-cls {
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}
.ca-cls.o1 {
  background: #dcfce7;
  border: 2px solid #22c55e;
}
.ca-cls.ologn {
  background: #d1fae5;
  border: 2px solid #10b981;
}
.ca-cls.on {
  background: #fef3c7;
  border: 2px solid #f59e0b;
}
.ca-cls.on2 {
  background: #fee2e2;
  border: 2px solid #ef4444;
}
.ca-cls .ca-big {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 900;
  display: block;
  margin-bottom: .3rem;
}
.ca-cls.o1 .ca-big {
  color: #14532d;
}
.ca-cls.ologn .ca-big {
  color: #065f46;
}
.ca-cls.on .ca-big {
  color: #78350f;
}
.ca-cls.on2 .ca-big {
  color: #7f1d1d;
}
.ca-cls h4 {
  margin: 0 0 .3rem;
  font-family: 'Playfair Display', serif;
  font-size: .95rem;
}
.ca-cls p {
  margin: .3rem 0;
  font-size: .85rem;
  line-height: 1.55;
}
.ca-cls .ca-ex {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  color: #475569;
}
.ca-table {
  overflow-x: auto;
  margin: 1.5rem 0;
}
.ca-table table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
}
.ca-table th {
  background: #312e81;
  color: white;
  padding: .55rem 1rem;
  text-align: right;
}
.ca-table th:first-child {
  text-align: left;
}
.ca-table td {
  padding: .5rem 1rem;
  text-align: right;
  border-bottom: 1px solid #e0e7ff;
}
.ca-table td:first-child {
  text-align: left;
  font-weight: 700;
  color: #4338ca;
}
.ca-table tr:nth-child(odd) td {
  background: #f5f3ff;
}
.ca-table .ca-green {
  color: #16a34a;
  font-weight: 700;
}
.ca-table .ca-red {
  color: #dc2626;
  font-weight: 700;
}
.ca-table .ca-yellow {
  color: #d97706;
  font-weight: 700;
}
.ca-why {
  background: #f5f3ff;
  border: 1px solid #c7d2fe;
  border-left: 4px solid #6366f1;
  border-radius: 10px;
  padding: 1.3rem 1.5rem;
  margin: 1.5rem 0;
}
.ca-why h3 {
  color: #4338ca !important;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  margin: 0 0 .65rem;
}
.ca-why p {
  color: #374151;
  font-size: .9rem;
  line-height: 1.7;
  margin: .4rem 0;
}
.ca-why .ca-highlight {
  color: #6366f1;
  font-weight: 700;
}
.dark .ca-why {
  background: #13112a;
  border-color: #2d2f5a;
  border-left-color: #818cf8;
}
.dark .ca-why h3 {
  color: #c7d2fe !important;
}
.dark .ca-why p {
  color: #94a3b8;
}
.dark .ca-why .ca-highlight {
  color: #a5b4fc;
}
.ca-graph {
  margin: 1.5rem 0;
}
.ca-graph-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: .35rem 0;
}
.ca-graph-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  min-width: 100px;
  text-align: right;
  color: #475569;
  font-weight: 700;
}
.ca-bar-wrap {
  flex: 1;
  background: #f1f5f9;
  border-radius: 4px;
  height: 20px;
  overflow: hidden;
}
.ca-bar-fill {
  height: 100%;
  border-radius: 4px;
}
.ca-bar-fill.o1 {
  background: #22c55e;
  width: 1%;
}
.ca-bar-fill.ologn {
  background: #10b981;
}
.ca-bar-fill.on {
  background: #f59e0b;
}
.ca-bar-fill.on2 {
  background: #ef4444;
}
.ca-graph-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  color: #64748b;
  min-width: 120px;
}
.cnd-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
  margin: 2rem 0;
}
.cnd-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6366f1 !important;
  margin-bottom: 0.6rem;
  display: block;
}
.cnd-img-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 1rem;
  text-align: center;
}
.cnd-img-wrap img {
  max-width: 100%;
  border-radius: 6px;
}
.cnd-patterns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}
.cnd-pat {
  border-radius: 10px;
  padding: 1.2rem;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
}
.cnd-pat-title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: #6366f1;
  display: block;
  margin-bottom: 0.5rem;
}
.cnd-pat-desc {
  font-size: 0.84rem;
  color: #374151 !important;
  line-height: 1.5;
}
.cnd-trace {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.86rem;
  font-family: 'JetBrains Mono', monospace;
}
.cnd-trace th {
  background: #1e293b;
  color: #e2e8f0 !important;
  padding: 0.5rem 0.9rem;
  text-align: center;
  font-weight: 600;
}
.cnd-trace td {
  padding: 0.45rem 0.9rem;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b !important;
}
.cnd-trace tr:last-child td {
  border-bottom: none;
}
.cnd-trace tr:nth-child(even) td {
  background: #f8fafc;
}
.cnd-true {
  color: #15803d !important;
  font-weight: 700;
}
.cnd-false {
  color: #ef4444 !important;
  font-weight: 700;
}
.algo-props {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  margin: 2rem 0 3rem;
}
.algo-prop {
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 14px;
  padding: 1.6rem;
  background: rgba(99,102,241,0.02);
  cursor: default;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.algo-prop:hover {
  border-color: rgba(99,102,241,0.4);
  background: rgba(99,102,241,0.05);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.1);
}
.algo-prop-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}
.algo-prop-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6366f1 !important;
  margin-bottom: 0.5rem;
}
.algo-prop-desc {
  font-family: 'Lora', serif;
  font-size: 0.92rem;
  color: #1e293b;
  line-height: 1.65;
  margin: 0 0 0.8rem;
}
.algo-prop-violation {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: #dc2626;
  background: rgba(220,38,38,0.05);
  border: 1px solid rgba(220,38,38,0.15);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  line-height: 1.5;
  opacity: 1;
  max-height: 100px;
  overflow: hidden;
  transition: opacity 0.25s ease, max-height 0.35s ease;
}
.dark .algo-prop-desc {
  color: rgba(255,255,255,0.75);
}
.algo-examples {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0 3rem;
}
.algo-example {
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
  background: rgba(99,102,241,0.02);
  transition: all 0.22s ease;
}
.algo-example:hover {
  border-color: rgba(99,102,241,0.35);
  background: rgba(99,102,241,0.05);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.08);
}
.algo-example-icon {
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
  display: block;
}
.algo-example-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.4rem;
}
.dark .algo-example-title {
  color: #f1f5f9;
}
.algo-example-desc {
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
}
.algo-example-detail {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #6366f1;
  margin-top: 0.6rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.25s ease, max-height 0.3s ease;
}
.algo-example:hover .algo-example-detail {
  opacity: 1;
  max-height: 60px;
}
.dark .algo-example-desc {
  color: #64748b;
}
.algo-order-toggle {
  margin: 2rem 0 3rem;
}
.algo-order-toggle input[type="checkbox"] {
  display: none;
}
.algo-order-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6366f1;
  border: 1.5px solid rgba(99,102,241,0.35);
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: all 0.18s ease;
  margin-bottom: 1.4rem;
}
.algo-order-label:hover {
  background: rgba(99,102,241,0.06);
  border-color: #6366f1;
}
.algo-order-toggle input:checked + .algo-order-label {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}
.algo-order-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  margin-bottom: 0.8rem;
}
.algo-order-toggle input:checked ~ .algo-steps-wrong {
  display: none;
}
.algo-order-toggle input:checked ~ .algo-steps-ok {
  display: block;
}
.algo-step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.65rem 0.9rem;
  margin: 0.3rem 0;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: #1e293b;
  background: rgba(99,102,241,0.03);
  border: 1px solid rgba(99,102,241,0.08);
}
.dark .algo-step-item {
  color: rgba(255,255,255,0.75);
  background: rgba(99,102,241,0.05);
}
.algo-step-item.wrong-step {
  background: rgba(220,38,38,0.04);
  border-color: rgba(220,38,38,0.12);
  color: #7f1d1d;
}
.dark .algo-step-item.wrong-step {
  color: #fca5a5;
}
.step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: #6366f1;
  min-width: 1.4rem;
  padding-top: 0.1rem;
}
.step-num.wrong-num {
  color: #dc2626;
}
.algo-result {
  margin-top: 1rem;
  padding: 0.9rem 1.2rem;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
}
.algo-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 14px;
  overflow: hidden;
  margin: 2rem 0 3rem;
}
.algo-compare-col {
  padding: 1.6rem;
  background: rgba(99,102,241,0.02);
}
.algo-compare-col:first-child {
  border-right: 1px solid rgba(99,102,241,0.12);
}
.algo-compare-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6366f1 !important;
  margin-bottom: 1rem;
  display: block;
}
.algo-compare-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-family: 'Lora', serif;
  font-size: 1rem;
  color: #334155;
  line-height: 1.6;
  margin-bottom: 0.6rem;
}
.algo-compare-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6366f1;
  margin-top: 0.45rem;
  flex-shrink: 0;
}
.dark .algo-compare-col {
  background: rgba(99,102,241,0.04);
}
.dark .algo-compare-item {
  color: rgba(255,255,255,0.7);
}
.algo-machine {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 2rem 0 3rem;
  padding: 2rem;
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 14px;
  background: rgba(99,102,241,0.02);
}
.algo-executor {
  text-align: center;
  padding: 1rem 1.2rem;
  border: 1.5px solid rgba(99,102,241,0.25);
  border-radius: 12px;
  background: rgba(99,102,241,0.04);
  min-width: 90px;
  transition: all 0.2s ease;
}
.algo-executor:hover {
  border-color: #6366f1;
  background: rgba(99,102,241,0.08);
  transform: scale(1.04);
}
.algo-executor-icon {
  font-size: 2rem;
  margin-bottom: 0.4rem;
  display: block;
}
.algo-executor-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: #6366f1;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.algo-machine-center {
  text-align: center;
  padding: 0.6rem 1rem;
  background: #6366f1;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.1em;
}
.algo-arrow {
  font-size: 1.2rem;
  color: rgba(99,102,241,0.4);
  font-family: 'Inter', sans-serif;
}
.algo-class {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin: 2rem 0 1.5rem;
}
.algo-class-panel {
  border-radius: 14px;
  padding: 1.5rem 1.6rem;
}
.algo-class-panel.specific {
  border: 1px solid rgba(148,163,184,0.3);
  background: rgba(148,163,184,0.04);
}
.algo-class-panel.general {
  border: 1px solid rgba(99,102,241,0.3);
  background: rgba(99,102,241,0.05);
}
.algo-class-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}
.specific .algo-class-head {
  color: #94a3b8;
}
.general .algo-class-head {
  color: #6366f1;
}
.algo-formula {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  color: #0f172a;
  margin: 0.3rem 0 1rem;
  line-height: 1.7;
}
.dark .algo-formula {
  color: #e2e8f0;
}
.algo-var {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95em;
  font-weight: 600;
  color: #6366f1;
  background: rgba(99,102,241,0.1);
  border: 1.5px solid rgba(99,102,241,0.35);
  border-radius: 5px;
  padding: 0.05em 0.35em;
}
.algo-class-note {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 0;
}
.specific .algo-class-note {
  color: #94a3b8;
}
.general .algo-class-note {
  color: #64748b;
}
.dark .algo-class-panel.specific {
  border-color: rgba(148,163,184,0.15);
  background: rgba(148,163,184,0.03);
}
.dark .algo-class-panel.general {
  border-color: rgba(99,102,241,0.2);
  background: rgba(99,102,241,0.06);
}
.algo-instances {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin: 1.5rem 0 2.5rem;
}
.algo-instance-card {
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 12px;
  padding: 1.2rem 1rem;
  background: rgba(99,102,241,0.02);
  text-align: center;
  transition: all 0.2s ease;
}
.algo-instance-card:hover {
  border-color: rgba(99,102,241,0.32);
  background: rgba(99,102,241,0.06);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(99,102,241,0.08);
}
.algo-instance-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 0.8rem;
  display: block;
}
.algo-instance-values {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84rem;
  color: #334155;
  line-height: 1.9;
  margin-bottom: 0.6rem;
}
.dark .algo-instance-values {
  color: rgba(255,255,255,0.7);
}
.algo-instance-result {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 600;
  color: #6366f1;
  border-top: 1px solid rgba(99,102,241,0.15);
  padding-top: 0.5rem;
}
.dark .algo-instance-card {
  background: rgba(99,102,241,0.04);
}
.algo-bb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin: 2rem 0 1.5rem;
  padding: 2rem 1.5rem;
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 14px;
  background: rgba(99,102,241,0.02);
}
.algo-bb-side {
  min-width: 120px;
  text-align: center;
}
.algo-bb-side-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 0.65rem;
  display: block;
}
.algo-bb-item {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84rem;
  color: #334155;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(99,102,241,0.14);
  border-radius: 6px;
  margin: 0.25rem auto;
  display: inline-block;
  background: rgba(99,102,241,0.03);
}
.dark .algo-bb-item {
  color: rgba(255,255,255,0.7);
  background: rgba(99,102,241,0.06);
}
.algo-bb-center {
  padding: 1.3rem 1.8rem;
  background: #1e1b4b;
  border: 1.5px solid #6366f1;
  border-radius: 12px;
  text-align: center;
  min-width: 150px;
}
.algo-bb-center-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #a5b4fc;
  margin-bottom: 0.5rem;
  display: block;
}
.algo-bb-center-formula {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: #e2e8f0;
  font-weight: 600;
}
.algo-bb-arrow {
  font-size: 1.6rem;
  color: rgba(99,102,241,0.4);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
}
.dark .algo-compare {
  border-color: rgba(99,102,241,0.15);
}
.dark .algo-machine {
  border-color: rgba(99,102,241,0.12);
}
.dark .algo-bb {
  border-color: rgba(99,102,241,0.12);
  background: rgba(99,102,241,0.03);
}
.algo-code-block {
  background: #0d0f14;
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 12px;
  overflow: hidden;
  margin: 0;
}
.algo-code-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.algo-code-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.algo-code-dot.red {
  background: #ef4444;
  opacity: 0.75;
}
.algo-code-dot.yellow {
  background: #f59e0b;
  opacity: 0.75;
}
.algo-code-dot.green {
  background: #22c55e;
  opacity: 0.75;
}
.algo-code-block pre {
  margin: 0 !important;
  padding: 1.1rem 1.4rem !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.9rem !important;
  line-height: 1.85 !important;
  color: #e2e8f0 !important;
  background: transparent !important;
  overflow-x: auto !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.algo-code-block pre code {
  font-family: 'JetBrains Mono', monospace !important;
  background: transparent !important;
  color: #e2e8f0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: inherit !important;
  border: none !important;
  box-shadow: none !important;
}
.algo-code-kw {
  color: #a5b4fc;
}
.algo-code-num {
  color: #6ee7b7;
}
.algo-code-out {
  color: #f9a8d4;
}
.algo-equip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0 3rem;
  align-items: start;
}
.algo-equip-col {
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 14px;
  padding: 1.4rem;
  background: rgba(99,102,241,0.02);
}
.algo-equip-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 1rem;
}
.algo-equip-img {
  line-height: 0;
}
.algo-equip-img img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}
.dark .algo-equip-col {
  background: rgba(99,102,241,0.04);
  border-color: rgba(99,102,241,0.12);
}
.fl-symbols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}
.fl-sym-card {
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.4rem;
  background: #fafafa;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.fl-sym-icon {
  flex-shrink: 0;
}
.fl-sym-name {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
  display: block;
  margin-bottom: 0.3rem;
}
.fl-sym-pseudo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #6366f1 !important;
  background: rgba(99,102,241,0.08);
  border-radius: 4px;
  padding: 2px 6px;
  display: inline-block;
  margin-bottom: 0.4rem;
}
.fl-sym-desc {
  font-size: 0.87rem;
  color: #374151 !important;
  line-height: 1.5;
}
.fl-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
  margin: 2rem 0;
}
.fl-pair-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6366f1 !important;
  margin-bottom: 0.6rem;
  display: block;
}
.fl-img-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  padding: 1rem;
  text-align: center;
}
.fl-img-wrap img {
  max-width: 100%;
  border-radius: 6px;
}
.fl-steps {
  counter-reset: fl-step;
  margin: 2rem 0;
}
.fl-step {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 1.4rem;
  align-items: flex-start;
}
.fl-step-num {
  counter-increment: fl-step;
  background: #6366f1;
  color: #fff !important;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.fl-step-body {
  font-size: 0.95rem;
  color: #1e293b !important;
  line-height: 1.6;
}
.fl-step-body strong {
  color: #0f172a;
}
.is-pass {
  margin: 1rem 0 1.5rem;
}
.is-pass-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  color: #6366f1;
  font-weight: 700;
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.is-arr {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  margin: .3rem 0;
}
.is-cell {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.1rem;
  border: 2px solid transparent;
  flex-direction: column;
}
.is-cell .is-idx {
  font-size: .62rem;
  font-weight: 400;
}
.is-cell.sorted {
  background: #dcfce7;
  border-color: #22c55e;
  color: #14532d;
}
.is-cell.sorted .is-idx {
  color: #86efac;
}
.is-cell.key {
  background: #6366f1;
  border-color: #4338ca;
  color: white;
}
.is-cell.key .is-idx {
  color: #c7d2fe;
}
.is-cell.neutral {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}
.is-cell.neutral .is-idx {
  color: #94a3b8;
}
.is-cell.shifting {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}
.is-arr-label {
  font-size: .76rem;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
  margin: .15rem 0 .6rem;
}
.is-trace {
  overflow-x: auto;
  margin: 1.25rem 0;
}
.is-trace table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
}
.is-trace th {
  background: #4338ca;
  color: white;
  padding: .5rem .75rem;
  text-align: center;
}
.is-trace td {
  padding: .45rem .75rem;
  text-align: center;
  border-bottom: 1px solid #e0e7ff;
}
.is-trace tr:nth-child(even) td {
  background: #f5f3ff;
}
.is-trace tr.done-row td {
  background: #dcfce7;
  color: #14532d;
  font-weight: 700;
}
.is-three {
  overflow-x: auto;
  margin: 1.5rem 0;
}
.is-three table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.is-three th {
  background: #312e81;
  color: white;
  padding: .55rem 1rem;
  text-align: left;
}
.is-three td {
  padding: .5rem 1rem;
  border-bottom: 1px solid #e0e7ff;
}
.is-three tr:nth-child(odd) td {
  background: #f5f3ff;
}
.is-green {
  color: #16a34a;
  font-weight: 700;
}
.is-yellow {
  color: #d97706;
  font-weight: 700;
}
.is-red {
  color: #dc2626;
}
.is-best {
  background: linear-gradient(135deg,#14532d,#16a34a);
  border-radius: 12px;
  padding: 1.5rem;
  color: white;
  margin: 1.5rem 0;
}
.is-best h3 {
  color: white !important;
  margin: 0 0 .5rem;
  font-family: 'Playfair Display',serif;
}
.is-best p {
  color: #bbf7d0;
  margin: .4rem 0;
  font-size: .9rem;
}
.is-best .is-big {
  font-size: 2rem;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  color: white;
  display: block;
}
.lb-ops {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}
.lb-op-card {
  border-radius: 12px;
  padding: 1.5rem 1.2rem;
  text-align: center;
  border: 1.5px solid transparent;
}
.lb-op-card.and {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.lb-op-card.or {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.lb-op-card.not {
  background: #fdf4ff;
  border-color: #e9d5ff;
}
.lb-op-symbol {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 900;
  display: block;
  margin-bottom: 0.5rem;
}
.lb-op-card.and .lb-op-symbol {
  color: #1d4ed8;
}
.lb-op-card.or .lb-op-symbol {
  color: #15803d;
}
.lb-op-card.not .lb-op-symbol {
  color: #7c3aed;
}
.lb-op-rule {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.7rem;
}
.lb-op-card.and .lb-op-rule {
  color: #1d4ed8;
}
.lb-op-card.or .lb-op-rule {
  color: #15803d;
}
.lb-op-card.not .lb-op-rule {
  color: #7c3aed;
}
.lb-op-desc {
  font-size: 0.88rem;
  color: #374151 !important;
  line-height: 1.5;
}
.lb-tt {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0 1.8rem;
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
}
.lb-tt th {
  background: #1e293b;
  color: #e2e8f0 !important;
  padding: 0.55rem 1rem;
  font-weight: 600;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}
.lb-tt td {
  padding: 0.5rem 1rem;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b !important;
}
.lb-tt tr:last-child td {
  border-bottom: none;
}
.lb-tt tr:nth-child(even) td {
  background: #f8fafc;
}
.lb-true {
  color: #15803d !important;
  font-weight: 700;
}
.lb-false {
  color: #ef4444 !important;
  font-weight: 700;
}
.lb-cmp {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin: 1.5rem 0;
}
.lb-cmp-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.8rem;
  text-align: center;
}
.lb-cmp-sym {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: #6366f1;
  display: block;
  margin-bottom: 0.2rem;
}
.lb-cmp-desc {
  font-size: 0.78rem;
  color: #64748b !important;
}
.lb-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin: 1.5rem 0;
}
.lb-range-card {
  border-radius: 10px;
  padding: 1.2rem;
  border: 1.5px solid transparent;
}
.lb-range-card.inside {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.lb-range-card.outside {
  background: #fef2f2;
  border-color: #fecaca;
}
.lb-range-title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  display: block;
  margin-bottom: 0.6rem;
}
.lb-range-card.inside .lb-range-title {
  color: #15803d;
}
.lb-range-card.outside .lb-range-title {
  color: #b91c1c;
}
.py-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 2.5rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid #e2e8f0;
}
.py-step {
  padding: 1.5rem 1.2rem;
  border-right: 1px solid #e2e8f0;
  position: relative;
}
.py-step:last-child {
  border-right: none;
}
.py-step.s1 {
  background: #eff6ff;
}
.py-step.s2 {
  background: #f0fdf4;
}
.py-step.s3 {
  background: #fefce8;
}
.py-step.s4 {
  background: #fdf4ff;
}
.py-step-num {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  display: block;
  margin-bottom: 0.3rem;
}
.py-step.s1 .py-step-num {
  color: #1d4ed8;
}
.py-step.s2 .py-step-num {
  color: #15803d;
}
.py-step.s3 .py-step-num {
  color: #a16207;
}
.py-step.s4 .py-step-num {
  color: #7c3aed;
}
.py-step-name {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: block;
  margin-bottom: 0.6rem;
}
.py-step.s1 .py-step-name {
  color: #1d4ed8;
}
.py-step.s2 .py-step-name {
  color: #15803d;
}
.py-step.s3 .py-step-name {
  color: #a16207;
}
.py-step.s4 .py-step-name {
  color: #7c3aed;
}
.py-step-desc {
  font-size: 0.82rem;
  color: #374151 !important;
  line-height: 1.5;
}
.py-apply {
  border-radius: 12px;
  overflow: hidden;
  margin: 2rem 0;
  border: 1.5px solid #e2e8f0;
}
.py-apply-header {
  padding: 0.8rem 1.3rem;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.py-apply-header.s1 {
  background: #eff6ff;
  color: #1d4ed8;
}
.py-apply-header.s2 {
  background: #f0fdf4;
  color: #15803d;
}
.py-apply-header.s3 {
  background: #fefce8;
  color: #a16207;
}
.py-apply-header.s4 {
  background: #fdf4ff;
  color: #7c3aed;
}
.py-apply-body {
  background: #fafafa;
  padding: 1.2rem 1.5rem;
  font-size: 0.9rem;
  color: #1e293b !important;
  line-height: 1.7;
}
.py-trace {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
}
.py-trace th {
  background: #1e293b;
  color: #e2e8f0 !important;
  padding: 0.55rem 1rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
}
.py-trace td {
  padding: 0.5rem 1rem;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b !important;
}
.py-trace tr:last-child td {
  border-bottom: none;
}
.py-trace tr:nth-child(even) td {
  background: #f8fafc;
}
.py-trace .py-cond-true {
  color: #15803d !important;
  font-weight: 700;
}
.py-trace .py-cond-false {
  color: #ef4444 !important;
  font-weight: 700;
}
.py-trace .py-out {
  color: #6366f1 !important;
  font-weight: 700;
}
.py-trace-template {
  background: #f8fafc;
  border: 1.5px dashed #6366f1;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.py-trace-template-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6366f1 !important;
  margin-bottom: 1rem;
  display: block;
}
.cb pre code .cb-str {
  color: #fcd34d !important;
}
.pa-pattern {
  margin: 2.5rem 0;
}
.pa-pattern-title {
  background: linear-gradient(90deg,#312e81,#4338ca);
  border-radius: 10px 10px 0 0;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.pa-pattern-title .pa-num {
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.pa-pattern-title h3 {
  color: white !important;
  margin: 0;
  font-size: 1.1rem;
}
.pa-pattern-title .pa-complexity {
  margin-left: auto;
  background: rgba(255,255,255,.1);
  border-radius: 6px;
  padding: .2rem .6rem;
  color: #c7d2fe;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
}
.pa-pattern-body {
  border: 2px solid #4338ca;
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 1.25rem;
}
.pa-arr {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
  margin: .75rem 0;
}
.pa-cell {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.1rem;
  border: 2px solid transparent;
  flex-direction: column;
  gap: 2px;
}
.pa-cell .pa-val {
  font-size: 1rem;
}
.pa-cell .pa-ptr {
  font-size: .62rem;
  font-weight: 700;
}
.pa-cell.neutral {
  background: #ede9fe;
  border-color: #a5b4fc;
  color: #3730a3;
}
.pa-cell.neutral .pa-ptr {
  color: transparent;
}
.pa-cell.left-ptr {
  background: #fee2e2;
  border-color: #ef4444;
  color: #7f1d1d;
}
.pa-cell.left-ptr .pa-ptr {
  color: #ef4444;
}
.pa-cell.right-ptr {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1e3a5f;
}
.pa-cell.right-ptr .pa-ptr {
  color: #3b82f6;
}
.pa-cell.both-ptr {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #14532d;
}
.pa-cell.both-ptr .pa-ptr {
  color: #22c55e;
}
.pa-cell.window {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}
.pa-arr-label {
  text-align: center;
  font-size: .78rem;
  font-family: 'JetBrains Mono', monospace;
  color: #64748b;
  margin: .2rem 0 .75rem;
}
.pa-freq {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: .75rem 0;
}
.pa-freq-cell {
  min-width: 52px;
  border-radius: 6px;
  padding: .4rem .6rem;
  text-align: center;
  background: #ede9fe;
  border: 2px solid #a5b4fc;
}
.pa-freq-cell .pa-fc-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
  font-weight: 700;
  color: #4338ca;
}
.pa-freq-cell .pa-fc-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 900;
  color: #312e81;
}
.pa-guide {
  background: #0f172a;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.pa-guide-title {
  color: #a5b4fc;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: .75rem;
}
.pa-guide-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem 1rem;
  margin: .4rem 0;
  font-size: .85rem;
}
.pa-guide-row .pa-signal {
  color: #fbbf24;
  font-family: 'JetBrains Mono', monospace;
}
.pa-guide-row .pa-result {
  color: #86efac;
  font-family: 'JetBrains Mono', monospace;
}
.dark .pa-cell.neutral {
  background: #1e1b4b;
  border-color: #6366f1;
  color: #a5b4fc;
}
.dark .pa-pattern-body {
  border-color: #4338ca;
}
.dark .pa-guide {
  background: #0a111f;
}
.qr-polya {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 2rem 0 3rem;
}
.qr-step {
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 14px;
  padding: 1.4rem 1.2rem;
  background: rgba(99,102,241,0.03);
  text-align: center;
}
.qr-step-num {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: rgba(99,102,241,0.25);
  line-height: 1;
  margin-bottom: 0.4rem;
}
.qr-step-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6366f1 !important;
  margin-bottom: 0.5rem;
}
.qr-step-desc {
  font-family: 'Lora', serif;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}
.dark .qr-step {
  background: rgba(99,102,241,0.05);
  border-color: rgba(99,102,241,0.15);
}
.dark .qr-step-desc {
  color: #64748b;
}
.qr-problema {
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 16px;
  margin: 2.5rem 0;
  overflow: hidden;
}
.qr-problema-header {
  background: rgba(99,102,241,0.07);
  padding: 1.2rem 1.8rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid rgba(99,102,241,0.12);
}
.dark .qr-problema-header {
  background: rgba(99,102,241,0.1);
}
.qr-problema-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: #6366f1;
  color: #fff !important;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
}
.qr-problema-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.dark .qr-problema-title {
  color: #f1f5f9;
}
.qr-problema-body {
  padding: 1.6rem 1.8rem;
}
.qr-passo {
  margin: 1.8rem 0;
}
.qr-passo-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6366f1 !important;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.qr-passo-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(99,102,241,0.15);
}
.qr-variante {
  background: rgba(99,102,241,0.04);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 12px;
  padding: 1.3rem 1.6rem;
  margin: 1.5rem 0;
}
.qr-variante-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6366f1 !important;
  margin-bottom: 0.5rem;
}
.qr-variante p {
  margin: 0;
  color: #475569 !important;
  font-size: 0.9rem;
}
.dark .qr-variante p {
  color: #94a3b8 !important;
}
.dark .qr-variante {
  background: rgba(99,102,241,0.05);
  border-color: rgba(99,102,241,0.12);
}
.ps-problem {
  margin: 2.5rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #4338ca;
}
.ps-problem-header {
  background: linear-gradient(90deg,#1e1b4b,#312e81);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.ps-problem-header .ps-pnum {
  background: #6366f1;
  border-radius: 8px;
  padding: .25rem .6rem;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.ps-problem-header h3 {
  color: white !important;
  margin: 0;
  font-size: 1.05rem;
}
.ps-problem-header .ps-complexity {
  margin-left: auto;
  color: #a5b4fc;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  flex-shrink: 0;
}
.ps-problem-body {
  padding: 1.25rem;
  background: white;
}
.ps-polya {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin: .75rem 0;
}
.ps-step {
  border-radius: 8px;
  padding: .75rem 1rem;
}
.ps-step.s1 {
  background: #ede9fe;
  border-left: 4px solid #6366f1;
}
.ps-step.s2 {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
}
.ps-step.s3 {
  background: #dcfce7;
  border-left: 4px solid #22c55e;
}
.ps-step.s4 {
  background: #fee2e2;
  border-left: 4px solid #ef4444;
}
.ps-step h4 {
  margin: 0 0 .3rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}
.ps-step.s1 h4 {
  color: #4338ca;
}
.ps-step.s2 h4 {
  color: #d97706;
}
.ps-step.s3 h4 {
  color: #16a34a;
}
.ps-step.s4 h4 {
  color: #dc2626;
}
.ps-step p {
  margin: 0;
  font-size: .85rem;
  line-height: 1.55;
}
.ps-trace {
  overflow-x: auto;
  margin: .75rem 0;
}
.ps-trace table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
}
.ps-trace th {
  background: #4338ca;
  color: white;
  padding: .4rem .6rem;
  text-align: center;
}
.ps-trace td {
  padding: .35rem .6rem;
  text-align: center;
  border-bottom: 1px solid #e0e7ff;
}
.ps-trace tr:nth-child(even) td {
  background: #f5f3ff;
}
.ps-trace .ps-highlight td {
  background: #dcfce7;
  font-weight: 700;
  color: #14532d;
}
.ps-sieve {
  display: grid;
  grid-template-columns: repeat(10,1fr);
  gap: 4px;
  margin: .75rem 0;
  max-width: 400px;
}
.ps-sieve-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: .78rem;
}
.ps-sieve-cell.prime {
  background: #6366f1;
  color: white;
}
.ps-sieve-cell.composite {
  background: #e2e8f0;
  color: #94a3b8;
  text-decoration: line-through;
}
.ps-sieve-cell.one {
  background: #fef3c7;
  color: #78350f;
}
.ps-decompose {
  background: #f5f3ff;
  border-radius: 10px;
  padding: 1.25rem;
  margin: 1rem 0;
}
.ps-decompose h4 {
  font-family: 'Playfair Display',serif;
  color: #4338ca;
  margin: 0 0 .5rem;
  font-size: 1rem;
}
.ps-decompose ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: .9rem;
}
.ps-decompose li {
  margin: .3rem 0;
}
.ps-constructs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  margin: 2rem 0;
}
.ps-card {
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
}
.ps-card-header {
  background: #1e293b;
  padding: 0.6rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #a5b4fc !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ps-card-header .ps-badge {
  font-size: 0.68rem;
  background: rgba(99,102,241,0.3);
  border-radius: 4px;
  padding: 2px 7px;
  color: #c7d2fe !important;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.ps-card pre {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 1rem 1.2rem !important;
  margin: 0 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.8rem !important;
  line-height: 1.65 !important;
  overflow-x: auto;
}
.ps-card pre code {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 1rem 1.2rem !important;
  margin: 0 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.8rem !important;
  line-height: 1.65 !important;
  overflow-x: auto;
}
.ps-indent-demo {
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
  margin: 1.8rem 0;
}
.ps-indent-demo br {
  display: none;
}
.ps-indent-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.83rem;
  padding: 0.15rem 1.5rem;
  line-height: 1.7;
  display: block;
}
.ps-indent-line.highlight {
  background: rgba(99,102,241,0.15);
  border-left: 2px solid #6366f1;
}
.ps-l0 {
  padding-left: 1.5rem;
}
.ps-l1 {
  padding-left: 3rem;
}
.ps-l2 {
  padding-left: 4.5rem;
}
.ps-equip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
  align-items: start;
}
.ps-equip-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6366f1 !important;
  margin-bottom: 0.5rem;
  display: block;
}
.ps-ref-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.88rem;
}
.ps-ref-table th {
  background: #6366f1;
  color: #fff !important;
  padding: 0.6rem 1rem;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}
.ps-ref-table td {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b !important;
}
.ps-ref-table tr:last-child td {
  border-bottom: none;
}
.ps-ref-table tr:nth-child(even) td {
  background: #f8fafc;
}
.ps-kw {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #6366f1 !important;
}
.qs-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #dc2626;
  color: white;
  border-radius: 20px;
  padding: .35rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.qs-tasks {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.qs-task {
  border-radius: 12px;
  border: 2px solid #e0e7ff;
  overflow: hidden;
}
.qs-task-header {
  background: #312e81;
  color: white;
  padding: .9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.qs-task-header .qs-tnum {
  background: #6366f1;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}
.qs-task-header h3 {
  color: white !important;
  margin: 0;
  font-size: .95rem;
}
.qs-task-body {
  padding: 1.25rem;
  background: white;
}
.qs-task-body p {
  margin: .5rem 0;
  font-size: .9rem;
}
.qs-results {
  overflow-x: auto;
  margin: 1.5rem 0;
}
.qs-results table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
}
.qs-results th {
  background: #4338ca;
  color: white;
  padding: .55rem 1rem;
  text-align: center;
}
.qs-results td {
  padding: .5rem 1rem;
  text-align: center;
  border-bottom: 1px solid #e0e7ff;
}
.qs-results tr:nth-child(odd) td {
  background: #f5f3ff;
}
.qs-results .qs-best {
  color: #16a34a;
  font-weight: 700;
}
.qs-results .qs-worst {
  color: #dc2626;
}
.qs-results .blank {
  color: #cbd5e1;
  font-style: italic;
}
.qs-analysis {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}
.qs-an-card {
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}
.qs-an-card.bubble {
  background: #fef3c7;
  border: 2px solid #f59e0b;
}
.qs-an-card.selection {
  background: #ede9fe;
  border: 2px solid #6366f1;
}
.qs-an-card.insertion {
  background: #dcfce7;
  border: 2px solid #22c55e;
}
.qs-an-card h4 {
  margin: 0 0 .4rem;
  font-family: 'Playfair Display', serif;
  font-size: .9rem;
}
.qs-an-card.bubble h4 {
  color: #92400e;
}
.qs-an-card.selection h4 {
  color: #3730a3;
}
.qs-an-card.insertion h4 {
  color: #14532d;
}
.qs-an-card p {
  font-size: .8rem;
  margin: .25rem 0;
}
.rb-vis {
  margin: 1.5rem 0;
}
.rb-arr {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  margin: .6rem 0;
}
.rb-cell {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  flex-direction: column;
  gap: 2px;
}
.rb-cell .rb-val {
  font-size: 1rem;
}
.rb-cell .rb-idx {
  font-size: .62rem;
  color: #94a3b8;
  font-weight: 400;
}
.rb-cell.neutral {
  background: #ede9fe;
  border-color: #a5b4fc;
  color: #3730a3;
}
.rb-cell.active {
  background: #6366f1;
  border-color: #4338ca;
  color: white;
}
.rb-cell.active .rb-idx {
  color: #c7d2fe;
}
.rb-cell.found {
  background: #22c55e;
  border-color: #16a34a;
  color: white;
}
.rb-cell.found .rb-idx {
  color: #bbf7d0;
}
.rb-cell.eliminated {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #94a3b8;
}
.rb-cell.eliminated .rb-idx {
  color: #cbd5e1;
}
.rb-step-label {
  text-align: center;
  font-size: .82rem;
  color: #64748b;
  font-family: "JetBrains Mono", monospace;
  margin: .25rem 0 .9rem;
}
.rb-arrow {
  text-align: center;
  color: #6366f1;
  font-size: 1.3rem;
  margin: .1rem 0;
}
.rb-ptrs {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  margin: .2rem 0;
}
.rb-ptr {
  width: 52px;
  text-align: center;
  font-size: .7rem;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
}
.rb-ptr.left {
  color: #ef4444;
}
.rb-ptr.right {
  color: #3b82f6;
}
.rb-ptr.mid {
  color: #6366f1;
}
.rb-ptr.empty {
  color: transparent;
}
.rb-cmp {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0;
}
.rb-cmp-card {
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.rb-cmp-card.linear {
  background: #fef3c7;
  border: 2px solid #f59e0b;
}
.rb-cmp-card.binary {
  background: #dcfce7;
  border: 2px solid #22c55e;
}
.rb-cmp-card h4 {
  margin: 0 0 .6rem;
  font-family: "Playfair Display", serif;
  font-size: 1rem;
}
.rb-cmp-card.linear h4 {
  color: #92400e;
}
.rb-cmp-card.binary h4 {
  color: #14532d;
}
.rb-cmp-card .rb-big {
  font-size: 1.6rem;
  font-weight: 900;
  font-family: "JetBrains Mono", monospace;
  display: block;
  margin: .3rem 0;
}
.rb-cmp-card.linear .rb-big {
  color: #b45309;
}
.rb-cmp-card.binary .rb-big {
  color: #16a34a;
}
.rb-cmp-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
  font-family: "JetBrains Mono", monospace;
  margin-top: .5rem;
}
.rb-cmp-card td {
  padding: .25rem .4rem;
  border-bottom: 1px solid rgba(0,0,0,.07);
}
.rb-cmp-card td:first-child {
  color: #64748b;
}
.rb-trace {
  overflow-x: auto;
  margin: 1.25rem 0;
}
.rb-trace table {
  width: 100%;
  border-collapse: collapse;
  font-family: "JetBrains Mono", monospace;
  font-size: .82rem;
}
.rb-trace th {
  background: #4338ca;
  color: white;
  padding: .5rem .75rem;
  text-align: center;
}
.rb-trace td {
  padding: .45rem .75rem;
  text-align: center;
  border-bottom: 1px solid #e0e7ff;
}
.rb-trace tr:nth-child(even) td {
  background: #f5f3ff;
}
.rb-trace tr.found-row td {
  background: #dcfce7;
  font-weight: 700;
  color: #14532d;
}
.rb-trace tr.not-found-row td {
  background: #fef2f2;
  color: #7f1d1d;
}
.rb-trace .rb-cond-pass {
  color: #16a34a;
  font-weight: 700;
}
.rb-trace .rb-cond-fail {
  color: #dc2626;
  font-weight: 700;
}
.rb-log {
  overflow-x: auto;
  margin: 1.25rem 0;
}
.rb-log table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  font-family: "JetBrains Mono", monospace;
}
.rb-log th {
  background: #312e81;
  color: white;
  padding: .5rem 1rem;
  text-align: left;
}
.rb-log td {
  padding: .45rem 1rem;
  border-bottom: 1px solid #e0e7ff;
}
.rb-log tr:nth-child(odd) td {
  background: #f5f3ff;
}
.rb-log .rb-highlight {
  color: #6366f1;
  font-weight: 700;
}
.rb-guess {
  background: linear-gradient(135deg,#312e81,#4338ca);
  border-radius: 12px;
  padding: 1.5rem;
  color: white;
  margin: 1.5rem 0;
}
.rb-guess h3 {
  color: white !important;
  margin: 0 0 .75rem;
  font-family: "Playfair Display",serif;
}
.rb-guess-steps {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .75rem;
}
.rb-guess-step {
  background: rgba(255,255,255,.1);
  border-radius: 6px;
  padding: .5rem .9rem;
  font-family: "JetBrains Mono", monospace;
  font-size: .85rem;
  display: flex;
  gap: .75rem;
  align-items: center;
}
.rb-guess-step .rb-g-q {
  color: #c7d2fe;
  flex: 1;
}
.rb-guess-step .rb-g-a {
  color: #bbf7d0;
  font-weight: 700;
}
.rb-guess-step .rb-g-n {
  background: rgba(255,255,255,.15);
  border-radius: 4px;
  padding: .1rem .4rem;
  color: #e0e7ff;
  min-width: 24px;
  text-align: center;
}
.rb-pass {
  margin: 1rem 0 1.5rem;
}
.rb-pass-label {
  font-family: "JetBrains Mono", monospace;
  font-size: .78rem;
  color: #6366f1;
  font-weight: 700;
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.rb-s-arr {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  margin: .3rem 0;
}
.rb-s-cell {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 1.1rem;
  border: 2px solid transparent;
}
.rb-s-cell.neutral {
  background: #ede9fe;
  border-color: #a5b4fc;
  color: #3730a3;
}
.rb-s-cell.mid {
  background: #6366f1;
  border-color: #4338ca;
  color: white;
  box-shadow: 0 0 0 3px #c7d2fe;
}
.rb-s-cell.eliminated {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #cbd5e1;
}
.rb-s-cell.found {
  background: #dcfce7;
  border-color: #22c55e;
  color: #14532d;
}
.rb-s-label {
  font-size: .76rem;
  color: #64748b;
  font-family: "JetBrains Mono", monospace;
  margin: .15rem 0 .6rem;
}
.dark .rb-trace td {
  border-bottom-color: #1e293b;
  color: #e2e8f0;
}
.dark .rb-trace tr:nth-child(even) td {
  background: #1e1b4b;
}
.dark .rb-trace tr.found-row td {
  background: #052e16;
  color: #86efac;
}
.dark .rb-trace tr.not-found-row td {
  background: #200a0a;
  color: #fca5a5;
}
.dark .rb-log td {
  border-bottom-color: #1e293b;
  color: #e2e8f0;
}
.dark .rb-log tr:nth-child(odd) td {
  background: #1e1b4b;
}
.dark .rb-cmp-card.linear {
  background: #1c1400;
  border-color: #d97706;
}
.dark .rb-cmp-card.linear h4 {
  color: #fbbf24;
}
.dark .rb-cmp-card.linear .rb-big {
  color: #fbbf24;
}
.dark .rb-cmp-card.linear p {
  color: #fde68a;
}
.dark .rb-cmp-card.binary {
  background: #052e16;
  border-color: #16a34a;
}
.dark .rb-cmp-card.binary h4 {
  color: #4ade80;
}
.dark .rb-cmp-card.binary .rb-big {
  color: #4ade80;
}
.dark .rb-cmp-card.binary p {
  color: #bbf7d0;
}
.dark .rb-cmp-card td {
  color: #e2e8f0;
  border-bottom-color: rgba(255,255,255,.07);
}
.dark .rb-cmp-card td:first-child {
  color: #94a3b8;
}
.dark .rb-pass-label {
  color: #818cf8;
}
.dark .rb-s-cell.neutral {
  background: #1e1b4b;
  border-color: #4338ca;
  color: #c7d2fe;
}
.dark .rb-s-cell.mid {
  background: #4f46e5;
  border-color: #818cf8;
  color: white;
  box-shadow: 0 0 0 3px #312e81;
}
.dark .rb-s-cell.eliminated {
  background: #1e293b;
  border-color: #334155;
  color: #475569;
}
.dark .rb-s-cell.found {
  background: #052e16;
  border-color: #22c55e;
  color: #86efac;
}
.dark .rb-s-label {
  color: #64748b;
}
.rb-flowchart {
  text-align: center;
  margin: 2rem 0;
}
.rb-flowchart-img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid #e0e7ff;
  box-shadow: 0 4px 24px rgba(99,102,241,.10);
}
.dark .rb-flowchart-img {
  border-color: #312e81;
  box-shadow: 0 4px 24px rgba(99,102,241,.20);
}
.rb-flowchart-caption {
  font-family: 'JetBrains Mono',monospace;
  font-size: 0.78rem;
  color: #6366f1;
  margin-top: 0.75rem;
  font-style: italic;
}
.dark .rb-flowchart-caption {
  color: #818cf8;
}
.rl-trace {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.85rem;
  font-family: 'JetBrains Mono',monospace;
}
.rl-trace th {
  background: #1e293b;
  color: #e2e8f0 !important;
  padding: 0.5rem 0.9rem;
  text-align: center;
  font-weight: 600;
}
.rl-trace td {
  padding: 0.45rem 0.9rem;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b !important;
}
.rl-trace tr:last-child td {
  border-bottom: none;
}
.rl-trace tr:nth-child(even) td {
  background: #f8fafc;
}
.rl-true {
  color: #15803d !important;
  font-weight: 700;
}
.rl-false {
  color: #ef4444 !important;
  font-weight: 700;
}
.rl-out {
  color: #6366f1 !important;
  font-weight: 700;
}
.rl-complexity {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1rem;
  margin: 2rem 0;
}
.rl-comp-card {
  border-radius: 10px;
  padding: 1.2rem;
  text-align: center;
  border: 1.5px solid transparent;
}
.rl-comp-card.best {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.rl-comp-card.worst {
  background: #fef2f2;
  border-color: #fecaca;
}
.rl-comp-card.avg {
  background: #fefce8;
  border-color: #fde68a;
}
.rl-comp-label {
  font-family: 'Inter',sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.4rem;
}
.rl-comp-card.best .rl-comp-label {
  color: #15803d;
}
.rl-comp-card.worst .rl-comp-label {
  color: #b91c1c;
}
.rl-comp-card.avg .rl-comp-label {
  color: #a16207;
}
.rl-comp-val {
  font-family: 'JetBrains Mono',monospace;
  font-size: 1.4rem;
  font-weight: 700;
  display: block;
  margin-bottom: 0.3rem;
}
.rl-comp-card.best .rl-comp-val {
  color: #15803d;
}
.rl-comp-card.worst .rl-comp-val {
  color: #b91c1c;
}
.rl-comp-card.avg .rl-comp-val {
  color: #a16207;
}
.rl-comp-desc {
  font-size: 0.82rem;
  color: #374151 !important;
  line-height: 1.4;
}
.dark .rl-trace th {
  background: #1e293b;
  color: #e2e8f0 !important;
}
.dark .rl-trace td {
  color: #e2e8f0 !important;
  border-bottom-color: #1e293b;
}
.dark .rl-trace tr:nth-child(even) td {
  background: #1e1b4b;
}
.dark .rl-comp-card.best {
  background: #052e16;
  border-color: #22c55e;
}
.dark .rl-comp-card.worst {
  background: #200a0a;
  border-color: #ef4444;
}
.dark .rl-comp-card.avg {
  background: #1c1400;
  border-color: #d97706;
}
.dark .rl-comp-desc {
  color: #94a3b8 !important;
}
.rl-flowchart {
  text-align: center;
  margin: 2rem 0;
}
.rl-flowchart-img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid #d1fae5;
  box-shadow: 0 4px 24px rgba(16,185,129,.10);
}
.dark .rl-flowchart-img {
  border-color: #064e3b;
  box-shadow: 0 4px 24px rgba(16,185,129,.20);
}
.rl-flowchart-caption {
  font-family: 'JetBrains Mono',monospace;
  font-size: 0.78rem;
  color: #10b981;
  margin-top: 0.75rem;
  font-style: italic;
}
.dark .rl-flowchart-caption {
  color: #34d399;
}
.sr-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #4338ca;
  color: white;
  border-radius: 20px;
  padding: .35rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.sr-scenarios {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 1.5rem 0;
}
.sr-scenario {
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #e0e7ff;
}
.sr-scenario-header {
  background: #312e81;
  color: white;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.sr-scenario-header .sr-num {
  background: #6366f1;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  flex-shrink: 0;
}
.sr-scenario-header h3 {
  color: white !important;
  margin: 0;
  font-size: 1rem;
}
.sr-scenario-body {
  padding: 1.25rem;
  background: white;
}
.sr-context {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin: .75rem 0 1rem;
}
.sr-ctx-item {
  background: #f5f3ff;
  border-radius: 6px;
  padding: .6rem .9rem;
  font-size: .82rem;
}
.sr-ctx-item .sr-ctx-label {
  font-family: 'JetBrains Mono', monospace;
  color: #6366f1;
  font-weight: 700;
  font-size: .72rem;
  display: block;
  margin-bottom: .15rem;
}
.sr-question {
  background: #fef3c7;
  border-radius: 8px;
  padding: .75rem 1rem;
  margin: .75rem 0;
  font-weight: 600;
  color: #78350f;
}
.sr-answer {
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: .75rem;
}
.sr-answer.linear {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
}
.sr-answer.binary {
  background: #dcfce7;
  border-left: 4px solid #22c55e;
}
.sr-answer.either {
  background: #e0f2fe;
  border-left: 4px solid #0ea5e9;
}
.sr-answer .sr-choice {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  display: block;
  margin-bottom: .4rem;
}
.sr-answer.linear .sr-choice {
  color: #92400e;
}
.sr-answer.binary .sr-choice {
  color: #14532d;
}
.sr-answer.either .sr-choice {
  color: #075985;
}
.sr-why {
  font-size: .88rem;
  line-height: 1.6;
}
.sr-tree {
  background: #0f172a;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
  line-height: 1.9;
}
.sr-tree .t-q {
  color: #fbbf24;
}
.sr-tree .t-yes {
  color: #86efac;
}
.sr-tree .t-no {
  color: #fca5a5;
}
.sr-tree .t-result-lin {
  color: #fde68a;
  font-weight: 700;
}
.sr-tree .t-result-bin {
  color: #bbf7d0;
  font-weight: 700;
}
.sr-tree .t-result-either {
  color: #bae6fd;
  font-weight: 700;
}
.sr-table {
  overflow-x: auto;
  margin: 1.5rem 0;
}
.sr-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.sr-table th {
  background: #4338ca;
  color: white;
  padding: .6rem 1rem;
  text-align: left;
}
.sr-table td {
  padding: .5rem 1rem;
  border-bottom: 1px solid #e0e7ff;
}
.sr-table tr:nth-child(even) td {
  background: #f5f3ff;
}
.sr-table .sr-yes {
  color: #16a34a;
  font-weight: 700;
}
.sr-table .sr-no {
  color: #dc2626;
  font-weight: 700;
}
.sr-table .sr-neutral {
  color: #64748b;
}
.sr-exercises {
  margin: 1.5rem 0;
}
.sr-ex {
  background: #f5f3ff;
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin: .75rem 0;
  border-left: 4px solid #6366f1;
}
.sr-ex .sr-ex-n {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #6366f1;
  font-size: .82rem;
  display: block;
  margin-bottom: .3rem;
}
.sr-ex p {
  margin: 0;
  font-size: .92rem;
}
.ss-cell .ss-idx {
  font-size: .62rem;
  font-weight: 400;
}
.ss-cell.neutral .ss-idx {
  color: #94a3b8;
}
.ss-cell.current {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}
.ss-cell.current .ss-idx {
  color: #d97706;
}
.ss-cell.minpos {
  background: #fee2e2;
  border-color: #ef4444;
  color: #7f1d1d;
}
.ss-cell.minpos .ss-idx {
  color: #ef4444;
}
.ss-cell.sorted {
  background: #dcfce7;
  border-color: #22c55e;
  color: #14532d;
}
.ss-cell.sorted .ss-idx {
  color: #86efac;
}
.ss-trace tr.sorted-row td {
  background: #dcfce7;
  color: #14532d;
  font-weight: 700;
}
.ss-trace .ss-swap {
  color: #dc2626;
  font-weight: 700;
}
.ss-trace .ss-noswap {
  color: #94a3b8;
}
.ss-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.ss-cmp-card {
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.ss-cmp-card.bubble {
  background: #fef3c7;
  border: 2px solid #f59e0b;
}
.ss-cmp-card.selection {
  background: #ede9fe;
  border: 2px solid #6366f1;
}
.ss-cmp-card h4 {
  margin: 0 0 .5rem;
  font-family: 'Playfair Display', serif;
  font-size: .95rem;
}
.ss-cmp-card.bubble h4 {
  color: #92400e;
}
.ss-cmp-card.selection h4 {
  color: #3730a3;
}
.ss-cmp-card table {
  width: 100%;
  font-size: .82rem;
  border-collapse: collapse;
}
.ss-cmp-card td {
  padding: .25rem 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
  font-size: .8rem;
}
.ss-cmp-card td:first-child {
  color: #64748b;
  padding-right: .5rem;
}
.ss-green {
  color: #16a34a;
  font-weight: 700;
}
.ss-red {
  color: #dc2626;
  font-weight: 700;
}
.dark .ss-cell.neutral .ss-idx {
  color: #64748b;
}
.dark .ss-cell.current {
  background: #1c1400;
  border-color: #d97706;
  color: #fde68a;
}
.dark .ss-cell.current .ss-idx {
  color: #d97706;
}
.dark .ss-cell.minpos {
  background: #200a0a;
  border-color: #dc2626;
  color: #fca5a5;
}
.dark .ss-cell.minpos .ss-idx {
  color: #ef4444;
}
.dark .ss-cell.sorted {
  background: #052e16;
  border-color: #22c55e;
  color: #86efac;
}
.dark .ss-cell.sorted .ss-idx {
  color: #4ade80;
}
.dark .ss-trace tr.sorted-row td {
  background: #052e16;
  color: #86efac;
}
.dark .ss-cmp-card.bubble {
  background: #1c1400;
  border-color: #d97706;
}
.dark .ss-cmp-card.bubble h4 {
  color: #fbbf24;
}
.dark .ss-cmp-card.selection {
  background: #1e1b4b;
  border-color: #4338ca;
}
.dark .ss-cmp-card.selection h4 {
  color: #818cf8;
}
.dark .ss-cmp-card td {
  color: #e2e8f0;
  border-bottom-color: rgba(255,255,255,.07);
}
.dark .ss-cmp-card td:first-child {
  color: #94a3b8;
}
.ss-cell.checking {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}
.ss-cell.kept {
  background: #dcfce7;
  border-color: #22c55e;
  color: #14532d;
}
.ss-cell.discarded {
  background: #fee2e2;
  border-color: #ef4444;
  color: #7f1d1d;
  opacity: 0.6;
}
.ss-arrow {
  color: #ef4444;
  font-size: 1.1rem;
}
.ss-trace tr.kept-row td {
  background: #dcfce7;
  color: #14532d;
  font-weight: 700;
}
.ss-trace tr.discarded-row td {
  background: #fee2e2;
  color: #7f1d1d;
  font-weight: 700;
}
.ss-trace .kept-yes {
  color: #dc2626;
  font-weight: 700;
}
.ss-trace .kept-no {
  color: #94a3b8;
}
.ss-ops {
  background: #0f172a;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  color: white;
  font-family: 'JetBrains Mono', monospace;
}
.ss-ops-title {
  color: #a5b4fc;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .75rem;
}
.ss-ops-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: .4rem 0;
  font-size: .88rem;
}
.ss-ops-n {
  color: #fbbf24;
  min-width: 80px;
}
.ss-ops-bar {
  height: 16px;
  background: #6366f1;
  border-radius: 3px;
}
.ss-ops-val {
  color: #94a3b8;
}
.qr-strategia {
  border: 1px solid #e0e7ff;
  border-radius: 8px;
  margin: 1.2rem 0 1.5rem;
  overflow: hidden;
  background: #faf9ff;
}
.qr-strategia-header {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6366f1;
  padding: 0.6rem 1.2rem;
  background: #eeebff;
  border-bottom: 1px solid #e0e7ff;
}
.qr-strategia-top {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-bottom: 1px solid #e0e7ff;
}
.qr-strategia-cell {
  padding: 0.85rem 1.1rem;
  border-right: 1px solid #e0e7ff;
}
.qr-strategia-cell:last-child {
  border-right: none;
}
.qr-strategia-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6366f1;
  display: block;
  margin-bottom: 0.4rem;
}
.qr-strategia-cell ul {
  margin: 0;
  padding-left: 1rem;
}
.qr-strategia-cell li {
  margin: 0.2rem 0;
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.5;
}
.qr-strategia-analisi {
  padding: 0.85rem 1.1rem;
}
.qr-strategia-analisi > .qr-strategia-label {
  margin-bottom: 0.5rem;
}
.qr-strategia-analisi ol {
  margin: 0;
  padding-left: 1.25rem;
}
.qr-strategia-analisi li {
  margin: 0.35rem 0;
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.55;
}
.dark .qr-strategia {
  background: #0c0b18;
  border-color: #1e293b;
}
.dark .qr-strategia-header {
  background: #13112a;
  color: #818cf8;
  border-color: #1e293b;
}
.dark .qr-strategia-top {
  border-color: #1e293b;
}
.dark .qr-strategia-cell {
  border-color: #1e293b;
}
.dark .qr-strategia-label {
  color: #818cf8;
}
.dark .qr-strategia-cell li,
.dark .qr-strategia-analisi li {
  color: #cbd5e1;
}
.dark .ss-cell.checking {
  background: #1c1400;
  border-color: #d97706;
  color: #fde68a;
}
.dark .ss-cell.kept {
  background: #052e16;
  border-color: #22c55e;
  color: #86efac;
}
.dark .ss-cell.discarded {
  background: #200a0a;
  border-color: #dc2626;
  color: #fca5a5;
}
.dark .ss-trace tr.kept-row td {
  background: #052e16;
  color: #86efac;
}
.dark .ss-trace tr.discarded-row td {
  background: #200a0a;
  color: #fca5a5;
}
.dark .ss-pass-chip {
  background: #1e293b;
}
.dark .ss-pass-chip.done {
  background: #14532d;
}
.tc-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #4338ca;
  color: white;
  border-radius: 20px;
  padding: .35rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: .5rem;
}
.tc-timer {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #dc2626;
  color: white;
  border-radius: 20px;
  padding: .35rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  margin-left: .5rem;
}
.tc-problem {
  margin: 2.5rem 0;
  border-radius: 12px;
  overflow: hidden;
}
.tc-problem-header {
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.tc-problem.p1 .tc-problem-header {
  background: linear-gradient(90deg,#1e3a5f,#1d4ed8);
}
.tc-problem.p2 .tc-problem-header {
  background: linear-gradient(90deg,#1e1b4b,#6d28d9);
}
.tc-problem.p3 .tc-problem-header {
  background: linear-gradient(90deg,#14532d,#15803d);
}
.tc-problem-header .tc-pnum {
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  font-weight: 900;
  flex-shrink: 0;
}
.tc-problem-header h3 {
  color: white !important;
  margin: 0;
  font-size: 1.1rem;
}
.tc-problem-header .tc-diff {
  margin-left: auto;
  background: rgba(255,255,255,.15);
  border-radius: 6px;
  padding: .2rem .6rem;
  color: rgba(255,255,255,.85);
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  flex-shrink: 0;
}
.tc-problem-body {
  border: 2px solid #e0e7ff;
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 1.5rem;
  background: white;
}
.tc-problem.p2 .tc-problem-body {
  border-color: #ddd6fe;
}
.tc-problem.p3 .tc-problem-body {
  border-color: #bbf7d0;
}
.tc-io {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}
.tc-io-box {
  border-radius: 8px;
  padding: .75rem 1rem;
}
.tc-io-box.input {
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
}
.tc-io-box.output {
  background: #f0fdf4;
  border: 1px solid #86efac;
}
.tc-io-box h4 {
  margin: 0 0 .4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  text-transform: uppercase;
  font-weight: 700;
}
.tc-io-box.input h4 {
  color: #6366f1;
}
.tc-io-box.output h4 {
  color: #16a34a;
}
.tc-io-box pre {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
  background: rgba(0,0,0,.03);
  padding: .5rem .75rem;
  border-radius: 5px;
}
.tc-examples {
  margin: 1rem 0;
}
.tc-example {
  background: #f8fafc;
  border-radius: 8px;
  padding: .75rem 1rem;
  margin: .5rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: .84rem;
  border-left: 3px solid #6366f1;
}
.tc-example .tc-ex-label {
  font-size: .72rem;
  color: #6366f1;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: .25rem;
}
.tc-constraints {
  background: #1e293b;
  border-radius: 8px;
  padding: .75rem 1rem;
  margin: .75rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  color: #94a3b8;
}
.tc-constraints .tc-cv {
  color: #a5b4fc;
}
.tc-polya {
  margin: 1.25rem 0;
}
.tc-polya-header {
  background: #312e81;
  color: white;
  padding: .6rem 1rem;
  border-radius: 8px 8px 0 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}
.tc-polya-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 2px solid #312e81;
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}
.tc-polya-cell {
  padding: .75rem 1rem;
  min-height: 80px;
  font-size: .85rem;
}
.tc-polya-cell.s1 {
  background: #f5f3ff;
  border-right: 1px solid #c4b5fd;
  border-bottom: 1px solid #c4b5fd;
}
.tc-polya-cell.s2 {
  background: #fefce8;
  border-bottom: 1px solid #fde68a;
}
.tc-polya-cell.s3 {
  background: #f0fdf4;
  border-right: 1px solid #bbf7d0;
}
.tc-polya-cell.s4 {
  background: #fef2f2;
}
.tc-polya-cell h5 {
  margin: 0 0 .3rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.tc-polya-cell.s1 h5 {
  color: #4338ca;
}
.tc-polya-cell.s2 h5 {
  color: #d97706;
}
.tc-polya-cell.s3 h5 {
  color: #16a34a;
}
.tc-polya-cell.s4 h5 {
  color: #dc2626;
}
.tc-polya-cell p {
  margin: 0;
  color: #94a3b8;
  font-style: italic;
  font-size: .82rem;
}
.tc-rubric {
  overflow-x: auto;
  margin: 1.5rem 0;
}
.tc-rubric table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.tc-rubric th {
  background: #312e81;
  color: white;
  padding: .55rem 1rem;
  text-align: left;
}
.tc-rubric td {
  padding: .5rem 1rem;
  border-bottom: 1px solid #e0e7ff;
}
.tc-rubric tr:nth-child(odd) td {
  background: #f5f3ff;
}
.tc-rubric td:last-child {
  font-weight: 700;
  text-align: right;
  color: #4338ca;
}
.vds-section {
  margin: 3.5rem 0;
}
.vds-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1.5px solid rgba(99,102,241,0.15);
}
.vds-section-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.vds-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.2;
}
.vds-section-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6366f1;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  white-space: nowrap;
}
.dark .vds-section-title {
  color: #f1f5f9;
}
.vds-code-block {
  position: relative;
  background: #0f1117;
  border: 1px solid rgba(99,102,241,0.2);
  border-left: 3px solid #6366f1;
  border-radius: 0 12px 12px 0;
  margin: 1.5rem 0;
  overflow: hidden;
}
.vds-code-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6366f1;
  padding: 0.65rem 1.2rem 0.4rem;
  border-bottom: 1px solid rgba(99,102,241,0.12);
}
.vds-code-block pre {
  margin: 0;
  padding: 1rem 1.4rem 1.2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.75;
  color: #e2e8f0;
  background: transparent;
  overflow-x: auto;
}
.vds-code-block code {
  font-family: 'JetBrains Mono', monospace;
  background: transparent;
  color: #e2e8f0;
}
.vds-code-comment {
  color: #64748b !important;
}
.vds-code-keyword {
  color: #a5b4fc !important;
}
.vds-code-init {
  color: #6ee7b7 !important;
}
.vds-code-bug {
  color: #f87171 !important;
}
.vds-code-fix {
  color: #6ee7b7 !important;
}
.vds-trace-wrap {
  margin: 1.5rem 0 2rem;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(99,102,241,0.15);
}
.vds-trace {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
}
.vds-trace thead tr {
  background: rgba(99,102,241,0.08);
}
.vds-trace th {
  padding: 0.55rem 1rem;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6366f1;
  border-bottom: 1px solid rgba(99,102,241,0.15);
}
.vds-trace td {
  padding: 0.45rem 1rem;
  text-align: center;
  color: #334155;
  border-bottom: 1px solid rgba(99,102,241,0.06);
  font-size: 0.85rem;
}
.vds-trace tbody tr:last-child td {
  border-bottom: none;
}
.vds-trace tbody tr:nth-child(even) {
  background: rgba(99,102,241,0.02);
}
.trace-init td {
  color: #94a3b8 !important;
  font-style: italic;
}
.trace-change {
  color: #6366f1 !important;
  font-weight: 600;
}
.trace-yes {
  color: #16a34a !important;
  font-weight: 600;
}
.trace-no {
  color: #dc2626 !important;
}
.trace-wrong-result td {
  background: rgba(220,38,38,0.06) !important;
}
.trace-right-result td {
  background: rgba(34,197,94,0.06) !important;
}
.dark .vds-trace th {
  color: #a5b4fc;
}
.dark .vds-trace td {
  color: rgba(255,255,255,0.7);
}
.dark .vds-trace thead tr {
  background: rgba(99,102,241,0.1);
}
.vds-init-toggle {
  margin: 2rem 0 3rem;
}
.vds-init-toggle input[type="checkbox"] {
  display: none;
}
.vds-init-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6366f1;
  border: 1.5px solid rgba(99,102,241,0.35);
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: all 0.18s ease;
  margin-bottom: 1.4rem;
}
.vds-init-label:hover {
  background: rgba(99,102,241,0.06);
  border-color: #6366f1;
}
.vds-init-toggle input:checked + .vds-init-label {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}
.vds-init-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  margin-bottom: 0.8rem;
}
.vds-panel-wrong {
  display: block;
}
.vds-panel-ok {
  display: none;
}
.vds-init-toggle input:checked ~ .vds-panel-wrong {
  display: none;
}
.vds-init-toggle input:checked ~ .vds-panel-ok {
  display: block;
}
.vds-result {
  margin-top: 1rem;
  padding: 0.9rem 1.2rem;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
}
.vds-warn {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  border: 1px solid rgba(220,38,38,0.25);
  border-left: 3px solid #dc2626;
  border-radius: 0 10px 10px 0;
  background: rgba(220,38,38,0.04);
  padding: 1rem 1.3rem;
  margin: 1.5rem 0;
}
.vds-warn-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.vds-warn-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: #7f1d1d;
  line-height: 1.6;
  margin: 0;
}
.vds-warn-text strong {
  color: #dc2626;
}
.dark .vds-warn-text {
  color: #fca5a5;
}
.vds-tip {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  border: 1px solid rgba(99,102,241,0.25);
  border-left: 3px solid #6366f1;
  border-radius: 0 10px 10px 0;
  background: rgba(99,102,241,0.04);
  padding: 1rem 1.3rem;
  margin: 1.5rem 0;
}
.vds-tip-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.vds-tip-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: #1e1b4b;
  line-height: 1.6;
  margin: 0;
}
.vds-tip-text strong {
  color: #6366f1;
}
.dark .vds-tip-text {
  color: #c7d2fe;
}
.vds-decide {
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 14px;
  overflow: hidden;
  margin: 2rem 0 3rem;
}
.vds-decide-head {
  background: rgba(99,102,241,0.07);
  padding: 1rem 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6366f1;
  border-bottom: 1px solid rgba(99,102,241,0.12);
}
.vds-decide-question {
  padding: 1rem 1.5rem 0.4rem;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-style: italic;
  color: #0f172a;
}
.dark .vds-decide-question {
  color: #e2e8f0;
}
.vds-decide-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 1.5rem 0.55rem 2rem;
  border-top: 1px solid rgba(99,102,241,0.06);
  transition: background 0.15s ease;
}
.vds-decide-row:hover {
  background: rgba(99,102,241,0.03);
}
.vds-decide-cond {
  font-family: 'Lora', serif;
  font-size: 0.9rem;
  color: #475569;
  min-width: 240px;
  flex-shrink: 0;
}
.dark .vds-decide-cond {
  color: #94a3b8;
}
.vds-decide-arrow {
  color: rgba(99,102,241,0.4);
  flex-shrink: 0;
}
.vds-decide-pattern {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: #6366f1;
}
.vds-decide-note {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-left: 0.3rem;
}
.dark .vds-code-block {
  background: #0a0c10;
  border-color: rgba(99,102,241,0.18);
}
.dark .vds-warn {
  background: rgba(220,38,38,0.06);
}
.dark .vds-tip {
  background: rgba(99,102,241,0.06);
}
.dark .vds-decide {
  border-color: rgba(99,102,241,0.16);
}
.dark .vds-decide-head {
  background: rgba(99,102,241,0.08);
}
.qr-def-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin: 2rem 0;
}
.qr-def-duo .qr-def {
  margin: 0;
}
.vt-anatomy {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}
.vt-part {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.2rem 1rem;
  text-align: center;
}
.vt-part-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.8rem;
  font-weight: 700;
  color: #6366f1;
  display: block;
  margin-bottom: 0.4rem;
}
.vt-part-name {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: #0f172a;
  display: block;
  margin-bottom: 0.3rem;
}
.vt-part-desc {
  font-size: 0.9rem;
  color: #374151 !important;
  line-height: 1.5;
}
.vt-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}
.vt-type-card {
  border-radius: 10px;
  padding: 1.2rem 1.3rem;
  border: 1.5px solid transparent;
}
.vt-type-card.int {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.vt-type-card.real {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.vt-type-card.str {
  background: #fefce8;
  border-color: #fde68a;
}
.vt-type-card.bool {
  background: #fdf4ff;
  border-color: #e9d5ff;
}
.vt-type-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  display: block;
  margin-bottom: 0.3rem;
}
.vt-type-card.int .vt-type-label {
  color: #1d4ed8;
}
.vt-type-card.real .vt-type-label {
  color: #15803d;
}
.vt-type-card.str .vt-type-label {
  color: #a16207;
}
.vt-type-card.bool .vt-type-label {
  color: #7c3aed;
}
.vt-type-desc {
  font-size: 0.88rem;
  color: #374151 !important;
  line-height: 1.5;
}
.vt-type-ex {
  margin-top: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #64748b !important;
}
.vt-op-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.vt-op-table th {
  background: #6366f1;
  color: #fff !important;
  padding: 0.6rem 1rem;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}
.vt-op-table td {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b !important;
}
.vt-op-table tr:last-child td {
  border-bottom: none;
}
.vt-op-table tr:nth-child(even) td {
  background: #f8fafc;
}
.vt-op-sym {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #6366f1 !important;
  font-size: 1.1rem;
}
.vt-naming {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin: 1.8rem 0;
}
.vt-naming-card {
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
}
.vt-naming-header {
  background: #1e293b;
  padding: 0.6rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: #a5b4fc !important;
}
.vt-naming-body {
  padding: 1rem 1.2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 2;
}
.vt-naming-bad {
  color: #f87171 !important;
}
.vt-naming-good {
  color: #6ee7b7 !important;
}
.vt-two-phase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin: 1.8rem 0;
  align-items: start;
}
.vt-phase-card {
  border-radius: 10px;
  padding: 1.2rem;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
}
.vt-phase-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  color: #6366f1;
  display: block;
  margin-bottom: 0.3rem;
}
.vt-phase-title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
  display: block;
  margin-bottom: 0.5rem;
}
.vt-phase-body {
  font-size: 0.9rem;
  color: #374151 !important;
  line-height: 1.6;
}
.qr-quiz {
  background: linear-gradient(135deg, rgba(99,102,241,0.07) 0%, rgba(139,92,246,0.05) 100%);
  border: 1.5px solid rgba(99,102,241,0.3);
  border-radius: 14px;
  padding: 2rem 2.5rem;
  margin: 2.5rem 0;
}
.qr-quiz-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6366f1 !important;
  display: block;
  margin-bottom: 1rem;
}
.qr-quiz-question {
  font-family: 'Lora', serif;
  font-size: 1rem;
  color: #1e293b !important;
  line-height: 1.75;
  margin-bottom: 1.5rem;
}
.qr-quiz-options {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.qr-quiz-options li {
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: #1e293b !important;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
}
.qr-quiz-options li:hover {
  border-color: rgba(99,102,241,0.4);
  background: rgba(99,102,241,0.04);
}
.qr-quiz.qr-answered .qr-quiz-options li {
  cursor: default;
}
.qr-quiz.qr-answered .qr-quiz-options li:hover {
  border-color: #e2e8f0;
  background: white;
}
.qr-quiz-options li.qr-opt-correct {
  border-color: #10b981;
  background: rgba(16,185,129,0.1);
  color: #064e3b !important;
  font-weight: 700;
}
.qr-quiz-options li.qr-opt-wrong {
  border-color: #ef4444;
  background: rgba(239,68,68,0.07);
  color: #b91c1c !important;
}
.qr-quiz-answer {
  display: none;
  border-top: 1px solid rgba(99,102,241,0.15);
  padding-top: 1rem;
  font-size: 0.9rem;
  color: #374151 !important;
  line-height: 1.65;
}
.qr-quiz.qr-answered .qr-quiz-answer {
  display: block;
}
.qr-def-formula {
  display: block;
  text-align: center;
  font-style: italic;
  font-size: 1.1em;
  font-family: 'Lora', Georgia, serif;
  padding-top: 0.3rem;
  letter-spacing: 0.03em;
}
.dark .vt-part {
  background: #1e293b;
  border-color: #334155;
}
.dark .vt-part-name {
  color: #e2e8f0;
}
.dark .vt-part-desc {
  color: #94a3b8 !important;
}
.dark .vt-type-card.int {
  background: #1e3a5f;
  border-color: #3b82f6;
}
.dark .vt-type-card.real {
  background: #14532d;
  border-color: #22c55e;
}
.dark .vt-type-card.str {
  background: #3d2b00;
  border-color: #d97706;
}
.dark .vt-type-card.bool {
  background: #3b0764;
  border-color: #a855f7;
}
.dark .vt-type-desc {
  color: #94a3b8 !important;
}
.dark .vt-type-ex {
  color: #64748b !important;
}
.dark .vt-phase-card {
  background: #1e293b;
  border-color: #334155;
}
.dark .vt-phase-title {
  color: #e2e8f0;
}
.dark .vt-phase-body {
  color: #94a3b8 !important;
}
.dark .vt-op-table td {
  color: #e2e8f0 !important;
  border-bottom-color: #1e293b;
}
.dark .vt-op-table tr:nth-child(even) td {
  background: #1e293b;
}
.dark .qr-quiz {
  background: rgba(99,102,241,0.08);
  border-color: rgba(99,102,241,0.3);
}
.dark .qr-quiz-question {
  color: #e2e8f0 !important;
}
.dark .qr-quiz-options li {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0 !important;
}
.dark .qr-quiz-options li:hover {
  border-color: rgba(99,102,241,0.45);
  background: rgba(99,102,241,0.08);
}
.dark .qr-quiz.qr-answered .qr-quiz-options li:hover {
  border-color: #334155;
  background: #1e293b;
}
.dark .qr-quiz-options li.qr-opt-correct {
  border-color: #10b981;
  background: rgba(16,185,129,0.13);
  color: #6ee7b7 !important;
}
.dark .qr-quiz-options li.qr-opt-wrong {
  border-color: #ef4444;
  background: rgba(239,68,68,0.1);
  color: #fca5a5 !important;
}
.dark .qr-quiz-answer {
  color: #94a3b8 !important;
  border-top-color: rgba(99,102,241,0.2);
}


/* ════════════════════════════════════════════════════════════════════
   Media query (deduplicate per query)
   ════════════════════════════════════════════════════════════════════ */


@media (max-width: 640px) {
  .qr-array-vis {
    gap: 0;
  }
  .qr-array-cell {
    min-width: 44px;
  }
  .algo-props {
    grid-template-columns: 1fr;
  }
  .algo-examples {
    grid-template-columns: 1fr;
  }
  .algo-compare {
    grid-template-columns: 1fr;
  }
  .algo-machine {
    flex-direction: column;
    gap: 0.8rem;
  }
  .algo-arrow {
    transform: rotate(90deg);
  }
  .algo-class {
    grid-template-columns: 1fr;
  }
  .algo-instances {
    grid-template-columns: 1fr;
  }
  .algo-bb {
    flex-direction: column;
  }
  .algo-bb-arrow {
    transform: rotate(90deg);
  }
  .algo-equip {
    grid-template-columns: 1fr;
  }
  .qr-polya {
    grid-template-columns: 1fr 1fr;
  }
  .vds-decide-row {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .vds-decide-cond {
    min-width: unset;
    width: 100%;
  }
  .vds-trace th {
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
  }
  .vds-trace td {
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 600px) {
  .bs-opt {
    grid-template-columns: 1fr;
  }
  .bs-cell {
    width: 38px;
    height: 38px;
    font-size: .9rem;
  }
  .ca-classes {
    grid-template-columns: 1fr;
  }
  .is-cell {
    width: 38px;
    height: 38px;
    font-size: .9rem;
  }
  .ps-polya {
    grid-template-columns: 1fr;
  }
  .qs-analysis {
    grid-template-columns: 1fr;
  }
  .rb-cmp {
    grid-template-columns: 1fr;
  }
  .rb-cell {
    width: 40px;
    height: 40px;
    font-size: .85rem;
  }
  .rb-ptr {
    width: 40px;
  }
  .sr-context {
    grid-template-columns: 1fr 1fr;
  }
  .ss-compare {
    grid-template-columns: 1fr;
  }
  .ss-cell {
    width: 38px;
    height: 38px;
    font-size: .9rem;
  }
  .tc-io {
    grid-template-columns: 1fr;
  }
  .tc-polya-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .qr-polya {
    grid-template-columns: 1fr;
  }
}
