.ag-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(32px, 5vw, 56px); align-items: start; }
/* タブレットの縦向きから、AIの画面と今日の仕事を左右に並べる */
@media (min-width: 760px) { .ag-stage { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); } }
@media (min-width: 1000px) { .ag-stage { grid-template-columns: 420px minmax(0, 1fr); } }

/* 端末の枠（どちらのテーマでも明るい画面のため、色は固定） */
.dev { width: 100%; max-width: 420px; margin-inline: auto; background: #131417; border-radius: 44px; padding: 10px; box-shadow: 0 0 0 1px rgba(128, 128, 128, .28), 0 40px 80px -40px rgba(0, 0, 0, .55); }
.app { position: relative; overflow: hidden; background: #fbfaf7; color: #1e2328; border-radius: 34px; height: clamp(560px, calc(100vh - 120px), 700px); height: clamp(560px, calc(100svh - 120px), 700px); display: flex; flex-direction: column; font-family: var(--font-body); letter-spacing: .02em; line-height: 1.7; }
.app :focus-visible { outline: 2px solid #c03a22; outline-offset: 2px; }
.a-top { flex: none; display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; border-bottom: 1px solid #e6e3dc; }
.a-av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(140deg, #6f9a46, #2f5a2b); display: grid; place-items: center; flex: none; }
.a-av svg { width: 18px; height: 18px; }
.a-who { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.a-who b { font-size: .92rem; }
.a-who small { font-size: .75rem; color: #5b6470; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-st { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; color: #4d5661; border: 1px solid #d9d5cc; border-radius: 99px; padding: 1px 10px; white-space: nowrap; }
.a-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9aa3ab; }
.a-st.run::before { background: #4f8a3a; animation: blink 1s ease-in-out infinite alternate; }
.a-st.wait { color: #7a4d0a; border-color: #e2c48f; background: #fbf1de; }
.a-st.wait::before { background: #c9861a; }
@keyframes blink { to { opacity: .25; } }

/* 設定の画面 */
.v-set, .v-work { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.set-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 16px; scrollbar-width: thin; }
/* 下に続きがあるあいだは、下端を薄くして続きを示す */
.set-scroll.more { -webkit-mask-image: linear-gradient(#000 calc(100% - 36px), rgba(0, 0, 0, .15)); mask-image: linear-gradient(#000 calc(100% - 36px), rgba(0, 0, 0, .15)); }
.set-k { font-size: .75rem; font-weight: 700; color: #4d5661; letter-spacing: .08em; margin: 0 0 8px; }
.set-k + .set-jobs, .set-k + .perms, .set-k + .seg { margin-top: 0; }
/* 今日の仕事は押すものではないため、ボタンに見えない一覧にする */
.set-jobs { list-style: none; counter-reset: job; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 0 16px; }
.set-jobs li { counter-increment: job; margin: 0; font-size: .75rem; line-height: 1.75; color: #2c4a26; }
.set-jobs li::before { content: counter(job); font-family: var(--mono); font-size: .75rem; color: #5f8a3e; margin-right: 6px; }
.perms { border: 1px solid #e6e3dc; border-radius: 14px; overflow: hidden; background: #fff; margin-bottom: 18px; }
.pr { appearance: none; border: 0; border-top: 1px solid #efebe4; background: #fff; width: 100%; min-height: 56px; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 12px 8px 14px; text-align: left; font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.pr:first-child { border-top: 0; }
.pr:active { background: #f6f4ef; }
.pr .pi { color: #5b6470; display: grid; place-items: center; }
.pr .pi svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pr b { display: block; font-size: .84rem; line-height: 1.5; }
.pr small { display: block; font-size: .75rem; line-height: 1.55; color: #5b6470; }
.tr { position: relative; width: 44px; height: 26px; border-radius: 99px; background: #aeb5bd; transition: background .2s; flex: none; }
.tr::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .22s cubic-bezier(.3, 1.4, .5, 1); }
.pr[aria-checked="true"] .tr { background: #3f6b3a; }
.pr[aria-checked="true"] .tr::after { transform: translateX(18px); }
.pr[aria-checked="true"] .pi { color: #2f5a2b; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: #eeebe4; border-radius: 12px; }
.seg button { -webkit-tap-highlight-color: transparent; appearance: none; border: 0; background: transparent; color: #4d5661; font: inherit; font-size: .78rem; font-weight: 700; line-height: 1.45; padding: 7px 4px; min-height: 44px; border-radius: 9px; cursor: pointer; touch-action: manipulation; transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: #fff; color: #1e2328; box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.seg .nw { display: inline-block; }
.seg-d { font-size: .75rem; line-height: 1.7; color: #4d5661; margin: 8px 2px 18px; min-height: 3.4em; }
.a-foot { flex: none; display: flex; align-items: center; gap: 10px; min-height: 70px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #e6e3dc; background: #fbfaf7; }
.a-foot:focus { outline: none; }
.a-go { appearance: none; flex: 1; min-height: 48px; border: 0; border-radius: 999px; background: #1e2328; color: #fff; font: inherit; font-weight: 700; font-size: .9rem; letter-spacing: .06em; cursor: pointer; touch-action: manipulation; transition: transform .15s, background .2s; }
@media (hover: hover) { .a-go:hover { background: #343b43; } }
.a-go:active { transform: scale(.98); }

/* 仕事の画面 */
.chat { flex: 1 1 46%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.m { max-width: 88%; font-size: .84rem; line-height: 1.7; padding: 8px 12px; border-radius: 16px; overflow-wrap: anywhere; animation: rise .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.m.me { align-self: flex-end; background: #e1edd8; color: #1d2a16; border-bottom-right-radius: 5px; }
.m.ai { align-self: flex-start; background: #fff; border: 1px solid #e6e3dc; border-bottom-left-radius: 5px; }
.m.sys { align-self: center; background: none; padding: 0; font-size: .75rem; color: #5b6470; }
.m.typing { color: #7d858e; letter-spacing: .3em; }
.log { flex: 1 1 54%; min-height: 0; display: flex; flex-direction: column; background: #1c2024; color: #e2e6e9; }
.log-h { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 14px; font-size: .75rem; color: #b3bcc4; letter-spacing: .1em; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.log-h span:last-child { font-family: var(--mono); letter-spacing: 0; }
.log-l { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; margin: 0; padding: 6px 8px 10px; scrollbar-width: thin; scrollbar-color: #444b52 transparent; }
.log-l li { margin: 0; display: grid; grid-template-columns: 2.9em auto minmax(0, 1fr); gap: 0 8px; align-items: baseline; padding: 4px 6px; font-size: .78rem; line-height: 1.6; border-radius: 6px; animation: lineIn .3s ease both; }
@keyframes lineIn { from { opacity: 0; transform: translateX(-6px); } }
.log-l time { font-family: var(--mono); font-size: .75rem; color: #98a1aa; }
.log-l .lk { font-size: .75rem; line-height: 1.6; color: #d5dbe0; background: rgba(255, 255, 255, .1); border-radius: 4px; padding: 0 6px; white-space: nowrap; }
.log-l .lt { overflow-wrap: anywhere; }
.log-l .ad { font-family: var(--mono); font-size: .75rem; }
.log-l li.no { color: #a3acb4; }
.log-l li.no .lk { background: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); color: #b3bcc4; }
.log-l li.cut .lk { background: rgba(110, 200, 160, .18); color: #a6e6c8; }
.log-l .rv { display: none; }
.busy { flex: 1; display: flex; align-items: center; gap: 10px; font-size: .82rem; color: #4d5661; padding-left: 6px; }
.busy i { display: inline-flex; gap: 4px; }
.busy i b { width: 6px; height: 6px; border-radius: 50%; background: #6f9a46; animation: dot 1s ease-in-out infinite; }
.busy i b:nth-child(2) { animation-delay: .15s; } .busy i b:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-4px); opacity: .4; } }
.f-n { flex: none; font-family: var(--mono); font-size: .75rem; color: #5b6470; }
.req { appearance: none; flex: 1; min-width: 0; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1.5px solid #3f6b3a; background: #fff; color: #24421f; border-radius: 24px; padding: 6px 6px 6px 16px; font: inherit; font-size: .84rem; font-weight: 700; line-height: 1.5; text-align: left; cursor: pointer; touch-action: manipulation; animation: rise .3s ease both; transition: background .2s, transform .15s; }
@media (hover: hover) { .req:hover { background: #f1f6ec; } }
.req:active { transform: scale(.98); }
.req .snd { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #3f6b3a; display: grid; place-items: center; }
.req .snd svg { width: 16px; height: 16px; fill: #fff; }
.req.end { justify-content: center; border-color: #1e2328; color: #1e2328; padding: 6px 16px; }

/* 確認のシート */
.sh-bg { position: absolute; inset: 0; z-index: 8; background: rgba(18, 20, 23, .48); animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; max-height: 92%; overflow-y: auto; overscroll-behavior: contain; background: #fff; color: #1e2328; border-radius: 22px 22px 0 0; box-shadow: 0 -14px 40px rgba(0, 0, 0, .25); padding: 10px 18px calc(16px + env(safe-area-inset-bottom, 0px)); animation: sheetIn .38s cubic-bezier(.2, .8, .2, 1) both; }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 99px; background: #d5d1c9; margin: 0 auto 12px; }
@keyframes sheetIn { from { transform: translateY(100%); } }
.sh-who { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: #4d5661; margin-bottom: 4px; }
.sh-who .a-av { width: 22px; height: 22px; }
.sh-who .a-av svg { width: 12px; height: 12px; }
.sh-h { font-family: var(--font-head); font-weight: 700; font-size: 1.02rem; line-height: 1.5; margin: 0 0 10px; letter-spacing: .04em; }
.sh-h:focus { outline: none; }
.sh-req { font-size: .78rem; line-height: 1.6; color: #4d5661; background: #f3f1ec; border-radius: 10px; padding: 7px 12px; margin: 0 0 6px; }
.sh-req b { color: #1e2328; }
.sh-dl { margin: 0 0 14px; }
.sh-r { display: grid; grid-template-columns: 5.6em minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid #eeeae3; font-size: .84rem; line-height: 1.6; }
.sh-r dt { color: #5b6470; }
.sh-r dd { margin: 0; overflow-wrap: anywhere; }
.sh-r .ad { font-family: var(--mono); font-size: .8rem; }
.sh-r .ext { display: inline-block; font-size: .75rem; line-height: 1.5; color: #4d5661; border: 1px solid #cfcac0; border-radius: 99px; padding: 0 8px; margin-left: 4px; white-space: nowrap; }
/* 中身が長いときもボタンは常に見える位置に残す */
.sh-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: sticky; bottom: 0; background: #fff; padding-top: 6px; box-shadow: 0 -10px 12px -10px rgba(0, 0, 0, .12); }
.rp .sh-btns { display: none; }
.sh-btns button { appearance: none; min-height: 48px; border-radius: 999px; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; touch-action: manipulation; transition: transform .15s, background .2s; }
.sh-btns button:active { transform: scale(.98); }
#shNo { border: 1.5px solid #1e2328; background: #fff; color: #1e2328; }
#shOk { border: 1.5px solid #3f6b3a; background: #3f6b3a; color: #fff; }
@media (hover: hover) { #shNo:hover { background: #f3f1ec; } #shOk:hover { background: #355c31; } }

/* 一日の終わり：実行履歴を広げ、依頼していない操作に印を付ける */
.v-work.review .chat { flex: 0 1 auto; max-height: 34%; }
.v-work.review .log { flex: 1 1 auto; }
.v-work.review .log-l li[data-o] { animation: mark .6s ease both; }
@keyframes mark { from { background: transparent; } }
.v-work.review .log-l li.o-leak { background: rgba(229, 83, 75, .2); box-shadow: inset 3px 0 0 #f07468; color: #fff; }
.v-work.review .log-l li.o-stop { background: rgba(76, 197, 154, .14); box-shadow: inset 3px 0 0 #4cc59a; }
.v-work.review .log-l li.o-block, .v-work.review .log-l li.o-ign { background: rgba(255, 255, 255, .06); box-shadow: inset 3px 0 0 #8b949e; }
.v-work.review .log-l .rv { display: block; grid-column: 3; font-size: .75rem; font-weight: 700; font-style: normal; }
.v-work.review .log-l li.o-leak .rv { color: #ffb1a8; }
.v-work.review .log-l li.o-stop .rv { color: #8fe0bf; }
.v-work.review .log-l li.o-block .rv, .v-work.review .log-l li.o-ign .rv { color: #c9d1d9; }

/* 今日の仕事（タブレットとパソコン） */
.side { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.board { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; box-shadow: 0 24px 60px -44px rgba(0, 0, 0, .35); }
.board h2 { font-size: 1.05rem; margin: 0 0 6px; }
.board .b-date { font-family: var(--mono); font-size: .75rem; color: var(--ink-3); margin: 0; }
.jobs { list-style: none; margin: 12px 0 0; padding: 0; }
.jobs li { margin: 0; display: grid; grid-template-columns: 2em minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); font-size: .86rem; line-height: 1.7; }
.jobs .jn { font-family: var(--mono); font-size: .75rem; color: var(--ink-3); }
.jobs .js { font-size: .75rem; color: var(--ink-3); border: 1px solid var(--line); border-radius: 99px; padding: 0 9px; white-space: nowrap; }
.jobs li.now .js { color: var(--ink); border-color: var(--ink-3); }
.jobs li.ok .js { color: var(--ok); border-color: var(--ok); }
.jobs li.ng .js { color: var(--danger); border-color: var(--danger); }
.jobs li.stop .js { color: var(--ink-2); border-color: var(--ink-3); white-space: normal; }
@media (max-width: 759px) { .board { display: none; } }

/* 結果 */
.res:empty { display: none; }
.res .r-k { font-family: var(--mono); font-size: .78rem; letter-spacing: .12em; color: var(--ink-3); margin: 0 0 6px; }
.res .big { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.35rem, 2.8vw, 1.6rem); line-height: 1.5; margin: 0 0 14px; word-break: auto-phrase; text-wrap: balance; }
.res .big:focus { outline: none; }
.res.bad .big { color: var(--danger); }
.res.good .big { color: var(--ok); }
.res p { color: var(--ink-2); font-size: .92rem; }
.nums { display: flex; flex-wrap: wrap; gap: 4px 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; margin: 0 0 1.2em; font-size: .86rem; color: var(--ink-2); }
.nums b { font-family: var(--mono); font-weight: 400; font-size: 1.3rem; margin: 0 3px 0 8px; color: var(--ink); }
.nums .r b { color: var(--danger); }
.nums .g b { color: var(--ok); }
.cmp { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; margin: 0 0 1.4em; align-items: start; }
.cmp > div { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface); }
.cmp h3 { font-family: var(--font-body); font-size: .78rem; letter-spacing: .08em; color: var(--ink-3); margin: 0 0 8px; }
.cmp blockquote { margin: 0; font-size: .88rem; line-height: 1.8; color: var(--ink); }
.evs { list-style: none; margin: 0; padding: 0; }
.evs li { margin: 0; padding: 6px 0 6px 14px; position: relative; font-size: .84rem; line-height: 1.7; color: var(--ink-2); border-top: 1px solid var(--line); }
.evs li:first-child { border-top: 0; padding-top: 0; }
.evs li::before { content: ""; position: absolute; left: 0; top: 1em; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.evs li:first-child::before { top: calc(1em - 6px); }
.evs li b { display: block; color: var(--ink); }
.evs li em { font-style: normal; font-weight: 700; }
.evs li.o-leak::before { background: var(--danger); } .evs li.o-leak em { color: var(--danger); }
.evs li.o-stop::before { background: var(--ok); } .evs li.o-stop em { color: var(--ok); }
.lesson { border-left: 2px solid var(--accent); padding: 2px 0 2px 16px; margin: 0 0 1.4em; font-size: 1rem; font-weight: 700; line-height: 1.85; color: var(--ink); }
.res.good .lesson { border-left-color: var(--ok); }
@media (pointer: coarse) { .res .btn { min-height: 44px; } }
.res .rate { font-size: .88rem; color: var(--ink-2); margin: 0 0 1.4em; }
.res .rate .muted { display: block; margin-top: 4px; font-size: .78rem; line-height: 1.7; }
/* 「実行する」を押した確認の画面を、見分けられた行に印を付けて見せ直す（画面の模型なので色は固定） */
.rp { margin: 0 0 1.6em; }
.res .rp-k { font-size: .78rem; letter-spacing: .08em; color: var(--ink-3); margin: 0 0 8px; }
.rp-sheet { max-width: 420px; background: #fff; color: #1e2328; border-radius: 16px; padding: 14px 16px 6px; box-shadow: 0 0 0 1px rgba(128, 128, 128, .3), 0 24px 48px -36px rgba(0, 0, 0, .5); }
.res .rp-sheet p { color: #1e2328; }
.res .rp-sheet .sh-req { color: #4d5661; font-size: .78rem; }
.res .rp-h { font-weight: 700; font-size: .95rem; margin: 0 0 8px; }
.rp-sheet .sh-dl { margin: 0; }
.rp-sheet .sh-r:last-child { border-bottom: 0; }
.sh-r.key { position: relative; border-bottom-color: transparent; box-shadow: 0 0 0 2px #c03a22; border-radius: 8px; padding-inline: 8px; margin-inline: -8px; }
.res .rp-tell { font-size: .9rem; color: var(--ink); margin: 10px 0 0; max-width: 420px; }

@media (prefers-reduced-motion: reduce) {
  .m, .req, .sh-bg, .sheet, .log-l li, .v-work.review .log-l li[data-o] { animation: none; }
  .a-st.run::before, .busy i b { animation: none; }
  .tr, .tr::after { transition: none; }
}

/* 実機のスマートフォンでは、端末の枠を省き、画面の幅と高さいっぱいに表示する */
@media (max-width: 600px) {
  .dev { margin-inline: -8px; width: auto; max-width: none; padding: 0; background: none; border-radius: 20px; box-shadow: 0 0 0 1px rgba(128, 128, 128, .3), 0 24px 48px -32px rgba(0, 0, 0, .45); }
  .app { border-radius: 20px; height: clamp(440px, calc(100vh - 88px), 640px); height: clamp(440px, calc(100svh - 88px), 640px); }
  .a-top { padding: 12px 14px 10px; }
  .set-scroll { padding: 12px 12px 14px; }
  .chat { padding: 10px 12px; }
  .m { font-size: .88rem; }
  .sheet { padding-inline: 16px; }
}
@media (max-width: 359px) {
  .a-who small { display: none; }
  .sh-r { grid-template-columns: 4.8em minmax(0, 1fr); }
}
/* 横向きのスマートフォン：会話と実行履歴を左右に並べ、画面の高さに収める */
@media (orientation: landscape) and (max-height: 560px) {
  .dev { max-width: 760px; padding: 6px; border-radius: 28px; }
  .app { border-radius: 22px; height: max(228px, calc(100vh - 84px)); height: max(228px, calc(100svh - 84px)); }
  .a-top { padding: 8px 16px; }
  .v-work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-rows: minmax(0, 1fr) auto; }
  .v-work .a-foot { grid-column: 1 / -1; min-height: 60px; padding-block: 6px; }
  .v-work.review .chat { max-height: none; }
  .sheet { max-height: 100%; left: 50%; right: auto; width: min(520px, 100%); transform: translateX(-50%); animation-name: fade; padding-bottom: 10px; }
  .sheet::before { margin-bottom: 6px; }
  .sh-who { display: none; }
  .sh-h { margin-bottom: 6px; }
  .sh-req { padding-block: 5px; }
  .sh-r { padding: 5px 0; }
  .sh-dl { margin-bottom: 8px; }
}
@media (min-width: 760px) and (orientation: landscape) and (max-height: 560px) {
  .ag-stage { grid-template-columns: minmax(0, 1fr); }
}

/* 01 AIには見えていた文字 */
.rv { max-width: 760px; }
.rv-bar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.rv-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.rv-tabs button { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-size: .84rem; line-height: 1.5; padding: 7px 14px; border-radius: 99px; cursor: pointer; min-height: 40px; }
.rv-tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.rv-st { display: inline-block; margin-left: 8px; font-size: .75rem; line-height: 1.5; font-weight: 700; padding: 0 7px; border-radius: 99px; border: 1px solid currentColor; opacity: .85; white-space: nowrap; }
.rv-st.on { background: var(--danger); border-color: var(--danger); color: var(--bg); opacity: 1; }
.rv-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.rv-mode button { appearance: none; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: .82rem; font-weight: 700; line-height: 1.5; padding: 7px 14px; border-radius: 9px; cursor: pointer; min-height: 40px; white-space: nowrap; }
.rv-mode button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
@media (pointer: coarse) { .rv-tabs button, .rv-mode button { min-height: 44px; } }
.rv-card { position: relative; overflow: hidden; background: #fff; color: #1e2328; border-radius: 16px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 30px 60px -40px rgba(0, 0, 0, .45); padding: 20px 22px; font-family: var(--font-body); font-size: .88rem; line-height: 1.85; letter-spacing: .02em; min-height: 300px; }
.rv-card p { margin: 0 0 .9em; }
.rv-card .mh { border-bottom: 1px solid #ece9e2; padding-bottom: 10px; margin-bottom: 14px; }
.rv-card .mh b { display: block; font-size: .98rem; }
.rv-card .mh small { display: block; font-size: .75rem; color: #5b6470; overflow-wrap: anywhere; }
.rv-card .url { font-family: var(--mono); font-size: .75rem; color: #4d5661; background: #f1f3f4; border-radius: 99px; padding: 3px 12px; display: inline-block; margin-bottom: 12px; overflow-wrap: anywhere; }
.rv-card .hl { list-style: none; margin: 0 0 1em; padding: 0; }
.rv-card .hl li { margin: 0; display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid #ece9e2; }
.rv-card .hl li b { font-family: var(--mono); font-weight: 400; white-space: nowrap; }
.rv-card .doc-foot { border-top: 1px solid #ece9e2; padding-top: 6px; color: #6b7079; font-size: .75rem; }
.rv-card .ev { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 4px 10px; font-size: .84rem; margin-bottom: 12px; }
.rv-card .ev dt { color: #5b6470; }
.rv-card .ev dd { margin: 0; overflow-wrap: anywhere; }
.rv-p[hidden] { display: none; }
/* 隠れた文字：人に見える画面では見えない。AIが読む文字では、蛍光色で現れる */
.hid { transition: background-color .4s, color .4s; }
.hid em { display: none; font-style: normal; font-size: .75rem; font-weight: 700; color: #fff; background: #c03a22; border-radius: 4px; padding: 0 6px; margin-right: 6px; }
.hid.white { color: #fff; user-select: none; }
.hid.tiny { font-size: 2px; line-height: 1.2; color: #c9ccd1; margin: 0; user-select: none; }
.hid.off { position: absolute; left: -9999px; top: 0; width: 1px; overflow: hidden; }
.hid.fold { display: none; }
.rv.ai .hid { color: #1e2328; background: #fff27a; box-shadow: 0 0 0 4px #fff27a; border-radius: 2px; }
.rv.ai .hid em { display: inline-block; }
.rv.ai .hid.tiny { font-size: .84rem; line-height: 1.8; margin: 0 0 .9em; }
.rv.ai .hid.off { position: static; width: auto; overflow: visible; margin-bottom: 1em; }
.rv.ai .hid.fold { display: block; }
.rv-cap { font-size: .88rem; color: var(--ink-2); margin: 14px 0 0; min-height: 3.6em; }
@media (prefers-reduced-motion: reduce) { .hid { transition: none; } }
@media (max-width: 600px) {
  .rv-card { padding: 16px; } .rv-bar { align-items: stretch; } .rv-mode { width: 100%; }
  .rv-tabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .rv-tabs button { border-radius: 14px; padding: 7px 8px; }
  .rv-st { display: block; width: fit-content; margin: 2px auto 0; }
}

.four { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: clamp(48px, 7vw, 72px); }
@media (min-width: 720px) { .four { grid-template-columns: 1fr 1fr; } }
.four > div { background: var(--bg); padding: clamp(22px, 3vw, 32px); }
.res .ends-card { margin: 8px 0 clamp(36px, 6vw, 48px); }
.four .n { font-family: var(--mono); font-size: .8rem; color: var(--accent); }
.four h3 { font-size: 1.04rem; margin: 6px 0 8px; }
.four p { color: var(--ink-2); font-size: .92rem; }
/* 段階表示の「次へ」は、二列の並びの下に横いっぱいで置く */
.ag-stage > .steps-nav { grid-column: 1 / -1; margin-top: 0; }

/* 元は style 属性だった指定（CSP の style-src に 'unsafe-inline' を付けないため、ここへ移した） */
.rv-card .rv-ttl { font-weight: 700; margin-bottom: .4em; }
.rv-card .rv-note { color: #5b6470; font-size: .8rem; }
