/* ==========================================================================
   06 · BOʻLIM BLOKLARI — matn ichidagi koʻrgazmali qismlar
   ========================================================================== */

/* ---------- umumiy setkalar ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 22px; }

/* ---------- koʻrgazmali grafikalar (umumiy) ---------- */
[data-viz] svg,
.lab-viz svg,
.cmp-viz svg { width: 100%; height: auto; display: block; }
.tviz { width: 62px; }

/* ============ 1.2 — BUTUN TURLARI ============ */
.whole-card { text-align: center; position: relative; }
.whole-card h4 { font-size: 1.1rem; margin: 8px 0 10px; }
.whole-card p { font-size: .93rem; margin: 0; }
.whole-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.whole-viz { max-width: 120px; margin: 0 auto 12px; }

.set-viz {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 auto 12px;
  max-width: 190px;
}
.set-viz span {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 1.4rem;
  border-radius: 11px;
  background: var(--viz-empty);
  border: 2px solid var(--viz-stroke);
}
.set-viz.small { max-width: 220px; }
.set-viz span.on {
  background: color-mix(in srgb, var(--blue) 22%, var(--surface));
  border-color: var(--blue);
}

.formula-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  margin: 18px 0 6px;
  box-shadow: var(--elev-1);
}
.formula-strip span {
  padding: 10px 20px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: .03em;
}
.formula-strip i { font-style: normal; color: var(--violet); font-size: 1.3rem; font-weight: 900; }
.formula-strip .fs-final { background: var(--grad-brand); color: #fff; }

/* ============ 1.3 — KASR ANATOMIYASI ============ */
.anatomy-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 26px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--elev-1);
}
.anat-frac { display: grid; place-items: center; }
.anat-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.anat-legend li {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: .95rem;
}
.c-blue { color: var(--blue); }
.c-green { color: var(--green); }
.c-grey { color: var(--ink-2); }
.anat-viz { width: 130px; }

/* ============ 1.4 — TENG BOʻLAKLAR SHARTI ============ */
.warn {
  margin-top: 24px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--red) 8%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--red) 30%, var(--line));
  border-radius: var(--r-lg);
  padding: 24px;
}
.warn h3 { font-size: 1.2rem; }
.warn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 14px; }
.warn-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
}
.warn-item.ok { border-color: color-mix(in srgb, var(--green) 45%, transparent); }
.warn-item.bad { border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.warn-item p { margin: 0; font-size: .94rem; }
.wviz { width: 92px; flex-shrink: 0; }
.wviz svg { width: 100%; height: auto; display: block; }

/* ============ 1.5 — BITTA KASRNING TOʻRTTA QIYOFASI ============ */
.repr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}
.repr {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--elev-1);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.repr:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
  box-shadow: var(--elev-hover);
}
.repr-head { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.repr-head h4 { margin: 0; font-size: 1.12rem; }
.repr-n {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--grad-brand);
  color: #fff;
  font-size: .88rem;
  font-weight: 800;
}
.repr-viz {
  min-height: 118px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 14px;
}
.repr-viz > svg, .repr-viz > div { max-width: 230px; width: 100%; }
.repr-viz .set-viz { margin-bottom: 0; }
.repr p { font-size: .93rem; color: var(--ink-2); margin: 0 0 9px; }
.repr-def {
  background: color-mix(in srgb, var(--blue) 8%, var(--surface-2));
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 9px 13px;
  color: var(--ink) !important;
}
.repr-read {
  font-weight: 700;
  color: var(--green-dk) !important;
  background: color-mix(in srgb, var(--green) 10%, var(--surface-2));
  border-radius: var(--r-sm);
  padding: 8px 13px;
}
html[data-theme="dark"] .repr-read { color: #7ff0c6 !important; }
.repr-where {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: .87rem !important;
  margin-bottom: 0 !important;
}

.repr-note {
  margin-top: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--amber) 15%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--line));
  border-radius: var(--r-lg);
  padding: 20px 24px;
  font-size: 1rem;
}
.rn-q {
  display: block;
  margin-top: 9px;
  padding: 9px 14px;
  background: var(--surface);
  border-radius: var(--r-sm);
  font-weight: 700;
}
.rn-q u { text-decoration-color: var(--amber); text-underline-offset: 3px; }

/* ============ 1.7 — BOʻLAK KATTALIGI ============ */
.size-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--elev-1);
  margin-top: 14px;
}
.size-item { flex: 1 1 170px; text-align: center; max-width: 220px; }
.size-item > div { max-width: 120px; margin: 0 auto 8px; }
.size-item b { display: block; font-size: 1.35rem; color: var(--blue); }
/* "> span" — izoh matni; kasr ichidagi span larga tegmasin */
.size-item > span { font-size: .84rem; color: var(--ink-2); }
.size-gt { font-size: 2rem; font-weight: 900; color: var(--amber); }

/* ============ 1.8 — MAXSUS HOLATLAR ============ */
.special { text-align: center; }
.sp-eq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3em;
  font-size: 1.55rem;
  font-weight: 900;
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 14px 12px;
  margin-bottom: 12px;
  color: var(--violet);
}
.special p { font-size: .93rem; }
.sp-viz { max-width: 150px; margin: 10px auto 0; }

/* ============ 3-BOʻLIM — TAQQOSLASH ============ */
.cmp-row { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 14px 0; }
.cmp-side { text-align: center; flex: 1; }
.cmp-side > div { margin-bottom: 6px; }
.cmp-side b { font-size: 1.25rem; }
.cmp-sign { font-size: 2rem; font-weight: 900; color: var(--amber); }

.numberline-box {
  margin-top: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--elev-2);
  overflow-x: auto;
}
#numberLine svg { min-width: 560px; }

/* ============ 4-BOʻLIM — TENG KASRLAR ============ */
.equal-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--elev-1);
}
.eq-item { text-align: center; flex: 1 1 150px; }
.eq-item b { display: block; margin-top: 6px; font-size: 1.2rem; color: var(--blue); }
.eq-sign { font-size: 1.6rem; font-weight: 900; color: var(--green); }

/* ============ 5-BOʻLIM — KASR TURLARI ============ */
.type-card { text-align: center; }
.type-tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  margin-bottom: 14px;
}
.type-tag.ok { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green-dk); }
.type-tag.warn { background: color-mix(in srgb, var(--amber) 22%, transparent); color: var(--amber-dk); }
.type-tag.info { background: color-mix(in srgb, var(--violet) 18%, transparent); color: var(--violet); }
html[data-theme="dark"] .type-tag.ok { color: #7ff0c6; }
html[data-theme="dark"] .type-tag.warn { color: #ffd68a; }

/* Uchala kartochkada BUTUN bir xil kattalikda koʻrinishi shart —
   aks holda 3/4 va 7/4 ni taqqoslab boʻlmaydi. Shuning uchun ikkita
   doira chiziladigan kartochkaga ikki barobar joy beriladi. */
.type-viz { width: 122px; margin: 0 auto 12px; }
.type-viz.is-wide { width: 254px; }
.type-viz.is-mixed {
  display: grid;
  place-items: center;
  width: auto;
  min-height: 122px;
  font-size: 2.4rem;
}

.convert-box { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; }
.conv {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--elev-1);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease);
}
.conv:hover { transform: translateY(-4px); box-shadow: var(--elev-hover); }
.conv h3 { font-size: 1.12rem; }
.conv p { color: var(--ink-2); font-size: .95rem; }
.conv-steps { display: grid; gap: 8px; }
.conv-steps.wide { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.conv-steps > div {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-weight: 600;
}
/* "> span" — qadam raqami. Bevosita farzandga chegaralangan, chunki
   qadam matnidagi <b>13/5</b> ichidagi kasr ham <span> lardan iborat. */
.conv-steps > div > span:first-child {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--violet);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
}

/* ============ 6-BOʻLIM — AMALLAR ============ */
.eq-viz {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.eq-viz > div { width: 150px; }
.eq-viz > span { font-size: 1.5rem; font-weight: 900; color: var(--ink-2); }
