/* Meishiire 3-Tier Recognition Demo (scoped strictly under #ms to prevent any CSS collision) */
#ms{
  --bg:#F8FAFC;--surface:#FFFFFF;--muted-bg:#F1F5F9;--border:#E2E8F0;--text:#0F172A;--text2:#475569;--text3:#64748B;
  --accent:#0284C7;--accent-soft:rgba(2,132,199,.12);--accent-border:rgba(2,132,199,.35);
  --gold:#B45309;--gold-soft:rgba(180,83,9,.10);--gold-line:rgba(180,83,9,.35);--phone-bg:#E2E8F0;--phone-border:#CBD5E1;
  --ok:#1E7A53;--warn:#B45309;
  --a-bg:#F8F9FA;--a-card:#FFFFFF;--a-text:#111827;--a-sub:#4B5563;--a-hint:#6B7280;--a-link:#0284C7;--a-div:#E5E7EB;
  --a-pri:#0061A4;--a-onpri:#FFFFFF;--a-surface:#FFFFFF;--a-onsv:#43474E;--a-dc:#F0F4F8;--a-dcb:#CBD5E1;
  --a-ban:#EDF3FA;--a-bans:#CBD9E8;--a-ok:#1E7A53;--a-warn:#B7791F;--a-ph:#F3F4F6;--a-ov:#C8D5E5;--a-btn:#0284C7;
  --b-ext-t:#B25E00;--b-ext-bg:#FFF4E5;--b-ext-bd:#FFE2B8;--b-loc-t:#2D7A46;--b-loc-bg:#EDF6F0;--b-loc-bd:#D1EAD8;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Hiragino Kaku Gothic ProN","Noto Sans JP","PingFang SC","PingFang TC","Microsoft YaHei","Microsoft JhengHei",sans-serif;
  line-height:1.6;background:var(--bg);color:var(--text);width:100%;max-width:none;margin:8px auto 32px;padding:24px;border-radius:20px;border:1px solid var(--border);
  box-shadow:0 12px 32px -8px rgba(15,23,42,.10);box-sizing:border-box;transition:background-color .25s,color .25s;text-align:left;
}
#ms[data-theme="dark"]{
  --bg:#1A2735;--surface:#141F2B;--muted-bg:#1C2A39;--border:#263545;--text:#F8FAFC;--text2:#CBD5E1;--text3:#94A3B8;
  --accent:#38BDF8;--accent-soft:rgba(56,189,248,.12);--accent-border:rgba(56,189,248,.35);
  --gold:#D4AF37;--gold-soft:rgba(212,175,55,.12);--gold-line:rgba(212,175,55,.35);--phone-bg:#111822;--phone-border:#283747;
  --ok:#6EE7B7;--warn:#FBBF24;
  --a-bg:#0F1216;--a-card:#1E232B;--a-text:#FFFFFF;--a-sub:#D1D5DB;--a-hint:#9CA3AF;--a-link:#38BDF8;--a-div:#374151;
  --a-pri:#9ECAFF;--a-onpri:#003258;--a-surface:#181B20;--a-onsv:#D1D5DB;--a-dc:#182330;--a-dcb:#334155;
  --a-ban:#15202D;--a-bans:#28394F;--a-ok:#4CC38A;--a-warn:#E0A94A;--a-ph:#262C36;--a-ov:#2A3A4E;--a-btn:#0284C7;
  --b-ext-t:#F0A04B;--b-ext-bg:#382A1B;--b-ext-bd:#573E20;--b-loc-t:#68D391;--b-loc-bg:#1C3325;--b-loc-bd:#285437;
  box-shadow:0 16px 36px -8px rgba(0,0,0,.5);
}
#ms *,#ms *::before,#ms *::after{box-sizing:border-box}
#ms button{font-family:inherit}

/* ---- 上部コントロール ---- */
#ms .top{display:flex;flex-wrap:wrap;gap:10px 12px;align-items:center;justify-content:space-between;padding-bottom:14px;margin-bottom:18px;border-bottom:1px solid var(--border)}
#ms .top .pills{margin-bottom:0}
#ms .ctl{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-left:auto}
#ms .btn{appearance:none;display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 10px;border-radius:6px;border:1px solid var(--border);background:var(--surface);color:var(--text2);font-size:12px;font-weight:600;cursor:pointer}
#ms .btn:hover{border-color:var(--accent);color:var(--accent)}
#ms .grid{display:grid;grid-template-columns:1.05fr .95fr;gap:28px;align-items:center}
#ms .grid > div{min-width:0}
@media (max-width:780px){#ms{padding:16px;border-radius:16px}#ms .grid{grid-template-columns:1fr;gap:22px}}
@media (max-width:480px){#ms{padding:14px}#ms .h{font-size:21px}#ms .phone{height:640px;border-radius:28px;padding:8px}}
#ms .pills{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
#ms .pill{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;border-radius:20px;padding:4px 14px;background:var(--gold-soft);color:var(--gold);border:1px solid var(--gold-line)}
#ms .h{font-size:26px;font-weight:700;line-height:1.35;margin:0 0 10px;color:var(--text)}
#ms .p{font-size:14px;line-height:1.75;color:var(--text3);margin:0 0 16px}
#ms .demo{background:var(--surface);border:1px solid var(--border);border-left:4px solid var(--gold);border-radius:8px;padding:11px 13px;margin-bottom:12px}
#ms .demo-h{font-size:12px;font-weight:700;color:var(--text2);margin-bottom:8px}
#ms .prov{display:flex;gap:5px;flex-wrap:wrap}
#ms .prov button{appearance:none;border:1px solid var(--border);background:var(--muted-bg);color:var(--text2);font-size:11.5px;font-weight:600;padding:4px 9px;border-radius:7px;cursor:pointer}
#ms .prov button.on{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}
#ms .note{font-size:11.5px;color:var(--text3);margin-top:8px;line-height:1.5}
#ms .steps{display:flex;flex-direction:column;gap:7px}
#ms .step{position:relative;overflow:hidden;display:flex;gap:11px;align-items:flex-start;text-align:left;padding:10px 12px;border-radius:8px;background:var(--surface);border:1px solid var(--border);color:var(--text);cursor:pointer}
#ms .step:hover{border-color:var(--accent)}
#ms .step.on{border-color:var(--accent);background:var(--accent-soft)}
#ms .num{width:24px;height:24px;border-radius:50%;background:var(--muted-bg);color:var(--text2);font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;flex:none;margin-top:1px}
#ms .step.on .num{background:#0284C7;color:#fff}
#ms .st-t{font-size:13.5px;font-weight:700;display:flex;gap:6px;align-items:center;flex-wrap:wrap}
#ms .tag{font-size:10px;font-weight:700;padding:1px 6px;border-radius:5px;background:var(--muted-bg);color:var(--text3);border:1px solid var(--border)}
#ms .tag.rank{background:var(--accent);color:#fff;border-color:var(--accent);font-size:11px}
#ms .tag.off{background:var(--gold-soft);color:var(--gold);border-color:var(--gold-line)}
#ms .tag.net{background:rgba(180,83,9,.12);color:var(--warn);border-color:var(--warn)}
#ms .st-d{font-size:12.5px;line-height:1.5;color:var(--text2);margin-top:2px}
#ms .bar{position:absolute;left:0;bottom:0;height:2.5px;width:0;background:var(--gold)}
#ms .step.on .bar{animation:msFill var(--dur,3200ms) linear forwards}
@keyframes msFill{to{width:100%}}

/* ---- 端末 ---- */
#ms .stage{display:flex;flex-direction:column;align-items:center}
#ms .phone{width:330px;max-width:100%;height:700px;background:var(--phone-bg);border:3px solid var(--phone-border);border-radius:34px;padding:10px;box-shadow:0 16px 36px rgba(0,0,0,.25)}
#ms .screen{position:relative;width:100%;height:100%;border-radius:24px;overflow:hidden;background:var(--a-bg);color:var(--a-text);display:flex;flex-direction:column;transition:background-color .25s;font-size:16px;user-select:auto}
#ms .sbar{height:24px;padding:5px 16px 0;display:flex;justify-content:space-between;align-items:center;font-size:10.5px;font-weight:600;flex:none}
#ms .cam{width:10px;height:10px;border-radius:50%;background:#020617}
#ms .view{flex:1;position:relative;overflow:hidden}
#ms .disc{text-align:center;font-size:12px;color:var(--text3);margin-top:12px;line-height:1.5}
#ms .home{flex:none;height:14px;display:flex;justify-content:center;align-items:center}
#ms .home span{width:90px;height:4px;border-radius:9px;background:var(--a-div)}

#ms .sc{position:absolute;inset:0;opacity:0;visibility:hidden;transition:opacity .3s,visibility .3s;background:var(--a-bg)}
#ms .sc.on{opacity:1;visibility:visible}
#ms .lyr{position:absolute;inset:0;background:var(--a-bg);overflow:hidden}

/* --- アプリ共通部品 --- */
#ms .tb{height:46px;display:flex;align-items:center;gap:14px;padding:0 14px;font-size:17px;color:var(--a-text);background:var(--a-bg);flex:none}
#ms .tb .bk{width:18px;height:18px;fill:var(--a-text);flex:none}
#ms .pg{padding:13px}
#ms .sec{font-size:12px;font-weight:700;color:var(--a-link);padding:0 0 7px;margin-top:17px}
#ms .sec:first-child{margin-top:0}
#ms .row{background:var(--a-dc);border:1.3px solid var(--a-dcb);border-radius:9px;padding:12px;margin-top:7px;position:relative}
#ms .row:first-of-type{margin-top:0}
#ms .row-flex{display:flex;align-items:center;gap:10px}
#ms .row-m{flex:1;min-width:0}
#ms .r-t{font-size:13.5px;color:var(--a-text)}
#ms .r-s{font-size:10.5px;color:var(--a-sub);margin-top:2px;line-height:1.5}
#ms .r-r{font-size:12px;font-weight:700;color:var(--a-sub);white-space:nowrap}
#ms .chev{width:14px;height:14px;fill:var(--a-sub);flex:none}
#ms .swt{width:34px;height:20px;border-radius:10px;background:var(--a-pri);position:relative;flex:none}
#ms .swt::after{content:"";position:absolute;top:3px;right:3px;width:14px;height:14px;border-radius:50%;background:var(--a-onpri)}
#ms .info{font-size:10.5px;color:var(--a-sub);line-height:1.6;margin:6px 4px 0}
#ms .banner{background:var(--a-ban);border:1px solid var(--a-bans);border-radius:9px;padding:12px;font-size:11px;line-height:1.7;color:var(--a-onsv)}
#ms .tap{position:absolute;width:44px;height:44px;margin:-22px 0 0 -22px;border-radius:50%;background:rgba(2,132,199,.4);opacity:0;pointer-events:none;z-index:20}

/* 設定画面（スクロール） */
#ms .setpg{position:absolute;left:0;right:0;top:0}
#ms .sc.on .setpg-a{animation:msFadeOut .3s 13.2s both}
#ms .sc.on .setpg-b{animation:msFadeIn .3s 13.2s both}
@keyframes msFadeIn{from{opacity:0}to{opacity:1}}
@keyframes msFadeOut{from{opacity:1}to{opacity:0}}
#ms .setpg-b{opacity:0}
#ms .swt.off{background:transparent;border:2px solid var(--a-hint)}
#ms .swt.off::after{right:auto;left:3px;top:1px;background:var(--a-hint)}
#ms .grp{padding:6px 12px}
#ms .grp .row-flex{padding:8px 0}
#ms .dv{height:1px;background:var(--a-dcb)}
#ms .dim{opacity:.4}
#ms .lk{color:var(--a-link)}
#ms .status-ok{color:var(--a-ok)}
#ms .status-warn{color:var(--a-warn)}

/* 一覧 */
#ms .mtop{height:46px;display:flex;align-items:center;gap:8px;padding:0 12px}
#ms .mtop .lg{width:24px;height:24px;border-radius:5px}
#ms .mtop .tt{flex:1;font-size:18.5px;font-weight:700;color:var(--a-text)}
#ms .mtop svg{width:19px;height:19px;fill:var(--a-text);margin:0 4px}
#ms .mrow{display:flex;align-items:center;gap:10px;background:var(--a-card);padding:10px 12px;border-bottom:1px solid var(--a-div)}
#ms .mth{width:60px;height:38px;background:#fff;border:1px solid #CBD5E1;border-radius:3px;flex:none;padding:4px;display:flex;flex-direction:column;justify-content:space-between}
#ms .mth i{display:block;height:3px;border-radius:2px;background:#2C5282;width:55%}
#ms .mth b{display:block;height:4px;border-radius:2px;background:#1A202C;width:80%}
#ms .mth u{display:block;height:2px;border-radius:2px;background:#9CA3AF;width:65%}
#ms .mn{font-size:13.5px;font-weight:700;color:var(--a-text)}
#ms .mk{font-size:10px;color:var(--a-sub)}
#ms .mc{font-size:11px;color:var(--a-sub)}
#ms .fab{position:absolute;right:14px;bottom:16px;width:48px;height:48px;border-radius:14px;background:var(--a-pri);display:flex;align-items:center;justify-content:center;box-shadow:0 4px 10px rgba(0,0,0,.3);z-index:3}
#ms .fab svg{width:24px;height:24px;fill:var(--a-onpri)}
#ms .mrow.newc{background:var(--a-card);animation:none}

/* 新規登録 */
#ms .addpg{padding:13px;position:relative}
#ms .add-t{font-size:18.5px;font-weight:700;color:var(--a-text);padding-bottom:10px}
#ms .sides{display:flex;gap:10px;margin-bottom:9px}
#ms .side{flex:1;background:var(--a-card);padding:9px}
#ms .side .st{font-size:12px;font-weight:700;margin-bottom:7px}
#ms .pv{height:70px;background:var(--a-ph);margin-bottom:7px;display:flex;align-items:center;justify-content:center;overflow:hidden}
#ms .mini{width:84%;height:80%;background:#fff;border-radius:2px;padding:3px 4px;display:flex;flex-direction:column;justify-content:space-between;color:#0F172A;box-shadow:0 1px 3px rgba(0,0,0,.3);font-size:4.5px;line-height:1.35}
#ms .mini b{font-size:6.5px}
#ms .bt{position:relative;text-align:center;border-radius:18px;padding:8px 4px;font-size:12px;font-weight:600;margin-bottom:6px}
#ms .bt.f{background:var(--a-btn);color:#fff}
#ms .bt.o{border:1px solid var(--a-ov);color:var(--a-link);margin-bottom:0}
#ms .parser{display:flex;align-items:center;gap:8px;background:var(--a-card);padding:7px 10px;margin-bottom:10px}
#ms .parser .ps{flex:1;font-size:11px;color:var(--a-sub)}
#ms .parser .pb{border:1px solid var(--a-ov);color:var(--a-link);border-radius:16px;padding:5px 9px;font-size:10px;position:relative}
#ms .fl{display:flex;gap:8px;margin-top:8px}
#ms .ed{flex:1;min-height:31px;border-bottom:1px solid var(--a-hint);font-size:12px;padding:6px 3px 3px;color:var(--a-text);line-height:1.35;min-width:0;word-break:break-all}
#ms .ed.h{color:var(--a-hint)}
#ms .ed.ml{min-height:46px}
#ms .svbtn{position:relative;margin-top:20px;background:var(--a-pri);color:var(--a-onpri);text-align:center;border-radius:20px;padding:10px;font-size:13px;font-weight:600}

/* ダイアログ */
#ms .scrim{position:absolute;inset:0;background:rgba(0,0,0,.4)}
#ms .dlg{position:absolute;left:16px;right:16px;top:50%;transform:translateY(-50%);background:var(--a-surface);border-radius:24px;padding:20px 20px 12px;box-shadow:0 10px 30px rgba(0,0,0,.35)}
#ms .d-t{font-size:15px;font-weight:700;color:var(--a-text)}
#ms .badge{display:inline-block;margin-top:9px;font-size:9.5px;font-weight:700;padding:2px 7px;border-radius:5px;border:1px solid}
#ms .badge.ext{color:var(--b-ext-t);background:var(--b-ext-bg);border-color:var(--b-ext-bd)}
#ms .badge.loc{color:var(--b-loc-t);background:var(--b-loc-bg);border-color:var(--b-loc-bd)}
#ms .stg{margin-top:10px;min-height:66px;position:relative}
#ms .stg>div{position:absolute;left:0;right:0;top:0}
#ms .stg .s-t{font-size:12px;font-weight:700;color:var(--a-pri)}
#ms .stg .s-d{font-size:10.5px;color:var(--a-sub);margin-top:3px;line-height:1.55}
#ms .prog{height:4px;border-radius:2px;background:var(--a-div);overflow:hidden;position:relative;margin-top:6px}
#ms .prog i{position:absolute;top:0;bottom:0;width:40%;background:var(--a-pri);border-radius:2px;animation:msInd 1.3s ease-in-out infinite}
@keyframes msInd{0%{left:-40%}100%{left:100%}}
#ms .d-act{text-align:right;font-size:12px;color:var(--a-sub);padding:10px 4px 2px}
#ms .sc.on .st1{animation:msFadeOut .25s 1.7s both}
#ms .sc.on .st2,#ms .sc.on .bdg{opacity:0;animation:msFadeIn .25s 1.8s both}
#ms .bdg-wrap{min-height:24px}

/* 比較ダイアログ */
#ms .cdlg{position:absolute;left:10px;right:10px;top:46px;background:var(--a-surface);border-radius:14px;padding:16px 8px 8px;box-shadow:0 10px 30px rgba(0,0,0,.4);opacity:0}
#ms .sc.on .cdlg{animation:msFadeIn .25s 2.9s both}
#ms .cd-t{font-size:15px;font-weight:700;color:var(--a-text);padding:0 10px 8px}
#ms .ct{width:100%;border-collapse:collapse;font-size:10px}
#ms .ct td,#ms .ct th{padding:7px 5px;text-align:left;vertical-align:top;line-height:1.35;word-break:break-all}
#ms .ct th{font-size:10.5px;font-weight:700;color:var(--a-text)}
#ms .ct .df{color:var(--a-text)}
#ms .ct .nd{color:var(--a-sub)}
#ms .ct .sel{color:var(--a-link);font-weight:700}
#ms .cd-act{display:flex;gap:2px;justify-content:flex-end;align-items:center;font-size:10.5px;font-weight:700;color:var(--a-link);padding:8px 4px 2px;flex-wrap:wrap}
#ms .cd-act span{padding:4px 6px;position:relative}
#ms .ct .ck1,#ms .ct .ck2{display:none}
#ms .ct .ck1 .p1,#ms .ct .ck2 .p2{display:inline}
#ms .sc.on .p-a{animation:msPA 8.2s both}
#ms .sc.on .p-b{animation:msPB 8.2s both}
@keyframes msPA{0%,55%{color:var(--a-link);font-weight:700}56%,100%{color:var(--a-sub);font-weight:400}}
@keyframes msPB{0%,55%{color:var(--a-sub);font-weight:400}56%,100%{color:var(--a-link);font-weight:700}}
#ms .m1,#ms .m2{display:inline}
#ms .cdlg-hide{animation:msFadeOut .25s 5.9s both}

/* 場面 1: 一覧 → 新規登録 → スキャナ */
#ms .sc.on .lst-hide{animation:msFadeOut .3s 1.6s both}
#ms .new-l{opacity:0}
#ms .sc.on .new-l{animation:msFadeIn .3s 1.5s both}
#ms .cam-l{opacity:0;background:radial-gradient(120% 90% at 50% 40%,#1E293B 0%,#0B1220 70%);color:#F8FAFC;display:flex;flex-direction:column;justify-content:space-between;padding:12px;z-index:6}
#ms .sc.on .cam-l{animation:msFadeIn .3s 3.6s both}
#ms .tapA{right:36px;bottom:40px;top:auto;left:auto;margin:0}
#ms .sc.on .tapA{animation:msTapA 1.2s ease-out .4s both}
@keyframes msTapA{0%{opacity:0;transform:translate(-40px,-70px) scale(.5)}40%{opacity:.9;transform:none}60%{opacity:.9;transform:scale(.75)}100%{opacity:0;transform:scale(1.5)}}
#ms .sc.on .fab{animation:msFabP 1.2s .4s both}
@keyframes msFabP{0%,45%{transform:scale(1)}55%{transform:scale(.88)}70%,100%{transform:scale(1)}}
#ms .tapB{opacity:0}
#ms .sc.on .tapB{animation:msTapB 1.2s 2.3s ease-out both}
@keyframes msTapB{0%{opacity:0;transform:translate(30px,40px) scale(.5)}40%{opacity:.9;transform:none}60%{opacity:.9;transform:scale(.75)}100%{opacity:0;transform:scale(1.4)}}
#ms .cam-hint{align-self:center;font-size:11px;font-weight:600;background:rgba(15,23,42,.75);border:1px solid rgba(148,163,184,.3);padding:4px 11px;border-radius:999px}
#ms .det-lbl{position:relative;align-self:center;height:24px;min-width:200px;font-size:11px;font-weight:700}
#ms .det-lbl span{position:absolute;left:50%;top:0;transform:translateX(-50%);white-space:nowrap;display:flex;gap:6px;align-items:center;padding:4px 12px;border-radius:999px;background:rgba(15,23,42,.8);border:1px solid rgba(148,163,184,.35);color:#E2E8F0}
#ms .det-lbl .l2{color:#4FD1C5;border-color:#4FD1C5;opacity:0}
#ms .sc.on .det-lbl .l1{animation:msL1 3.2s 3.8s both}
#ms .sc.on .det-lbl .l2{animation:msL2 3.2s 3.8s both}
@keyframes msL1{0%,30%{opacity:1}36%,100%{opacity:0}}
@keyframes msL2{0%,32%{opacity:0}40%,100%{opacity:1}}
#ms .dots2{width:8px;height:8px;border-radius:50%;border:2px solid #94A3B8;border-top-color:transparent;animation:msSpin .8s linear infinite;display:inline-block}
@keyframes msSpin{to{transform:rotate(360deg)}}
#ms .cam-frame{position:relative;width:100%;aspect-ratio:1.62/1;margin:auto 0;padding:10px;perspective:700px}
#ms .tilt{position:relative;width:100%;height:100%;transform:rotateX(16deg) rotateZ(-6deg) translateX(8px) scale(.9)}
#ms .sc.on .tilt{animation:msTilt 3.2s ease-in-out 3.8s both}
@keyframes msTilt{0%,40%{transform:rotateX(16deg) rotateZ(-6deg) translateX(8px) scale(.9)}68%,100%{transform:none}}
#ms .biz{width:100%;height:100%;background:#fff;color:#0F172A;border-radius:4px;padding:11px 12px;position:relative;overflow:hidden;box-shadow:0 10px 24px rgba(0,0,0,.55)}
#ms .biz-in{height:100%;display:flex;flex-direction:column;justify-content:space-between}
#ms .biz-top{display:flex;justify-content:space-between;align-items:flex-start}
#ms .biz-co{font-size:9.5px;font-weight:700;color:#2C5282}
#ms .biz-dept{font-size:8px;color:#4B5563}
#ms .biz-name{font-size:15px;font-weight:700;letter-spacing:.08em;margin-top:1px}
#ms .biz-name.latin{letter-spacing:.02em}
#ms .biz-kana{font-size:7.5px;color:#718096;letter-spacing:.1em}
#ms .biz-en{font-size:7.5px;color:#718096;text-align:right;line-height:1.4}
#ms .biz-meta{font-size:7.6px;line-height:1.5;color:#334155;border-top:1px solid #E2E8F0;padding-top:4px}
#ms .beam{position:absolute;left:0;right:0;height:2px;top:0;opacity:0;z-index:2;background:linear-gradient(90deg,transparent,#14B8A6,#5EEAD4,#14B8A6,transparent);box-shadow:0 0 12px 2px rgba(20,184,166,.7)}
#ms .sc.on .beam{animation:msSweep 3.2s ease-in-out 3.8s both}
@keyframes msSweep{0%,62%{top:2%;opacity:0}68%{opacity:1}88%{top:96%;opacity:1}94%,100%{top:96%;opacity:0}}
#ms .detect{position:absolute;inset:-18px;border:2px dashed rgba(148,163,184,.8);border-radius:8px;pointer-events:none;opacity:.7}
#ms .sc.on .detect{animation:msDet 3.2s ease-in-out 3.8s both}
@keyframes msDet{0%{inset:-22px;opacity:.2;border-style:dashed;border-color:rgba(148,163,184,.8);background:transparent}14%{inset:-12px;opacity:.85}24%{inset:-16px;opacity:.85}34%{inset:0;opacity:1;border-style:solid;border-color:#4FD1C5;background:rgba(79,209,197,.14);box-shadow:0 0 14px rgba(79,209,197,.6)}40%,100%{inset:0;opacity:1;border-style:solid;border-color:#4FD1C5;background:rgba(79,209,197,.10);box-shadow:0 0 14px rgba(79,209,197,.5)}}
#ms .dh{position:absolute;width:11px;height:11px;border-radius:50%;background:#4FD1C5;border:2px solid #0B1220;opacity:0}
#ms .dh.a{top:-6px;left:-6px}
#ms .dh.b{top:-6px;right:-6px}
#ms .dh.c{bottom:-6px;left:-6px}
#ms .dh.d{bottom:-6px;right:-6px}
#ms .sc.on .dh{animation:msDh 3.2s ease-in-out 3.8s both}
@keyframes msDh{0%,28%{opacity:0;transform:scale(.4)}36%{opacity:1;transform:scale(1.5)}46%,100%{opacity:1;transform:scale(1)}}
#ms .flash{position:absolute;inset:0;background:#fff;opacity:0;pointer-events:none}
#ms .sc.on .flash{animation:msFlash 3.2s 3.8s both}
@keyframes msFlash{0%,86%{opacity:0}90%{opacity:.75}100%{opacity:0}}
#ms .shut{align-self:center;width:46px;height:46px;border-radius:50%;border:3px solid #fff;padding:3px;margin-bottom:4px}
#ms .shut i{display:block;width:100%;height:100%;border-radius:50%;background:#38BDF8}
#ms .sc.on .shut i{animation:msShut2 3.2s 3.8s both}
@keyframes msShut2{0%,84%{transform:scale(1);background:#38BDF8}90%{transform:scale(.8);background:#fff}100%{transform:scale(1);background:#38BDF8}}

/* 場面 5：結果・比較・保存の外側遷移 */
#ms .sc.on .res-lst{opacity:0;animation:msFadeIn .3s 7.4s both}
@media (prefers-reduced-motion:reduce){#ms *{animation-duration:.01ms!important;animation-delay:0s!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
