:root {
  /* Component rules consume these semantic aliases only. Palette experiments
     live in the named theme blocks below. */
  --navy-950: var(--canvas);
  --navy-900: var(--surface);
  --navy-800: var(--surface-raised);
  --cream-100: var(--text-primary);
  --cream-300: var(--text-secondary);
  --lime-400: var(--inverse-surface);
  --lime-500: var(--action-hover);
  --ink-1000: var(--brand-mark-surface);
  --border-subtle: var(--border-hairline);
  --border-default: var(--border-strong);
  --amber-400: var(--chart-series-4);
  --ice-400: var(--chart-series-3);
  --mode-active-border: var(--orientation-accent);
  --mode-active-surface: var(--surface-raised);
  --mode-active-text: var(--text-primary);
  --mode-active-signal: var(--orientation-accent);
  --display: "Montserrat", "Bahnschrift", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --body: "Montserrat", "Aptos", "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --cut-md: 12px;
  --control-press-offset: 1px;
  --motion-immediate: 80ms;
  --motion-fast: 120ms;
  --motion-standard: 200ms;
  --motion-deliberate: 280ms;
}

:root,
:root[data-theme="soft-dark"] {
  color-scheme: dark;
  --canvas: #111315;
  --canvas-rgb: 17 19 21;
  --surface: #1a1e22;
  --surface-rgb: 26 30 34;
  --surface-raised: #242a30;
  --surface-raised-rgb: 36 42 48;
  --text-primary: #f0f1f2;
  --text-primary-rgb: 240 241 242;
  --text-body: #cdd2d6;
  --text-secondary: #929aa1;
  --text-secondary-rgb: 146 154 161;
  --text-tertiary: #69727a;
  --border-hairline: rgb(240 241 242 / 9%);
  --border-strong: rgb(240 241 242 / 24%);
  --inverse-surface: #f0f1f2;
  --inverse-text: #111315;
  --chart-series-1: #5ea8ff;
  --chart-series-1-rgb: 94 168 255;
  --chart-series-2: #72d99a;
  --chart-series-2-rgb: 114 217 154;
  --chart-series-3: #c79bff;
  --chart-series-3-rgb: 199 155 255;
  --chart-series-4: #ffb86b;
  --chart-series-4-rgb: 255 184 107;
  --orientation-accent: var(--chart-series-1);
  --orientation-soft: rgb(94 168 255 / 10%);
  --community-accent: #ff6a3d;
  --community-accent-rgb: 255 106 61;
  --community-soft: rgb(255 106 61 / 12%);
  --accent-soft: rgb(240 241 242 / 6%);
  --action-hover: #d9dcdf;
  --brand-mark-surface: #0b0d0f;
  --surface-gradient-mid: #15181b;
  --node-highlight: #2c333a;
  --node-shadow: #181c20;
  --shadow-rgb: 0 0 0;
  --shadow-floating: 0 8px 30px rgb(0 0 0 / 42%);
  --shadow-sticky: 0 10px 28px rgb(0 0 0 / 34%);
  --shadow-index: 0 10px 24px rgb(0 0 0 / 28%);
  --shadow-dialog: 0 18px 48px rgb(0 0 0 / 58%);
  --shadow-node: 0 8px 22px rgb(0 0 0 / 56%);
  --shadow-graph-inset: inset 0 0 48px rgb(0 0 0 / 68%);
}

:root[data-theme="snowfield-light"] {
  color-scheme: light;
  --canvas: #f3f1ec;
  --canvas-rgb: 243 241 236;
  --surface: #ffffff;
  --surface-rgb: 255 255 255;
  --surface-raised: #e8e5df;
  --surface-raised-rgb: 232 229 223;
  --text-primary: #17212b;
  --text-primary-rgb: 23 33 43;
  --text-body: #3f4b55;
  --text-secondary: #5f6b74;
  --text-secondary-rgb: 95 107 116;
  --text-tertiary: #647078;
  --border-hairline: rgb(23 33 43 / 12%);
  --border-strong: rgb(23 33 43 / 30%);
  --inverse-surface: #17212b;
  --inverse-text: #f3f1ec;
  --chart-series-1: #1265b0;
  --chart-series-1-rgb: 18 101 176;
  --chart-series-2: #197a55;
  --chart-series-2-rgb: 25 122 85;
  --chart-series-3: #7048a8;
  --chart-series-3-rgb: 112 72 168;
  --chart-series-4: #a95f00;
  --chart-series-4-rgb: 169 95 0;
  --orientation-accent: var(--chart-series-1);
  --orientation-soft: rgb(18 101 176 / 10%);
  --community-accent: #b94a1f;
  --community-accent-rgb: 185 74 31;
  --community-soft: rgb(185 74 31 / 11%);
  --accent-soft: rgb(23 33 43 / 5%);
  --action-hover: #2a3742;
  --brand-mark-surface: #17212b;
  --surface-gradient-mid: #e9e6df;
  --node-highlight: #ffffff;
  --node-shadow: #dedad2;
  --shadow-rgb: 23 33 43;
  --shadow-floating: 0 6px 18px rgb(23 33 43 / 11%);
  --shadow-sticky: 0 8px 18px rgb(23 33 43 / 10%);
  --shadow-index: 0 7px 16px rgb(23 33 43 / 8%);
  --shadow-dialog: 0 18px 48px rgb(23 33 43 / 20%);
  --shadow-node: 0 8px 20px rgb(23 33 43 / 14%);
  --shadow-graph-inset: inset 0 0 34px rgb(23 33 43 / 9%);
}

:root[data-theme="webskill-original"] {
  color-scheme: dark;
  --canvas: #071524;
  --canvas-rgb: 7 21 36;
  --surface: #0b1d30;
  --surface-rgb: 11 29 48;
  --surface-raised: #10263a;
  --surface-raised-rgb: 16 38 58;
  --text-primary: #f2e8d5;
  --text-primary-rgb: 242 232 213;
  --text-body: #f2e8d5;
  --text-secondary: #bdb29f;
  --text-secondary-rgb: 189 178 159;
  --text-tertiary: #92897a;
  --border-hairline: rgb(242 232 213 / 18%);
  --border-strong: rgb(242 232 213 / 42%);
  --inverse-surface: #c8ff2e;
  --inverse-text: #071524;
  --chart-series-1: #c8ff2e;
  --chart-series-1-rgb: 200 255 46;
  --chart-series-2: #bdb29f;
  --chart-series-2-rgb: 189 178 159;
  --chart-series-3: #78d9ff;
  --chart-series-3-rgb: 120 217 255;
  --chart-series-4: #ffb852;
  --chart-series-4-rgb: 255 184 82;
  --orientation-accent: var(--chart-series-1);
  --orientation-soft: rgb(200 255 46 / 12%);
  --community-accent: #c8ff2e;
  --community-accent-rgb: 200 255 46;
  --community-soft: rgb(200 255 46 / 12%);
  --accent-soft: rgb(200 255 46 / 12%);
  --mode-active-surface: #c8ff2e;
  --mode-active-text: #071524;
  --mode-active-signal: #071524;
  --action-hover: #aadb1f;
  --brand-mark-surface: #02070b;
  --surface-gradient-mid: #06111d;
  --node-highlight: #173f56;
  --node-shadow: #081725;
  --shadow-rgb: 2 7 11;
  --shadow-floating: 0 8px 30px rgb(2 7 11 / 42%);
  --shadow-sticky: 0 10px 28px rgb(2 7 11 / 34%);
  --shadow-index: 0 10px 24px rgb(2 7 11 / 28%);
  --shadow-dialog: 0 18px 48px rgb(2 7 11 / 58%);
  --shadow-node: 0 8px 22px rgb(2 7 11 / 56%);
  --shadow-graph-inset: inset 0 0 48px rgb(2 7 11 / 68%);
}

:root[data-theme="bluebird-day"] {
  color-scheme: light;
  --canvas: #edf6fa;
  --canvas-rgb: 237 246 250;
  --surface: #ffffff;
  --surface-rgb: 255 255 255;
  --surface-raised: #dcecf3;
  --surface-raised-rgb: 220 236 243;
  --text-primary: #102a3a;
  --text-primary-rgb: 16 42 58;
  --text-body: #334b58;
  --text-secondary: #566c77;
  --text-secondary-rgb: 86 108 119;
  --text-tertiary: #5e737d;
  --border-hairline: rgb(16 42 58 / 12%);
  --border-strong: rgb(16 42 58 / 30%);
  --inverse-surface: #102a3a;
  --inverse-text: #edf6fa;
  --chart-series-1: #006ba6;
  --chart-series-1-rgb: 0 107 166;
  --chart-series-2: #187a62;
  --chart-series-2-rgb: 24 122 98;
  --chart-series-3: #7651a8;
  --chart-series-3-rgb: 118 81 168;
  --chart-series-4: #a65f00;
  --chart-series-4-rgb: 166 95 0;
  --orientation-accent: var(--chart-series-1);
  --orientation-soft: rgb(0 107 166 / 10%);
  --community-accent: #9a5a00;
  --community-accent-rgb: 154 90 0;
  --community-soft: rgb(154 90 0 / 11%);
  --accent-soft: rgb(16 42 58 / 5%);
  --action-hover: #1c3a4b;
  --brand-mark-surface: #102a3a;
  --surface-gradient-mid: #dfeef4;
  --node-highlight: #ffffff;
  --node-shadow: #cbdde4;
  --shadow-rgb: 16 42 58;
  --shadow-floating: 0 6px 18px rgb(16 42 58 / 11%);
  --shadow-sticky: 0 8px 18px rgb(16 42 58 / 10%);
  --shadow-index: 0 7px 16px rgb(16 42 58 / 8%);
  --shadow-dialog: 0 18px 48px rgb(16 42 58 / 20%);
  --shadow-node: 0 8px 20px rgb(16 42 58 / 14%);
  --shadow-graph-inset: inset 0 0 34px rgb(16 42 58 / 9%);
}

:root[data-theme="alpine-paper"] {
  color-scheme: light;
  --canvas: #f2eee3;
  --canvas-rgb: 242 238 227;
  --surface: #fffdf7;
  --surface-rgb: 255 253 247;
  --surface-raised: #e3ddcd;
  --surface-raised-rgb: 227 221 205;
  --text-primary: #203027;
  --text-primary-rgb: 32 48 39;
  --text-body: #445249;
  --text-secondary: #5c6b61;
  --text-secondary-rgb: 92 107 97;
  --text-tertiary: #606d63;
  --border-hairline: rgb(32 48 39 / 12%);
  --border-strong: rgb(32 48 39 / 30%);
  --inverse-surface: #203027;
  --inverse-text: #f2eee3;
  --chart-series-1: #1f6b52;
  --chart-series-1-rgb: 31 107 82;
  --chart-series-2: #5b7a30;
  --chart-series-2-rgb: 91 122 48;
  --chart-series-3: #6c5096;
  --chart-series-3-rgb: 108 80 150;
  --chart-series-4: #a65d00;
  --chart-series-4-rgb: 166 93 0;
  --orientation-accent: var(--chart-series-1);
  --orientation-soft: rgb(31 107 82 / 10%);
  --community-accent: #a74424;
  --community-accent-rgb: 167 68 36;
  --community-soft: rgb(167 68 36 / 11%);
  --accent-soft: rgb(32 48 39 / 5%);
  --action-hover: #2e4438;
  --brand-mark-surface: #203027;
  --surface-gradient-mid: #e7e1d2;
  --node-highlight: #fffdf7;
  --node-shadow: #d5cebc;
  --shadow-rgb: 32 48 39;
  --shadow-floating: 0 6px 18px rgb(32 48 39 / 11%);
  --shadow-sticky: 0 8px 18px rgb(32 48 39 / 10%);
  --shadow-index: 0 7px 16px rgb(32 48 39 / 8%);
  --shadow-dialog: 0 18px 48px rgb(32 48 39 / 20%);
  --shadow-node: 0 8px 20px rgb(32 48 39 / 14%);
  --shadow-graph-inset: inset 0 0 34px rgb(32 48 39 / 9%);
}

:root[data-theme="avalanche-signal"] {
  color-scheme: light;
  --canvas: #f4f2f1;
  --canvas-rgb: 244 242 241;
  --surface: #ffffff;
  --surface-rgb: 255 255 255;
  --surface-raised: #e6e1df;
  --surface-raised-rgb: 230 225 223;
  --text-primary: #271b1a;
  --text-primary-rgb: 39 27 26;
  --text-body: #514240;
  --text-secondary: #6c5b58;
  --text-secondary-rgb: 108 91 88;
  --text-tertiary: #71615e;
  --border-hairline: rgb(39 27 26 / 12%);
  --border-strong: rgb(39 27 26 / 30%);
  --inverse-surface: #271b1a;
  --inverse-text: #f4f2f1;
  --chart-series-1: #245ca5;
  --chart-series-1-rgb: 36 92 165;
  --chart-series-2: #2e7454;
  --chart-series-2-rgb: 46 116 84;
  --chart-series-3: #704c9d;
  --chart-series-3-rgb: 112 76 157;
  --chart-series-4: #9d6400;
  --chart-series-4-rgb: 157 100 0;
  --orientation-accent: var(--chart-series-1);
  --orientation-soft: rgb(36 92 165 / 10%);
  --community-accent: #a32622;
  --community-accent-rgb: 163 38 34;
  --community-soft: rgb(163 38 34 / 10%);
  --accent-soft: rgb(39 27 26 / 5%);
  --action-hover: #3a2927;
  --brand-mark-surface: #271b1a;
  --surface-gradient-mid: #ebe7e5;
  --node-highlight: #ffffff;
  --node-shadow: #d7d0cd;
  --shadow-rgb: 39 27 26;
  --shadow-floating: 0 6px 18px rgb(39 27 26 / 11%);
  --shadow-sticky: 0 8px 18px rgb(39 27 26 / 10%);
  --shadow-index: 0 7px 16px rgb(39 27 26 / 8%);
  --shadow-dialog: 0 18px 48px rgb(39 27 26 / 20%);
  --shadow-node: 0 8px 20px rgb(39 27 26 / 14%);
  --shadow-graph-inset: inset 0 0 34px rgb(39 27 26 / 9%);
}

:root[data-theme="powder-lilac"] {
  color-scheme: light;
  --canvas: #f5f1f8;
  --canvas-rgb: 245 241 248;
  --surface: #ffffff;
  --surface-rgb: 255 255 255;
  --surface-raised: #e7deed;
  --surface-raised-rgb: 231 222 237;
  --text-primary: #281d33;
  --text-primary-rgb: 40 29 51;
  --text-body: #50445a;
  --text-secondary: #675b70;
  --text-secondary-rgb: 103 91 112;
  --text-tertiary: #706477;
  --border-hairline: rgb(40 29 51 / 12%);
  --border-strong: rgb(40 29 51 / 30%);
  --inverse-surface: #281d33;
  --inverse-text: #f5f1f8;
  --chart-series-1: #6740a3;
  --chart-series-1-rgb: 103 64 163;
  --chart-series-2: #35725e;
  --chart-series-2-rgb: 53 114 94;
  --chart-series-3: #9d365b;
  --chart-series-3-rgb: 157 54 91;
  --chart-series-4: #9a6200;
  --chart-series-4-rgb: 154 98 0;
  --orientation-accent: var(--chart-series-1);
  --orientation-soft: rgb(103 64 163 / 10%);
  --community-accent: #9d365b;
  --community-accent-rgb: 157 54 91;
  --community-soft: rgb(157 54 91 / 10%);
  --accent-soft: rgb(40 29 51 / 5%);
  --action-hover: #3b2c48;
  --brand-mark-surface: #281d33;
  --surface-gradient-mid: #ebe4f0;
  --node-highlight: #ffffff;
  --node-shadow: #d8cde0;
  --shadow-rgb: 40 29 51;
  --shadow-floating: 0 6px 18px rgb(40 29 51 / 11%);
  --shadow-sticky: 0 8px 18px rgb(40 29 51 / 10%);
  --shadow-index: 0 7px 16px rgb(40 29 51 / 8%);
  --shadow-dialog: 0 18px 48px rgb(40 29 51 / 20%);
  --shadow-node: 0 8px 20px rgb(40 29 51 / 14%);
  --shadow-graph-inset: inset 0 0 34px rgb(40 29 51 / 9%);
}

:root[data-theme="chrome-park"] {
  color-scheme: light;
  --canvas: #e9eceb;
  --canvas-rgb: 233 236 235;
  --surface: #f8faf9;
  --surface-rgb: 248 250 249;
  --surface-raised: #d6dbd9;
  --surface-raised-rgb: 214 219 217;
  --text-primary: #101514;
  --text-primary-rgb: 16 21 20;
  --text-body: #35403d;
  --text-secondary: #52605c;
  --text-secondary-rgb: 82 96 92;
  --text-tertiary: #5c6865;
  --border-hairline: rgb(16 21 20 / 12%);
  --border-strong: rgb(16 21 20 / 30%);
  --inverse-surface: #101514;
  --inverse-text: #e9eceb;
  --chart-series-1: #3f6d00;
  --chart-series-1-rgb: 63 109 0;
  --chart-series-2: #007260;
  --chart-series-2-rgb: 0 114 96;
  --chart-series-3: #773f98;
  --chart-series-3-rgb: 119 63 152;
  --chart-series-4: #9a5b00;
  --chart-series-4-rgb: 154 91 0;
  --orientation-accent: var(--chart-series-1);
  --orientation-soft: rgb(63 109 0 / 11%);
  --community-accent: #9b225e;
  --community-accent-rgb: 155 34 94;
  --community-soft: rgb(155 34 94 / 10%);
  --accent-soft: rgb(16 21 20 / 5%);
  --action-hover: #28302e;
  --brand-mark-surface: #101514;
  --surface-gradient-mid: #dfe3e1;
  --node-highlight: #f8faf9;
  --node-shadow: #c6cdca;
  --shadow-rgb: 16 21 20;
  --shadow-floating: 0 6px 18px rgb(16 21 20 / 11%);
  --shadow-sticky: 0 8px 18px rgb(16 21 20 / 10%);
  --shadow-index: 0 7px 16px rgb(16 21 20 / 8%);
  --shadow-dialog: 0 18px 48px rgb(16 21 20 / 20%);
  --shadow-node: 0 8px 20px rgb(16 21 20 / 14%);
  --shadow-graph-inset: inset 0 0 34px rgb(16 21 20 / 9%);
}

:root[data-theme="night-lift"] {
  color-scheme: dark;
  --canvas: #071521;
  --canvas-rgb: 7 21 33;
  --surface: #0e2231;
  --surface-rgb: 14 34 49;
  --surface-raised: #173246;
  --surface-raised-rgb: 23 50 70;
  --text-primary: #eaf6ff;
  --text-primary-rgb: 234 246 255;
  --text-body: #bdd4e3;
  --text-secondary: #87a5b7;
  --text-secondary-rgb: 135 165 183;
  --text-tertiary: #6f8b9a;
  --border-hairline: rgb(234 246 255 / 9%);
  --border-strong: rgb(234 246 255 / 24%);
  --inverse-surface: #eaf6ff;
  --inverse-text: #071521;
  --chart-series-1: #56c8ff;
  --chart-series-1-rgb: 86 200 255;
  --chart-series-2: #69d7a2;
  --chart-series-2-rgb: 105 215 162;
  --chart-series-3: #c490ff;
  --chart-series-3-rgb: 196 144 255;
  --chart-series-4: #ffc56e;
  --chart-series-4-rgb: 255 197 110;
  --orientation-accent: var(--chart-series-1);
  --orientation-soft: rgb(86 200 255 / 10%);
  --community-accent: #ff7858;
  --community-accent-rgb: 255 120 88;
  --community-soft: rgb(255 120 88 / 12%);
  --accent-soft: rgb(234 246 255 / 6%);
  --action-hover: #d5eafa;
  --brand-mark-surface: #040d14;
  --surface-gradient-mid: #0a1b29;
  --node-highlight: #24465c;
  --node-shadow: #102738;
  --shadow-rgb: 0 0 0;
  --shadow-floating: 0 8px 30px rgb(0 0 0 / 42%);
  --shadow-sticky: 0 10px 28px rgb(0 0 0 / 34%);
  --shadow-index: 0 10px 24px rgb(0 0 0 / 28%);
  --shadow-dialog: 0 18px 48px rgb(0 0 0 / 58%);
  --shadow-node: 0 8px 22px rgb(0 0 0 / 56%);
  --shadow-graph-inset: inset 0 0 48px rgb(0 0 0 / 68%);
}

:root[data-theme="timberline"] {
  color-scheme: dark;
  --canvas: #171a16;
  --canvas-rgb: 23 26 22;
  --surface: #20261f;
  --surface-rgb: 32 38 31;
  --surface-raised: #2e372c;
  --surface-raised-rgb: 46 55 44;
  --text-primary: #f1f3e9;
  --text-primary-rgb: 241 243 233;
  --text-body: #ccd3c2;
  --text-secondary: #9aa691;
  --text-secondary-rgb: 154 166 145;
  --text-tertiary: #84927f;
  --border-hairline: rgb(241 243 233 / 9%);
  --border-strong: rgb(241 243 233 / 24%);
  --inverse-surface: #f1f3e9;
  --inverse-text: #171a16;
  --chart-series-1: #74c69d;
  --chart-series-1-rgb: 116 198 157;
  --chart-series-2: #9ccc65;
  --chart-series-2-rgb: 156 204 101;
  --chart-series-3: #c299e8;
  --chart-series-3-rgb: 194 153 232;
  --chart-series-4: #ffbf62;
  --chart-series-4-rgb: 255 191 98;
  --orientation-accent: var(--chart-series-1);
  --orientation-soft: rgb(116 198 157 / 10%);
  --community-accent: #ffb347;
  --community-accent-rgb: 255 179 71;
  --community-soft: rgb(255 179 71 / 12%);
  --accent-soft: rgb(241 243 233 / 6%);
  --action-hover: #dce3d3;
  --brand-mark-surface: #0d0f0c;
  --surface-gradient-mid: #1b201a;
  --node-highlight: #3c4739;
  --node-shadow: #242b22;
  --shadow-rgb: 0 0 0;
  --shadow-floating: 0 8px 30px rgb(0 0 0 / 42%);
  --shadow-sticky: 0 10px 28px rgb(0 0 0 / 34%);
  --shadow-index: 0 10px 24px rgb(0 0 0 / 28%);
  --shadow-dialog: 0 18px 48px rgb(0 0 0 / 58%);
  --shadow-node: 0 8px 22px rgb(0 0 0 / 56%);
  --shadow-graph-inset: inset 0 0 48px rgb(0 0 0 / 68%);
}

:root[data-theme="apres-glow"] {
  color-scheme: dark;
  --canvas: #21141d;
  --canvas-rgb: 33 20 29;
  --surface: #2d1d29;
  --surface-rgb: 45 29 41;
  --surface-raised: #42283a;
  --surface-raised-rgb: 66 40 58;
  --text-primary: #fff0f6;
  --text-primary-rgb: 255 240 246;
  --text-body: #e0c5d1;
  --text-secondary: #b58d9f;
  --text-secondary-rgb: 181 141 159;
  --text-tertiary: #a77e91;
  --border-hairline: rgb(255 240 246 / 9%);
  --border-strong: rgb(255 240 246 / 24%);
  --inverse-surface: #fff0f6;
  --inverse-text: #21141d;
  --chart-series-1: #ff8ac4;
  --chart-series-1-rgb: 255 138 196;
  --chart-series-2: #7ed6a3;
  --chart-series-2-rgb: 126 214 163;
  --chart-series-3: #b89aff;
  --chart-series-3-rgb: 184 154 255;
  --chart-series-4: #ffc173;
  --chart-series-4-rgb: 255 193 115;
  --orientation-accent: var(--chart-series-1);
  --orientation-soft: rgb(255 138 196 / 10%);
  --community-accent: #ff9b62;
  --community-accent-rgb: 255 155 98;
  --community-soft: rgb(255 155 98 / 12%);
  --accent-soft: rgb(255 240 246 / 6%);
  --action-hover: #ead5de;
  --brand-mark-surface: #120b10;
  --surface-gradient-mid: #281820;
  --node-highlight: #533248;
  --node-shadow: #34202e;
  --shadow-rgb: 0 0 0;
  --shadow-floating: 0 8px 30px rgb(0 0 0 / 42%);
  --shadow-sticky: 0 10px 28px rgb(0 0 0 / 34%);
  --shadow-index: 0 10px 24px rgb(0 0 0 / 28%);
  --shadow-dialog: 0 18px 48px rgb(0 0 0 / 58%);
  --shadow-node: 0 8px 22px rgb(0 0 0 / 56%);
  --shadow-graph-inset: inset 0 0 48px rgb(0 0 0 / 68%);
}

:root[data-theme="polar-night"] {
  color-scheme: dark;
  --canvas: #0b1020;
  --canvas-rgb: 11 16 32;
  --surface: #121a2c;
  --surface-rgb: 18 26 44;
  --surface-raised: #1d2940;
  --surface-raised-rgb: 29 41 64;
  --text-primary: #f2f7ff;
  --text-primary-rgb: 242 247 255;
  --text-body: #ccd8e8;
  --text-secondary: #94a8c0;
  --text-secondary-rgb: 148 168 192;
  --text-tertiary: #7489a2;
  --border-hairline: rgb(242 247 255 / 9%);
  --border-strong: rgb(242 247 255 / 24%);
  --inverse-surface: #f2f7ff;
  --inverse-text: #0b1020;
  --chart-series-1: #69bfff;
  --chart-series-1-rgb: 105 191 255;
  --chart-series-2: #68d7b1;
  --chart-series-2-rgb: 104 215 177;
  --chart-series-3: #a99cff;
  --chart-series-3-rgb: 169 156 255;
  --chart-series-4: #ffc857;
  --chart-series-4-rgb: 255 200 87;
  --orientation-accent: var(--chart-series-1);
  --orientation-soft: rgb(105 191 255 / 10%);
  --community-accent: #ffc857;
  --community-accent-rgb: 255 200 87;
  --community-soft: rgb(255 200 87 / 12%);
  --accent-soft: rgb(242 247 255 / 6%);
  --action-hover: #dce8f7;
  --brand-mark-surface: #060912;
  --surface-gradient-mid: #0e1526;
  --node-highlight: #263653;
  --node-shadow: #151f34;
  --shadow-rgb: 0 0 0;
  --shadow-floating: 0 8px 30px rgb(0 0 0 / 42%);
  --shadow-sticky: 0 10px 28px rgb(0 0 0 / 34%);
  --shadow-index: 0 10px 24px rgb(0 0 0 / 28%);
  --shadow-dialog: 0 18px 48px rgb(0 0 0 / 58%);
  --shadow-node: 0 8px 22px rgb(0 0 0 / 56%);
  --shadow-graph-inset: inset 0 0 48px rgb(0 0 0 / 68%);
}

:root[data-theme="ink-ice"] {
  color-scheme: light;
  --canvas: #f8fbfc;
  --canvas-rgb: 248 251 252;
  --surface: #ffffff;
  --surface-rgb: 255 255 255;
  --surface-raised: #e3edf0;
  --surface-raised-rgb: 227 237 240;
  --text-primary: #08161c;
  --text-primary-rgb: 8 22 28;
  --text-body: #31444c;
  --text-secondary: #536870;
  --text-secondary-rgb: 83 104 112;
  --text-tertiary: #5d7179;
  --border-hairline: rgb(8 22 28 / 12%);
  --border-strong: rgb(8 22 28 / 30%);
  --inverse-surface: #08161c;
  --inverse-text: #f8fbfc;
  --chart-series-1: #006f7d;
  --chart-series-1-rgb: 0 111 125;
  --chart-series-2: #1d7652;
  --chart-series-2-rgb: 29 118 82;
  --chart-series-3: #67499d;
  --chart-series-3-rgb: 103 73 157;
  --chart-series-4: #9b6000;
  --chart-series-4-rgb: 155 96 0;
  --orientation-accent: var(--chart-series-1);
  --orientation-soft: rgb(0 111 125 / 10%);
  --community-accent: #b9482c;
  --community-accent-rgb: 185 72 44;
  --community-soft: rgb(185 72 44 / 10%);
  --accent-soft: rgb(8 22 28 / 5%);
  --action-hover: #1d3038;
  --brand-mark-surface: #08161c;
  --surface-gradient-mid: #edf4f6;
  --node-highlight: #ffffff;
  --node-shadow: #d2e1e5;
  --shadow-rgb: 8 22 28;
  --shadow-floating: 0 6px 18px rgb(8 22 28 / 11%);
  --shadow-sticky: 0 8px 18px rgb(8 22 28 / 10%);
  --shadow-index: 0 7px 16px rgb(8 22 28 / 8%);
  --shadow-dialog: 0 18px 48px rgb(8 22 28 / 20%);
  --shadow-node: 0 8px 20px rgb(8 22 28 / 14%);
  --shadow-graph-inset: inset 0 0 34px rgb(8 22 28 / 9%);
}

:root[data-theme="gondola-79"] {
  color-scheme: light;
  --canvas: #efe3cf;
  --canvas-rgb: 239 227 207;
  --surface: #fff9ee;
  --surface-rgb: 255 249 238;
  --surface-raised: #ddcdb4;
  --surface-raised-rgb: 221 205 180;
  --text-primary: #2f211b;
  --text-primary-rgb: 47 33 27;
  --text-body: #56433a;
  --text-secondary: #705c51;
  --text-secondary-rgb: 112 92 81;
  --text-tertiary: #766358;
  --border-hairline: rgb(47 33 27 / 12%);
  --border-strong: rgb(47 33 27 / 30%);
  --inverse-surface: #2f211b;
  --inverse-text: #fff9ee;
  --chart-series-1: #2454a4;
  --chart-series-1-rgb: 36 84 164;
  --chart-series-2: #27745b;
  --chart-series-2-rgb: 39 116 91;
  --chart-series-3: #8a3e63;
  --chart-series-3-rgb: 138 62 99;
  --chart-series-4: #a85b00;
  --chart-series-4-rgb: 168 91 0;
  --orientation-accent: var(--chart-series-1);
  --orientation-soft: rgb(36 84 164 / 10%);
  --community-accent: #b83a24;
  --community-accent-rgb: 184 58 36;
  --community-soft: rgb(184 58 36 / 11%);
  --accent-soft: rgb(47 33 27 / 5%);
  --action-hover: #4a352b;
  --brand-mark-surface: #2f211b;
  --surface-gradient-mid: #e4d4bc;
  --node-highlight: #fff9ee;
  --node-shadow: #cbb99e;
  --shadow-rgb: 47 33 27;
  --shadow-floating: 0 6px 18px rgb(47 33 27 / 11%);
  --shadow-sticky: 0 8px 18px rgb(47 33 27 / 10%);
  --shadow-index: 0 7px 16px rgb(47 33 27 / 8%);
  --shadow-dialog: 0 18px 48px rgb(47 33 27 / 20%);
  --shadow-node: 0 8px 20px rgb(47 33 27 / 14%);
  --shadow-graph-inset: inset 0 0 34px rgb(47 33 27 / 9%);
}

html,
body,
body[data-view="tree"] {
  overflow-x: clip;
}

body[data-view="tree"] {
  overflow-y: visible;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  background: var(--navy-950);
  color: var(--text-body);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  color: var(--text-primary);
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  content: "";
  pointer-events: none;
}

body::before {
  inset: 64px auto 0 max(16px, calc((100vw - 1440px) / 2));
  width: 1px;
  background: rgb(var(--text-primary-rgb) / 7%);
}

body::after {
  inset: 108px max(16px, calc((100vw - 1440px) / 2)) auto auto;
  width: 64px;
  height: 1px;
  background: var(--community-accent);
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--orientation-accent);
  outline-offset: 3px;
}

/* Framework-independent UI primitives. Screen classes own layout and type;
   these classes own only behavior shared by the same control role. */
.ui-action {
  text-decoration: none;
}

.ui-action--primary-cut {
  border-radius: var(--radius-sm);
  background: var(--lime-400);
  color: var(--inverse-text);
  clip-path: polygon(
    0 0,
    calc(100% - var(--cut-md)) 0,
    100% var(--cut-md),
    100% 100%,
    0 100%
  );
  transition:
    background-color var(--motion-fast) ease-out,
    transform var(--motion-fast) ease-out;
}

.ui-action--primary-cut:hover {
  background: var(--lime-500);
}

.ui-action--primary-cut:active {
  transform: translateY(var(--control-press-offset));
}

.ui-action--primary-cut:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px var(--cream-100);
}

.ui-node-control {
  cursor: pointer;
  text-align: left;
  transition:
    border-color var(--motion-fast) ease-out,
    background-color var(--motion-fast) ease-out,
    transform var(--motion-fast) ease-out;
}

.ui-node-control:active {
  transform: translateY(var(--control-press-offset));
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: var(--lime-400);
  color: var(--navy-950);
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform var(--motion-fast) ease-out;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-bar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px max(16px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid var(--border-subtle);
  background: rgb(var(--canvas-rgb) / 96%);
}

.brand {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--ink-1000);
}

.brand-mark img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  line-height: 1;
}

.brand-copy strong {
  font-family: var(--display);
  font-size: 24px;
  font-stretch: condensed;
  letter-spacing: 0.08em;
}

.brand-copy span {
  margin-top: 5px;
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.app-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.frame-switcher {
  position: relative;
}

.frame-switch {
  display: grid;
  min-width: 132px;
  min-height: 44px;
  align-content: center;
  padding: 6px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition:
    border-color var(--motion-fast) ease-out,
    background-color var(--motion-fast) ease-out,
    transform var(--motion-fast) ease-out;
}

.frame-switch > span {
  color: var(--community-accent);
  font-family: var(--display);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
}

.frame-switch > strong {
  max-width: 132px;
  margin-top: 4px;
  overflow: hidden;
  font-family: var(--display);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.frame-switch:hover,
.frame-switch:focus-visible,
.frame-switch[aria-expanded="true"] {
  border-color: var(--orientation-accent);
  background: var(--orientation-soft);
}

.frame-switch:active {
  transform: translateY(var(--control-press-offset));
}

.frame-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: min(352px, calc(100vw - 24px));
  max-height: min(72vh, 620px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-dialog);
  overscroll-behavior: contain;
}

.frame-menu[hidden] {
  display: none;
}

.frame-option {
  display: grid;
  min-width: 0;
  min-height: 74px;
  grid-template-columns: 20px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 5px 7px;
  padding: 9px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition:
    border-color var(--motion-fast) ease-out,
    background-color var(--motion-fast) ease-out,
    transform var(--motion-fast) ease-out;
}

.frame-option:hover,
.frame-option:focus-visible {
  border-color: var(--orientation-accent);
  background: var(--orientation-soft);
}

.frame-option:active {
  transform: translateY(var(--control-press-offset));
}

.frame-option.is-current {
  border-color: var(--orientation-accent);
  background: var(--orientation-soft);
  box-shadow: inset 3px 0 0 var(--orientation-accent);
}

.frame-option-number {
  color: var(--community-accent);
  font-family: var(--display);
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.frame-option-copy {
  display: grid;
  min-width: 0;
}

.frame-option-copy strong {
  overflow: hidden;
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.03em;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.frame-option-copy small {
  margin-top: 4px;
  color: var(--text-secondary);
  font-family: var(--body);
  font-size: 7px;
  line-height: 1.2;
}

.frame-option-swatches {
  display: flex;
  grid-column: 2;
  gap: 3px;
}

.frame-option-swatches i {
  display: block;
  width: 18px;
  height: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--frame-swatch);
}

.language-switch {
  min-width: 48px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--cream-100);
  cursor: pointer;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  transition:
    border-color var(--motion-fast) ease-out,
    color var(--motion-fast) ease-out,
    background-color var(--motion-fast) ease-out;
}

.language-switch:hover {
  border-color: var(--lime-400);
  background: var(--accent-soft);
  color: var(--lime-400);
}

.language-switch:active {
  transform: translateY(1px);
}

.course-shell {
  display: grid;
  width: min(100%, 1440px);
  grid-template-columns: 264px minmax(0, 1fr) 220px;
  align-items: start;
  gap: 32px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.path-rail,
.focus-rail {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  scrollbar-color: var(--border-default) transparent;
  scrollbar-width: thin;
}

.path-rail-heading {
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.15em;
  line-height: 1.2;
  text-transform: uppercase;
}

.path-rail-heading h2,
.lesson-section h2,
.cue-panel h2,
.safety-panel h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-transform: uppercase;
}

.path-rail-heading > p:last-child {
  margin: 12px 0 0;
  color: var(--cream-300);
  font-size: 13px;
  line-height: 1.55;
}

.path-list,
.path-list ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.path-chapter {
  border-bottom: 1px solid var(--border-subtle);
}

.path-chapter-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 16px 8px 8px;
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.path-chapter-label span {
  color: var(--border-default);
  font-variant-numeric: tabular-nums;
}

.path-chapter.is-current .path-chapter-label strong {
  color: var(--cream-100);
}

.path-lesson {
  position: relative;
  display: grid;
  min-height: 60px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-left: 2px solid transparent;
  color: var(--cream-300);
  text-decoration: none;
  transition:
    background-color var(--motion-fast) ease-out,
    border-color var(--motion-fast) ease-out,
    color var(--motion-fast) ease-out;
}

.path-lesson:hover {
  background: var(--navy-900);
  color: var(--cream-100);
}

.path-lesson.is-current {
  border-left-color: var(--lime-400);
  background: var(--accent-soft);
  color: var(--cream-100);
}

.path-index {
  align-self: start;
  padding-top: 3px;
  font-family: var(--display);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.path-name {
  display: grid;
  min-width: 0;
  align-self: center;
  gap: 2px;
}

.path-name strong {
  overflow: hidden;
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.path-name span {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.path-now {
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.lesson-content {
  min-width: 0;
  border-right: 1px solid var(--border-subtle);
  border-left: 1px solid var(--border-subtle);
  background: var(--navy-950);
}

.loading-frame {
  display: grid;
  min-height: 60vh;
  place-items: center;
  color: var(--lime-400);
  font-family: var(--display);
  letter-spacing: 0.15em;
}

.lesson-hero {
  position: relative;
  padding: 48px 48px 40px;
  border-bottom: 1px solid var(--border-subtle);
  animation: enter var(--motion-standard) ease-out both;
}

.lesson-coordinate {
  position: absolute;
  top: 16px;
  right: 16px;
  color: rgb(var(--text-primary-rgb) / 34%);
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.lesson-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.lesson-title-row h1 {
  max-width: 720px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(54px, 7vw, 96px);
  font-stretch: condensed;
  font-weight: 780;
  letter-spacing: -0.025em;
  line-height: 0.83;
  text-transform: uppercase;
}

.lesson-title-row h1:focus {
  outline: none;
}

.lesson-chinese-title {
  margin: 18px 0 0;
  color: var(--cream-300);
  font-size: 18px;
}

.lesson-count {
  display: flex;
  flex: 0 0 auto;
  align-items: baseline;
  padding-bottom: 8px;
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
}

.lesson-count strong {
  color: var(--lime-400);
  font-size: 38px;
  line-height: 1;
}

.lesson-count span {
  color: var(--cream-300);
  font-size: 16px;
}

.lesson-count.is-preview {
  align-items: center;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--lime-400);
  background: rgb(var(--text-primary-rgb) / 8%);
}

.lesson-count.is-preview strong {
  font-size: 22px;
  letter-spacing: 0.12em;
}

.lesson-goal {
  max-width: 720px;
  margin: 36px 0 0;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 32px;
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.lesson-meta span {
  padding: 6px 12px;
  border: 1px solid var(--border-subtle);
  border-right: 0;
}

.lesson-meta span:last-child {
  border-right: 1px solid var(--border-subtle);
}

.lesson-section {
  padding: 48px;
  border-bottom: 1px solid var(--border-subtle);
  animation: enter var(--motion-standard) ease-out both;
}

.lesson-section:nth-of-type(2) { animation-delay: 40ms; }
.lesson-section:nth-of-type(3) { animation-delay: 80ms; }
.lesson-section:nth-of-type(4) { animation-delay: 120ms; }

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.section-heading > span {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 12px;
}

.section-heading .eyebrow {
  margin-bottom: 6px;
}

.lesson-disclosure-summary {
  position: relative;
  min-height: 44px;
  margin-bottom: 0;
  padding-right: 56px;
  cursor: pointer;
  list-style: none;
}

.lesson-disclosure-summary > div {
  min-width: 0;
}

.lesson-disclosure-summary::-webkit-details-marker {
  display: none;
}

.lesson-disclosure-summary::marker {
  content: "";
}

.lesson-disclosure-summary::after {
  position: absolute;
  top: 50%;
  right: 0;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  color: var(--lime-400);
  content: "+";
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
  transform: translateY(-50%);
}

.lesson-disclosure-summary:hover::after {
  border-color: var(--lime-400);
}

.lesson-disclosure-summary:focus-visible {
  outline: 2px solid var(--lime-400);
  outline-offset: 6px;
}

.lesson-disclosure-summary:active::after {
  transform: translateY(calc(-50% + 1px));
}

.lesson-disclosure[open] > .lesson-disclosure-summary {
  margin-bottom: 28px;
}

.lesson-disclosure[open] > .lesson-disclosure-summary::after {
  content: "−";
}

.lesson-disclosure-body {
  min-width: 0;
}

.lead-copy {
  max-width: 760px;
  margin: 0;
  font-size: 20px;
  line-height: 1.7;
}

.prerequisite-strip {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  margin-top: 32px;
  padding: 20px 0;
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-subtle);
}

.prerequisite-strip > strong {
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.compact-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-list li {
  position: relative;
  padding-left: 18px;
  color: var(--cream-300);
}

.compact-list li::before {
  position: absolute;
  top: 0.68em;
  left: 0;
  width: 6px;
  height: 1px;
  background: var(--lime-400);
  content: "";
}

.phase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.phase-card {
  min-height: 0;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--navy-900);
}

.phase-marker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.phase-marker strong {
  color: var(--lime-400);
}

.phase-card h3,
.drill-step h3 {
  margin: 24px 0 10px;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-transform: uppercase;
}

.phase-card p,
.drill-step p {
  margin: 0;
  color: var(--cream-300);
  font-size: 13px;
  line-height: 1.65;
}

.video-frame {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--ink-1000);
}

.video-label {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.video-label span:first-child {
  color: var(--lime-400);
}

.video-ratio {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.video-ratio iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-placeholder {
  display: grid;
  min-height: 240px;
  place-content: center;
  padding: 32px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  text-align: center;
}

.video-placeholder span {
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.video-placeholder p {
  max-width: 520px;
  margin: 16px auto 0;
  color: var(--cream-300);
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.reference-card {
  position: relative;
  display: grid;
  min-height: 196px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  text-decoration: none;
  transition:
    border-color var(--motion-fast) ease-out,
    background-color var(--motion-fast) ease-out;
}

.reference-card:hover {
  border-color: var(--border-default);
  background: var(--navy-800);
}

.reference-provider,
.external-label {
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.reference-card strong {
  margin-top: 20px;
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.1;
  text-transform: uppercase;
}

.reference-card p {
  margin: 12px 0 40px;
  color: var(--cream-300);
  font-size: 13px;
}

.external-label {
  position: absolute;
  bottom: 16px;
  left: 18px;
}

.drill-list {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.drill-list::before {
  position: absolute;
  top: 28px;
  bottom: 28px;
  left: 23px;
  width: 1px;
  background: var(--border-default);
  content: "";
}

.drill-step {
  position: relative;
  display: grid;
  min-height: 92px;
  grid-template-columns: 48px 1fr;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.drill-step:last-child {
  border-bottom: 0;
}

.drill-level {
  z-index: 1;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--lime-400);
  border-radius: var(--radius-sm);
  background: var(--navy-950);
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 13px;
}

.drill-step h3 {
  margin-top: 0;
}

.drill-step p {
  font-size: 15px;
}

.practice-intro {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid var(--border-default);
  border-top: 2px solid var(--lime-400);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}

.practice-intro > p,
.practice-applicability p {
  margin: 0;
  color: var(--cream-200);
  line-height: 1.65;
}

.practice-applicability {
  display: grid;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.practice-applicability strong,
.drill-stage,
.drill-detail-list dt {
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.drill-step.is-structured {
  align-items: start;
  padding: 20px 0;
}

.drill-step.is-structured > div {
  min-width: 0;
}

.drill-stage {
  display: block;
  margin-bottom: 8px;
}

.drill-step.is-structured h3 {
  margin-bottom: 8px;
}

.drill-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 0;
}

.drill-detail-list > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--navy-900);
}

.drill-detail-list > div.is-reset {
  border-color: var(--border-default);
  background: var(--accent-soft);
}

.drill-detail-list dt,
.drill-detail-list dd {
  margin: 0;
}

.drill-detail-list dd {
  margin-top: 6px;
  color: var(--cream-300);
  font-size: 13px;
  line-height: 1.55;
}

.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cue-panel,
.safety-panel {
  min-height: 320px;
  padding: 24px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.cue-panel {
  border-top: 2px solid var(--lime-400);
  background: var(--accent-soft);
}

.safety-panel {
  background: var(--navy-900);
}

.cue-list,
.safety-list,
.check-list,
.mistake-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.cue-list,
.safety-list {
  display: grid;
  gap: 16px;
}

.cue-list li,
.safety-list li {
  position: relative;
  padding: 0 0 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.cue-list li::before {
  position: absolute;
  top: 7px;
  left: 0;
  width: 8px;
  height: 8px;
  border: 1px solid var(--lime-400);
  content: "";
  transform: rotate(45deg);
}

.safety-list li::before {
  position: absolute;
  top: 9px;
  left: 0;
  width: 8px;
  height: 1px;
  background: var(--cream-300);
  content: "";
}

.mistake-list {
  border-top: 1px solid var(--border-default);
}

.mistake-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.mistake-row p {
  margin: 8px 0 0;
}

.mistake-label,
.reset-label {
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.mistake-label {
  color: var(--cream-300);
}

.reset-label {
  color: var(--lime-400);
}

.self-check-section {
  background: var(--navy-900);
}

.check-list {
  display: grid;
  gap: 8px;
  counter-reset: checks;
}

.check-list li {
  position: relative;
  min-height: 64px;
  padding: 19px 16px 16px 56px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  counter-increment: checks;
}

.check-list li::before {
  position: absolute;
  top: 16px;
  left: 16px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--border-default);
  color: var(--cream-300);
  content: counter(checks, decimal-leading-zero);
  font-family: var(--display);
  font-size: 10px;
}

.review-note {
  margin: 16px 0 0;
  color: var(--cream-300);
  font-size: 13px;
}

.lesson-navigation {
  position: sticky;
  z-index: 10;
  bottom: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin: 24px;
  padding: 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: rgb(var(--surface-rgb) / 96%);
}

.previous-action,
.next-action {
  display: grid;
  min-height: 64px;
  align-content: center;
  gap: 3px;
  padding: 10px 16px;
  text-decoration: none;
}

.previous-action {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.previous-action:hover {
  border-color: var(--border-default);
  background: var(--navy-800);
}

.previous-action.is-disabled {
  color: rgb(var(--text-primary-rgb) / 38%);
}

.previous-action span,
.next-action span {
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.previous-action strong,
.next-action strong {
  overflow: hidden;
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.focus-rail {
  display: grid;
  gap: 16px;
  overflow: visible;
}

.focus-card,
.focus-rule,
.next-preview {
  padding: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--navy-900);
}

.focus-card {
  border-top: 2px solid var(--lime-400);
}

.focus-card > strong,
.next-preview strong {
  display: block;
  margin-top: 24px;
  font-family: var(--display);
  font-size: 24px;
  line-height: 0.95;
  text-transform: uppercase;
}

.focus-card > span,
.next-preview small {
  display: block;
  margin-top: 8px;
  color: var(--cream-300);
  font-size: 12px;
}

.focus-progress {
  height: 4px;
  margin-top: 28px;
  overflow: hidden;
  border-radius: var(--radius-xs);
  background: rgb(var(--text-primary-rgb) / 12%);
}

.focus-progress span {
  display: block;
  height: 100%;
  background: var(--lime-400);
}

.focus-card > p:last-child,
.focus-rule > p:last-child {
  margin: 10px 0 0;
  color: var(--cream-300);
  font-size: 11px;
  line-height: 1.55;
}

.next-preview {
  text-decoration: none;
  transition: border-color var(--motion-fast) ease-out;
}

.next-preview:hover {
  border-color: var(--lime-400);
}

.next-preview > span {
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.site-footer {
  display: flex;
  width: min(100%, 1440px);
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid var(--border-subtle);
  color: var(--cream-300);
  font-size: 11px;
}

.site-footer p {
  max-width: 640px;
  margin: 0;
}

.noscript-notice {
  margin: 24px;
  padding: 16px;
  border: 1px solid var(--border-default);
  background: var(--navy-900);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 0px) {
  body::before,
  body::after {
    display: none;
  }

  .course-shell {
    display: block;
    width: min(100%, 430px);
    padding: 0 0 64px;
  }

  .path-rail {
    position: relative;
    top: auto;
    z-index: 5;
    max-height: none;
    overflow: hidden;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--navy-950);
  }

  .path-rail-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 0 0 12px;
    border-bottom: 0;
  }

  .path-rail-heading .eyebrow,
  .path-rail-heading > p:last-child {
    display: none;
  }

  .path-rail-heading h2 {
    font-size: 19px;
  }

  .path-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .path-chapter {
    display: flex;
    flex: 0 0 auto;
    align-items: stretch;
    border-bottom: 0;
    scroll-snap-align: start;
  }

  .path-chapter-label {
    display: none;
  }

  .path-chapter ol {
    display: flex;
    gap: 8px;
  }

  .path-lesson {
    width: 176px;
    min-height: 64px;
    border: 1px solid var(--border-subtle);
    border-left: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    scroll-snap-align: center;
  }

  .path-lesson.is-current {
    border: 2px solid var(--lime-400);
  }

  .lesson-content {
    border-right: 0;
    border-left: 0;
  }

  .lesson-hero,
  .lesson-section {
    padding-right: 24px;
    padding-left: 24px;
  }
}

@media (min-width: 0px) {
  .app-bar {
    min-height: 60px;
  }

  .brand-copy strong {
    font-size: 20px;
  }

  .brand-copy span {
    display: none;
  }

  .lesson-hero {
    padding: 48px 16px 32px;
  }

  .lesson-coordinate {
    right: 16px;
  }

  .lesson-title-row {
    display: block;
  }

  .lesson-title-row h1 {
    max-width: calc(100vw - 32px);
    font-size: clamp(48px, 16vw, 72px);
    line-height: 0.86;
    overflow-wrap: anywhere;
  }

  .lesson-count {
    margin-top: 24px;
    padding: 0;
  }

  .lesson-goal {
    margin-top: 24px;
    font-size: 17px;
  }

  .lesson-meta {
    margin-top: 24px;
  }

  .lesson-section {
    padding: 40px 16px;
  }

  .section-heading {
    gap: 12px;
  }

  .section-heading > span {
    width: 28px;
    height: 28px;
  }

  .lesson-section h2,
  .cue-panel h2,
  .safety-panel h2 {
    font-size: 24px;
  }

  .lead-copy {
    font-size: 17px;
  }

  .prerequisite-strip {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .phase-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    overflow: visible;
    padding-bottom: 0;
  }

  .phase-card {
    min-height: 0;
  }

  .reference-grid,
  .split-section,
  .mistake-row {
    grid-template-columns: 1fr;
  }

  .cue-panel,
  .safety-panel {
    min-height: 0;
    padding: 20px;
  }

  .mistake-row {
    gap: 16px;
  }

  .mistake-row > div:last-child {
    padding-left: 16px;
    border-left: 2px solid var(--lime-400);
  }

  .lesson-navigation {
    bottom: 8px;
    grid-template-columns: minmax(92px, 0.64fr) minmax(0, 1.36fr);
    margin: 16px 8px;
  }

  .previous-action,
  .next-action {
    min-height: 60px;
    padding: 10px 12px;
  }

  .previous-action strong,
  .next-action strong {
    font-size: 14px;
  }

  .site-footer {
    display: grid;
    padding: 24px 16px;
  }
}

/* Phone-primary learning surface. Wide layouts progressively add rails, but
   this is the product's primary reading and interaction contract. */
@media (min-width: 0px) {
  html {
    scroll-padding-top: 60px;
  }

  body {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
    font-size: 15px;
    overscroll-behavior-y: none;
  }

  .app-bar {
    width: min(100%, 430px);
    margin: 0 auto;
    min-height: 56px;
    padding: 6px 16px;
  }

  .brand {
    min-height: 44px;
    gap: 10px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand-mark img {
    width: 32px;
    height: 32px;
  }

  .app-bar-actions {
    gap: 6px;
  }

  .frame-switch {
    min-width: 106px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .frame-switch > strong {
    max-width: 96px;
  }

  .language-switch {
    min-width: 44px;
    min-height: 44px;
    padding: 6px 8px;
  }

  .frame-menu {
    right: -50px;
  }

  .course-shell {
    padding-bottom: 24px;
  }

  .path-rail {
    padding: 12px 0 10px;
  }

  .path-rail-heading {
    padding: 0 16px 10px;
  }

  .path-rail-heading h2 {
    font-size: 17px;
    letter-spacing: 0.04em;
  }

  .path-list {
    gap: 6px;
    padding: 0 16px 8px;
    scroll-padding-inline: 16px;
  }

  .path-chapter ol {
    gap: 6px;
  }

  .path-lesson {
    width: 150px;
    min-height: 58px;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 7px 8px;
  }

  .path-name strong {
    font-size: 14px;
  }

  .path-name span {
    font-size: 10px;
  }

  .path-now {
    font-size: 8px;
  }

  .lesson-content {
    display: flex;
    flex-direction: column;
  }

  .lesson-hero {
    order: 0;
    padding: 36px 16px 28px;
  }

  .why-section {
    order: 1;
  }

  .reference-section {
    order: 2;
  }

  .movement-section {
    order: 3;
  }

  .drills-section {
    order: 4;
  }

  .lesson-content.has-structured-progression .guidance-section {
    order: 4;
  }

  .lesson-content.has-structured-progression .drills-section {
    order: 5;
  }

  .guidance-section {
    order: 5;
  }

  .mistakes-section {
    order: 6;
  }

  .self-check-section {
    order: 7;
  }

  .lesson-navigation {
    order: 8;
  }

  .lesson-coordinate {
    top: 12px;
    font-size: 9px;
  }

  .lesson-title-row h1 {
    max-width: calc(100vw - 32px);
    font-size: clamp(42px, 13.5vw, 58px);
    line-height: 0.9;
  }

  .lesson-chinese-title {
    margin-top: 14px;
    font-size: 16px;
  }

  .lesson-count {
    margin-top: 18px;
  }

  .lesson-count strong {
    font-size: 34px;
  }

  .lesson-goal {
    margin-top: 20px;
    font-size: 16px;
    line-height: 1.65;
  }

  .lesson-meta {
    margin-top: 20px;
  }

  .lesson-meta span {
    padding: 6px 9px;
    font-size: 10px;
  }

  .lesson-section {
    padding: 32px 16px;
  }

  .section-heading {
    margin-bottom: 20px;
  }

  .section-heading .eyebrow {
    margin-bottom: 4px;
  }

  .lead-copy {
    font-size: 16px;
    line-height: 1.7;
  }

  .prerequisite-strip {
    margin-top: 24px;
    padding: 16px 0;
  }

  .reference-section .video-frame {
    margin-right: -16px;
    margin-left: -16px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .video-label {
    min-height: 36px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .reference-card {
    min-height: 164px;
    padding: 16px;
  }

  .reference-card strong {
    margin-top: 16px;
    font-size: 18px;
  }

  .reference-card p {
    margin-bottom: 32px;
  }

  .phase-grid {
    margin-right: 0;
    padding-right: 0;
  }

  .phase-card {
    min-height: 0;
  }

  .drill-step {
    min-height: 84px;
    grid-template-columns: 44px 1fr;
    gap: 12px;
  }

  .practice-intro {
    padding: 16px;
  }

  .drill-detail-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .drill-list::before {
    left: 21px;
  }

  .drill-level {
    width: 44px;
    height: 44px;
  }

  .cue-panel,
  .safety-panel {
    padding: 18px;
  }

  .check-list li {
    min-height: 60px;
    padding: 17px 14px 14px 52px;
  }

  .lesson-navigation {
    position: fixed;
    z-index: 30;
    right: auto;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 50%;
    width: min(calc(100% - 16px), 414px);
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 6px;
    margin: 0;
    padding: 6px;
    box-shadow: var(--shadow-floating);
    transform: translateX(-50%);
  }

  .previous-action,
  .next-action {
    min-height: 58px;
    padding: 8px 10px;
  }

  .previous-action strong {
    font-size: 11px;
  }

  .next-action strong {
    font-size: 14px;
  }

  .site-footer {
    width: min(100%, 430px);
    padding-bottom: 8px;
  }
}

body[data-locale="zh-Hant"] .lesson-title-row h1,
body[data-locale="zh-Hant"] .path-rail-heading h2,
body[data-locale="zh-Hant"] .lesson-section h2,
body[data-locale="zh-Hant"] .cue-panel h2,
body[data-locale="zh-Hant"] .safety-panel h2 {
  font-family: var(--body);
  letter-spacing: 0.01em;
  text-transform: none;
}

body[data-locale="zh-Hant"] .lesson-title-row h1 {
  line-height: 1.02;
}

/* Mobile questline: a navigational skill tree, not completion state. */
.path-rail {
  padding: 14px 0 8px;
  background: var(--navy-900);
}

.path-rail-heading {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.path-rail-heading .eyebrow {
  display: block;
  margin: 0;
  font-size: 9px;
}

.path-rail-heading h2 {
  font-size: 24px;
  line-height: 1;
}

.path-rail-heading > p:last-child {
  display: none;
}

.path-list {
  display: flex;
  min-height: 138px;
  gap: 0;
  overflow-x: auto;
  padding: 20px 16px 8px;
  scroll-padding-inline: 16px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.path-list::-webkit-scrollbar {
  display: none;
}

.skill-node {
  position: relative;
  display: block;
  min-height: 116px;
  flex: 0 0 96px;
  padding-top: 18px;
  scroll-snap-align: center;
}

.skill-node::after {
  position: absolute;
  z-index: 0;
  top: 45px;
  left: calc(50% + 28px);
  width: 40px;
  height: 2px;
  background: var(--border-subtle);
  content: "";
}

.skill-node:last-child::after {
  display: none;
}

.skill-node.is-before::after {
  background: var(--border-default);
}

.skill-chapter {
  position: absolute;
  top: 0;
  left: 50%;
  width: max-content;
  max-width: 112px;
  overflow: hidden;
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  transform: translateX(-50%);
  white-space: nowrap;
}

.path-lesson,
.path-lesson.is-current {
  position: relative;
  z-index: 1;
  display: grid;
  width: 96px;
  min-height: 106px;
  grid-template-columns: 1fr;
  justify-items: center;
  align-content: start;
  gap: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
}

.path-lesson:hover,
.path-lesson.is-current:hover {
  background: transparent;
}

.skill-node-core {
  position: relative;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 2px solid var(--border-default);
  border-radius: 50%;
  background: var(--navy-950);
  color: var(--cream-100);
  transition:
    border-color var(--motion-fast) ease-out,
    background-color var(--motion-fast) ease-out,
    transform var(--motion-fast) ease-out;
}

.skill-node-core::before {
  position: absolute;
  inset: 5px;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  content: "";
}

.path-lesson:hover .skill-node-core {
  border-color: var(--cream-100);
  background: var(--navy-800);
}

.path-lesson:active .skill-node-core {
  transform: translateY(1px);
}

.skill-node.is-current .skill-node-core {
  border: 3px solid var(--lime-400);
  background: var(--navy-800);
  color: var(--lime-400);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.skill-node.is-current .skill-node-core::before {
  border-color: rgb(var(--text-primary-rgb) / 36%);
}

.skill-node.is-after .path-lesson {
  opacity: 0.5;
}

.path-index {
  z-index: 1;
  align-self: center;
  padding: 0;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
}

.path-name {
  display: block;
  width: 100%;
  min-height: 30px;
  margin-top: 8px;
}

.path-name strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.path-now {
  margin-top: 3px;
  padding: 2px 5px;
  border: 1px solid var(--lime-400);
  border-radius: var(--radius-xs);
  color: var(--lime-400);
  font-size: 8px;
  line-height: 1;
}

/* Constellation home: the curriculum map is the product entry, not a lesson rail. */
body[data-view="tree"] {
  padding-bottom: 0;
}

.skill-tree-home[hidden],
.lesson-content[hidden] {
  display: none !important;
}

.skill-tree-home {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border-subtle);
  border-left: 1px solid var(--border-subtle);
  background:
    radial-gradient(circle at 50% 18%, rgb(var(--text-primary-rgb) / 5%), transparent 34%),
    linear-gradient(180deg, var(--surface) 0%, var(--surface-gradient-mid) 48%, var(--canvas) 100%);
}

.skill-tree-heading {
  position: relative;
  z-index: 4;
  padding: 34px 20px 18px;
  border-bottom: 1px solid rgb(var(--text-primary-rgb) / 10%);
  background: linear-gradient(180deg, rgb(var(--canvas-rgb) / 96%), rgb(var(--canvas-rgb) / 54%));
}

.skill-tree-heading::after {
  position: absolute;
  right: 20px;
  bottom: -1px;
  width: 62px;
  height: 2px;
  background: var(--lime-400);
  box-shadow: none;
  content: "";
}

.skill-tree-heading h1 {
  max-width: 340px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(44px, 13vw, 58px);
  font-stretch: condensed;
  letter-spacing: -0.015em;
  line-height: 0.84;
  text-transform: uppercase;
}

.skill-tree-heading h1:focus {
  outline: none;
}

.skill-tree-heading > p:not(.eyebrow) {
  max-width: 320px;
  margin: 18px 0 0;
  color: var(--cream-300);
  font-size: 14px;
  line-height: 1.5;
}

.tree-summary {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.tree-summary span {
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.1em;
  line-height: 1.4;
}

.constellation-tree {
  position: relative;
  isolation: isolate;
  min-height: 820px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
  background:
    radial-gradient(circle at 50% 12%, rgb(var(--chart-series-1-rgb) / 7%), transparent 24%),
    radial-gradient(circle at 28% 43%, rgb(var(--chart-series-2-rgb) / 8%), transparent 22%),
    radial-gradient(circle at 72% 68%, rgb(var(--chart-series-3-rgb) / 6%), transparent 24%);
}

.constellation-tree::before,
.constellation-tree::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgb(var(--text-primary-rgb) / 7%);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.constellation-tree::before {
  top: 126px;
  left: -108px;
  width: 322px;
  height: 322px;
}

.constellation-tree::after {
  right: -128px;
  bottom: 92px;
  width: 360px;
  height: 360px;
  box-shadow:
    0 0 0 28px rgb(var(--text-primary-rgb) / 2%),
    0 0 0 76px rgb(var(--text-primary-rgb) / 1%);
}

.constellation-stars {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.7;
  background-image:
    radial-gradient(circle at 18% 13%, rgb(var(--chart-series-1-rgb) / 70%) 0 1px, transparent 1.5px),
    radial-gradient(circle at 72% 22%, rgb(var(--chart-series-2-rgb) / 52%) 0 1px, transparent 1.5px),
    radial-gradient(circle at 40% 64%, rgb(var(--chart-series-3-rgb) / 52%) 0 1px, transparent 1.5px),
    radial-gradient(circle at 88% 76%, rgb(var(--chart-series-4-rgb) / 52%) 0 1px, transparent 1.5px);
  background-size: 91px 103px, 133px 121px, 79px 137px, 147px 109px;
}

.constellation-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 820px;
  overflow: visible;
  pointer-events: none;
}

.constellation-connection-glow,
.constellation-connection-line {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.constellation-connection-glow {
  stroke: rgb(var(--chart-series-1-rgb) / 14%);
  stroke-width: 9;
}

.constellation-connection-line {
  stroke: rgb(var(--text-primary-rgb) / 45%);
  stroke-dasharray: 2 5;
  stroke-linecap: round;
  stroke-width: 1.5;
}

.constellation-nodes {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 0;
  list-style: none;
}

.constellation-node {
  position: absolute;
  top: var(--node-y);
  left: var(--node-x);
  width: 132px;
  min-height: 110px;
  animation: node-awaken 480ms cubic-bezier(0.2, 0.75, 0.24, 1) both;
  animation-delay: calc(var(--node-order) * 55ms);
  transform: translate(-50%, -50%);
}

.constellation-node-link {
  display: grid;
  min-height: 108px;
  place-items: start center;
  align-content: start;
  padding: 6px 4px;
  text-align: center;
  text-decoration: none;
}

.constellation-node-halo {
  position: relative;
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 1px solid rgb(var(--text-primary-rgb) / 34%);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgb(var(--text-primary-rgb) / 12%), transparent 42%),
    var(--navy-900);
  box-shadow:
    0 0 0 5px rgb(var(--canvas-rgb) / 88%),
    0 0 0 6px rgb(var(--text-primary-rgb) / 13%),
    var(--shadow-node);
  transition:
    border-color var(--motion-standard) ease-out,
    box-shadow var(--motion-standard) ease-out,
    transform var(--motion-standard) ease-out;
}

.constellation-node-halo::before,
.constellation-node-halo::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.constellation-node-halo::before {
  inset: 6px;
  border: 1px solid rgb(var(--chart-series-1-rgb) / 24%);
}

.constellation-node-halo::after {
  inset: -10px;
  border: 1px solid rgb(var(--text-primary-rgb) / 8%);
}

.constellation-node-core {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgb(var(--text-primary-rgb) / 36%);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, var(--node-highlight), var(--node-shadow) 70%);
  color: var(--cream-100);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.constellation-node-name {
  display: -webkit-box;
  max-width: 128px;
  margin-top: 12px;
  overflow: hidden;
  color: var(--cream-100);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 2px 8px var(--ink-1000);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.constellation-chapter {
  position: absolute;
  top: -20px;
  left: 50%;
  width: max-content;
  max-width: 142px;
  overflow: hidden;
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.12em;
  line-height: 1;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px var(--navy-950);
  text-transform: uppercase;
  transform: translateX(-50%);
  white-space: nowrap;
}

.primary-view-switch,
.atlas-mode-switch {
  position: sticky;
  z-index: 18;
  top: 56px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 8px 16px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: rgb(var(--canvas-rgb) / 96%);
  box-shadow: var(--shadow-sticky);
  backdrop-filter: blur(12px);
}

.primary-view-button,
.atlas-mode-button {
  display: grid;
  min-height: 48px;
  grid-template-columns: auto minmax(0, 1fr);
  place-items: center;
  gap: 9px;
  padding: 8px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--navy-950);
  color: var(--cream-300);
  cursor: pointer;
  font-family: var(--display);
  letter-spacing: 0.08em;
  text-align: left;
  transition:
    border-color var(--motion-fast) ease-out,
    background-color var(--motion-fast) ease-out,
    color var(--motion-fast) ease-out;
}

.primary-view-button span,
.atlas-mode-button span {
  color: var(--cream-300);
  font-size: 16px;
}

.primary-view-button strong,
.atlas-mode-button strong {
  justify-self: start;
  font-size: 10px;
}

.primary-view-button.is-active,
.atlas-mode-button.is-active {
  border-color: var(--lime-400);
  background: var(--lime-400);
  color: var(--navy-950);
}

.primary-view-button.is-active span,
.atlas-mode-button.is-active span {
  color: var(--navy-950);
}

.primary-view-button:focus-visible,
.atlas-mode-button:focus-visible {
  outline: 2px solid var(--cream-100);
  outline-offset: -4px;
}

@media (max-width: 359px) {
  .brand-copy {
    display: none;
  }
}

.primary-view-switch {
  z-index: 20;
}

.primary-view-button span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.explore-view-panel .atlas-mode-switch {
  position: static;
  z-index: auto;
  top: auto;
  box-shadow: none;
}

.primary-view-panel[hidden],
.skill-graph-mode[hidden],
.catalog-list-mode[hidden] {
  display: none !important;
}

.skill-graph-mode {
  padding: 18px 16px 26px;
  border-bottom: 1px solid var(--border-default);
  background:
    linear-gradient(180deg, rgb(var(--text-primary-rgb) / 3%), transparent 180px),
    var(--navy-900);
}

.skill-graph-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 0 0 12px;
}

.skill-graph-toolbar > div:first-child > span {
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.skill-graph-toolbar h2 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.015em;
  line-height: 1;
  text-transform: uppercase;
}

.skill-graph-toolbar p {
  max-width: 250px;
  margin: 7px 0 0;
  color: var(--cream-300);
  font-size: 10px;
  line-height: 1.35;
}

.skill-graph-controls {
  display: grid;
  grid-template-columns: 38px 48px 38px;
  gap: 2px;
}

.skill-graph-controls button {
  display: grid;
  min-width: 38px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--navy-950);
  color: var(--cream-100);
  cursor: pointer;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
}

.skill-graph-controls button:nth-child(2) {
  color: var(--lime-400);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.skill-graph-controls button:hover,
.skill-graph-controls button:focus-visible {
  border-color: var(--lime-400);
  background: var(--accent-soft);
  color: var(--lime-400);
}

.skill-graph-viewport {
  position: relative;
  height: min(68dvh, 620px);
  min-height: 480px;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  outline: none;
  background:
    linear-gradient(90deg, rgb(var(--text-primary-rgb) / 6%) 1px, transparent 1px),
    linear-gradient(0deg, rgb(var(--text-primary-rgb) / 5%) 1px, transparent 1px),
    radial-gradient(circle at 50% 34%, rgb(var(--chart-series-1-rgb) / 7%), transparent 56%),
    var(--navy-950);
  background-size: 24px 24px, 24px 24px, auto, auto;
  box-shadow: var(--shadow-graph-inset);
  cursor: grab;
  overscroll-behavior: contain;
  touch-action: none;
  user-select: none;
}

.skill-graph-viewport:active {
  cursor: grabbing;
}

.skill-graph-viewport:focus-visible {
  border-color: var(--lime-400);
  box-shadow:
    var(--shadow-graph-inset),
    0 0 0 2px rgb(var(--text-primary-rgb) / 22%);
}

.skill-graph {
  display: block;
  width: 100%;
  height: 100%;
}

.skill-graph-stage rect {
  fill: rgb(var(--canvas-rgb) / 54%);
  stroke: rgb(var(--text-primary-rgb) / 15%);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.skill-graph-stage-code,
.skill-graph-stage-count {
  fill: var(--lime-400);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.skill-graph-stage-title {
  fill: var(--cream-300);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.skill-graph-edge {
  fill: none;
  stroke: var(--lime-400);
  stroke-linecap: square;
  stroke-opacity: 0.32;
  stroke-width: 1.25;
  transition:
    opacity var(--motion-fast) ease-out,
    stroke-opacity var(--motion-fast) ease-out,
    stroke-width var(--motion-fast) ease-out;
  vector-effect: non-scaling-stroke;
}

.skill-graph-arrow {
  fill: var(--lime-400);
}

.skill-graph-viewport.has-focus .skill-graph-edge:not(.is-active) {
  opacity: 0.13;
}

.skill-graph-edge.is-active {
  stroke-opacity: 1;
  stroke-width: 2.4;
}

.skill-graph-node {
  cursor: pointer;
  outline: none;
}

.skill-graph-node-body {
  fill: rgb(var(--surface-raised-rgb) / 94%);
  stroke: rgb(var(--text-primary-rgb) / 33%);
  stroke-width: 1;
  transition:
    fill var(--motion-fast) ease-out,
    stroke var(--motion-fast) ease-out,
    opacity var(--motion-fast) ease-out;
  vector-effect: non-scaling-stroke;
}

.skill-graph-node-edge {
  fill: none;
  stroke: var(--cream-300);
  stroke-opacity: 0.45;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.skill-graph-node-signal {
  fill: var(--navy-950);
  stroke: var(--cream-300);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.skill-graph-node-meta {
  fill: var(--cream-300);
  font-family: var(--display);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.skill-graph-node-title {
  fill: var(--cream-100);
  font-family: var(--body);
  font-size: 10px;
  font-weight: 750;
}

.skill-graph-node.is-authored .skill-graph-node-body,
.skill-graph-node.is-authored .skill-graph-node-signal {
  stroke: var(--community-accent);
}

.skill-graph-node.is-authored .skill-graph-node-signal {
  fill: var(--community-accent);
}

.skill-graph-node.is-editorial .skill-graph-node-signal {
  stroke: var(--chart-series-4);
}

.skill-graph-node.is-terminology .skill-graph-node-signal {
  stroke: var(--chart-series-3);
}

.skill-graph-node:hover .skill-graph-node-body,
.skill-graph-node:focus-visible .skill-graph-node-body {
  fill: var(--navy-800);
  stroke: var(--lime-400);
}

.skill-graph-viewport.has-focus .skill-graph-node:not(.is-selected, .is-prerequisite, .is-dependent) .skill-graph-node-body {
  opacity: 0.38;
}

.skill-graph-node.is-selected .skill-graph-node-body {
  fill: rgb(var(--chart-series-1-rgb) / 18%);
  stroke: var(--chart-series-1);
  stroke-width: 2;
}

.skill-graph-node.is-selected .skill-graph-node-title {
  fill: var(--chart-series-1);
}

.skill-graph-node.is-prerequisite .skill-graph-node-body {
  stroke: var(--chart-series-2);
}

.skill-graph-node.is-dependent .skill-graph-node-body {
  stroke: var(--chart-series-3);
}

.skill-graph-viewport[data-zoom-tier="overview"] .skill-graph-node-meta,
.skill-graph-viewport[data-zoom-tier="overview"] .skill-graph-node-title {
  opacity: 0;
}

.skill-graph-viewport[data-zoom-tier="mid"] .skill-graph-node-meta {
  opacity: 0;
}

.skill-graph-hint {
  position: absolute;
  right: 12px;
  bottom: 10px;
  margin: 0;
  padding: 5px 7px;
  border: 1px solid rgb(var(--text-primary-rgb) / 18%);
  background: rgb(var(--canvas-rgb) / 88%);
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.skill-graph-legend {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-top: 0;
  background: var(--navy-950);
  color: var(--cream-300);
}

.skill-graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.skill-graph-legend i {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--lime-400);
}

.skill-graph-legend i.is-authored {
  width: 8px;
  height: 8px;
  border: 1px solid var(--community-accent);
  background: var(--community-accent);
  transform: rotate(45deg);
}

.skill-graph-legend strong,
.skill-graph-legend small {
  font-family: var(--display);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.skill-graph-legend small {
  margin-left: auto;
  color: var(--lime-400);
}

.constellation-node-link:hover .constellation-node-halo,
.constellation-node-link:focus-visible .constellation-node-halo {
  border-color: var(--lime-400);
  box-shadow:
    0 0 0 5px rgb(var(--canvas-rgb) / 88%),
    0 0 0 7px rgb(var(--chart-series-1-rgb) / 20%),
    0 0 28px rgb(var(--chart-series-1-rgb) / 22%);
  transform: scale(1.08);
}

.constellation-node-link:hover .constellation-node-core,
.constellation-node-link:focus-visible .constellation-node-core {
  color: var(--lime-400);
}

.constellation-node-link:active .constellation-node-halo {
  transform: scale(0.97);
}

.tree-footnote {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 22px;
  color: var(--cream-300);
}

.tree-footnote p {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
}

.tree-key-mark {
  display: block;
  width: 24px;
  height: 1px;
  flex: 0 0 24px;
  background: var(--lime-400);
  box-shadow: none;
}

.lesson-tree-back {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  margin: -20px 0 28px;
  padding: 8px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition:
    border-color var(--motion-fast) ease-out,
    color var(--motion-fast) ease-out,
    background-color var(--motion-fast) ease-out;
}

.lesson-tree-back:hover {
  border-color: var(--lime-400);
  background: var(--accent-soft);
  color: var(--lime-400);
}

body[data-locale="zh-Hant"] .skill-tree-heading h1,
body[data-locale="zh-Hant"] .constellation-chapter,
body[data-locale="zh-Hant"] .lesson-tree-back {
  font-family: var(--body);
  letter-spacing: 0.02em;
  text-transform: none;
}

body[data-locale="zh-Hant"] .skill-tree-heading h1 {
  font-size: clamp(42px, 13vw, 56px);
  line-height: 0.94;
}

@keyframes node-awaken {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 12px)) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Controlled Edge route-map prototype. Normal flow owns vertical scrolling. */
body[data-view="tree"] {
  overflow-y: auto;
  overscroll-behavior-y: auto;
}

.dependency-map-home[hidden],
.lesson-content[hidden] {
  display: none !important;
}

.dependency-map-home {
  position: relative;
  border-right: 1px solid var(--border-subtle);
  border-left: 1px solid var(--border-subtle);
  background: var(--navy-950);
}

.route-map-heading {
  position: relative;
  padding: 32px 20px 22px;
  border-bottom: 1px solid var(--border-subtle);
  background:
    linear-gradient(90deg, rgb(var(--text-primary-rgb) / 4%) 1px, transparent 1px),
    linear-gradient(180deg, rgb(var(--text-primary-rgb) / 3%) 1px, transparent 1px),
    var(--navy-950);
  background-size: 24px 24px;
}

.route-map-heading::after {
  position: absolute;
  right: 20px;
  bottom: -1px;
  width: 64px;
  height: 2px;
  background: var(--lime-400);
  content: "";
}

.skill-tree-heading,
.route-map-heading {
  isolation: isolate;
  overflow: hidden;
}

.skill-tree-heading::before,
.route-map-heading::before {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: -18px;
  width: 176px;
  height: 176px;
  background: url("./assets/sensesei-logo.png") center / contain no-repeat;
  content: "";
  filter: grayscale(1) brightness(4);
  opacity: 0.05;
  pointer-events: none;
  transform: translateY(-50%);
}

.skill-tree-heading > *,
.route-map-heading > * {
  position: relative;
  z-index: 1;
}

.skill-tree-heading::after,
.route-map-heading::after {
  z-index: 2;
}

.route-map-heading h1 {
  max-width: 350px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(42px, 12.5vw, 56px);
  font-stretch: condensed;
  letter-spacing: -0.01em;
  line-height: 0.86;
  text-transform: uppercase;
}

.route-map-heading h1:focus {
  outline: none;
}

.route-map-heading > p:not(.eyebrow) {
  max-width: 330px;
  margin: 18px 0 0;
  color: var(--cream-300);
  font-size: 14px;
  line-height: 1.55;
}

.route-map {
  position: relative;
  overflow: visible;
  padding: 24px 16px 40px;
  background:
    linear-gradient(90deg, transparent 49.8%, rgb(var(--text-primary-rgb) / 5%) 50%, transparent 50.2%),
    repeating-linear-gradient(0deg, transparent 0 47px, rgb(var(--text-primary-rgb) / 3%) 48px),
    var(--navy-900);
}

.route-map::before {
  position: absolute;
  inset: 0 auto 0 16px;
  width: 3px;
  background: linear-gradient(180deg, var(--inverse-surface), rgb(var(--text-primary-rgb) / 12%) 34%, transparent 100%);
  content: "";
}

.route-map-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-map-step {
  display: flex;
  flex-direction: column;
  width: 100%;
  animation: route-node-enter var(--motion-standard) ease-out both;
}

.route-map-step.is-left {
  align-items: flex-start;
}

.route-map-step.is-center {
  align-items: center;
}

.route-map-step.is-right {
  align-items: flex-end;
}

.route-chapter-band {
  display: grid;
  width: 100%;
  min-height: 42px;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 16px 0 10px;
  padding: 7px 10px;
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-subtle);
  background: rgb(var(--canvas-rgb) / 94%);
  font-family: var(--display);
  text-transform: uppercase;
}

.route-map-step:first-child .route-chapter-band {
  margin-top: 0;
}

.route-chapter-band > span {
  color: var(--lime-400);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.route-chapter-band strong {
  overflow: hidden;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-chapter-band small {
  color: var(--cream-300);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.route-map-connector {
  display: block;
  width: 100%;
  height: 52px;
  overflow: visible;
  pointer-events: none;
}

.route-map-connector path {
  fill: none;
  stroke: rgb(var(--text-primary-rgb) / 45%);
  stroke-linecap: square;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.route-map-node {
  position: relative;
  display: grid;
  width: min(82%, 320px);
  min-height: 82px;
  grid-template-columns: 54px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  background:
    linear-gradient(135deg, rgb(var(--text-primary-rgb) / 6%), transparent 48%),
    var(--navy-950);
  color: var(--cream-100);
  text-decoration: none;
  transition:
    border-color var(--motion-fast) ease-out,
    background-color var(--motion-fast) ease-out,
    transform var(--motion-fast) ease-out;
}

.route-map-node::before {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 18px;
  height: 18px;
  border-top: 2px solid var(--lime-400);
  border-right: 2px solid var(--lime-400);
  content: "";
}

.route-map-node:hover,
.route-map-node:focus-visible {
  border-color: var(--lime-400);
  background-color: var(--navy-800);
}

.route-map-node:active {
  transform: translateY(1px);
}

.route-node-index {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--border-default);
  background: var(--navy-900);
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
}

.route-node-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.route-node-copy small {
  overflow: hidden;
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.1em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.route-node-copy strong {
  font-size: 14px;
  line-height: 1.2;
}

.route-node-open {
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 18px;
  text-align: right;
}

.dependency-preview {
  padding: 32px 16px 36px;
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--navy-950);
}

.dependency-preview-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  align-items: end;
}

.dependency-preview-heading .eyebrow {
  grid-column: 1 / -1;
}

.dependency-preview-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 0.01em;
  line-height: 0.95;
  text-transform: uppercase;
}

.dependency-preview-heading > span {
  padding: 5px 7px;
  border: 1px solid var(--border-default);
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.dependency-preview > p {
  margin: 16px 0 24px;
  color: var(--cream-300);
  font-size: 13px;
  line-height: 1.55;
}

.dependency-input-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.dependency-input-node {
  display: grid;
  min-height: 88px;
  align-content: space-between;
  gap: 12px;
  padding: 10px 8px;
  border: 1px solid var(--border-default);
  background: var(--navy-900);
}

.dependency-input-node span {
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.dependency-input-node strong {
  font-size: 10px;
  line-height: 1.2;
}

.dependency-merge-lines {
  display: block;
  width: 100%;
  height: 70px;
}

.dependency-merge-lines path {
  fill: none;
  stroke: var(--border-default);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.dependency-gate {
  width: max-content;
  max-width: 80%;
  min-height: 34px;
  margin: 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--lime-400);
  background: var(--accent-soft);
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
}

.dependency-target-node {
  position: relative;
  display: grid;
  width: min(82%, 320px);
  min-height: 76px;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  margin: 46px auto 0;
  padding: 12px;
  border: 2px solid var(--lime-400);
  background: var(--navy-900);
}

.dependency-target-node::before {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 1px;
  height: 46px;
  background: var(--lime-400);
  content: "";
}

.dependency-target-node > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  background: var(--lime-400);
  color: var(--navy-950);
  font-size: 22px;
  font-weight: 900;
}

.dependency-target-node div {
  display: grid;
  gap: 4px;
}

.dependency-target-node small {
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.dependency-target-node strong {
  font-size: 15px;
}

.route-map-footnote {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 24px;
  color: var(--cream-300);
}

.route-map-footnote p {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
}

.route-key-mark {
  display: block;
  width: 24px;
  height: 2px;
  flex: 0 0 24px;
  background: var(--lime-400);
}

body[data-locale="zh-Hant"] .route-map-heading h1,
body[data-locale="zh-Hant"] .route-chapter-band,
body[data-locale="zh-Hant"] .dependency-preview-heading h2,
body[data-locale="zh-Hant"] .dependency-preview-heading > span,
body[data-locale="zh-Hant"] .dependency-gate {
  font-family: var(--body);
  letter-spacing: 0.02em;
  text-transform: none;
}

body[data-locale="zh-Hant"] .route-map-heading h1 {
  font-size: clamp(40px, 12.5vw, 54px);
  line-height: 0.95;
}

@keyframes route-node-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (forced-colors: active) {
  .next-action,
  .focus-progress span,
  .compact-list li::before,
  .safety-list li::before {
    forced-color-adjust: none;
  }
}

/* Complete catalogue map: 85 skills, grouped by stable stage and family. */

.route-map-heading {
  padding-bottom: 26px;
}

.route-map-heading h1 {
  max-width: 360px;
  font-size: clamp(42px, 12vw, 54px);
}

.tree-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 22px;
  border: 1px solid var(--border-subtle);
  background: var(--border-subtle);
}

.tree-summary span {
  min-width: 0;
  padding: 8px 6px;
  background: var(--navy-950);
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-align: center;
  white-space: nowrap;
}

.catalog-toolbar {
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--navy-900);
}

.catalog-search {
  display: grid;
  gap: 7px;
}

.catalog-search > span:first-child {
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.catalog-search-field {
  display: grid;
  min-height: 48px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--navy-950);
}

.catalog-search-field:focus-within {
  border-color: var(--lime-400);
  box-shadow: 0 0 0 1px var(--lime-400);
}

.catalog-search-field > span {
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 22px;
  text-align: center;
}

.catalog-search input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 12px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--cream-100);
  font: inherit;
  font-size: 14px;
}

.catalog-search input::placeholder {
  color: rgb(var(--text-secondary-rgb) / 72%);
}

.catalog-filters {
  display: flex;
  gap: 7px;
  margin-top: 10px;
  overflow-x: auto;
  padding: 2px 1px 5px;
  scrollbar-width: none;
}

.catalog-filters::-webkit-scrollbar {
  display: none;
}

.catalog-filter {
  display: inline-flex;
  min-height: 40px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--cream-300);
  cursor: pointer;
  font-family: var(--display);
  letter-spacing: 0.06em;
}

.catalog-filter span {
  font-size: 9px;
  font-weight: 750;
}

.catalog-filter strong {
  color: var(--cream-100);
  font-size: 10px;
}

.catalog-filter.is-active {
  border-color: var(--lime-400);
  background: var(--accent-soft);
  color: var(--lime-400);
}

.catalog-filter.is-active strong {
  color: var(--lime-400);
}

.stage-index {
  position: sticky;
  z-index: 12;
  top: 56px;
  display: flex;
  gap: 1px;
  overflow-x: auto;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgb(var(--canvas-rgb) / 97%);
  box-shadow: var(--shadow-index);
  scrollbar-width: none;
}

.stage-index::-webkit-scrollbar {
  display: none;
}

.stage-index[hidden] {
  display: none;
}

.stage-index button {
  display: grid;
  min-width: 52px;
  min-height: 48px;
  flex: 1 0 52px;
  place-content: center;
  gap: 1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--cream-300);
  cursor: pointer;
  font-family: var(--display);
  text-align: center;
}

.stage-index button:hover,
.stage-index button:focus-visible {
  border-bottom-color: var(--lime-400);
  color: var(--lime-400);
}

.stage-index button span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.stage-index button strong {
  font-size: 8px;
}

.route-map {
  overflow: visible;
  padding: 0 0 32px;
  background:
    linear-gradient(90deg, transparent 15px, rgb(var(--text-primary-rgb) / 9%) 16px, transparent 17px),
    repeating-linear-gradient(0deg, transparent 0 47px, rgb(var(--text-primary-rgb) / 2.5%) 48px),
    var(--navy-900);
}

.route-map::before {
  display: none;
}

.route-map-list {
  display: block;
  margin: 0;
  padding: 0;
}

.core-path-preview {
  padding: 24px 16px 30px;
  border-bottom: 1px solid var(--border-default);
  background: var(--navy-950);
}

.core-path-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.core-path-heading .eyebrow,
.catalogue-intro .eyebrow {
  margin: 0 0 7px;
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.core-path-heading h2,
.catalogue-intro h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.015em;
  line-height: 1;
  text-transform: uppercase;
}

.core-path-heading p:last-child,
.catalogue-intro p:last-child {
  max-width: 34rem;
  margin: 8px 0 0;
  color: var(--cream-300);
  font-size: 11px;
  line-height: 1.45;
}

.core-path-heading > strong {
  padding-top: 21px;
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.core-path-grid {
  --core-path-column-gap: 28px;
  --core-path-row-gap: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(80px, auto);
  gap: var(--core-path-row-gap) var(--core-path-column-gap);
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.core-path-step {
  position: relative;
  min-width: 0;
  grid-column: var(--path-column);
  grid-row: var(--path-row);
}

.core-path-step::after {
  position: absolute;
  z-index: 0;
  background: var(--lime-400);
  content: "";
  pointer-events: none;
}

.core-path-step::before {
  position: absolute;
  z-index: 2;
  width: 0;
  height: 0;
  content: "";
  pointer-events: none;
}

.core-path-step[data-connector="right"]::after {
  top: calc(50% - 1px);
  left: 100%;
  width: var(--core-path-column-gap);
  height: 2px;
}

.core-path-step[data-connector="right"]::before {
  top: calc(50% - 4px);
  left: calc(100% + var(--core-path-column-gap) - 7px);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid var(--lime-400);
}

.core-path-step[data-connector="left"]::after {
  top: calc(50% - 1px);
  right: 100%;
  width: var(--core-path-column-gap);
  height: 2px;
}

.core-path-step[data-connector="left"]::before {
  top: calc(50% - 4px);
  right: calc(100% + var(--core-path-column-gap) - 7px);
  border-top: 4px solid transparent;
  border-right: 7px solid var(--lime-400);
  border-bottom: 4px solid transparent;
}

.core-path-step[data-connector="down"]::after {
  top: 100%;
  left: calc(50% - 1px);
  width: 2px;
  height: var(--core-path-row-gap);
}

.core-path-step[data-connector="down"]::before {
  top: calc(100% + var(--core-path-row-gap) - 7px);
  left: calc(50% - 4px);
  border-top: 7px solid var(--lime-400);
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.core-path-step[data-connector="none"]::after {
  display: none;
}

.core-path-step[data-connector="none"]::before {
  display: none;
}

.core-path-node {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  min-height: 80px;
  grid-template-columns: auto minmax(0, 1fr) 10px;
  align-items: center;
  gap: 9px;
  padding: 12px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  color: var(--cream-100);
}

.core-path-node:hover,
.core-path-node:focus-visible {
  border-color: var(--lime-400);
  background: var(--navy-800);
}

.core-node-index {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--lime-400);
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.core-node-copy {
  display: grid;
  min-width: 0;
}

.core-node-copy small {
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.06em;
  line-height: 1.25;
}

.core-node-copy strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.18;
}

.core-node-mark {
  width: 8px;
  height: 8px;
  border: 1px solid var(--lime-400);
  transform: rotate(45deg);
}

.learn-view-panel {
  background: var(--navy-950);
}

.learn-path-rail {
  display: block;
}

.learn-explore-cta {
  display: grid;
  gap: 18px;
  padding: 24px 16px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--navy-900);
}

.learn-explore-cta h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.015em;
  line-height: 1;
}

.learn-explore-cta p {
  max-width: 34rem;
  margin: 8px 0 0;
  color: var(--cream-300);
  font-size: 12px;
  line-height: 1.5;
}

.learn-explore-action {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  cursor: pointer;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-align: left;
  white-space: nowrap;
}

.learn-explore-action strong {
  font-size: 18px;
}

.catalogue-intro {
  padding: 24px 16px 16px 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--navy-900);
}

.skill-stage {
  position: relative;
  padding: 28px 16px 32px 28px;
  border-bottom: 1px solid var(--border-subtle);
  scroll-margin-top: 112px;
}

.skill-stage::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 15px;
  width: 2px;
  background: linear-gradient(180deg, var(--inverse-surface), rgb(var(--text-primary-rgb) / 14%));
  content: "";
}

.skill-stage::after {
  position: absolute;
  top: 35px;
  left: 11px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--lime-400);
  background: var(--navy-950);
  content: "";
  transform: rotate(45deg);
}

.skill-stage-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.skill-stage-index {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--lime-400);
  background: var(--accent-soft);
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.skill-stage-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.015em;
  line-height: 1;
  text-transform: uppercase;
}

.skill-stage-heading p {
  margin: 7px 0 0;
  color: var(--cream-300);
  font-size: 11px;
  line-height: 1.4;
}

.skill-stage-heading > strong {
  padding-top: 4px;
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.stage-branch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin-top: 18px;
}

.family-branch {
  min-width: 0;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
}

.family-branch-heading {
  display: grid;
  min-height: 38px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgb(var(--surface-raised-rgb) / 72%);
}

.family-branch-heading span,
.family-branch-heading strong {
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.family-branch-heading h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.family-node-list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 7px;
  list-style: none;
}

.family-node-list::before {
  display: none;
}

.catalog-node-item {
  position: relative;
  min-width: 0;
}

.catalog-skill-node {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 78px;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  padding: 9px 7px 8px 5px;
  border: 1px solid rgb(var(--text-primary-rgb) / 8%);
  border-radius: var(--radius-sm);
  background: rgb(var(--surface-raised-rgb) / 58%);
  color: var(--cream-100);
}

.catalog-skill-node:hover,
.catalog-skill-node:focus-visible {
  border-color: var(--border-default);
  background: var(--navy-800);
}

.catalog-node-signal {
  position: relative;
  z-index: 1;
  display: block;
  width: 9px;
  height: 9px;
  margin-top: 3px;
  border: 2px solid var(--cream-300);
  background: var(--navy-950);
  transform: rotate(45deg);
}

.catalog-skill-node.is-editorial .catalog-node-signal {
  border-color: var(--amber-400);
}

.catalog-skill-node.is-terminology .catalog-node-signal {
  border-color: var(--ice-400);
}

.catalog-skill-node.is-authored .catalog-node-signal {
  border-color: var(--lime-400);
  background: var(--lime-400);
  box-shadow: none;
}

.catalog-node-copy {
  display: grid;
  min-width: 0;
}

.catalog-node-copy small {
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.07em;
  line-height: 1;
}

.catalog-node-copy strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.18;
}

.catalog-node-copy > span {
  margin-top: 6px;
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 7px;
  letter-spacing: 0.05em;
}

.catalog-node-state {
  grid-column: 2;
  width: max-content;
  max-width: 100%;
  margin-top: -2px;
  padding: 2px 4px;
  border-left: 1px solid var(--border-default);
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 6px;
  font-weight: 750;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.catalog-skill-node.is-authored .catalog-node-state {
  border-color: var(--lime-400);
  color: var(--lime-400);
}

.catalog-skill-node.is-editorial .catalog-node-state {
  border-color: var(--amber-400);
  color: var(--amber-400);
}

.catalog-skill-node.is-terminology .catalog-node-state {
  border-color: var(--ice-400);
  color: var(--ice-400);
}

.catalog-skill-node.is-selected,
.core-path-node.is-selected {
  border-color: var(--lime-400);
  background: var(--accent-soft);
}

.catalog-skill-node.is-prerequisite,
.core-path-node.is-prerequisite {
  border-left-color: var(--lime-400);
  background: rgb(var(--text-primary-rgb) / 5%);
}

.catalog-skill-node.is-dependent,
.core-path-node.is-dependent {
  border-right-color: var(--ice-400);
  background: rgb(var(--text-primary-rgb) / 3%);
}

.catalog-empty {
  display: grid;
  min-height: 360px;
  place-content: center;
  padding: 48px 24px;
  text-align: center;
}

.catalog-empty > span {
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 44px;
}

.catalog-empty h2 {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: 22px;
}

.catalog-empty p {
  max-width: 280px;
  margin: 10px auto 0;
  color: var(--cream-300);
  font-size: 13px;
}

.route-map-footnote {
  border-top: 1px solid var(--border-subtle);
  background: var(--navy-950);
}

.skill-inspector {
  position: fixed;
  inset: 0;
  width: min(calc(100% - 24px), 406px);
  max-width: none;
  height: 84dvh;
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--navy-950);
  color: var(--cream-100);
  box-shadow: var(--shadow-dialog);
}

#skill-inspector-content {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.skill-inspector::backdrop {
  background: rgb(var(--shadow-rgb) / 72%);
  backdrop-filter: blur(3px);
}

.inspector-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: start;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border-subtle);
  background:
    linear-gradient(90deg, rgb(var(--text-primary-rgb) / 4%) 1px, transparent 1px),
    var(--navy-950);
  background-size: 22px 22px;
}

.inspector-header p {
  margin: 0;
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.inspector-header h2 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.01em;
  line-height: 0.98;
  text-transform: uppercase;
}

.inspector-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--navy-900);
  color: var(--cream-100);
  cursor: pointer;
  font-size: 24px;
}

.inspector-scroll {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 12px 16px 16px;
  overscroll-behavior: contain;
}

.inspector-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inspector-meta span {
  padding: 4px 6px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.inspector-note {
  margin: 16px 0 0;
  color: var(--cream-100);
  font-size: 14px;
  line-height: 1.55;
}

.dependency-flow {
  margin: 16px 0 18px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  background:
    linear-gradient(180deg, rgb(var(--text-primary-rgb) / 4%), transparent 48%),
    rgb(var(--surface-raised-rgb) / 58%);
}

.dependency-flow-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.dependency-flow-heading strong {
  color: var(--lime-400);
}

.dependency-flow-inputs {
  display: grid;
  grid-template-columns: repeat(var(--dependency-columns), minmax(0, 1fr));
  gap: 5px;
}

.dependency-flow-input {
  display: grid;
  min-width: 0;
  min-height: 54px;
  align-content: space-between;
  gap: 6px;
  padding: 7px 5px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  background: var(--navy-900);
  color: var(--cream-100);
}

.dependency-flow-input:hover,
.dependency-flow-input:focus-visible {
  border-color: var(--lime-400);
  background: var(--navy-800);
}

.dependency-flow-input span,
.dependency-flow-target small {
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.dependency-flow-input strong {
  overflow-wrap: anywhere;
  font-size: 9px;
  line-height: 1.12;
}

.dependency-flow-lines {
  display: block;
  width: 100%;
  height: 64px;
  overflow: visible;
  color: var(--lime-400);
  pointer-events: none;
}

.dependency-flow-input-line,
.dependency-flow-target-line {
  fill: none;
  stroke: currentcolor;
  stroke-linecap: square;
  vector-effect: non-scaling-stroke;
}

.dependency-flow-input-line {
  stroke-width: 1.25;
}

.dependency-flow-target-line {
  stroke-width: 2;
}

.dependency-flow-arrow {
  fill: currentcolor;
}

.dependency-flow-target {
  display: grid;
  min-height: 56px;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 2px solid var(--lime-400);
  border-radius: var(--radius-xs);
  background: var(--accent-soft);
}

.dependency-flow-target > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  background: var(--lime-400);
  color: var(--navy-950);
  font-size: 12px;
}

.dependency-flow-target div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.dependency-flow-target strong {
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.2;
}

.inspector-section {
  margin-top: 24px;
}

.inspector-section-heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.inspector-section-heading span {
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.inspector-section-heading h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.inspector-section-heading strong {
  color: var(--cream-300);
  font-family: var(--display);
  font-size: 9px;
}

.inspector-relationship-list,
.inspector-source-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.inspector-relationship-list button,
.inspector-source-list a {
  display: grid;
  width: 100%;
  min-height: 52px;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  color: var(--cream-100);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.inspector-relationship-list span,
.inspector-source-list span {
  color: var(--lime-400);
  font-family: var(--display);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.inspector-relationship-list strong,
.inspector-source-list strong {
  font-size: 12px;
  line-height: 1.25;
}

.inspector-relationship-list .is-recommended span {
  color: var(--amber-400);
}

.inspector-relationship-list .is-candidate span {
  color: var(--ice-400);
}

.inspector-source-list a {
  grid-template-columns: 78px minmax(0, 1fr) 18px;
}

.inspector-source-list small {
  color: var(--lime-400);
  font-size: 14px;
  text-align: right;
}

.inspector-empty {
  margin: 10px 0 0;
  padding: 12px;
  border-left: 2px solid var(--border-default);
  color: var(--cream-300);
  font-size: 12px;
}

.inspector-footer {
  position: relative;
  z-index: 2;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-subtle);
  background: var(--navy-950);
}

.inspector-lesson-action,
.inspector-lesson-pending {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--lime-400);
  border-radius: var(--radius-sm);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.inspector-lesson-pending {
  border-color: var(--border-subtle);
  color: var(--cream-300);
}

body[data-locale="zh-Hant"] .skill-stage-heading h2,
body[data-locale="zh-Hant"] .core-path-heading h2,
body[data-locale="zh-Hant"] .catalogue-intro h2,
body[data-locale="zh-Hant"] .family-branch-heading h3,
body[data-locale="zh-Hant"] .primary-view-button,
body[data-locale="zh-Hant"] .atlas-mode-button,
body[data-locale="zh-Hant"] .learn-explore-cta h2,
body[data-locale="zh-Hant"] .learn-explore-action,
body[data-locale="zh-Hant"] .skill-graph-toolbar h2,
body[data-locale="zh-Hant"] .skill-graph-toolbar > div:first-child > span,
body[data-locale="zh-Hant"] .skill-graph-stage-title,
body[data-locale="zh-Hant"] .skill-graph-node-title,
body[data-locale="zh-Hant"] .skill-graph-hint,
body[data-locale="zh-Hant"] .skill-graph-legend,
body[data-locale="zh-Hant"] .inspector-header h2,
body[data-locale="zh-Hant"] .inspector-section-heading h3 {
  font-family: var(--body);
  letter-spacing: 0.01em;
  text-transform: none;
}

@media (max-width: 350px) {
  .skill-graph-mode {
    padding-right: 12px;
    padding-left: 12px;
  }

  .skill-graph-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .skill-graph-controls {
    width: 100%;
    grid-template-columns: 44px minmax(64px, 1fr) 44px;
  }

  .skill-graph-viewport {
    min-height: 440px;
  }

  .skill-stage {
    padding-right: 12px;
  }

  .skill-stage-heading {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .skill-stage-heading > strong {
    display: none;
  }
}

/* The document is the single scroll owner. Avoid an accidental body scroll
   container so the app bar and stage index can remain sticky. */
html {
  overflow-x: clip;
  scroll-behavior: auto;
}

body,
body[data-view="tree"] {
  overflow-x: clip;
  overflow-y: visible;
}

/* Soft monochrome calibration: luminance establishes hierarchy; blue is reserved
   for current position, selection, and learning-path data. */
.eyebrow,
.catalogue-intro .eyebrow,
.skill-graph-toolbar > div:first-child > span {
  color: var(--orientation-accent);
}

.core-path-heading .eyebrow {
  color: var(--community-accent);
}

.primary-view-button.is-active,
.atlas-mode-button.is-active {
  border-color: var(--mode-active-border);
  background: var(--mode-active-surface);
  color: var(--mode-active-text);
  box-shadow: inset 0 -2px 0 var(--mode-active-border);
}

.primary-view-button.is-active span,
.atlas-mode-button.is-active span {
  color: var(--mode-active-signal);
}

.catalog-search-field {
  border-color: var(--border-subtle);
  background: var(--surface-raised);
}

.catalog-search-field:focus-within {
  border-color: var(--orientation-accent);
  box-shadow: 0 0 0 1px var(--orientation-accent);
}

.catalog-search-field > span,
.stage-index button:hover,
.stage-index button:focus-visible {
  color: var(--orientation-accent);
}

.catalog-search input {
  color: var(--text-body);
}

.catalog-search input::placeholder {
  color: var(--text-tertiary);
}

.catalog-filter.is-active {
  border-color: var(--orientation-accent);
  background: var(--orientation-soft);
  color: var(--orientation-accent);
}

.catalog-filter.is-active strong {
  color: var(--orientation-accent);
}

.stage-index button {
  color: var(--text-tertiary);
}

.stage-index button:hover,
.stage-index button:focus-visible {
  border-bottom-color: var(--orientation-accent);
}

.tree-summary span,
.core-path-heading > strong,
.skill-stage-heading > strong,
.core-node-copy small,
.catalog-node-copy small,
.catalog-node-copy > span,
.catalog-node-state {
  color: var(--text-tertiary);
}

.tree-summary span {
  background: var(--surface);
}

.explore-view-panel .stage-index {
  top: 121px;
}

.core-path-step::after {
  background: var(--orientation-accent);
}

.core-path-step[data-connector="right"]::before {
  border-left-color: var(--orientation-accent);
}

.core-path-step[data-connector="left"]::before {
  border-right-color: var(--orientation-accent);
}

.core-path-step[data-connector="down"]::before {
  border-top-color: var(--orientation-accent);
}

.core-path-node:hover,
.core-path-node:focus-visible,
.core-path-node.is-selected {
  border-color: var(--orientation-accent);
  background: var(--orientation-soft);
}

.core-node-index,
.core-node-mark {
  border-color: var(--orientation-accent);
  color: var(--orientation-accent);
}

.skill-stage::before {
  background: linear-gradient(180deg, var(--orientation-accent), rgb(var(--chart-series-1-rgb) / 12%));
}

.skill-stage::after,
.skill-stage-index {
  border-color: var(--orientation-accent);
}

.skill-stage-index {
  background: var(--orientation-soft);
  color: var(--orientation-accent);
}

.family-branch-heading span,
.family-branch-heading strong {
  color: var(--text-secondary);
}

.catalog-skill-node.is-authored .catalog-node-signal {
  border-color: var(--community-accent);
  background: var(--community-accent);
}

.catalog-skill-node.is-authored .catalog-node-state {
  border-color: var(--community-accent);
  color: var(--community-accent);
}

.catalog-skill-node.is-selected,
.catalog-skill-node.is-prerequisite {
  border-color: var(--orientation-accent);
  background: var(--orientation-soft);
}

.path-lesson.is-current {
  border-left-color: var(--orientation-accent);
  background: var(--orientation-soft);
}

.path-now {
  color: var(--orientation-accent);
}

/* Keep the complete dependency map available without making every edge compete
   with the nodes. Interaction restores emphasis to the active relationship. */
.skill-graph-edge {
  stroke: var(--text-secondary);
  stroke-opacity: 0.17;
  stroke-width: 1;
}

.skill-graph-arrow {
  fill: var(--text-tertiary);
  opacity: 0.55;
}

.skill-graph-edge.is-active {
  stroke: var(--orientation-accent);
  stroke-opacity: 0.92;
  stroke-width: 2.2;
}

.skill-graph-node-body {
  stroke: rgb(var(--text-primary-rgb) / 22%);
}

.skill-graph-node-title {
  fill: var(--text-body);
}

.skill-graph-stage-code,
.skill-graph-stage-count {
  fill: var(--text-tertiary);
}
