:root{
      --bg:#0d1117;
      --panel:#111827;
      --panel2:#151d2c;
      --ink:#e5e7eb;
      --muted:#9ca3af;
      --line:rgba(255,255,255,.12);
      --accent:#f59e0b;
      --good:#34d399;
      --bad:#fb7185;
      --blue:#60a5fa;
      --violet:#a78bfa;
      --shadow:0 24px 80px rgba(0,0,0,.42);
      --radius:22px;
    }
    *{box-sizing:border-box}
    html,body{margin:0; min-height:100%; background:radial-gradient(circle at top,#1f2937 0%,#0b0f18 50%,#05070b 100%); color:var(--ink); font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;}
    body{overflow-x:hidden}
    button,input,select,textarea{font:inherit; font-size:16px;}
    button{border:0; cursor:pointer; color:inherit}
    .app,.stage,.panel,.roomWrap,.roomFrame,.lensHandle,.hotspot,.card,.evidence,.patchRow,.repairGrid,.proofChips,.visitProofBox,.modal,.mobileNav,.sheetToggle,.panelTabs{
      -webkit-user-select:none;
      user-select:none;
      -webkit-touch-callout:none;
      -webkit-tap-highlight-color:transparent;
    }
    button,a,.btn,.tabBtn,.hotspot,.sheetToggle,.mobileNav button,.close,select{
      touch-action:manipulation;
    }
    input,textarea,select{
      -webkit-user-select:auto;
      user-select:auto;
    }
    body.is-dragging-lens .app,
    body.is-dragging-lens .stage,
    body.is-dragging-lens .roomWrap,
    body.is-dragging-lens .roomFrame,
    body.is-dragging-lens .lensHandle{
      -webkit-user-select:none!important;
      user-select:none!important;
      -webkit-touch-callout:none!important;
      touch-action:none!important;
    }
    body.is-dragging-lens{overscroll-behavior:none;}
    .app{min-height:100vh; padding:18px; display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:18px; max-width:1480px; margin:0 auto;}
    .stage,.panel{background:linear-gradient(180deg,rgba(17,24,39,.94),rgba(9,13,21,.94)); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; position:relative;}
    .stage{min-height:calc(100vh - 36px); display:flex; flex-direction:column;}
    .topbar{display:flex; justify-content:space-between; gap:12px; align-items:center; padding:14px 16px; border-bottom:1px solid var(--line); background:rgba(4,7,12,.38);}
    .title{display:flex; flex-direction:column; gap:2px}
    .titleHead{display:flex; align-items:center; gap:10px; min-width:0;}
    .titleHead h1{min-width:0;}
    .siteBack{display:inline-flex; flex:0 0 auto; align-items:center; justify-content:center; min-height:30px; padding:6px 10px; border:1px solid rgba(255,255,255,.16); border-radius:999px; background:rgba(255,255,255,.08); color:#e5e7eb; text-decoration:none; font-size:12px; font-weight:800; line-height:1; white-space:nowrap; transition:.16s ease;}
    .siteBack:hover{background:rgba(255,255,255,.14);}
    .siteBack:focus-visible{outline:3px solid #60a5fa; outline-offset:3px;}
    h1{font-size:18px; margin:0; letter-spacing:.08em;}
    .subtitle{font-size:12px; color:var(--muted)}
    .meters{display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end;}
    .pill{font-size:12px; padding:7px 10px; border-radius:999px; background:rgba(255,255,255,.07); border:1px solid var(--line); color:#d1d5db; white-space:nowrap;}
    .pill strong{color:white}
    .roomWrap{padding:14px; display:grid; place-items:center; flex:1; position:relative;}
    .roomFrame{position:relative; width:min(100%,1000px); aspect-ratio:1000/620; border-radius:20px; overflow:hidden; background:#090d15; border:1px solid rgba(255,255,255,.16); box-shadow:inset 0 0 120px rgba(0,0,0,.72),0 20px 60px rgba(0,0,0,.34); touch-action:none; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none;}
    svg.room{width:100%; height:100%; display:block; position:absolute; inset:0; -webkit-user-select:none; user-select:none;}
    svg.room text{ -webkit-user-select:none; user-select:none; pointer-events:none; }
    .overlayNoise{position:absolute; inset:0; pointer-events:none; opacity:.11; mix-blend-mode:screen; background-image:repeating-linear-gradient(0deg,rgba(255,255,255,.16) 0 1px,transparent 1px 4px); animation:scan 4s linear infinite;}
    .scanline{position:absolute; left:0; right:0; height:90px; top:-120px; background:linear-gradient(180deg,transparent,rgba(96,165,250,.12),transparent); animation:drop 7s linear infinite; pointer-events:none;}
    @keyframes scan{from{transform:translateY(0)}to{transform:translateY(24px)}}
    @keyframes drop{0%{top:-110px}100%{top:100%}}
    .hotspots{position:absolute; inset:0; pointer-events:none;}
    .hotspot{position:absolute; transform:translate(-50%,-50%); width:52px; height:52px; border-radius:999px; background:rgba(245,158,11,.13); border:1px solid rgba(245,158,11,.35); box-shadow:0 0 0 0 rgba(245,158,11,.35); pointer-events:auto; display:grid; place-items:center; color:#fed7aa; transition:.18s ease;}
    .hotspot::before{content:""; width:10px; height:10px; border-radius:50%; background:#fbbf24; box-shadow:0 0 18px #fbbf24;}
    .hotspot:hover,.hotspot:focus-visible{transform:translate(-50%,-50%) scale(1.08); box-shadow:0 0 0 10px rgba(245,158,11,.08); outline:none;}
    .hotspot.locked{opacity:.35; filter:grayscale(1)}
    .hotspot.solved{background:rgba(52,211,153,.14); border-color:rgba(52,211,153,.45);}
    .hotspot.solved::before{background:#34d399; box-shadow:0 0 18px #34d399;}
    .lensHandle{position:absolute; left:50%; top:50%; width:132px; height:132px; border:2px solid rgba(147,197,253,.92); border-radius:50%; transform:translate(-50%,-50%); pointer-events:auto; display:grid; place-items:center; background:radial-gradient(circle at 40% 35%,rgba(147,197,253,.18),rgba(59,130,246,.04) 45%,rgba(0,0,0,.03)); box-shadow:0 0 0 9999px rgba(2,6,23,.18), inset 0 0 28px rgba(147,197,253,.18), 0 0 35px rgba(96,165,250,.22); touch-action:none; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; cursor:grab; z-index:5;}
    .lensHandle:active{cursor:grabbing}
    .lensHandle::after{content:"記憶レンズ"; font-size:11px; letter-spacing:.08em; color:#dbeafe; background:rgba(0,0,0,.48); border:1px solid rgba(147,197,253,.45); padding:4px 8px; border-radius:999px; transform:translateY(52px);}
    .toast{position:absolute; left:50%; bottom:22px; transform:translateX(-50%); background:rgba(5,8,15,.92); border:1px solid rgba(255,255,255,.18); padding:12px 14px; border-radius:16px; box-shadow:var(--shadow); max-width:min(760px,calc(100% - 28px)); font-size:14px; color:#e5e7eb; z-index:8; opacity:0; pointer-events:none; transition:.22s ease;}
    .toast.show{opacity:1; transform:translateX(-50%) translateY(-4px)}
    .panel{padding:14px; display:flex; flex-direction:column; gap:12px; min-height:calc(100vh - 36px);}
    .card{border:1px solid var(--line); background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.025)); border-radius:18px; padding:13px;}
    .panel .card{scrollbar-width:thin; scrollbar-color:rgba(148,163,184,.48) rgba(15,23,42,.52); touch-action:pan-y; -webkit-overflow-scrolling:touch;}
    .panel .card::-webkit-scrollbar{width:8px; height:8px;}
    .panel .card::-webkit-scrollbar-track{background:rgba(15,23,42,.52); border-radius:999px;}
    .panel .card::-webkit-scrollbar-thumb{background:rgba(148,163,184,.42); border-radius:999px; border:2px solid rgba(15,23,42,.52);}
    .panel .card::-webkit-scrollbar-thumb:hover{background:rgba(203,213,225,.62);}
    .card h2{font-size:13px; margin:0 0 8px; letter-spacing:.08em; color:#f3f4f6; display:flex; align-items:center; justify-content:space-between; gap:8px;}
    .card p{margin:0; color:#cbd5e1; font-size:13px; line-height:1.7;}
    .objective{font-size:14px!important; color:#f9fafb!important;}
    .tiny{font-size:11px; color:var(--muted)}
    .storyPanel{margin-top:11px; display:grid; gap:9px;}
    .storyHead{display:flex; align-items:center; justify-content:space-between; gap:8px; padding:9px 10px; border-radius:13px; background:rgba(96,165,250,.10); border:1px solid rgba(147,197,253,.24);}
    .storyHead strong{font-size:13px; color:#dbeafe;}
    .storyHead span{font-size:11px; color:#bfdbfe; text-align:right;}
    .situationBox,.nextActionBox,.whyBox{padding:10px 11px; border-radius:13px; border:1px solid rgba(255,255,255,.10); background:rgba(0,0,0,.18);}
    .situationBox b,.nextActionBox b,.whyBox b{display:block; margin-bottom:3px; font-size:11px; color:#fef3c7; letter-spacing:.08em;}
    .situationBox span,.nextActionBox span,.whyBox span{display:block; color:#d1d5db; font-size:12px; line-height:1.6;}
    .nextActionBox{border-color:rgba(52,211,153,.30); background:rgba(52,211,153,.08);}
    .nextActionBox b{color:#bbf7d0;}
    .phaseTrack{display:grid; grid-template-columns:repeat(4,1fr); gap:6px;}
    .phaseStep{min-height:42px; display:grid; place-items:center; text-align:center; border-radius:12px; border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.045); color:#94a3b8; font-size:11px; font-weight:800; line-height:1.25;}
    .phaseStep.done{border-color:rgba(52,211,153,.25); background:rgba(52,211,153,.08); color:#bbf7d0;}
    .phaseStep.active{border-color:rgba(251,191,36,.48); background:rgba(251,191,36,.15); color:#fff7ed; box-shadow:0 0 0 1px rgba(251,191,36,.10) inset;}
    .evidenceGrid{display:grid; grid-template-columns:1fr; gap:8px;}
    .evidence{display:flex; gap:9px; align-items:flex-start; padding:10px; border:1px solid rgba(255,255,255,.1); border-radius:14px; background:rgba(0,0,0,.22); min-height:58px; position:relative; overflow:hidden;}
    .evidence::before{content:""; width:35px; height:35px; border-radius:11px; background:linear-gradient(135deg,rgba(245,158,11,.6),rgba(96,165,250,.4)); flex:0 0 auto; box-shadow:inset 0 0 18px rgba(255,255,255,.13);}
    .evidence.locked{opacity:.35; filter:saturate(.4)}
    .evidence strong{display:block; font-size:12px; color:white; margin-bottom:2px;}
    .evidence span{font-size:12px; line-height:1.45; color:#cbd5e1; display:block;}
    .actions{display:grid; grid-template-columns:1fr 1fr; gap:8px;}
    .btn{border-radius:13px; padding:11px 10px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.13); color:#f3f4f6; transition:.17s ease; text-decoration: none;}
    .btn:hover{background:rgba(255,255,255,.13)}
    .btn.primary{background:linear-gradient(135deg,#b45309,#f59e0b); border-color:rgba(251,191,36,.65); color:#111827; font-weight:800;}
    .btn.good{background:rgba(52,211,153,.18); border-color:rgba(52,211,153,.35);}
    .btn.bad{background:rgba(251,113,133,.14); border-color:rgba(251,113,133,.35);}
    .btn:disabled{opacity:.45; cursor:not-allowed}
    .repairActions #findEvidenceBtn{grid-column:1/-1;}
    .repairGrid{display:grid; gap:8px;}
    .patchRow{position:relative; padding:10px; border:1px solid rgba(255,255,255,.10); border-radius:14px; background:rgba(0,0,0,.18); transition:.15s ease;}
    .patchHead{display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:8px;}
    .patchLabel{font-size:12px; font-weight:800; letter-spacing:.04em; color:#e5e7eb;}
    .patchRow .proof{font-size:10px; padding:3px 7px; border-radius:999px; background:rgba(52,211,153,.16); border:1px solid rgba(52,211,153,.32); color:#bbf7d0; white-space:nowrap;}
    .patchRow.lockedRow{opacity:.55;}
    .patchRow.lockedRow .proof{background:rgba(251,191,36,.12); border-color:rgba(251,191,36,.28); color:#fde68a;}
    .optRow{display:grid; gap:6px;}
    .optBtn{text-align:left; border-radius:11px; padding:9px 11px; min-height:40px; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.13); color:#d1d5db; font-size:12.5px; line-height:1.35; transition:.15s ease;}
    .optBtn:hover:not(:disabled){background:rgba(255,255,255,.10);}
    .optBtn:focus-visible{outline:2px solid #60a5fa; outline-offset:2px;}
    .optBtn.picked{background:rgba(96,165,250,.20); border-color:rgba(147,197,253,.60); color:#eff6ff; font-weight:800;}
    .optBtn:disabled{opacity:.6; cursor:not-allowed;}
    .proofChips{display:flex; flex-wrap:wrap; gap:6px;}
    .chip{border-radius:999px; padding:8px 12px; min-height:38px; font-size:12px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.14); color:#d1d5db; transition:.15s ease;}
    .chip:hover:not(:disabled){background:rgba(255,255,255,.11);}
    .chip:focus-visible{outline:2px solid #60a5fa; outline-offset:2px;}
    .chip.picked{background:rgba(52,211,153,.18); border-color:rgba(52,211,153,.55); color:#d1fae5; font-weight:800;}
    .chip:disabled{opacity:.45; cursor:not-allowed;}
    .log{height:120px; overflow:auto; font-size:12px; color:#cbd5e1; line-height:1.55; padding-right:4px; touch-action:pan-y; -webkit-overflow-scrolling:touch;}
    .log div{padding:6px 0; border-bottom:1px solid rgba(255,255,255,.06)}
    .log .logOk{color:#86efac;}
    .log .logInfo{color:#93c5fd;}
    .log .logWarn{color:#fcd34d;}
    .log .logErr{color:#fca5a5;}
    .modalBackdrop{position:fixed; inset:0; display:none; align-items:center; justify-content:center; background:rgba(0,0,0,.68); z-index:40; padding:16px;}
    .modalBackdrop.show{display:flex;}
    .modal{width:min(820px,100%); max-height:min(86vh,820px); overflow:auto; border-radius:24px; border:1px solid rgba(255,255,255,.18); background:linear-gradient(180deg,#141c2b,#080c14); box-shadow:var(--shadow); padding:18px; position:relative; touch-action:pan-y; -webkit-overflow-scrolling:touch;}
    .modalHead{display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:12px;}
    .modal h3{margin:0; font-size:18px; letter-spacing:.05em;}
    .modal .desc{color:#cbd5e1; line-height:1.75; font-size:14px; margin:4px 0 0;}
    .close{width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.16);}
    .inspectGrid{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:14px 0;}
    .inspectPane{min-height:210px; border-radius:18px; border:1px solid rgba(255,255,255,.12); padding:12px; background:rgba(0,0,0,.25); overflow:hidden; position:relative;}
    .inspectPane h4{margin:0 0 8px; font-size:12px; color:#cbd5e1; letter-spacing:.08em;}
    .inspectPane svg{width:100%; height:160px; display:block; border-radius:14px; background:rgba(255,255,255,.035);}
    .modalActions{display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end;}
    .markBtns{display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin-top:12px;}
    .statusLine{padding:10px 12px; border-radius:14px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.1); color:#cbd5e1; font-size:13px; line-height:1.6;}
    .intro{position:fixed; inset:0; background:radial-gradient(circle at 50% 10%,#1f2937,#04060a 65%); z-index:120; display:flex; align-items:center; justify-content:center; padding:20px;}
    .intro.hide{display:none}
    .introBox{width:min(760px,100%); border:1px solid rgba(255,255,255,.18); background:linear-gradient(180deg,rgba(17,24,39,.95),rgba(8,11,18,.95)); border-radius:28px; padding:24px; box-shadow:var(--shadow);}
    .introBox h2{font-size:26px; margin:0 0 12px; letter-spacing:.08em;}
    .introBox p{color:#cbd5e1; line-height:1.85;}
    .introGuide{display:grid; gap:8px; margin-top:14px;}
    .introGuide div{padding:10px 12px; border-radius:14px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12); color:#dbeafe; font-size:13px; line-height:1.55;}
    .introGuide b{display:block; color:#fff7ed; margin-bottom:2px;}
    .introBtns{display:flex; gap:10px; flex-wrap:wrap; margin-top:18px;}
    .ending{position:absolute; inset:0; display:none; place-items:center; background:radial-gradient(circle,rgba(251,191,36,.18),rgba(0,0,0,.84)); z-index:30; padding:22px; text-align:center;}
    .ending.show{display:grid; animation:fadeIn .8s ease both}
    .endingBox{width:min(640px,100%); padding:28px; border-radius:26px; border:1px solid rgba(251,191,36,.35); background:rgba(2,6,23,.86); box-shadow:var(--shadow);}
    .endingBadge{display:inline-flex; align-items:center; justify-content:center; min-width:112px; margin:0 auto 10px; padding:7px 14px; border-radius:999px; border:1px solid rgba(251,191,36,.55); background:linear-gradient(135deg,rgba(251,191,36,.34),rgba(245,158,11,.12)); color:#fef3c7; font-size:13px; font-weight:900; letter-spacing:.22em; box-shadow:0 0 32px rgba(251,191,36,.24);}
    .ending h2{font-size:28px; margin:0 0 12px;}
    .ending p{color:#e5e7eb; line-height:1.75;}
    .ending p strong{color:#fef3c7;}
    .auditReport{margin:14px auto 6px; padding:12px 14px; max-width:520px; border-radius:14px; border:1px solid rgba(148,163,184,.32); background:rgba(3,7,15,.92); text-align:left; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:12.5px; line-height:1.75; color:#cbd5e1; overflow-x:auto;}
    .auditReport .auditHead{font-weight:800; letter-spacing:.18em; color:#fbbf24; font-size:11.5px; margin-bottom:8px; padding-bottom:6px; border-bottom:1px solid rgba(148,163,184,.22);}
    .auditReport .ok{color:#86efac;}
    .auditReport .info{color:#93c5fd;}
    @keyframes fadeIn{from{opacity:0}to{opacity:1}}
    .glitchText{animation:glitch .5s steps(2,end) 1}
    @keyframes glitch{0%{transform:translate(0); filter:hue-rotate(0)}20%{transform:translate(-2px,1px); filter:hue-rotate(80deg)}45%{transform:translate(2px,-1px)}70%{transform:translate(-1px,2px); filter:hue-rotate(-80deg)}100%{transform:translate(0)}}
    .redacted{background:linear-gradient(90deg,#111827,#374151,#111827); color:transparent; border-radius:4px; padding:0 4px;}

    /* 演出: 画面フラッシュ。既定 opacity:0 で、アニメーションでのみ可視化する。
       アニメーション無効環境(prefers-reduced-motion)では自動的に何も表示されない。 */
    .screenFlash{position:absolute; inset:0; pointer-events:none; opacity:0; z-index:25; background:radial-gradient(circle at 50% 42%, rgba(147,197,253,.5), rgba(96,165,250,.16) 55%, transparent 78%);}
    .screenFlash.go{animation:flashFade .68s ease both;}
    @keyframes flashFade{0%{opacity:.85}100%{opacity:0}}

    /* 演出: ターミナル風カットシーン。行の基準は可視(opacity:1)で、
       アニメーションが有効なときだけ「点灯」して見える。無効環境では即時表示。 */
    .cutscene{position:fixed; inset:0; display:none; z-index:115; background:radial-gradient(circle at 50% 18%, rgba(13,23,42,.97), rgba(2,4,9,.985) 70%); padding:22px; cursor:pointer;}
    .cutscene.show{display:grid; place-items:center; animation:fadeIn .3s ease both;}
    .cutBox{width:min(640px,100%); padding:22px 24px; border-radius:18px; border:1px solid rgba(96,165,250,.30); background:rgba(3,7,15,.88); box-shadow:0 30px 90px rgba(0,0,0,.55), 0 0 60px rgba(96,165,250,.08) inset; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;}
    .cutKicker{font-size:11px; letter-spacing:.26em; color:#60a5fa; border-bottom:1px solid rgba(96,165,250,.22); padding-bottom:9px; margin-bottom:13px;}
    .cutLines{display:grid; gap:9px; min-height:120px; align-content:start;}
    .cutLine{color:#c7d8f0; font-size:13.5px; line-height:1.65; animation:cutIn .5s ease both;}
    .cutLine::before{content:"> "; color:#3b82f6;}
    @keyframes cutIn{from{opacity:0; transform:translateY(7px)}to{opacity:1; transform:none}}
    .cutSkip{margin-top:16px; font-size:10.5px; letter-spacing:.12em; color:#64748b; text-align:right;}

    /* 演出 控えめ(body.calm): 常時アニメーションを止め、装飾を薄くする */
    body.calm .overlayNoise,
    body.calm .scanline{animation:none!important; opacity:.04;}
    body.calm .hotspot.pulse{animation:none!important;}
    body.calm .glitchText{animation:none!important;}
    body.calm .lensHandle.found{animation:none!important;}
    body.calm .screenFlash{display:none!important;}
    @media (max-width:820px){
      .cutscene{padding:14px;}
      .cutBox{padding:16px; border-radius:15px;}
      .cutLine{font-size:12.5px;}
      .cutLines{min-height:96px;}
      .cutKicker{font-size:10px;}
    }

    .guideBubble{position:absolute; z-index:12; left:24px; top:24px; max-width:min(430px,calc(100% - 48px)); padding:12px 14px; border-radius:16px; border:1px solid rgba(147,197,253,.45); background:rgba(7,12,22,.92); box-shadow:0 16px 46px rgba(0,0,0,.38),0 0 28px rgba(96,165,250,.14); color:#e5e7eb; font-size:13px; line-height:1.65; display:none; pointer-events:none;}
    .guideBubble.show{display:block; animation:fadeIn .24s ease both;}
    .guideBubble strong{color:#bfdbfe;}
    .guideBubble::after{content:""; position:absolute; left:52px; top:100%; border:10px solid transparent; border-top-color:rgba(147,197,253,.45);}
    .hotspot .label{position:absolute; left:50%; top:-34px; transform:translateX(-50%) translateY(4px); opacity:0; pointer-events:none; white-space:nowrap; background:rgba(5,8,15,.92); border:1px solid rgba(255,255,255,.18); color:#f9fafb; font-size:12px; padding:5px 8px; border-radius:999px; transition:.16s ease; box-shadow:0 10px 24px rgba(0,0,0,.28);}
    .hotspot:hover .label,.hotspot:focus-visible .label,.hotspot.showLabel .label{opacity:1; transform:translateX(-50%) translateY(0);}
    .hotspot.pulse{animation:hotPulse 1.2s ease-in-out infinite; border-color:rgba(147,197,253,.85); background:rgba(96,165,250,.18);}
    @keyframes hotPulse{0%,100%{box-shadow:0 0 0 0 rgba(96,165,250,.32)}50%{box-shadow:0 0 0 16px rgba(96,165,250,0)}}
    .lensHandle.near{border-color:#fbbf24; box-shadow:0 0 0 9999px rgba(2,6,23,.15), inset 0 0 30px rgba(251,191,36,.2), 0 0 45px rgba(251,191,36,.35);}
    .lensHandle.found{animation:lensClick .34s ease both;}
    @keyframes lensClick{0%{transform:translate(-50%,-50%) scale(1)}40%{transform:translate(-50%,-50%) scale(1.06)}100%{transform:translate(-50%,-50%) scale(1)}}
    .repairNotice{margin:0 0 10px; padding:11px 12px; border-radius:15px; border:1px solid rgba(251,191,36,.28); background:linear-gradient(180deg,rgba(251,191,36,.12),rgba(245,158,11,.055)); color:#fef3c7; font-size:12px; line-height:1.55;}
    .repairNotice strong{display:block; color:#fff7ed; font-size:13px; margin-bottom:3px;}
    .repairNotice.ready{border-color:rgba(52,211,153,.36); background:linear-gradient(180deg,rgba(52,211,153,.14),rgba(20,184,166,.055)); color:#d1fae5;}
    .repairChecklist{display:grid; grid-template-columns:1fr; gap:6px; margin-top:9px;}
    .repairCheck{display:flex; align-items:flex-start; justify-content:space-between; gap:8px; padding:7px 8px; border-radius:11px; border:1px solid rgba(255,255,255,.10); background:rgba(0,0,0,.18);}
    .repairCheck b{font-size:12px; color:#f9fafb;}
    .repairCheck span{font-size:11px; color:#cbd5e1; text-align:right;}
    .repairCheck.done{border-color:rgba(52,211,153,.28); background:rgba(52,211,153,.09);}
    .repairCheck.done span{color:#bbf7d0;}
    .repairCheck.missing{border-color:rgba(251,191,36,.22);}
    .repairCheck.missing span{color:#fde68a;}
    .visitProofBox{margin-top:10px; padding:11px 12px; border-radius:15px; border:1px solid rgba(147,197,253,.25); background:rgba(96,165,250,.075);}
    .visitProofBox.lockedProof .proofChips{display:none;}
    .visitProofBox.lockedProof{opacity:.72; border-style:dashed;}
    .visitProofBox h3{margin:0 0 6px; font-size:12px; letter-spacing:.08em; color:#dbeafe; display:flex; justify-content:space-between; gap:8px;}
    .visitProofStatus{margin:0 0 9px; color:#cbd5e1; font-size:12px; line-height:1.55;}
    .tabBtn.locked{border-color:rgba(251,191,36,.32); color:#fde68a;}
    .softHidden{display:none!important;}
    .panelTabs{display:none; gap:8px; position:sticky; top:0; z-index:20; padding:4px 0 8px; background:linear-gradient(180deg,rgba(9,13,21,.98),rgba(9,13,21,.72)); backdrop-filter:blur(8px);}
    .tabBtn{flex:1; border-radius:999px; padding:10px 8px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12); color:#cbd5e1; font-size:12px;}
    .tabBtn.active{background:rgba(245,158,11,.18); border-color:rgba(245,158,11,.5); color:#fff7ed; font-weight:800;}
    .resultGrid{display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin:12px 0;}
    .resultStat{border:1px solid rgba(255,255,255,.14); background:rgba(255,255,255,.06); border-radius:14px; padding:10px;}
    .resultStat b{display:block; font-size:18px; color:white;}.resultStat span{font-size:11px; color:#cbd5e1;}
    .shareText{width:100%; min-height:78px; border-radius:14px; background:#070b12; color:#e5e7eb; border:1px solid rgba(255,255,255,.16); padding:10px; resize:vertical; font-size:16px;}

    .mobileHint{display:none}
    @media (max-width:980px){
      .app{grid-template-columns:1fr; padding:10px; gap:10px;}
      .stage{min-height:auto;}
      .panel{min-height:auto;}
      .roomWrap{padding:8px;}
      .topbar{align-items:flex-start; flex-direction:column;}
      .meters{justify-content:flex-start;}
      .actions{grid-template-columns:1fr;}
      .inspectGrid{grid-template-columns:1fr;}
      .markBtns{grid-template-columns:1fr;}
      .hotspot{width:46px;height:46px;}
      .lensHandle{width:112px;height:112px;}
      .mobileHint{display:inline;}

      body{padding-bottom:72px;}
      .panel{border-radius:20px 20px 0 0;}
      .panelTabs{display:flex;}
      .panel .card{display:none;}
      .panel .card.mobileActive{display:block;}
      .hotspot{width:58px;height:58px;}
      .hotspot .label{opacity:1; top:-31px; font-size:11px; transform:translateX(-50%) translateY(0);}
      .resultGrid{grid-template-columns:repeat(2,1fr);}

    }


    /* v7: mobile is not a collapsed PC layout. It becomes a touch-first bottom sheet. */
    .sheetToggle{display:none;}
    @media (max-width:820px){
      html,body{height:100%; overflow-x:hidden; overscroll-behavior:none;}
      body{padding-bottom:0; background:#05070b;}
      .app{display:block; padding:0; margin:0; max-width:none; min-height:100svh;}
      .stage{min-height:100svh; height:100svh; border-radius:0; border:0; box-shadow:none; background:linear-gradient(180deg,rgba(17,24,39,.96),rgba(5,7,11,.96));}
      .topbar{padding:8px 10px; gap:7px; border-radius:0; background:rgba(4,7,12,.62);}
      h1{font-size:15px; line-height:1.2;}
      .subtitle{display:none;}
      .meters{width:100%; justify-content:flex-start; flex-wrap:nowrap; overflow-x:auto; gap:6px; padding-bottom:2px; -webkit-overflow-scrolling:touch; scrollbar-width:none;}
      .meters::-webkit-scrollbar{display:none;}
      .pill{font-size:10px; padding:5px 7px; flex:0 0 auto;}
      .roomWrap{padding:8px 8px 86px; display:flex; align-items:flex-start; justify-content:center; overflow:hidden; flex:1; min-height:0;}
      .roomFrame{width:100%; max-width:560px; aspect-ratio:1000/620; border-radius:16px; margin-top:2px; box-shadow:inset 0 0 90px rgba(0,0,0,.68),0 18px 50px rgba(0,0,0,.32);}
      .lensHandle{width:108px; height:108px; border-width:2px;}
      .lensHandle::after{font-size:10px; padding:3px 7px; transform:translateY(43px);}
      .hotspot{width:64px; height:64px;}
      .hotspot::before{width:12px; height:12px;}
      .hotspot .label{top:-30px; font-size:11px; opacity:.95; transform:translateX(-50%) translateY(0); padding:4px 7px;}
      .guideBubble{left:10px; right:10px; top:auto; bottom:12px; max-width:none; font-size:12px; padding:10px 12px; line-height:1.55; border-radius:14px;}
      .guideBubble::after{display:none;}
      .toast{bottom:82px; font-size:13px; padding:10px 12px; max-width:calc(100% - 18px);}

      .panel{position:fixed; left:0; right:0; bottom:0; z-index:55; min-height:0; max-height:70svh; border-radius:22px 22px 0 0; padding:8px 10px 12px; transform:translateY(calc(100% - 84px)); transition:transform .22s ease; overflow:auto; overscroll-behavior:contain; box-shadow:0 -20px 70px rgba(0,0,0,.58); border-left:0; border-right:0; border-bottom:0;}
      .panel.sheetOpen{transform:translateY(0);}
      .sheetToggle{display:flex; align-items:center; justify-content:center; width:100%; height:28px; margin:0 0 2px; background:transparent; color:#cbd5e1; position:relative;}
      .sheetToggle::before{content:""; position:absolute; top:5px; left:50%; transform:translateX(-50%); width:44px; height:4px; border-radius:999px; background:rgba(255,255,255,.28);}
      .sheetToggle span{font-size:11px; margin-top:10px; letter-spacing:.08em;}
      .panelTabs{display:flex; position:sticky; top:0; z-index:20; padding:4px 0 8px; background:linear-gradient(180deg,rgba(9,13,21,.98),rgba(9,13,21,.78)); backdrop-filter:blur(10px);}
      .tabBtn{padding:11px 6px; font-size:12px; min-height:42px;}
      .panel .card{display:none; margin-top:6px;}
      .panel.sheetOpen .card.mobileActive{display:block;}
      .panel:not(.sheetOpen) .card{display:none!important;}
      .card{border-radius:16px; padding:12px;}
      .card h2{font-size:12px;}
      .card p{font-size:12px; line-height:1.6;}
      .objective{font-size:13px!important;}
      .evidenceGrid{gap:7px;}
      .evidence{padding:9px; min-height:54px;}
      .actions{grid-template-columns:1fr 1fr; gap:8px;}
      .btn{padding:12px 10px; min-height:44px;}
      .repairGrid{gap:10px;}
      .optBtn{min-height:44px; font-size:13px; padding:10px 12px;}
      .chip{min-height:44px; padding:10px 13px; font-size:12.5px;}
      .log{height:190px;}
      .modalBackdrop{align-items:flex-end; padding:0;}
      .modal{width:100%; max-height:78svh; border-radius:24px 24px 0 0; padding:14px;}
      .modal h3{font-size:16px;}
      .modal .desc{font-size:13px; line-height:1.65;}
      .inspectGrid{grid-template-columns:1fr; gap:9px; margin:10px 0;}
      .inspectPane{min-height:150px; padding:10px;}
      .inspectPane svg{height:126px;}
      .markBtns{grid-template-columns:1fr;}
      .resultGrid{grid-template-columns:repeat(2,1fr);}
      .intro{padding:14px;}
      .introBox{padding:20px; border-radius:22px;}
      .introBox h2{font-size:22px;}
    }
    @media (max-width:390px){
      .roomWrap{padding-left:5px; padding-right:5px;}
      .hotspot{width:58px; height:58px;}
      .lensHandle{width:100px; height:100px;}
      .pill{font-size:9.5px; padding:5px 6px;}
      .tabBtn{font-size:11px; padding-left:4px; padding-right:4px;}
    }



    /* v9: mobile-first redesign. PC layout above is untouched. */
    .mobileNav{display:none;}
    @media (max-width:820px){
      :root{--mobile-sheet-closed:54px;}
      html,body{height:100%; overflow:hidden; background:#05070b;}
      body{padding:0;}
      .app{display:block; width:100%; height:100svh; min-height:100svh; padding:0; margin:0; overflow:hidden;}
      .stage{height:100svh; min-height:100svh; border-radius:0; border:0; box-shadow:none; overflow:hidden; background:linear-gradient(180deg,#080d16,#05070b 62%);}
      .topbar{height:74px; min-height:74px; padding:7px 10px 5px; gap:4px; display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; border-bottom:1px solid rgba(255,255,255,.10); background:rgba(4,7,12,.82); backdrop-filter:blur(10px);}
      .title{display:block; min-width:0;}
      .titleHead{justify-content:space-between; gap:8px;}
      .siteBack{min-height:28px; padding:5px 8px; font-size:11px;}
      h1{font-size:16px; line-height:1.15; letter-spacing:.04em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
      #gameTitle .redacted{display:none;}
      .subtitle{display:none;}
      .meters{width:100%; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; overflow:visible; padding:0;}
      .pill{font-size:10px; line-height:1; padding:6px 3px; text-align:center; min-width:0; white-space:nowrap; border-color:rgba(255,255,255,.10); background:rgba(255,255,255,.055);}
      .pill strong{font-size:11px;}
      .roomWrap{position:relative; flex:1; height:calc(100svh - 74px); min-height:0; padding:6px 0 calc(var(--mobile-sheet-closed) + 8px); display:flex; align-items:flex-start; justify-content:flex-start; overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain; scrollbar-width:none; touch-action:pan-x; scroll-snap-type:x proximity; background:radial-gradient(circle at 50% 0%,rgba(31,41,55,.70),transparent 48%);}
      .roomWrap::-webkit-scrollbar{display:none;}
      .roomFrame{flex:0 0 auto; height:calc(100svh - 74px - var(--mobile-sheet-closed) - 18px); width:calc((100svh - 74px - var(--mobile-sheet-closed) - 18px) * 1.6129); min-width:680px; max-width:none; margin:0 16px; border-radius:18px; border-color:rgba(255,255,255,.14); box-shadow:inset 0 0 110px rgba(0,0,0,.76),0 22px 70px rgba(0,0,0,.46); touch-action:pan-x; scroll-snap-align:center;}
      svg.room{transform:translateZ(0);}
      .mobileNav{display:flex; position:fixed; left:50%; transform:translateX(-50%); bottom:calc(var(--mobile-sheet-closed) + 10px); z-index:58; gap:6px; padding:5px; border-radius:999px; background:rgba(5,8,15,.76); border:1px solid rgba(255,255,255,.14); backdrop-filter:blur(12px); box-shadow:0 12px 36px rgba(0,0,0,.38);}
      .mobileNav button{min-width:54px; min-height:34px; border-radius:999px; background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.12); color:#dbeafe; font-weight:700; font-size:12px;}
      .mobileNav button:active{background:rgba(96,165,250,.24);}
      .hotspot{width:58px; height:58px; background:rgba(245,158,11,.11); border-color:rgba(245,158,11,.35);}
      .hotspot::before{width:12px; height:12px;}
      .hotspot .label{opacity:0; top:-30px; font-size:11px; padding:4px 7px; transform:translateX(-50%) translateY(2px);}
      .hotspot.showLabel .label,.hotspot.pulse .label,.hotspot:focus-visible .label{opacity:1; transform:translateX(-50%) translateY(0);}
      .lensHandle{width:112px; height:112px; border-width:2px;}
      .lensHandle::after{font-size:10px; padding:3px 7px; transform:translateY(45px);}
      .guideBubble{position:fixed; left:10px; top:82px; right:10px; bottom:auto; max-width:none; font-size:12px; line-height:1.5; padding:9px 11px; border-radius:14px; background:rgba(5,8,15,.92); pointer-events:none; z-index:66;}
      .guideBubble::after{display:none;}
      .toast{position:fixed; left:12px; right:12px; bottom:calc(var(--mobile-sheet-closed) + 58px); transform:none; font-size:13px; line-height:1.55; padding:10px 12px; max-width:none; border-radius:14px; z-index:76;}
      .toast.show{transform:none;}
      body.sheet-open .guideBubble{display:none!important;}
      body.sheet-open .toast{top:82px; bottom:auto; z-index:88;}
      body.game-ended .panel,
      body.game-ended .mobileNav,
      body.game-ended .guideBubble,
      body.game-ended .toast{display:none!important;}
      .ending{position:fixed; inset:0; z-index:130; padding:max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom)); overflow:auto; place-items:center; background:radial-gradient(circle at 50% 30%,rgba(251,191,36,.28),rgba(5,7,11,.94) 62%,#03050a 100%); touch-action:pan-y; -webkit-overflow-scrolling:touch;}
      .endingBox{width:min(100%,430px); max-height:none; margin:auto 0; padding:18px; border-radius:20px; background:linear-gradient(180deg,rgba(15,23,42,.96),rgba(2,6,23,.94));}
      .endingBadge{min-width:96px; margin-bottom:8px; padding:6px 12px; font-size:12px;}
      .ending h2{font-size:24px; margin-bottom:8px;}
      .ending p{font-size:13px; line-height:1.55; margin:0 0 10px;}
      .ending .resultGrid{gap:6px; margin:10px 0;}
      .ending .resultStat{padding:8px 6px; border-radius:12px;}
      .ending .resultStat b{font-size:16px;}
      .ending .resultStat span{font-size:10px;}
      .ending #endingScore{margin:6px 0 8px; font-weight:800; color:#fef3c7;}
      .ending .shareText{min-height:66px; max-height:92px; font-size:13px; line-height:1.45; resize:none;}
      .ending .modalActions{grid-template-columns:1fr 1fr; margin-top:10px;}
      .panel{position:fixed; left:0; right:0; bottom:0; z-index:70; display:flex; flex-direction:column; min-height:0; max-height:72svh; border-radius:18px 18px 0 0; padding:0 10px 12px; transform:translateY(calc(100% - var(--mobile-sheet-closed))); transition:transform .2s ease; overflow:hidden; overscroll-behavior:contain; box-shadow:0 -20px 70px rgba(0,0,0,.60); border-left:0; border-right:0; border-bottom:0; background:linear-gradient(180deg,rgba(17,24,39,.98),rgba(7,11,19,.98));}
      .panel.sheetOpen{height:72svh; transform:translateY(0);}
      .sheetToggle{display:flex; align-items:center; justify-content:center; flex:0 0 44px; width:calc(100% + 20px); height:44px; margin:0 -10px; padding:0 10px; background:linear-gradient(180deg,#111827,#0b1220); color:#e5e7eb; position:relative; z-index:3; letter-spacing:.04em; border-radius:18px 18px 0 0;}
      .sheetToggle::before{content:""; position:absolute; top:5px; left:50%; transform:translateX(-50%); width:46px; height:4px; border-radius:999px; background:rgba(255,255,255,.30);}
      .sheetToggle span{font-size:13px; margin-top:9px; font-weight:800;}
      .panelTabs{display:none;}
      .panel.sheetOpen .panelTabs{display:flex; position:relative; z-index:2; flex:0 0 auto; width:calc(100% + 20px); margin:0 -10px; padding:6px 10px 8px; background:#0b1220; backdrop-filter:none; box-shadow:0 10px 18px rgba(0,0,0,.32);}
      .tabBtn{padding:10px 6px; min-height:40px; font-size:12px;}
      .panel .card{display:none!important; margin-top:6px;}
      .panel.sheetOpen .card.mobileActive{display:block!important; flex:1 1 auto; min-height:0; overflow:auto; overscroll-behavior:contain; touch-action:pan-y; -webkit-overflow-scrolling:touch;}
      .panel.sheetOpen #goalCard.mobileActive{flex:1 1 auto;}
      .panel.sheetOpen #actionsCard.mobileActive{flex:0 0 auto; overflow:visible;}
      .card{border-radius:16px; padding:12px;}
      .card h2{font-size:12px; margin-bottom:7px;}
      .card p{font-size:12px; line-height:1.65;}
      .objective{font-size:13px!important;}
      .actions{grid-template-columns:1fr 1fr; gap:8px;}
      .btn{min-height:44px; padding:11px 10px; border-radius:13px; text-decoration: none;}
      .evidence{padding:9px; min-height:54px;}
      .optBtn{min-height:44px; font-size:13px; padding:10px 12px;}
      .chip{min-height:44px; padding:10px 13px; font-size:12.5px;}
      .modalBackdrop{align-items:flex-end; padding:0; z-index:90;}
      .modal{width:100%; max-height:78svh; border-radius:22px 22px 0 0; padding:14px;}
      .modal h3{font-size:16px;}
      .inspectGrid{grid-template-columns:1fr 1fr; gap:8px; margin:10px 0;}
      .inspectPane{min-height:132px; padding:9px;}
      .inspectPane h4{font-size:11px; margin-bottom:6px;}
      .inspectPane svg{height:102px;}
      .inspectPane .tiny{font-size:10.5px; line-height:1.35;}
      .markBtns{grid-template-columns:1fr 1fr;}
      .markBtns .primary{grid-column:1/-1;}
      .modalActions{display:grid; grid-template-columns:1fr; gap:8px;}
      .intro{padding:14px;}
      .introBox{padding:20px; border-radius:22px;}
      .introBox h2{font-size:22px;}
    }
    @media (max-width:390px){
      .topbar{height:70px; min-height:70px; padding-left:8px; padding-right:8px;}
      h1{font-size:15px;}
      .pill{font-size:9px; padding:5px 2px;}
      .pill strong{font-size:10px;}
      .roomWrap{height:calc(100svh - 70px); padding-bottom:calc(var(--mobile-sheet-closed) + 8px);}
      .roomFrame{height:calc(100svh - 70px - var(--mobile-sheet-closed) - 18px); width:calc((100svh - 70px - var(--mobile-sheet-closed) - 18px) * 1.6129); min-width:640px; margin:0 12px;}
      .mobileNav button{min-width:50px; font-size:11px;}
      .hotspot{width:54px;height:54px;}
      .lensHandle{width:106px;height:106px;}
      body.sheet-open .toast{top:76px;}
      .modal{max-height:84svh; padding:12px;}
      .inspectGrid{gap:7px;}
      .inspectPane{min-height:116px; padding:8px;}
      .inspectPane svg{height:86px;}
      .statusLine{font-size:12px; padding:9px 10px;}
      .markBtns{gap:7px;}
      .ending{padding:10px;}
      .endingBox{padding:14px;}
      .endingBadge{margin-bottom:6px;}
      .ending h2{font-size:21px; margin-bottom:6px;}
      .ending p{font-size:12px; line-height:1.45; margin-bottom:8px;}
      .ending .resultGrid{margin:8px 0;}
      .ending .shareText{min-height:56px;}
      .ending .btn{min-height:42px; padding:9px 8px;}
    }

    @media (min-width:821px){
      html,body{height:100%; overflow:hidden;}
      .app{height:100dvh; min-height:0; padding:14px; gap:14px; grid-template-columns:minmax(0,1fr) minmax(340px,360px);}
      .stage,.panel{height:calc(100dvh - 28px); min-height:0;}
      .stage{overflow:hidden;}
      .panel{overflow:hidden; gap:10px;}
      .panelTabs{display:flex; position:static; flex:0 0 auto; padding:0 0 2px; background:transparent; backdrop-filter:none;}
      .panel .card{display:none; min-height:0;}
      .panel .card.mobileActive{display:block;}
      #goalCard.mobileActive{flex:1 1 auto; overflow:auto; min-height:0;}
      #actionsCard.mobileActive{flex:0 0 auto;}
      .panel .card.mobileActive[data-section="evidence"],
      .panel .card.mobileActive[data-section="repair"],
      .panel .card.mobileActive[data-section="log"]{overflow:auto;}
      .panel .card.mobileActive[data-section="evidence"]{max-height:calc(100dvh - 120px);}
      #repairCard.mobileActive{max-height:calc(100dvh - 120px);}
      .log{height:calc(100dvh - 160px);}
      .storyPanel{gap:7px; margin-top:9px;}
      .situationBox,.nextActionBox,.whyBox{padding:8px 10px;}
      .phaseStep{min-height:38px;}
      .roomWrap{min-height:0;}
      .roomFrame{max-height:calc(100dvh - 120px); width:min(100%, calc((100dvh - 120px) * 1.6129), 1000px);}
    }

    @media (prefers-reduced-motion: reduce){*{animation:none!important; transition:none!important}}
