: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; }

/* Home refresh: ManabiDock current exam-app header and modern study layout.
   Does not change question, auth, Stripe, D1, or scoring behavior. */
body.md-home{background:#f6f5f0;color:#223b4b;line-height:1.75}
body.md-home .wrap{width:min(calc(100% - 40px),930px)}
body.md-home .site-header{background:#17364a;color:#fff;border-bottom:1px solid rgba(255,255,255,.17)}
body.md-home .header-inner{min-height:90px;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 0}
body.md-home .brand{display:flex;align-items:center;gap:14px;min-width:0}
body.md-home .brand-badge{width:56px;height:56px;flex:none;border-radius:50%;border:1.5px solid #c6ac7e;background:rgba(255,255,255,.035);display:grid;place-items:center;color:#e5d4b5;font-family:"Yu Mincho","Hiragino Mincho ProN",serif;font-size:23px;font-weight:400;line-height:1;box-shadow:inset 0 0 0 5px rgba(198,172,126,.065)}
body.md-home .brand-copy{display:flex;flex-direction:column;min-width:0;gap:2px}
body.md-home .brand-copy strong{font-size:23px;font-family:"Yu Mincho","Hiragino Mincho ProN",serif;font-weight:600;letter-spacing:.11em;line-height:1.4}
body.md-home .brand-copy small{font-size:11px;color:#d0dce1;letter-spacing:.05em;font-weight:400}
body.md-home .header-login{flex:none;border:1px solid rgba(255,255,255,.62);border-radius:8px;background:transparent;color:#fff;padding:10px 15px;font-size:13px;font-weight:600;line-height:1.3;min-height:42px;white-space:nowrap}
body.md-home .header-login:hover{background:rgba(255,255,255,.12)}
body.md-home .header-login:focus-visible{outline:3px solid #e5c286}
body.md-home .hero{position:relative;overflow:hidden;margin:28px 0 25px;padding:42px 48px 44px;border:1px solid #e9e6df;border-radius:18px;background:linear-gradient(125deg,#fff 10%,#fbfaf7 100%);box-shadow:0 9px 35px rgba(25,46,56,.035)}
body.md-home .hero::after{position:absolute;content:"";width:260px;height:260px;border:1px solid rgba(176,152,109,.20);border-radius:50%;top:-185px;right:-38px;box-shadow:0 0 0 23px rgba(176,152,109,.025),0 0 0 48px rgba(176,152,109,.025);pointer-events:none}
body.md-home .hero-eyebrow,body.md-home .section-eyebrow{font-size:11px;letter-spacing:.15em;font-weight:700;color:#9b7a4e;text-transform:uppercase;margin:0 0 13px}
body.md-home .hero h1{margin:0 0 15px;font-family:"Yu Mincho","Hiragino Mincho ProN",serif;font-size:clamp(29px,4.5vw,44px);font-weight:600;line-height:1.45;color:#19384b;letter-spacing:.025em}
body.md-home .hero-summary{font-size:14px;line-height:1.95;max-width:670px;color:#566976;margin:0 0 25px}
body.md-home .hero-facts{display:flex;flex-wrap:wrap;gap:6px 0;border-top:1px solid #e8e9e6;border-bottom:1px solid #e8e9e6;padding:14px 0;max-width:655px}
body.md-home .hero-facts span{display:inline-flex;align-items:baseline;gap:4px;color:#536a76;font-size:12px;padding:0 22px;border-right:1px solid #e3e5e4}
body.md-home .hero-facts span:first-child{padding-left:0}
body.md-home .hero-facts span:last-child{border-right:0}
body.md-home .hero-facts strong{font-weight:700;color:#173e53;font-size:22px;line-height:1.3;font-variant-numeric:tabular-nums}
body.md-home .hero-actions{align-items:center;display:flex;gap:14px 18px;margin-top:25px}
body.md-home .hero-actions .btn-primary{min-width:220px;background:#204b61;border-radius:8px}
body.md-home .hero-free-note{font-size:12px;color:#667b83}
body.md-home .panel{border:1px solid #e7e8e4;border-radius:16px;box-shadow:0 6px 22px rgba(23,49,60,.03);padding:24px 28px;margin:20px 0}
body.md-home .section-heading{display:flex;gap:12px;justify-content:space-between;align-items:end;margin:0 0 14px}
body.md-home .section-heading h2{margin:0;font-family:"Yu Mincho","Hiragino Mincho ProN",serif;font-size:25px;font-weight:600;color:#1a394b}
body.md-home .section-heading .section-eyebrow{margin-bottom:1px}
body.md-home .section-heading>p{margin:0 0 2px;color:#75828a;font-size:12px}
body.md-home #home-categories{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:17px}
body.md-home #home-categories .btn{display:flex;align-items:center;justify-content:space-between;text-align:left;gap:10px;width:100%;height:100%;min-height:59px;border:1px solid #e1e5e5;border-radius:10px;background:#fafbf9;color:#244556;font-weight:600;font-size:14px;line-height:1.6;padding:12px 16px}
body.md-home #home-categories .btn::after{content:"›";font-family:serif;color:#9b845d;font-size:24px;font-weight:400;line-height:1}
body.md-home #home-categories .btn:hover{background:#eef3f2;border-color:#bdcecd}
body.md-home .purchase-panel{border-left:3px solid #bea477}
body.md-home .purchase-panel .panel-head h2{font-size:22px;color:#1f4457}
body.md-home .purchase-panel .price{font-size:25px;color:#173e53}
body.md-home #account-panel{scroll-margin-top:18px}
body.md-home footer{padding:20px 0 35px;border-top:1px solid #e5e6e3}
body.md-home footer p{margin:0 0 12px}
body.md-home footer a{color:#365b6a}
@media(max-width:700px){
  body.md-home .wrap{width:min(calc(100% - 28px),930px)}
  body.md-home .header-inner{min-height:76px;gap:10px;padding:10px 0}
  body.md-home .brand{gap:9px}
  body.md-home .brand-badge{width:42px;height:42px;font-size:18px}
  body.md-home .brand-copy strong{font-size:19px}
  body.md-home .brand-copy small{font-size:9px;letter-spacing:0}
  body.md-home .header-login{font-size:11px;padding:8px 9px;min-height:39px}
  body.md-home .hero{margin:16px 0 20px;padding:28px 22px 30px}
  body.md-home .hero-summary{font-size:13px}
  body.md-home .hero-facts span{padding:0 13px;font-size:11px}
  body.md-home .hero-facts strong{font-size:19px}
  body.md-home .panel{padding:20px 17px}
  body.md-home .section-heading{align-items:start;flex-direction:column;gap:4px}
  body.md-home #home-categories{grid-template-columns:1fr}
  body.md-home .hero-actions{display:flex;flex-direction:column;align-items:stretch}
  body.md-home .hero-actions .btn{width:100%}
  body.md-home .hero-free-note{text-align:center}
  body.md-home .purchase-panel .panel-head{flex-wrap:wrap}
}
@media(max-width:360px){
  body.md-home .brand-copy strong{font-size:16px}
  body.md-home .brand-copy small{font-size:8px}
  body.md-home .brand-badge{width:37px;height:37px}
  body.md-home .header-login{font-size:10px;padding:7px}
  body.md-home .hero-facts span{padding:0 10px}
}
