/* ============================================================
   physics-lab/css/hub-v3.css — หน้าห้องแลป (physics-lab/index.html) + คลังการทดลอง v3 (physics-lab/experiments/index.html)
   วางบน kit: tokens.css + base.css + components.css (ไม่มีสี/ขนาดฮาร์ดโค้ดนอกจาก token)
   คลาสขึ้นต้น lh- (lab hub) เพื่อไม่ชนกับ studio-v3.css ของ hub ซิม
   ============================================================ */

[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); }

body.lh-page { min-height: 100vh; display: flex; flex-direction: column; }
.lh-wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding-inline: var(--sp-5); }
@media (max-width: 640px) { .lh-wrap { padding-inline: var(--sp-4); } }
.lh-main { flex: 1 0 auto; padding-bottom: var(--sp-10); }
a.k-btn { text-decoration: none; }
.lh-main:focus { outline: none; }

.lh-skip {
  position: absolute; left: var(--sp-3); top: -60px; z-index: 100;
  background: var(--c-primary-600); color: var(--c-on-primary); padding: var(--sp-2) var(--sp-4); /* G7: 600 เพื่อให้ตัวอักษร ≥ 4.5:1 */
  border-radius: var(--r-pill); font-weight: 700; text-decoration: none;
}
.lh-skip:focus { top: var(--sp-3); }

/* ---------- Header ---------- */
.lh-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--c-bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
}
.lh-header__in { display: flex; align-items: center; gap: var(--sp-4); min-height: 64px; flex-wrap: wrap; padding-block: var(--sp-2); }
.lh-brand { display: inline-flex; align-items: center; gap: var(--sp-3); text-decoration: none; color: var(--c-ink); min-width: 0; }
.lh-brand:hover { color: var(--c-ink); }
.lh-brand__mark {
  width: 40px; height: 40px; flex: none; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--c-accent), color-mix(in srgb, var(--c-accent) 70%, var(--c-ink) 30%)); color: #fff;
  box-shadow: var(--sh-1), inset 0 -3px 0 rgba(0, 0, 0, .14);
}
.lh-brand__txt { display: flex; flex-direction: column; line-height: 1.15; font-weight: 800; font-size: var(--fs-lg); }
.lh-brand__txt small { font-weight: 600; font-size: var(--fs-xs); color: var(--c-ink-3); }
.lh-nav { display: flex; gap: var(--sp-1); margin-left: var(--sp-4); }
.lh-nav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--sp-3);
  border-radius: var(--r-pill); text-decoration: none; color: var(--c-ink-2); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap;
}
.lh-nav a:hover { background: var(--c-surface-3); color: var(--c-ink); }
.lh-nav a[aria-current="page"] { background: var(--c-primary-soft); color: var(--c-primary-ink); }
.lh-tools { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.lh-tools .k-btn { color: var(--c-ink-2); }
@media (max-width: 860px) {
  .lh-header__in { gap: var(--sp-2); }
  .lh-brand__txt small { display: none; }
  .lh-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .lh-nav::-webkit-scrollbar { display: none; }
  .lh-nav a { flex: none; }
}

/* ---------- Hero ---------- */
.lh-hero {
  position: relative; margin-top: var(--sp-5); border-radius: var(--r-xl); overflow: hidden;
  border: 1px solid var(--c-border);
  background:
    radial-gradient(60% 90% at 92% 0%, color-mix(in srgb, var(--c-accent) 26%, transparent), transparent 70%),
    radial-gradient(55% 80% at 0% 100%, color-mix(in srgb, var(--c-primary) 20%, transparent), transparent 72%),
    radial-gradient(40% 60% at 60% 110%, color-mix(in srgb, var(--c-grape) 14%, transparent), transparent 70%),
    var(--c-surface);
  box-shadow: var(--sh-2);
}
.lh-hero__grid {
  display: grid; gap: var(--sp-5) var(--sp-8);
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
  grid-template-areas: "copy mascot" "quick mascot";
  padding: var(--sp-8) var(--sp-8) var(--sp-6); align-items: start;
}
.lh-hero--compact .lh-hero__grid { padding: var(--sp-6) var(--sp-8); grid-template-areas: "copy mascot"; align-items: center; }
.lh-hero__copy { grid-area: copy; min-width: 0; }
.lh-hero__quick { grid-area: quick; min-width: 0; }
.lh-hero__mascot { grid-area: mascot; align-self: center; justify-self: center; min-width: 0; }
.lh-eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-2); padding: 4px 12px; border-radius: var(--r-pill);
  background: var(--c-primary-soft); color: var(--c-primary-ink); font-weight: 800; font-size: var(--fs-xs); letter-spacing: .06em;
}
.lh-eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--c-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-primary) 25%, transparent); }
.lh-hero h1 { font-size: clamp(30px, 4.6vw, 52px); line-height: 1.18; margin: var(--sp-3) 0 var(--sp-3); letter-spacing: -.01em; }
.lh-hero--compact h1 { font-size: clamp(26px, 3.4vw, 38px); margin: var(--sp-2) 0; }
.lh-hero h1 em { font-style: normal; color: var(--c-primary-ink); background: linear-gradient(transparent 62%, color-mix(in srgb, var(--c-sun) 55%, transparent) 62%); padding: 0 .1em; }
.lh-lead { font-size: var(--fs-lg); color: var(--c-ink-2); max-width: 60ch; margin-bottom: var(--sp-4); }
.lh-hero--compact .lh-lead { font-size: var(--fs-md); margin-bottom: var(--sp-3); }
.lh-stats { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.lh-stats li {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 14px; border-radius: var(--r-pill);
  background: var(--c-surface); border: 1px solid var(--c-border); font-size: var(--fs-sm); color: var(--c-ink-2);
}
.lh-stats b { font-size: var(--fs-lg); color: var(--c-ink); font-variant-numeric: tabular-nums; }
.lh-hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); }

.lh-mascot { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); max-width: 280px; }
.lh-bubble {
  position: relative; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); background: var(--c-surface);
  border: 1.5px solid var(--c-border-strong); box-shadow: var(--sh-1); font-weight: 600; font-size: var(--fs-sm); text-align: center; color: var(--c-ink);
}
.lh-bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -9px; width: 16px; height: 16px; background: var(--c-surface);
  border-right: 1.5px solid var(--c-border-strong); border-bottom: 1.5px solid var(--c-border-strong);
  transform: translateX(-50%) rotate(45deg);
}
.lh-mascot svg { width: 168px; height: 168px; filter: drop-shadow(0 10px 14px rgba(30, 42, 69, .16)); animation: lh-bob 4.2s ease-in-out infinite; }
.lh-hero--compact .lh-mascot svg { width: 120px; height: 120px; }
@keyframes lh-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
:root[data-mascot="off"] .lh-hero__mascot { display: none; }
:root[data-mascot="off"] .lh-hero__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "quick"; }
:root[data-mascot="off"] .lh-hero--compact .lh-hero__grid { grid-template-areas: "copy"; }

/* เริ่มสอนเร็ว */
.lh-quick {
  display: grid; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--c-surface) 92%, transparent); border: 1.5px solid color-mix(in srgb, var(--c-primary) 40%, var(--c-border));
  box-shadow: var(--sh-1); max-width: 760px;
}
.lh-quick h2 { font-size: var(--fs-lg); margin: 0; display: flex; align-items: center; gap: var(--sp-2); }
.lh-quick p { margin: 0; color: var(--c-ink-2); font-size: var(--fs-sm); }
.lh-quick__row { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }
.lh-quick__row .k-select { flex: 1 1 260px; min-width: 0; }

@media (max-width: 900px) {
  .lh-hero__grid, .lh-hero--compact .lh-hero__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "mascot" "copy" "quick"; padding: var(--sp-5) var(--sp-4) var(--sp-4); gap: var(--sp-4); }
  .lh-hero--compact .lh-hero__grid { grid-template-areas: "mascot" "copy"; }
  .lh-mascot { flex-direction: row; max-width: none; width: 100%; }
  .lh-mascot svg, .lh-hero--compact .lh-mascot svg { width: 72px; height: 72px; flex: none; }
  .lh-bubble { text-align: left; flex: 1; }
  .lh-bubble::after { left: -9px; bottom: auto; top: 50%; transform: translateY(-50%) rotate(135deg); }
  .lh-hero__mascot { justify-self: stretch; }
  .lh-lead { font-size: var(--fs-md); }
}

/* ---------- Section ---------- */
.lh-section { margin-top: var(--sp-8); }
.lh-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.lh-heading h2 { margin: 0; font-size: var(--fs-2xl); }
.lh-heading p { margin: 0; color: var(--c-ink-2); }
.lh-kicker { display: block; font-weight: 800; font-size: var(--fs-xs); letter-spacing: .08em; color: var(--c-primary-ink); margin-bottom: 2px; }

/* ---------- เส้นทางเข้า (3 การ์ดใหญ่) ---------- */
.lh-paths { display: grid; gap: var(--sp-5); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lh-path {
  position: relative; display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-5); border-radius: var(--r-xl); text-decoration: none; color: var(--c-ink);
  background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--sh-1);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur);
}
.lh-path:hover { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: var(--topic, var(--c-primary)); color: var(--c-ink); }
.lh-path__no { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; color: var(--c-ink-3); }
.lh-path__ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--topic-soft, var(--c-primary-soft)); color: var(--topic, var(--c-primary-700)); }
.lh-path h3 { margin: var(--sp-2) 0 0; font-size: var(--fs-xl); }
.lh-path p { margin: 0; color: var(--c-ink-2); font-size: var(--fs-sm); }
.lh-path__cta { margin-top: auto; padding-top: var(--sp-3); font-weight: 800; color: var(--c-primary-ink); }
@media (max-width: 900px) { .lh-paths { grid-template-columns: minmax(0, 1fr); } }

/* ---------- ขั้นตอนการทดลอง ---------- */
.lh-flow { display: grid; gap: var(--sp-3); grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; counter-reset: lhf; }
.lh-flow li {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: var(--sp-4) var(--sp-3) var(--sp-3);
  border-radius: var(--r-lg); background: var(--c-surface); border: 1px dashed var(--c-border-strong); font-size: var(--fs-sm); color: var(--c-ink-2); counter-increment: lhf;
}
.lh-flow li::before {
  content: counter(lhf); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--c-primary-600); color: var(--c-on-primary); font-weight: 800; margin-bottom: var(--sp-1);
}
.lh-flow b { color: var(--c-ink); font-size: var(--fs-md); }
@media (max-width: 1000px) { .lh-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .lh-flow { grid-template-columns: minmax(0, 1fr); } }

/* ---------- เลือกตามชั้น / หมวด ---------- */
.lh-grades { display: grid; gap: var(--sp-3); grid-template-columns: repeat(6, minmax(0, 1fr)); }
.lh-grade {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--sp-4) var(--sp-2); border-radius: var(--r-lg); text-decoration: none;
  background: var(--c-surface); border: 1.5px solid var(--c-border); color: var(--c-ink); box-shadow: var(--sh-1);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.lh-grade:hover { transform: translateY(-3px); border-color: var(--c-primary); box-shadow: var(--sh-2); color: var(--c-ink); }
.lh-grade b { font-size: var(--fs-2xl); line-height: 1.1; }
.lh-grade span { font-size: var(--fs-xs); color: var(--c-ink-2); font-weight: 600; }
@media (max-width: 760px) { .lh-grades { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lh-topics { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.lh-topics a { text-decoration: none; }

/* ---------- ตัวกรอง ---------- */
.lh-filters {
  display: grid; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-radius: var(--r-lg);
  background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--sh-1);
}
.lh-search-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }
.lh-search { position: relative; flex: 1 1 320px; min-width: 0; }
.lh-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--c-ink-3); pointer-events: none; }
.lh-search input {
  width: 100%; height: 48px; padding: 0 44px 0 46px; border-radius: var(--r-pill); border: 1.5px solid var(--c-border-strong);
  background: var(--c-surface-2); font-size: var(--fs-md);
}
.lh-search input::placeholder { color: var(--c-ink-3); }
.lh-search input:focus { outline: none; border-color: var(--c-primary); box-shadow: var(--sh-focus); background: var(--c-surface); }
.lh-search__clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: transparent; color: var(--c-ink-3); cursor: pointer; display: grid; place-items: center;
}
.lh-search__clear:hover { background: var(--c-surface-3); color: var(--c-ink); }
.lh-search-hint { font-size: var(--fs-xs); color: var(--c-ink-3); margin: 0; }
.lh-frow { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.lh-flabel { flex: none; font-weight: 700; font-size: var(--fs-sm); color: var(--c-ink-2); min-width: 64px; }
.lh-fgroup { display: flex; gap: var(--sp-2); min-width: 0; overflow-x: auto; scrollbar-width: thin; padding: 2px 2px 6px; flex: 1 1 auto; }
.lh-fgroup > * { flex: none; }
.lh-count { font-weight: 600; font-size: .85em; color: var(--c-ink-3); /* G7: เดิม opacity .7 → 3.2:1 */ font-variant-numeric: tabular-nums; margin-left: 2px; }
.lh-chip[data-topic] { border-color: color-mix(in srgb, var(--topic) 45%, var(--c-border)); }
.lh-chip[data-topic]::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--topic); flex: none; }
.lh-chip[data-empty="true"] { opacity: .45; }
.lh-chip[aria-pressed="true"][data-topic] { background: var(--topic-soft); border-color: var(--topic); }
.lh-fopts { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }
.lh-fopts .k-select { min-width: 220px; max-width: 100%; }
.lh-fopts .lh-flabel { min-width: 0; }
.lh-fsel { display: flex; align-items: center; gap: var(--sp-3); flex: 1 1 360px; min-width: 0; max-width: 560px; }
.lh-fsel .k-select { flex: 1 1 auto; min-width: 0; }
@media (max-width: 640px) { .lh-fsel { flex-direction: column; align-items: stretch; gap: 2px; max-width: none; } }
.lh-toggle {
  display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 40px; padding: 0 var(--sp-3); border-radius: var(--r-pill);
  border: 1.5px solid var(--c-border); background: var(--c-surface); color: var(--c-ink-2); font-weight: 700; font-size: var(--fs-sm); cursor: pointer;
}
.lh-toggle:hover { border-color: var(--c-border-strong); }
.lh-toggle[aria-pressed="true"] { background: var(--c-primary-soft); border-color: var(--c-primary); color: var(--c-primary-ink); }
@media (max-width: 640px) {
  .lh-filters { padding: var(--sp-3) var(--sp-4); }
  .lh-frow { flex-direction: column; align-items: stretch; gap: 2px; }
  .lh-flabel { min-width: 0; }
  .lh-fopts .k-select { flex: 1 1 100%; }
}
.lh-resultbar { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin: var(--sp-5) 0 var(--sp-3); color: var(--c-ink-2); font-size: var(--fs-sm); }
.lh-resultbar p { margin: 0; font-weight: 700; color: var(--c-ink); }
.lh-resultbar span { color: var(--c-ink-3); }

/* ---------- กลุ่ม + การ์ด ---------- */
.lh-group + .lh-group { margin-top: var(--sp-8); }
.lh-ghead { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); padding-bottom: var(--sp-2); border-bottom: 2px dashed var(--c-border-strong); }
.lh-ghead h3 { margin: 0; font-size: var(--fs-xl); }
.lh-ghead h3 .lh-gdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--topic, var(--c-primary)); margin-right: 8px; }
.lh-ghead span { color: var(--c-ink-2); font-weight: 600; }
.lh-ghead small { margin-left: auto; color: var(--c-ink-3); font-size: var(--fs-sm); }

.lh-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); }
.lh-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); box-shadow: var(--sh-1);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.lh-card:hover, .lh-card:focus-within { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: color-mix(in srgb, var(--topic, var(--c-primary)) 55%, var(--c-border)); }
.lh-card__cover { position: relative; aspect-ratio: 8 / 5; background: var(--topic-soft, var(--c-surface-3)); overflow: hidden; border-bottom: 1px solid var(--c-border); }
.lh-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
.lh-card:hover .lh-card__cover img { transform: scale(1.04); }
.lh-card__flags { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.lh-card__flags .k-badge { box-shadow: var(--sh-1); }
.lh-card__body { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4); flex: 1 1 auto; }
.lh-card__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lh-card__chap { font-size: var(--fs-xs); color: var(--c-ink-3); font-weight: 700; margin-left: auto; }
.lh-card__title { font-size: var(--fs-lg); margin: 0; line-height: 1.3; }
.lh-card__link { color: var(--c-ink); text-decoration: none; }
.lh-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.lh-card__link:hover { color: var(--c-ink); }
.lh-card__link:focus-visible { box-shadow: none; }
.lh-card:has(.lh-card__link:focus-visible) { outline: 3px solid var(--c-primary-ink); outline-offset: 2px; /* G7: วงโฟกัสทึบ (เดิมโปร่ง 55%) */ }
.lh-card__en { margin: -2px 0 0; font-size: var(--fs-xs); color: var(--c-ink-3); font-weight: 600; }
.lh-card__sum { margin: 0; font-size: var(--fs-sm); color: var(--c-ink-2); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lh-card__modes { display: flex; flex-wrap: wrap; gap: 6px; position: relative; z-index: 2; }
.lh-card__modes a {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700;
  background: var(--topic-soft, var(--c-surface-3)); color: var(--c-ink); text-decoration: none; border: 1px solid transparent; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lh-card__modes a:hover { border-color: var(--topic, var(--c-primary)); color: var(--c-ink); }
.lh-card__modes .lh-more { background: transparent; color: var(--c-ink-3); font-size: var(--fs-xs); align-self: center; font-weight: 700; }
.lh-card__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-top: auto; padding-top: var(--sp-2); flex-wrap: wrap; }
.lh-card__nums { font-size: var(--fs-xs); color: var(--c-ink-2); font-weight: 600; line-height: 1.4; }
.lh-card__nums b { color: var(--c-ink); font-variant-numeric: tabular-nums; }
.lh-card__btns { position: relative; z-index: 2; display: flex; gap: var(--sp-2); flex: none; }
.lh-hit { background: color-mix(in srgb, var(--c-sun) 40%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
@media (max-width: 480px) { .lh-grid { grid-template-columns: minmax(0, 1fr); } }

.lh-empty { margin-top: var(--sp-6); }
.lh-empty .lh-mascot { max-width: none; }
.lh-empty svg { width: 120px; height: 120px; }

/* ---------- International Pack (รายการ) ---------- */
.lh-intl { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lh-intl a {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); min-height: 56px;
  border-radius: var(--r-lg); border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-ink); text-decoration: none; box-shadow: var(--sh-1);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.lh-intl a:hover { transform: translateY(-2px); border-color: var(--topic, var(--c-primary)); box-shadow: var(--sh-2); color: var(--c-ink); }
.lh-intl a[hidden] { display: none; }
.lh-intl__no { font-size: var(--fs-xs); font-weight: 800; color: var(--c-ink-3); font-variant-numeric: tabular-nums; }
.lh-intl__name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; font-weight: 700; }
.lh-intl__name small { font-weight: 600; font-size: var(--fs-xs); color: var(--c-ink-3); overflow: hidden; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; } /* ชื่อไทยยาวขึ้น 2 บรรทัดแทนการตัด … */
.lh-intl__arrow { color: var(--c-ink-3); }
.lh-level { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 800; white-space: nowrap; background: var(--c-surface-3); color: var(--c-ink-2); }
.lh-level[data-level="alevel"] { background: var(--c-info-soft); color: var(--c-info-ink); }
.lh-level[data-level="apib"] { background: var(--c-warn-soft); color: var(--c-warn-ink); }
.lh-level[data-level="olympiad"] { background: var(--c-danger-soft); color: var(--c-danger-ink); }
.lh-level[data-level="university"] { background: var(--c-primary-soft); color: var(--c-primary-ink); }
@media (max-width: 860px) { .lh-intl { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .lh-intl a { grid-template-columns: 28px minmax(0, 1fr) auto; } .lh-intl__arrow { display: none; } }

/* ---------- Cross-link ---------- */
.lh-cross {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); flex-wrap: wrap; margin-top: var(--sp-10);
  padding: var(--sp-6) var(--sp-8); border-radius: var(--r-xl); border: 1px solid var(--c-border);
  background: linear-gradient(120deg, color-mix(in srgb, var(--c-accent) 14%, var(--c-surface)), color-mix(in srgb, var(--c-sky) 14%, var(--c-surface)));
}
.lh-cross h2 { margin: 0 0 4px; font-size: var(--fs-xl); }
.lh-cross p { margin: 0; color: var(--c-ink-2); }
.lh-cross__actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
@media (max-width: 640px) { .lh-cross { padding: var(--sp-5) var(--sp-4); } }

/* ---------- Footer ---------- */
.lh-footer { border-top: 1px solid var(--c-border); background: color-mix(in srgb, var(--c-surface) 70%, transparent); padding: var(--sp-5) 0; color: var(--c-ink-2); font-size: var(--fs-sm); }
.lh-footer__in { display: flex; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }
.lh-footer a { color: var(--c-ink); font-weight: 700; text-decoration: none; }
.lh-footer a:hover { color: var(--c-primary-ink); text-decoration: underline; }

/* ---------- หน้า redirect/แผนที่แลปฝึก ---------- */
.lh-card-plain { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: var(--sp-5); }
.lh-map { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.lh-map th, .lh-map td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.lh-map th { color: var(--c-ink-2); font-size: var(--fs-xs); letter-spacing: .04em; }
.lh-map td:first-child { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--c-ink-3); font-weight: 700; }
.lh-map a { font-weight: 700; }
.lh-mapwrap { overflow-x: auto; }

/* โหมดโปรเจกเตอร์ */
:root[data-projector="on"] .lh-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
:root[data-projector="on"] .lh-card__sum { -webkit-line-clamp: 4; }

@media (prefers-reduced-motion: reduce) {
  .lh-mascot svg { animation: none; }
  .lh-card:hover, .lh-card:focus-within, .lh-path:hover, .lh-grade:hover, .lh-intl a:hover { transform: none; }
}
