/* ============================================================
   kit/css/site.css — โฉมพรีเมียมของหน้าทางเข้า (Physic Lab แบรนด์เดียว)
   ใช้กับ: index.html · physics-sim/index.html · physics-lab/index.html · physics-lab/catalog (ส่วนหัว)
   วางต่อจาก tokens/base/components — แทน physics-sim/css/studio-v3.css บนหน้าที่ใช้ body.pl-site
   สีพื้นผิวของเชลล์ตั้งที่ body.pl-site เท่านั้น (ไม่แตะ :root) → ตัววาด canvas/3D ที่อ่านโทเคนจาก :root ไม่เปลี่ยน
   ============================================================ */

/* ---------- โทเคนของเชลล์ (body.pl-site = ทั้งหน้า · .pl-scope = เฉพาะส่วนหัวบนหน้าที่มีโครงของตัวเอง เช่นคลังแลป) ---------- */
body.pl-site, .pl-scope, body.pl-catalog {
  --pl-bg: #F6F4EF;
  --pl-bg-2: #EFEBE3;
  --pl-surface: #FFFFFF;
  --pl-line: #E6E1D7;
  --pl-line-2: #D8D1C4;
  --pl-ink: #111A2B;
  --pl-ink-2: #4A5468;
  --pl-ink-3: #5F6A80;
  --pl-brand: #0B7A6D;
  --pl-brand-ink: #0A6A5F;
  --pl-brand-soft: #E3F3EF;
  --pl-gold: #C98A1B;
  --pl-gold-soft: #FBF1DC;
  --pl-night: #0C1424;
  --pl-night-2: #13223A;
  --pl-shadow-1: 0 1px 2px rgba(17, 26, 43, .05), 0 1px 1px rgba(17, 26, 43, .03);
  --pl-shadow-2: 0 2px 4px rgba(17, 26, 43, .04), 0 12px 32px -8px rgba(17, 26, 43, .12);
  --pl-shadow-3: 0 4px 8px rgba(17, 26, 43, .05), 0 28px 60px -16px rgba(17, 26, 43, .22);
  --pl-radius: 20px;
  --pl-radius-lg: 28px;
  --pl-wrap: 1240px;
  --pl-head-h: 68px;

  /* ให้ชิ้นส่วน kit (ปุ่ม ชิป select) กลืนกับพื้นผิวใหม่ */
  --c-bg: var(--pl-bg);
  --c-surface: var(--pl-surface);
  --c-surface-2: #FAF8F4;
  --c-surface-3: var(--pl-bg-2);
  --c-border: var(--pl-line);
  --c-border-strong: var(--pl-line-2);
  --c-ink: var(--pl-ink);
  --c-ink-2: var(--pl-ink-2);
  --c-ink-3: var(--pl-ink-3);
  --c-primary-soft: var(--pl-brand-soft);
  --c-primary-ink: var(--pl-brand-ink);
  --c-primary-hover: var(--pl-brand-ink);
  --sh-1: var(--pl-shadow-1);
  --sh-2: var(--pl-shadow-2);
  --sh-3: var(--pl-shadow-3);
}
body.pl-site {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--pl-bg); background-image: none; color: var(--pl-ink);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
:root[data-theme="dark"] body.pl-site, :root[data-theme="dark"] .pl-scope, :root[data-theme="dark"] body.pl-catalog {
  --pl-bg: #0A0F1C;
  --pl-bg-2: #131B2E;
  --pl-surface: #111827;
  --pl-line: #1F2A40;
  --pl-line-2: #2C3A56;
  --pl-ink: #EEF2FA;
  --pl-ink-2: #B4BDD0;
  --pl-ink-3: #97A2B8;
  --pl-brand: #2DD4BF;
  --pl-brand-ink: #5EE0CC;
  --pl-brand-soft: #0F302C;
  --pl-gold: #F2B84B;
  --pl-gold-soft: #2E2410;
  --pl-night: #060A14;
  --pl-night-2: #0E1A2E;
  --pl-shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --pl-shadow-2: 0 12px 32px -8px rgba(0, 0, 0, .55);
  --pl-shadow-3: 0 28px 60px -16px rgba(0, 0, 0, .7);
  --c-surface-2: #0E1524;
}

/* หมวดเนื้อหา → --topic / --topic-soft (การ์ด ชิป หัวกลุ่ม) */
[data-topic="measure"] { --topic: var(--topic-measure); --topic-soft: var(--topic-measure-soft); }
[data-topic="mech"]    { --topic: var(--topic-mech);    --topic-soft: var(--topic-mech-soft); }
[data-topic="wave"]    { --topic: var(--topic-wave);    --topic-soft: var(--topic-wave-soft); }
[data-topic="light"]   { --topic: var(--topic-light);   --topic-soft: var(--topic-light-soft); }
[data-topic="em"]      { --topic: var(--topic-em);      --topic-soft: var(--topic-em-soft); }
[data-topic="heat"]    { --topic: var(--topic-heat);    --topic-soft: var(--topic-heat-soft); }
[data-topic="matter"]  { --topic: var(--topic-matter);  --topic-soft: var(--topic-matter-soft); }
[data-topic="modern"]  { --topic: var(--topic-modern);  --topic-soft: var(--topic-modern-soft); }

.pl-site h1, .pl-site h2, .pl-site h3 { color: var(--pl-ink); letter-spacing: 0; }
.pl-site a.k-btn, .pl-site a.k-btn:hover { text-decoration: none; }
.pl-site .k-btn { box-shadow: none; }
.pl-site .k-btn:hover { transform: none; }
.pl-site .k-btn--primary { background: var(--pl-brand); color: #fff; }
.pl-site .k-btn--primary:hover { background: var(--pl-brand-ink); box-shadow: var(--pl-shadow-2); }
:root[data-theme="dark"] .pl-site .k-btn--primary { color: #04201C; }
:root[data-theme="dark"] .pl-site .k-btn--primary:hover { background: var(--pl-brand-ink); }
.pl-site .k-btn--soft { background: var(--pl-surface); color: var(--pl-ink); box-shadow: inset 0 0 0 1px var(--pl-line-2); }
.pl-site .k-btn--soft:hover { background: var(--c-surface-2); box-shadow: inset 0 0 0 1px var(--pl-ink-3); }
.pl-site .k-badge--grade { color: var(--pl-brand-ink); }

.pl-wrap { width: 100%; max-width: var(--pl-wrap); margin: 0 auto; padding-inline: 24px; }
@media (max-width: 640px) { .pl-wrap { padding-inline: 16px; } }
.pl-main { flex: 1 0 auto; padding-bottom: 96px; }
.pl-main:focus { outline: none; }

.v3-skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--pl-brand-ink); color: #fff; padding: 8px 16px;
  border-radius: 999px; font-weight: 700; text-decoration: none;
}
.v3-skip:focus { top: 12px; color: #fff; }

/* ============================================================
   ส่วนหัว (ใช้ร่วมทุกหน้าทางเข้า)
   ============================================================ */
.pl-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--pl-bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--pl-line) 80%, transparent);
}
.pl-header__in { display: flex; align-items: center; gap: 20px; min-height: var(--pl-head-h); }
.pl-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--pl-ink); flex: none; }
.pl-site .pl-brand:hover { color: var(--pl-ink); }
.pl-brand__mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: radial-gradient(120% 120% at 20% 10%, #19B3A0 0%, #0B7A6D 55%, #08564D 100%);
  color: #fff; font-weight: 800; font-size: 21px; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 14px -6px rgba(11, 122, 109, .6);
}
.pl-brand__txt { display: flex; flex-direction: column; line-height: 1.1; font-weight: 800; font-size: 18px; }
.pl-brand__txt small { font-weight: 600; font-size: 12px; color: var(--pl-ink-3); margin-top: 2px; }
.pl-nav { display: flex; gap: 2px; margin-left: 12px; }
.pl-nav a {
  position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border-radius: 10px; text-decoration: none; color: var(--pl-ink-2); font-weight: 600; font-size: 15px;
  transition: color .15s ease, background-color .15s ease;
}
.pl-nav a:hover { color: var(--pl-ink); background: color-mix(in srgb, var(--pl-ink) 5%, transparent); }
.pl-nav a[aria-current="page"] { color: var(--pl-ink); }
.pl-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -14px; height: 2px; border-radius: 2px; background: var(--pl-brand);
}
.pl-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; padding: 4px; border-radius: 999px; border: 1px solid var(--pl-line); background: var(--pl-surface); }
.pl-tools .k-btn { width: 36px; height: 36px; color: var(--pl-ink-2); }
.pl-tools .k-btn:hover { background: var(--pl-bg-2); color: var(--pl-ink); }
.pl-tools .k-btn[aria-pressed="true"] { background: var(--pl-brand-soft); color: var(--pl-brand-ink); box-shadow: none; }
.pl-cta { flex: none; }
@media (max-width: 1020px) { .pl-cta { display: none; } }
@media (max-width: 860px) {
  .pl-header__in { flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; }
  .pl-brand__txt small { display: none; }
  .pl-nav { order: 3; width: 100%; margin: 0 -8px; padding: 0 0 6px; overflow-x: auto; scrollbar-width: none; }
  .pl-nav::-webkit-scrollbar { display: none; }
  .pl-nav a { flex: none; min-height: 44px; }
  .pl-nav a[aria-current="page"]::after { bottom: 4px; }
}

/* ============================================================
   ส่วนท้าย
   ============================================================ */
.pl-footer { border-top: 1px solid var(--pl-line); background: var(--pl-surface); padding: 56px 0 28px; font-size: 14px; color: var(--pl-ink-2); }
.pl-footer__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.pl-footer__brand p { margin: 14px 0 0; max-width: 34ch; line-height: 1.7; }
.pl-footer h2 { font-size: 13px; font-weight: 700; color: var(--pl-ink); margin: 0 0 12px; }
.pl-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pl-footer a { color: var(--pl-ink-2); text-decoration: none; }
.pl-footer a:hover { color: var(--pl-ink); text-decoration: underline; }
.pl-footer__base { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--pl-line); color: var(--pl-ink-3); font-size: 13px; }
@media (max-width: 860px) { .pl-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pl-footer__brand { grid-column: 1 / -1; } }

/* ============================================================
   ชิ้นส่วนร่วม: หัวส่วน ปุ่มลิงก์ ตัวเลข
   ============================================================ */
.pl-section { margin-top: 96px; }
.pl-section[hidden] { display: none; }
.pl-shead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; margin-bottom: 28px; }
.pl-shead__txt { max-width: 640px; }
.pl-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--pl-brand-ink); margin-bottom: 8px; }
.pl-label::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.pl-shead h2 { margin: 0; font-size: clamp(26px, 3vw, 36px); line-height: 1.25; font-weight: 800; }
.pl-shead p { margin: 10px 0 0; color: var(--pl-ink-2); font-size: 17px; line-height: 1.65; }
.pl-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; text-decoration: none; color: var(--pl-ink); white-space: nowrap; }
.pl-more::after { content: "→"; transition: transform .2s ease; }
.pl-site .pl-more:hover { color: var(--pl-brand-ink); text-decoration: none; }
.pl-more:hover::after { transform: translateX(3px); }

/* ============================================================
   หน้าแรก: ฮีโร่โทนกลางคืน
   ============================================================ */
.pl-hero {
  position: relative; isolation: isolate; overflow: hidden; margin-top: 20px;
  border-radius: var(--pl-radius-lg); color: #E9EEF7;
  background:
    radial-gradient(52% 70% at 88% 18%, rgba(255, 197, 61, .20), transparent 70%),
    radial-gradient(60% 80% at 8% 100%, rgba(25, 179, 160, .28), transparent 70%),
    linear-gradient(160deg, var(--pl-night-2) 0%, var(--pl-night) 70%);
  box-shadow: var(--pl-shadow-3);
}
.pl-hero::before { /* ตารางพิกัดจาง ๆ แบบกระดาษกราฟ */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(80% 80% at 60% 40%, #000 30%, transparent 85%); mask-image: radial-gradient(80% 80% at 60% 40%, #000 30%, transparent 85%);
}
.pl-hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; align-items: center; padding: 72px 64px 64px; }
.pl-hero__copy { min-width: 0; }
.pl-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); color: #D6DEEC; font-size: 14px; font-weight: 600;
}
.pl-pill b { padding: 2px 8px; border-radius: 999px; background: #FFC53D; color: #3A2B0E; font-size: 12px; font-weight: 800; }
.pl-hero h1 { margin: 22px 0 18px; color: #fff; font-size: clamp(36px, 5vw, 60px); line-height: 1.22; font-weight: 800; }
.pl-hero h1 em { font-style: normal; background: linear-gradient(92deg, #5EE0CC 0%, #FFD66E 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pl-hero__lead { margin: 0; max-width: 56ch; font-size: 18px; line-height: 1.75; color: #B9C4D6; }
.pl-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.pl-hero .k-btn--primary { background: #19B3A0; color: #04201C; }
.pl-hero .k-btn--primary:hover { background: #3CCDB9; box-shadow: 0 10px 30px -8px rgba(25, 179, 160, .7); }
.pl-site .pl-btn-glass { background: rgba(255, 255, 255, .08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.pl-site .pl-btn-glass:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.pl-stats { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); justify-content: start; gap: 0; margin: 44px 0 0; padding: 0; list-style: none; }
.pl-stats li { padding: 0 28px; border-left: 1px solid rgba(255, 255, 255, .14); }
.pl-stats li:first-child { padding-left: 0; border-left: 0; }
.pl-stats b { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; }
.pl-stats span { font-size: 13px; color: #9FAEC4; font-weight: 600; }

/* โชว์เคส: หน้าต่างแอปจำลอง + มาสคอต */
.pl-show { position: relative; min-width: 0; padding: 12px 0 32px 24px; }
.pl-window {
  position: relative; margin: 0; border-radius: 16px; overflow: hidden; background: #F6F4EF;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 40px 80px -20px rgba(0, 0, 0, .6);
  transform: perspective(1800px) rotateY(-5deg) rotateX(2deg); transform-origin: left center;
}
.pl-window__bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: #E9E5DD; }
.pl-window__bar i { width: 10px; height: 10px; border-radius: 50%; background: #D3CCBF; }
.pl-window__bar i:nth-child(1) { background: #F2766B; } .pl-window__bar i:nth-child(2) { background: #F5BE4F; } .pl-window__bar i:nth-child(3) { background: #5DC66D; }
.pl-window__bar span { margin-left: 10px; font-size: 11px; color: #6B6457; font-weight: 600; }
.pl-window__main { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; background: #fff; }
.pl-window__strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; background: #E9E5DD; }
.pl-window__strip img { width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; border-radius: 6px; background: #fff; }
.pl-float {
  position: absolute; display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .96); color: #111A2B; font-size: 13px; font-weight: 700; line-height: 1.3;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .45);
}
.pl-float small { display: block; font-weight: 600; color: #5F6A80; font-size: 12px; }
.pl-float__ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: #E3F3EF; color: #0A6A5F; }
.pl-float--a { left: -8px; bottom: 6px; }
.pl-float--b { right: -6px; top: -6px; }
.pl-float--b .pl-float__ico { background: #FBF1DC; color: #8A5A00; }
.pl-show .v3-hero__mascot { position: absolute; right: -18px; bottom: -14px; z-index: 2; }
.pl-show .v3-mascot svg, .pl-show .v3-mascot img { width: 132px; height: 132px; filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .45)) drop-shadow(0 0 28px rgba(255, 197, 61, .35)); animation: pl-bob 4.6s ease-in-out infinite; }
.pl-show .v3-bubble { display: none; }
@keyframes pl-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
:root[data-mascot="off"] .v3-hero__mascot { display: none; }

@media (max-width: 1080px) {
  .pl-hero__grid { grid-template-columns: minmax(0, 1fr); padding: 56px 40px 48px; }
  .pl-show { max-width: 620px; padding-left: 0; }
  .pl-window { transform: none; }
}
@media (max-width: 640px) {
  .pl-hero { margin-top: 12px; border-radius: 22px; }
  .pl-hero__grid { padding: 40px 22px 32px; gap: 28px; }
  .pl-hero__lead { font-size: 16px; }
  .pl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 0; }
  .pl-stats li:nth-child(3) { padding-left: 0; border-left: 0; }
  .pl-float--b { display: none; }
  .pl-show .v3-mascot svg, .pl-show .v3-mascot img { width: 92px; height: 92px; }
  .pl-show .v3-hero__mascot { right: -6px; }
}

/* ความไว้วางใจ: แถบใต้ฮีโร่ */
.pl-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 36px; margin: 28px 0 0; padding: 0; list-style: none; color: var(--pl-ink-2); font-size: 15px; font-weight: 600; }
.pl-trust li { display: inline-flex; align-items: center; gap: 8px; }
.pl-trust svg { color: var(--pl-brand); flex: none; }

/* ============================================================
   หน้าแรก: สองพื้นที่เรียนรู้
   ============================================================ */
.pl-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.pl-path {
  position: relative; display: grid; grid-template-rows: auto 1fr; overflow: hidden; border-radius: var(--pl-radius-lg);
  background: var(--pl-surface); border: 1px solid var(--pl-line); color: var(--pl-ink); text-decoration: none;
  box-shadow: var(--pl-shadow-1); transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.pl-site .pl-path:hover { color: var(--pl-ink); transform: translateY(-4px); box-shadow: var(--pl-shadow-3); border-color: var(--pl-line-2); }
.pl-path__art { position: relative; display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; padding: 20px 20px 0; background: linear-gradient(180deg, var(--pl-brand-soft), transparent); }
.pl-path--lab .pl-path__art { background: linear-gradient(180deg, var(--pl-gold-soft), transparent); }
.pl-path__art img { width: 100%; height: 100%; aspect-ratio: 8 / 5; object-fit: cover; border-radius: 12px; background: var(--pl-surface); box-shadow: var(--pl-shadow-2); }
.pl-path__art img:first-child { grid-row: 1 / span 2; }
.pl-path__body { display: flex; flex-direction: column; gap: 10px; padding: 28px 32px 32px; }
.pl-path__tag { font-size: 13px; font-weight: 700; color: var(--pl-brand-ink); }
.pl-path--lab .pl-path__tag { color: var(--pl-gold); }
.pl-path h3 { margin: 0; font-size: 26px; line-height: 1.3; }
.pl-path__count { margin: 0; color: var(--pl-ink-3); font-size: 15px; font-weight: 600; }
.pl-path ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--pl-ink-2); font-size: 15px; line-height: 1.55; }
.pl-path li { position: relative; padding-left: 26px; }
.pl-path li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--pl-brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.3 2.3 4.7-5' fill='none' stroke='%230A6A5F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.pl-path--lab li::before { background-color: var(--pl-gold-soft); }
.pl-path__cta { margin-top: auto; padding-top: 14px; font-weight: 700; color: var(--pl-ink); display: inline-flex; gap: 8px; align-items: center; }
.pl-path__cta::after { content: "→"; transition: transform .2s ease; }
.pl-path:hover .pl-path__cta::after { transform: translateX(4px); }
@media (max-width: 860px) { .pl-paths { grid-template-columns: minmax(0, 1fr); } .pl-path__body { padding: 22px 22px 26px; } }

/* ระดับชั้น */
.pl-grades { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.v3-grade {
  display: flex; flex-direction: column; gap: 4px; padding: 20px 20px 18px; border-radius: 18px; text-decoration: none;
  background: var(--pl-surface); border: 1px solid var(--pl-line); color: var(--pl-ink); box-shadow: var(--pl-shadow-1);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.pl-site .v3-grade:hover { color: var(--pl-ink); border-color: var(--pl-brand); box-shadow: var(--pl-shadow-2); transform: translateY(-2px); }
.v3-grade b { font-size: 28px; line-height: 1.15; font-weight: 800; }
.v3-grade span { font-size: 13px; color: var(--pl-ink-3); font-weight: 600; }
.v3-grade::after { content: "→"; margin-top: 8px; color: var(--pl-ink-3); font-weight: 700; transition: transform .2s ease, color .2s ease; }
.v3-grade:hover::after { color: var(--pl-brand-ink); transform: translateX(3px); }
@media (max-width: 860px) { .pl-grades { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 420px) { .v3-grade { padding: 16px 14px; } .v3-grade b { font-size: 24px; } }

/* ============================================================
   การ์ดหัวข้อ (หน้าแรก + คลังซิม)
   ============================================================ */
.v3-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pl-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 960px) { .pl-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .pl-grid-3, .v3-grid { grid-template-columns: minmax(0, 1fr); } }
.v3-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--pl-surface); border: 1px solid var(--pl-line); border-radius: var(--pl-radius); box-shadow: var(--pl-shadow-1);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.v3-card:hover, .v3-card:focus-within { transform: translateY(-3px); box-shadow: var(--pl-shadow-2); border-color: var(--pl-line-2); }
.v3-card__cover { position: relative; aspect-ratio: 16 / 9; background: var(--topic-soft, var(--pl-bg-2)); overflow: hidden; }
.v3-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.v3-card:hover .v3-card__cover img { transform: scale(1.035); }
.v3-card__flags { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; }
.v3-card__flags .k-badge { box-shadow: var(--pl-shadow-1); }
.v3-card__body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 16px; flex: 1 1 auto; border-top: 1px solid var(--pl-line); }
.v3-card__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.v3-card__meta .k-badge { height: 22px; font-size: 12px; }
.v3-card__chap { font-size: 12px; color: var(--pl-ink-3); font-weight: 600; margin-left: auto; }
.v3-card__title { font-size: 17px; margin: 2px 0 0; line-height: 1.4; font-weight: 700; }
.v3-card__link, .pl-site .v3-card__link { color: var(--pl-ink); text-decoration: none; }
.pl-site .v3-card__link:hover { color: var(--pl-ink); }
.v3-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.v3-card__link:focus-visible { box-shadow: none; outline: none; }
.v3-card:has(.v3-card__link:focus-visible) { outline: 3px solid var(--pl-brand-ink); outline-offset: 2px; }
.v3-card__en { display: none; }
.v3-card__en:has(mark) { display: block; margin: -4px 0 0; font-size: 12px; color: var(--pl-ink-3); font-weight: 500; }
.v3-card__sum { margin: 0; font-size: 14px; color: var(--pl-ink-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.v3-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.v3-card__nums { font-size: 13px; color: var(--pl-ink-3); font-weight: 600; line-height: 1.4; }
.v3-card__nums b { color: var(--pl-ink); font-variant-numeric: tabular-nums; }
.v3-card__quick { position: relative; z-index: 2; flex: none; text-decoration: none; }
.pl-site .v3-card__quick.k-btn--soft { height: 32px; padding: 0 12px; font-size: 13px; background: transparent; box-shadow: inset 0 0 0 1px var(--pl-line-2); color: var(--pl-ink-2); }
.pl-site .v3-card__quick.k-btn--soft:hover { background: var(--pl-brand-soft); color: var(--pl-brand-ink); box-shadow: inset 0 0 0 1px var(--pl-brand); }
.v3-card__hit { background: color-mix(in srgb, #FFC53D 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.v3-card__formula { font-family: var(--font-num); font-size: 12px; background: var(--pl-bg-2); color: var(--pl-ink); padding: 2px 8px; border-radius: 6px; width: fit-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   หน้าแรก: ส่วนสำหรับครู
   ============================================================ */
.pl-teach { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: center; padding: 56px; border-radius: var(--pl-radius-lg); background: var(--pl-surface); border: 1px solid var(--pl-line); box-shadow: var(--pl-shadow-1); }
.pl-teach .pl-shead { margin: 0; }
.pl-teach__list { display: grid; gap: 12px; }
.v3-teach__item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 18px 20px; border-radius: 16px; background: var(--c-surface-2); border: 1px solid var(--pl-line); }
.v3-teach__item h3 { grid-column: 2; margin: 0; font-size: 17px; }
.v3-teach__item p { grid-column: 2; margin: 0; font-size: 14px; color: var(--pl-ink-2); line-height: 1.6; }
.v3-teach__ico { grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--pl-brand-soft); color: var(--pl-brand-ink); }
.v3-teach__item .k-btn { grid-column: 3; grid-row: 1 / span 2; }
.pl-teach__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
@media (max-width: 960px) { .pl-teach { grid-template-columns: minmax(0, 1fr); padding: 32px 24px; gap: 28px; } }
@media (max-width: 560px) { .v3-teach__item { grid-template-columns: 44px minmax(0, 1fr); } .v3-teach__item .k-btn { grid-column: 1 / -1; grid-row: auto; justify-self: start; margin-top: 8px; } }

/* แถบปิดท้าย */
.pl-band {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: 96px;
  padding: 48px 56px; border-radius: var(--pl-radius-lg); color: #E9EEF7;
  background: radial-gradient(60% 120% at 100% 0%, rgba(255, 197, 61, .18), transparent 60%), linear-gradient(135deg, var(--pl-night-2), var(--pl-night));
}
.pl-band h2 { margin: 0 0 6px; color: #fff; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.3; }
.pl-band p { margin: 0; color: #B9C4D6; font-size: 16px; }
.pl-band__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.pl-band .k-btn--primary { background: #19B3A0; color: #04201C; }
.pl-band .k-btn--primary:hover { background: #3CCDB9; }
@media (max-width: 640px) { .pl-band { padding: 32px 24px; margin-top: 64px; } }

/* ============================================================
   หน้าคลัง (คลังซิม / ห้องปฏิบัติการ): แถบหัวหน้า
   ============================================================ */
.pl-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 32px 48px; align-items: end; padding: 48px 0 32px; }
.pl-crumb { display: flex; gap: 8px; align-items: center; margin: 0 0 14px; padding: 0; list-style: none; font-size: 14px; color: var(--pl-ink-3); font-weight: 600; }
.pl-crumb a { color: var(--pl-ink-3); text-decoration: none; }
.pl-crumb a:hover { color: var(--pl-ink); text-decoration: underline; }
.pl-crumb li + li::before { content: "/"; margin-right: 8px; color: var(--pl-line-2); }
.pl-intro h1 { margin: 0; font-size: clamp(32px, 4vw, 46px); line-height: 1.2; font-weight: 800; }
.pl-intro__lead { margin: 12px 0 0; max-width: 60ch; color: var(--pl-ink-2); font-size: 17px; line-height: 1.7; }
.pl-intro .v3-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 20px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--pl-ink-3); font-weight: 600; }
.pl-intro .v3-stats b { color: var(--pl-ink); font-size: 16px; font-variant-numeric: tabular-nums; margin-right: 2px; }
@media (max-width: 960px) { .pl-intro { grid-template-columns: minmax(0, 1fr); padding: 32px 0 24px; } }

/* กล่องเริ่มสอนเร็ว (ขนาดกะทัดรัด) */
.v3-quick { display: grid; gap: 10px; padding: 18px 20px; border-radius: 18px; background: var(--pl-surface); border: 1px solid var(--pl-line); box-shadow: var(--pl-shadow-1); }
.v3-quick h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; font-weight: 700; }
.v3-quick__ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--pl-gold-soft); color: var(--pl-gold); flex: none; }
.v3-quick p { margin: 0; color: var(--pl-ink-3); font-size: 13px; line-height: 1.5; }
.v3-quick__row { display: flex; gap: 8px; align-items: center; }
.v3-quick__row .k-select { flex: 1 1 auto; min-width: 0; height: 42px; border-radius: 12px; }
.v3-quick__row .k-btn { height: 42px; border-radius: 12px; flex: none; }

/* ---------- แถบค้นหาและตัวกรอง (ติดบนเมื่อเลื่อน) ---------- */
.v3-filters {
  display: grid; gap: 10px; padding: 14px 16px; border-radius: 18px;
  background: var(--pl-surface); border: 1px solid var(--pl-line); box-shadow: var(--pl-shadow-1);
}
.v3-search-row { display: flex; gap: 10px; align-items: center; }
.v3-search { position: relative; flex: 1 1 auto; min-width: 0; }
.v3-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--pl-ink-3); pointer-events: none; }
.v3-search input {
  width: 100%; height: 48px; padding: 0 48px 0 48px; border-radius: 14px; border: 1px solid var(--pl-line-2);
  background: var(--c-surface-2); color: var(--pl-ink); font-size: 16px; transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.v3-search input::placeholder { color: var(--pl-ink-3); }
.v3-search input:focus { outline: none; border-color: var(--pl-brand); background: var(--pl-surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pl-brand) 18%, transparent); }
.v3-search__clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--pl-ink-3); cursor: pointer; display: grid; place-items: center; font-size: 20px; }
.v3-search__clear:hover { background: var(--pl-bg-2); color: var(--pl-ink); }
.v3-search-kbd { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.v3-search:has(.v3-search__clear:not([hidden])) .v3-search-kbd, .v3-search:focus-within .v3-search-kbd { display: none; }
.pl-site #resetFilters { height: 48px; border-radius: 14px; flex: none; }
.v3-frow { display: flex; align-items: center; gap: 12px; min-width: 0; }
.v3-flabel { flex: none; font-weight: 600; font-size: 13px; color: var(--pl-ink-3); min-width: 56px; }
.v3-fgroup { display: flex; gap: 6px; min-width: 0; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.v3-fgroup::-webkit-scrollbar { display: none; }
.v3-fgroup > * { flex: none; }
.pl-site .v3-chip { height: 34px; padding: 0 12px; gap: 6px; border-radius: 10px; font-size: 14px; font-weight: 600; background: transparent; border: 1px solid var(--pl-line); color: var(--pl-ink-2); box-shadow: none; }
.pl-site .v3-chip:hover { transform: none; border-color: var(--pl-line-2); color: var(--pl-ink); background: var(--c-surface-2); }
.pl-site .v3-chip[aria-pressed="true"] { background: var(--pl-ink); border-color: var(--pl-ink); color: var(--pl-surface); }
.pl-site .v3-chip[aria-pressed="true"] .v3-count { color: color-mix(in srgb, var(--pl-surface) 70%, transparent); }
.v3-chip[data-topic]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--topic); flex: none; }
.v3-chip[data-empty="true"] { opacity: .45; }
.v3-count { font-weight: 600; font-size: 12px; color: var(--pl-ink-3); font-variant-numeric: tabular-nums; }
.v3-fopts { display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: center; }
.v3-fopts .k-select { width: auto; flex: 1 1 260px; min-width: 200px; max-width: 420px; height: 38px; border-radius: 10px; font-size: 14px; }
.v3-fopts .v3-flabel { min-width: 0; }
.v3-fopts .k-seg { margin-left: auto; }
.v3-fopts .v3-flabel + .k-seg { margin-left: 0; }
.pl-site .k-seg { padding: 3px; border-radius: 10px; background: var(--pl-bg-2); border: 0; }
.pl-site .k-seg__opt { min-height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; }
.pl-site .k-seg__opt[aria-checked="true"] { background: var(--pl-surface); color: var(--pl-ink); box-shadow: var(--pl-shadow-1); }
.v3-filters__more { display: contents; }
@media (max-width: 760px) {
  .v3-filters { padding: 12px; }
  .v3-search-row { flex-wrap: wrap; }
  .pl-site #resetFilters { height: 44px; }
  .v3-frow { flex-direction: column; align-items: stretch; gap: 4px; }
  .v3-fopts .k-select { flex: 1 1 100%; max-width: none; }
  .v3-fopts .k-seg { margin-left: 0; }
  .v3-search-kbd { display: none; }
}

.v3-resultbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 24px 0 0; font-size: 14px; }
.v3-resultbar p { margin: 0; font-weight: 700; color: var(--pl-ink); }
.v3-resultbar span { color: var(--pl-ink-3); }

/* กลุ่มตามบท/หมวด — บทเล็ก (1–3 หัวข้อ) วางเรียงกันในแถวเดียว ไม่ทิ้งช่องว่างทั้งแถว */
#simGrid { --cols: 4; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: 20px; row-gap: 40px; margin-top: 28px; }
.v3-group { --n: var(--cols); grid-column: span var(--n); min-width: 0; }
.v3-group[data-n="1"] { --n: 1; } .v3-group[data-n="2"] { --n: 2; } .v3-group[data-n="3"] { --n: 3; }
#simGrid .v3-group .v3-grid { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
@media (max-width: 1120px) { #simGrid { --cols: 3; } .v3-group[data-n="3"] { --n: 3; } }
@media (max-width: 840px) { #simGrid { --cols: 2; } .v3-group[data-n="2"], .v3-group[data-n="3"] { --n: 2; } }
@media (max-width: 560px) { #simGrid { --cols: 1; } .v3-group[data-n] { --n: 1; } }
:root[data-projector="on"] #simGrid { --cols: 3; }
@media (max-width: 1120px) { :root[data-projector="on"] #simGrid { --cols: 2; } :root[data-projector="on"] .v3-group[data-n="3"] { --n: 2; } }
@media (max-width: 560px) { :root[data-projector="on"] #simGrid { --cols: 1; } }
.pl-site .v3-group .v3-grid { gap: 20px; }
.v3-ghead { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 16px; min-height: 56px; align-content: flex-end; }
.v3-ghead h3 { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; font-weight: 800; }
.v3-ghead h3 .v3-gdot { width: 10px; height: 10px; border-radius: 50%; background: var(--topic); box-shadow: 0 0 0 4px var(--topic-soft); }
.v3-ghead span { color: var(--pl-ink-2); font-weight: 600; font-size: 15px; min-width: 0; }
.v3-ghead small { display: none; margin-left: auto; color: var(--pl-ink-3); font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--pl-bg-2); }
.v3-ghead::after { content: ""; order: 3; flex: 1 0 100%; height: 1px; background: var(--pl-line); margin-top: 4px; }

/* สถานะว่าง */
.v3-empty { margin-top: 32px; padding: 40px 24px; border-radius: var(--pl-radius); border: 1px dashed var(--pl-line-2); background: var(--pl-surface); }
.v3-empty .v3-mascot { max-width: none; flex-direction: column; }
.v3-empty svg, .v3-empty .v3-mascot img { width: 104px; height: 104px; }

/* มาสคอต + กล่องคำพูด (ใช้ในสถานะว่าง) */
.v3-mascot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.v3-bubble { position: relative; padding: 12px 16px; border-radius: 16px; background: var(--pl-surface); border: 1px solid var(--pl-line-2); box-shadow: var(--pl-shadow-1); font-weight: 600; font-size: 14px; text-align: center; color: var(--pl-ink); max-width: 420px; }

/* ส่วนต่อยอดท้ายคลัง */
.v3-cross { margin-top: 72px; }

/* โหมดโปรเจกเตอร์: การ์ดใหญ่ขึ้น */
:root[data-projector="on"] .v3-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
:root[data-projector="on"] .v3-card__sum { -webkit-line-clamp: 3; }

@media (prefers-reduced-motion: reduce) {
  .pl-show .v3-mascot svg, .pl-show .v3-mascot img { animation: none; }
  .v3-card:hover, .v3-card:focus-within, .pl-path:hover, .v3-grade:hover { transform: none; }
  .pl-window { transform: none; }
}

/* ขนาดแตะ ≥ 44px บนจอสัมผัส */
@media (max-width: 760px), (pointer: coarse) {
  .pl-site .v3-chip, .pl-site .v3-card__quick.k-btn--soft, .v3-search__clear, .pl-site .k-seg__opt { min-height: 44px; }
  .pl-tools .k-btn { width: 44px; height: 44px; }
  .v3-search__clear { width: 44px; height: 44px; right: 2px; }
}

/* ============================================================
   หน้าห้องปฏิบัติการ + คลังการทดลอง (body.pl-site.lh-page) — ปรับชิ้นส่วน lh-* ของ hub-v3.css ให้เข้าชุด
   ============================================================ */
.pl-intro__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pl-intro--solo { grid-template-columns: minmax(0, 1fr); padding-bottom: 24px; }
.pl-linkbtn { justify-self: start; border: 0; background: none; padding: 2px 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--pl-ink-3); cursor: pointer; }
.pl-linkbtn:hover { color: var(--pl-brand-ink); text-decoration: underline; }
.pl-site .lh-wrap { max-width: var(--pl-wrap); padding-inline: 24px; }
@media (max-width: 640px) { .pl-site .lh-wrap { padding-inline: 16px; } }
.pl-site.lh-page { background-image: none; }
.pl-site .lh-section { margin-top: 88px; }
.pl-site .lh-heading { display: block; margin-bottom: 24px; }
.pl-site .lh-heading h2 { font-size: clamp(24px, 2.8vw, 32px); line-height: 1.3; }
.pl-site .lh-heading p { margin: 8px 0 0; color: var(--pl-ink-2); font-size: 16px; }
.pl-site .lh-kicker { display: none; }
.pl-site .lh-section > .lh-heading::before { content: ""; display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--pl-brand); margin-bottom: 14px; }

/* ห้อง 3 มิติ: กรอบพรีเมียม */
.pl-site .room-hub__scene { border-radius: var(--pl-radius-lg); box-shadow: var(--pl-shadow-3); }
.pl-site .room-hub__scene-label { display: none; }
.pl-site .room-hub__zones { border-radius: 0 0 var(--pl-radius-lg) var(--pl-radius-lg); background: linear-gradient(transparent, rgba(12, 20, 36, .82) 30%); gap: 10px; padding: 40px 18px 18px; }
.pl-site .room-hub__zone { min-height: 56px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 14px; background: rgba(255, 255, 255, .94); color: #111A2B; transition: background-color .15s ease, transform .15s ease; }
.pl-site .room-hub__zone:hover { transform: translateY(-2px); }
.pl-site .room-hub__zone:hover, .pl-site .room-hub__zone[aria-pressed="true"] { background: #fff; border-color: #19B3A0; box-shadow: 0 0 0 2px #19B3A0; }
.pl-site .room-hub__zone-icon { background: #E3F3EF; color: #0A6A5F; border-radius: 10px; }
.pl-site .room-hub__hint { color: var(--pl-ink-3); font-size: 14px; padding: 12px 4px 0; }
.pl-site .room-hub__results:has(#roomResults:empty) { display: none; }
.pl-site .room-hub__card { border-color: var(--pl-line); border-radius: 14px; background: var(--pl-surface); color: var(--pl-ink); box-shadow: var(--pl-shadow-1); }
.pl-site .room-hub__card a { color: var(--pl-ink); text-decoration: none; }
@media (max-width: 600px) { .pl-site .room-hub__zones { background: var(--pl-night); border-radius: 0 0 22px 22px; } }

/* เส้นทาง 3 แบบ */
.pl-site .lh-paths { gap: 20px; }
.pl-site .lh-path { border-radius: var(--pl-radius); border: 1px solid var(--pl-line); background: var(--pl-surface); box-shadow: var(--pl-shadow-1); padding: 28px; color: var(--pl-ink); text-decoration: none; }
.pl-site .lh-path:hover { transform: translateY(-3px); box-shadow: var(--pl-shadow-2); border-color: var(--pl-line-2); color: var(--pl-ink); }
.pl-site .lh-path__no { display: none; }
.pl-site .lh-path h3 { font-size: 20px; }
.pl-site .lh-path p { color: var(--pl-ink-2); font-size: 15px; line-height: 1.65; }
.pl-site .lh-path__cta { color: var(--pl-ink); font-weight: 700; }

/* หกขั้นตอน */
.pl-site .lh-flow li { border-radius: 16px; border: 1px solid var(--pl-line); background: var(--pl-surface); box-shadow: none; }

/* ชั้นเรียน หมวด การ์ด */
.pl-site .lh-grade { border-radius: 18px; border: 1px solid var(--pl-line); background: var(--pl-surface); box-shadow: var(--pl-shadow-1); color: var(--pl-ink); text-decoration: none; }
.pl-site .lh-grade:hover { border-color: var(--pl-brand); box-shadow: var(--pl-shadow-2); color: var(--pl-ink); }
.pl-site .lh-topics a { text-decoration: none; }
.pl-site .lh-card { border-radius: var(--pl-radius); border-color: var(--pl-line); box-shadow: var(--pl-shadow-1); }
.pl-site .lh-card:hover { box-shadow: var(--pl-shadow-2); }

/* ตัวกรองคลังการทดลอง */
.pl-site .lh-filters { border-radius: 18px; border: 1px solid var(--pl-line); background: var(--pl-surface); box-shadow: var(--pl-shadow-1); padding: 14px 16px; }
.pl-site .lh-search input { border-radius: 14px; border-color: var(--pl-line-2); background: var(--c-surface-2); }
.pl-site .lh-search input:focus { border-color: var(--pl-brand); background: var(--pl-surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pl-brand) 18%, transparent); }
.pl-site .lh-chip, .pl-site .lh-toggle { border-radius: 10px; }
.pl-site .lh-fgroup .k-chip[aria-pressed="true"], .pl-site .lh-toggle[aria-pressed="true"] { background: var(--pl-ink); border-color: var(--pl-ink); color: var(--pl-surface); }
.pl-site .lh-fgroup .k-chip[aria-pressed="true"] .lh-count, .pl-site .lh-toggle[aria-pressed="true"] .lh-count { color: color-mix(in srgb, var(--pl-surface) 70%, transparent); }
.pl-site .lh-cross { margin-top: 88px; }
.pl-intro > * { grid-area: auto; min-width: 0; }
.pl-intro .lh-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 20px 0 0; padding: 0; list-style: none; }
.pl-intro .lh-stats li { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; font-size: 14px; color: var(--pl-ink-3); font-weight: 600; }
.pl-intro .lh-stats b { font-size: 16px; color: var(--pl-ink); margin-right: 2px; }
.pl-site .lh-quick { max-width: none; }
/* คลังการทดลอง: หัวข้อส่วนซ้ำกับหัวหน้า → ซ่อนให้เห็นแค่ตัวกรอง (ยังมี h2 ให้โปรแกรมอ่านจอ) */
.pl-site[data-page="experiments"] #library { margin-top: 0; }
.pl-site[data-page="experiments"] #library > .lh-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pl-site .lh-group + .lh-group { margin-top: 40px; }

/* ส่วนหัวบนหน้าคลังแลปตามหลักสูตร (โครง app-shell เดิม: แถบข้างติดบน 100vh) — ไม่ติดบน เพื่อไม่ทับแถบข้าง */
.pl-scope.pl-header { position: relative; font-family: var(--font-sans); background: var(--pl-bg); color: var(--pl-ink); }
.pl-scope .pl-brand__txt, .pl-scope .pl-nav a { font-family: var(--font-sans); }
.pl-scope .pl-nav a { text-decoration: none; }
.pl-scope .pl-nav a[aria-current="page"]::after { bottom: -14px; }
.pl-scope .pl-wrap { max-width: none; padding-inline: 24px; }
.pl-site .v3-quick__row, .pl-site .lh-quick__row { flex-wrap: nowrap; }
/* ขนาดแตะ ≥ 44px บนมือถือ/จอสัมผัส — ครอบคลุมปุ่มเล็กของทุกหน้าทางเข้า (รวม lh-* ของห้องแลป) */
@media (max-width: 760px), (pointer: coarse) {
  .pl-site .k-btn, .pl-site .k-btn--sm, .pl-site .k-chip, .pl-site .lh-toggle, .pl-site .k-select,
  .pl-site .v3-quick__row .k-btn, .pl-site .v3-quick__row .k-select { min-height: 44px; }
  .pl-site .k-btn--sm { padding-inline: 14px; }
  .pl-linkbtn { min-height: 44px; }
}
/* ทางลัดใต้สองพื้นที่เรียนรู้ (หน้าแรก) */
.pl-shortcuts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; }
.pl-shortcuts > span { font-size: 14px; font-weight: 600; color: var(--pl-ink-3); margin-right: 6px; }
.pl-site .pl-shortcuts .k-chip { height: 36px; padding: 0 14px; border-radius: 999px; background: var(--pl-surface); border: 1px solid var(--pl-line); color: var(--pl-ink-2); font-size: 14px; font-weight: 600; text-decoration: none; box-shadow: none; }
.pl-site .pl-shortcuts .k-chip:hover { transform: none; border-color: var(--pl-brand); color: var(--pl-brand-ink); }
/* มาสคอตภาพ 3 มิติ (k-mascot--art) ในโชว์เคสหน้าแรก: ให้ขนาดตาม img ด้านบน (132 / 92 px) แทนขนาดใน style */
.pl-show .k-mascot--art { width: auto !important; height: auto !important; }
.pl-show .v3-mascot img { width: 150px !important; height: 150px !important; } /* img มี style 100% จาก mascot() */
@media (max-width: 640px) { .pl-show .v3-mascot img { width: 100px !important; height: 100px !important; } }
/* โชว์เคสหน้าแรก (แก้ 2026-11-19 ตามผู้ใช้: มาสคอตบังภาพย่อ) — ของลอยทุกชิ้นอยู่นอกเนื้อหาหน้าต่าง:
   มาสคอตเกาะมุมขวาบนบนแถบชื่อ (มุมนั้นของภาพปกเป็นท้องฟ้าว่าง) · การ์ดสองใบอยู่ในช่องว่างใต้หน้าต่าง */
.pl-show { padding: 64px 40px 76px 24px; }
.pl-float--a { left: 8px; right: auto; top: auto; bottom: 8px; }
.pl-float--b { left: auto; right: 0; top: auto; bottom: 8px; }
.pl-show .v3-hero__mascot { top: 0; right: -14px; bottom: auto; }
.pl-show .v3-mascot img { width: 128px !important; height: 128px !important; }
@media (max-width: 1080px) { .pl-show { padding: 56px 24px 76px 0; } }
@media (max-width: 640px) {
  .pl-show { padding: 44px 8px 64px 0; }
  .pl-float--a { left: 0; bottom: 4px; }
  .pl-show .v3-hero__mascot { top: -6px; right: -10px; }
  .pl-show .v3-mascot img { width: 88px !important; height: 88px !important; }
}
/* คลังซิม: บทที่พับ (แสดงแถวแรก) + ปุ่ม "ดูอีก N หัวข้อ" */
.v3-card--folded { display: none !important; }
.v3-more {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 12px; min-height: 44px;
  border: 1px dashed var(--pl-line-2); border-radius: 14px; background: transparent; color: var(--pl-ink-2);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.v3-more:hover { background: var(--pl-surface); color: var(--pl-brand-ink); border-color: var(--pl-brand); border-style: solid; }
.v3-more:focus-visible { outline: 3px solid var(--pl-brand-ink); outline-offset: 2px; }

/* ============================================================
   คลังแลปตามหลักสูตร (body.pl-catalog) — แอปเดิมผูกตัวแปร --paper/--ink/--accent … กับ token kit ที่ :root (v3-theme.css)
   ผูกซ้ำที่ body ให้คำนวณจากโทนพรีเมียมของเชลล์ (ไม่แตะ :root → ภาพซิม/แลปในแอปที่อ่าน token จาก :root ไม่เปลี่ยน)
   ============================================================ */
body.pl-catalog {
  --bg: var(--pl-bg); --bg-2: var(--c-surface-2); --paper: var(--pl-surface); --paper-2: var(--c-surface-2);
  --ink: var(--pl-ink); --ink-2: var(--pl-ink-2); --muted: var(--pl-ink-3); --line: var(--pl-line); --line-2: var(--pl-line-2);
  --accent: var(--pl-brand-ink); --accent-2: var(--pl-brand); --accent-soft: var(--pl-brand-soft);
  --teal: var(--pl-brand); --teal-soft: var(--pl-brand-soft);
  --shadow-sm: var(--pl-shadow-1); --shadow-md: var(--pl-shadow-2); --shadow-lg: var(--pl-shadow-3);
  background-color: var(--pl-bg); background-image: none; color: var(--pl-ink);
}
body.pl-catalog a { color: var(--pl-brand-ink); }
body.pl-catalog .sidebar { box-shadow: none; border-right-color: var(--pl-line); }
body.pl-catalog .btn-primary { background: var(--pl-brand); color: #fff; box-shadow: none; }
body.pl-catalog .btn-primary:hover { background: var(--pl-brand-ink); }
:root[data-theme="dark"] body.pl-catalog .btn-primary { color: #04201C; }
/* ขนาดแตะ ≥ 44px บนมือถือ/จอสัมผัส (ปุ่ม แท็บ ช่องค้นหา ของแอปคลังแลป) */
@media (max-width: 760px), (pointer: coarse) {
  body.pl-catalog .icon-btn, body.pl-catalog .btn, body.pl-catalog .tab, body.pl-catalog .done-toggle,
  body.pl-catalog .search, body.pl-catalog .search input, body.pl-catalog button { min-height: 44px; }
  body.pl-catalog .icon-btn { min-width: 44px; }
}
/* แถบข้างคลังแลป: ตรา φ แบบเดียวกับส่วนหัว (แทนรูปขวดแก้วเดิม) */
body.pl-catalog .brand-mark {
  display: grid; place-items: center;
  background: radial-gradient(120% 120% at 20% 10%, #19B3A0 0%, #0B7A6D 55%, #08564D 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 14px -6px rgba(11, 122, 109, .6);
}
body.pl-catalog .brand-mark__phi { color: #fff; font-weight: 800; font-size: 24px; line-height: 1; }
