/* Học Rubik — giao diện "khối màu": viền đậm, bóng cứng, sáu màu của khối Rubik. */

:root {
  --bg: #fff7e6;
  --bg-2: #f6ead0;
  --card: #ffffff;
  --ink: #17130f;
  --ink-2: #51483d;
  --focus: #1d4ed8;

  --c-white: #ffffff;
  --c-yellow: #ffd60a;
  --c-red: #d62828;
  --c-orange: #ff8a00;
  --c-blue: #2563eb;
  --c-green: #16a34a;
  --c-off: #8d877e;
  --cube-body: #15120f;

  --tint-yellow: #fff1a8;
  --tint-blue: #dbe7ff;
  --tint-green: #d6f5df;
  --tint-red: #ffe0dc;
  --tint-orange: #ffe6c7;

  --radius: 16px;
  --radius-sm: 10px;
  --border: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);

  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.9rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
img, svg { max-width: 100%; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1140px, 100% - 2rem); margin-inline: auto; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--radius-sm);
}
.skip:focus { top: 1rem; }

.icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Đầu trang ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 64px; }

.logo { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; text-decoration: none; letter-spacing: -0.02em; }
.logo svg { width: 34px; height: 34px; }

.nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.nav a { text-decoration: none; font-weight: 600; padding: .55rem .8rem; border-radius: var(--radius-sm); min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { background: var(--bg-2); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.logo, .nav a { white-space: nowrap; }
/* Màn hình hẹp: chỉ giữ liên kết sang trang còn lại (logo đã dẫn về trang chủ). */
@media (max-width: 560px) { .nav .nav__minor, .nav a[aria-current="page"] { display: none; } }

/* ---------- Nút ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 52px; padding: .7rem 1.4rem;
  font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--card); color: var(--ink);
  border: var(--border); border-radius: 14px; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn--primary { background: var(--c-yellow); }
.btn--dark { background: var(--ink); color: #fff; box-shadow: 3px 3px 0 var(--c-yellow); }
.btn--dark:hover { box-shadow: 5px 5px 0 var(--c-yellow); }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* ---------- Trang chủ ---------- */

.hero { padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero .wrap { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 880px) { .hero .wrap { grid-template-columns: 1.05fr .95fr; } }

.eyebrow {
  display: inline-block; font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase;
  background: var(--ink); color: #fff; padding: .3rem .7rem; border-radius: 999px; margin-bottom: 1rem;
}
.hero h1 mark { background: var(--c-yellow); color: inherit; padding: 0 .12em; border-radius: 8px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hero__lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--ink-2); margin-top: 1.2rem; max-width: 34em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.8rem; }

.stats { display: flex; flex-wrap: wrap; gap: .75rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.stats li { background: var(--card); border: var(--border); border-radius: var(--radius-sm); padding: .5rem .9rem; font-weight: 600; }
.stats b { font-size: 1.35rem; font-weight: 800; margin-right: .3rem; }

.hero__stage {
  position: relative; border: var(--border); border-radius: 28px; box-shadow: 8px 8px 0 var(--ink);
  background-color: #8fb2ff;
  background-image: radial-gradient(rgb(23 19 15 / .16) 1.5px, transparent 1.6px);
  background-size: 22px 22px;
  padding: clamp(1rem, 4vw, 2.5rem);
}
.hero__stage .cube3d { max-width: 400px; }

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section--tint { background: var(--bg-2); border-block: var(--border); }
.section__head { max-width: 46rem; margin-bottom: 2rem; }
.section__head p { color: var(--ink-2); margin-top: .7rem; font-size: 1.1rem; }

.roadmap { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); }
.step-card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--card); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.step-card:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--ink); }
.step-card__art { display: grid; place-items: center; padding: 1rem; border-bottom: var(--border); background: var(--tint, var(--tint-yellow)); }
.step-card__art .iso { width: 128px; height: auto; }
.step-card__body { padding: 1rem 1.1rem 1.2rem; display: grid; gap: .35rem; }
.step-card__num { font: 700 .8rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.step-card p { color: var(--ink-2); font-size: .98rem; line-height: 1.5; }
.roadmap li:nth-child(5n+1) .step-card__art { --tint: var(--tint-blue); }
.roadmap li:nth-child(5n+2) .step-card__art { --tint: var(--tint-green); }
.roadmap li:nth-child(5n+3) .step-card__art { --tint: var(--tint-orange); }
.roadmap li:nth-child(5n+4) .step-card__art { --tint: var(--tint-yellow); }
.roadmap li:nth-child(5n+5) .step-card__art { --tint: var(--tint-red); }

.features { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.feature { background: var(--card); border: var(--border); border-radius: var(--radius); padding: 1.4rem; display: grid; gap: .6rem; align-content: start; }
.feature__icon { width: 48px; height: 48px; display: grid; place-items: center; border: var(--border); border-radius: 12px; background: var(--tint, var(--c-yellow)); }
.feature__icon .icon { width: 24px; height: 24px; }
.feature p { color: var(--ink-2); }

.soon { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); list-style: none; margin: 0; padding: 0; }
.soon li { border: 3px dashed var(--ink); border-radius: var(--radius); padding: 1.2rem; display: grid; gap: .3rem; }
.soon span { font: 700 .78rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.soon p { color: var(--ink-2); font-size: .98rem; }

.cta-band { background: var(--ink); color: #fff; border-radius: 28px; padding: clamp(1.75rem, 5vw, 3rem); display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.cta-band p { color: #d9d2c5; margin-top: .5rem; }
.cta-band .btn { box-shadow: 3px 3px 0 #fff; }
.cta-band .btn:hover { box-shadow: 5px 5px 0 #fff; }

.site-footer { border-top: var(--border); padding: 1.75rem 0 2.25rem; color: var(--ink-2); font-size: .95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; }

/* ---------- Ảnh khối tĩnh (SVG) ---------- */

.iso { display: block; }
.iso polygon { stroke: var(--cube-body); stroke-width: .13; stroke-linejoin: round; }
.st-white { fill: var(--c-white); }
.st-yellow { fill: var(--c-yellow); }
.st-red { fill: var(--c-red); }
.st-orange { fill: var(--c-orange); }
.st-blue { fill: var(--c-blue); }
.st-green { fill: var(--c-green); }
.st-off { fill: var(--c-off); }

/* ---------- Khối 3D ---------- */

.cube3d {
  position: relative; width: 100%; max-width: 330px; aspect-ratio: 1; margin-inline: auto;
  container-type: inline-size;
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none;
  border-radius: 16px;
}
.cube3d.is-dragging { cursor: grabbing; }
.cube3d__scene {
  --s: calc(100cqi / 5.7);
  position: absolute; inset: 0; display: grid; place-items: center;
  perspective: calc(var(--s) * 13);
}
.cube3d__body { position: relative; width: 0; height: 0; transform-style: preserve-3d; }
.cube3d__body.is-easing { transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.cubie { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-style: preserve-3d; }
.cubie__face {
  position: absolute; width: var(--s); height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  background: var(--cube-body);
  backface-visibility: hidden;
}
.cubie__face--f { transform: translateZ(calc(var(--s) / 2)); }
.cubie__face--b { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.cubie__face--r { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.cubie__face--l { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.cubie__face--u { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.cubie__face--d { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.cubie__face[data-c]::after {
  content: ''; position: absolute; inset: 7%; border-radius: 16%;
  background: var(--st);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12);
}
[data-c="white"] { --st: var(--c-white); }
[data-c="yellow"] { --st: var(--c-yellow); }
[data-c="red"] { --st: var(--c-red); }
[data-c="orange"] { --st: var(--c-orange); }
[data-c="blue"] { --st: var(--c-blue); }
[data-c="green"] { --st: var(--c-green); }
[data-c="off"] { --st: var(--c-off); }

.stage-btn {
  position: absolute; right: .6rem; bottom: .6rem; z-index: 2;
  display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .4rem .75rem;
  font-size: .88rem; font-weight: 600; cursor: pointer;
  background: var(--card); border: 2px solid var(--ink); border-radius: 999px;
  transition: background-color .15s ease;
}
.stage-btn:hover { background: var(--tint-yellow); }
.stage-btn .icon { width: 1.05em; height: 1.05em; }

/* ---------- Trình phát công thức ---------- */

.player, .sandbox {
  margin: 1.75rem 0; display: grid;
  background: var(--card); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
@media (min-width: 720px) { .player, .sandbox { grid-template-columns: minmax(250px, 320px) 1fr; } }

.player__stage {
  position: relative; padding: .75rem .75rem 3.2rem;
  background-color: var(--bg-2);
  background-image: linear-gradient(rgb(23 19 15 / .07) 1px, transparent 1px), linear-gradient(90deg, rgb(23 19 15 / .07) 1px, transparent 1px);
  background-size: 24px 24px;
  border-bottom: var(--border);
}
@media (min-width: 720px) { .player__stage { border-bottom: 0; border-right: var(--border); } }

.player__panel { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.player figcaption { font-size: 1rem; line-height: 1.55; }
.player figcaption strong { display: block; font-size: 1.08rem; margin-bottom: .15rem; }
/* Chưa có JavaScript: vẫn đọc được công thức. */
.player:not(.is-ready) { padding: 1.1rem 1.2rem; display: block; }
.player:not(.is-ready)[data-alg]::after { content: 'Công thức: ' attr(data-alg); display: block; margin-top: .5rem; font: 700 1rem var(--mono); }

.player__moves, .sandbox__keys { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.chip-group { display: flex; flex-wrap: wrap; gap: .3rem; padding: .25rem; border: 2px dashed var(--ink-2); border-radius: 14px; }
.chip {
  min-width: 44px; height: 44px; padding: 0 .45rem; cursor: pointer;
  font: 700 1.02rem var(--mono);
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-sm);
  transition: background-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.chip:hover { background: var(--tint-yellow); }
.chip.is-done { background: var(--ink); color: #fff; }
.chip.is-next { background: var(--tint-yellow); box-shadow: 0 3px 0 var(--ink); }
.chip.is-active { background: var(--c-yellow); transform: translateY(-3px); box-shadow: 0 5px 0 var(--ink); }
.chip--key { min-width: 52px; height: 48px; box-shadow: 0 3px 0 var(--ink); }
.chip--key:active { transform: translateY(3px); box-shadow: none; }
.sandbox__keys { display: grid; grid-template-columns: repeat(4, minmax(52px, 1fr)); gap: .55rem; max-width: 22rem; }

.player__status { font-size: .95rem; color: var(--ink-2); min-height: 3.1em; }

.player__controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: auto; }
.ctl {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-width: 46px; height: 46px; padding: 0 .6rem; cursor: pointer; font-weight: 700; font-size: .95rem;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-sm);
  transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.ctl:hover:not(:disabled) { background: var(--tint-yellow); }
.ctl:disabled { opacity: .4; cursor: not-allowed; }
.ctl--play { order: -1; flex: 1 1 100%; background: var(--c-yellow); padding: 0 1rem; box-shadow: var(--shadow-sm); }
.ctl--play:hover:not(:disabled) { background: var(--c-yellow); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.ctl--play:active { transform: translate(2px, 2px); box-shadow: none; }
.ctl--text { padding: 0 .85rem; font-weight: 600; }
.ctl[data-act="speed"] { margin-left: auto; }

/* Ba khối nhỏ đặt cạnh nhau (bài làm quen) */
.trio { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 1.75rem 0; }
.trio .player { margin: 0; grid-template-columns: 1fr; grid-template-rows: auto 1fr; box-shadow: var(--shadow-sm); }
.trio .player__stage { border-right: 0; border-bottom: var(--border); }
.trio .cube3d { max-width: 210px; }
.trio .stage-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.trio .stage-btn { width: 44px; padding: 0; justify-content: center; }

/* ---------- Trang khoá học ---------- */

.course { display: grid; gap: 1.5rem; padding: 1.5rem 0 4rem; align-items: start; }
@media (min-width: 960px) { .course { grid-template-columns: 290px minmax(0, 1fr); gap: 2.5rem; padding-top: 2.25rem; } }

.toc { background: var(--card); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
@media (min-width: 960px) { .toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; } }
.toc__head { padding: 1rem 1.1rem .9rem; display: grid; gap: .55rem; }
.toc__title { font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.toc__toggle {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: .3rem .7rem; cursor: pointer;
  font-weight: 600; font-size: .9rem; background: var(--bg); border: 2px solid var(--ink); border-radius: var(--radius-sm);
}
@media (min-width: 960px) { .toc__toggle { display: none; } }
.progress { height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--bg); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--c-green); transition: width .3s ease; }
.toc__count { font-size: .88rem; color: var(--ink-2); }
.toc__list { list-style: none; margin: 0; padding: 0 .5rem .6rem; }
.js .toc:not(.is-open) .toc__list, .js .toc:not(.is-open) .toc__reset { display: none; }
@media (min-width: 960px) {
  .js .toc:not(.is-open) .toc__list { display: block; }
  .js .toc:not(.is-open) .toc__reset { display: inline-flex; }
}
.toc__link {
  display: flex; align-items: center; gap: .65rem; min-height: 46px; padding: .4rem .6rem;
  text-decoration: none; font-weight: 500; font-size: .98rem; line-height: 1.3; border-radius: var(--radius-sm);
}
.toc__link:hover { background: var(--bg); }
.toc__link[aria-current="true"] { background: var(--c-yellow); font-weight: 700; }
.toc__badge {
  flex: none; width: 28px; height: 28px; display: grid; place-items: center;
  font: 700 .82rem var(--mono); border: 2px solid var(--ink); border-radius: 8px; background: var(--card);
}
.toc__badge .icon { display: none; width: 16px; height: 16px; stroke-width: 3; }
.toc__link.is-done .toc__badge { background: var(--c-green); color: #fff; }
.toc__link.is-done .toc__badge .icon { display: block; }
.toc__link.is-done .toc__badge b { display: none; }
.toc__reset {
  display: inline-flex; align-items: center; min-height: 44px; margin: 0 1.1rem .8rem; padding: 0; cursor: pointer;
  background: none; border: 0; font-size: .88rem; color: var(--ink-2); text-decoration: underline;
}

.js .lesson:not(.is-current) { display: none; }
.lesson + .lesson { margin-top: 4rem; }
.js .lesson + .lesson { margin-top: 0; }
.lesson { max-width: 52rem; min-width: 0; }
.lesson__head { display: grid; gap: 1.25rem; align-items: center; margin-bottom: 2rem; padding-bottom: 1.75rem; border-bottom: var(--border); }
@media (min-width: 640px) { .lesson__head { grid-template-columns: 1fr auto; } }
.lesson__head h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.lesson__head h1:focus { outline: none; }
.lesson__goal { margin-top: .9rem; font-size: 1.12rem; color: var(--ink-2); max-width: 36em; }
.lesson__goal b { color: var(--ink); }
.lesson__art { width: 132px; padding: .6rem; background: var(--tint-blue); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

.prose > * + * { margin-top: 1.1rem; }
.prose h2 { font-size: 1.5rem; margin-top: 2.6rem; }
.prose h3 { margin-top: 1.9rem; }
.prose ul { padding-left: 1.3rem; }
.prose li + li { margin-top: .4rem; }
.prose a { font-weight: 600; text-decoration-thickness: 2px; text-underline-offset: 3px; }

.steps { list-style: none; counter-reset: s; padding: 0; display: grid; gap: .9rem; }
.steps > li { counter-increment: s; position: relative; padding-left: 3rem; min-height: 2.2rem; }
.steps > li + li { margin-top: 0; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: -.05rem;
  width: 2.1rem; height: 2.1rem; display: grid; place-items: center;
  font: 700 .95rem var(--mono); background: var(--ink); color: #fff; border-radius: 9px;
}

.alg {
  font: 700 .98em var(--mono); white-space: nowrap;
  background: var(--tint-yellow); border: 2px solid var(--ink); border-radius: 8px; padding: .08em .45em;
}
.alg-block {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem;
  background: var(--ink); color: #fff; border-radius: var(--radius); padding: 1rem 1.2rem;
}
.alg-block span { font-size: .9rem; color: #d9d2c5; }
.alg-block b { font: 700 clamp(1.15rem, 3.4vw, 1.6rem) var(--mono); letter-spacing: .02em; color: var(--c-yellow); }

.note, .warn { display: grid; grid-template-columns: auto 1fr; gap: .8rem; padding: 1rem 1.1rem; border: var(--border); border-radius: var(--radius); }
.note { background: var(--tint-green); }
.warn { background: var(--tint-red); }
.note::before, .warn::before {
  content: ''; width: 26px; height: 26px; margin-top: .15rem; background: var(--ink);
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}
.note { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5'/%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3C/svg%3E"); }
.warn { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }
.note b:first-child, .warn b:first-child { display: block; }

.shapes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.shapes li { margin: 0; padding: .6rem .5rem .7rem; text-align: center; font-weight: 600; font-size: .95rem; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-sm); }
.shapes li + li { margin-top: 0; }
.shapes .iso { width: min(100%, 110px); height: auto; margin: 0 auto .3rem; }
@media (max-width: 520px) { .shapes { grid-template-columns: repeat(2, 1fr); } }

.table-wrap { overflow-x: auto; border: var(--border); border-radius: var(--radius); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: .98rem; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 2px solid var(--bg-2); vertical-align: top; }
thead th { background: var(--ink); color: #fff; border-bottom: 0; white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td .alg { white-space: nowrap; }

.pairs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.pairs li { display: inline-flex; align-items: center; gap: .45rem; margin: 0; padding: .4rem .7rem; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; font-weight: 600; font-size: .95rem; }
.pairs li + li { margin-top: 0; }
.swatch { width: 18px; height: 18px; border: 2px solid var(--ink); border-radius: 5px; background: var(--sw); }

.lesson__nav { display: flex; flex-wrap: wrap; gap: .9rem; justify-content: space-between; margin-top: 3rem; padding-top: 1.75rem; border-top: var(--border); }

/* ---------- Giảm chuyển động ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .step-card, .chip, .ctl, .progress i, .cube3d__body.is-easing { transition: none; }
}
