.ma-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 5vw, 48px); align-items: start; }
@media (min-width: 760px) { .ma-stage { grid-template-columns: minmax(0, 1fr) 280px; } }

/* 進み具合 */
.ma-steps { display: flex; gap: 6px; justify-content: center; margin: 0 0 12px; padding: 0; list-style: none; }
.ma-steps li { width: 34px; height: 6px; border-radius: 3px; background: var(--line); transition: background .3s; }
.ma-steps li.done { background: var(--ink-3); }
.ma-steps li.now { background: var(--accent); }

/* 端末（どちらのテーマでも固定色の画面） */
.ma-play { display: grid; justify-items: center; }
.ma-phone { width: min(360px, 100%); background: #0f1012; border-radius: 40px; padding: 10px; box-shadow: 0 0 0 1px rgba(128,128,128,.28), 0 40px 80px -40px rgba(0,0,0,.55); }
.ma-ph { position: relative; overflow: hidden; background: #e9eaef; color: #15161a; border-radius: 30px; min-height: 360px; display: flex; flex-direction: column; font-family: var(--font-body); transition: background .5s, color .5s; }
.ma-ph.night { background: #07080b; color: #d6d9e2; }
.ph-top { display: flex; justify-content: space-between; padding: 9px 20px 6px; font-size: .76rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ph-band { display: none; gap: 8px; padding: 0 12px 8px; font-size: .72rem; }
.ph-band.on { display: flex; }
.ph-band div { flex: 1; background: rgba(192,57,43,.14); border-radius: 10px; padding: 6px 10px; }
.ph-band b { display: block; font-size: .95rem; font-variant-numeric: tabular-nums; }
.ph-band b.bump { animation: ma-bump .35s; }
.ph-view { flex: 1; padding: 6px 14px 18px; display: flex; flex-direction: column; gap: 10px; outline: none; }
.ph-view.in > * { animation: ma-in .35s both; }

/* 画面の部品 */
.card { background: #fff; color: #15161a; border-radius: 16px; padding: 14px 16px; box-shadow: 0 6px 18px -12px rgba(0,0,0,.35); line-height: 1.7; font-size: .9rem; }
.card .from { display: flex; align-items: center; gap: 8px; font-size: .76rem; color: #5b5e68; margin-bottom: 4px; }
.card .from i { width: 22px; height: 22px; border-radius: 6px; background: #2b8a4b; display: inline-block; }
.card .url { color: #1a5fd0; text-decoration: underline; word-break: break-all; }
.ma-ph .bar { background: #fff; border-radius: 999px; padding: 7px 14px; font-size: .78rem; color: #5b5e68; font-family: var(--mono); word-break: break-all; }
.ma-ph .bar b { color: #c0392b; font-weight: 400; }
.store { display: flex; gap: 12px; align-items: center; }
.store .ic { width: 56px; height: 56px; border-radius: 14px; background: linear-gradient(135deg, #e0632b, #c03a22); flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.4rem; }
.store small { display: block; color: #5b5e68; font-size: .74rem; }
.stars { color: #d79a00; font-size: .8rem; letter-spacing: .1em; }
.perm { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.perm li { display: flex; justify-content: space-between; gap: 8px; background: #f2f3f6; border-radius: 10px; padding: 8px 12px; font-size: .84rem; }
.perm li.strong { background: #fbe4e1; font-weight: 700; }
.perm li span:last-child { color: #8a8d97; font-size: .76rem; white-space: nowrap; }
.perm li.got span:last-child { color: #c0392b; }
.os { background: #fff; border-radius: 22px; padding: 18px 18px 14px; box-shadow: 0 18px 40px -20px rgba(0,0,0,.5); font-size: .86rem; line-height: 1.7; }
.os h3 { font-size: 1rem; margin: 0 0 6px; color: #15161a; }
.os p { margin: 0 0 6px; color: #3e414a; }
.log { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: .84rem; }
.log li { background: #15171d; border: 1px solid #262a33; border-radius: 12px; padding: 9px 12px; line-height: 1.6; animation: ma-in .4s both; }
.log li time { display: block; font-family: var(--mono); font-size: .7rem; color: #f07468; }
.big-clock { font-size: 3rem; font-weight: 700; text-align: center; letter-spacing: .04em; margin: 18px 0 4px; font-variant-numeric: tabular-nums; }
.chk { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.chk li { display: flex; gap: 10px; align-items: flex-start; background: #fff; border-radius: 12px; padding: 10px 12px; font-size: .86rem; line-height: 1.6; opacity: .45; transition: opacity .3s; }
.chk li::before { content: "□"; font-weight: 700; color: #8a8d97; }
.chk li.on { opacity: 1; }
.chk li.on::before { content: "✓"; color: #1a6e51; }

/* 選ぶボタン（端末の外。大きく、片手で押せる） */
.choices { width: min(420px, 100%); display: grid; gap: 10px; margin-top: 16px; }
.choices p.q { margin: 0 0 2px; font-family: var(--font-head); font-size: 1.02rem; text-align: center; }
.choices .btn { width: 100%; min-height: 54px; font-size: 1rem; letter-spacing: .04em; padding: 12px 18px; }
.choices .btn.line { background: var(--surface); color: var(--ink); }
.choices .btn.safe { background: var(--ok); border-color: var(--ok); color: #fff; }
.shake { animation: ma-shake .4s; }

/* 結末 */
.end { width: min(560px, 100%); margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 4vw, 30px); display: none; outline: none; }
.end.on { display: block; animation: ma-in .4s both; }
.end .stamp { display: inline-block; border: 3px solid currentColor; border-radius: 10px; padding: 4px 14px; font-family: var(--font-head); font-size: 1.3rem; transform: rotate(-6deg); animation: ma-stamp .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.end.g .stamp { color: var(--ok); } .end.w .stamp { color: var(--warn); } .end.b .stamp { color: var(--danger); }
.end .big { font-family: var(--font-head); font-size: 1.25rem; margin: 14px 0 6px; }
.end p { color: var(--ink-2); font-size: .94rem; }
.score { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.score div { background: var(--bg-2); border-radius: 12px; padding: 10px; text-align: center; font-size: .74rem; color: var(--ink-3); }
.score b { display: block; font-size: 1.05rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.end ol.how { padding-left: 1.4em; margin: 8px 0 14px; font-size: .92rem; }
.end ol.how li { margin-bottom: 4px; }
.end .btns { display: flex; flex-wrap: wrap; gap: 10px; }
.end .btns .btn { min-height: 48px; }

.side { display: flex; flex-direction: column; gap: 18px; }
.state-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; }
.state-card h2 { font-family: var(--font-head); font-size: .98rem; margin-bottom: 10px; }
.state-row { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .84rem; }
.state-row:last-child { border-bottom: 0; }
.state-row dt { color: var(--ink-3); } .state-row dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.state-row.danger dd { color: var(--danger); }
.side-hint { font-size: .8rem; color: var(--ink-3); line-height: 1.8; }
@media (max-width: 759px) { .side .state-card { display: none; } }

@keyframes ma-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ma-bump { 50% { transform: scale(1.18); } }
@keyframes ma-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes ma-stamp { from { opacity: 0; transform: scale(2.2) rotate(-6deg); } to { opacity: 1; transform: scale(1) rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) {
  .ph-view.in > *, .log li, .end.on, .end .stamp, .ph-band b.bump, .shake { animation: none; }
}
/* レッスン */
.keytable { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .9rem; }
.keytable th, .keytable td { text-align: left; vertical-align: top; padding: 12px 10px; border-bottom: 1px solid var(--line); line-height: 1.7; }
.keytable th { color: var(--ink-3); font-weight: 400; font-size: .82rem; white-space: nowrap; }
.keytable thead th { color: var(--ink-2); font-weight: 700; }
.keytable .no { color: var(--danger); font-weight: 700; }
.keytable .ok { color: var(--ok); font-weight: 700; }
.keytable td.k { font-weight: 700; color: var(--ink); white-space: nowrap; }
@media (max-width: 620px) {
  .keytable, .keytable thead, .keytable tbody, .keytable tr, .keytable th, .keytable td { display: block; }
  .keytable thead { display: none; }
  .keytable tr { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
  .keytable td, .keytable th { border: 0; padding: 3px 0; }
  .keytable td.k { font-size: 1rem; margin-bottom: 4px; }
  .keytable td[data-l]::before { content: attr(data-l) "："; color: var(--ink-3); font-size: .8rem; }
}
.keys { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 720px) { .keys { grid-template-columns: 1fr 1fr; } }
.keys > div { background: var(--bg-2); padding: clamp(22px, 3vw, 30px); }
.keys h3 { font-size: 1.02rem; margin-bottom: 8px; }
.keys p { color: var(--ink-2); font-size: .92rem; }
details.more { margin-top: 20px; border-top: 1px solid var(--line); }
details.more > summary { cursor: pointer; padding: 16px 0; font-family: var(--font-head); font-size: .96rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "＋"; color: var(--ink-3); }
details.more[open] > summary::after { content: "－"; }
details.more .more-body { padding-bottom: 8px; }
details.more .more-body p { color: var(--ink-2); font-size: .88rem; }

/* 元は style 属性だった指定（CSP の style-src に 'unsafe-inline' を付けないため、ここへ移した） */
.mt-wide { margin-top: clamp(40px, 6vw, 64px); }

/* 元は malicious-app.js が style 属性で付けていた指定（CSP の style-src に 'unsafe-inline' を付けないため、ここへ移した） */
.card .desc { margin: 10px 0 0; }
.card .ask { margin: 6px 0 10px; }
.card .sub { margin: 6px 0 0; }
.card.review { font-size: .8rem; color: #5b5e68; }
.card.hit { background: #fbe4e1; }
.card .from i.bank { background: #2b5fd0; }
.card .from i.carrier { background: #8a5a10; }
p.sleep-note { text-align: center; margin: 0; font-size: .86rem; }
