/* 2026-11-17: home layout specifically for the existing Worker+Firebase app. */
:root{--md-navy:#142b45;--md-ink:#20354a;--md-gold:#d5ad72;--md-gold-strong:#b38a51;--md-muted:#627386;--md-paper:#f6f5f1;--md-border:#e1e6ea}
body.md-home{background:#f6f6f3;color:var(--md-ink);-webkit-font-smoothing:antialiased}
body.md-home .wrap{width:min(100% - 32px,900px)}
body.md-home .site-header{background:#102a42;border-bottom:1px solid #314a60}
body.md-home .header-inner{min-height:77px;padding-block:14px}
body.md-home .brand{font-size:17px;letter-spacing:.015em}
body.md-home .logo{height:40px;width:40px;border:1px solid #c5a36f;color:#efd6ac;border-radius:11px;font-family:'Hiragino Mincho ProN','Yu Mincho',serif;font-size:20px}
body.md-home .tagline{font-size:11px;letter-spacing:.055em}
body.md-home .site-header #header-account{min-height:39px;padding:7px 14px;border-radius:10px;border:1px solid rgba(240,220,176,.65);background:transparent;color:#f7e9d1;font-size:12px;font-weight:700}
body.md-home .site-header #header-account:hover{background:#1f415c}
body.md-home main.wrap{padding-top:24px}
body.md-home .md-hero{position:relative;overflow:hidden;isolation:isolate;background:linear-gradient(125deg,#15334e 0%,#1d4059 62%,#264d63 100%);border-radius:24px;padding:39px 38px 32px;margin:0 0 19px;color:#fff;box-shadow:0 15px 42px rgba(17,48,69,.12)}
body.md-home .md-hero::after{content:'';position:absolute;right:-66px;top:-118px;width:350px;height:350px;border-radius:50%;border:1px solid rgba(235,212,171,.26);box-shadow:0 0 0 46px rgba(240,216,170,.06),0 0 0 92px rgba(240,216,170,.035);z-index:-1;pointer-events:none}
body.md-home .md-hero .eyebrow{display:block;margin:0 0 13px;color:#e7c89b;font-size:11px;letter-spacing:.19em;font-weight:800}
body.md-home .md-hero h1{color:#fff;font-family:'Hiragino Mincho ProN','Yu Mincho','Noto Serif JP',serif;font-size:clamp(27px,4.8vw,42px);line-height:1.36;letter-spacing:.055em;margin:0 0 12px;max-width:620px}
body.md-home .md-hero h1 span{display:block;font-size:1.06em}
body.md-home .md-hero>p{color:#dfe9f0;max-width:550px;font-size:14px;line-height:1.9;margin:0 0 23px}
body.md-home .md-hero .stat-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;max-width:610px}
body.md-home .md-hero .stat-row>div{padding:12px 15px;border:1px solid rgba(241,227,202,.25);background:rgba(255,255,255,.095);border-radius:14px}
body.md-home .md-hero .stat-row strong{color:#fff;font-size:27px;font-weight:800;line-height:1.35}
body.md-home .md-hero .stat-row small{color:#d4e0ea;font-size:11px}
body.md-home .md-hero .hero-actions{margin-top:22px;align-items:center}
body.md-home .btn{border-radius:12px;min-height:46px}
body.md-home .md-hero #free-start{background:linear-gradient(120deg,#edd7ab,#d6ad70);color:#17344d;border:1px solid #d6ad70;box-shadow:0 4px 12px rgba(0,0,0,.08)}
body.md-home .md-hero #show-purchase{background:transparent;border:1px solid rgba(250,250,250,.55);color:#fff}
body.md-home .md-hero #show-purchase:hover{background:rgba(255,255,255,.1)}
body.md-home .md-account-summary{display:flex;align-items:center;justify-content:space-between;gap:15px;flex-wrap:wrap;background:#fff;border:1px solid var(--md-border);border-radius:18px;padding:17px 22px;box-shadow:0 5px 22px rgba(21,42,65,.045);margin-bottom:24px}
body.md-home .md-user{display:flex;align-items:center;gap:12px;min-width:0;flex:1 1 245px}
body.md-home .md-avatar{display:grid;place-items:center;width:44px;height:44px;flex:0 0 44px;border-radius:50%;background:#f2f0e9;color:#15344d;font-size:19px;font-family:serif;border:1px solid #e4ddcd}
body.md-home .md-user-heading{display:block;font-size:13px;color:var(--md-ink)}
body.md-home .md-user-note{font-size:11px;line-height:1.5;color:var(--md-muted);margin:4px 0 0;overflow-wrap:anywhere}
body.md-home .md-account-actions{display:flex;gap:8px;flex-wrap:wrap}
body.md-home .md-small-button{min-height:39px;padding:8px 16px;border:1px solid #173a56;background:#fff;color:#173a56;border-radius:10px;font-size:12px;font-weight:800}
body.md-home .md-small-button:hover{background:#f0f4f7}
body.md-home .md-signup{background:#163650;color:#fff}
body.md-home .md-signup:hover{background:#244865}
body.md-home .md-logout{color:#963d45;border-color:#cd9398}
body.md-home .md-category-section{margin:10px 0 25px}
body.md-home .md-section-head{display:flex;justify-content:space-between;margin-bottom:14px}
body.md-home .md-overline{color:#a07b4a;letter-spacing:.16em;font-size:10px;font-weight:800}
body.md-home .md-section-head h2{font-size:22px;line-height:1.45;margin:5px 0 6px;font-weight:800;color:#1b3348}
body.md-home .md-section-head p{margin:0;color:#65778a;font-size:12px}
body.md-home .md-category-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
body.md-home .md-category-tile{display:flex;align-items:center;text-align:left;gap:14px;min-height:103px;padding:18px 18px;border:1px solid var(--md-border);border-radius:17px;background:#fff;color:var(--md-ink);box-shadow:0 3px 13px rgba(21,42,65,.035);transition:box-shadow .15s ease,transform .15s ease}
body.md-home .md-category-tile:hover{box-shadow:0 8px 22px rgba(21,42,65,.095);transform:translateY(-1px)}
body.md-home .md-category-tile:disabled{opacity:.8;cursor:wait}
body.md-home .md-category-symbol{height:55px;width:55px;flex:0 0 55px;display:grid;place-items:center;border-radius:14px;background:#f4f1e9;color:#173954;font-size:26px}
body.md-home .md-category-text{min-width:0;display:flex;flex:1;flex-direction:column;gap:2px}
body.md-home .md-category-text strong{font-size:15px;line-height:1.5}
body.md-home .md-category-text small{color:#6c7d8b;font-size:11px}
body.md-home .md-category-count{color:#9b7848;font-size:11px;font-weight:800}
body.md-home .md-category-go{color:#3c5b74;font-size:11px;font-weight:800;white-space:nowrap}
body.md-home .md-purchase{background:linear-gradient(120deg,#17334d,#23465f);border:1px solid #b89b6e;border-radius:20px;color:#fff;box-shadow:0 9px 28px rgba(20,43,69,.075);margin-top:22px;padding:25px 26px}
body.md-home .md-purchase .eyebrow{color:#e8c993}
body.md-home .md-purchase h2{color:#fff}
body.md-home .md-purchase p{color:#d7e4ee}
body.md-home .md-purchase .price{color:#f1d4a3}
body.md-home .md-purchase #buy-btn{background:linear-gradient(115deg,#ead1a5,#d5ad70);color:#1e3a51}
body.md-home .md-purchase #premium-start{border-color:#ead1a5;color:#fff;background:transparent}
body.md-home .md-purchase #show-account{color:#f4dfb5}
body.md-home .md-purchase .muted{color:#cfdae6}
body.md-home #account-panel{margin-top:22px;border:1px solid #d8e0e6}
body.md-home #quiz-panel{margin-top:25px}
body.md-home .question-card{background:#fcfcfb;border-top:1px solid #e2e7eb}
body.md-home .answers button{border-radius:12px}
body.md-home #notice{border-left:3px solid #bd955e}
body.md-home footer{padding-bottom:12px}
@media(max-width:700px){body.md-home .tagline{display:none}body.md-home .md-hero{padding:29px 23px}body.md-home .md-category-grid{grid-template-columns:1fr}}
@media(max-width:500px){body.md-home .header-inner{min-height:66px}body.md-home .brand{font-size:14px}body.md-home .site-header #header-account{font-size:11px;padding:7px 9px}body.md-home .md-hero{border-radius:18px;padding:28px 20px}body.md-home .md-hero>p{font-size:12px}body.md-home .md-hero .stat-row{gap:7px}body.md-home .md-hero .stat-row>div{padding:9px 8px;border-radius:10px}body.md-home .md-hero .stat-row strong{font-size:21px}body.md-home .md-hero .stat-row small{font-size:10px;line-height:1.4}body.md-home .md-account-summary{padding:14px;gap:11px}body.md-home .md-account-actions{width:100%}body.md-home .md-account-actions button{flex:1}body.md-home .md-category-tile{min-height:88px;padding:14px 13px;gap:11px}body.md-home .md-category-symbol{height:48px;width:48px;flex-basis:48px}body.md-home .md-category-text strong{font-size:13px}body.md-home .md-purchase{padding:20px 18px}}
@media(prefers-reduced-motion:reduce){body.md-home .md-category-tile{transition:none}}
