    :root {
      --world: #101a36;
      --world-raised: #18274d;
      --paper: #f7f3e8;
      --paper-deep: #ede6d6;
      --surface: #ffffff;
      --ink: #17233d;
      --ink-soft: #58657d;
      --line: #d9d5c9;
      --signal: #ffc93c;
      --action: #3f58d9;
      --circuit: #25c5c0;
      --physical: #f26a4f;
      --success: #137a54;
      --warning: #d98a00;
      --error: #b83d45;
      --lab: #0d1422;
      --lab-raised: #151e30;
      --lab-line: #2a3851;
      --lab-text: #f5f7fb;
      --lab-soft: #aebbd0;
      --shadow: 0 18px 50px rgba(25, 34, 59, .13);
      --radius-xl: 24px;
      --radius-lg: 18px;
      --radius-md: 12px;
      --fast: 120ms;
      --panel: 220ms;
      --travel: 360ms;
      --appbar: 76px;
    }

    * { box-sizing: border-box; }
    html, body { min-height: 100%; }
    html { background: var(--paper); }
    body {
      margin: 0;
      color: var(--ink);
      background: #e9e4d8;
      font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
      font-size: 16px;
      line-height: 1.55;
      overflow: hidden;
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
    }
    button, textarea, input { font: inherit; }
    button { cursor: pointer; }
    button:focus-visible, a:focus-visible, textarea:focus-visible {
      outline: 3px solid #fff;
      outline-offset: 3px;
      box-shadow: 0 0 0 6px var(--action);
    }
    button:disabled { cursor: not-allowed; }
    svg { display: block; }
    .sr-only {
      position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
      overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
    .icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
    .icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
    .skip-link {
      position: fixed; top: 10px; left: 10px; z-index: 1000; transform: translateY(-150%);
      padding: 12px 18px; background: var(--signal); color: var(--ink); border-radius: 10px; font-weight: 900;
    }
    .skip-link:focus { transform: none; }

    .app-shell {
      width: 100%; height: 100svh; min-height: 620px;
      display: flex; flex-direction: column; overflow: hidden;
      background: var(--paper);
    }
    .appbar {
      height: var(--appbar); flex: 0 0 var(--appbar);
      display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
      align-items: center; gap: 20px; padding: 0 24px;
      position: relative; z-index: 30;
      background: rgba(247, 243, 232, .96);
      border-bottom: 1px solid var(--line);
      transition: color var(--panel), background var(--panel), border-color var(--panel);
    }
    .app-shell[data-screen="map"] .appbar,
    .app-shell[data-screen="create"] .appbar {
      color: #fff; background: rgba(16, 26, 54, .94); border-color: rgba(255, 255, 255, .12);
    }
    .brand {
      display: inline-flex; align-items: center; gap: 12px; justify-self: start;
      color: inherit; text-decoration: none; min-width: 0;
    }
    .brandmark {
      width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
      color: var(--ink); background: var(--signal);
      border: 1px solid rgba(23, 35, 61, .18); box-shadow: 0 7px 18px rgba(20, 32, 67, .18);
      transform: rotate(-3deg);
    }
    .brandmark .icon { width: 26px; height: 26px; stroke-width: 2.2; }
    .brand-copy { min-width: 0; }
    .brand-copy b { display: block; font-size: 18px; line-height: 1.2; letter-spacing: .02em; white-space: nowrap; }
    .brand-copy small { display: block; margin-top: 3px; font-size: 10px; font-weight: 800; letter-spacing: .16em; opacity: .62; white-space: nowrap; }
    .main-nav {
      display: flex; align-items: center; gap: 6px; padding: 5px;
      border-radius: 14px; background: rgba(23, 35, 61, .06); border: 1px solid rgba(23, 35, 61, .08);
    }
    .app-shell[data-screen="map"] .main-nav,
    .app-shell[data-screen="create"] .main-nav { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.1); }
    .main-nav button {
      min-width: 44px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px;
      display: flex; align-items: center; gap: 8px;
      color: inherit; background: transparent; font-weight: 800; font-size: 14px;
      transition: background var(--fast), color var(--fast), transform var(--fast);
    }
    .main-nav button:hover { background: rgba(255,255,255,.7); color: var(--ink); }
    .app-shell[data-screen="map"] .main-nav button:hover,
    .app-shell[data-screen="create"] .main-nav button:hover { background: rgba(255,255,255,.12); color: #fff; }
    .main-nav button[aria-current="page"] { background: #fff; color: var(--ink); box-shadow: 0 4px 12px rgba(16,26,54,.09); }
    .app-shell[data-screen="map"] .main-nav button[aria-current="page"],
    .app-shell[data-screen="create"] .main-nav button[aria-current="page"] { background: var(--signal); color: var(--ink); }
    .main-nav .icon { width: 20px; height: 20px; }
    .utility-bar { justify-self: end; display: flex; align-items: center; gap: 8px; }
    .icon-button {
      width: 44px; height: 44px; border: 1px solid rgba(23,35,61,.12); border-radius: 12px;
      display: grid; place-items: center; color: inherit; background: rgba(255,255,255,.66);
      transition: background var(--fast), color var(--fast), transform var(--fast);
    }
    .app-shell[data-screen="map"] .icon-button,
    .app-shell[data-screen="create"] .icon-button { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); }
    .icon-button:hover { transform: translateY(-1px); background: var(--surface); color: var(--ink); }
    .app-shell[data-screen="map"] .icon-button:hover,
    .app-shell[data-screen="create"] .icon-button:hover { background: rgba(255,255,255,.16); color: #fff; }
    .icon-button[aria-pressed="true"] { background: var(--signal); color: var(--ink); border-color: var(--signal); }
    .profile-chip {
      height: 48px; display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 5px;
      border: 1px solid rgba(23,35,61,.1); border-radius: 14px; background: rgba(255,255,255,.62); color: inherit;
    }
    .app-shell[data-screen="map"] .profile-chip,
    .app-shell[data-screen="create"] .profile-chip { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); }
    .avatar {
      width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px;
      color: var(--world); background: #dff4ef;
    }
    .profile-chip b { display: block; font-size: 13px; line-height: 1.2; }
    .profile-chip small { display: block; margin-top: 2px; font-size: 10px; color: inherit; opacity: .64; }

    .view { flex: 1; min-height: 0; display: none; overflow: hidden; }
    .view.active { display: flex; flex-direction: column; animation: viewIn var(--panel) ease-out both; }
    @keyframes viewIn { from { opacity: .4; transform: translateY(5px); } to { opacity: 1; transform: none; } }

    .eyebrow {
      display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 900;
      letter-spacing: .12em; text-transform: uppercase;
    }
    .eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
    .primary, .secondary, .quiet {
      min-height: 52px; border-radius: var(--radius-md); padding: 0 20px;
      display: inline-flex; align-items: center; justify-content: center; gap: 10px;
      font-weight: 900; font-size: 17px; border: 1px solid transparent;
      transition: transform var(--fast), box-shadow var(--fast), background var(--fast), color var(--fast);
    }
    .primary { color: var(--ink); background: var(--signal); border-color: #e9b62d; box-shadow: 0 8px 18px rgba(74, 55, 9, .16); }
    .primary:hover { transform: translateY(-2px); box-shadow: 0 12px 25px rgba(74, 55, 9, .2); }
    .primary.action { color: #fff; background: var(--action); border-color: var(--action); }
    .primary:disabled { transform: none; opacity: .42; box-shadow: none; }
    .secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
    .secondary:hover { border-color: #aeb5c5; transform: translateY(-1px); }
    .quiet { color: var(--ink-soft); background: transparent; border-color: transparent; }
    .quiet:hover { color: var(--ink); background: rgba(23,35,61,.06); }
    .primary .icon, .secondary .icon, .quiet .icon { width: 21px; height: 21px; }

    /* Exploration map */
    .view-map { background: var(--world); color: #fff; }
    .map-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0,1fr); }
    .map-brief {
      position: relative; z-index: 4; padding: clamp(22px, 3.4vw, 42px) 18px clamp(20px, 3vw, 34px) clamp(24px, 3.2vw, 42px);
      display: flex; flex-direction: column; gap: 22px; justify-content: center;
      background: linear-gradient(90deg, rgba(16,26,54,.98) 0%, rgba(16,26,54,.93) 72%, rgba(16,26,54,0) 100%);
    }
    .map-kicker { color: var(--signal); }
    .map-brief h1 { margin: 13px 0 10px; max-width: 8.5em; font-size: clamp(36px, 4.4vw, 58px); line-height: 1.08; letter-spacing: -.055em; }
    .map-brief h1 em { font-style: normal; color: var(--signal); }
    .map-lead { margin: 0; max-width: 28em; color: #c8d2e8; font-size: 17px; line-height: 1.75; }
    .chapter-progress { display: flex; align-items: center; gap: 12px; color: #dce5f6; font-size: 14px; font-weight: 750; }
    .chapter-progress .track { width: 118px; height: 8px; overflow: hidden; background: rgba(255,255,255,.13); border-radius: 99px; }
    .chapter-progress .track span { display: block; width: 20%; height: 100%; background: var(--signal); border-radius: inherit; }
    .mission-callout {
      width: min(100%, 330px); padding: 20px; color: var(--ink);
      background: var(--paper); border: 1px solid rgba(255,255,255,.54); border-radius: var(--radius-lg);
      box-shadow: 0 22px 54px rgba(0,0,0,.28); position: relative;
    }
    .mission-callout::before {
      content: ""; position: absolute; width: 7px; inset: 18px auto 18px 0;
      border-radius: 0 6px 6px 0; background: var(--signal);
    }
    .mission-callout .callout-top { display: flex; align-items: center; gap: 8px; color: var(--action); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
    .mission-callout h2 { margin: 9px 0 8px; font-size: 24px; line-height: 1.22; letter-spacing: -.03em; }
    .mission-callout p { margin: 0 0 16px; color: var(--ink-soft); font-size: 16px; line-height: 1.7; }
    .mission-callout .primary { width: 100%; }
    .map-safety { display: flex; align-items: center; gap: 8px; color: #aebbd3; font-size: 12px; }
    .map-safety .icon { width: 18px; height: 18px; color: #dce6fa; }
    .map-stage {
      position: relative; min-width: 0; min-height: 0; overflow: hidden;
      background:
        radial-gradient(circle at 69% 24%, rgba(70, 117, 186, .25), transparent 26%),
        radial-gradient(circle at 25% 47%, rgba(37,197,192,.12), transparent 32%),
        linear-gradient(145deg, #14244c 0%, #101b3b 55%, #091124 100%);
    }
    .map-stage::before {
      content: ""; position: absolute; inset: 0; pointer-events: none;
      background-image:
        radial-gradient(circle, rgba(255,255,255,.8) 0 1px, transparent 1.4px),
        radial-gradient(circle, rgba(255,255,255,.38) 0 1px, transparent 1.5px);
      background-size: 143px 131px, 217px 187px;
      background-position: 26px 19px, 79px 43px;
      opacity: .65;
    }
    .map-stage::after {
      content: ""; position: absolute; inset: auto 0 0; height: 41%;
      background:
        linear-gradient(170deg, transparent 0 30%, #1b2b54 31% 55%, #263c6c 56% 58%, #122143 59%);
      clip-path: polygon(0 24%, 9% 12%, 19% 26%, 31% 10%, 42% 26%, 55% 12%, 66% 24%, 78% 7%, 91% 22%, 100% 9%, 100% 100%, 0 100%);
      opacity: .92;
    }
    .map-svg { position: absolute; z-index: 1; inset: 5% 3% 5%; width: 94%; height: 90%; overflow: visible; }
    .map-path { fill: none; stroke: rgba(255,255,255,.37); stroke-width: 3; stroke-dasharray: 10 12; stroke-linecap: round; }
    .map-path-lit { fill: none; stroke: var(--signal); stroke-width: 4; stroke-linecap: round; opacity: .82; }
    .map-fog { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(ellipse at 77% 23%, transparent 0 17%, rgba(10,18,40,.42) 36%, transparent 56%); }
    .map-node {
      position: absolute; z-index: 5; width: 184px; min-height: 132px; padding: 0; border: 0;
      color: #fff; background: transparent; text-align: center;
      transform: translate(-50%, -50%);
    }
    .map-node .island {
      position: relative; width: 132px; height: 78px; margin: 0 auto 10px;
      display: grid; place-items: center; border-radius: 50%;
      border: 2px solid rgba(255,255,255,.3);
      box-shadow: 0 25px 28px rgba(2,8,23,.38);
    }
    .map-node .island::after {
      content: ""; position: absolute; inset: 15px 5px -13px; border-radius: 50%;
      background: rgba(3,8,24,.36); filter: blur(2px); z-index: -1;
    }
    .map-node.current .island { background: linear-gradient(145deg, #ffe27a, var(--signal) 58%, #ec9d37); border-color: #fff0ae; }
    .map-node.next .island { background: linear-gradient(145deg, #4be0cb, #1d9f9a); border-color: rgba(196,255,247,.62); }
    .map-node.far .island { filter: grayscale(.35); opacity: .56; background: linear-gradient(145deg, #737fa9, #46547f); }
    .map-node .node-title { display: block; font-size: 16px; font-weight: 900; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
    .map-node .node-meta { display: block; margin-top: 3px; color: #d3ddf1; font-size: 13px; text-shadow: 0 2px 8px rgba(0,0,0,.65); }
    .map-node.current .node-meta { color: #fff0ae; }
    .map-node:not(:disabled):hover .island { transform: translateY(-4px); box-shadow: 0 30px 34px rgba(2,8,23,.46); }
    .map-node .island, .map-node .node-title { transition: transform var(--panel), box-shadow var(--panel); }
    .node-energy { left: 20%; top: 68%; }
    .node-sense { left: 52%; top: 47%; }
    .node-core { left: 79%; top: 30%; }
    .tower-mini { width: 38px; height: 48px; position: relative; border-radius: 16px 16px 8px 8px; background: #fff8dd; border: 4px solid #d59725; }
    .tower-mini::before { content: ""; position: absolute; width: 3px; height: 19px; left: 15px; top: -19px; background: #3a2e1d; border-radius: 3px; }
    .tower-mini::after { content: ""; position: absolute; width: 11px; height: 11px; left: 9px; top: 14px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 12px 4px rgba(255,201,60,.42); }
    .forest-mini { width: 53px; height: 50px; position: relative; }
    .forest-mini i { position: absolute; bottom: 0; width: 28px; height: 43px; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: #0d5e58; }
    .forest-mini i:nth-child(1) { left: 0; height: 32px; background: #147d6f; }
    .forest-mini i:nth-child(2) { left: 20px; background: #0b655d; }
    .far-mini { width: 45px; height: 45px; display: grid; place-items: center; color: #eef4ff; }
    .far-mini .icon { width: 40px; height: 40px; }
    .current-pin {
      position: absolute; left: 50%; top: -42px; transform: translateX(-50%);
      padding: 8px 11px; border-radius: 10px; color: var(--ink); background: #fff; white-space: nowrap;
      font-size: 13px; font-weight: 900; box-shadow: 0 10px 20px rgba(0,0,0,.22);
    }
    .current-pin::after { content: ""; position: absolute; left: 50%; bottom: -6px; border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; transform: translateX(-50%); }
    .aibo-map {
      position: absolute; z-index: 6; left: 38%; top: 71%;
      display: flex; align-items: flex-end; gap: 10px;
    }
    .aibo-map .speech {
      max-width: 220px; padding: 10px 13px; color: var(--ink); background: #fff;
      border-radius: 13px 13px 13px 4px; box-shadow: 0 12px 28px rgba(0,0,0,.23);
      font-size: 14px; line-height: 1.55; font-weight: 700;
    }
    .map-zone-label {
      position: absolute; z-index: 4; right: 22px; bottom: 20px; color: #91a1c2;
      display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 750;
    }
    .map-zone-label::before { content: ""; width: 30px; height: 1px; background: currentColor; }

    /* Aibo */
    .aibo { position: relative; width: 58px; height: 64px; flex: 0 0 auto; filter: drop-shadow(0 8px 10px rgba(0,0,0,.16)); }
    .aibo .aibo-head {
      position: absolute; inset: 8px 3px 15px; border-radius: 18px 18px 14px 14px;
      background: #e9f7f2; border: 3px solid #0c8682;
    }
    .aibo .aibo-head::before {
      content: ""; position: absolute; width: 10px; height: 8px; border-radius: 50%;
      left: 13px; right: 13px; top: 19px; background: radial-gradient(circle at 2px 4px, var(--ink) 0 3px, transparent 3.5px), radial-gradient(circle at 18px 4px, var(--ink) 0 3px, transparent 3.5px);
    }
    .aibo .aibo-head::after {
      content: ""; position: absolute; width: 18px; height: 5px; left: 50%; bottom: 7px; transform: translateX(-50%);
      border-radius: 6px; background: var(--signal);
    }
    .aibo .antenna {
      position: absolute; width: 3px; height: 12px; top: 0; left: 50%; transform: translateX(-50%);
      background: #0c8682; border-radius: 3px;
    }
    .aibo .antenna::after { content: ""; position: absolute; left: -4px; top: -6px; width: 11px; height: 11px; border-radius: 50%; background: var(--signal); border: 2px solid #fff; }
    .aibo .body {
      position: absolute; width: 42px; height: 20px; left: 8px; bottom: 0; border-radius: 8px 8px 11px 11px;
      background: #0c8682; border: 3px solid #096d69;
    }
    .aibo .body::after { content: ""; position: absolute; left: 17px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
    .aibo.state-thinking .aibo-head::after { width: 8px; background: var(--physical); }
    .aibo.state-happy .aibo-head::before { background: linear-gradient(20deg, transparent 46%, var(--ink) 47% 53%, transparent 54%), linear-gradient(160deg, transparent 46%, var(--ink) 47% 53%, transparent 54%); background-size: 10px 9px; background-repeat: no-repeat; background-position: 3px 6px, 17px 6px; }

    /* Mission shell */
    .view-mission { background: var(--paper); }
    .mission-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--paper); }
    .mission-head {
      flex: 0 0 auto; min-height: 88px; display: grid; grid-template-columns: auto minmax(0,1fr) auto;
      align-items: center; gap: 18px; padding: 13px 22px;
      background: var(--paper); border-bottom: 1px solid var(--line);
    }
    .mission-title { min-width: 0; }
    .mission-title span { display: block; color: var(--ink-soft); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
    .mission-title h1 { margin: 2px 0 0; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.16; letter-spacing: -.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .mission-goal { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 13px; }
    .mission-goal strong { color: var(--ink); font-size: 14px; }
    .goal-badge { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: var(--action); background: #eef0ff; }
    .back-button {
      width: 48px; height: 48px; padding: 0; border: 1px solid var(--line); border-radius: 13px;
      display: grid; place-items: center; color: var(--ink); background: var(--surface);
    }
    .back-button .icon { width: 21px; height: 21px; }
    .mission-content { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
    .stage-panel { display: none; min-height: 100%; padding: clamp(16px, 2.4vw, 28px) clamp(20px, 3vw, 38px) 22px; }
    .stage-panel.active { display: block; animation: stageIn var(--panel) ease-out both; }
    @keyframes stageIn { from { opacity: .3; transform: translateX(7px); } to { opacity: 1; transform: none; } }
    .stage-rail {
      flex: 0 0 auto; min-height: 72px; display: grid; grid-template-columns: repeat(6, minmax(0,1fr));
      gap: 4px; padding: 8px 18px; background: rgba(247,243,232,.98); border-top: 1px solid var(--line);
    }
    .stage-tab {
      min-width: 0; min-height: 52px; border: 0; border-radius: 12px; padding: 6px 8px;
      display: flex; align-items: center; justify-content: center; gap: 8px;
      color: #788398; background: transparent; font-size: 12px; font-weight: 800;
      transition: background var(--fast), color var(--fast);
    }
    .stage-tab i {
      width: 29px; height: 29px; flex: 0 0 29px; display: grid; place-items: center;
      border-radius: 9px; background: rgba(23,35,61,.06); color: inherit; font-size: 11px; font-style: normal; font-weight: 900;
    }
    .stage-tab:hover { background: rgba(23,35,61,.05); color: var(--ink); }
    .stage-tab.active { color: var(--action); background: #eef0ff; }
    .stage-tab.active i { background: var(--action); color: #fff; }
    .stage-tab.done { color: var(--success); }
    .stage-tab.done i { color: #fff; background: var(--success); }
    .stage-tab.locked { opacity: .48; }

    /* Story */
    .story-grid { min-height: 100%; display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.55fr); gap: 20px; align-items: stretch; }
    .story-panel { min-height: 470px; padding: clamp(22px,3vw,38px); position: relative; overflow: hidden; border-radius: var(--radius-xl); background: linear-gradient(145deg, #18264c, #1e3565 62%, #147b85); color: #fff; }
    .story-panel::before { content: ""; position: absolute; width: 320px; height: 320px; border: 62px solid rgba(255,255,255,.055); border-radius: 50%; right: -110px; top: -125px; }
    .story-panel::after { content: ""; position: absolute; inset: auto 0 0; height: 34%; background: linear-gradient(170deg, transparent 0 42%, rgba(7,17,41,.46) 43%); clip-path: polygon(0 44%, 20% 24%, 42% 42%, 61% 13%, 79% 34%, 100% 17%, 100% 100%, 0 100%); }
    .chapter-tag { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 9px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.13); font-size: 12px; font-weight: 850; }
    .chapter-tag .icon { width: 17px; height: 17px; color: var(--signal); }
    .story-panel h2 { position: relative; z-index: 2; max-width: 10em; margin: 26px 0 12px; font-size: clamp(34px, 4vw, 52px); line-height: 1.08; letter-spacing: -.05em; }
    .story-panel p { position: relative; z-index: 2; max-width: 32em; margin: 0; color: #dbe5f4; font-size: 17px; line-height: 1.8; }
    .story-cta { position: relative; z-index: 3; margin-top: 28px; }
    .story-scene { position: absolute; z-index: 2; right: 9%; bottom: 8%; width: 300px; height: 250px; }
    .big-tower { position: absolute; width: 100px; height: 145px; right: 56px; bottom: 35px; border-radius: 47px 47px 17px 17px; background: #f1eee3; border: 9px solid #c1cbdf; box-shadow: 0 28px 38px rgba(1,9,28,.32); }
    .big-tower::before { content: ""; position: absolute; width: 5px; height: 65px; left: 39px; top: -67px; background: #c1cbdf; border-radius: 4px; }
    .big-tower::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; left: 30px; top: 35px; background: #4a5777; }
    .story-scene .aibo { position: absolute; left: 20px; bottom: 35px; transform: scale(1.45); transform-origin: left bottom; }
    .story-ground { position: absolute; left: 0; right: 0; bottom: 20px; height: 75px; border-radius: 50%; background: rgba(3,15,37,.34); filter: blur(2px); }
    .objective-panel { padding: 22px; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; }
    .objective-panel h3 { margin: 8px 0 15px; font-size: 24px; line-height: 1.2; letter-spacing: -.03em; }
    .objective-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
    .objective-list li { display: grid; grid-template-columns: 34px 1fr; gap: 11px; align-items: start; padding: 11px; border-radius: 13px; background: #f7f6f2; }
    .objective-list i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--action); background: #e8ebff; font-style: normal; font-weight: 900; }
    .objective-list b { display: block; font-size: 16px; }
    .objective-list small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
    .parts-block { margin-top: auto; padding-top: 18px; }
    .parts-block > b { display: block; margin-bottom: 10px; font-size: 14px; }
    .parts-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; }
    .part-chip { min-width: 0; padding: 9px 5px 7px; text-align: center; border-radius: 11px; border: 1px solid var(--line); background: #fff; }
    .part-chip .icon { width: 25px; height: 25px; margin: 0 auto 4px; color: var(--ink); }
    .part-chip span { display: block; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
    .story-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: #fff6da; border: 1px solid #f1d889; color: #765a16; font-size: 14px; line-height: 1.55; }
    .story-note .icon { width: 20px; height: 20px; flex: none; }
    .clear-button { min-height: 44px; padding: 0 12px; border: 0; border-radius: 9px; color: var(--action); background: transparent; font-weight: 850; }

    /* Concept */
    .concept-grid { min-height: 100%; display: grid; grid-template-columns: minmax(0,1.45fr) minmax(290px,.55fr); gap: 20px; }
    .concept-board { border-radius: var(--radius-xl); border: 1px solid var(--line); background: var(--surface); padding: clamp(20px,2.6vw,32px); box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; }
    .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
    .section-heading h2 { margin: 6px 0 0; font-size: clamp(28px,3vw,38px); line-height: 1.18; letter-spacing: -.04em; }
    .section-heading p { margin: 7px 0 0; color: var(--ink-soft); font-size: 16px; }
    .circuit-story {
      position: relative; min-height: 335px; margin-top: 22px; padding: 18px;
      border-radius: var(--radius-lg); border: 1px solid #dfdccf; background: #fbfaf6;
      overflow: hidden;
    }
    .circuit-grid { position: absolute; inset: 0; opacity: .6; background-image: radial-gradient(#b7b7aa 1.2px, transparent 1.3px); background-size: 22px 22px; }
    .circuit-route { position: absolute; inset: 36px 26px 24px; width: calc(100% - 52px); height: calc(100% - 60px); }
    .wire-base { fill: none; stroke: #c1c2bd; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
    .wire-live { fill: none; stroke: var(--circuit); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 10 10; opacity: 0; transition: opacity var(--fast); }
    .concept-board.live .wire-live { opacity: 1; animation: currentFlow 1.7s linear infinite; }
    @keyframes currentFlow { to { stroke-dashoffset: -40; } }
    .circuit-comp {
      position: absolute; z-index: 2; width: 108px; min-height: 82px; padding: 10px;
      border-radius: 16px; border: 1px solid #cfcfc4; background: #fff;
      box-shadow: 0 12px 22px rgba(23,35,61,.09); text-align: center;
    }
    .circuit-comp b { display: block; margin-top: 4px; font-size: 13px; }
    .circuit-comp small { display: block; color: var(--ink-soft); font-size: 12px; }
    .comp-battery { left: 7%; top: 42%; }
    .comp-lamp { right: 7%; top: 38%; }
    .comp-switch { left: 50%; bottom: 7%; transform: translateX(-50%); width: 118px; }
    .battery-drawing { width: 35px; height: 42px; margin: auto; border-radius: 7px; background: var(--ink); position: relative; }
    .battery-drawing::before { content: "+"; color: #fff; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 18px; }
    .lamp-drawing { width: 46px; height: 46px; margin: auto; border-radius: 50% 50% 42% 42%; display: grid; place-items: center; color: #4f596c; background: #d9d8d1; border: 4px solid #e8e4d7; transition: background var(--fast), box-shadow var(--fast), color var(--fast); }
    .lamp-drawing .icon { width: 23px; height: 23px; }
    .concept-board.live .lamp-drawing { color: #7d5c00; background: #ffe17a; box-shadow: 0 0 0 8px rgba(255,201,60,.17), 0 0 32px rgba(255,201,60,.6); }
    .toggle-control { width: 68px; height: 44px; margin: auto; padding: 0; border-radius: 99px; border: 0; background: transparent; position: relative; }
    .toggle-control::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 32px; border-radius: 99px; background: #c8ccd4; transition: background var(--fast); }
    .toggle-control span { position: absolute; left: 3px; top: 9px; display: block; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: transform var(--fast), background var(--fast); z-index: 1; }
    .toggle-control[aria-pressed="true"]::before { background: var(--success); }
    .toggle-control[aria-pressed="true"] span { transform: translateX(36px); }
    .circuit-caption {
      position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
      padding: 7px 11px; border-radius: 9px; background: #fff; border: 1px solid #ddd9ce;
      color: var(--ink-soft); font-size: 13px; font-weight: 800; white-space: nowrap;
    }
    .concept-board.live .circuit-caption { color: var(--success); border-color: #b9decf; background: #effbf6; }
    .field-note { background: #fff8e6; border: 1px solid #eedc9f; border-radius: var(--radius-xl); padding: 22px; align-self: start; position: relative; }
    .field-note::before {
      content: ""; position: absolute; left: 50%; top: -10px; width: 78px; height: 20px;
      transform: translateX(-50%) rotate(-2deg); background: rgba(255,201,60,.6); border: 1px solid rgba(170,127,18,.16);
    }
    .field-note .eyebrow { color: #8c6814; }
    .field-note h3 { margin: 15px 0 10px; font-family: "LXGW WenKai", "Kaiti SC", serif; font-size: 27px; line-height: 1.35; }
    .field-note p { margin: 0; color: #5f563f; font-size: 16px; line-height: 1.8; }
    .concept-points { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
    .concept-points li { display: flex; gap: 9px; align-items: flex-start; padding: 10px 0; border-top: 1px solid rgba(143,111,30,.16); font-size: 14px; font-weight: 700; }
    .concept-points .icon { width: 18px; height: 18px; flex: none; color: #96701a; }

    /* Shared progress/buttons for concept and later stages */
    .stage-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
    .stage-actions .hint { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 14px; }
    .stage-actions .hint .icon { width: 18px; height: 18px; }
    .lab-guidance { margin: 12px 0 0; color: #c3cde0; font-size: 13px; }
    .voice-hint, .engineering-data { display: none; }
    body[data-age-mode="support"] .voice-hint { display: flex; }
    body[data-age-mode="engineering"] .engineering-data { display: block; }
    body[data-age-mode="support"] .primary,
    body[data-age-mode="support"] .secondary { min-height: 58px; font-size: 18px; }
    body[data-age-mode="support"] .quick-answer,
    body[data-age-mode="support"] .challenge-option { min-height: 50px; font-size: 16px; }
    body[data-age-mode="support"] .concept-points li,
    body[data-age-mode="support"] .story-note { font-size: 16px; }
    .voice-hint { align-items: center; gap: 9px; padding: 9px 11px; border-radius: 10px; background: #edf3ff; color: #395176; font-size: 12px; font-weight: 750; }
    .voice-hint .icon { width: 18px; height: 18px; flex: none; color: var(--action); }
    .engineering-data { padding: 12px; border: 1px solid #d7dce8; border-radius: 10px; background: #f5f7fb; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.7; color: #33415b; }

    /* Lab */
    .mission-shell[data-stage="simulation"] .mission-head { background: var(--lab); color: var(--lab-text); border-color: var(--lab-line); }
    .mission-shell[data-stage="simulation"] .mission-title span,
    .mission-shell[data-stage="simulation"] .mission-goal { color: var(--lab-soft); }
    .mission-shell[data-stage="simulation"] .mission-goal strong { color: var(--lab-text); }
    .mission-shell[data-stage="simulation"] .goal-badge { color: var(--circuit); background: rgba(37,197,192,.12); }
    .mission-shell[data-stage="simulation"] .back-button { color: var(--lab-text); background: var(--lab-raised); border-color: var(--lab-line); }
    .mission-shell[data-stage="simulation"] .mission-content { background: var(--lab); color: var(--lab-text); }
    .mission-shell[data-stage="simulation"] .stage-rail { color: var(--lab-text); background: #0c1320; border-color: var(--lab-line); }
    .mission-shell[data-stage="simulation"] .stage-tab { color: #8594ad; }
    .mission-shell[data-stage="simulation"] .stage-tab i { background: rgba(255,255,255,.05); }
    .mission-shell[data-stage="simulation"] .stage-tab.active { color: var(--circuit); background: rgba(37,197,192,.1); }
    .mission-shell[data-stage="simulation"] .stage-tab.active i { color: var(--ink); background: var(--circuit); }
    .mission-shell[data-stage="simulation"] .stage-tab.done { color: #62ddb6; }
    .mission-shell[data-stage="simulation"] .stage-tab.done i { color: #fff; background: var(--success); }
    .lab-titlebar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
    .lab-titlebar h2 { margin: 4px 0 0; font-size: clamp(28px,3vw,38px); line-height: 1.2; letter-spacing: -.04em; }
    .lab-titlebar p { margin: 6px 0 0; color: var(--lab-soft); font-size: 14px; }
    .lab-titlebar .eyebrow { color: var(--circuit); }
    .lab-status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--lab-line); color: var(--lab-soft); background: var(--lab-raised); font-size: 13px; font-weight: 850; }
    .lab-status-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
    .lab-layout { display: grid; grid-template-columns: minmax(0,1fr) 292px; gap: 16px; min-height: 0; }
    .lab-workbench { min-width: 0; display: flex; flex-direction: column; border-radius: var(--radius-xl); border: 1px solid var(--lab-line); background: var(--lab-raised); overflow: hidden; }
    .lab-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 15px; border-bottom: 1px solid var(--lab-line); }
    .lab-toolbar strong { font-size: 14px; }
    .lab-toolbar small { color: var(--lab-soft); font-size: 12px; }
    .lab-canvas {
      flex: 1; min-height: 390px; position: relative; overflow: hidden;
      background-color: #111b2c;
      background-image: radial-gradient(#41506b 1.15px, transparent 1.2px);
      background-size: 24px 24px;
    }
    .lab-canvas::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 70% 38%, rgba(255,201,60,.09), transparent 26%); pointer-events: none; }
    .lab-wires { position: absolute; inset: 0; width: 100%; height: 100%; }
    .lab-wire { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 5; }
    .lab-wire.red { stroke: var(--physical); }
    .lab-wire.blue { stroke: #6076ff; }
    .lab-wire.gap { stroke: #ff8b75; stroke-dasharray: 10 13; opacity: .42; }
    .lab-wire.closed { opacity: 1; }
    #electronRoute { fill: none; stroke: none; pointer-events: none; }
    .lab-electron { fill: var(--signal); opacity: 0; filter: drop-shadow(0 0 5px #ffdb73); }
    .lab-canvas.running .lab-electron { opacity: 1; animation: electronPath 1.9s linear infinite; }
    @keyframes electronPath {
      0% { offset-distance: 0%; }
      100% { offset-distance: 100%; }
    }
    .lab-component {
      position: absolute; z-index: 3; min-width: 122px; padding: 12px;
      border-radius: 16px; border: 1px solid #35445e; background: #1a263a;
      box-shadow: 0 16px 30px rgba(0,0,0,.28); color: var(--lab-text); text-align: center;
    }
    .lab-component b { display: block; font-size: 13px; }
    .lab-component small { display: block; margin-top: 2px; color: var(--lab-soft); font-size: 12px; }
    .lab-battery { left: 7%; top: 32%; }
    .lab-led { right: 7%; top: 30%; }
    .lab-switch { left: 50%; bottom: 10%; transform: translateX(-50%); }
    .lab-battery .battery-drawing { width: 52px; height: 73px; }
    .lab-battery .battery-drawing::after { content: "3V"; position: absolute; bottom: 5px; left: 7px; color: var(--signal); font-size: 10px; }
    .lab-led .bulb-graphic { width: 58px; height: 58px; margin: auto; border-radius: 50%; background: #3f4859; border: 4px solid #677184; transition: background var(--fast), box-shadow var(--fast); }
    .lab-led.glowing .bulb-graphic { background: #ffe377; border-color: #fff1b5; box-shadow: 0 0 35px 12px rgba(255,201,60,.6); }
    .endpoint {
      position: absolute; z-index: 5; width: 44px; height: 44px; border-radius: 50%;
      color: var(--lab-text); background: #233149; border: 2px solid #6f7e96;
      display: grid; place-items: center; font-size: 10px; font-weight: 900; transition: transform var(--fast), background var(--fast), border-color var(--fast);
    }
    .endpoint:hover { transform: scale(1.06); border-color: var(--signal); }
    .endpoint.selected { color: var(--ink); background: var(--signal); border-color: #fff0ab; }
    .endpoint[data-end="battery-positive"] { left: 27%; top: 35%; }
    .endpoint[data-end="led-positive"] { left: 66%; top: 35%; }
    .endpoint[data-end="battery-negative"] { left: 27%; top: 63%; }
    .endpoint[data-end="led-negative"] { left: 66%; top: 63%; }
    .switch-button { width: 82px; height: 44px; margin: 5px auto 0; padding: 4px; border: 0; border-radius: 99px; background: #4a5569; }
    .switch-button span { display: block; width: 35px; height: 35px; border-radius: 50%; background: #fff; transition: transform var(--fast); }
    .switch-button[aria-pressed="true"] { background: var(--success); }
    .switch-button[aria-pressed="true"] span { transform: translateX(39px); }
    .lab-hint-label { position: absolute; z-index: 3; left: 50%; top: 13%; transform: translateX(-50%); color: #e4ecfa; background: rgba(10,17,30,.84); border: 1px solid var(--lab-line); border-radius: 9px; padding: 7px 11px; font-size: 13px; font-weight: 750; white-space: nowrap; }
    .parts-tray { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--lab-line); overflow-x: auto; }
    .parts-tray > span { flex: none; color: #8796ae; font-size: 12px; font-weight: 800; margin-right: 4px; }
    .tray-part { flex: none; min-height: 48px; display: flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid var(--lab-line); border-radius: 10px; color: #bec9db; background: #111b2c; font-size: 12px; }
    .tray-part .icon { width: 19px; height: 19px; color: var(--circuit); }
    .lab-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
    .prediction-card, .coach-card { border: 1px solid var(--lab-line); border-radius: var(--radius-lg); background: var(--lab-raised); padding: 15px; }
    .prediction-card h3, .coach-card h3 { margin: 0 0 5px; font-size: 16px; }
    .prediction-card > p, .coach-card > p { margin: 0 0 12px; color: var(--lab-soft); font-size: 14px; line-height: 1.6; }
    .prediction-choices { display: grid; gap: 8px; }
    .prediction-choice {
      min-height: 46px; padding: 9px 11px; text-align: left; border-radius: 10px; border: 1px solid var(--lab-line);
      color: #cbd5e6; background: #111a2a; font-size: 14px;
    }
    .prediction-choice:hover { border-color: #60718e; }
    .prediction-choice[aria-pressed="true"] { color: var(--ink); background: var(--signal); border-color: var(--signal); font-weight: 850; }
    .lab-actions { display: flex; gap: 8px; margin-top: 12px; }
    .lab-actions .primary, .lab-actions .secondary { min-height: 46px; padding: 0 13px; font-size: 14px; flex: 1; }
    .lab-actions .secondary { color: var(--lab-text); background: #111a2a; border-color: var(--lab-line); }
    .lab-result { margin-top: 12px; min-height: 64px; padding: 11px; border-radius: 10px; border: 1px solid var(--lab-line); background: #111a2a; color: var(--lab-soft); font-size: 14px; line-height: 1.55; }
    .lab-result strong { display: block; margin-bottom: 3px; color: var(--lab-text); font-size: 15px; }
    .lab-result.success { border-color: rgba(72,208,164,.38); background: rgba(19,122,84,.16); color: #bdebd9; }
    .lab-result.success strong { color: #71e0bb; }
    .lab-result.error { border-color: rgba(242,106,79,.38); background: rgba(184,61,69,.12); color: #ffd4cd; }
    .lab-result.error strong { color: #ff9382; }
    .coach-card { margin-top: auto; }
    .coach-person { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
    .coach-person .aibo { width: 42px; height: 47px; }
    .coach-person b { font-size: 14px; }
    .coach-person small { display: block; color: var(--circuit); font-size: 12px; }
    .coach-card p { margin-bottom: 9px; color: #c6d0e1; }
    .lab-next { width: 100%; min-height: 47px; margin-top: 7px; font-size: 14px; display: none; }
    .lab-next.visible { display: inline-flex; }

    /* Build */
    .build-layout { min-height: 100%; display: grid; grid-template-columns: minmax(0,1.25fr) minmax(330px,.75fr); gap: 20px; }
    .build-visual-card { min-height: 500px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: #e8e2d5; overflow: hidden; box-shadow: var(--shadow); position: relative; }
    .build-photo {
      position: absolute; inset: 22px 22px 92px; overflow: hidden; border-radius: 18px;
      background: linear-gradient(150deg, #cbd2d7 0%, #e7e6df 62%, #d5c4ad 100%);
      border: 1px solid #b9c0c6;
    }
    .build-photo::before { content: ""; position: absolute; left: 8%; right: 8%; bottom: 11%; height: 47%; border-radius: 18px; background: #b18459; box-shadow: inset 0 -13px 0 #9d7048; }
    .breadboard { position: absolute; width: 68%; height: 52%; left: 16%; top: 23%; border-radius: 16px; background: #eeeadd; border: 9px solid #607166; box-shadow: 0 24px 34px rgba(56,48,36,.25); }
    .breadboard::after { content: ""; position: absolute; inset: 17px; opacity: .6; background-image: radial-gradient(#76827a 1.2px, transparent 1.4px); background-size: 17px 17px; }
    .build-wire { position: absolute; z-index: 2; height: 6px; border-radius: 7px; transform-origin: left center; }
    .build-wire.w1 { left: 27%; top: 37%; width: 28%; transform: rotate(-7deg); background: var(--physical); }
    .build-wire.w2 { left: 53%; top: 39%; width: 15%; transform: rotate(74deg); background: #526bda; }
    .build-wire.w3 { left: 53%; top: 53%; width: 26%; transform: rotate(103deg); background: #526bda; }
    .build-battery { position: absolute; z-index: 3; left: 24%; top: 32%; width: 74px; height: 102px; border-radius: 13px; background: var(--ink); border: 6px solid #fff; box-shadow: 0 12px 20px rgba(0,0,0,.2); color: #fff; display: grid; place-items: center; font-size: 23px; }
    .build-led { position: absolute; z-index: 3; right: 22%; top: 33%; width: 63px; height: 63px; display: grid; place-items: center; border-radius: 50% 50% 43% 43%; background: #ffe17a; border: 8px solid #fff0ae; box-shadow: 0 0 28px rgba(255,201,60,.64); }
    .build-switch { position: absolute; z-index: 3; left: 46%; bottom: 20%; width: 104px; height: 54px; border: 5px solid #cbd5cc; border-radius: 13px; background: #fff; display: grid; place-items: center; }
    .build-switch::after { content: ""; width: 61px; height: 18px; border-radius: 99px; background: var(--success); }
    .photo-label { position: absolute; z-index: 4; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 7px 10px; border-radius: 8px; color: var(--ink); background: rgba(255,255,255,.9); font-size: 10px; font-weight: 800; white-space: nowrap; }
    .build-legend { position: absolute; left: 20px; right: 20px; bottom: 18px; padding: 14px 16px; border-radius: 15px; background: #fff; border: 1px solid rgba(23,35,61,.12); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
    .build-legend .legend-copy b { display: block; font-size: 15px; }
    .build-legend .legend-copy small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 11px; }
    .build-steps { display: flex; align-items: center; gap: 6px; }
    .build-steps i { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--ink-soft); background: #f1ede3; font-style: normal; font-size: 10px; font-weight: 900; }
    .build-steps i.done { color: #fff; background: var(--success); }
    .build-steps i.active { color: #fff; background: var(--action); }
    .build-instructions { padding: 21px; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; }
    .build-instructions h2 { margin: 6px 0 7px; font-size: 27px; line-height: 1.2; letter-spacing: -.04em; }
    .build-instructions > p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.65; }
    .safety-card { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; padding: 12px; border-radius: 12px; border: 1px solid #f1d284; background: #fff8df; color: #705313; font-size: 14px; line-height: 1.55; }
    .safety-card .icon { flex: none; width: 19px; height: 19px; }
    .step-checklist { display: grid; gap: 8px; }
    .check-row { min-height: 54px; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fbfaf6; color: var(--ink); text-align: left; }
    .check-row .number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: #e8ebff; color: var(--action); font-size: 11px; font-weight: 900; }
    .check-row strong { display: block; font-size: 15px; line-height: 1.35; }
    .check-row small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 12px; }
    .check-row .check-state { width: 26px; height: 26px; border-radius: 8px; border: 1px solid #cbd0dc; display: grid; place-items: center; color: transparent; background: #fff; }
    .check-row[aria-checked="true"] { border-color: #aadaca; background: #effaf5; }
    .check-row[aria-checked="true"] .check-state { color: #fff; background: var(--success); border-color: var(--success); }
    .check-row .check-state .icon { width: 16px; height: 16px; }
    .evidence-row { margin-top: 14px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
    .evidence-button { min-height: 49px; border: 1px dashed #acb8c9; border-radius: 12px; background: #fbfaf7; color: var(--ink); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 850; }
    .evidence-button .icon { width: 19px; height: 19px; color: var(--action); }
    .evidence-button.saved { color: var(--success); background: #effaf5; border-color: #98d2be; }
    .evidence-sample { min-height: 49px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 800; padding: 0 11px; }
    .evidence-preview { display: none; margin-top: 8px; padding: 9px; align-items: center; gap: 9px; border-radius: 10px; background: #effaf5; color: #24664f; font-size: 13px; }
    .evidence-preview.visible { display: flex; }
    .evidence-preview .mini-board { width: 48px; height: 34px; border-radius: 7px; background: #e8e6de; border: 3px solid #778277; position: relative; }
    .evidence-preview .mini-board::after { content: ""; position: absolute; width: 13px; height: 20px; left: 8px; top: 3px; background: var(--ink); border-radius: 3px; }
    .build-submit {
      width: 100%; margin-top: 8px; position: sticky; bottom: 0;
      box-shadow: 0 -8px 16px rgba(255,255,255,.9), 0 8px 18px rgba(20,32,67,.16);
    }
    .form-error { min-height: 18px; margin: 8px 0 0; color: var(--error); font-size: 13px; font-weight: 700; }

    /* Reflection */
    .reflect-layout { min-height: 100%; display: grid; grid-template-columns: minmax(0,.9fr) minmax(390px,1.1fr); gap: 20px; }
    .stage-panel[data-stage-panel="reflect"] { height: 100%; }
    .reflect-layout { height: 100%; min-height: 0; }
    .evidence-board { padding: 22px; border-radius: var(--radius-xl); background: #e8e1d3; border: 1px solid #d7cdbb; min-width: 0; }
    .stage-panel[data-stage-panel="reflect"] .evidence-board { height: 100%; overflow: auto; }
    .evidence-board-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
    .evidence-board h2 { margin: 5px 0 0; font-size: 28px; letter-spacing: -.03em; }
    .evidence-board p { margin: 3px 0 0; color: #6a6358; font-size: 14px; }
    .evidence-stack { display: grid; gap: 10px; }
    .evidence-card { background: #fffdf7; border: 1px solid #d9d0be; border-radius: 14px; padding: 13px; display: grid; grid-template-columns: 75px 1fr; gap: 12px; align-items: center; }
    .evidence-thumb { width: 75px; height: 62px; border-radius: 10px; display: grid; place-items: center; background: #f4efe2; border: 1px solid #ded5c5; overflow: hidden; }
    .evidence-thumb.circuit-thumb { background: #1a273b; }
    .thumb-circuit { width: 48px; height: 36px; position: relative; border: 1px dashed; border-radius: 6px; }
    .evidence-card b { display: block; font-size: 15px; }
    .evidence-card small { display: block; color: #726c60; font-size: 13px; line-height: 1.5; margin-top: 3px; }
    .evidence-tag { display: inline-block; margin-top: 5px; padding: 3px 6px; border-radius: 6px; color: #5d5546; background: #f1eadb; font-size: 11px; font-weight: 850; }
    .challenge-card { margin-top: 12px; padding: 14px; border-radius: 14px; background: #16254b; color: #fff; }
    .challenge-card h3 { margin: 0 0 5px; font-size: 15px; }
    .challenge-card p { color: #c8d3e8; }
    .challenge-options { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
    .challenge-option { min-height: 44px; border-radius: 9px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; padding: 0 12px; font-size: 14px; }
    .challenge-option[data-result="correct"] { border-color: #70dcb7; color: #a7f1d7; }
    .mentor-card { min-width: 0; height: 100%; border-radius: var(--radius-xl); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
    .mentor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #f7f9ff; }
    .mentor-identity { display: flex; align-items: center; gap: 10px; }
    .mentor-identity .aibo { width: 47px; height: 52px; }
    .mentor-identity b { display: block; font-size: 15px; }
    .mentor-identity small { display: block; color: var(--success); font-size: 10px; font-weight: 800; }
    .mentor-kicker { color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
    .mentor-body { flex: 1; min-height: 0; padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow: auto; }
    .mentor-question { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: start; }
    .mentor-question .aibo { width: 37px; height: 42px; }
    .mentor-bubble { padding: 12px 13px; border: 1px solid #dfe3eb; border-radius: 4px 14px 14px 14px; background: #f5f7fb; font-size: 16px; line-height: 1.65; }
    .quick-answers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
    .quick-answer { min-height: 44px; border-radius: 10px; border: 1px solid #d9dee8; background: #fff; color: var(--ink); padding: 0 12px; font-size: 14px; font-weight: 750; }
    .quick-answer:hover { border-color: #aab7cb; }
    .quick-answer[aria-pressed="true"] { color: #fff; background: var(--action); border-color: var(--action); }
    .reflection-field label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 850; }
    textarea {
      width: 100%; min-height: 94px; resize: vertical; padding: 12px 13px; border-radius: 11px;
      border: 1px solid #cfd5e0; background: #fbfcff; color: var(--ink); font-size: 16px; line-height: 1.6;
    }
    textarea::placeholder { color: #929eb0; }
    .reflection-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
    .reflection-actions .quiet { min-height: 44px; padding: 0 10px; font-size: 12px; }
    .reflection-actions .primary { min-height: 46px; padding: 0 16px; font-size: 13px; }
    .mentor-response { display: none; padding: 12px 13px; border-radius: 11px; border: 1px solid #b9decf; background: #effbf6; color: #255f4c; font-size: 15px; line-height: 1.6; }
    .mentor-response.visible { display: block; }
    .ability-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: auto; padding: 12px 18px 15px; border-top: 1px solid var(--line); background: #fbfaf6; }
    .ability-state { padding: 9px 7px; text-align: center; border-radius: 10px; background: #f0ede5; color: #8d8b83; font-size: 12px; font-weight: 850; }
    .ability-state i { width: 16px; height: 16px; margin: 0 auto 5px; border-radius: 50%; display: block; border: 2px solid currentColor; }
    .ability-state.active { color: var(--success); background: #e8f8f1; }
    .ability-state.active i { border-color: var(--success); background: radial-gradient(circle, var(--success) 0 4px, transparent 5px); }
    .mentor-footer { padding: 0 18px 15px; background: #fbfaf6; }
    .mentor-footer .primary { width: 100%; }

    /* Portfolio */
    .view-portfolio { background: var(--paper); overflow: auto; }
    .portfolio-page { min-height: 100%; padding: clamp(22px,3vw,36px); }
    .portfolio-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
    .portfolio-head h1 { margin: 7px 0 0; font-size: clamp(34px,4.2vw,48px); line-height: 1.1; letter-spacing: -.05em; }
    .portfolio-head p { margin: 8px 0 0; color: var(--ink-soft); font-size: 15px; }
    .portfolio-layout { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 20px; align-items: start; }
    .project-card { border-radius: var(--radius-xl); border: 1px solid var(--line); background: #fff; overflow: hidden; box-shadow: var(--shadow); }
    .project-cover { min-height: 215px; position: relative; overflow: hidden; background: linear-gradient(140deg, #d9e4ee, #edf1e7 55%, #d6d0c2); }
    .project-cover::before { content: ""; position: absolute; left: 8%; right: 8%; bottom: 12%; height: 55%; border-radius: 17px; background: #b9885d; box-shadow: inset 0 -13px 0 #a0724b; }
    .cover-board { position: absolute; width: 53%; height: 54%; left: 23%; top: 20%; border-radius: 15px; background: #e7e6dd; border: 8px solid #647469; box-shadow: 0 18px 26px rgba(45,55,49,.22); }
    .cover-board::after { content: ""; position: absolute; inset: 15px; opacity: .58; background-image: radial-gradient(#7c877d 1.2px, transparent 1.4px); background-size: 17px 17px; }
    .cover-battery { position: absolute; z-index: 2; left: 32%; top: 34%; width: 52px; height: 75px; border-radius: 10px; background: var(--ink); border: 5px solid #fff; color: #fff; display: grid; place-items: center; font-size: 18px; }
    .cover-led { position: absolute; z-index: 2; right: 31%; top: 35%; width: 46px; height: 46px; border-radius: 50% 50% 42% 42%; background: #ffe17a; border: 6px solid #fff0ae; box-shadow: 0 0 25px rgba(255,201,60,.65); }
    .cover-wire { position: absolute; z-index: 2; height: 5px; background: var(--physical); border-radius: 5px; transform-origin: left; }
    .cover-wire.c1 { left: 38%; top: 39%; width: 23%; }
    .cover-wire.c2 { left: 38%; top: 55%; width: 27%; transform: rotate(22deg); background: #546bdc; }
    .project-body { padding: 20px; }
    .project-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .project-meta .eyebrow { color: var(--action); }
    .private-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; background: #f2f4f8; color: #69768a; font-size: 10px; font-weight: 800; }
    .private-tag .icon { width: 14px; height: 14px; }
    .project-body h2 { margin: 10px 0 5px; font-size: 26px; letter-spacing: -.03em; }
    .project-body > p { margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.7; }
    .evidence-line { display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; margin-top: 18px; }
    .evidence-point { min-width: 0; position: relative; padding: 12px 8px 10px; border-radius: 11px; background: #f7f6f1; text-align: center; }
    .evidence-point::after { content: ""; position: absolute; height: 1px; left: 50%; top: 25px; width: 100%; background: #d9d8cc; z-index: 0; }
    .evidence-point:last-child::after { display: none; }
    .evidence-point i { position: relative; z-index: 1; width: 27px; height: 27px; margin: 0 auto 7px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--success); }
    .evidence-point i .icon { width: 15px; height: 15px; }
    .evidence-point b { display: block; font-size: 12px; }
    .evidence-point small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 11px; }
    .project-actions { display: flex; gap: 8px; margin-top: 17px; flex-wrap: wrap; }
    .project-actions .secondary, .project-actions .primary { min-height: 46px; font-size: 13px; }
    .growth-panel { border-radius: var(--radius-xl); border: 1px solid var(--line); background: var(--surface); padding: 20px; box-shadow: var(--shadow); }
    .growth-panel h2 { margin: 6px 0 4px; font-size: 24px; letter-spacing: -.03em; }
    .growth-panel > p { margin: 0 0 18px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
    .ability-list { display: grid; gap: 9px; }
    .ability-row { padding: 12px; border-radius: 12px; border: 1px solid #dedfda; background: #fbfaf6; }
    .ability-row.current { border-color: #b9dccd; background: #f1fbf6; }
    .ability-row .ability-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .ability-row b { font-size: 15px; }
    .ability-row span { font-size: 12px; color: var(--ink-soft); font-weight: 800; }
    .ability-row.current span { color: var(--success); }
    .ability-row p { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
    .growth-next { margin-top: 18px; padding: 14px; border-radius: 13px; background: var(--world); color: #fff; }
    .growth-next small { display: block; color: #aebad3; font-size: 12px; }
    .growth-next b { display: block; margin: 4px 0 9px; font-size: 15px; }
    .growth-next .secondary { width: 100%; min-height: 46px; font-size: 12px; background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.16); }
    .empty-portfolio { display: none; min-height: 410px; place-items: center; border-radius: var(--radius-xl); border: 1px dashed #c4c6c0; background: #fbfaf6; text-align: center; padding: 24px; }
    .empty-portfolio.visible { display: grid; }
    .empty-art { width: 112px; height: 100px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 22px; color: var(--action); background: #edf0ff; }
    .empty-art .icon { width: 54px; height: 54px; stroke-width: 1.2; }
    .empty-portfolio h2 { margin: 0 0 7px; font-size: 25px; }
    .empty-portfolio p { max-width: 32em; margin: 0 auto 16px; color: var(--ink-soft); font-size: 14px; }

    /* Concept controls */
    .prototype-badge {
      position: fixed; left: 18px; bottom: 14px; z-index: 70;
      padding: 7px 10px; border-radius: 8px; color: #fff; background: rgba(13,20,34,.84); font-size: 10px; font-weight: 800;
      backdrop-filter: blur(8px);
    }
    .concept-tools { position: fixed; right: 16px; bottom: 14px; z-index: 80; font-size: 12px; }
    .concept-tools-toggle {
      min-height: 38px; padding: 0 12px; border: 1px solid rgba(255,255,255,.22);
      border-radius: 10px; color: #fff; background: rgba(13,20,34,.9); font-weight: 850;
      display: flex; align-items: center; gap: 7px; box-shadow: 0 8px 20px rgba(0,0,0,.18);
    }
    .concept-tools-toggle .icon { width: 17px; height: 17px; }
    .concept-tools-panel {
      display: none; width: 266px; margin-bottom: 8px; padding: 14px;
      border-radius: 14px; color: var(--ink); background: #fff; border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0,0,0,.22);
    }
    .concept-tools-panel.open { display: block; }
    .concept-tools-panel h2 { margin: 0 0 4px; font-size: 14px; }
    .concept-tools-panel p { margin: 0 0 10px; color: var(--ink-soft); font-size: 10px; }
    .mode-switch { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; padding: 4px; border-radius: 10px; background: #f0ede5; }
    .mode-switch button { min-height: 38px; border: 0; border-radius: 7px; color: var(--ink-soft); background: transparent; font-size: 10px; font-weight: 850; }
    .mode-switch button[aria-pressed="true"] { color: var(--ink); background: #fff; box-shadow: 0 2px 6px rgba(23,35,61,.1); }
    .tools-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
    .tools-row button { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf6; color: var(--ink); font-size: 10px; font-weight: 800; }
    .tools-row button:hover { background: #f3f1e9; }
    body.capture .prototype-badge, body.capture .concept-tools { display: none; }
    body.capture .view.active, body.capture .stage-panel.active { animation: none !important; }
    body.capture .appbar { transition: none !important; }
    body.kid-app .prototype-badge, body.kid-app .concept-tools { display: none; }
    body.kid-app.review-mode .prototype-badge, body.kid-app.review-mode .concept-tools { display: block; }
    body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
      animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important;
    }

    @media (max-width: 1120px) {
      .appbar { grid-template-columns: minmax(175px,1fr) auto minmax(175px,1fr); gap: 12px; padding: 0 16px; }
      .brand-copy small { display: none; }
      .main-nav button { padding: 0 11px; font-size: 13px; }
      .map-grid { grid-template-columns: 305px minmax(0,1fr); }
      .map-brief { padding-left: 24px; }
      .map-brief h1 { font-size: 40px; }
      .map-node { width: 155px; }
      .map-node .island { width: 112px; height: 70px; }
      .lab-layout { grid-template-columns: minmax(0,1fr) 268px; }
      .stage-panel { padding: 17px 20px 18px; }
      .story-grid, .concept-grid, .build-layout { gap: 14px; }
      .story-grid { grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr); }
      .story-panel h2 { font-size: 40px; }
      .story-panel p { font-size: 15px; }
      .story-scene { transform: scale(.82); transform-origin: right bottom; }
      .build-layout { grid-template-columns: minmax(0,1.1fr) minmax(315px,.9fr); }
      .portfolio-layout { grid-template-columns: minmax(0,1fr) 282px; }
    }
    @media (max-width: 920px) {
      :root { --appbar: 68px; }
      .appbar { grid-template-columns: auto 1fr auto; gap: 8px; }
      .brandmark { width: 40px; height: 40px; }
      .brand-copy b { font-size: 16px; }
      .main-nav { justify-self: center; }
      .main-nav button { padding: 0 10px; }
      .main-nav button span { display: none; }
      .profile-chip { padding-right: 5px; }
      .profile-chip > div:last-child { display: none; }
      .map-grid { grid-template-columns: 280px minmax(0,1fr); }
      .map-brief h1 { font-size: 36px; }
      .map-lead { font-size: 14px; }
      .mission-callout { padding: 16px; }
      .mission-callout h2 { font-size: 21px; }
      .mission-head { grid-template-columns: auto minmax(0,1fr); padding: 11px 16px; min-height: 78px; }
      .mission-goal { display: none; }
      .mission-title h1 { font-size: 24px; }
      .stage-tab span { display: none; }
      .stage-tab { gap: 0; }
      .story-grid, .concept-grid, .build-layout, .reflect-layout { grid-template-columns: minmax(0,1fr); }
      .objective-panel { display: grid; grid-template-columns: minmax(0,1fr) minmax(230px,.8fr); gap: 16px; }
      .objective-panel .eyebrow, .objective-panel h3 { grid-column: 1; }
      .objective-list { grid-column: 1; }
      .parts-block { grid-column: 2; grid-row: 1 / span 3; margin: 0; padding: 0; }
      .story-note { grid-column: 1 / -1; }
      .concept-grid { grid-template-columns: minmax(0,1fr) 250px; }
      .build-visual-card { min-height: 410px; }
      .build-layout { grid-template-columns: 1fr 320px; }
      .reflect-layout { grid-template-columns: minmax(0,.9fr) minmax(340px,1.1fr); }
      .portfolio-layout { grid-template-columns: minmax(0,1fr) 270px; }
    }
    @media (max-width: 760px) {
      body { overflow: auto; }
      .app-shell { min-height: 100svh; height: auto; overflow: visible; }
      .appbar { position: sticky; top: 0; }
      .utility-bar .icon-button:first-child { display: none; }
      .map-grid { grid-template-columns: 1fr; }
      .map-brief { padding: 26px 20px; background: var(--world); }
      .map-brief h1 { max-width: none; }
      .map-stage { min-height: 560px; }
      .map-node { width: 140px; }
      .node-energy { left: 24%; }
      .node-sense { left: 58%; }
      .node-core { left: 82%; }
      .aibo-map { left: 29%; top: 81%; }
      .mission-shell { min-height: calc(100svh - var(--appbar)); }
      .mission-content { overflow: visible; }
      .stage-panel { padding: 16px; }
      .story-grid, .concept-grid, .build-layout, .reflect-layout, .portfolio-layout { grid-template-columns: 1fr; }
      .story-panel { min-height: 530px; }
      .story-scene { transform: scale(.68); right: 1%; }
      .objective-panel { display: block; }
      .parts-block { margin-top: 16px; padding-top: 16px; }
      .concept-grid { gap: 14px; }
      .lab-layout { grid-template-columns: 1fr; }
      .lab-canvas { min-height: 430px; }
      .build-visual-card { min-height: 470px; }
      .build-layout { gap: 14px; }
      .portfolio-page { padding: 20px 16px 70px; }
      .portfolio-layout { gap: 14px; }
    }
    @media (max-height: 790px) and (min-width: 900px) {
      :root { --appbar: 68px; }
      .map-brief { gap: 16px; }
      .map-brief h1 { font-size: 42px; margin-top: 8px; }
      .mission-head { min-height: 72px; padding-top: 8px; padding-bottom: 8px; }
      .mission-title h1 { font-size: 25px; }
      .stage-panel { padding-top: 14px; padding-bottom: 14px; }
      .story-panel { min-height: 420px; }
      .story-panel h2 { font-size: 37px; margin-top: 16px; }
      .story-scene { transform: scale(.77); }
      .objective-panel { padding: 17px; }
      .objective-list li { padding: 8px; }
      .lab-canvas { min-height: 330px; }
      .build-visual-card { min-height: 420px; }
      .evidence-board { padding: 17px; }
      .mentor-body { padding: 14px 16px; }
      .mentor-question { gap: 8px; }
      .mentor-bubble { padding: 10px 12px; font-size: 13px; }
      textarea { min-height: 75px; }
    }
    @media (max-height: 860px) and (min-width: 900px) {
      .circuit-story { min-height: 250px; margin-top: 14px; }
      .concept-board { padding-top: 20px; padding-bottom: 20px; }
      .stage-actions { margin-top: 12px; }
      .build-instructions { padding: 16px; }
      .build-instructions h2 { margin-top: 3px; margin-bottom: 5px; font-size: 24px; }
      .build-instructions > p { font-size: 14px; line-height: 1.5; }
      .safety-card { margin: 10px 0; padding: 9px 10px; font-size: 13px; }
      .step-checklist { gap: 6px; }
      .check-row { min-height: 48px; padding: 6px 9px; }
      .check-row small { font-size: 11px; }
      .evidence-row { margin-top: 8px; }
      .evidence-button, .evidence-sample { min-height: 44px; }
      .form-error { min-height: 14px; margin-top: 4px; }
    }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    }
