:root{font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Noto Sans JP",Meiryo,sans-serif;color:#182d40;background:#f6f5f0;font-synthesis:none}*{box-sizing:border-box}body{margin:0;line-height:1.75}button,input,select{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #b58e51;outline-offset:3px}[hidden]{display:none!important}.wrap{width:min(100% - 32px,820px);margin:auto}.site-header{background:#142b45;color:white}.header-inner{display:flex;align-items:center;justify-content:space-between;padding:13px 0;gap:12px}.brand{display:flex;align-items:center;gap:10px;font-size:16px;font-weight:700}.logo{height:33px;width:33px;display:grid;place-items:center;border:1px solid #c8ad7c;border-radius:8px;color:#f0dcb3;font-family:serif}.tagline{font-size:12px;color:#c9d4df}.hero{padding:42px 0 24px}.eyebrow{letter-spacing:.13em;color:#ad7e41;font-size:11px;font-weight:800}.hero h1{font-size:clamp(30px,5vw,48px);letter-spacing:.025em;line-height:1.35;margin:12px 0}.hero p{color:#657384;margin:0 0 22px}.stat-row{display:flex;gap:12px;max-width:560px}.stat-row div{flex:1;min-width:0;background:#fff;border:1px solid #e5e6e8;padding:13px;border-radius:12px}.stat-row strong{font-size:23px;display:block;color:#172e49}.stat-row small{display:block;color:#667587;font-size:11px}.hero-actions,.button-row{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}.btn{border:0;border-radius:10px;padding:11px 17px;font-weight:700;min-height:46px;transition:opacity .2s}.btn:hover{opacity:.85}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-primary{background:#1b4267;color:#fff}.btn-light{background:#ecf0f3;color:#244560}.btn-outline{border:1px solid #bed0db;background:white;color:#244560}.panel{background:white;border:1px solid #e2e5e8;border-radius:16px;padding:22px;margin:18px 0;box-shadow:0 10px 25px #18304908}.panel-head{display:flex;align-items:start;justify-content:space-between;gap:12px}.panel h2{margin:0 0 8px;font-size:23px}.panel p{margin-top:5px}.price{font-size:24px;white-space:nowrap}.muted{color:#667587}.small{font-size:13px}.quiet,.link-btn{border:0;background:transparent;color:#1b4267;text-decoration:underline;padding:5px}.link-btn{margin-top:12px}.panel label{display:block;font-size:13px;font-weight:700;margin-top:11px}.panel input,.panel select{border:1px solid #aebbc8;border-radius:8px;padding:11px;background:white;width:100%}.filters{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:9px;margin:15px 0}.filters label{margin:0}.question-card{border-top:1px solid #e5e8ed;padding-top:15px}.question{font-weight:700;font-size:18px;white-space:pre-wrap}.answers{display:grid;gap:9px;margin-top:14px}.answers button{text-align:left;border:1px solid #d3dce3;border-radius:10px;padding:12px 15px;background:#f9fafb;color:#1b2d3f;white-space:pre-wrap}.answers button:disabled{opacity:1;cursor:default}.answers button.correct{background:#e1f2e9;border-color:#559879}.answers button.wrong{background:#fae8e5;border-color:#ce7a71}.explanation{border-left:3px solid #a68554;background:#f8f7f3;padding:14px;margin:14px 0;white-space:pre-wrap}.notice, #notice{background:#edf5fa;border:1px solid #bed7e4;padding:12px 15px;border-radius:9px;margin:12px 0}footer{font-size:12px;color:#708092;margin:30px 0 50px}footer span{display:block}@media(max-width:500px){.tagline{display:none}.stat-row strong{font-size:19px}.stat-row small{font-size:10px}.panel{padding:16px}.btn{width:100%}.button-row{display:grid;grid-template-columns:1fr;gap:8px}.hero-actions{display:grid}.filters{grid-template-columns:1fr}.filters select{margin-bottom:5px}}

:root { background: var(--surface); color: var(--ink); }
.site-header, .btn-primary { background: var(--ink); }
.brand-link { color: white; font-size: 0.8rem; }
.panel, .answers button, .question, .explanation { overflow-wrap: anywhere; }
#quiz-panel .quiet { white-space: nowrap; }
footer nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; }
footer a { color: var(--ink); }
body.md-quiz .site-header, body.md-quiz #home, body.md-quiz footer { display: none; }


/* ManabiDock shared visual language: home only (2026-11-21)
   Original auth, purchase and quiz handlers remain unchanged. */
body.md-home {background:#f5f5f2;}
body.md-home .wrap {width:min(100% - 36px, 900px);}
body.md-home .site-header {background:#102a43;border-bottom:1px solid rgba(220,191,140,.24);}
body.md-home .header-inner {min-height:88px;padding:12px 0;gap:14px;}
body.md-home .brand-identity {display:flex;align-items:center;gap:12px;min-width:0;color:white;text-decoration:none;}
body.md-home .brand-mark {position:relative;flex:none;width:48px;height:48px;display:block;border-radius:50%;}
body.md-home .brand-text {display:flex;flex-direction:column;line-height:1.35;min-width:0;}
body.md-home .brand-text strong {font-size:20px;letter-spacing:.01em;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Noto Sans JP",Meiryo,sans-serif;}
body.md-home .brand-text small {font-size:11px;color:#d9c8a8;letter-spacing:.035em;white-space:nowrap;}

body.md-home .guide-crest {display:block;width:100%;height:100%;overflow:visible;}
body.md-home .header-login {flex:none;border:1px solid var(--md-accent,#c6ae80);background:transparent;color:#f3e1bd;border-radius:12px;min-height:44px;padding:9px 15px;font-size:13px;font-weight:700;line-height:1.35;}
body.md-home .header-login:hover {background:rgba(255,255,255,.08);}
body.md-home #home {padding-top:28px;}
body.md-home #home .hero {position:relative;isolation:isolate;overflow:hidden;background:linear-gradient(125deg,#183650 0%,#21475d 100%);color:#fff;border-radius:27px;padding:44px 44px 42px;margin:0 0 38px;border:1px solid rgba(208,177,118,.2);}
body.md-home #home .hero::before {content:"";position:absolute;z-index:-1;width:610px;height:610px;border-radius:50%;border:1px solid rgba(219,189,132,.21);top:-300px;right:-180px;box-shadow:0 0 0 105px rgba(224,203,159,.035), 0 0 0 220px rgba(224,203,159,.025);pointer-events:none;}
body.md-home #home .hero::after {content:"";position:absolute;z-index:-1;width:390px;height:390px;border:1px solid rgba(219,189,132,.17);border-radius:50%;bottom:-300px;left:-110px;pointer-events:none;}
body.md-home #home .hero-kicker,body.md-home .section-kicker {font-size:12px;color:#e0bb82;font-weight:800;letter-spacing:.2em;}
body.md-home #home .hero h1 {color:#fff;font-family:"Hiragino Mincho ProN","Yu Mincho","Noto Serif JP",serif;font-size:clamp(28px,4.4vw,45px);font-weight:700;line-height:1.56;letter-spacing:.025em;max-width:670px;margin:24px 0 20px;overflow-wrap:anywhere;}
body.md-home #home .hero-summary {color:#dae4ec;font-size:15px;line-height:2.0;max-width:650px;margin:0 0 26px;}
body.md-home .hero-stats {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:22px 0 28px;}
body.md-home .hero-stat {display:flex;flex-direction:column;justify-content:center;min-height:96px;padding:16px 19px;border:1px solid rgba(229,230,230,.25);border-radius:16px;background:rgba(255,255,255,.075);}
body.md-home .hero-stat strong {font-size:clamp(23px,3.5vw,33px);font-variant-numeric:tabular-nums;color:#fff;line-height:1.22;letter-spacing:-.015em;}
body.md-home .hero-stat small {margin-top:9px;color:#dbe6ed;font-size:12px;line-height:1.45;}
body.md-home #home .hero-actions {display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:0;}
body.md-home #home .hero-actions .btn {display:flex;align-items:center;justify-content:center;min-height:56px;border-radius:14px;padding:12px 17px;text-align:center;font-size:15px;text-decoration:none;line-height:1.5;}
body.md-home #home .hero .btn-primary {background:linear-gradient(100deg,#ecd4a6,var(--md-accent,#d9b378));border:1px solid #eac992;color:#16344d;}
body.md-home #home .btn-hero-outline {background:transparent;color:#fff;border:1px solid rgba(236,241,245,.66);}
body.md-home #home .btn-hero-outline:hover {background:rgba(255,255,255,.1);}
body.md-home .study-topics {margin:0 0 30px;}
body.md-home .study-topics h2 {font-size:27px;margin:11px 0 8px;line-height:1.42;color:#19344c;}
body.md-home .topic-lead {color:#647588;font-size:14px;margin:0 0 21px;}
body.md-home #home-categories {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;margin:0;}
body.md-home #home-categories button {display:flex;align-items:center;gap:14px;min-width:0;min-height:94px;text-align:left;background:#fff;border:1px solid #dae3e9;border-radius:19px;padding:17px 17px;color:#1b344b;font-size:15px;font-weight:750;box-shadow:0 4px 13px rgba(22,42,61,.035);white-space:normal;line-height:1.55;}
body.md-home #home-categories button:hover {border-color:#c7ae7e;background:#fffdf8;opacity:1;}
body.md-home #home-categories button::before {content:"◈";flex:0 0 47px;height:47px;display:grid;place-items:center;border-radius:14px;background:#f3f1eb;color:#21475d;font-size:21px;font-weight:600;}
body.md-home #home-categories button::after {content:"›";margin-left:auto;color:#9a7b4b;font-size:27px;font-weight:500;}
body.md-home #home .purchase-panel {background:#1b3b54;border:1px solid #b79b68;border-radius:24px;padding:29px 30px;color:#eff4f8;box-shadow:none;scroll-margin-top:24px;}
body.md-home #home .purchase-panel h2 {color:white;font-size:25px;}
body.md-home #home .purchase-panel .price {color:#e6c38a;font-size:29px;}
body.md-home #home .purchase-panel p {color:#dce6ec;}
body.md-home #home .purchase-panel .btn-primary {background:var(--md-accent,#e5c38b);color:#183650;}
body.md-home #home .purchase-panel .btn-outline {background:transparent;color:white;border:1px solid #c8d4dd;}
body.md-home #home .purchase-panel .muted {color:#dce6ec;}
body.md-home #home #account-panel {scroll-margin-top:24px;}
body.md-home #home #account-panel .btn-primary {background:#1b4267;}
@media(max-width:680px) {
 body.md-home .wrap {width:min(100% - 28px, 900px);}
 body.md-home .header-inner {min-height:74px;padding:10px 0;gap:8px;}
 body.md-home .brand-mark {width:40px;height:40px;}
 body.md-home .brand-identity {gap:8px;}
 body.md-home .brand-text strong {font-size:16px;}
 body.md-home .brand-text small {font-size:9px;}
 body.md-home .header-login {min-height:40px;font-size:12px;padding:8px 11px;border-radius:11px;}
 body.md-home #home {padding-top:18px;}
 body.md-home #home .hero {padding:30px 22px 25px;border-radius:23px;margin-bottom:31px;}
 body.md-home #home .hero::before {right:-365px;top:-265px;}
 body.md-home #home .hero-kicker {font-size:10px;letter-spacing:.15em;}
 body.md-home #home .hero h1 {font-size:clamp(27px,6.2vw,38px);margin:17px 0 16px;line-height:1.5;}
 body.md-home #home .hero-summary {font-size:13px;line-height:1.85;margin-bottom:20px;}
 body.md-home .hero-stats {gap:7px;margin:20px 0 22px;}
 body.md-home .hero-stat {min-height:84px;padding:12px 9px;border-radius:11px;}
 body.md-home .hero-stat strong {font-size:24px;}
 body.md-home .hero-stat small {font-size:10px;margin-top:7px;}
 body.md-home #home .hero-actions {grid-template-columns:1fr;gap:10px;}
 body.md-home #home .hero-actions .btn {min-height:51px;width:100%;font-size:14px;}
 body.md-home .study-topics h2 {font-size:24px;}
 body.md-home .topic-lead {font-size:13px;}
 body.md-home #home-categories {grid-template-columns:1fr;gap:11px;}
 body.md-home #home-categories button {min-height:84px;padding:13px 15px;font-size:14px;border-radius:17px;width:100%;}
 body.md-home #home-categories button::before {flex-basis:44px;height:44px;}
 body.md-home #home .purchase-panel {padding:23px 20px;}
 body.md-home #home .purchase-panel h2 {font-size:22px;}
}
@media(max-width:355px) {
 body.md-home .brand-mark {width:36px;height:36px;}
 body.md-home .brand-text strong {font-size:13px;}
 body.md-home .brand-text small {font-size:8px;}
 body.md-home .header-login {font-size:10px;padding:7px 5px;}
 body.md-home .hero-stat strong {font-size:21px;}
}
@media(prefers-reduced-motion:reduce){body.md-home #home .btn {transition:none;}}

/* Optional question figure: hidden for text-only questions. */
#question-image[hidden]{display:none}
.question-image{margin:16px 0 22px;padding:12px;border:1px solid #dce4e3;border-radius:12px;background:#fff;min-width:0}
.question-image img{display:block;width:auto;height:auto;max-width:100%;max-height:440px;margin:0 auto;object-fit:contain}
.question-image figcaption{font-size:12px;line-height:1.7;color:#526775;margin-top:9px;overflow-wrap:anywhere}
.question-image .figure-error{font-size:14px;color:#8a3636}
.question-image .figure-retry{font:inherit;padding:8px 12px;margin:8px 0 0;border:1px solid #aab8bd;border-radius:6px;background:#fff;cursor:pointer}
@media(max-width:420px){.question-image{padding:6px}.question-image img{max-height:330px}.question-image figcaption{font-size:11px}}

/* Two-line title matches other nationwide guide apps. */
body.md-home #home .hero #home-title .hero-line {display:block;}
body.md-home .brand-mark.guide-mark img {display:block;width:100%;height:100%;object-fit:contain;}
