/* Knowledge map (screens/map.js, .km-*) and parent area (screens/parent.js, .pa-*). Colours come from style.css :root. */

/* ================= stars (shared by map and parent) ================= */
.km-star { --km-s: 56px; position: relative; display: inline-block; width: var(--km-s); height: var(--km-s); flex: none; vertical-align: middle; }
.km-svg { position: absolute; left: 0; bottom: 0; width: var(--km-s); height: var(--km-s); display: block; overflow: visible; }
.km-svg path { stroke-width: 6; stroke-linejoin: round; }
.km-fill { position: absolute; left: 0; right: 0; bottom: 0; overflow: hidden; }
.km-open .km-base path { fill: #fff; stroke: #8EA5D1; }
.km-learning .km-base path { fill: #FFF6D9; stroke: #EDB200; }
.km-learning .km-top path { fill: #FFCB3D; stroke: #EDB200; }
.km-mastered .km-base path { fill: #FFC62E; stroke: #E0A200; }
.km-mastered .km-base { filter: drop-shadow(0 2px 0 rgba(200, 140, 0, .35)); }
.km-locked .km-base path { fill: #E7EBF2; stroke: #CBD3E1; }
.km-shine { position: absolute; left: 36%; top: 34%; width: 13%; height: 13%; border-radius: 50%; background: rgba(255, 255, 255, .85); }
.km-lock { position: absolute; right: -6%; bottom: -4%; font-size: calc(var(--km-s) * .4); line-height: 1; }

.km-pill { display: inline-block; font-weight: 900; font-size: 13px; padding: 4px 11px; border-radius: 999px; letter-spacing: .3px; white-space: nowrap; }
.km-pill-mastered { background: #FFF1C2; color: #7A5700; }
.km-pill-learning { background: #E6EFFF; color: #2556A8; }
.km-pill-open { background: #E3F7F0; color: #0B6E53; }
.km-pill-locked { background: #EEF1F6; color: #5C6378; }

/* ================= knowledge map ================= */
.km { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px 36px; display: flex; flex-direction: column; gap: 16px; }
.km-head { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; padding: 14px 28px 18px 18px; }
.km-bot svg { display: block; }
.km-head-body { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.km-title { font-size: 28px; }
.km-sub { margin: 0; color: var(--ink2); font-weight: 700; }
.km-bar { display: flex; gap: 3px; height: 14px; border-radius: 999px; background: #EEF2F8; overflow: hidden; }
.km-bar-seg { height: 100%; flex-basis: 0; }
.km-bar-seg.m { background: #FFC62E; }
.km-bar-seg.l { background: #FFE6A0; }
.km-bar-seg.r { background: #EEF2F8; }
.km-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-weight: 700; color: var(--ink2); font-size: 16px; }
.km-leg { display: inline-flex; align-items: center; gap: 7px; }
.km-leg b { color: var(--ink); }

.km-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.km-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 6px 15px; font-size: 16px; transition: transform .08s; }
.km-chip:active { transform: scale(.97); }
.km-chip-ic { font-size: 18px; line-height: 1; }
.km-chip-n { font-size: 13px; font-weight: 800; color: var(--muted); }
.km-chip.on .km-chip-n { color: rgba(255, 255, 255, .85); }
.km-chip:focus-visible, .km-node:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.km-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 16px; align-items: start; }
.km-board.single { grid-template-columns: 1fr; }
.km-dom { padding: 12px 16px 14px; min-width: 0; }
.km-dom.wide { grid-column: 1 / -1; }
.km-dom-head { display: flex; align-items: center; gap: 10px; margin: 0 4px 6px; }
.km-dom-ic { width: 38px; height: 38px; border-radius: 12px; background: #F2F6FC; display: grid; place-items: center; font-size: 21px; flex: none; }
.km-dom-titles { flex: 1; min-width: 0; }
.km-dom-head h3 { font-size: 21px; margin: 0; }
.km-dom-dist { display: block; color: var(--muted); font-weight: 700; }
.km-dom-n { font-weight: 800; color: #7A5700; background: #FFF4CF; border-radius: 999px; padding: 4px 12px; font-size: 15px; white-space: nowrap; }
.km-nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 4px; }
.km-board.single .km-nodes { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.km-board.single .km-star { --km-s: 70px; }
.km-node { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: 16px; min-height: 48px; min-width: 0; transition: transform .12s, background .15s; }
.km-node:hover { background: #F3F7FF; transform: translateY(-2px); }
.km-node:active { transform: scale(.96); }
.km-name { font-size: 14px; font-weight: 800; line-height: 1.15; text-align: center; max-width: 100%; overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.km-node-locked .km-name { color: var(--muted); font-weight: 700; }
.km-node-mastered .km-name { color: #6B4D00; }

.km-modal { max-width: 540px; }
.km-modal-body { display: flex; gap: 22px; align-items: center; }
.km-modal-star { flex: none; }
.km-modal-info { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; min-width: 0; }
.km-modal-info p { margin: 0; font-size: 19px; }
.km-modal-row { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink2); }
.km-tiers { font-size: 26px; letter-spacing: 2px; line-height: 1; }
.km-tier { color: #E3E8F2; }
.km-tier.on { color: #FFC300; }
.km-empty { padding: 30px; display: flex; flex-direction: column; align-items: center; font-size: 22px; font-weight: 800; }

/* ================= parent area ================= */
.pa { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px 36px; display: flex; flex-direction: column; gap: 16px; font-size: 17px; }
.pa-note { color: var(--ink2); font-size: 15px; font-weight: 600; margin: 8px 0 0; line-height: 1.4; }
.pa-empty { color: var(--muted); font-weight: 700; margin: 6px 0; }
.pa-btns { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pa-btn-s { padding: 10px 16px; font-size: 15px; min-height: 44px; }
.btn.pa-btn-quiet { background: transparent; color: var(--ink2); box-shadow: none; }
.btn.pa-btn-quiet:hover { background: #F2F6FC; filter: none; }

/* gate */
.pa-gate { flex: 1; display: grid; place-items: center; padding: 8px 0 20px; }
.pa-gate-card { width: 100%; max-width: 460px; padding: 22px 28px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.pa-gate-ic { font-size: 42px; line-height: 1; }
.pa-gate-card h2 { font-size: 26px; }
.pa-gate-lead { margin: 0; color: var(--ink2); font-weight: 700; }
.pa-words { font-size: 23px; font-weight: 900; color: var(--blue-d); margin: 6px 0 2px; line-height: 1.25; }
.pa-gate-msg { margin: 2px 0 0; min-height: 22px; font-weight: 700; color: var(--ink2); font-size: 16px; }
.pa-gate-msg.bad, .pa-pin-msg.bad { color: #D94B4B; }
.pa-link { color: var(--blue-d); font-weight: 800; font-size: 16px; text-decoration: underline; padding: 10px 12px; min-height: 44px; }
.pa-pad { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 4px; }
.pa-pad.off { opacity: .45; pointer-events: none; }
.pa-cells { display: flex; gap: 12px; }
.pa-cell { width: 52px; height: 60px; border-radius: 14px; background: #F4F7FC; box-shadow: inset 0 0 0 3px var(--line); display: grid; place-items: center; font-size: 30px; font-weight: 900; }
.pa-cell.on { box-shadow: inset 0 0 0 3px var(--blue); background: #fff; }
.pa-cells.mask .pa-cell { width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px #B8C6E0; }
.pa-cells.mask .pa-cell.on { background: var(--blue); box-shadow: none; }
.pa-keys { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; }
.pa-key { height: 58px; border-radius: 16px; background: #fff; font-size: 26px; font-weight: 900; box-shadow: 0 4px 0 var(--line), inset 0 0 0 2px var(--line); }
.pa-key:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line), inset 0 0 0 2px var(--line); }
.pa-key.fn { color: var(--ink2); background: #F7F9FD; font-size: 22px; }
.pa-key:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.pa-pin-setup { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pa-pin-msg { font-weight: 800; font-size: 19px; text-align: center; margin: 0 0 4px; }
.pa-pin-modal { max-width: 420px; }

/* header: tabs, children, tip */
.pa-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; background: #fff; padding: 6px; border-radius: 999px; box-shadow: var(--sh); }
.pa-tab { min-height: 48px; border-radius: 999px; font-weight: 800; font-size: 17px; color: var(--ink2); padding: 8px 10px; }
.pa-tab:hover:not(.on) { background: #F2F6FC; }
.pa-tab.on { background: var(--blue); color: #fff; }
.pa-tab:focus-visible, .pa-kid:focus-visible, .pa-switch:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.pa-tip { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: #FFF6D6; border-radius: var(--r-s); padding: 10px 16px; font-weight: 700; }
.pa-body { display: flex; flex-direction: column; gap: 16px; }
.pa-kids { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pa-kids-l { font-weight: 800; color: var(--ink2); }
.pa-kid { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 16px 4px 6px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); }
.pa-kid svg { display: block; }
.pa-kid small { color: var(--muted); font-weight: 700; }
.pa-kid.on { box-shadow: inset 0 0 0 3px var(--blue); background: #EEF4FF; }

/* cards, grids */
.pa-card { padding: 16px 20px 18px; min-width: 0; }
.pa-card-t { font-size: 19px; margin-bottom: 12px; }
.pa-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.pa-charts { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.pa-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* KPIs */
.pa-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.pa-kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; position: relative; min-width: 0; }
.pa-kpi-ic { position: absolute; right: 12px; top: 10px; font-size: 22px; }
.pa-kpi-v { font-size: 32px; font-weight: 900; line-height: 1.1; }
.pa-kpi-of { font-size: 16px; color: var(--ink2); font-weight: 800; }
.pa-kpi-l { font-weight: 800; color: var(--ink2); font-size: 15px; line-height: 1.2; }
.pa-kpi small { color: var(--muted); font-weight: 700; font-size: 13px; }

/* charts */
.pa-heat-wrap, .pa-bars-wrap { overflow: hidden; }
.pa-heat { max-width: 100%; height: auto; display: block; }
.pa-bars { width: 100%; height: auto; display: block; }
.pa-hm-0 { fill: #EDF1F7; }
.pa-hm-1 { fill: #CFE0FC; }
.pa-hm-2 { fill: #93BAF7; }
.pa-hm-3 { fill: #4F8EF7; }
.pa-hm-4 { fill: #2459B8; }
.pa-today { stroke: var(--ink); stroke-width: 2; }
.pa-ax { font-size: 12px; font-weight: 700; fill: var(--muted); }
.pa-ax.sm { font-size: 11px; }
.pa-ax.b { fill: var(--ink); font-weight: 900; }
.pa-grid { stroke: #EDF1F7; stroke-width: 1; }
.pa-base { stroke: #B8C3D6; stroke-width: 1.5; }
.pa-bar { fill: #93BAF7; }
.pa-bar.met { fill: var(--blue); }
.pa-bar-g:hover .pa-bar { fill: var(--blue-d); }
.pa-hit { fill: transparent; }
.pa-val { font-size: 12px; font-weight: 800; fill: var(--ink2); }
.pa-goal { stroke: var(--orange); stroke-width: 2; stroke-dasharray: 6 5; }
.pa-empty-t { font-size: 16px; font-weight: 800; fill: var(--muted); }
.pa-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--ink2); }
.pa-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.pa-sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.pa-sw-met { background: var(--blue); }
.pa-sw-under { background: #93BAF7; }
.pa-sw-goal { display: inline-block; width: 22px; border-top: 2px dashed var(--orange); }
i.pa-hm-0 { background: #EDF1F7; } i.pa-hm-1 { background: #CFE0FC; } i.pa-hm-2 { background: #93BAF7; } i.pa-hm-3 { background: #4F8EF7; } i.pa-hm-4 { background: #2459B8; }

/* accuracy by domain */
.pa-accs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 44px; }
.pa-acc { display: grid; grid-template-columns: minmax(0, 190px) minmax(60px, 1fr) 92px; gap: 12px; align-items: center; }
.pa-acc-name { display: grid; grid-template-columns: 26px 1fr; column-gap: 6px; align-items: center; min-width: 0; }
.pa-acc-name b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-acc-name small { grid-column: 2; color: var(--muted); font-weight: 700; font-size: 12px; }
.pa-acc-track { height: 12px; background: #EDF1F7; border-radius: 999px; overflow: hidden; }
.pa-acc-fill { display: block; height: 100%; border-radius: 999px; }
.pa-acc-fill.good { background: var(--green); }
.pa-acc-fill.mid { background: #FFB020; }
.pa-acc-fill.low { background: var(--red); }
.pa-acc-v { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.pa-acc-v small, .pa-weak-v small { color: var(--muted); font-weight: 700; font-size: 12px; white-space: nowrap; }

/* needs attention */
.pa-weak { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.pa-weak li { display: flex; align-items: center; gap: 10px; background: #FFF6F0; border-radius: var(--r-s); padding: 8px 12px; }
.pa-weak-ic { width: 34px; height: 34px; border-radius: 10px; background: #fff; display: grid; place-items: center; font-size: 18px; flex: none; }
.pa-weak-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pa-weak-txt small { color: var(--muted); font-weight: 700; font-size: 13px; }
.pa-weak-v { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }

/* recent sessions */
.pa-table-wrap { overflow-x: auto; }
.pa-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.pa-table th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 6px 10px; border-bottom: 2px solid var(--line); }
.pa-table td { padding: 9px 10px; border-bottom: 1px solid #EEF2F8; }
.pa-table tr:last-child td { border-bottom: 0; }
.pa-table td small { color: var(--muted); font-weight: 700; }
.pa-stopped { color: #B86200 !important; }

/* skills tab */
.pa-hint { margin: 0; }
.pa-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pa-chip { min-height: 44px; font-size: 15px; padding: 8px 14px; }
.pa-chip-n { opacity: .7; font-weight: 800; }
.pa-sk-card { padding: 12px 16px 8px; }
.pa-sk-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.pa-sk-head .pa-weak-ic { background: #F2F6FC; }
.pa-sk-head h3 { font-size: 19px; flex: 1; }
.pa-sk-head small { color: var(--ink2); font-weight: 800; }
.pa-sk-row { display: grid; grid-template-columns: minmax(0, 1fr) 118px 104px 124px 220px; gap: 10px; align-items: center; padding: 6px 4px; border-top: 1px solid #EEF2F8; }
.pa-sk-th { border-top: 0; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding-bottom: 2px; }
.pa-sk-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pa-sk-name > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.pa-sk-name b { font-size: 16px; line-height: 1.2; }
.pa-sk-name small, .pa-sk-acc small { color: var(--muted); font-weight: 700; font-size: 13px; }
.pa-sk-last { color: var(--ink2); font-size: 15px; font-weight: 600; }
.pa-sk-row .pa-btn-s { justify-self: end; white-space: nowrap; }

/* settings */
.pa-inline { display: flex; gap: 12px; align-items: center; }
.pa-inp { font-size: 20px; padding: 10px 14px; }
.pa-settings .lbl { margin: 14px 0 8px; font-size: 16px; }
.pa-settings .lbl:first-of-type { margin-top: 0; }
.pa-sep { height: 2px; background: #EEF2F8; margin: 16px 0 6px; }
.pa-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.pa-action > div { display: flex; flex-direction: column; min-width: 0; }
.pa-action small, .pa-row-txt small { color: var(--ink2); font-weight: 600; font-size: 14px; line-height: 1.35; }
.pa-action .btn { flex: none; }
.pa-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #EEF2F8; }
.pa-row-txt { display: flex; flex-direction: column; min-width: 0; }
.pa-switch { flex: none; width: 64px; height: 38px; border-radius: 999px; background: #D5DCE8; position: relative; transition: background .2s; }
.pa-switch::before { content: ''; position: absolute; inset: -5px -2px; } /* bigger hit area */
.pa-knob { position: absolute; left: 4px; top: 4px; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .18); transition: transform .2s; }
.pa-switch.on { background: var(--green); }
.pa-switch.on .pa-knob { transform: translateX(26px); }
.pa-voice { padding: 10px 0 4px; display: flex; flex-direction: column; gap: 10px; }
.pa-vst-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pa-vst { font-size: 14px; font-weight: 800; padding: 6px 12px; border-radius: 999px; }
.pa-vst.ok { background: #E3F7F0; color: #0B6E53; }
.pa-vst.no { background: #FFF0E6; color: #A34E00; }
.pa-how { background: #F7F9FD; border-radius: var(--r-s); padding: 10px 14px; font-size: 15px; }
.pa-how summary { font-weight: 800; cursor: pointer; min-height: 28px; }
.pa-how ol { margin: 8px 0 2px; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; line-height: 1.4; }

/* about */
.pa-about { display: flex; flex-direction: column; gap: 16px; }
.pa-about p { line-height: 1.5; margin: 10px 0 0; }
.pa-about-head { display: flex; align-items: center; gap: 22px; }
.pa-about-head svg { display: block; }
.pa-logo { font-size: 46px; color: var(--blue); font-weight: 900; }
.pa-tagline { font-size: 19px; font-weight: 700; color: var(--ink2); margin: 4px 0 0 !important; }
.pa-ver { display: inline-block; background: #F2F6FC; border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: 14px; color: var(--ink2); }

/* ================= responsive ================= */
@media (max-width: 1150px) {
  .pa-sk-row { grid-template-columns: minmax(0, 1fr) 112px 92px 112px 200px; }
}
@media (max-width: 1000px) {
  .pa-accs, .pa-weak { grid-template-columns: minmax(0, 1fr); }
  .pa-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pa-charts { grid-template-columns: minmax(0, 1fr); }
  .pa-heat { width: 100%; max-width: 420px; }
  .pa-sk-row { grid-template-columns: minmax(0, 1fr) 104px 84px 190px; }
  .pa-sk-row > :nth-child(4) { display: none; }
}
@media (max-width: 900px) {
  .km-board { grid-template-columns: 1fr; }
  .km-chip-n { display: none; }
  .km-chip { padding: 6px 12px; }
  .pa-grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .km, .pa { padding: 0 12px 24px; }
  .km-head { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 14px 16px; }
  .km-legend { justify-content: center; }
  .km-title { font-size: 23px; }
  .km-nodes { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .km-modal-body { flex-direction: column; text-align: center; }
  .km-modal-info { align-items: center; }
  .pa-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pa-tab { font-size: 15px; padding: 6px 4px; }
  .pa-acc { grid-template-columns: minmax(0, 1fr) 80px; }
  .pa-acc-track { grid-column: 1 / -1; grid-row: 2; }
  .pa-sk-row { grid-template-columns: minmax(0, 1fr) auto; }
  .pa-sk-row > :nth-child(3), .pa-sk-th { display: none; }
  .pa-sk-row .pa-btn-s { grid-column: 1 / -1; justify-self: start; }
  .pa-action, .pa-inline { flex-direction: column; align-items: stretch; }
  .pa-about-head { flex-direction: column; text-align: center; }
}
@media (max-height: 720px) {
  .pa-gate-ic { display: none; }
  .pa-gate-card { padding: 16px 24px 18px; gap: 6px; }
  .pa-key { height: 50px; }
  .pa-cell { height: 52px; }
}
/* phones (portrait): two rows of tabs, no text under 14px */
@media (max-width: 700px) {
  .pa-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 28px; }
  .pa-tab { font-size: 16px; }
  .pa-card { padding: 14px 14px 16px; }
  .pa-kpi { padding: 12px 12px; }
  .pa-kpi-v { font-size: 28px; }
  .pa-table td { padding: 8px 6px; }
  .pa-table th { padding: 6px; }
  .pa-gate-card { padding: 18px 16px 20px; }
  .pa-words { font-size: 21px; }
  .pa-cells.mask .pa-cell { width: 24px; height: 24px; }
  .pa-keys { grid-template-columns: repeat(3, 68px); gap: 8px; }
  .pa-key { height: 54px; }
  .km-head { gap: 10px; }
  .km-dom { padding: 10px 10px 12px; }
  .km-chip { font-size: 15px; }
}
/* phones (both orientations): no text under 14px */
@media (max-width: 700px), (max-height: 500px) and (min-width: 560px) {
  .pa-kpi small, .pa-legend, .pa-acc-name small, .pa-acc-v small, .pa-weak-v small, .pa-weak-txt small, .pa-sk-name small,
  .pa-sk-acc small, .pa-table th, .pa-table td small, .pa-kid small, .pa-chip-n, .km-pill, .km-dom-dist, .km-chip-n { font-size: 14px; }
  .pa-sk-th { font-size: 14px; letter-spacing: 0; text-transform: none; }
}
/* phones (landscape): the gate keypad fits the short screen */
@media (max-height: 500px) and (min-width: 560px) {
  .pa { padding: 0 16px 24px; gap: 12px; }
  .pa-gate { padding: 0 0 12px; }
  .pa-gate-card { max-width: 600px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; row-gap: 6px; align-items: center; padding: 12px 20px 14px; text-align: left; }
  .pa-gate-card > :not(.pa-pad) { grid-column: 1; }
  .pa-gate-card > .pa-pad { grid-column: 2; grid-row: 1 / span 5; margin: 0; gap: 8px; }
  .pa-gate-card h2 { font-size: 22px; }
  .pa-cell { width: 44px; height: 46px; font-size: 26px; }
  .pa-keys { grid-template-columns: repeat(3, 64px); gap: 6px; }
  .pa-key { height: 48px; font-size: 24px; }
  .pa-kpi-v { font-size: 28px; }
  .km { padding: 0 16px 24px; }
  .km-head { padding: 10px 18px 12px 12px; }
  .km-bot svg { width: 72px; height: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .km-node, .km-node:hover, .pa-switch, .pa-knob { transition: none; transform: none; }
}
