
:root {
  --teal:#1699a3;
  --bg:#ececec;
  --card:#fff;
  --text:#111;
  --shadow:0 6px 18px rgba(0,0,0,.15);
  --ok:#1f9d62;
  --ok-bg:#e8f7f1;
  --ng:#d24a43;
  --ng-bg:#fdeeee;
}
* { box-sizing:border-box; -webkit-tap-highlight-color: transparent; }
html,body { margin:0; padding:0; background:var(--bg); color:var(--text); font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic","Meiryo",sans-serif; }
body { min-height:100vh; }
button { touch-action: manipulation; }
.app { max-width:430px; margin:0 auto; min-height:100vh; background:linear-gradient(180deg,#f1f1f1 0%, #ebebeb 100%); position:relative; overflow-x:hidden; }
.screen { display:none; min-height:100vh; }
.screen.active { display:block; }
.hero {
  background:radial-gradient(circle at 30% 20%, rgba(255,255,255,.18), transparent 35%), var(--teal);
  color:#fff;
  padding:28px 22px 42px;
}
.hero-title { font-size:50px; line-height:1.02; font-weight:900; text-shadow:0 3px 8px rgba(0,0,0,.18); }
.home-buttons { padding:22px 18px 120px; display:flex; flex-direction:column; gap:18px; }
.big-btn {
  appearance:none; border:none; border-radius:14px; padding:22px 18px; color:#fff; font-size:22px; font-weight:900;
  text-align:left; box-shadow:var(--shadow); cursor:pointer;
}
.big-btn.teal { background:linear-gradient(180deg,#19aab4,#0f8a93); }
.big-btn.green { background:linear-gradient(180deg,#67c926,#3b9920); }
.big-btn.gray { background:linear-gradient(180deg,#7e7e7e,#2f2f2f); }
.big-btn small { display:block; font-size:13px; margin-top:4px; opacity:.95; }
.big-btn[disabled] { opacity:.55; cursor:default; filter:saturate(.65); }
.topbar {
  position:sticky; top:0; z-index:40; background:var(--teal); color:#fff; text-align:center;
  padding:44px 16px 16px; box-shadow:0 2px 8px rgba(0,0,0,.12);
}
.topbar-title { font-size:22px; font-weight:900; }
.topbar-sub { margin-top:4px; font-size:12px; font-weight:700; opacity:.96; }
.section-pad { padding:18px; }
.card {
  background:#fff; border-radius:18px; box-shadow:var(--shadow); padding:18px;
}
.card + .card { margin-top:16px; }
.card-title { font-size:18px; font-weight:900; margin-bottom:12px; }
.action-btn {
  appearance:none; border:none; border-radius:14px; padding:14px 16px; font-size:17px; font-weight:900; cursor:pointer;
  box-shadow:var(--shadow); width:100%; margin-top:10px;
}
.action-btn.teal { background:var(--teal); color:#fff; }
.action-btn.gray { background:#444; color:#fff; }
.score-box {
  background:#fff; border-radius:18px; box-shadow:var(--shadow); padding:18px; text-align:center;
}
.score-big { font-size:36px; font-weight:900; margin:8px 0; }
.score-comment { font-size:24px; font-weight:900; margin-top:8px; }
.quiz-floating {
  position:fixed; right:12px; top:max(12px, env(safe-area-inset-top)); z-index:60;
  display:flex; flex-direction:column; gap:8px; align-items:flex-end;
}
.counter {
  background:rgba(255,255,255,.94); border-radius:999px; box-shadow:var(--shadow); padding:8px 12px; font-size:13px; font-weight:900;
}
.nav-row { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.nav-btn {
  appearance:none; border:none; background:rgba(255,255,255,.96); color:#111; border-radius:999px;
  box-shadow:var(--shadow); padding:10px 14px; font-size:14px; font-weight:900; cursor:pointer;
}
.nav-btn.quiz-return { color:#2d5a70; border:1px solid rgba(45,90,112,.18); }
.nav-btn:disabled { opacity:.45; cursor:default; }
.quiz-header { padding:14px 16px 10px; background:var(--teal); color:#fff; }
.quiz-title { font-size:24px; font-weight:900; text-align:center; }
.quiz-sub { font-size:12px; font-weight:700; text-align:center; margin-top:4px; opacity:.96; }
.quiz-body { padding-top:84px; padding-bottom:230px; }
.noteText { font-size:14px; color:#444; font-weight:700; }
.figureWrap.fullpage { padding:10px; }
.figureWrap.fullpage img { width:100% !important; height:auto !important; max-width:100% !important; display:block; }

.qText { padding:18px 16px 14px; font-size:24px; line-height:1.72; letter-spacing:.01em; }
.stmt { margin-top:10px; padding-left:1.35em; text-indent:-1.35em; font-size:20px; line-height:1.72; }
.line { height:6px; background:var(--teal); margin:0 14px; }
.figureWrap { margin:12px 10px 14px; background:#fff; border-radius:16px; box-shadow:var(--shadow); padding:12px 10px 12px; overflow:visible; }
.figureHead { font-size:18px; font-weight:900; color:#222; margin:0 2px 10px; }
.figureSub { font-size:13px; color:#666; font-weight:700; margin:0 2px 10px; line-height:1.6; }
.figureStack { display:grid; gap:12px; }
.figurePanel { background:#fff; border:1px solid #ececec; border-radius:14px; padding:8px 6px 10px; }
.figurePanelTitle { font-size:14px; font-weight:900; color:#444; margin:0 2px 8px; }
.figureWrap svg,.figureWrap img { display:block; width:100% !important; max-width:100% !important; height:auto !important; max-height:none !important; object-fit:contain; margin:0 auto; }
.figureWrap > * { box-sizing:border-box; }
.figureWrap table { width:100% !important; border-collapse:collapse; }
.figureWrap img { vertical-align:top; }
.singlePlate img{width:100% !important; height:auto !important; display:block; margin:0 auto;}
.r2tableScroll{overflow-x:auto; overflow-y:visible; padding-bottom:2px;}
.r2tableScroll img{display:block; width:100% !important; min-width:0 !important; max-width:100% !important; height:auto !important; margin:0 auto;}
@media (min-width: 840px){ .r2tableScroll img{width:100% !important; min-width:0 !important; max-width:100% !important;} }

.inlineChoices { margin:14px 0 0; display:flex; flex-direction:column; gap:10px; }
.inlineChoice {
  background:#fff; border-radius:14px; box-shadow:var(--shadow); padding:12px 14px;
  font-size:18px; line-height:1.55; font-weight:700;
}
.inlineChoice .formulaWrap { overflow-x:auto; }
.choice.compact { width:64px; text-align:center; padding:10px 0; font-size:18px; line-height:1; }
.choice.compact span { display:block; }
.dockRow.compact { grid-template-columns:64px 40px; justify-content:start; }

.inlineChoice .matrixBlock, .inlineChoice [style*="white-space:pre"] {
  overflow-x:auto;
  font-size:16px !important;
  line-height:1.3 !important;
}
.inlineChoice div { max-width:100%; }
.qText + .stmt{margin-top:8px;}
.qText br{display:block;margin-top:.6em;content:"";}

@media (max-width:430px){ .qText{font-size:25px; line-height:1.78;} .stmt{font-size:21px;} .figureHead{font-size:19px;} }
.miniBox { margin:12px 14px; background:#fff; border-radius:13px; box-shadow:var(--shadow); padding:12px 14px; font-size:15px; line-height:1.65; }
.miniBox .tip { margin-top:6px; font-size:12px; color:#555; font-weight:700; }
.feedbackArea { margin:0 14px 12px; min-height:58px; }
.feedback {
  display:none; padding:13px 14px; border-radius:16px; color:#fff; font-size:17px; font-weight:900; text-align:center;
  box-shadow:0 10px 20px rgba(0,0,0,.14);
}
.feedback.show { display:block; }
.feedback.ok { background:linear-gradient(180deg,#24b06a,#198f57); }
.feedback.ng { background:linear-gradient(180deg,#e95b53,#cc433b); }
.topPillRow { display:flex; gap:8px; padding:0 14px 10px; flex-wrap:wrap; }
.pill {
  appearance:none; border:3px solid rgba(22,153,163,.35); border-radius:999px; color:#1c4e52; padding:8px 14px;
  font-size:15px; font-weight:900; background:#fff; cursor:pointer;
}
.answerDock {
  position:fixed; left:50%; transform:translateX(-50%); bottom:0; width:min(430px,100%);
  background:rgba(239,239,239,.99); border-top:1px solid rgba(0,0,0,.08); box-shadow:0 -4px 12px rgba(0,0,0,.10);
  padding:6px 7px calc(6px + env(safe-area-inset-bottom)); z-index:40;
}
.dockTitle { margin:0 0 6px 4px; font-size:12px; font-weight:900; color:#555; }
.dockList { display:flex; flex-direction:column; gap:5px; }
.dockRow { display:grid; grid-template-columns:1fr 40px; gap:5px; align-items:start; }
.choice {
  background:#fff; border-radius:13px; box-shadow:var(--shadow); padding:8px 11px; font-size:16px; font-weight:900;
  line-height:1.2; cursor:pointer;
}
.choice small { display:block; margin-top:2px; font-size:10px; color:#666; font-weight:700; }
.choice img { display:block; width:100%; height:auto; }
.choice.correct { background:var(--ok-bg); color:var(--ok); }
.choice.wrong { background:var(--ng-bg); color:var(--ng); }
.zoomBtn {
  display:grid; place-items:center; width:40px; height:40px; background:#fff; border-radius:11px;
  box-shadow:var(--shadow); color:var(--teal); font-size:22px; font-weight:900; cursor:pointer;
}
.modal {
  position:fixed; inset:0; background:rgba(0,0,0,.42); display:none; align-items:center; justify-content:center; padding:12px; z-index:80;
}
.modal.show { display:flex; }
.sheet {
  width:min(410px, 100%); max-height:82vh; overflow:auto; background:#f8f8f8; border-radius:20px;
  box-shadow:0 20px 40px rgba(0,0,0,.26); padding:16px 16px 18px;
}
.sheetTop { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.sheetTitle { font-size:22px; font-weight:900; }
.closeBtn {
  appearance:none; border:none; color:#fff; background:var(--teal); border-radius:12px; padding:8px 12px; font-size:14px; font-weight:900; cursor:pointer;
}
.tag { display:inline-block; padding:4px 10px; border-radius:999px; color:#fff; font-size:12px; font-weight:900; margin-bottom:10px; }
.tag.ok { background:#1f9d62; } .tag.ng { background:#d24a43; } .tag.memo { background:#666; }
.block { background:#fff; border-radius:14px; box-shadow:var(--shadow); padding:12px 13px; margin-bottom:10px; }
.blockTitle { font-size:14px; font-weight:900; color:#666; margin-bottom:6px; }
.block p { margin:0; font-size:15px; line-height:1.7; }
.bullet { margin:0; padding-left:1.1em; }
.bullet li { margin:0 0 8px 0; font-size:15px; line-height:1.7; }
.formula { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; background:#f3f3f3; border-radius:10px; padding:8px 10px; font-size:14px; line-height:1.6; }
.blankBox {
  display:inline-flex; align-items:center; justify-content:center; min-width:2.15em; min-height:1.7em;
  padding:0 0.24em; margin:0 0.10em; border:2.5px solid #2f4f4f; border-radius:7px;
  background:#fff; box-shadow:0 1px 0 rgba(0,0,0,.05); font-weight:900; font-size:0.92em;
  line-height:1; vertical-align:middle; white-space:nowrap; letter-spacing:0;
}
.qText.blankQuestionMode { line-height:1.84; }
.qText.blankQuestionMode .stmt { line-height:1.84; }
.qText.blankQuestionMode .inlineChoice small { display:inline-flex; flex-wrap:wrap; gap:6px; align-items:center; margin-top:6px; }

.jump-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  margin-top:12px;
}
.jump-btn{
  appearance:none;
  border:none;
  background:#f5f5f5;
  color:#111;
  border-radius:12px;
  box-shadow:var(--shadow);
  padding:12px 0;
  font-size:16px;
  font-weight:900;
  cursor:pointer;
}
.jump-btn.current{background:var(--teal); color:#fff;}
.jump-btn.unanswered{background:#f5f5f5; color:#111;}
.jump-btn.correct{background:#e8f7f1; color:#1f9d62;}
.jump-btn.wrong{background:#fdeeee; color:#d24a43;}
.score-list{
  margin-top:14px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.score-row{
  background:#fff;
  border-radius:12px;
  box-shadow:var(--shadow);
  padding:12px 14px;
  font-size:15px;
  line-height:1.7;
}
.small-note{
  margin-top:10px;
  font-size:13px;
  color:#666;
  line-height:1.7;
}

.mode-badge{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  background:#fff;
  color:#1c4e52;
  border:2px solid rgba(22,153,163,.25);
  font-size:12px;
  font-weight:900;
  margin-left:8px;
}
.numbers{
  font-weight:900;
  letter-spacing:.02em;
}



.revisionNote{
  margin:0 0 10px 0;
  font-size:11px;
  line-height:1.5;
  color:#777;
  font-weight:700;
}


/* ===== UI compact refresh ===== */
:root{
  --teal:#2d6c7b;
  --bg:#f3f5f7;
  --shadow:0 10px 28px rgba(17,37,56,.10);
  --ok:#198a58;
  --ok-bg:#e7f6ee;
  --ng:#cb4a45;
  --ng-bg:#fcecec;
}
html,body{background:var(--bg);}
.app{background:linear-gradient(180deg,#f7f9fb 0%, #eef2f5 100%);}
.hero{
  padding:22px 18px 30px;
  background:radial-gradient(circle at 25% 20%, rgba(255,255,255,.16), transparent 34%), linear-gradient(135deg,#3a7d91 0%, #2d6c7b 100%);
}
.hero-title{font-size:42px; letter-spacing:.01em;}
.home-buttons{padding:16px 14px 56px; gap:12px;}
.big-btn{
  position:relative;
  border-radius:18px;
  padding:18px 16px;
  font-size:20px;
  box-shadow:0 10px 26px rgba(17,37,56,.12);
}
.big-btn.teal{background:linear-gradient(180deg,#448ba0,#2d6c7b);}
.big-btn.green{background:linear-gradient(180deg,#4f9b83,#2d6f5b);}
.big-btn.gray{background:linear-gradient(180deg,#54626a,#34424a);}
.big-btn.orange{background:linear-gradient(180deg,#f0a446,#d97a18);}
.big-btn small{font-size:12px; margin-top:6px; color:rgba(255,255,255,.88); opacity:1;}
.topbar{padding:36px 14px 12px; background:linear-gradient(135deg,#3a7d91 0%, #2d6c7b 100%);}
.topbar-title{font-size:20px;}
.topbar-sub{font-size:11px; margin-top:3px;}
.section-pad{padding:12px;}
.card{padding:14px; border-radius:16px;}
.card + .card{margin-top:12px;}
.card-title{font-size:16px; margin-bottom:10px;}
.action-btn{padding:12px 14px; font-size:15px; border-radius:14px; margin-top:8px;}
.score-box{padding:14px; border-radius:16px;}
.score-big{font-size:31px; margin:6px 0;}
.score-comment{font-size:21px; margin-top:6px;}
.quiz-floating{right:10px; top:max(10px, env(safe-area-inset-top)); gap:6px;}
.counter{padding:7px 10px; font-size:12px;}
.nav-row{gap:6px;}
.nav-btn{padding:8px 11px; font-size:13px;}
.quiz-header{padding:11px 14px 8px;}
.quiz-title{font-size:20px;}
.quiz-sub{font-size:11px; margin-top:3px;}
.quiz-body{padding-top:70px; padding-bottom:116px;}
.qText{padding:12px 12px 10px; font-size:20px; line-height:1.56; letter-spacing:0;}
.stmt{margin-top:7px; padding-left:1.15em; text-indent:-1.15em; font-size:17px; line-height:1.6;}
.line{height:4px; margin:0 12px;}
.figureWrap{margin:10px 8px 12px; padding:10px 8px; border-radius:14px;}
.figureWrap.fullpage{padding:8px;}
.figureHead{font-size:16px; margin:0 2px 8px;}
.figureSub{font-size:12px; margin:0 2px 8px; line-height:1.5;}
.figureStack{gap:10px;}
.figurePanel{border-radius:12px; padding:7px 5px 8px;}
.figurePanelTitle{font-size:13px; margin:0 2px 6px;}
.inlineChoices{margin:10px 0 0; gap:8px;}
.inlineChoice{padding:10px 12px; font-size:16px; line-height:1.48; border-radius:12px;}
.inlineChoice .matrixBlock, .inlineChoice [style*="white-space:pre"]{font-size:14px !important; line-height:1.25 !important;}
@media (max-width:430px){ .qText{font-size:20px; line-height:1.58;} .stmt{font-size:17px; line-height:1.62;} .figureHead{font-size:16px;} }
.miniBox{display:none;}
.feedbackArea{margin:0 12px 8px; min-height:44px;}
.feedback{padding:10px 12px; border-radius:14px; font-size:15px;}
.topPillRow{gap:6px; padding:0 12px 8px;}
.pill{padding:6px 12px; font-size:13px; border-width:2px;}
.answerDock{
  background:rgba(243,245,247,.96);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  padding:4px 6px calc(4px + env(safe-area-inset-bottom));
}
.dockTitle{margin:0 0 4px 2px; font-size:11px;}
.dockList{display:grid; gap:6px;}
.dockRow.compact{
  display:block;
  position:relative;
  min-height:44px;
}
.dockList.choiceCount1{grid-template-columns:1fr;}
.dockList.choiceCount2{grid-template-columns:repeat(2,minmax(0,1fr));}
.dockList.choiceCount3{grid-template-columns:repeat(3,minmax(0,1fr));}
.dockList.choiceCount4{grid-template-columns:repeat(2,minmax(0,1fr));}
.dockList.choiceCount5{grid-template-columns:repeat(6,minmax(0,1fr));}
.dockList.choiceCount5 .dockCell{grid-column:span 2;}
.dockList.choiceCount5 .dockCell:nth-child(-n+2){grid-column:span 3;}
.choice.compact{
  width:100%;
  min-height:44px;
  border-radius:13px;
  padding:10px 0 9px;
  font-size:15px;
  box-shadow:0 6px 16px rgba(17,37,56,.10);
}
.choice.compact span{display:block; line-height:1;}
.zoomBtn{
  position:absolute;
  right:5px;
  bottom:5px;
  width:18px;
  height:18px;
  font-size:10px;
  border-radius:999px;
  box-shadow:none;
  background:#eef3f6;
  border:1px solid rgba(45,108,123,.18);
}
.sheet{width:min(400px,100%); border-radius:18px; padding:14px 14px 16px;}
.sheetTitle{font-size:20px;}
.closeBtn{padding:7px 11px; font-size:13px; border-radius:10px;}
.block{padding:11px 12px; margin-bottom:8px; border-radius:12px;}
.blockTitle{font-size:13px; margin-bottom:5px;}
.block p{font-size:14px; line-height:1.65;}
.bullet li{font-size:14px; line-height:1.65; margin:0 0 6px 0;}
.formula{padding:7px 9px; font-size:13px; line-height:1.55;}
.jump-grid{gap:6px; margin-top:10px;}
.jump-btn{padding:10px 0; font-size:14px; border-radius:10px;}
.score-list{margin-top:10px; gap:6px;}
.score-row{padding:10px 12px; font-size:14px; line-height:1.55;}
.small-note{margin-top:8px; font-size:12px; line-height:1.55;}
.mode-badge{padding:3px 9px; font-size:11px; margin-left:6px;}
.revisionNote{font-size:10px; line-height:1.45; margin:0 0 8px 0;}

#pastMenuScreen .section-pad,
#yearMenuScreen .section-pad,
#scoreYearScreen .section-pad{
  display:grid;
  gap:10px;
}
#yearMenuScreen .big-btn,
#scoreYearScreen .big-btn{
  background:linear-gradient(180deg,#ffffff,#f7fafb);
  color:#1b333d;
  border:1px solid rgba(45,108,123,.15);
  padding:14px 16px 14px 18px;
  font-size:18px;
  box-shadow:0 10px 24px rgba(17,37,56,.08);
}
#yearMenuScreen .big-btn::before,
#scoreYearScreen .big-btn::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:6px;
  border-radius:18px 0 0 18px;
  background:linear-gradient(180deg,#62a6b6,#2d6c7b);
}
#yearMenuScreen .big-btn small,
#scoreYearScreen .big-btn small{
  color:#687c84;
}
#yearMenuScreen .big-btn.gray,
#scoreYearScreen .big-btn.gray{
  color:#fff;
  background:linear-gradient(180deg,#46555d,#313e46);
  border:none;
}
#yearMenuScreen .big-btn.gray::before,
#scoreYearScreen .big-btn.gray::before{
  background:linear-gradient(180deg,#9cb0b9,#6a7d86);
}
#yearMenuScreen .big-btn.gray small,
#scoreYearScreen .big-btn.gray small{
  color:rgba(255,255,255,.82);
}
#scoreScreen .topbar,
#yearMenuScreen .topbar,
#scoreYearScreen .topbar{
  background:linear-gradient(135deg,#386f82 0%, #2d6c7b 100%);
}


/* ===== UI polish v2 ===== */
:root[data-font-scale="standard"] .hero-title{font-size:48px;}
:root[data-font-scale="standard"] .topbar-title{font-size:22px;}
:root[data-font-scale="standard"] .topbar-sub{font-size:12px;}
:root[data-font-scale="standard"] .big-btn{font-size:22px;padding:20px 18px;}
:root[data-font-scale="standard"] .big-btn small{font-size:13px;}
:root[data-font-scale="standard"] .card-title{font-size:18px;}
:root[data-font-scale="standard"] .action-btn{font-size:17px;padding:14px 16px;}
:root[data-font-scale="standard"] .qText{font-size:22px;line-height:1.64;}
:root[data-font-scale="standard"] .stmt{font-size:18px;line-height:1.68;}
:root[data-font-scale="standard"] .inlineChoice{font-size:17px;line-height:1.58;}
:root[data-font-scale="standard"] .figureHead{font-size:17px;}
:root[data-font-scale="standard"] .choice.compact{min-height:48px;font-size:16px;}
:root[data-font-scale="standard"] .nav-btn{font-size:15px;padding:10px 13px;}
:root[data-font-scale="standard"] .feedback{font-size:16px;padding:11px 13px;}
:root[data-font-scale="standard"] .block p,
:root[data-font-scale="standard"] .bullet li,
:root[data-font-scale="standard"] .score-row,
:root[data-font-scale="standard"] .inlineHelp,
:root[data-font-scale="standard"] .small-note,
:root[data-font-scale="standard"] .legendItem{font-size:15px;line-height:1.72;}
:root[data-font-scale="standard"] .formula{font-size:14px;line-height:1.65;}
:root[data-font-scale="compact"] .hero-title{font-size:42px;}
:root[data-font-scale="compact"] .topbar-title{font-size:20px;}
:root[data-font-scale="compact"] .topbar-sub{font-size:11px;}
:root[data-font-scale="compact"] .big-btn{font-size:20px;padding:18px 16px;}
:root[data-font-scale="compact"] .big-btn small{font-size:12px;}
:root[data-font-scale="compact"] .card-title{font-size:16px;}
:root[data-font-scale="compact"] .action-btn{font-size:15px;padding:12px 14px;}
:root[data-font-scale="compact"] .qText{font-size:19px;line-height:1.56;}
:root[data-font-scale="compact"] .stmt{font-size:16px;line-height:1.58;}
:root[data-font-scale="compact"] .inlineChoice{font-size:15px;line-height:1.48;}
:root[data-font-scale="compact"] .figureHead{font-size:15px;}
:root[data-font-scale="compact"] .choice.compact{min-height:42px;font-size:14px;}
:root[data-font-scale="compact"] .nav-btn{font-size:13px;padding:8px 11px;}
:root[data-font-scale="compact"] .topPillRow{padding:0 10px 6px;}
:root[data-font-scale="compact"] .feedback{font-size:14px;}
:root[data-font-scale="compact"] .quiz-body{padding-top:76px;padding-bottom:108px;}
:root[data-font-scale="compact"] .figureWrap{margin:8px 8px 10px;padding:8px 7px;}
:root[data-font-scale="compact"] .questionMeta{gap:6px;}
:root[data-font-scale="compact"] .block p,
:root[data-font-scale="compact"] .bullet li,
:root[data-font-scale="compact"] .score-row,
:root[data-font-scale="compact"] .inlineHelp,
:root[data-font-scale="compact"] .small-note,
:root[data-font-scale="compact"] .legendItem{font-size:14px;line-height:1.65;}
:root[data-font-scale="compact"] .formula{font-size:13px;line-height:1.55;}
:root[data-font-scale="mini"] .hero-title{font-size:36px;}
:root[data-font-scale="mini"] .topbar-title{font-size:18px;}
:root[data-font-scale="mini"] .topbar-sub{font-size:10px;}
:root[data-font-scale="mini"] .big-btn{font-size:18px;padding:16px 14px;}
:root[data-font-scale="mini"] .big-btn small{font-size:11px;}
:root[data-font-scale="mini"] .card-title{font-size:15px;}
:root[data-font-scale="mini"] .action-btn{font-size:14px;padding:11px 13px;}
:root[data-font-scale="mini"] .qText{font-size:16px;line-height:1.46;}
:root[data-font-scale="mini"] .stmt{font-size:14px;line-height:1.48;}
:root[data-font-scale="mini"] .inlineChoice{font-size:13px;line-height:1.38;padding:8px 10px;}
:root[data-font-scale="mini"] .figureHead{font-size:14px;}
:root[data-font-scale="mini"] .choice.compact{min-height:38px;font-size:13px;padding:8px 0;}
:root[data-font-scale="mini"] .nav-btn{font-size:12px;padding:7px 10px;}
:root[data-font-scale="mini"] .quiz-body{padding-top:78px;padding-bottom:104px;}
:root[data-font-scale="mini"] .figureWrap{margin:8px 7px 9px;padding:7px 6px;}
:root[data-font-scale="mini"] .feedback{font-size:13px;padding:9px 10px;}
:root[data-font-scale="mini"] .pill{font-size:12px;padding:5px 10px;}
:root[data-font-scale="mini"] .block p,
:root[data-font-scale="mini"] .bullet li,
:root[data-font-scale="mini"] .score-row,
:root[data-font-scale="mini"] .inlineHelp,
:root[data-font-scale="mini"] .small-note,
:root[data-font-scale="mini"] .legendItem{font-size:13px;line-height:1.56;}
:root[data-font-scale="mini"] .formula{font-size:12px;line-height:1.48;}
.home-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.home-card{min-height:96px;padding:16px 14px 14px;display:flex;flex-direction:column;justify-content:space-between;}
.big-btn.soft{background:linear-gradient(180deg,#fefefe,#eef3f6);color:#1f3440;border:1px solid rgba(45,108,123,.15);}
.big-btn.soft small{color:#6c7b82;}
.big-btn,.action-btn,.nav-btn,.pill,.choice,.jump-btn,.setting-chip{transition:transform .12s ease, box-shadow .12s ease, filter .12s ease, background .12s ease;}
.big-btn:active,.action-btn:active,.nav-btn:active,.pill:active,.choice:active,.jump-btn:active,.setting-chip:active{transform:translateY(1px) scale(.99);filter:saturate(.98);}
#pastMenuScreen .section-pad,#yearMenuScreen .section-pad,#scoreYearScreen .section-pad{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
#pastMenuScreen .big-btn:last-child,#yearMenuScreen .big-btn:last-child,#scoreYearScreen .big-btn:last-child{grid-column:1/-1;}
#yearMenuScreen .big-btn,#scoreYearScreen .big-btn,#pastMenuScreen .big-btn{min-height:82px;display:flex;flex-direction:column;justify-content:center;}
#yearMenuScreen .big-btn small,#scoreYearScreen .big-btn small,#pastMenuScreen .big-btn small{line-height:1.35;}
.quiz-header{padding-bottom:10px;}
.questionMeta{display:flex;flex-direction:column;gap:7px;margin-top:8px;}
.progressTrack{width:100%;height:8px;background:rgba(255,255,255,.24);border-radius:999px;overflow:hidden;}
.progressFill{height:100%;width:0;background:linear-gradient(90deg,#c8f2ff,#ffffff);border-radius:999px;transition:width .18s ease;}
.statusRow{display:flex;gap:6px;flex-wrap:wrap;align-items:center;}
.statusChip{display:inline-flex;align-items:center;justify-content:center;padding:4px 9px;border-radius:999px;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.22);font-size:11px;font-weight:900;color:#fff;}
.statusChip.ok{background:rgba(25,138,88,.18);border-color:rgba(200,255,226,.4);}
.statusChip.ng{background:rgba(203,74,69,.2);border-color:rgba(255,217,216,.4);}
.statusChip.pending{background:rgba(255,255,255,.14);}
.statusChip.ghost{background:rgba(255,255,255,.12);}
.statusChip.revision{background:rgba(255,232,171,.18);border-color:rgba(255,241,203,.4);cursor:pointer;}
.feedbackArea{display:flex;flex-direction:column;gap:8px;}
.nextAction{display:none;gap:6px;flex-wrap:wrap;align-items:center;margin:0 12px 4px;}
.nextAction.show{display:flex;}
.guide-btn{appearance:none;border:none;border-radius:999px;padding:8px 12px;font-size:12px;font-weight:900;background:#fff;color:#204351;box-shadow:0 8px 18px rgba(17,37,56,.10);cursor:pointer;}
.guide-btn.primary{background:linear-gradient(180deg,#3f879b,#2d6c7b);color:#fff;}
.guide-text{font-size:12px;color:#53646d;font-weight:800;}
.answerDock{padding-top:4px;}
.dockList{gap:5px;}
.choice.compact{min-height:40px;border-radius:12px;}
.zoomBtn{right:4px;bottom:4px;width:17px;height:17px;font-size:10px;}
.jumpLegend{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:10px;}
.legendItem{background:#fff;border-radius:10px;padding:8px 10px;font-size:12px;font-weight:900;color:#44555c;box-shadow:0 8px 18px rgba(17,37,56,.07);}
.jump-btn{display:flex;align-items:center;justify-content:space-between;padding:10px 10px 10px 12px;text-align:left;}
.jump-num{font-size:14px;font-weight:900;}
.jump-mark{font-size:12px;font-weight:900;opacity:.9;}
.jump-btn.current .jump-mark{opacity:1;}
.score-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.metric-label{font-size:14px;font-weight:900;}
.score-list.compact{margin-top:12px;}
.score-row strong{font-weight:900;}
.settingsRow{display:flex;gap:8px;flex-wrap:wrap;}
.setting-chip{appearance:none;border:none;border-radius:999px;padding:10px 14px;background:#eef3f6;color:#21414f;font-size:14px;font-weight:900;box-shadow:0 8px 18px rgba(17,37,56,.08);cursor:pointer;}
.setting-chip.active{background:linear-gradient(180deg,#3f879b,#2d6c7b);color:#fff;}
.inlineHelp{font-size:13px;line-height:1.65;color:#5a6b73;}
#settingsScreen .section-pad{display:grid;gap:12px;}
@media (max-width:430px){
  .home-buttons{grid-template-columns:repeat(2,minmax(0,1fr));}
  #pastMenuScreen .section-pad,#yearMenuScreen .section-pad,#scoreYearScreen .section-pad{grid-template-columns:repeat(2,minmax(0,1fr));}
  .year-tools-row{grid-template-columns:1fr;}
  .heatmap-row{grid-template-columns:58px repeat(5,minmax(42px,1fr));gap:4px;}
  .heatmap-head{font-size:9px;}
  .heatmap-cell{font-size:10px;padding:5px 2px;}
}


.home-wide{grid-column:1/-1;}
.home-progress-card{padding:16px 14px;border-radius:18px;}
.home-progress-title{font-size:16px;font-weight:900;margin-bottom:10px;}
.home-progress-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.home-progress-item{background:#f7fafc;border-radius:12px;padding:10px 12px;box-shadow:0 6px 16px rgba(17,37,56,.06);}
.home-progress-item b{display:block;font-size:12px;color:#5b6c74;margin-bottom:4px;}
.home-progress-item span{font-size:16px;font-weight:900;color:#1d3944;line-height:1.35;}
#categoryScreen .section-pad,#calcCategoryScreen .section-pad{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
#categoryScreen .big-btn:last-child,#categoryScreen .small-note,#calcCategoryScreen .big-btn:last-child,#calcCategoryScreen .small-note{grid-column:1/-1;}
#categoryScreen .big-btn,#calcCategoryScreen .big-btn{min-height:94px;display:flex;flex-direction:column;justify-content:center;}
.jumpFilters,.explainJumpRow{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0 12px;}
.jump-filter-btn,.explain-jump-btn{appearance:none;border:none;border-radius:999px;padding:8px 12px;font-size:12px;font-weight:900;background:#eef3f6;color:#21414f;box-shadow:0 8px 18px rgba(17,37,56,.08);cursor:pointer;}
.jump-filter-btn.active,.explain-jump-btn.active{background:linear-gradient(180deg,#3f879b,#2d6c7b);color:#fff;}
.jump-btn.review{background:#fff7df;color:#9a6a00;}
.jump-year-section{margin-bottom:12px;}
.jump-year-title{font-size:13px;font-weight:900;color:#4d616a;margin:4px 2px 8px;}
.jump-year-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;}
.jump-context{margin:2px 0 10px;font-size:13px;font-weight:900;color:#4d616a;line-height:1.5;}

.legendItem.review{background:#fff7df;color:#8a6100;}
.hl-wrong{color:#cb4a45;font-weight:900;}
.hl-correct{color:#1d7a56;font-weight:900;}
.hl-formula{color:#2d6c7b;font-weight:900;}
.hl-key{color:#d47b00;font-weight:900;}
.wrong-keyword{color:#cb4a45;font-weight:900;}
.correct-keyword{color:#1d7a56;font-weight:900;}
.important-keyword{color:#d47b00;font-weight:900;}
.formula-keyword{color:#2d6c7b;font-weight:900;}
.answer-keyword{color:#1d3f57;font-weight:900;}
.term-actual{color:#1f5f99;font-weight:900;}
.term-target{color:#b55312;font-weight:900;}
#modalBody .choice-explain-list{
  display:block;
  margin-top:6px;
}
#modalBody .choice-explain-item{
  display:block;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  line-height:1.7;
}
#modalBody .choice-explain-item + .choice-explain-item{
  margin-top:.35em;
}
#modalBody .choice-explain-item.is-wrong,
#modalBody .choice-explain-item.is-correct{
  background:transparent;
}
#modalBody .choice-explain-item .choice-marker{
  display:inline;
  min-width:0;
  margin-right:.38em;
  padding:0;
  border-radius:0;
  background:transparent;
  color:#1d3f57;
  font-weight:900;
  white-space:nowrap;
}
#modalBody .explainBlock{
  background:#fff;
  border:1px solid rgba(45,108,123,.10);
  border-radius:16px;
  padding:12px;
  box-shadow:0 8px 20px rgba(17,37,56,.08);
}
#modalBody .explainBlock + .explainBlock{margin-top:10px;}
#modalBody .explainBlock:first-of-type{
  border-left:5px solid #1d7a56;
  background:#fbfffd;
}
#modalBody .explainBlock:first-of-type .blockTitle{color:#1d7a56;}
#modalBody .explainBlock > p{
  margin:0 0 8px;
  line-height:1.75;
}
#modalBody .explainBlock > p:last-child{margin-bottom:0;}
#modalBody .explain-main,
#modalBody .explain-support{
  position:relative;
  margin:10px 0 0;
  padding:12px;
  border-radius:14px;
  line-height:1.75;
  font-size:15px;
}
#modalBody .explain-main{
  background:#edf8f6;
  border:1px solid rgba(45,108,123,.22);
}
#modalBody .explain-support{
  background:#fff8ed;
  border:1px solid rgba(212,123,0,.22);
}
#modalBody .explain-main::before,
#modalBody .explain-support::before{
  position:absolute;
  top:10px;
  left:12px;
  display:inline-flex;
  align-items:center;
  min-height:20px;
  padding:2px 9px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  letter-spacing:0;
  line-height:1.2;
}
#modalBody .explain-main::before{
  display:none;
  content:"";
  color:#fff;
  background:#2d6c7b;
}
#modalBody .explain-support::before{
  display:inline-flex;
  content:"関連知識";
  color:#8a5700;
  background:#fff0d2;
  border:1px solid rgba(212,123,0,.26);
}
#modalBody .explain-support{
  padding:42px 12px 12px;
}
#modalBody .explain-support .related-alert{
  color:#c43d32;
  font-weight:900;
}
#modalBody .wrong-keyword,
#modalBody .correct-keyword,
#modalBody .important-keyword,
#modalBody .answer-keyword,
#modalBody .formula-keyword,
#modalBody .term-actual,
#modalBody .term-target{
  display:inline;
  padding:.08em .24em;
  border-radius:7px;
}
#modalBody .wrong-keyword{background:#fff0ed;}
#modalBody .correct-keyword{background:#edf8f0;}
#modalBody .important-keyword{background:#fff4df;}
#modalBody .answer-keyword{background:#eaf2f6;}
#modalBody .formula-keyword{background:#eef8fb;}
#modalBody .term-actual{background:#eaf3ff;border:1px solid rgba(31,95,153,.18);}
#modalBody .term-target{background:#fff1e6;border:1px solid rgba(181,83,18,.18);}
.formula-label{
  display:inline-flex;
  align-items:center;
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  vertical-align:middle;
  white-space:nowrap;
  margin:.1em .16em;
  padding:.24em .52em .28em;
  border-radius:10px;
  background:#eef8fb;
  border:1px solid rgba(45,108,123,.22);
  box-shadow:0 4px 10px rgba(17,37,56,.06);
  color:#225f70;
  font-family:"Times New Roman","Cambria Math","STIX Two Math",serif;
  font-weight:900;
  line-height:1.22;
  -webkit-overflow-scrolling:touch;
}
.formula-label .mathChoice,
.formula-label .choiceFormulaSet{
  flex-wrap:nowrap;
  white-space:nowrap;
}
#modalBody .formulaDisplay{
  display:block;
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  margin:.55em 0;
  padding:.45em .55em;
  border-radius:12px;
  background:#eef8fb;
  border:1px solid rgba(45,108,123,.22);
  box-shadow:0 4px 10px rgba(17,37,56,.06);
  color:#225f70;
  -webkit-overflow-scrolling:touch;
}
#modalBody .formulaDisplay .mathChoice,
#modalBody .formulaDisplay .mathEquation,
#modalBody .formulaDisplay .formulaStack{
  width:max-content;
  max-width:none;
  white-space:nowrap;
  flex-wrap:nowrap;
}
.overline{text-decoration:overline;text-decoration-thickness:1.5px;}
.explain-figure{margin:10px 0 12px;padding:8px;background:#fff;border-radius:12px;box-shadow:0 8px 18px rgba(17,37,56,.08);}
.explain-figure img{display:block;width:100%;height:auto;max-width:100%;object-fit:contain;}
.explain-figure figcaption{margin-top:6px;font-size:12px;font-weight:800;color:#52636b;}
.explain-figure-inline{margin:10px 0 12px;}
.explain-figure-inline .figureWrap{margin:8px 0 12px;padding:8px;border-radius:12px;}
.explain-figure-inline img{display:block;width:100%;height:auto;max-width:100%;object-fit:contain;}
.modal .figureWrap,
#modalBody .figureWrap,
#modalBody .figurePanel,
#modalBody .singlePlate,
#modalBody .r2tableScroll{
  overflow:visible !important;
  max-height:none !important;
}
#modalBody .r2tableScroll{
  overflow-x:auto !important;
  overflow-y:visible !important;
}
#modalBody img,
#modalBody svg,
#modalBody canvas{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  height:auto !important;
  max-height:none !important;
  object-fit:contain !important;
  object-position:center center !important;
}
#modalBody .figureFormulaChoices{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:10px;
  overflow:visible !important;
}
#modalBody .figureFormulaChoice{
  display:flex;
  align-items:flex-start;
  gap:10px;
  overflow-x:auto;
  overflow-y:visible;
  padding:8px 6px 12px;
}
#modalBody .figureFormulaChoice img{
  width:auto !important;
  max-width:calc(100% - 38px) !important;
  height:auto !important;
  max-height:none !important;
  flex:0 1 auto;
}
.explainBlock.block-formula .blockTitle{color:#2d6c7b;}
.explainBlock.block-warn .blockTitle{color:#cb4a45;}
.explainBlock.block-key .blockTitle{color:#d47b00;}
.explainBlock.block-correct .blockTitle{color:#1d7a56;}
.category-list-btn{appearance:none;border:none;width:100%;text-align:left;background:#fff;border-radius:12px;box-shadow:var(--shadow);padding:12px 14px;font-size:14px;font-weight:900;cursor:pointer;line-height:1.6;color:#1b333d;}
.category-list-btn small{display:block;margin-top:4px;font-size:12px;color:#687c84;font-weight:700;}
.category-card{background:#fff;border-radius:16px;box-shadow:var(--shadow);padding:14px 14px 12px;display:flex;flex-direction:column;gap:10px;border:1px solid rgba(45,108,123,.10);}
.category-card.full{grid-column:1/-1;}
.category-wide-btn{grid-column:1/-1;}
.category-card-title{font-size:16px;font-weight:900;line-height:1.45;color:#1b333d;}
.category-card-sub{font-size:12px;line-height:1.6;color:#687c84;font-weight:700;}
.category-action-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
#categoryScreen .category-action-row{grid-template-columns:repeat(2,minmax(0,1fr));}
.category-mini-btn{appearance:none;border:none;border-radius:12px;padding:11px 10px;font-size:13px;font-weight:900;cursor:pointer;box-shadow:0 8px 20px rgba(17,37,56,.08);}
.category-mini-btn.main{background:linear-gradient(180deg,#448ba0,#2d6c7b);color:#fff;}
.category-mini-btn.random{background:linear-gradient(180deg,#4da86d,#2f8050);color:#fff;}
.category-mini-btn.alt{background:linear-gradient(180deg,#ffffff,#eef3f6);color:#1f3440;border:1px solid rgba(45,108,123,.15);}

.category-mini-btn.score{grid-column:1/-1;background:linear-gradient(180deg,#fff9e8,#f6efcf);color:#5b4a12;border:1px solid rgba(138,111,27,.18);}
.category-score-list{margin-top:12px;display:flex;flex-direction:column;gap:8px;}
.category-score-item{background:#fff;border-radius:12px;box-shadow:var(--shadow);padding:12px 14px;border:1px solid rgba(45,108,123,.10);line-height:1.6;}
.category-score-item strong{font-weight:900;}
.category-score-item small{display:block;color:#687c84;font-size:12px;margin-top:2px;font-weight:700;}
.score-full{grid-column:1/-1;}
.score-menu-heading{
  grid-column:1/-1;
  margin:4px 2px 0;
  font-size:14px;
  font-weight:900;
  color:#294653;
}
.year-tools-card{
  grid-column:1/-1;
  background:#fff;
  border-radius:16px;
  box-shadow:var(--shadow);
  padding:14px;
  border:1px solid rgba(45,108,123,.10);
}
.year-tools-title{
  font-size:15px;
  font-weight:900;
  color:#1b333d;
  margin-bottom:8px;
}
.year-tools-row{
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  align-items:center;
}
.year-tools-select{
  width:100%;
  appearance:none;
  border:1px solid rgba(44,79,103,.18);
  border-radius:12px;
  padding:12px 14px;
  background:#fffdfb;
  color:#24343f;
  font-size:14px;
  font-weight:900;
  box-shadow:0 8px 18px rgba(17,37,56,.06);
}
.year-progress{
  width:100%;
  margin-top:8px;
  font-size:11px;
  line-height:1.35;
  color:#6b7372;
  font-weight:800;
}
.year-progress-top{
  display:flex;
  justify-content:space-between;
  gap:8px;
  margin-bottom:5px;
}
.year-progress-bar{
  width:100%;
  height:7px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(44,79,103,.12);
}
.year-progress-bar i{
  display:block;
  height:100%;
  width:0;
  border-radius:999px;
  background:linear-gradient(90deg,#87a2bb,#2c4f67);
}
.bookmark-pill.active{
  background:#fff4d7;
  color:#8a5700;
  border-color:rgba(196,134,73,.35);
}
.score-heatmap{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.heatmap-row{
  display:grid;
  grid-template-columns:72px repeat(5,minmax(0,1fr));
  gap:6px;
  align-items:stretch;
}
.heatmap-head{
  font-size:10px;
  color:#5d7078;
  font-weight:900;
  text-align:center;
  line-height:1.2;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
}
.heatmap-year{
  font-size:12px;
  color:#1b333d;
  font-weight:900;
  display:flex;
  align-items:center;
}
.heatmap-cell{
  border-radius:9px;
  min-height:42px;
  padding:6px 4px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  text-align:center;
  font-size:11px;
  font-weight:900;
  line-height:1.2;
  border:1px solid rgba(44,79,103,.08);
  color:#1b333d;
}
.heatmap-cell small{
  display:block;
  margin-top:2px;
  font-size:9px;
  color:rgba(27,51,61,.70);
  font-weight:800;
}
.heatmap-cell.empty{background:#f3eee8;color:#8b8580;}
.heatmap-cell.low{background:#fde7df;}
.heatmap-cell.mid{background:#fff2cf;}
.heatmap-cell.high{background:#dff1e4;}
.heatmap-cell.top{background:#c9e1f0;}
@media (max-width:430px){
  .year-tools-row{grid-template-columns:1fr;}
  .heatmap-row{grid-template-columns:58px repeat(5,minmax(42px,1fr));gap:4px;}
  .heatmap-head{font-size:9px;}
  .heatmap-cell{font-size:10px;padding:5px 2px;}
}
.score-dashboard-card,
.score-chart-card,
.score-insight-card{
  background:#fff;
  border-radius:16px;
  box-shadow:var(--shadow);
  padding:14px;
  border:1px solid rgba(45,108,123,.10);
}
.score-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.score-card-title{
  font-size:16px;
  line-height:1.45;
  font-weight:900;
  color:#1b333d;
}
.score-card-sub{
  margin-top:2px;
  font-size:12px;
  line-height:1.5;
  font-weight:800;
  color:#687c84;
}
.score-badge{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:5px 10px;
  border-radius:999px;
  background:#eef8fb;
  color:#225f70;
  font-size:12px;
  font-weight:900;
  border:1px solid rgba(45,108,123,.16);
}
.score-summary-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
.score-metric-card{
  background:#fff;
  border-radius:14px;
  box-shadow:0 8px 20px rgba(17,37,56,.08);
  padding:12px;
  border:1px solid rgba(45,108,123,.08);
}
.score-metric-label{
  font-size:12px;
  line-height:1.4;
  color:#61737b;
  font-weight:900;
}
.score-metric-value{
  margin-top:5px;
  font-size:24px;
  line-height:1.15;
  font-weight:900;
  color:#1d3944;
}
.score-metric-note{
  margin-top:4px;
  font-size:11px;
  line-height:1.45;
  color:#6d7d84;
  font-weight:800;
}
.radar-chart{
  width:100%;
  min-height:230px;
  display:grid;
  place-items:center;
  margin-top:2px;
}
.radar-chart svg{
  width:100%;
  max-width:300px;
  height:auto;
  display:block;
}
.radar-grid{fill:none;stroke:#dbe6eb;stroke-width:1;}
.radar-axis{stroke:#d6e1e6;stroke-width:1;}
.radar-area{fill:rgba(45,108,123,.24);stroke:#2d6c7b;stroke-width:3;stroke-linejoin:round;}
.radar-point{fill:#2d6c7b;stroke:#fff;stroke-width:2;}
.radar-label{font-size:10px;font-weight:900;fill:#294653;}
.radar-empty{font-size:12px;font-weight:900;fill:#80919a;}
.radar-legend{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  margin-top:8px;
}
.radar-legend-item{
  background:#f7fafc;
  border-radius:11px;
  padding:8px 9px;
  border:1px solid rgba(45,108,123,.08);
}
.radar-legend-item b{
  display:block;
  font-size:12px;
  line-height:1.35;
  color:#294653;
}
.radar-legend-item span{
  display:block;
  margin-top:2px;
  font-size:11px;
  line-height:1.35;
  color:#687c84;
  font-weight:800;
}
.score-action-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-top:12px;
}
.score-action-grid .action-btn{
  margin-top:0;
}
.score-action-grid .wide{
  grid-column:1/-1;
}
.action-btn.danger{
  background:linear-gradient(180deg,#d8625b,#b9423b);
  color:#fff;
}
.score-category-menu{
  grid-column:1/-1;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.score-category-menu .category-mini-btn{
  min-height:58px;
  text-align:left;
}
.score-category-menu .category-mini-btn small{
  display:block;
  margin-top:4px;
  font-size:11px;
  line-height:1.35;
  opacity:.86;
}
.priority-rank{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:2.4em;
  margin-right:6px;
  padding:2px 7px;
  border-radius:999px;
  background:#eef8fb;
  color:#225f70;
  font-size:12px;
  font-weight:900;
  border:1px solid rgba(45,108,123,.16);
}
.priority-score{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-left:6px;
  padding:2px 7px;
  border-radius:999px;
  background:#fff7df;
  color:#8a6100;
  font-size:11px;
  font-weight:900;
}
.priority-reason{
  display:block;
  margin-top:4px;
  color:#687c84;
  font-size:12px;
  line-height:1.45;
  font-weight:800;
}
@media (max-width:430px){
  .score-summary-grid,.radar-legend,.score-category-menu{grid-template-columns:repeat(2,minmax(0,1fr));}
  .score-metric-value{font-size:22px;}
}

@media (max-width:430px){#categoryScreen .section-pad,#calcCategoryScreen .section-pad{grid-template-columns:repeat(2,minmax(0,1fr));}.category-action-row{grid-template-columns:1fr;}}


/* ===== inline choice box cleanup ===== */
.inlineChoices{
  display:block !important;
  margin:14px 0 0 !important;
}
.inlineChoice{
  background:transparent !important;
  box-shadow:none !important;
  border-radius:0 !important;
  padding:0 !important;
  margin-top:12px !important;
  font-size:20px !important;
  line-height:1.72 !important;
  font-weight:400 !important;
}
.inlineChoice:first-child{margin-top:0 !important;}
.inlineChoice.hasFormulaChoice{
  line-height:1.42 !important;
}
.inlineChoice.hasFormulaChoice > .mathChoice,
.inlineChoice.hasFormulaChoice > .choiceFormulaSet,
.inlineChoice.hasFormulaChoice > .formula-label{
  display:inline-flex;
  align-items:center;
  max-width:calc(100% - 2.4em);
  overflow-x:auto;
  overflow-y:hidden;
  vertical-align:middle;
  white-space:nowrap;
  margin:.08em 0 .08em .28em;
  padding:.22em .48em .26em;
  border-radius:10px;
  background:#eef8fb;
  border:1px solid rgba(45,108,123,.24);
  box-shadow:0 3px 8px rgba(17,37,56,.06);
  color:#225f70;
  font-size:.9em;
  line-height:1.18;
  -webkit-overflow-scrolling:touch;
}
.inlineChoice.hasFormulaChoice > .mathChoice,
.inlineChoice.hasFormulaChoice > .mathChoice .mathMatrix,
.inlineChoice.hasFormulaChoice > .choiceFormulaSet{
  flex-wrap:nowrap;
}
.inlineChoice.hasFormulaChoice > .mathChoice .mathMatrix{
  padding:.08em .34em;
  row-gap:.06em;
}
.inlineChoice.hasFormulaChoice > .mathChoice .mathMatrix .matrixRow{
  column-gap:.5em;
}
.inlineChoice.hasFormulaChoice img{
  display:inline-block;
  width:auto;
  max-width:calc(100% - 2.4em);
  max-height:3.2em;
  height:auto;
  object-fit:contain;
  vertical-align:middle;
}
.inlineChoice .formulaWrap,
.inlineChoice .matrixBlock,
.inlineChoice [style*="white-space:pre"]{
  background:transparent !important;
}
.mathChoice{
  display:inline-flex;
  align-items:center;
  gap:.28em;
  flex-wrap:wrap;
  max-width:100%;
  overflow:visible;
  vertical-align:middle;
  white-space:normal;
  font-family:"Times New Roman","Cambria Math","STIX Two Math",serif;
  font-weight:600;
  line-height:1.15;
}
.mathFrac{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  vertical-align:middle;
  line-height:1.05;
  margin:0 .08em;
}
.mathFrac .num{
  display:block;
  border-bottom:1.5px solid currentColor;
  padding:0 .22em .08em;
  min-width:100%;
  text-align:center;
}
.mathFrac .den{
  display:block;
  padding:.08em .22em 0;
  min-width:100%;
  text-align:center;
}
.mathSqrt{
  display:inline-flex;
  align-items:flex-start;
  gap:.06em;
}
.mathSqrt .radical{
  font-size:1.35em;
  line-height:.95;
}
.mathSqrt .radicand{
  border-top:1.5px solid currentColor;
  padding:.08em .14em 0;
}
.mathOver{
  text-decoration:overline;
  text-decoration-thickness:1.4px;
  text-decoration-skip-ink:none;
}
.mathMatrix{
  display:inline-flex;
  flex-direction:column;
  gap:.12em;
  padding:.12em .48em;
  border-left:1.5px solid currentColor;
  border-right:1.5px solid currentColor;
  border-radius:3px;
  vertical-align:middle;
  line-height:1.18;
}
.mathMatrix .matrixRow{
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:minmax(1em,max-content);
  column-gap:.72em;
  align-items:center;
  justify-content:center;
}
.mathCases{
  display:inline-flex;
  align-items:stretch;
  gap:.35em;
  font-family:"Times New Roman","Cambria Math","STIX Two Math",serif;
  font-weight:600;
  font-size:.94em;
  line-height:1.22;
  max-width:100%;
}
.mathCases .caseBrace{
  display:flex;
  align-items:center;
  font-size:4.2em;
  line-height:.72;
  font-weight:400;
}
.mathCases .caseRows{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:.34em;
  min-width:0;
}
.mathCases .caseRow{
  white-space:nowrap;
}
.mathIsotope{
  display:inline-grid;
  grid-template-columns:1.34em auto;
  grid-template-rows:.70em .70em;
  align-items:stretch;
  column-gap:.04em;
  margin:0 .10em;
  vertical-align:-.20em;
  line-height:1;
  font-family:"Times New Roman","Cambria Math","STIX Two Math",serif;
  font-weight:700;
  font-variant-numeric:tabular-nums;
}
.mathIsotope sup,
.mathChoice .mathIsotope sup{
  grid-column:1;
  grid-row:1;
  display:block;
  width:100%;
  box-sizing:border-box;
  font-size:.68em;
  line-height:1;
  vertical-align:baseline;
  align-self:end;
  justify-self:stretch;
  text-align:right;
  padding-right:.02em;
}
.mathIsotope sub,
.mathChoice .mathIsotope sub{
  grid-column:1;
  grid-row:2;
  display:block;
  width:100%;
  box-sizing:border-box;
  font-size:.68em;
  line-height:1;
  vertical-align:baseline;
  align-self:start;
  justify-self:stretch;
  text-align:right;
  padding-right:.02em;
}
.mathIsotope .symbol{
  grid-column:2;
  grid-row:1 / span 2;
  display:block;
  font-size:1.12em;
  line-height:1.05;
}
.chem-formula{
  display:inline-block;
  vertical-align:baseline;
  white-space:nowrap;
  font-family:"Times New Roman","Cambria Math","STIX Two Math",serif;
  font-weight:700;
  letter-spacing:.01em;
}
.chem-formula sub{
  font-size:.68em;
  line-height:0;
  vertical-align:-.34em;
}
.chem-formula sup{
  font-size:.68em;
  line-height:0;
  vertical-align:.52em;
  margin-left:.03em;
}
.mathChoice sup,
.mathChoice sub{
  font-size:.72em;
  line-height:0;
}
.choiceFormulaSet{
  display:inline-flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.34em .9em;
  max-width:100%;
  vertical-align:middle;
  font-family:"Times New Roman","Cambria Math","STIX Two Math",serif;
  font-weight:600;
  line-height:1.22;
}
.choiceFormulaSet .formulaTerm{
  display:inline-flex;
  align-items:center;
  gap:.22em;
  white-space:nowrap;
}
.mathVector{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:.12em;
  border-left:1.5px solid currentColor;
  border-right:1.5px solid currentColor;
  padding:.08em .42em;
  line-height:1.2;
  vertical-align:middle;
}
.mathEquation{
  display:inline-flex;
  align-items:center;
  gap:.45em;
  flex-wrap:wrap;
  font-family:"Times New Roman","Cambria Math","STIX Two Math",serif;
  font-weight:600;
}
.formulaDisplay{
  display:block;
  max-width:100%;
  overflow-x:auto;
  margin:.35em 0;
  padding:.15em 0;
}
.formulaStack{
  display:block;
  font-family:"Times New Roman","Cambria Math","STIX Two Math",serif;
  font-weight:600;
  line-height:1.35;
}
.formulaStack .formulaLine{
  display:flex;
  align-items:center;
  gap:.28em;
  width:max-content;
  min-width:0;
  margin:.22em 0;
  white-space:nowrap;
}
@media (max-width:430px){
  .inlineChoice{
    font-size:17px !important;
    line-height:1.62 !important;
  }
  .mathChoice{
    font-size:16px;
  }
}



/* ===== color polish v2 ===== */
:root{
  --teal:#2c4f67;
  --bg:#f6f1eb;
  --card:#fffdfb;
  --text:#1c232b;
  --shadow:0 14px 34px rgba(28,35,43,.10);
  --ok:#2a7652;
  --ok-bg:#ebf6f0;
  --ng:#b95e56;
  --ng-bg:#fcf0ee;
}
html,body{
  background:
    radial-gradient(circle at top left, rgba(214,177,116,.16), transparent 30%),
    linear-gradient(180deg,#fbf7f2 0%, #f2ece6 100%);
  color:var(--text);
}
.app{
  background:
    radial-gradient(circle at top right, rgba(91,117,141,.08), transparent 24%),
    linear-gradient(180deg,#fcfaf7 0%, #f2ece6 100%);
}
.hero,
.topbar,
#scoreScreen .topbar,
#yearMenuScreen .topbar,
#scoreYearScreen .topbar{
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.20), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(214,177,116,.18), transparent 28%),
    linear-gradient(135deg,#5d748d 0%, #2c4f67 52%, #1f394d 100%);
}
.hero-title,
.topbar-title,
.quiz-title,
.sheetTitle{
  letter-spacing:.018em;
  text-shadow:0 3px 10px rgba(0,0,0,.10);
}
.big-btn{
  box-shadow:0 14px 30px rgba(28,35,43,.10);
}
.big-btn.teal{background:linear-gradient(180deg,#7391ad,#2c4f67);}
.big-btn.green{background:linear-gradient(180deg,#7f9a8b,#4f6c60);}
.big-btn.gray{background:linear-gradient(180deg,#7b8591,#535d68);}
.big-btn.orange{background:linear-gradient(180deg,#dfb680,#c48649);}
.big-btn.soft{
  background:linear-gradient(180deg,#fffefd,#f5efe7);
  color:#24343f;
  border:1px solid rgba(44,79,103,.12);
}
.big-btn.soft small{color:#6f7675;}
.card,
.score-box,
.figureWrap,
.figurePanel,
.inlineChoice,
.sheet,
.block,
.score-row,
.legendItem{
  background:rgba(255,253,251,.98);
  box-shadow:var(--shadow);
}
.figurePanel{
  border:1px solid rgba(44,79,103,.07);
}
.action-btn.teal,
.guide-btn.primary,
.setting-chip.active{
  background:linear-gradient(180deg,#6d8ba7,#2c4f67);
}
.action-btn.gray,
.closeBtn{
  background:linear-gradient(180deg,#73808c,#4b5662);
}
.nav-btn,
.counter,
.pill,
.guide-btn,
.setting-chip,
.statusChip.pending,
.statusChip.ghost{
  background:rgba(255,252,248,.98);
  color:#24343f;
}
.pill,
.mode-badge{
  border-color:rgba(44,79,103,.18);
  color:#31536b;
}
.answerDock{
  background:rgba(249,245,239,.97);
  border-top:1px solid rgba(44,79,103,.08);
}
.choice{
  background:#fffdfb;
}
.choice.correct{background:var(--ok-bg); color:var(--ok);}
.choice.wrong{background:var(--ng-bg); color:var(--ng);}
.zoomBtn{
  background:#f5efe8;
  border:1px solid rgba(44,79,103,.14);
  color:var(--teal);
}
.jump-btn.current,
.statusChip.ok,
.progressFill{
  background:linear-gradient(90deg,#87a2bb,#2c4f67);
  color:#fff;
}
.jump-btn.correct{background:var(--ok-bg); color:var(--ok);}
.jump-btn.wrong{background:var(--ng-bg); color:var(--ng);}
.statusChip.ok{border-color:rgba(255,255,255,.22);}
.statusChip.ng{background:rgba(185,94,86,.15); border-color:rgba(185,94,86,.18);}
.statusChip.revision{
  background:rgba(223,182,128,.18);
  border-color:rgba(196,134,73,.24);
  color:#66431d;
}
#yearMenuScreen .big-btn,
#scoreYearScreen .big-btn,
#pastMenuScreen .big-btn{
  background:linear-gradient(180deg,#fffefd,#f7f0e8);
  color:#22343f;
  border:1px solid rgba(44,79,103,.10);
}
#yearMenuScreen .big-btn::before,
#scoreYearScreen .big-btn::before,
#pastMenuScreen .big-btn::before{
  background:linear-gradient(180deg,#9bb2c7,#2c4f67);
}
#yearMenuScreen .big-btn small,
#scoreYearScreen .big-btn small,
#pastMenuScreen .big-btn small,
.inlineHelp,
.small-note,
.figureSub,
.noteText{
  color:#6b7372;
}
.formula{
  background:#f6efe7;
  border:1px solid rgba(44,79,103,.07);
}
.line{background:linear-gradient(90deg,#6f8f98,#2f5d67);}



/* 分離版：過去問題専用 */
#openJunsokuBtn,
#openVocabBtn{display:none !important;}
/* 基礎科目資料統合 */
.junsoku-topbar{position:sticky;top:0;z-index:10;background:#1699a3;color:#fff;padding:calc(14px + env(safe-area-inset-top)) 16px 14px;box-shadow:0 4px 18px rgba(0,0,0,.12);}
.junsoku-toprow{display:flex;align-items:center;gap:10px;}
.junsoku-back{border:none;background:rgba(255,255,255,.16);color:#fff;border-radius:999px;padding:10px 14px;font-size:14px;font-weight:900;}
.junsoku-titlewrap{min-width:0;flex:1;}
.junsoku-title{font-size:20px;font-weight:900;line-height:1.25;}
.junsoku-sub{margin-top:3px;font-size:12px;line-height:1.5;opacity:.95;font-weight:700;}
.junsoku-frame-wrap{padding:0 0 env(safe-area-inset-bottom);height:calc(100vh - 86px - env(safe-area-inset-top));background:#ececec;}
.junsoku-frame{display:block;width:100%;height:100%;border:0;background:#ececec;}
@media (max-width:640px){.junsoku-frame-wrap{height:calc(100vh - 88px - env(safe-area-inset-top));}}


/* ===== PATCH: figure visibility hardening (2026-05-12) ===== */
#figureHost,
#figureHost .figureWrap,
#figureHost .figurePanel,
#figureHost .figureCard,
#figureHost .singlePlate,
#figureHost .r2tableScroll{
  max-width:100% !important;
  overflow:visible !important;
}
#figureHost img,
#figureHost svg,
#figureHost canvas{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  height:auto !important;
  max-height:none !important;
  object-fit:contain !important;
  margin-left:auto !important;
  margin-right:auto !important;
}
#figureHost table{
  width:100% !important;
  max-width:100% !important;
}
#figureHost [style*="overflow:hidden"],
#figureHost [style*="overflow: hidden"]{
  overflow:visible !important;
}



/* ===== PATCH: figure visibility hardening 2 (2026-05-12) ===== */
#figureHost{
  overflow:visible !important;
  padding-bottom:16px !important;
}
#figureHost,
#figureHost *{
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}
#figureHost .figureWrap,
#figureHost .figurePanel,
#figureHost .figureCard,
#figureHost .singlePlate,
#figureHost .r2tableScroll,
#figureHost [style*="overflow:hidden"],
#figureHost [style*="overflow: hidden"]{
  overflow:visible !important;
  height:auto !important;
  max-height:none !important;
}
#figureHost [style*="height:"],
#figureHost [style*="max-height"]{
  height:auto !important;
  max-height:none !important;
}
#figureHost img,
#figureHost svg,
#figureHost canvas{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  height:auto !important;
  max-height:none !important;
  object-fit:contain !important;
  object-position:center center !important;
  margin-left:auto !important;
  margin-right:auto !important;
}
#figureHost svg{
  overflow:visible !important;
}
#figureHost table{
  max-width:100% !important;
}

#figureHost .figureFormulaChoices{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:10px;
}
#figureHost .figureFormulaChoice{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:8px 6px 12px;
  border-top:1px solid #eeeeee;
  overflow-x:auto;
  overflow-y:visible;
}
#figureHost .figureFormulaChoice:first-child{
  border-top:0;
}
#figureHost .figureFormulaChoice span{
  flex:0 0 28px;
  font-weight:900;
  font-size:18px;
  text-align:center;
}
#figureHost .figureFormulaChoice img{
  width:auto !important;
  max-width:calc(100% - 38px) !important;
  height:auto !important;
  max-height:none !important;
  object-fit:contain !important;
  margin:0 !important;
  flex:0 1 auto;
}



/* ===== H19 table/formula support ===== */
.h19FigureTable .r2tableScroll{overflow-x:auto;}
.h19DataTable{width:100%;border-collapse:collapse;font-size:15px;line-height:1.45;background:#fff;}
.h19DataTable th,.h19DataTable td{border:1px solid rgba(27,51,61,.45);padding:6px 8px;text-align:center;white-space:nowrap;}
.h19DataTable th{font-weight:900;background:#f7fafb;}
.h19FormulaBlock{overflow-x:auto;line-height:1.7;}
.h19FormulaLine{white-space:nowrap;margin:4px 0;font-family:"Times New Roman","Cambria Math","STIX Two Math",serif;font-weight:600;}

/* ===== PATCH: targeted table/diagram repairs (2026-06-03) ===== */
.codedFigure{overflow:visible !important;}
.codedFigure .dataTableScroll{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}
.codedFigure .dataTableFix{width:100%;border-collapse:collapse;table-layout:fixed;background:#fff;font-size:13px;line-height:1.35;}
.codedFigure .dataTableFix th,
.codedFigure .dataTableFix td{border:1px solid rgba(34,57,70,.38);padding:6px 5px;text-align:center;vertical-align:middle;word-break:keep-all;}
.codedFigure .dataTableFix th{background:#f3f7f8;font-weight:900;}
.codedFigure .dataTableFix th:first-child,
.codedFigure .dataTableFix td:first-child{text-align:left;}
.codedFigure .codedSvg{display:block;width:100%;height:auto;overflow:visible;}
.codedFigure .svgText{font-family:"Hiragino Sans","Yu Gothic","Meiryo",sans-serif;fill:#111;}
.codedFigure .svgSmall{font-size:15px;font-weight:700;}
.codedFigure .svgLabel{font-size:17px;font-weight:900;}
.codedFigure .svgMath{font-family:"Times New Roman","Cambria Math",serif;font-size:18px;font-style:italic;}
.codedFigure .qualityTableFix{font-size:10.5px;table-layout:fixed;}
.codedFigure .qualityTableFix th,
.codedFigure .qualityTableFix td{padding:4px 2px;line-height:1.25;}
.codedFigure .qualityTableFix .rowHead{width:31%;}
.codedFigure .qualityTableFix .smallCol{width:8.5%;}
.codedFigure .qualityTableFix .importanceCol{width:12%;}
.codedFigure .projectTableFix{font-size:12.5px;}
.inlineChoice .decisionTableChoiceScroll{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;margin-top:6px;}
.inlineChoice .decisionTableChoice{min-width:360px;width:100%;border-collapse:collapse;table-layout:fixed;background:#fff;font-size:12.5px;line-height:1.3;}
.inlineChoice .decisionTableChoice th,
.inlineChoice .decisionTableChoice td{border:1px solid rgba(34,57,70,.35);padding:5px 4px;text-align:center;vertical-align:middle;white-space:nowrap;}
.inlineChoice .decisionTableChoice th{background:#f3f7f8;font-weight:900;}
.inlineChoice .decisionTableChoice .sectionCell{width:58px;background:#eef6f8;}
.inlineChoice .decisionTableChoice .labelCell{text-align:left;width:98px;}



/* ===== Engineering color system trial v2 ===== */
:root {
  --primary:#1f6fb2;
  --primary-dark:#0f2a44;
  --primary-mid:#195a91;
  --primary-light:#2f8fc5;
  --accent:#52b6d8;
  --bg:#eef5fb;
  --surface:#ffffff;
  --surface-soft:#f7fbff;
  --line:#d5e4f1;
  --text:#102033;
  --muted:#64748b;
  --success:#14835d;
  --danger:#c2413b;
  --warning:#b7791f;
  --teal:#1f6fb2;
  --ok:#14835d;
  --ok-bg:#e4f6ee;
  --ng:#c2413b;
  --ng-bg:#fde9e7;
  --shadow:0 12px 32px rgba(15,42,68,.10);
}
html, body {
  background:
    linear-gradient(rgba(31,111,178,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31,111,178,.045) 1px, transparent 1px),
    linear-gradient(180deg,#edf5fc 0%, #f8fbfe 46%, #eaf3fa 100%) !important;
  background-size:32px 32px,32px 32px,auto !important;
  color:var(--text);
}
.app {
  position:relative;
  isolation:isolate;
  background:linear-gradient(180deg,#f9fcff 0%, #edf5fb 100%) !important;
}
.app::before {
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:-1;
  background:
    radial-gradient(circle at 12% 8%, rgba(47,143,197,.16), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(82,182,216,.13), transparent 32%);
}
.screen { position:relative; z-index:1; }
.hero,
.topbar,
.quiz-header {
  position:relative;
  overflow:hidden;
  background:
    linear-gradient(rgba(255,255,255,.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.10) 1px, transparent 1px),
    linear-gradient(135deg,#0f2a44 0%, #195a91 62%, #2f8fc5 100%) !important;
  background-size:28px 28px,28px 28px,auto !important;
  color:#fff;
  box-shadow:0 14px 36px rgba(15,42,68,.16);
}
.hero { border-bottom-left-radius:24px; border-bottom-right-radius:24px; }
.hero::after,
.topbar::after,
.quiz-header::after {
  content:"";
  position:absolute;
  right:16px;
  bottom:12px;
  width:74px;
  height:42px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:9px;
  background:
    linear-gradient(rgba(255,255,255,.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.13) 1px, transparent 1px);
  background-size:10px 10px;
  opacity:.36;
}
.topbar > *, .quiz-header > *, .hero > * { position:relative; }
.hero-title,
.topbar-title,
.quiz-title { letter-spacing:0; text-shadow:none; }
.home-buttons { gap:12px; }
.big-btn {
  position:relative;
  min-height:82px;
  border-radius:18px !important;
  padding:16px 18px 15px 22px !important;
  background:rgba(255,255,255,.94) !important;
  color:var(--text) !important;
  border:1px solid var(--line) !important;
  box-shadow:var(--shadow) !important;
  overflow:hidden;
}
.big-btn::before {
  content:"";
  position:absolute;
  left:0;
  top:14px;
  bottom:14px;
  width:4px;
  border-radius:0 999px 999px 0;
  background:linear-gradient(180deg,var(--primary-light),var(--primary-dark));
}
.big-btn::after { content:none !important; }
.big-btn small { color:var(--muted) !important; opacity:1 !important; }
.card,
.score-box,
.score-row,
.inlineChoice,
.figureWrap,
.block,
.sheet,
.category-list-btn,
.category-filter-btn,
.review-card,
.weak-card {
  background:rgba(255,255,255,.94) !important;
  border:1px solid var(--line) !important;
  box-shadow:var(--shadow) !important;
}
.card,
.score-box,
.figureWrap,
.sheet { border-radius:18px !important; }
.card-title,
.blockTitle,
.figureHead,
.sheetTitle { color:var(--primary-dark) !important; }
.action-btn,
.closeBtn,
.jump-btn.current,
.pill.active,
.category-filter-btn.active {
  background:linear-gradient(135deg,var(--primary-dark),var(--primary-mid),var(--primary-light)) !important;
  color:#fff !important;
  border:none !important;
  box-shadow:0 12px 26px rgba(31,111,178,.20) !important;
}
.action-btn.gray,
.nav-btn,
.pill,
.category-filter-btn,
.zoomBtn {
  background:rgba(255,255,255,.96) !important;
  color:var(--primary-dark) !important;
  border:1px solid rgba(31,111,178,.18) !important;
}
.action-btn,
.nav-btn,
.pill,
.choice,
.jump-btn,
.closeBtn,
.category-list-btn,
.category-filter-btn { min-height:44px; touch-action:manipulation; }
.nav-btn.quiz-return { color:var(--primary-dark) !important; }
.quiz-body { background:transparent; }
.qText {
  margin:12px 12px 10px;
  padding:16px 16px 14px !important;
  background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(246,250,254,.95));
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:var(--shadow);
  color:var(--text);
}
.line {
  height:3px !important;
  margin:10px 14px 0 !important;
  border-radius:999px;
  background:linear-gradient(90deg,var(--primary-dark),var(--primary-light)) !important;
}
.inlineChoice { border-radius:15px !important; color:var(--text); }
.answerDock {
  background:rgba(238,245,251,.94) !important;
  border-top:1px solid var(--line) !important;
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}
.choice {
  background:rgba(255,255,255,.98) !important;
  color:var(--text) !important;
  border:1px solid rgba(31,111,178,.12);
  box-shadow:0 8px 20px rgba(15,42,68,.09) !important;
}
.choice.correct,
.jump-btn.correct {
  background:#e4f6ee !important;
  color:#0f6a46 !important;
  border-color:rgba(20,131,93,.24) !important;
}
.choice.wrong,
.jump-btn.wrong {
  background:#fde9e7 !important;
  color:#a8322d !important;
  border-color:rgba(194,65,59,.24) !important;
}
.feedback.ok { background:linear-gradient(135deg,#0f6a46,#1ea672) !important; }
.feedback.ng { background:linear-gradient(135deg,#9f2d29,#d4554f) !important; }
.block p,
.bullet li,
.score-row,
.inlineHelp,
.small-note,
.legendItem { color:#22344d; line-height:1.78; }
.important-keyword,
.formula-keyword,
.answer-keyword { color:var(--primary-dark); }
.correct-keyword { color:#0f6a46; }
.wrong-keyword { color:#c2413b; }
.blankBox {
  border-color:var(--primary-dark) !important;
  color:var(--primary-dark);
  background:#f7fbff !important;
}
.modal { background:rgba(15,42,68,.48) !important; }
:root .choice.compact,
:root[data-font-scale="standard"] .choice.compact,
:root[data-font-scale="compact"] .choice.compact,
:root[data-font-scale="mini"] .choice.compact { min-height:44px !important; }
:root .dockRow.compact,
:root[data-font-scale="standard"] .dockRow.compact,
:root[data-font-scale="compact"] .dockRow.compact,
:root[data-font-scale="mini"] .dockRow.compact { min-height:44px !important; }
@media (max-width:430px) {
  .qText { margin:10px 10px 8px; padding:14px 14px 12px !important; }
  .big-btn { min-height:78px; }
  .home-buttons { padding-left:12px; padding-right:12px; }
}


/* ===== Engineering color system trial v3 ===== */
:root {
  --primary:#17679f;
  --primary-dark:#0b2d4b;
  --primary-mid:#155783;
  --primary-light:#3a91c3;
  --accent:#6bb8d6;
  --bg:#edf4fa;
  --surface:#ffffff;
  --surface-soft:#f6fbff;
  --line:#d9e7f1;
  --text:#102033;
  --muted:#66788a;
  --success:#16815f;
  --danger:#c94843;
  --warning:#b57918;
  --teal:#17679f;
  --ok:#16815f;
  --ok-bg:#e3f4ed;
  --ng:#c94843;
  --ng-bg:#fdebea;
  --shadow:0 10px 24px rgba(11,45,75,.105);
}
html, body {
  background:
    linear-gradient(rgba(23,103,159,.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23,103,159,.032) 1px, transparent 1px),
    linear-gradient(180deg,#edf4fa 0%,#f8fbfe 52%,#e9f2f8 100%) !important;
  background-size:40px 40px,40px 40px,auto !important;
  color:var(--text) !important;
}
.app {
  background:linear-gradient(180deg,#fbfdff 0%,#edf4fa 100%) !important;
}
.app::before { display:none !important; }
.hero,
.topbar,
.quiz-header {
  background:
    linear-gradient(rgba(255,255,255,.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.075) 1px, transparent 1px),
    linear-gradient(138deg,#0b2d4b 0%,#155783 66%,#3a91c3 100%) !important;
  background-size:34px 34px,34px 34px,auto !important;
  box-shadow:0 12px 30px rgba(11,45,75,.16) !important;
}
.hero::after,
.topbar::after,
.quiz-header::after {
  width:88px !important;
  height:34px !important;
  border-radius:6px !important;
  border-color:rgba(255,255,255,.13) !important;
  background:
    linear-gradient(rgba(255,255,255,.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.11) 1px, transparent 1px) !important;
  background-size:12px 12px !important;
  opacity:.22 !important;
}
.hero-title,
.topbar-title,
.quiz-title {
  letter-spacing:0 !important;
  text-shadow:none !important;
  font-weight:850 !important;
}
.hero-title { font-size:32px !important; line-height:1.24 !important; }
.topbar-title { font-size:20px !important; }
.quiz-title { font-size:20px !important; }
.topbar-sub,
.quiz-sub { color:rgba(255,255,255,.84) !important; font-weight:700 !important; }
.home-buttons { gap:11px !important; }
.big-btn {
  min-height:78px !important;
  border-radius:14px !important;
  padding:16px 17px 15px 21px !important;
  background:rgba(255,255,255,.96) !important;
  color:var(--text) !important;
  border:1px solid var(--line) !important;
  box-shadow:var(--shadow) !important;
}
.big-btn::before {
  top:15px !important;
  bottom:15px !important;
  width:3px !important;
  border-radius:0 999px 999px 0 !important;
  background:linear-gradient(180deg,var(--primary-light),var(--primary-dark)) !important;
}
.big-btn::after { content:none !important; }
.big-btn small { color:var(--muted) !important; opacity:1 !important; }
.card,
.score-box,
.score-row,
.inlineChoice,
.figureWrap,
.block,
.sheet,
.category-list-btn,
.category-filter-btn,
.review-card,
.weak-card,
.miniBox {
  background:rgba(255,255,255,.96) !important;
  border:1px solid var(--line) !important;
  box-shadow:var(--shadow) !important;
}
.card,
.score-box,
.figureWrap,
.sheet { border-radius:16px !important; }
.card-title,
.blockTitle,
.figureHead,
.sheetTitle { color:var(--primary-dark) !important; }
.action-btn,
.closeBtn,
.jump-btn.current,
.pill.active,
.category-filter-btn.active {
  background:linear-gradient(135deg,var(--primary-dark),var(--primary-mid),var(--primary-light)) !important;
  color:#fff !important;
  border:none !important;
  box-shadow:0 10px 22px rgba(23,103,159,.20) !important;
}
.action-btn.gray,
.nav-btn,
.pill,
.category-filter-btn,
.zoomBtn {
  background:rgba(255,255,255,.97) !important;
  color:var(--primary-dark) !important;
  border:1px solid rgba(23,103,159,.18) !important;
}
.action-btn,
.nav-btn,
.pill,
.choice,
.jump-btn,
.closeBtn,
.category-list-btn,
.category-filter-btn { min-height:44px !important; touch-action:manipulation; }
.qText {
  margin:10px 10px 8px !important;
  padding:14px 14px 12px !important;
  background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(246,251,255,.96)) !important;
  border:1px solid var(--line) !important;
  border-radius:16px !important;
  box-shadow:var(--shadow) !important;
  color:var(--text) !important;
}
.line {
  height:3px !important;
  margin:9px 14px 0 !important;
  border-radius:999px !important;
  background:linear-gradient(90deg,var(--primary-dark),var(--primary-light)) !important;
}
.answerDock {
  background:rgba(237,244,250,.95) !important;
  border-top:1px solid var(--line) !important;
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}
.choice {
  background:rgba(255,255,255,.985) !important;
  color:var(--text) !important;
  border:1px solid rgba(23,103,159,.12) !important;
  box-shadow:0 7px 18px rgba(11,45,75,.09) !important;
}
.choice.correct,
.jump-btn.correct {
  background:#e3f4ed !important;
  color:#0e674a !important;
  border-color:rgba(22,129,95,.24) !important;
}
.choice.wrong,
.jump-btn.wrong {
  background:#fdebea !important;
  color:#a83834 !important;
  border-color:rgba(201,72,67,.24) !important;
}
.feedback.ok { background:linear-gradient(135deg,#0e674a,#1b9b72) !important; }
.feedback.ng { background:linear-gradient(135deg,#9f342f,#d0544f) !important; }
.block p,
.bullet li,
.score-row,
.inlineHelp,
.small-note,
.legendItem { color:#22344d !important; }
.important-keyword,
.formula-keyword,
.answer-keyword { color:var(--primary-dark) !important; }
.correct-keyword { color:#0e674a !important; }
.wrong-keyword { color:#c94843 !important; }
.blankBox {
  border-color:var(--primary-dark) !important;
  color:var(--primary-dark) !important;
  background:#f7fbff !important;
}
.modal { background:rgba(11,45,75,.48) !important; }
@media (max-width:430px) {
  .hero-title { font-size:30px !important; }
  .qText { margin:10px 10px 8px !important; }
  .big-btn { min-height:76px !important; }
}


/* ===== Subject portal return button ===== */
.subject-top-home-btn {
  appearance:none;
  display:flex;
  align-items:center;
  justify-content:center;
  width:calc(100% - 28px);
  min-height:44px;
  margin:14px 14px 0;
  padding:10px 14px;
  border-radius:14px;
  border:1px solid rgba(23,103,159,.22);
  background:rgba(255,255,255,.96);
  color:var(--primary-dark, #0b2d4b);
  box-shadow:0 8px 20px rgba(11,45,75,.09);
  font-size:14px;
  font-weight:850;
  letter-spacing:0;
  text-decoration:none;
  cursor:pointer;
  touch-action:manipulation;
}
.subject-top-home-btn:active { transform:translateY(1px); }


/* ===== fixed page navigation ===== */
.fixed-page-nav {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: 12px;
  z-index: 78;
  display: none;
  flex-direction: column;
  align-items: flex-end;
  max-width: calc(100% - 24px);
}
.fixed-page-nav.is-visible { display: flex; }
.fixed-page-nav.modal-active {
  z-index: 92;
}
.sheetTop {
  position: sticky;
  top: -16px;
  z-index: 4;
  padding-top: 4px;
  background: #f8f8f8;
}
@media (max-width: 430px) {
  .fixed-page-nav {
    right: max(12px, env(safe-area-inset-right));
  }
}



/* ===== responsive fit: PC / iPad / iPhone ===== */
@media (max-width: 699px) {
  .app { max-width: 430px; margin: 0 auto; border-radius: 0; }
  .answerDock { width: min(430px, 100%); }
}
@media (min-width: 700px) {
  html, body { background: linear-gradient(180deg, #eaf3fa 0%, #f7fbff 100%); }
  .app {
    max-width: min(760px, calc(100vw - 48px));
    margin: 20px auto;
    min-height: calc(100vh - 40px);
    border-radius: 28px;
    overflow-x: hidden;
    box-shadow: 0 22px 54px rgba(11, 45, 75, .14);
  }
  .answerDock { width: min(760px, calc(100vw - 48px)); }
  .sheet { width: min(720px, calc(100% - 24px)); }
  .modal { padding: 24px; }
  .hero { padding-left: 34px; padding-right: 34px; }
  .home-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .home-wide, .big-btn.home-wide { grid-column: 1 / -1; }
  .section-pad { padding: 20px; }
  #yearMenuScreen .section-pad,
  #scoreYearScreen .section-pad,
  #categoryScreen .section-pad,
  #calcCategoryScreen .section-pad {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .quiz-body { padding-left: 20px; padding-right: 20px; }
  .qText { font-size: 22px; line-height: 1.65; }
  .stmt { font-size: 18px; line-height: 1.65; }
  .figureWrap, .question-figure-block, .explain-figure, .explain-figure-inline { max-width: 100%; }
  .quiz-floating, .fixed-page-nav {
    right: max(24px, calc((100vw - 760px) / 2 + 18px));
    max-width: calc(min(760px, 100vw - 48px) - 36px);
  }
  .quiz-floating .nav-row { flex-wrap: nowrap; }
  .quiz-floating .nav-btn { white-space: nowrap; }
  .quiz-header { padding-top: 94px !important; }
}
@media (min-width: 1100px) {
  .app { max-width: min(960px, calc(100vw - 72px)); }
  .answerDock { width: min(960px, calc(100vw - 72px)); }
  .home-buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #yearMenuScreen .section-pad,
  #scoreYearScreen .section-pad,
  #categoryScreen .section-pad,
  #calcCategoryScreen .section-pad {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .qText { font-size: 23px; line-height: 1.68; }
  .quiz-floating, .fixed-page-nav {
    right: max(36px, calc((100vw - 960px) / 2 + 18px));
    max-width: calc(min(960px, 100vw - 72px) - 36px);
  }
}

/* 令和元年度（再）: long-form reading and text-based formula layout */
.qText.r1re-readable > p {
  margin: 0 0 1.05em;
  line-height: 1.78;
}
.qText.r1re-readable > p:last-of-type {
  margin-bottom: 0;
}
.qText.r1re-readable.long-question {
  line-height: 1.8;
}
.qText.r1re-readable .questionLead {
  font-weight: 700;
}
.qText.r1re-readable .statementLine {
  padding-left: 2.5em;
  text-indent: -2.5em;
}
.qText.r1re-readable .statementMarker {
  display: inline-block;
  min-width: 2.35em;
  font-weight: 800;
  color: var(--primary-dark);
}
.qText.r1re-readable .conditionLine {
  padding-left: 1.25em;
  text-indent: -1.25em;
  margin-bottom: .55em;
}
.qText.r1re-readable .sourceNote {
  color: var(--muted);
  font-size: .86em;
  text-align: right;
}
.qText.r1re-readable br.readingBreak {
  display: block;
  content: "";
  margin-top: .65em;
}
.qText.r1re-readable .formulaDisplay {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  box-sizing: border-box;
  margin: .55em 0 1em;
  padding: .62em .72em;
  border: 1px solid rgba(45,108,123,.22);
  border-radius: 11px;
  background: #eef8fb;
  color: #225f70;
  font-family: "Times New Roman","Cambria Math","STIX Two Math",serif;
  font-weight: 700;
}
.qText.r1re-readable .formulaDisplay .mathEquation {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: .45em;
  white-space: normal;
}
.qText.r1re-readable .formulaDisplay .formulaStack {
  width: 100%;
  min-width: 0;
}
.qText.r1re-readable .formulaDisplay .formulaLine {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  flex-wrap: wrap;
  white-space: normal;
}
.qText.r1re-readable .formula-label {
  display: inline-flex;
  min-width: 0;
  max-inline-size: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  flex-wrap: nowrap;
}
.qText.r1re-readable .inlineChoice.hasFormulaChoice > .formula-label,
.qText.r1re-readable .inlineChoice.hasFormulaChoice > .choiceFormulaSet {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: normal;
  flex-wrap: wrap;
}
.qText.r1re-readable .inlineChoice,
.qText.r1re-readable .choiceFormulaSet {
  min-width: 0;
  overflow-wrap: anywhere;
}
.qText.r1re-readable .inlineChoice.hasFormulaChoice > .choiceFormulaSet {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: .28em;
}
.qText.r1re-readable .choiceFormulaSet .formulaTerm {
  white-space: normal;
  min-width: 0;
  overflow-wrap: anywhere;
}
.qText .formula-label sup,
.qText .formulaDisplay sup,
.qText .choiceFormulaSet sup,
#modalBody .formula-label sup,
#modalBody .formulaDisplay sup,
#modalBody .choiceFormulaSet sup {
  display: inline-block;
  position: relative;
  top: -.42em;
  font-size: .68em;
  line-height: 0;
  vertical-align: super;
}
.qText .formula-label sub,
.qText .formulaDisplay sub,
.qText .choiceFormulaSet sub,
#modalBody .formula-label sub,
#modalBody .formulaDisplay sub,
#modalBody .choiceFormulaSet sub {
  display: inline-block;
  position: relative;
  bottom: -.22em;
  font-size: .68em;
  line-height: 0;
  vertical-align: sub;
}
.mathNthRoot {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  margin-right: .12em;
}
.mathNthRoot > sup,
.qText .formulaDisplay .mathNthRoot > sup,
#modalBody .formulaDisplay .mathNthRoot > sup {
  position: absolute;
  left: -.18em;
  top: -.28em;
  bottom: auto;
  font-size: .55em;
  line-height: 1;
  vertical-align: baseline;
}
.mathNthRoot .radical {
  font-size: 1.45em;
  line-height: .95;
}
.mathNthRoot .radicand {
  border-top: 1.5px solid currentColor;
  padding: .08em .12em 0;
}



/* Keep the existing navigation above, rather than on top of, the quiz heading. */
[hidden] { display: none !important; }
#dockList .choice { width: 100%; font-family: inherit; cursor: pointer; }
#dockList .choice.compact { min-height: 44px !important; }
#dockList .choice:focus-visible { outline: 3px solid #146ca5; outline-offset: 2px; }
@media (max-width: 699px) {
  .quiz-header { padding-top: calc(108px + env(safe-area-inset-top, 0px)) !important; }
  .quiz-floating, .fixed-page-nav { right: max(12px, env(safe-area-inset-right, 0px)); max-width: calc(100% - 24px); }
  .quiz-floating .nav-row, .fixed-page-nav .nav-row { flex-wrap: wrap; justify-content: flex-end; }
  .quiz-floating .nav-btn, .fixed-page-nav .nav-btn { min-height: 44px; white-space: nowrap; }
}
#localSaveNotice {
  position: fixed; z-index: 20000; top: max(8px, env(safe-area-inset-top, 0px));
  left: 12px; right: 12px; margin: auto; max-width: 640px;
  display: flex; align-items: center; gap: 12px; box-sizing: border-box;
  padding: 12px 16px; border: 1px solid #b45309; border-radius: 8px;
  background: #fff7ed; color: #7c2d12; font: 15px/1.5 sans-serif;
  box-shadow: 0 4px 16px rgba(0,0,0,.16);
}
#localSaveNotice span { min-width: 0; overflow-wrap: anywhere; }
#localSaveNotice button { min-width: 76px; min-height: 44px; flex-shrink: 0; }


/* Only menu screens are themed. Quiz content, formulas and explanation dialogs retain their styles. */
body[data-subject-theme] { --menu-accent:#206dac; --menu-tint:#e8f2fb; --menu-brand:#15598f; --menu-ink:#18334a; --menu-muted:#596e7f; --menu-line:#d4e1eb; --menu-font:18px; --menu-small:12px; --menu-heading:28px; }
body[data-subject-theme="tekisei"] { --menu-accent:#23745e; --menu-tint:#e7f3ed; }
body[data-subject-theme="senmon"] { --menu-accent:#a65421; --menu-tint:#fcf0e2; }
html[data-font-scale="standard"] body[data-subject-theme] { --menu-font:20px; --menu-small:14px; --menu-heading:30px; }
html[data-font-scale="mini"] body[data-subject-theme] { --menu-font:16px; --menu-small:11px; --menu-heading:25px; }
body[data-subject-theme] .screen:not([id="quizScreen"]) { background:#eef3f8; color:var(--menu-ink); }
body[data-subject-theme] .screen:not([id="quizScreen"]) :is(.hero,.topbar) {
  position:relative !important;
  background:var(--menu-brand) !important;
  color:#fff !important;
  border-radius:0 !important;
  border-bottom:3px solid #74c1de;
  box-shadow:none !important;
  text-align:left !important;
  padding:calc(78px + env(safe-area-inset-top,0px)) 24px 24px !important;
}
body[data-subject-theme] .screen:not([id="quizScreen"]) :is(.hero,.topbar)::before,
body[data-subject-theme] .screen:not([id="quizScreen"]) :is(.hero,.topbar)::after { content:none !important; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .topbar-title { font-size:calc(var(--menu-heading) - 4px) !important; line-height:1.35 !important; font-weight:750 !important; letter-spacing:0 !important; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .topbar-sub { font-size:var(--menu-small) !important; line-height:1.65 !important; margin-top:7px; font-weight:500 !important; opacity:.9; }
body[data-subject-theme] #homeScreen { position:relative; }
body[data-subject-theme] #homeScreen .hero { display:grid; grid-template-columns:minmax(0,1fr) 154px; align-items:center; gap:12px; }
body[data-subject-theme] #homeScreen .hero-title { font-size:var(--menu-heading) !important; line-height:1.35 !important; font-weight:750 !important; letter-spacing:0 !important; text-shadow:none !important; max-width:none !important; }
body[data-subject-theme] #homeScreen .hero-title h1 { margin:5px 0 4px; font:inherit; color:#fff; }
body[data-subject-theme] #homeScreen .subject-eyebrow { display:block; font-size:12px; line-height:1.5; font-weight:500; color:#e2eff8; }
body[data-subject-theme] #homeScreen .subject-caption { display:block; font-size:var(--menu-small); line-height:1.65; font-weight:500; color:#e2eff8; }
body[data-subject-theme] #homeScreen .subject-hero-art { display:block; width:154px; height:112px; pointer-events:none; }
body[data-subject-theme] #homeScreen .subject-hero-art svg { width:100%; height:100%; display:block; }
body[data-subject-theme] #subjectTopHomeBtn {
  position:absolute !important; left:20px !important; top:calc(14px + env(safe-area-inset-top,0px)) !important; right:auto !important;
  z-index:45; display:flex; align-items:center; gap:4px; width:auto !important; max-width:calc(100% - 178px); min-height:44px !important;
  margin:0 !important; padding:0 4px !important; border:0 !important; border-radius:4px !important;
  background:transparent !important; box-shadow:none !important; color:#fff !important; font-family:inherit; font-size:12px; font-weight:600; line-height:1.4; text-decoration:none;
}
body[data-subject-theme] #subjectTopHomeBtn svg { flex:0 0 16px; width:16px; height:16px; }
body[data-subject-theme] #homeScreen .home-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; padding:22px 22px max(32px,env(safe-area-inset-bottom,0px)) !important; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .big-btn {
  position:relative; min-width:0; min-height:82px !important; margin:0; padding:18px 18px !important;
  background:#fff !important; border:1px solid var(--menu-line) !important; border-radius:8px !important;
  box-shadow:0 4px 12px rgba(28,57,78,.05) !important; color:var(--menu-ink) !important;
  font-family:inherit; font-size:var(--menu-font) !important; font-weight:700 !important; line-height:1.4 !important; letter-spacing:0 !important;
  text-shadow:none !important; white-space:normal; overflow-wrap:anywhere;
}
body[data-subject-theme] .screen:not([id="quizScreen"]) .big-btn::before,
body[data-subject-theme] .screen:not([id="quizScreen"]) .big-btn::after { content:none !important; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .big-btn small { display:block; margin-top:7px !important; padding:0 !important; font-size:var(--menu-small) !important; line-height:1.65 !important; font-weight:500 !important; color:var(--menu-muted) !important; opacity:1; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .big-btn[disabled] { color:#60717d !important; background:#f3f6f8 !important; border-color:#dce4ea !important; box-shadow:none !important; opacity:.65; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .big-btn.gray { grid-column:1/-1; min-height:52px !important; border-color:transparent !important; background:transparent !important; box-shadow:none !important; color:#285779 !important; }
body[data-subject-theme] #homeScreen .home-card { grid-column:auto !important; min-height:144px !important; padding:57px 16px 17px !important; display:block; }
body[data-subject-theme] #homeScreen .menu-label { display:block; padding-right:0; }
body[data-subject-theme] .menu-icon { position:absolute; display:grid; place-items:center; left:16px; top:17px; width:28px; height:28px; color:var(--menu-accent); pointer-events:none; }
body[data-subject-theme] .menu-icon svg { display:block; width:25px; height:25px; }
body[data-subject-theme] .menu-arrow { position:absolute; right:16px; top:21px; display:block; width:18px; height:18px; color:#6990ab; pointer-events:none; }
body[data-subject-theme] .menu-arrow svg { display:block; width:100%; height:100%; }
body[data-subject-theme] #homeScreen #openPastMenuBtn { grid-column:1/-1 !important; min-height:108px !important; padding:24px 44px 24px 76px !important; background:var(--menu-accent) !important; color:#fff !important; border-color:var(--menu-accent) !important; font-size:calc(var(--menu-font) + 3px) !important; }
body[data-subject-theme] #openPastMenuBtn small { color:#fff !important; opacity:.9 !important; }
body[data-subject-theme] #openPastMenuBtn .menu-icon { left:22px; top:31px; width:35px; height:35px; color:#fff; }
body[data-subject-theme] #openPastMenuBtn .menu-icon svg { width:33px; height:33px; }
body[data-subject-theme] #openPastMenuBtn .menu-arrow { top:42px; right:20px; color:#fff; }
body[data-subject-theme] #homeScreen :is(#resumeYearBtn,#resumeCategoryBtn) { grid-column:1/-1 !important; min-height:85px !important; padding:18px 36px 18px 60px !important; background:var(--menu-tint) !important; border-color:#bbd0df !important; }
body[data-subject-theme] #homeScreen :is(#resumeYearBtn,#resumeCategoryBtn) .menu-icon { top:24px; }
body[data-subject-theme] #homeScreen :is(#resumeYearBtn,#resumeCategoryBtn) .menu-arrow { top:31px; }
body[data-subject-theme] #openReviewPriorityBtn .menu-icon { color:#23745e; }
body[data-subject-theme] #openWeakDrillBtn .menu-icon { color:#a65421; }
body[data-subject-theme] #openScoreYearBtn .menu-icon { color:#206dac; }
body[data-subject-theme] #openSettingsBtn .menu-icon { color:#5d7180; }
body[data-subject-theme] #homeScreen #openSettingsBtn { background:#fff !important; border-color:var(--menu-line) !important; color:var(--menu-ink) !important; box-shadow:0 4px 12px rgba(28,57,78,.05) !important; }
body[data-subject-theme] #homeScreen #homeProgressCard { grid-column:1/-1; background:transparent !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; padding:12px 0 10px !important; margin:0 !important; }
body[data-subject-theme] #homeScreen .home-progress-title { font-size:16px !important; font-weight:700; color:var(--menu-ink); margin:0 0 13px; }
body[data-subject-theme] #homeScreen .home-progress-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0; }
body[data-subject-theme] #homeScreen .home-progress-item { min-width:0; background:transparent !important; border-radius:0 !important; box-shadow:none !important; padding:9px 14px !important; border-left:1px solid #c9d9e5; }
body[data-subject-theme] #homeScreen .home-progress-item:nth-child(odd) { border-left:0; padding-left:0 !important; }
body[data-subject-theme] #homeScreen .home-progress-item b { font-size:var(--menu-small) !important; font-weight:500 !important; color:var(--menu-muted); margin-bottom:3px; }
body[data-subject-theme] #homeScreen .home-progress-item span { display:block; font-size:27px !important; line-height:1.3; font-weight:750; color:var(--menu-ink); font-variant-numeric:tabular-nums; }
body[data-subject-theme] #homeScreen #homeWeakCategory { font-size:13px !important; line-height:1.65 !important; overflow-wrap:anywhere; }
body[data-subject-theme] .screen:not([id="quizScreen"]) > .section-pad { padding:22px !important; }
body[data-subject-theme] #pastMenuScreen .section-pad { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
body[data-subject-theme] #homeScreen :is(#openWeakDrillBtn,#openCalcTrainingBtn) { display:none !important; }
body[data-subject-theme] #pastMenuScreen .big-btn:not(.gray) { justify-content:flex-start; min-height:158px !important; padding:57px 16px 18px !important; }
body[data-subject-theme] #pastMenuScreen #openYearMenuBtn { border-top:3px solid var(--menu-accent) !important; }
body[data-subject-theme] #pastMenuScreen #openCategoryFromPastBtn { border-top:3px solid #23745e !important; }
body[data-subject-theme] :is(#yearMenuScreen,#scoreYearScreen) .section-pad { gap:12px; }
body[data-subject-theme] :is(#yearMenuScreen,#scoreYearScreen) .big-btn:not(.gray) { min-height:108px !important; border-top:2px solid #b6d2e5 !important; padding:18px 16px !important; }
body[data-subject-theme] :is(#yearMenuScreen,#scoreYearScreen) .big-btn small { margin-top:5px !important; }
body[data-subject-theme] #yearMenuScreen .year-progress { margin-top:12px; }
body[data-subject-theme] #yearMenuScreen .year-progress-top { display:flex; flex-wrap:wrap; gap:4px 10px; font-size:11px !important; font-weight:500 !important; line-height:1.5; color:var(--menu-muted); }
body[data-subject-theme] #yearMenuScreen .year-progress-bar { height:4px; background:#e7eef4; box-shadow:none; }
body[data-subject-theme] #yearMenuScreen .year-progress-bar i { background:var(--menu-accent) !important; }
body[data-subject-theme] #yearMenuScreen .year-tools-card { border:1px solid var(--menu-line); border-radius:8px; background:#fff; box-shadow:none; padding:18px; }
body[data-subject-theme] #categoryScreen .section-pad > .small-note,
body[data-subject-theme] #calcCategoryScreen .section-pad > .small-note { grid-column:1/-1; margin:0; padding:0 0 8px; font-size:var(--menu-small); line-height:1.7; }
body[data-subject-theme] #categoryScreen > .section-pad { grid-template-columns:repeat(2,minmax(0,1fr)); }
body[data-subject-theme] .screen:not([id="quizScreen"]) .category-cards { grid-column:1/-1; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
body[data-subject-theme] #categoryScreen .category-card.full { grid-column:auto; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .category-card { min-width:0; padding:18px; border:1px solid var(--menu-line); border-top:3px solid var(--menu-accent); border-radius:8px; box-shadow:0 4px 12px rgba(28,57,78,.04); gap:12px; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .category-card-title { font-size:var(--menu-font); font-weight:700; color:var(--menu-ink); line-height:1.5; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .category-card-sub { font-size:var(--menu-small); font-weight:500; line-height:1.8; color:var(--menu-muted); }
body[data-subject-theme] .screen:not([id="quizScreen"]) .category-action-row { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:auto; }
body[data-subject-theme] .screen:not([id="quizScreen"]) :is(.category-mini-btn,.action-btn,.setting-chip) { font-family:inherit; min-height:44px !important; border-radius:6px !important; box-shadow:none !important; font-weight:600 !important; line-height:1.5; letter-spacing:0; white-space:normal; overflow-wrap:anywhere; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .category-mini-btn { padding:10px 8px; font-size:12px; border:1px solid #cbdce8; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .category-mini-btn.main { background:#246b9e !important; color:#fff !important; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .category-mini-btn.alt { background:#e8f4ed !important; color:#216650 !important; border-color:#bcd8ca; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .category-mini-btn.random { background:#fff !important; color:#285b7f !important; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .category-mini-btn.score { grid-column:auto; background:#f2f5f8 !important; color:#536b7d !important; border-color:transparent; }
body[data-subject-theme="tekisei"] #categoryScreen .category-mini-btn.score { grid-column:1/-1; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .category-mini-btn:disabled { opacity:.48; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .action-btn { font-size:calc(var(--menu-font) - 3px) !important; padding:12px 14px !important; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .action-btn.teal { background:#246b9e !important; color:#fff !important; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .action-btn.gray { background:#fff !important; color:#285b7f !important; border:1px solid var(--menu-line); }
body[data-subject-theme] .screen:not([id="quizScreen"]) .action-btn.danger { background:#fff1ef !important; border:1px solid #edc9c4 !important; color:#a13932 !important; }
body[data-subject-theme] .screen:not([id="quizScreen"]) :is(.score-dashboard-card,.score-chart-card,.score-insight-card,.card) { border-radius:0 !important; background:transparent !important; box-shadow:none !important; border:0 !important; border-bottom:1px solid var(--menu-line) !important; padding:18px 0 !important; }
body[data-subject-theme] .screen:not([id="quizScreen"]) :is(.score-metric-card,.score-box,.category-score-item) { border:1px solid var(--menu-line); border-radius:8px !important; background:#fff !important; box-shadow:none !important; }
body[data-subject-theme] .screen:not([id="quizScreen"]) :is(.score-card-title,.card-title) { font-size:var(--menu-font); line-height:1.45; color:var(--menu-ink); }
body[data-subject-theme] .screen:not([id="quizScreen"]) :is(.score-card-sub,.score-row,.small-note) { font-weight:500; line-height:1.7; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .setting-chip { background:#fff; border:1px solid var(--menu-line); color:var(--menu-ink); }
body[data-subject-theme] .screen:not([id="quizScreen"]) .setting-chip.active { background:#246b9e !important; border-color:#246b9e; color:#fff; }
body[data-subject-theme] .screen:not([id="quizScreen"]) .year-tools-select { font-family:inherit; min-height:44px !important; border-radius:6px; }
body[data-subject-theme] .screen:not([id="quizScreen"]) :is(button,a):focus-visible { outline:3px solid #e8ae42; outline-offset:3px; }
@media (hover:hover) {
  body[data-subject-theme] .screen:not([id="quizScreen"]) .big-btn:not(:disabled):hover { border-color:var(--menu-accent) !important; box-shadow:0 6px 18px rgba(28,57,78,.10) !important; }
}
@media (min-width:700px) {
  body[data-subject-theme] #homeScreen .hero { padding-right:34px !important; padding-left:34px !important; grid-template-columns:minmax(0,1fr) 180px; }
  body[data-subject-theme] #homeScreen .subject-hero-art { width:180px; height:125px; }
  body[data-subject-theme] #homeScreen .home-buttons { padding:26px 30px 40px !important; }
  body[data-subject-theme] #homeScreen .home-progress-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
  body[data-subject-theme] #homeScreen .home-progress-item:nth-child(odd) { border-left:1px solid #c9d9e5; padding-left:14px !important; }
  body[data-subject-theme] #homeScreen .home-progress-item:first-child { border-left:0; padding-left:0 !important; }
  body[data-subject-theme] #homeScreen .home-card:not(#openPastMenuBtn):not(#resumeYearBtn):not(#resumeCategoryBtn) { min-height:118px !important; padding:22px 42px 22px 62px !important; }
  body[data-subject-theme] #homeScreen .home-card .menu-icon { top:24px; }
}
@media (max-width:699px) {
  body[data-subject-theme] #homeScreen .hero { grid-template-columns:minmax(0,1fr) 110px; padding:calc(76px + env(safe-area-inset-top,0px)) 20px 22px !important; }
  body[data-subject-theme] #homeScreen .subject-hero-art { width:110px; height:88px; }
  body[data-subject-theme] #homeScreen .home-buttons { padding:18px 16px 28px !important; gap:12px; }
  body[data-subject-theme] #subjectTopHomeBtn { left:12px !important; font-size:12px !important; font-weight:600 !important; }
  body[data-subject-theme] .screen:not([id="quizScreen"]) > .section-pad { padding:18px 16px !important; }
  body[data-subject-theme] #categoryScreen > .section-pad,
  body[data-subject-theme] .screen:not([id="quizScreen"]) .category-cards { grid-template-columns:minmax(0,1fr); }
  body[data-subject-theme] #pastMenuScreen .section-pad { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
}
@media (max-width:359px) {
  body[data-subject-theme] #homeScreen .hero { grid-template-columns:minmax(0,1fr) 90px; gap:5px; padding-left:16px !important; padding-right:16px !important; }
  body[data-subject-theme] #homeScreen .subject-hero-art { width:90px; height:82px; }
  body[data-subject-theme] #homeScreen .home-buttons { gap:10px; padding-left:12px !important; padding-right:12px !important; }
  body[data-subject-theme] #homeScreen .home-card { padding-left:13px !important; padding-right:13px !important; }
  body[data-subject-theme] #homeScreen #openPastMenuBtn { padding-left:68px !important; }
  body[data-subject-theme] #homeScreen :is(#resumeYearBtn,#resumeCategoryBtn) { padding-left:52px !important; }
  body[data-subject-theme] #yearMenuScreen .section-pad { grid-template-columns:minmax(0,1fr); }
}
@media (prefers-reduced-motion:reduce) { body[data-subject-theme] .screen:not([id="quizScreen"]) button { transition:none !important; } }


body[data-subject-theme].score-browser-open > .app { overflow:visible !important; }
/* Score views only; quiz, explanations and home retain their current appearance. */
body[data-subject-theme] :is(#scoreYearScreen,#scoreScreen,#categoryScoreScreen) { --score-ink:#18334a; --score-muted:#536b7d; }
body[data-subject-theme] #scoreYearScreen > .section-pad { display:block; }
body[data-subject-theme] .score-tabs { display:flex; gap:0; background:#f3f7fa; border-bottom:1px solid #bdd0df; position:sticky; top:calc(72px + env(safe-area-inset-top,0px)); z-index:30; margin:0 0 22px; }
body[data-subject-theme] .score-tab { flex:1; min-width:0; min-height:48px; padding:10px 4px; border:0; border-bottom:3px solid transparent; border-radius:0; background:transparent; box-shadow:none; color:#506779; font-weight:600; line-height:1.4; font-family:inherit; font-size:15px; letter-spacing:0; }
body[data-subject-theme] .score-tab[aria-selected="true"] { border-bottom-color:var(--menu-accent); background:#fff; color:var(--menu-accent); font-weight:750; }
body[data-subject-theme] :is(.score-tab,.score-mode-btn):focus-visible { outline:3px solid #2692cf; outline-offset:-3px; }
body[data-subject-theme] #scoreYearScreen [hidden] { display:none !important; }
body[data-subject-theme] .score-section-title { margin:0 0 14px; color:var(--score-ink); font-size:19px; font-weight:750; line-height:1.5; letter-spacing:0; }
body[data-subject-theme] .score-scope { color:var(--score-muted); font-size:13px; line-height:1.6; margin:0 0 18px; }
body[data-subject-theme] .score-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; margin:0 0 24px; border-block:1px solid #cbdbe6; padding-block:14px; }
body[data-subject-theme] .score-kpi { min-width:0; padding:5px 14px; border-left:1px solid #cbdbe6; }
body[data-subject-theme] .score-kpi:first-child { border-left:0; padding-left:0; }
body[data-subject-theme] .score-kpi span { display:block; font-size:13px; color:var(--score-muted); line-height:1.5; }
body[data-subject-theme] .score-kpi strong { display:block; color:var(--score-ink); font-size:29px; font-weight:750; line-height:1.6; font-variant-numeric:tabular-nums; }
body[data-subject-theme] .score-kpi small { display:block; font-size:12px; color:var(--score-muted); line-height:1.6; }
body[data-subject-theme] .score-kpi:last-child strong { color:#ad3737; }
body[data-subject-theme] :is(#scoreYearScreen,#scoreScreen,#categoryScoreScreen) :is(.score-dashboard-card,.score-chart-card,.score-insight-card,.score-metric-card) { background:transparent; box-shadow:none; border:0; border-radius:0; }
body[data-subject-theme] #scoreYearScreen .score-dashboard-card { padding:0; margin:0; }
body[data-subject-theme] .score-balance-grid { display:grid; grid-template-columns:minmax(200px,280px) minmax(0,1fr); align-items:center; gap:20px; }
body[data-subject-theme] .score-balance-grid .radar-chart { width:100%; max-width:280px; margin:0 auto; }
body[data-subject-theme] .score-balance-grid .radar-legend { display:block; margin:0; }
body[data-subject-theme] .score-balance-grid .radar-legend-item { display:flex; align-items:center; justify-content:space-between; gap:8px; border:0; border-bottom:1px solid #d7e2ea; border-radius:0; background:transparent; box-shadow:none; padding:11px 0; }
body[data-subject-theme] .radar-legend-item b { font-size:13px; line-height:1.5; min-width:0; }
body[data-subject-theme] .radar-legend-item span { font-size:13px; line-height:1.5; color:var(--score-muted); text-align:right; font-variant-numeric:tabular-nums; }
body[data-subject-theme] .score-year-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
body[data-subject-theme] #scoreYearScreen .score-year-grid .big-btn { display:block; min-height:78px !important; padding:14px 16px !important; border:1px solid #d4e1eb !important; box-shadow:none !important; text-align:left; font-size:17px !important; }
body[data-subject-theme] #scoreYearScreen .score-year-grid .big-btn small { font-size:12px !important; }
body[data-subject-theme] #scoreYearScreen .score-year-grid .big-btn:last-child { grid-column:auto; }
body[data-subject-theme] .score-mode-picker { display:flex; gap:0; max-width:340px; margin:0 0 18px; border:1px solid #c1d3e0; border-radius:6px; overflow:hidden; }
body[data-subject-theme] .score-mode-btn { flex:1; min-height:46px; padding:9px; border:0; border-radius:0; background:#fff; color:var(--score-muted); box-shadow:none; font-family:inherit; font-size:14px; font-weight:600; }
body[data-subject-theme] .score-mode-btn[aria-pressed="true"] { background:var(--menu-accent); color:#fff; }
body[data-subject-theme] #scoreYearScreen .score-category-menu,
body[data-subject-theme] #scoreYearScreen .score-category-dynamic-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
body[data-subject-theme] #scoreYearScreen .score-category-dynamic-buttons { grid-column:1/-1; }
body[data-subject-theme] #scoreYearScreen .score-category-menu .category-mini-btn { min-width:0; min-height:74px; padding:14px; border:1px solid #d4e1eb; border-radius:6px; box-shadow:none; background:#fff; color:var(--score-ink); text-align:left; font-size:16px; line-height:1.5; overflow-wrap:anywhere; }
body[data-subject-theme] #scoreYearScreen .score-category-menu small { font-size:12px; color:var(--score-muted); }
body[data-subject-theme] #scoreYearScreen #scoreCategoryMenuBtn { grid-column:1/-1; min-height:44px; background:transparent; border:0; color:var(--menu-accent); }
body[data-subject-theme] .score-fold { margin-top:24px; padding-top:14px; border-top:1px solid #cbdbe6; min-width:0; }
body[data-subject-theme] .score-fold > summary { min-height:44px; box-sizing:border-box; padding:10px 0; color:var(--score-ink); font-size:15px; font-weight:650; cursor:pointer; line-height:1.6; }
body[data-subject-theme] .score-fold[open] > summary { margin-bottom:12px; }
body[data-subject-theme] .score-fold .score-heatmap { max-width:100%; overflow-x:auto; }
body[data-subject-theme] .score-reset { margin:28px 0 16px; }
body[data-subject-theme] .score-reset summary { color:#a63838; }
body[data-subject-theme] :is(#scoreScreen,#categoryScoreScreen) .score-summary-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0; padding:0; margin:0 0 20px; border-block:1px solid #cbdbe6; }
body[data-subject-theme] :is(#scoreScreen,#categoryScoreScreen) .score-metric-card { min-width:0; padding:15px 12px; }
body[data-subject-theme] :is(#scoreScreen,#categoryScoreScreen) .score-metric-card:nth-child(even) { border-left:1px solid #cbdbe6; }
body[data-subject-theme] :is(#scoreScreen,#categoryScoreScreen) .score-metric-label { font-size:13px; color:var(--score-muted); }
body[data-subject-theme] :is(#scoreScreen,#categoryScoreScreen) .score-metric-value { font-size:27px; color:var(--score-ink); line-height:1.6; font-variant-numeric:tabular-nums; }
body[data-subject-theme] :is(#scoreScreen,#categoryScoreScreen) .score-metric-note { font-size:12px; line-height:1.6; color:var(--score-muted); }
body[data-subject-theme] :is(#scoreScreen,#categoryScoreScreen) .score-insight-card { padding:0; }
body[data-subject-theme] :is(#scoreScreen,#categoryScoreScreen) .score-row { font-size:14px; line-height:1.7; overflow-wrap:anywhere; padding:9px 0; }
body[data-subject-theme] :is(#scoreScreen,#categoryScoreScreen) .score-action-grid { margin-top:20px; }
body[data-subject-theme] :is(#scoreScreen,#categoryScoreScreen) .score-action-grid .action-btn { min-height:46px; border-radius:6px; font-size:14px; line-height:1.5; }
body[data-subject-theme] #scoreScreen .score-chart-card { padding:16px 0 0; border-top:1px solid #cbdbe6; }
body[data-subject-theme] .score-current-detail { margin-bottom:20px; }
body[data-subject-theme] .score-current-detail .score-row { border-bottom:1px solid #d7e2ea; }
@media(max-width:600px) {
  body[data-subject-theme] .score-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); row-gap:12px; }
  body[data-subject-theme] .score-kpi:nth-child(3) { border-left:0; padding-left:0; }
  body[data-subject-theme] .score-kpi strong { font-size:27px; }
  body[data-subject-theme] .score-balance-grid { grid-template-columns:minmax(0,1fr); gap:4px; }
  body[data-subject-theme] .score-balance-grid .radar-chart { max-width:240px; }
  body[data-subject-theme] .score-year-grid,
  body[data-subject-theme] #scoreYearScreen .score-category-menu,
  body[data-subject-theme] #scoreYearScreen .score-category-dynamic-buttons { grid-template-columns:minmax(0,1fr); }
}



body[data-subject-theme] #fixedPageNav {
  max-width: calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
}
body[data-subject-theme] #fixedPageNav .nav-btn {
  white-space: nowrap;
}
body.fixed-page-nav-open .screen.active > .hero,
body.fixed-page-nav-open .screen.active > .topbar {
  padding-top: calc(78px + env(safe-area-inset-top, 0px));
}
body.page-nav-modal-open #counterWrap { visibility: hidden; }
body.page-nav-modal-open .modal.show {
  padding-top: calc(82px + env(safe-area-inset-top, 0px));
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
}
body.page-nav-modal-open .modal.show > .sheet {
  max-height: calc(100vh - 94px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - 94px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}


/* Reviewed calculation explanations; existing questions and navigation are untouched. */
.reviewedSourceFigure .reviewedDiagram,
#figureHost .reviewedSourceFigure .reviewedDiagram,
#modalBody .reviewedSourceFigure .reviewedDiagram { max-width:560px !important; }
#modalBody .calculation-guide { min-width:0; overflow-wrap:anywhere; }
#modalBody .calculation-guide .calculation-step { margin-top:1em; }
#modalBody .calculation-guide .calculation-step > p { margin:.45em 0; line-height:1.75; }
#modalBody .calculation-guide .calculation-step-title { margin:0 0 .35em; font-size:1em; line-height:1.6; font-weight:700; }
#modalBody .calculation-guide .formula-label { max-width:100%; box-sizing:border-box; flex-wrap:wrap; row-gap:.25em; }
#modalBody .calculation-guide .calc-expression { display:inline-block; white-space:nowrap; }
#modalBody .calculation-guide .calc-script { display:inline-block; white-space:nowrap; }
#modalBody .calculation-guide .calc-frac { display:inline-flex; flex-direction:column; align-items:stretch; justify-content:center; vertical-align:middle; line-height:1.15; margin:0 .12em; }
#modalBody .calculation-guide .calc-num { display:block; padding:0 .2em .12em; border-bottom:1.5px solid currentColor; text-align:center; }
#modalBody .calculation-guide .calc-den { display:block; padding:.12em .2em 0; text-align:center; }
#modalBody .calculation-guide sup { display:inline; position:static; top:auto; bottom:auto; font-size:.75em; vertical-align:super; line-height:0; }
#modalBody .calculation-guide sub { display:inline; position:static; top:auto; bottom:auto; font-size:.75em; vertical-align:sub; line-height:0; }


#calcCategoryScreen .section-pad.calc-training-content { display:block; }
#calcCategoryScreen .calc-training-toolbar { display:grid;grid-template-columns:minmax(180px,1fr) minmax(180px,1fr) auto;gap:12px;align-items:end;margin:0 0 20px; }
#calcCategoryScreen .calc-training-toolbar label { display:grid;gap:6px;font-size:14px;font-weight:700; }
#calcCategoryScreen input[type="search"],#calcCategoryScreen select { width:100%;min-height:44px;min-width:0;box-sizing:border-box;border:1px solid #aac4d8;border-radius:6px;padding:10px;background:#fff;color:#17344c;font:inherit; }
#calcCategoryScreen .calc-training-order { display:flex;gap:0;padding:0;margin:0;border:0;min-width:0; }
#calcCategoryScreen .calc-training-order legend { font-size:14px;font-weight:700;margin-bottom:6px; }
#calcCategoryScreen .calc-training-order label { position:relative;display:block; }
#calcCategoryScreen .calc-training-order input { position:absolute;opacity:0;width:1px;height:1px; }
#calcCategoryScreen .calc-training-order span { min-height:44px;display:flex;align-items:center;justify-content:center;padding:0 14px;border:1px solid #aac4d8;background:#fff;box-sizing:border-box; }
#calcCategoryScreen .calc-training-order label:first-of-type span { border-radius:6px 0 0 6px; }
#calcCategoryScreen .calc-training-order label:last-of-type span { border-radius:0 6px 6px 0; }
#calcCategoryScreen .calc-training-order input:checked+span { color:#fff;background:#205a7c;border-color:#205a7c; }
#calcCategoryScreen .calc-training-order input:focus-visible+span { outline:3px solid #238ebc;outline-offset:2px; }
#calcCategoryScreen .calc-training-group { margin:26px 0; }
#calcCategoryScreen .calc-training-group h2 { margin:0 0 12px;padding:0 0 9px;border-bottom:2px solid #a9cbdc;font-size:18px;line-height:1.5; }
#calcCategoryScreen .calc-training-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }
#calcCategoryScreen .calc-training-topic { min-width:0;padding:16px;border:1px solid #c4d8e7;border-radius:8px;background:#fdfefe; }
#calcCategoryScreen .calc-training-topic h3 { font-size:17px;line-height:1.5;margin:0 0 5px;color:#153e59;overflow-wrap:anywhere; }
#calcCategoryScreen .calc-topic-hint { font-size:13px;line-height:1.6;color:#50677a;margin:0 0 12px; }
#calcCategoryScreen .calc-topic-stat { display:flex;flex-wrap:wrap;gap:4px 8px;margin:0 0 6px;font-size:13px;line-height:1.6; }
#calcCategoryScreen .calc-topic-stat span { margin-left:auto; }
#calcCategoryScreen progress { display:block;box-sizing:border-box;width:100%;height:7px;accent-color:#28799b;margin:0 0 14px;border:0; }
#calcCategoryScreen .calc-topic-actions { display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px; }
#calcCategoryScreen .calc-topic-actions button { min-width:0;min-height:44px;padding:8px 4px;border:1px solid #aecbdc;border-radius:6px;background:#fff;color:#224d6a;font-size:14px;font-weight:700;line-height:1.35;box-shadow:none; }
#calcCategoryScreen .calc-topic-actions button:first-child { background:#205a7c;border-color:#205a7c;color:#fff; }
#calcCategoryScreen .calc-topic-actions button:disabled { opacity:.42;cursor:default; }
#calcCategoryScreen .calc-topic-actions small { display:block;font-size:11px;font-weight:400; }
#calcCategoryScreen #calcTrainingVisibleCount { display:block;margin:18px 0 0;font-size:13px;color:#50677a; }
#calcCategoryScreen #calcCategoryBackBtn { margin-top:24px;min-height:44px;width:100%; }
#calcCategoryScreen [hidden] { display:none!important; }
@media (max-width:700px) {
  #calcCategoryScreen .calc-training-toolbar { grid-template-columns:minmax(0,1fr); }
  #calcCategoryScreen .calc-training-grid { grid-template-columns:minmax(0,1fr); }
  #calcCategoryScreen .calc-training-topic { padding:14px; }
}

