/* ─────────────────────────────────────────────────────────────
   แผนที่ความรู้ · Knowledge map (parent screen + landing page)
   ───────────────────────────────────────────────────────────── */
.km { position: relative; width: 100%; max-width: 620px; margin: 0 auto; }
.km-svg { display: block; width: 100%; height: auto; overflow: visible; font-family: inherit; -webkit-tap-highlight-color: transparent; }
.km-slice { transition: opacity .25s ease; }
.km-slice.is-dim { opacity: .35; }
.km-edge { transition: opacity .25s ease; }
.km-edge.is-dim { opacity: .12; }
.km-edge.is-lit { stroke: #111412; stroke-opacity: .7; stroke-dasharray: none; stroke-width: 3; }
.km-node, .km-book { cursor: pointer; transition: opacity .25s ease; outline: none; }
.km-node.is-dim, .km-book.is-dim { opacity: .3; }
.km-node .km-ring { opacity: 0; }
.km-node.is-selected .km-ring, .km-node:focus-visible .km-ring { opacity: 1; }
.km-book.is-selected rect:first-of-type, .km-book:focus-visible rect:first-of-type { stroke: #111412; stroke-width: 4; }
.km-centre { cursor: pointer; }
.km-centre-name { font-family: 'Mali', var(--font-kid, cursive); font-weight: 700; font-size: 40px; fill: #111412; }
.km-centre-sub { font-weight: 600; font-size: 24px; fill: #2A2F2B; }
.km-label { font-weight: 600; font-size: 30px; fill: #111412; paint-order: stroke; stroke: #FFFFFF; stroke-width: 9px; stroke-linejoin: round; }
.km-label.is-strong { font-weight: 700; font-size: 34px; }
@media (prefers-reduced-motion: reduce) { .km-slice, .km-edge, .km-node, .km-book { transition: none; } }

/* legend + domain chips */
.km-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted, #5B605C); }
.km-legend li { display: inline-flex; align-items: center; gap: 6px; }
.km-domains { display: flex; flex-wrap: wrap; gap: 6px; }
.km-domain { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 8px; border: 1.5px solid transparent; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600; color: #111412; cursor: pointer; }
.km-domain i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.km-domain[aria-pressed="true"] { border-color: #111412; }

/* language switch */
.km-lang { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--soft, #F5F5F2); border: 1px solid var(--line, #E6E6E1); }
.km-lang button { min-width: 44px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--muted, #5B605C); cursor: pointer; }
.km-lang button[aria-pressed="true"] { background: #111412; color: #FFFFFF; }

/* stage chip */
.km-stage { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 6px; border-radius: 999px; background: var(--soft, #F5F5F2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.km-stage.s3 { background: var(--accent, #C6F36B); }

/* bilingual static text (landing): <span lang="th">…</span><span lang="en">…</span> */
[data-km-lang="th"] [lang="en"]:not(html), [data-km-lang="en"] [lang="th"]:not(html) { display: none !important; }

/* ─────────────────────────────────────────────────────────────
   ต้นไม้ของหนู · My tree (kid home screen)
   Calm by design: new leaves unfold once, nothing loops or blinks.
   ───────────────────────────────────────────────────────────── */
.kt-card { padding: 18px 18px 16px; border-radius: var(--radius-l, 28px); background: linear-gradient(180deg, #F4FBE6 0%, #FFFFFF 78%); border: 1px solid var(--line, #E6E6E1); }
.kt { width: 100%; max-width: 440px; margin: 4px auto 0; }
.kt-svg { display: block; width: 100%; height: auto; max-height: 300px; overflow: visible; -webkit-tap-highlight-color: transparent; }
.kt-leaf { cursor: pointer; outline: none; }
.kt-leaf .kt-body { transform-origin: 0 0; }
.kt-leaf.is-new .kt-body { animation: kt-unfold 1.4s cubic-bezier(.2, .8, .2, 1) both; }
.kt-leaf .kt-glow { opacity: .9; }
.kt-leaf.is-selected .kt-body, .kt-leaf:focus-visible .kt-body { filter: drop-shadow(0 0 0 #111412) drop-shadow(0 0 2px rgba(17, 20, 18, .55)); }
@keyframes kt-unfold { 0% { transform: scale(.05); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .kt-leaf.is-new .kt-body { animation: none; } }

.kt-say { min-height: 26px; margin: 6px 0 0; text-align: center; font-size: 15px; font-weight: 600; color: var(--ink, #111412); }
.kt-say .d { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.kt-grew { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.kt-grew li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px 8px 8px; border-radius: 16px; background: var(--white, #fff); border: 1px solid var(--line, #E6E6E1); }
.kt-grew .ic { flex: none; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 12px; }
.kt-grew .tx { flex: 1 1 auto; min-width: 0; line-height: 1.4; }
.kt-grew .tx b { display: block; font-size: 15px; }
.kt-grew .tx span { font-size: 13px; color: var(--muted, #5B605C); }
.kt-grew .bk { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 52px; padding: 2px; border-radius: 2px 8px 8px 2px; border-left: 5px solid rgba(17, 20, 18, .2); color: var(--ink, #111412); font-family: var(--font-kid); font-weight: 700; font-size: 13px; line-height: 1.1; text-align: center; text-decoration: none; }
.kt-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted, #5B605C); }
.kt-legend li { display: inline-flex; align-items: center; gap: 4px; }
