* { box-sizing:border-box; }
:root {
  color-scheme:light;
  --ink:#172d28; --muted:#53665e; --accent:#087b4b; --line:#dce6df; --mint:#e7f5ed;
  --dock-height:calc(76px + env(safe-area-inset-bottom,0px));
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic UI",Meiryo,system-ui,sans-serif;
  color:var(--ink); background:#f5f8f5; line-height:1.65; -webkit-text-size-adjust:100%;
}
body { margin:0; min-height:100vh; min-height:100dvh; }
button,a { touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
button { color:inherit; font:inherit; cursor:pointer; }
a { color:inherit; }
:focus-visible { outline:3px solid #05724e; outline-offset:3px; }
#app:focus,.feedback:focus { outline:none; }
.mast { background:#fff; border-bottom:1px solid var(--line); padding-top:env(safe-area-inset-top); }
.mast-in { max-width:1104px; margin:auto; display:flex; justify-content:space-between; align-items:center; padding:9px 24px; }
.brand { display:inline-flex; align-items:center; gap:10px; text-decoration:none; min-height:44px; font-size:17px; font-weight:800; letter-spacing:.02em; }
.brand-icon { position:relative; width:33px; height:33px; background:linear-gradient(135deg,#169468,#006844); border-radius:11px; }
.brand-icon::before { content:""; position:absolute; inset:8px 8px 7px; border:1.7px solid white; border-radius:2px 4px 4px 2px; box-shadow:inset 3px 0 0 #98dcbc; transform:rotate(-8deg); }
.brand-icon::after { content:""; position:absolute; top:9px; right:12px; background:#ffcf94; width:4px; height:6px; transform:rotate(-8deg); }
.mast-label { color:var(--muted); font-size:12px; font-weight:600; letter-spacing:.08em; }
main { width:min(calc(100% - 48px),1000px); margin:clamp(28px,5vw,66px) auto; }
.cover,.quiz,.sheet { border:1px solid var(--line); border-radius:26px; background:#fff; box-shadow:0 18px 55px -34px #23413565; }
.cover { display:grid; grid-template-columns:1.02fr 1fr; overflow:hidden; }
.cover-copy { padding:clamp(30px,4.4vw,60px); align-self:center; }
.cover-photo { display:block; width:100%; height:100%; min-height:300px; object-fit:cover; object-position:52% center; }
.eyebrow,.topic { display:inline-flex; align-items:center; gap:8px; color:#136b49; margin:0; font-weight:750; font-size:13px; }
.book-mark { display:inline-block; background:currentColor; width:10px; height:14px; clip-path:polygon(0 0,100% 0,100% 100%,50% 75%,0 100%); }
.cover h1 { font-size:clamp(34px,3.4vw,49px); line-height:1.32; letter-spacing:-.055em; margin:22px 0 15px; }
.cover em { font-style:normal; color:var(--accent); }
.lede { font-size:15px; line-height:1.9; color:#44574e; margin:0; }
.cover-meta { display:flex; flex-wrap:wrap; gap:8px 18px; padding:18px 0 17px; font-size:13px; color:var(--muted); }
.cover-meta b { font-size:16px; color:var(--ink); margin-left:3px; }
.cover-meta span+span { padding-left:17px; border-left:1px solid var(--line); }
.primary,.back { min-height:48px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:16px; font-weight:750; text-decoration:none; }
.primary { position:relative; width:100%; padding:12px 39px; background:var(--accent); color:white; border:0; box-shadow:0 3px 8px #0b80531a; }
.primary span { position:absolute; right:17px; font-size:20px; line-height:1; }
.primary:disabled { background:#e5ebe7; box-shadow:none; color:#63746a; cursor:default; }
.primary:not(:disabled):active { background:#005f3a; }
.save-hint { margin:9px 0 0; text-align:center; font-size:12px; color:var(--muted); }
.quiz { display:grid; grid-template-columns:minmax(215px,0.49fr) minmax(0,1fr); align-items:stretch; }
.stepbar { display:flex; flex-direction:column; overflow:hidden; background:#e6f3e9; padding:32px 26px 0; border-radius:25px 0 0 25px; }
.step-info { display:flex; flex-direction:column; align-items:start; gap:18px; }
.counter { font-size:15px; align-items:baseline; font-weight:650; color:var(--muted); font-variant-numeric:tabular-nums; }
.counter b { font-family:Inter,"Segoe UI",sans-serif; font-size:clamp(50px,5vw,72px); line-height:1; font-weight:650; color:#13573e; margin-right:5px; letter-spacing:-.055em; }
progress { -webkit-appearance:none; appearance:none; height:6px; width:100%; display:block; border:0; border-radius:20px; overflow:hidden; margin:17px 0; color:#119758; background:#c8ddce; }
progress::-webkit-progress-bar { background:#c8ddce; }
progress::-webkit-progress-value { background:#119758; border-radius:20px; }
progress::-moz-progress-bar { background:#119758; border-radius:20px; }
.side-photo { flex:1; min-height:145px; margin:14px -26px 0; background:linear-gradient(to bottom,#e6f3e9,transparent 27%),url("camera.webp") center bottom / cover no-repeat; }
.question-card { padding:clamp(25px,3.5vw,44px); min-width:0; }
.prompt-block { margin:0 0 20px; }
.topic { padding:3px 12px; border-radius:20px; background:var(--mint); font-size:12px; letter-spacing:.02em; }
.preference .topic { background:#f4eef9; color:#705083; }
.prompt { font-size:clamp(20px,2.1vw,26px); margin:13px 0 20px; line-height:1.57; font-weight:750; letter-spacing:-.025em; }
.choices { display:grid; gap:9px; }
.option { display:flex; align-items:center; gap:13px; padding:12px 14px; width:100%; text-align:left; min-height:54px; background:white; border:1px solid #d0dcd4; border-radius:12px; line-height:1.5; font-size:16px; }
.option:disabled { cursor:default; opacity:1; color:inherit; -webkit-text-fill-color:currentColor; }
.letter { display:grid; place-items:center; flex:none; width:30px; height:30px; border-radius:9px; background:#f0f4f1; color:#4c6254; font:650 14px/1 Inter,"Segoe UI",sans-serif; }
.option-body { flex:1; min-width:0; }
.right { background:#edf8f1; border-color:#30885d; }
.right .letter { background:#0a794b; color:white; }
.wrong { background:#fff5ee; border-color:#c08c6d; }
.wrong .letter { color:#854626; background:#f6e2d3; }
.mark { display:block; font-size:12px; margin-top:4px; color:#12663f; }
.wrong .mark { color:#884321; }
.feedback { margin:17px 0 0; padding:15px 17px; background:#f2f7f3; border-radius:12px; }
.feedback h2,.result-lines h2 { font-size:16px; margin:0; font-weight:750; }
.feedback p,.review p { margin:5px 0; line-height:1.8; }
.feedback.quiet { background:transparent; padding:0; color:var(--muted); }
.quiet h2 { font-size:13px; }
.source { display:inline-block; font-size:13px; color:#176945; text-underline-offset:3px; padding:4px 0; }
.action-dock { margin-top:22px; padding-top:17px; border-top:1px solid var(--line); display:grid; grid-template-columns:minmax(88px,.5fr) 1fr; gap:10px; }
.back { gap:8px; padding:8px 14px; background:#f1f5f2; color:#41574a; }
.back span { font-size:18px; }
@media(hover:hover) { .primary:not(:disabled):hover { background:#05633d; } .back:hover,.option:not(:disabled):not(.right):hover { background:#eff8f1; border-color:#7caf93; } }
.retention { width:100%; border-collapse:collapse; margin:0 0 16px; text-align:center; font-variant-numeric:tabular-nums; }
.retention th,.retention td { border:1px solid var(--line); padding:5px; }
.retention th { background:#edf5f0; font-size:13px; }
.figures { grid-template-columns:1fr 1fr; }
.figures .option { align-items:stretch; padding:8px; }
.figures .letter { display:none; }
.figures .option-body>span:first-child { font-size:13px; font-weight:700; }
.diagram { position:relative; display:flex; flex-direction:column; justify-content:center; gap:6px; height:13em; padding:10px; border:1px solid #a8bbad; background:#f4f3e8; border-radius:6px; color:#293e30; font:14px/1.45 "Yu Gothic UI",Meiryo,sans-serif; margin:4px 0; }
.line { display:block; }
.dA { text-align:center; }
.dB { justify-content:flex-start; gap:2px; }
.dB .l0,.dC .l2 { font-size:18px; font-weight:800; }
.dB .l2,.dD .l2 { font-size:12px; }
.dC .l2 { order:-1; margin-bottom:auto; }
.dD .l0 { font-weight:700; }
.dD .l1 { align-self:flex-end; max-width:44%; margin-top:auto; text-align:right; }
.dD .l2 { max-width:44%; position:absolute; bottom:10px; left:8px; }
.sheet { max-width:640px; margin:auto; padding:clamp(22px,3.5vw,40px); }
.result-head { position:relative; overflow:hidden; isolation:isolate; border-radius:18px; padding:30px 24px 24px; background:linear-gradient(125deg,#eff8ea,#e3f1e8 62%,#c9e3d2); }
.result-head::after { content:""; position:absolute; z-index:-1; top:-110px; right:-100px; width:240px; height:240px; border:1px solid #bad8c7; border-radius:50%; box-shadow:0 0 0 22px #ffffff24,0 0 0 45px #ffffff22; }
.result h1 { font-size:clamp(27px,4vw,39px); letter-spacing:-.045em; line-height:1.5; margin:12px 0 8px; }
.result-head p:last-child { margin-bottom:0; }
.result-motif { position:relative; width:64px; height:58px; margin-bottom:10px; }
.result-motif i,.result-motif b { position:absolute; }
.compare i,.compare b,.reflection i,.reflection b { background:#9ccbb3; border:2px solid #4f9177; width:31px; height:39px; border-radius:5px; left:5px; top:8px; transform:rotate(-16deg); }
.compare b,.reflection b { top:13px; left:25px; transform:rotate(10deg); background:linear-gradient(155deg,#ffdfb2 52%,#e7ab7d 52%,#e7ab7d 69%,#fff0d8 70%); border:3px solid white; box-shadow:0 2px 6px #123f2e39; }
.discovery i,.discovery b { inset:4px 8px; background:#418b66; clip-path:polygon(50% 0,65% 34%,100% 50%,65% 64%,50% 100%,34% 65%,0 50%,34% 34%); }
.discovery b { inset:1px 0 auto auto; width:19px; height:19px; background:#d99361; }
.search i { width:39px; height:39px; border:6px solid #328663; border-radius:50%; background:#c2e7d5; left:3px; top:3px; }
.search b { width:21px; height:8px; top:39px; left:32px; transform:rotate(45deg); border-radius:6px; background:#b47b55; }
.result-lines { padding:23px 0 4px; }
.result-lines p { margin:10px 0; border-left:3px solid #94c5a8; padding-left:13px; }
.result .primary { margin-top:20px; }
.review>.back { width:max-content; min-height:44px; font-size:14px; }
.review h1 { font-size:26px; margin:15px 0 5px; }
.review details { border-bottom:1px solid var(--line); padding:12px 0; }
.review summary { cursor:pointer; min-height:44px; font-weight:650; }
.review-topic { color:#166a47; display:inline-block; margin-right:8px; font-size:12px; }
.review .diagram { max-width:240px; }
.answer-key { color:#196943; font-weight:750; }
.review>.back:last-child { margin-top:15px; }
#storage-note { width:min(92%,640px); position:relative; margin:12px auto; padding:12px; border-radius:10px; background:#fff0df; font-size:13px; }
body:has(#storage-note:not([hidden])) .save-hint { display:none; }
@media(max-width:720px) {
  :root,body { background:#fff; }
  main { width:min(100%,500px); margin:0 auto; }
  .mast-in { max-width:500px; padding:4px max(18px,env(safe-area-inset-right)) 4px max(18px,env(safe-area-inset-left)); }
  .brand { font-size:15px; } .brand-icon { width:30px; height:30px; }
  .cover,.quiz,.sheet { border:0; box-shadow:none; border-radius:0; }
  .cover { display:flex; flex-direction:column-reverse; }
  .cover-photo { height:clamp(140px,24vh,220px); min-height:0; width:100%; object-position:center 52%; }
  .cover-copy { padding:22px 20px max(22px,env(safe-area-inset-bottom)); width:100%; }
  .cover h1 { margin:11px 0 12px; font-size:clamp(31px,8vw,42px); }
  .cover-meta { padding:12px 0; }
  .quiz { display:block; padding:0 max(18px,env(safe-area-inset-right)) var(--dock-height) max(18px,env(safe-area-inset-left)); }
  .stepbar { padding:15px 0 0; background:transparent; border-radius:0; }
  .step-info { flex-direction:row; align-items:center; justify-content:space-between; gap:8px; }
  .counter { font-size:13px; } .counter b { font-size:23px; margin-right:2px; }
  progress { margin:8px 0 0; height:5px; background:#dceae0; }
  .side-photo { display:none; }
  .question-card { padding:19px 0 12px; }
  .prompt-block { --panel:#e8f4eb; --arc:#c4dfce; position:relative; isolation:isolate; overflow:hidden; padding:15px 16px 17px; margin:0 0 15px; border-radius:16px; background:linear-gradient(115deg,#f1f8f2,var(--panel)); }
  .preference .prompt-block { --panel:#f0ebf7; --arc:#decfe9; background:linear-gradient(115deg,#f8f5fb,var(--panel)); }
  .prompt-block::after { content:""; position:absolute; z-index:-1; top:-71px; right:-34px; width:124px; height:124px; border:1px solid var(--arc); border-radius:50%; box-shadow:0 0 0 10px var(--panel),0 0 0 11px var(--arc),0 0 0 21px var(--panel),0 0 0 22px var(--arc); }
  .topic,.preference .topic { padding:0; background:transparent; }
  .prompt { margin:8px 0 0; font-size:clamp(19px,5vw,22px); line-height:1.55; }
  .action-dock { position:fixed; z-index:3; left:0; right:0; bottom:0; max-width:500px; margin:0 auto; background:#fff; padding:10px max(18px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left)); grid-template-columns:minmax(100px,.54fr) 1fr; box-shadow:0 -5px 18px #193d2a08; }
  .action-dock .back { padding:8px; gap:5px; white-space:nowrap; }
  .action-dock .primary { padding:10px 26px 10px 10px; }
  .action-dock .primary span { right:10px; }
  .feedback,.option,.source { scroll-margin-bottom:var(--dock-height); }
  body:has(.quiz) #storage-note { margin-top:calc(-1 * var(--dock-height)); margin-bottom:var(--dock-height); }
  .sheet { padding:20px 18px max(24px,env(safe-area-inset-bottom)); }
  .result-head { padding:21px; }
}
@media(max-width:359px) {
  .figures { grid-template-columns:1fr; }
  .diagram { height:9em; }
  .option { padding:11px 12px; gap:10px; }
}
@media(max-height:470px) and (max-width:720px) {
  .action-dock { position:static; margin-top:14px; padding:10px 0; box-shadow:none; }
  .quiz { padding-bottom:12px; }
  body:has(.quiz) #storage-note { margin:8px auto; }
}
