.av-topic .gt-nav,
.av-topic-layout .gt-nav {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.av-lab {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.av-lab-visual,
.av-exp-visual {
  min-height: 320px;
  padding: 18px;
  border: 1px solid rgba(190, 202, 222, 0.82);
  border-radius: 16px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.86)),
    repeating-linear-gradient(0deg, rgba(37, 99, 235, 0.055) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg, rgba(20, 184, 166, 0.05) 0 1px, transparent 1px 30px);
  overflow: hidden;
}

.av-area-lab,
.av-volume-lab,
.av-exp-floor,
.av-exp-box {
  display: grid;
  place-items: center;
  min-height: 280px;
}

.av-unit-grid,
.av-exp-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(18px, 1fr));
  grid-template-rows: repeat(var(--rows), minmax(18px, 1fr));
  gap: 4px;
  width: min(100%, calc(var(--cols) * 42px));
  padding: 10px;
  border-radius: 14px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}

.av-unit-grid i,
.av-exp-grid i {
  min-height: 22px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 6px;
  background: #dbeafe;
}

.av-cube-stack,
.av-exp-cubes {
  position: relative;
  display: grid;
  width: min(100%, calc(var(--cols) * 46px + var(--layers) * 18px));
  min-height: calc(var(--rows) * 38px + var(--layers) * 22px);
  margin: 28px auto;
}

.av-cube-stack section,
.av-exp-cubes section {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: repeat(var(--cols), 30px);
  gap: 5px;
  transform: translate(calc(var(--layer) * 16px), calc(var(--layer) * -18px));
}

.av-cube-stack i,
.av-exp-cubes i {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 45%),
    #60a5fa;
  box-shadow:
    inset -5px -5px rgba(30, 64, 175, 0.16),
    0 3px 0 rgba(30, 64, 175, 0.16);
}

.av-case-grid {
  grid-template-columns: repeat(3, minmax(270px, 1fr));
}

.av-case {
  display: grid;
  gap: 12px;
  min-height: 520px;
  padding: 14px;
  border: 1px solid rgba(190, 202, 222, 0.76);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(30, 41, 59, 0.05);
}

.av-case-head {
  display: grid;
  gap: 4px;
}

.av-case-head span {
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 950;
}

.av-case-head strong {
  color: #0f172a;
  font-size: 1.16rem;
  line-height: 1.2;
}

.av-case p {
  margin: 0;
  color: #64748b;
  line-height: 1.55;
}

.av-case-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.av-case-controls label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #334155;
  font-weight: 900;
}

.av-case-controls output {
  color: #0f172a;
  font-weight: 950;
}

.av-case-controls input {
  width: 100%;
}

.av-case-scene {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, #f8fafc, #eef6ff);
  overflow: hidden;
}

.av-case-scene b,
.av-exp-floor b,
.av-exp-box b {
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  color: #fff;
  background: #2563eb;
  font-weight: 950;
}

.av-case-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.av-case-metrics span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 12px;
  color: #64748b;
  background: #f8fafc;
  font-size: 0.74rem;
  font-weight: 900;
}

.av-case-metrics b {
  color: #0f172a;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.av-case-result {
  min-height: 62px;
  padding: 12px;
  border-radius: 14px;
  color: #254155;
  background: rgba(236, 253, 245, 0.85);
  font-weight: 850;
  line-height: 1.45;
}

.av-room-floor,
.av-garden-bed,
.av-rug,
.av-tablecloth,
.av-window-pane,
.av-shipping-box,
.av-storage-bin,
.av-drawer {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.floor-tiles i {
  background: linear-gradient(135deg, #bfdbfe, #dbeafe);
}

.garden-plots {
  background: #78350f;
}

.garden-plots i {
  border-color: rgba(255, 255, 255, 0.2);
  background:
    radial-gradient(circle at 50% 35%, #22c55e 0 24%, transparent 26%),
    linear-gradient(180deg, #92400e, #78350f);
}

.rug-pattern {
  padding: 14px;
  border: 6px solid #be123c;
  background: #fff1f2;
}

.rug-pattern i {
  border-color: rgba(190, 18, 60, 0.26);
  background: repeating-linear-gradient(45deg, #fecdd3 0 8px, #fff1f2 8px 16px);
}

.av-tablecloth {
  width: 92%;
}

.av-tablecloth > i {
  width: 150px;
  height: 80px;
  border-radius: 999px;
  background: #92400e;
  box-shadow: 0 24px 0 -12px rgba(146, 64, 14, 0.55);
}

.cloth-grid {
  border: 5px solid #0f766e;
  background: #ecfdf5;
}

.cloth-grid i {
  background: #ccfbf1;
}

.av-window-pane {
  width: min(100%, 230px);
  padding: 14px;
  border: 8px solid #475569;
  border-radius: 12px;
  background: #bfdbfe;
}

.glass-grid {
  width: 100%;
  background: #dbeafe;
}

.glass-grid i {
  border-color: rgba(71, 85, 105, 0.4);
  background: rgba(255, 255, 255, 0.45);
}

.av-paint-wall {
  position: relative;
  width: min(100%, 250px);
  height: 150px;
  border: 8px solid #64748b;
  border-radius: 12px;
  background: linear-gradient(90deg, #93c5fd 0 var(--paint), #fef3c7 var(--paint));
}

.av-paint-wall i {
  position: absolute;
  right: 18px;
  top: 24px;
  width: 22px;
  height: 72px;
  border-radius: 999px;
  background: #f97316;
}

.av-paint-wall em {
  position: absolute;
  right: 5px;
  top: 88px;
  width: 64px;
  height: 6px;
  border-radius: 999px;
  background: #334155;
  transform: rotate(28deg);
}

.av-paint-wall span,
.av-aquarium span,
.av-juice-carton span,
.av-sand-tray span {
  position: absolute;
  left: 12px;
  bottom: 12px;
}

.av-aquarium {
  position: relative;
  width: min(100%, 240px);
  height: 150px;
  border: 8px solid rgba(71, 85, 105, 0.8);
  border-top-width: 5px;
  border-radius: 14px;
  background: linear-gradient(180deg, transparent 0 calc(100% - var(--water)), #7dd3fc calc(100% - var(--water)));
}

.av-aquarium i {
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
}

.av-aquarium em {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 48px;
  height: 12px;
  border-radius: 999px;
  background: rgba(14, 116, 144, 0.26);
}

.av-shipping-box,
.av-storage-bin,
.av-drawer {
  width: 100%;
}

.box-cubes i {
  background: linear-gradient(135deg, #fbbf24, #d97706);
}

.bin-cubes i {
  background: linear-gradient(135deg, #99f6e4, #14b8a6);
}

.drawer-cubes i {
  background: linear-gradient(135deg, #c4b5fd, #7c3aed);
}

.av-juice-carton {
  position: relative;
  width: 120px;
  height: 180px;
  border-radius: 14px 14px 10px 10px;
  background:
    linear-gradient(180deg, transparent 0 calc(100% - var(--fill)), #f97316 calc(100% - var(--fill))),
    #ffedd5;
  border: 6px solid #fb923c;
  box-shadow: inset -18px 0 rgba(255, 255, 255, 0.22);
}

.av-juice-carton i {
  position: absolute;
  top: -22px;
  left: 22px;
  width: 66px;
  height: 34px;
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
  background: #fed7aa;
  border: 5px solid #fb923c;
  border-bottom: 0;
}

.av-juice-carton em {
  position: absolute;
  right: 18px;
  top: 30px;
  width: 6px;
  height: 56px;
  border-radius: 999px;
  background: #334155;
  transform: rotate(-12deg);
}

.av-sand-tray {
  position: relative;
  width: min(100%, 250px);
  min-height: 155px;
  border: 8px solid #92400e;
  border-radius: 16px;
  background: linear-gradient(180deg, #fef3c7 0 calc(100% - var(--depth)), #fbbf24 calc(100% - var(--depth)));
}

.sand-grid {
  margin-top: 18px;
  background: rgba(146, 64, 14, 0.12);
}

.sand-grid i {
  border-color: rgba(146, 64, 14, 0.22);
  background: rgba(251, 191, 36, 0.38);
}

.av-drawer {
  padding: 16px;
  border: 8px solid #92400e;
  border-radius: 14px;
  background: #fffbeb;
}

.av-experiment {
  display: grid;
  gap: 18px;
}

.av-exp-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.av-exp-story {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 16px;
  background: linear-gradient(145deg, #ffffff, #eff6ff);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.08);
}

.av-exp-story > span {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
  font-size: 0.78rem;
  font-weight: 950;
}

.av-exp-story > strong {
  color: #102033;
  font-size: 1.08rem;
  line-height: 1.35;
}

.av-exp-story p {
  margin: 0;
  color: #536171;
  line-height: 1.65;
}

.av-exp-board {
  display: grid;
  gap: 12px;
}

.control-card.is-muted {
  opacity: 0.55;
}

.av-exp-floor b,
.av-exp-box b {
  margin-top: 14px;
  color: #334155;
  background: #e2e8f0;
}

.av-exp-floor b.is-on,
.av-exp-box b.is-on {
  color: #fff;
  background: #2563eb;
}

html[lang="en"] .av-case-head strong,
html[lang="en"] .av-case-result,
html[lang="en"] .av-case-metrics b,
html[lang="en"] .av-exp-story > strong,
html[lang="en"] .av-exp-story p {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

html[lang="en"] .av-case-grid {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}

html[lang="en"] .av-case {
  min-height: 550px;
}

html[lang="en"] .av-case-controls {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 980px) {
  .av-lab,
  .av-exp-workbench {
    grid-template-columns: 1fr;
  }

  .av-case-grid {
    grid-template-columns: 1fr;
  }

  .av-case-controls,
  .av-case-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .av-topic .gt-nav,
  .av-topic-layout .gt-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
