.ri-stage { display: grid; gap: clamp(36px, 5vw, 48px); align-items: start; }
/* iPad の縦向きから、図と設定画面を左右に並べる */
@media (min-width: 760px) { .ri-stage { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.ri-left { min-width: 0; --netH: 440px; }
/* 左右に並ぶときは、設定を変えながら図を見られるように、図の側を画面に留める */
@media (min-width: 760px) and (min-height: 700px) { .ri-left { position: sticky; top: 80px; } }

/* ネットワークの図（夜空の固定色） */
.net { position: relative; height: var(--netH); border-radius: 18px; overflow: hidden; color: #e8edf5; background: linear-gradient(180deg, #23314f 0%, #18233b 45%, #121a2c 100%); box-shadow: 0 40px 80px -44px rgba(0, 0, 0, .55); transition: background .8s; isolation: isolate; }
.net::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 1.2s; background-image: radial-gradient(1.2px 1.2px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 27% 8%, #fff, transparent), radial-gradient(1.4px 1.4px at 46% 14%, #fff, transparent), radial-gradient(1px 1px at 63% 6%, #fff, transparent), radial-gradient(1.2px 1.2px at 78% 17%, #fff, transparent), radial-gradient(1px 1px at 91% 9%, #fff, transparent), radial-gradient(1px 1px at 36% 24%, #fff, transparent), radial-gradient(1px 1px at 70% 26%, #fff, transparent); }
.net.night { background: linear-gradient(180deg, #0c1222 0%, #0a0f1c 55%, #080c17 100%); }
.net.night::before { opacity: .85; animation: twinkle 3.2s ease-in-out infinite alternate; }
.net.dawn { background: linear-gradient(180deg, #1d2a48 0%, #2c3554 55%, #6a4a4a 100%); }
.net.dawn::before { opacity: .25; }
@keyframes twinkle { to { opacity: .5; } }
.n-inet { position: absolute; left: 0; right: 0; top: 0; height: 21%; border-bottom: 1px dashed rgba(255, 255, 255, .16); background: linear-gradient(180deg, rgba(255, 181, 71, .09), transparent); }
.n-tag { position: absolute; font-size: .75rem; letter-spacing: .14em; color: rgba(232, 237, 245, .62); line-height: 1; white-space: nowrap; }
.n-inet .n-tag { left: 14px; bottom: 8px; }
.n-house { position: absolute; left: 3%; right: 3%; top: 34%; bottom: 3%; border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px; background: rgba(255, 255, 255, .025); }
.n-house .n-tag { left: 12px; top: 10px; }
.n-guest { position: absolute; left: 60%; right: 5%; top: 36.2%; bottom: 4.5%; border: 1.5px dashed #74b9ff; border-radius: 14px; background: rgba(116, 185, 255, .06); opacity: 0; transform: scale(.97); transition: opacity .5s, transform .5s; }
.n-guest.on { opacity: 1; transform: none; }
.n-guest .n-tag { right: 10px; top: 9px; color: #9fcfff; }
.n-clock { position: absolute; right: 14px; bottom: calc(79% + 8px); font-family: var(--mono); font-size: .8rem; color: rgba(232, 237, 245, .8); display: flex; align-items: center; gap: 6px; }
.n-clock svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.n-links { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.n-links line { stroke: rgba(232, 237, 245, .22); stroke-width: 1.4; transition: stroke .4s; }
.n-links line.up { stroke-dasharray: 3 4; }
.n-links line.g { stroke: #74b9ff; stroke-dasharray: 5 4; stroke-opacity: .75; }
.n-links line.bad { stroke: #ff6b6b; stroke-opacity: .85; stroke-dasharray: 4 4; }

.node { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 5px; width: 80px; text-align: center; z-index: 2; }
.node .ic { position: relative; width: 46px; height: 46px; border-radius: 14px; background: #2a3550; border: 1px solid rgba(255, 255, 255, .2); display: grid; place-items: center; color: #e8edf5; transition: background .35s, border-color .35s, box-shadow .35s, color .35s; }
.node .ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.node .lb { font-size: .75rem; line-height: 1.35; color: #c9d3e3; white-space: nowrap; letter-spacing: .04em; }
.node .lb small { display: block; font-family: var(--mono); font-size: .75rem; color: rgba(201, 211, 227, .7); letter-spacing: 0; }
.node .bd { position: absolute; top: -9px; left: 50%; margin-left: 10px; font-size: .75rem; font-weight: 700; line-height: 1.6; white-space: nowrap; background: #c9353b; color: #fff; border-radius: 99px; padding: 0 7px; display: none; }
.node.owned .ic { background: #532f44; border-color: #ff6b6b; color: #ffe1e1; box-shadow: 0 0 0 5px rgba(229, 72, 77, .16), 0 0 22px rgba(229, 72, 77, .45); }
.node.owned .bd, .node.leak .bd { display: block; }
.node[data-n="cam"] .bd, .node[data-n="spk"] .bd { left: auto; right: 50%; margin: 0 10px 0 0; }
.node.router .bd { top: -12px; margin-left: 0; transform: translateX(-50%); }
.node.leak .bd { background: #9a5800; }
.node.blk .ic { border-color: #4cd1a0; box-shadow: 0 0 0 5px rgba(76, 209, 160, .18), 0 0 20px rgba(76, 209, 160, .4); }
.node.router .ic { width: 64px; height: 64px; border-radius: 18px; background: #333f5c; }
.node.router.owned .ic { background: #532f44; }
.node.router .ic svg { width: 32px; height: 32px; }
.node.router .lb { font-weight: 700; color: #fff; }
.node.scan { width: 60px; }
.node.scan .ic { width: 34px; height: 34px; border-radius: 50%; color: #ffc46b; border-color: rgba(255, 196, 107, .45); background: #393e4e; }
.node.scan .ic svg { width: 18px; height: 18px; }
.node.scan .lb { font-family: var(--mono); font-size: .75rem; color: rgba(255, 196, 107, .8); }
.node.car { flex-direction: row; width: auto; gap: 8px; opacity: 0; transform: translate(-50%, -50%) translateX(-14px); transition: opacity .5s, transform .6s cubic-bezier(.2, .8, .2, 1); }
.node.car.show { opacity: 1; transform: translate(-50%, -50%); }
.node.car .ic { color: #ffc46b; border-color: rgba(255, 196, 107, .5); background: #393e4e; }
.node.car.owned .ic { background: #532f44; }
.node.car .bd { left: 0; margin-left: 30px; }

.node[data-n="s1"] { --x: 12%; --y: 9.5%; } .node[data-n="s2"] { --x: 31%; --y: 9.5%; } .node[data-n="s3"] { --x: 50%; --y: 9.5%; } .node[data-n="s4"] { --x: 69%; --y: 9.5%; } .node[data-n="s5"] { --x: 88%; --y: 9.5%; }
.node[data-n="router"] { --x: 50%; --y: 53%; }
.node[data-n="pc"] { --x: 17%; --y: 52%; } .node[data-n="ph1"] { --x: 14%; --y: 80%; } .node[data-n="ph2"] { --x: 31%; --y: 88%; } .node[data-n="nas"] { --x: 49%; --y: 86%; }
.node[data-n="cam"] { --x: 83%; --y: 52%; } .node[data-n="spk"] { --x: 86%; --y: 80%; } .node[data-n="game"] { --x: 69%; --y: 85%; }
.node[data-n="car"] { --x: 76%; --y: 27.5%; }
.pk { position: absolute; left: 0; top: 0; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #ffc46b; box-shadow: 0 0 10px 2px rgba(255, 196, 107, .7); z-index: 3; pointer-events: none; }
.pk.red { background: #ff6b6b; box-shadow: 0 0 10px 2px rgba(255, 107, 107, .7); }
.pk.dim { width: 6px; height: 6px; margin: -3px 0 0 -3px; opacity: .7; }
.rp { position: absolute; width: 74px; height: 74px; margin: -37px 0 0 -37px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); z-index: 1; pointer-events: none; animation: rp .75s ease-out forwards; }
.rp.ok { border-color: #4cd1a0; } .rp.ng { border-color: #ff6b6b; } .rp.soft { width: 40px; height: 40px; margin: -20px 0 0 -20px; border-width: 1px; }
@keyframes rp { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
@media (max-width: 600px), (max-height: 500px) and (orientation: landscape) {
  /* スマートフォンでは、図と、夜の記録の最新の行が、同じ画面に収まる高さにする */
  .ri-left { --netH: 400px; }
  .node { width: 64px; gap: 3px; }
  .node .ic { width: 38px; height: 38px; border-radius: 11px; }
  .node .ic svg { width: 20px; height: 20px; }
  .node.router .ic { width: 50px; height: 50px; border-radius: 15px; }
  .node.router .ic svg { width: 26px; height: 26px; }
  .node .lb { font-size: 12px; letter-spacing: 0; line-height: 1.25; }
  .node .bd { font-size: 12px; padding: 0 6px; }
  .node .lb small, .node.scan .lb { display: none; }
  .node.scan .ic { width: 28px; height: 28px; }
  .node.scan .ic svg { width: 15px; height: 15px; }
  .n-inet { height: 22%; }
  .n-inet .n-tag { left: 12px; bottom: 7px; }
  .n-clock { right: 12px; bottom: calc(78% + 7px); line-height: 1; font-size: .75rem; }
  .n-house .n-tag { left: 10px; top: 7px; }
  .node[data-n="s1"] { --x: 10%; --y: 8%; } .node[data-n="s2"] { --x: 30%; --y: 8%; } .node[data-n="s3"] { --x: 50%; --y: 8%; } .node[data-n="s4"] { --x: 70%; --y: 8%; } .node[data-n="s5"] { --x: 90%; --y: 8%; }
  .node[data-n="router"] { --y: 55%; }
  .node[data-n="pc"] { --x: 15%; --y: 55%; } .node[data-n="ph1"] { --x: 13%; --y: 77%; } .node[data-n="ph2"] { --x: 30%; --y: 86.5%; } .node[data-n="nas"] { --x: 49%; --y: 80%; }
  .node[data-n="cam"] { --x: 85%; --y: 55%; } .node[data-n="spk"] { --x: 86%; --y: 77%; } .node[data-n="game"] { --x: 70%; --y: 86.5%; }
  .node[data-n="car"] { --x: 76%; --y: 29.5%; }
  .node.router .bd { top: -26px; transform: translateX(-60%); }
  .n-guest { left: 60%; right: 4%; top: 35.8%; bottom: 4%; }
  .n-guest .n-tag { right: 8px; top: 6px; letter-spacing: 0; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .node[data-n="pc"] { --x: 18%; } .node[data-n="ph1"] { --x: 8%; --y: 82%; } .node[data-n="ph2"] { --x: 26%; --y: 82%; } .node[data-n="nas"] { --x: 38%; --y: 84%; }
  .node[data-n="cam"] { --x: 86%; } .node[data-n="spk"] { --x: 90%; --y: 80%; } .node[data-n="game"] { --x: 72%; --y: 82%; }
  .n-guest .n-tag { left: 8px; right: auto; }
}
@supports (height: 100svh) {
  @media (max-width: 600px) { .ri-left { --netH: clamp(300px, calc(100svh - 330px), 400px); } }
  /* 横向きのスマートフォンでは、図が画面の高さに収まるようにする */
  @media (max-height: 500px) and (orientation: landscape) { .ri-left { --netH: clamp(260px, calc(100svh - 96px), 400px); } }
}

/* 夜の操作と記録 */
.n-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 22px; }
.n-bar .btn { min-height: 48px; }
@media (max-width: 600px) {
  .n-bar { margin-top: 16px; gap: 10px 12px; }
  .n-bar .btn { padding-left: 22px; padding-right: 22px; }
  /* 夜のあいだは設定を変えられないため、件数の表示を省いて記録を広く見せる */
  .n-bar:has(#skip:not(.hidden)) .n-score { display: none; }
  /* 夜のあいだは二つのボタンを一行に収め、記録の見える高さを確保する（狭い画面では長いほうのボタンの文字を二行にする） */
  .n-bar:has(#skip:not(.hidden)) { flex-wrap: nowrap; }
  .n-bar:has(#skip:not(.hidden)) .btn { padding: 6px 14px; line-height: 1.35; letter-spacing: .02em; }
  .n-bar:has(#skip:not(.hidden)) #night { flex: 0 1 auto; min-width: 0; white-space: normal; text-wrap: balance; }
  .n-bar:has(#skip:not(.hidden)) #skip { flex: none; }
}
.n-bar .btn[aria-disabled="true"] { opacity: .5; cursor: progress; transform: none; box-shadow: none; }
.n-score { font-family: var(--mono); font-size: .84rem; color: var(--ink-2); margin-left: auto; }
.n-score b { color: var(--ink); font-weight: 400; }
.n-log { list-style: none; margin: 18px 0 0; padding: 0; max-height: 300px; overflow-y: auto; border-top: 1px solid var(--line); scrollbar-width: thin; }
/* 図を画面の上端に合わせたとき、記録の最新の行が画面の下に隠れない高さにする */
@supports (height: 100svh) { .n-log { max-height: clamp(150px, calc(100svh - var(--netH) - 196px), 300px); } }
.n-log:empty { display: none; }
@media (max-width: 600px) { .n-log { margin-top: 14px; } }
/* 小さなスマートフォンでも、記録の最新の行が画面の下に隠れないようにする */
@supports (height: 100svh) { @media (max-width: 600px) { .n-log { max-height: clamp(96px, calc(100svh - var(--netH) - 172px), 300px); } } }
.n-log li { display: grid; grid-template-columns: 3.2em 1fr; gap: 10px; margin: 0; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: .875rem; line-height: 1.8; animation: logIn .4s cubic-bezier(.2, .8, .2, 1) both; }
.n-log time { font-family: var(--mono); font-size: .78rem; color: var(--ink-3); padding-top: 1px; }
.n-log .tg { display: inline-block; font-size: .75rem; font-weight: 700; border-radius: 99px; padding: 0 8px; margin-left: 6px; line-height: 1.7; white-space: nowrap; vertical-align: 1px; }
.n-log .tg { border: 1px solid currentColor; }
.n-log .ok .tg { color: var(--ok); }
.n-log .ng .tg { color: var(--danger); }
.n-log li.ng { color: var(--ink); }
.n-log li.ok, .n-log li.info { color: var(--ink-2); }
@keyframes logIn { from { opacity: 0; transform: translateY(6px); } }

.room { position: absolute; inset: 0; }
.room .wall { position: absolute; inset: 0 0 32% 0; background: linear-gradient(180deg, #4a4339, #3b352d); }
.room .floor { position: absolute; inset: 68% 0 0 0; background: linear-gradient(180deg, #5a4a3a, #3e3226); }
.room .win { position: absolute; left: 10%; top: 12%; width: 22%; height: 40%; background: linear-gradient(180deg, #1c2a44, #2d3f61); border: 3px solid #6a5f51; }
.room .sofa { position: absolute; left: 42%; bottom: 20%; width: 42%; height: 24%; background: #6b4e3a; border-radius: 10px 10px 4px 4px; box-shadow: inset 0 10px 0 #7a5a43; }
.room .lamp { position: absolute; right: 8%; top: 18%; width: 10%; height: 14%; background: radial-gradient(circle at 50% 70%, #ffd98a, #c99a3e 70%); border-radius: 40% 40% 6px 6px; box-shadow: 0 0 40px 10px rgba(255, 210, 120, .25); }
.room .tbl { position: absolute; left: 22%; bottom: 14%; width: 16%; height: 6%; background: #7c6450; border-radius: 3px; }
.room::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 3px); }
.c-osd { position: absolute; left: 10px; top: 8px; right: 10px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: .75rem; color: #fff; text-shadow: 0 1px 2px #000; }
.c-osd .live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ff4d4d; margin-right: 6px; vertical-align: 0; }
.c-view-n { position: absolute; right: 10px; bottom: 8px; font-size: .75rem; color: #fff; background: rgba(200, 30, 30, .85); border-radius: 99px; padding: 0 8px; }

/* 朝の報告 */
.ri-result { margin-top: clamp(48px, 7vw, 72px); }
.ri-result:empty { display: none; }
.ri-result .big { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.4rem, 3vw, 1.85rem); line-height: 1.5; margin: 0 0 12px; }
.ri-result .big:focus { outline: none; }
.ri-result.good .big { color: var(--ok); }
.ri-result.bad .big { color: var(--danger); }
.ri-result > p { color: var(--ink-2); max-width: var(--text); }
.harms { display: grid; gap: 20px; margin-top: 32px; grid-auto-flow: row dense; }
@media (min-width: 760px) { .harms { grid-template-columns: 1fr 1fr; } }
.hc { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; animation: logIn .5s cubic-bezier(.2, .8, .2, 1) both; }
.hc.wide { grid-column: 1 / -1; }
.hv { background: #0f1626; color: #e8edf5; padding: 18px; display: grid; place-items: center; min-height: 170px; }
.ht { padding: 18px 20px 20px; }
.ht h3 { font-family: var(--font-head); font-size: 1.02rem; margin: 0 0 6px; line-height: 1.5; }
.ht p { margin: 0; font-size: .88rem; color: var(--ink-2); }
.mb { width: min(100%, 320px); background: #fff; color: #222; border-radius: 10px; overflow: hidden; font-size: .75rem; }
.mb-bar { display: flex; align-items: center; gap: 6px; background: #eef0f3; padding: 6px 10px; font-family: var(--mono); font-size: .75rem; white-space: nowrap; overflow: hidden; }
.mb-bar .ns { color: #b42318; font-family: var(--font-body); font-weight: 700; flex: none; }
.mb-bar .u { overflow: hidden; text-overflow: ellipsis; }
.mb-body { padding: 12px 14px 14px; display: grid; gap: 7px; }
.mb-body b { font-family: var(--font-head); color: #0c6b58; font-size: .86rem; letter-spacing: .06em; }
.mb-body i { display: block; min-height: 24px; border: 1px solid #d5d9de; border-radius: 6px; font-style: normal; font-size: .75rem; color: #6b7480; padding: 2px 8px; }
.mb-body span { display: block; text-align: center; background: #0c6b58; color: #fff; border-radius: 6px; padding: 3px; font-weight: 700; }
.mb-ip { border-top: 1px dashed #d5d9de; padding: 7px 12px; font-family: var(--mono); font-size: .75rem; color: #b42318; background: #fff6f5; }
.relay { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.relay .rn { display: grid; justify-items: center; gap: 4px; font-size: .78rem; text-align: center; min-width: 70px; }
.relay .rn svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.relay .rn.me { color: #ff8f8f; }
.relay .rn small { font-family: var(--mono); font-size: .75rem; color: #9aa6b8; }
.relay .ar { color: #ff8f8f; font-family: var(--mono); letter-spacing: -.1em; }
.relay .vpn { flex-basis: 100%; text-align: center; font-family: var(--mono); font-size: .75rem; color: #ffc46b; }
.feed { width: min(100%, 320px); position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; }
.wmap { width: 100%; max-width: 640px; height: auto; display: block; }
.wmap .land { fill: rgba(232, 237, 245, .2); }
.wmap .bot { fill: #ff6b6b; }
.wmap .bot.me { fill: #ffc46b; }
.wmap .arc { fill: none; stroke: #ff6b6b; stroke-width: 1; stroke-opacity: .45; stroke-dasharray: 4 5; animation: flow 1.2s linear infinite; }
.wmap .arc.me { stroke: #ffc46b; stroke-width: 2; stroke-opacity: 1; }
.wmap .tgt { fill: #fff; }
.wmap .tgt-r { fill: none; stroke: #ff6b6b; stroke-width: 1.5; animation: pulse 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.wmap text { font-family: var(--font-body); font-size: 12px; fill: #e8edf5; }
/* 地図は縮めて表示するため、狭い画面では文字を大きく描き、表示上 12px 以上にする */
@media (max-width: 600px) { .wmap text { font-size: 24px; } }
@media (max-width: 359px) { .wmap text { font-size: 30px; } }
@media (max-width: 600px) { .hv { padding: 14px; } .relay .vpn { text-wrap: balance; } }
@media (max-width: 400px) { .relay { gap: 4px; } .relay .rn { min-width: 0; } }
.wmap text.me { fill: #ffc46b; font-weight: 700; }
@keyframes flow { to { stroke-dashoffset: -18; } }
@keyframes pulse { from { transform: scale(.5); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
.lst { width: min(100%, 300px); background: #fff; color: #1f2a37; border-radius: 10px; padding: 10px 12px; font-size: .75rem; }
.lst div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px solid #edf0f4; font-family: var(--mono); }
.lst div:first-child { border-top: 0; font-family: var(--font-body); font-weight: 700; color: #5b6675; }
.lst div.x { color: #b42318; background: #fff1ef; margin: 0 -6px; padding: 4px 6px; border-radius: 6px; }
.pkts { display: grid; gap: 6px; width: min(100%, 300px); font-family: var(--mono); font-size: .75rem; }
.pkts div { display: flex; gap: 4px; }
.pkts i { flex: 1; height: 20px; border-radius: 3px; background: rgba(232, 237, 245, .14); }
.pkts i.r { flex: 3; background: rgba(255, 196, 107, .2); color: #ffc46b; font-style: normal; padding: 0 6px; line-height: 20px; white-space: nowrap; overflow: hidden; }
.folders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(100%, 300px); font-size: .75rem; text-align: center; color: #c9d3e3; }
.folders div { display: grid; justify-items: center; gap: 4px; }
.folders svg { width: 34px; height: 28px; }
.folders .x svg path { fill: rgba(255, 107, 107, .35); stroke: #ff6b6b; }
.chk-h { font-family: var(--font-head); font-size: 1.1rem; margin: 48px 0 6px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.chk-h b { font-family: var(--mono); font-weight: 400; font-size: .95rem; color: var(--ink-2); }
.chk { list-style: none; margin: 14px 0 0; padding: 0; }
.chk li { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; margin: 0; padding: 14px 0; border-top: 1px solid var(--line); }
.chk li:last-child { border-bottom: 1px solid var(--line); }
.chk .mk { font-family: var(--mono); font-size: .9rem; color: var(--ink-3); }
.chk li.done .mk { color: var(--ok); }
.chk .nm { font-weight: 700; font-size: .94rem; }
/* 設定の状態（「分けた」など）は、途中で折り返さず、一まとまりで次の行に送る */
.chk .nm + .muted { display: inline-block; }
.chk .why { grid-column: 2 / -1; font-size: .84rem; color: var(--ink-2); line-height: 1.8; }
.chk .ef { font-size: .75rem; border-radius: 99px; padding: 1px 10px; white-space: nowrap; border: 1px solid var(--line); color: var(--ink-3); }
.chk .ef.stop { color: var(--ok); border-color: currentColor; }
.chk .ef.hole { color: var(--danger); border-color: currentColor; }
@media (max-width: 560px) { .chk li { grid-template-columns: 1.6em minmax(0, 1fr); } .chk .ef { grid-column: 2; justify-self: start; } }
.ri-result .btns .textlink { margin-left: 6px; align-self: center; font-size: .88rem; min-height: 44px; }

/* 今夜までの備え（五つのカード） */
.fx-h { font-family: var(--font-head); font-size: 1.15rem; margin: 0 0 4px; }
.fx-list { display: grid; gap: 12px; margin-top: 12px; }
.fx { appearance: none; width: 100%; text-align: left; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 14px; align-items: center; padding: 14px 16px; min-height: 88px; border-radius: 16px; border: 2px solid var(--line); background: var(--bg-2); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .2s, background .2s, transform .15s; -webkit-tap-highlight-color: transparent; }
.fx:active { transform: scale(.98); }
.fx:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.fx .fi { grid-row: span 2; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; background: var(--bg); border: 1px solid var(--line); }
.fx .ft { font-weight: 700; font-size: 1.02rem; line-height: 1.5; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.fx .fs { font-size: .75rem; white-space: nowrap; border-radius: 99px; padding: 2px 10px; border: 1px solid var(--line); color: var(--ink-2); font-weight: 700; }
.fx .fd { font-size: .86rem; line-height: 1.7; color: var(--ink-2); }
.fx .fd .on, .fx[aria-checked="true"] .fd .off { display: none; }
.fx[aria-checked="true"] .fd .on { display: inline; }
.fx[aria-checked="true"] { border-color: var(--ok); background: var(--ok-soft); }
.fx[aria-checked="true"] .fs { color: var(--ok); border-color: currentColor; }
.fx[aria-checked="true"] .fi { animation: fxPop .4s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes fxPop { 40% { transform: scale(1.25) rotate(-6deg); } }
.fx-wrap.busy { opacity: .55; pointer-events: none; }
/* 朝の評価 */
.ri-rate { display: grid; gap: 10px; justify-items: start; margin: 18px 0 8px; padding: 18px 20px; border-radius: 16px; border: 2px solid currentColor; animation: rateIn .5s cubic-bezier(.3, 1.5, .5, 1); }
.ri-result.good .ri-rate { color: var(--ok); }
.ri-result.bad .ri-rate { color: var(--danger); }
.ri-rate .st { font-size: 2rem; letter-spacing: .12em; line-height: 1; }
.ri-rate .lb { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; }
.ri-rate .nums { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--ink); }
.ri-rate .nums b { font-family: var(--mono); font-size: 1.5rem; font-weight: 400; margin-right: 4px; }
@keyframes rateIn { from { opacity: 0; transform: scale(1.3) rotate(-4deg); } }

/* 図の下の「夜を迎える」が画面の外にあるあいだ、設定画面の下に、見直した数と夜へ進むボタンを浮かべる */
.ri-dock { position: fixed; z-index: 50; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-width: 480px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 7px 7px 20px; border-radius: 999px; background: #17191d; color: #f4f2ec; border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .6); visibility: hidden; opacity: 0; transform: translateY(24px); transition: opacity .25s, transform .35s cubic-bezier(.2, .8, .2, 1), visibility 0s .35s; }
.ri-dock.on { visibility: visible; opacity: 1; transform: none; transition: opacity .25s, transform .35s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.ri-dock .d-score { font-family: var(--mono); font-size: .84rem; color: rgba(244, 242, 236, .75); white-space: nowrap; }
.ri-dock .d-score b { display: inline-block; color: #fff; font-weight: 400; font-size: 1.1rem; }
.ri-dock .d-score b.bump { animation: dBump .45s cubic-bezier(.3, 1.6, .5, 1); color: #7ee2b8; }
@keyframes dBump { 40% { transform: scale(1.45); } }
.ri-dock .btn { flex: none; min-height: 44px; }
@media (max-width: 359px) { .ri-dock { padding-left: 14px; gap: 8px; } .ri-dock .btn { padding-inline: 14px; } }

@media (prefers-reduced-motion: reduce) {
  .net.night::before, .wmap .arc, .wmap .tgt-r, .n-log li, .hc, .rp, .fx[aria-checked="true"] .fi, .ri-rate, .ri-dock .d-score b.bump { animation: none; }
  .net, .net::before, .node .ic, .node.car, .n-guest, .fx, .ri-dock, .ri-dock.on { transition: none; }
}

/* 学ぶ */
.todo { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; counter-reset: t; }
@media (min-width: 720px) { .todo { grid-template-columns: 1fr 1fr; } }
.todo div { background: var(--bg); padding: clamp(22px, 3vw, 30px); counter-increment: t; }
.section.alt .todo div { background: var(--bg-2); }
.todo div::before { content: counter(t, decimal-leading-zero); display: block; font-family: var(--mono); font-size: .8rem; color: var(--accent); margin-bottom: 6px; }
.todo h3 { font-size: 1.02rem; margin-bottom: 8px; }
.todo p { color: var(--ink-2); font-size: .92rem; }
.src { margin-top: 48px; max-width: var(--text); }
.src a { white-space: nowrap; }
