:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2a44;
  --muted: #6b7591;
  --line: #e3e7f1;
  --primary: #4f6bed;
  --primary-ink: #ffffff;
  --soft: #eef1fd;
  --accent-bg: linear-gradient(135deg, #eef1ff 0%, #fff4e8 100%);
  --ok: #1e9e6a;
  --ok-bg: #e5f7ef;
  --ng: #d9534f;
  --ng-bg: #fdecec;
  --warn-bg: #fff7e0;
  --star: #f5a623;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151f; --card: #1c2130; --text: #e8ecf6; --muted: #9aa3bd; --line: #2c3346;
    --primary: #7b91ff; --primary-ink: #0d1020; --soft: #252c42;
    --accent-bg: linear-gradient(135deg, #232a45 0%, #33291f 100%);
    --ok: #4cd29a; --ok-bg: #173327; --ng: #ff7b76; --ng-bg: #3a1e1f; --warn-bg: #3a321a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px; line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.35; }
h2 { font-size: 1.3rem; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.row > .btn { flex: 1; }
.between { justify-content: space-between; align-items: center; }
.hl { color: var(--primary); font-size: 1.25em; }

/* カード */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin: 0 0 14px; box-shadow: 0 1px 3px rgba(20, 30, 60, .06); }
.card.accent { background: var(--accent-bg); }
.card.warn { background: var(--warn-bg); }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .05em; color: var(--primary); background: var(--soft); padding: 2px 10px; border-radius: 99px; margin-bottom: 8px; }
.big-emoji { font-size: 3rem; line-height: 1; margin-bottom: 8px; }

/* ボタン */
.btn { display: block; width: 100%; border: 0; border-radius: 12px; padding: 12px 16px; margin: 8px 0 0; background: var(--soft); font-weight: 600; text-align: center; }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.big { padding: 16px; font-size: 1.05rem; margin-top: 14px; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.soft { background: var(--soft); }
.btn.small { padding: 8px 12px; font-size: .9rem; width: auto; }
.btn.danger { background: var(--ng-bg); color: var(--ng); }
.btn:active, .choice:active, .key:active, .skill:active { transform: scale(.98); }
.back { background: none; border: 0; color: var(--primary); padding: 4px 0 10px; font-weight: 600; }

/* はじめの画面 */
.hero { text-align: center; padding: 28px 0 18px; }
.logo { font-size: 2rem; font-weight: 800; letter-spacing: .02em; }
.logo b { color: var(--primary); }
.lbl { display: block; font-weight: 700; margin: 14px 0 6px; }
.inp { width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--text); }
.inp:focus { outline: none; border-color: var(--primary); }
.note { font-size: .8rem; color: var(--muted); margin: 6px 0 0; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg button, .subj { border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 8px 4px; font-size: .85rem; font-weight: 600; }
.seg button.on, .subj.on { border-color: var(--primary); background: var(--soft); color: var(--primary); }
.seg button:disabled, .subj:disabled { opacity: .45; cursor: default; }
.seg small, .subj small { display: block; font-size: .65rem; font-weight: 400; }
.subjects { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.subj { font-size: 1.3rem; padding: 8px 2px; }
.subj span { display: block; font-size: .8rem; }
.privacy { text-align: center; font-size: .8rem; color: var(--muted); }

/* ホーム */
.greet { font-size: 1.15rem; margin: 4px 0 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--card); border-radius: 14px; padding: 10px 6px; text-align: center; box-shadow: 0 1px 3px rgba(20, 30, 60, .06); }
.stat .v { font-size: 1.25rem; font-weight: 800; }
.stat .v small { font-size: .7em; color: var(--muted); }
.stat .k { font-size: .75rem; color: var(--muted); }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0; flex: 1; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .4s; }
.bar.sm { height: 6px; margin: 0; }
.mini { display: flex; align-items: center; gap: 10px; font-size: .85rem; margin-top: 8px; }
.mini span { width: 6.5em; flex: none; }
.tip { text-align: center; color: var(--muted); font-size: .9rem; }
.stars { color: var(--star); letter-spacing: 1px; white-space: nowrap; }
.stars i { color: var(--line); font-style: normal; }

/* 単元マップ・結果 */
.page-h { font-size: 1.4rem; margin: 4px 0 4px; }
.grade-h { font-size: 1rem; color: var(--muted); margin: 18px 0 8px; }
.unit-h { font-weight: 800; margin-bottom: 6px; }
.skill { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; background: none; border: 0; border-top: 1px solid var(--line); padding: 12px 2px; text-align: left; }
.skill:first-of-type { border-top: 0; }
.skill em { font-style: normal; font-size: .7rem; background: var(--primary); color: var(--primary-ink); padding: 1px 8px; border-radius: 99px; margin-left: 6px; vertical-align: 2px; }
.res { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.res:first-of-type { border-top: 0; }
.res .mk { width: 1.8em; height: 1.8em; flex: none; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: .9rem; }
.res .nm { flex: 1; }
.res .st { font-size: .8rem; color: var(--muted); }
.res.ok .mk { background: var(--ok-bg); color: var(--ok); }
.res.inf .mk { background: var(--soft); color: var(--primary); }
.res.ng .mk { background: var(--warn-bg); color: #c98a00; }
.res.un .mk { background: var(--line); color: var(--muted); }
.list { padding-left: 1.2em; }
.list li { margin: 6px 0; }

/* 解説 */
.lesson .pt { margin: 10px 0; }
.lesson .ex, .ex { background: var(--soft); border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-size: .95rem; }

/* 問題 */
.qhead { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.qhead span { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.x { border: 0; background: none; font-size: 1.6rem; line-height: 1; color: var(--muted); padding: 0 4px; }
.dots { flex: 1; display: flex; gap: 6px; }
.dots i { flex: 1; height: 8px; border-radius: 99px; background: var(--line); }
.dots i.cur { background: var(--primary); opacity: .5; }
.dots i.ok { background: var(--ok); }
.dots i.ng { background: var(--ng); }
.qcard { margin-top: 8px; }
.q { font-size: 1.25rem; font-weight: 600; line-height: 1.8; word-break: break-word; }
.form { margin-top: 10px; font-size: .85rem; color: var(--muted); }
.sys { display: inline-block; border-left: 3px solid var(--text); padding-left: 10px; margin: 4px 0; border-radius: 6px 0 0 6px; }
.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .85em; line-height: 1.25; margin: 0 2px; }
.fr span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 3px; }

.fields { margin: 4px 0 10px; }
.frow { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.flbl { min-width: 5.5em; font-weight: 600; font-size: .95rem; }
.field { flex: 1; min-height: 50px; display: flex; align-items: center; padding: 0 14px; font-size: 1.35rem; font-weight: 700; border: 2px solid var(--line); border-radius: 12px; background: var(--card); }
.field i { color: var(--line); font-style: normal; }
.field.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--soft); }
.field.ok { border-color: var(--ok); background: var(--ok-bg); }
.field.ng { border-color: var(--ng); background: var(--ng-bg); }
.fpost { font-weight: 600; }

.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 4px; }
.key { border: 0; border-radius: 12px; background: var(--card); box-shadow: 0 1px 2px rgba(20, 30, 60, .12); min-height: 52px; font-size: 1.35rem; font-weight: 700; }
.key.fn { background: var(--soft); font-size: .95rem; }

.choices { display: grid; gap: 10px; margin: 6px 0; }
.choice { border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 14px; font-size: 1.25rem; font-weight: 700; }
.choice.ok { border-color: var(--ok); background: var(--ok-bg); }
.choice.ng { border-color: var(--ng); background: var(--ng-bg); opacity: .8; }
.choice:disabled { cursor: default; }

.hints { margin: 10px 0; }
.hint { background: var(--warn-bg); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: .95rem; }
.hint b { display: inline-block; font-size: .75rem; background: var(--star); color: #fff; padding: 0 8px; border-radius: 99px; margin-right: 6px; }

.fb { border-radius: 14px; padding: 14px; margin: 12px 0 0; }
.fb.ok { background: var(--ok-bg); }
.fb.retry { background: var(--warn-bg); }
.fb.ng { background: var(--soft); }
.fb-h { font-weight: 800; font-size: 1.05rem; }
.fb .ans { margin-top: 8px; font-size: 1.1rem; }
.fb .exp, .fb details { margin-top: 8px; font-size: .95rem; }
.fb summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.levelup { font-weight: 800; color: var(--star); font-size: 1.1rem; margin: 6px 0; }

/* 記録 */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; margin-top: 10px; }
.chart .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.chart .b { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.chart span { font-size: .65rem; color: var(--muted); margin-top: 2px; }
.tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .9rem; }
.tbl th { text-align: left; font-size: .75rem; color: var(--muted); font-weight: 600; padding: 4px 2px; }
.tbl td { border-top: 1px solid var(--line); padding: 8px 2px; }
.log { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.log span:nth-child(2) { flex: 1; }
label.btn { cursor: pointer; }

/* 下のメニュー */
#nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
#nav[hidden] { display: none; }
#nav button { flex: 1; max-width: 186px; border: 0; background: none; padding: 8px 0 10px; font-size: .75rem; color: var(--muted); }
#nav button span { display: block; font-size: 1.3rem; line-height: 1.2; filter: grayscale(1); opacity: .6; }
#nav button.on { color: var(--primary); font-weight: 700; }
#nav button.on span { filter: none; opacity: 1; }

#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-size: .9rem; opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100% - 32px); z-index: 10; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 印刷 */
.print-only { display: none; }
@media print {
  :root { --bg: #fff; --card: #fff; --text: #000; --muted: #444; --line: #ccc; }
  body { background: #fff; }
  #nav, .no-print, #toast { display: none !important; }
  .print-only { display: block; }
  .print-head { font-weight: 700; margin-bottom: 10px; }
  #app { max-width: none; padding: 0; }
  .card, .stat { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .chart .b { background: #555; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* 分数の入力（上が分子、下が分母） */
.fracin { flex: 1; display: flex; flex-direction: column; align-items: stretch; max-width: 220px; }
.fpart { display: flex; align-items: center; gap: 8px; }
.fpart .field { min-height: 46px; justify-content: center; }
.fpart small { flex: none; width: 4.2em; font-size: .8rem; font-weight: 700; color: var(--muted); }
.fline { height: 3px; background: var(--text); border-radius: 2px; margin: 6px calc(4.2em + 8px) 6px 0; }
.key.wide { grid-column: span 2; }

/* 実力チェックの答えと解説 */
.seg.two { grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
.rv-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rv .q { font-size: 1.1rem; margin-bottom: 8px; }
.rv-a { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); }
.rv-a > span { flex: none; width: 6.5em; }
.rv.ng .rv-a:nth-of-type(1) div { color: var(--ng); }
.rv details { margin-top: 8px; }
.rv summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.rv .exp { background: var(--soft); border-radius: 10px; padding: 10px 12px; margin-top: 6px; }

/* 目立たない「その他」（データの初期化） */
.more { text-align: center; margin: 28px 0 8px; font-size: .8rem; color: var(--muted); }
.more summary { cursor: pointer; display: inline-block; padding: 6px 12px; list-style: none; opacity: .7; }
.more summary::-webkit-details-marker { display: none; }
.linkish { display: block; margin: 6px auto 0; background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: .8rem; padding: 6px; }

/* レベル */
.lvcard { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(20, 30, 60, .06); }
.lv { flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-weight: 800; font-size: .95rem; }
.lvt { flex: 1; min-width: 0; }
.lvt .bar { margin: 4px 0 2px; }
.stat .k .up { color: var(--ok); }

/* 目標 */
.goalbar { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(20, 30, 60, .06); }
.goalbar .gi, .gopt .gi { font-size: 1.6rem; flex: none; }
.goalbar .gt { flex: 1; min-width: 0; }
.goalbar .btn { flex: none; margin: 0; }
.count { font-size: 1rem; }
.count span { font-size: 1.6rem; font-weight: 800; color: var(--primary); margin: 0 2px; }
.gopt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 2px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px; margin-bottom: 8px; }
.gopt small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.gopt.on { border-color: var(--primary); background: var(--soft); }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.units { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.uopt { border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px; font-weight: 600; text-align: left; }
.uopt.on { border-color: var(--primary); background: var(--soft); color: var(--primary); }
.uopt.wide { width: 100%; margin-top: 8px; }

/* 今日のメニュー */
.task { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--card); border: 0; border-radius: 12px; padding: 12px; margin-top: 8px; box-shadow: 0 1px 2px rgba(20, 30, 60, .08); }
.task .ck { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--primary); font-weight: 800; }
.task .nm { flex: 1; font-weight: 700; }
.task .nm small { display: block; font-weight: 400; font-size: .75rem; color: var(--muted); }
.task .go { flex: none; font-size: .85rem; color: var(--primary); font-weight: 700; }
.task.done .ck { background: var(--ok); color: #fff; }
.task.done .nm { color: var(--muted); text-decoration: line-through; }
.task.done .go { color: var(--muted); font-weight: 400; }
.done-msg { margin-top: 12px; text-align: center; font-weight: 800; color: var(--ok); }
.celebrate { background: var(--ok-bg); }

/* 計画表 */
.pday { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pday:first-child { border-top: 0; }
.pday .pd { flex: none; width: 5.5em; font-weight: 700; font-size: .9rem; }
.pday .pt { flex: 1; font-size: .9rem; }
.pday.now .pd { color: var(--primary); }
.pday.exam { background: var(--warn-bg); border-radius: 10px; padding: 10px; margin-top: 4px; }
.mini .wide { width: auto; flex: 1; }

/* バッジ */
.chip { display: inline-block; background: var(--card); border-radius: 99px; padding: 4px 12px; margin: 4px 3px 0; font-size: .85rem; font-weight: 700; box-shadow: 0 1px 2px rgba(20, 30, 60, .12); }
.newbadge { margin-top: 10px; font-weight: 800; color: var(--star); }
.levelup.big { font-size: 1.2rem; color: var(--primary); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.badge { text-align: center; border-radius: 12px; padding: 10px 6px; background: var(--bg); opacity: .6; }
.badge span { display: block; font-size: 1.6rem; line-height: 1.2; filter: grayscale(1); }
.badge b { display: block; font-size: .75rem; line-height: 1.3; margin-top: 4px; }
.badge small { display: block; font-size: .65rem; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.badge.got { opacity: 1; background: var(--warn-bg); }
.badge.got span { filter: none; }
.chart .b.goal { background: var(--ok); }

/* 図形・グラフの図 */
.fig { display: block; width: 100%; max-width: 340px; max-height: 240px; height: auto; margin: 12px auto 4px; overflow: visible; }
.fig line, .fig path, .fig polygon, .fig rect { stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fig .arc { stroke: var(--primary); stroke-width: 1.8; }
.fig .arc.x { stroke: var(--ng); }
.fig .thin { stroke-width: 1.3; }
.fig .dash { stroke-dasharray: 5 4; opacity: .6; }
.fig .box { fill: var(--soft); }
.fig text { fill: currentColor; stroke: none; font-size: 15px; font-weight: 700; font-family: inherit; }
.fig text.lbl { fill: var(--primary); }
.fig text.x { fill: var(--ng); font-style: italic; }
.fig text.sm { font-size: 11px; font-weight: 400; }
.conds { margin: 10px 0 4px; padding: 10px 14px; background: var(--soft); border-radius: 10px; font-size: 1.05rem; line-height: 1.9; }
.proof { margin: 8px 0 10px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; font-size: .95rem; font-weight: 500; line-height: 1.9; }
.proof .blank { display: inline-block; min-width: 3.5em; text-align: center; border-bottom: 2px solid var(--ng); color: var(--ng); }
.choice.long { font-size: 1rem; font-weight: 600; text-align: left; padding: 12px 14px; }

/* 計算メモ */
#memo { position: fixed; left: 0; right: 0; bottom: 0; height: 46vh; z-index: 8; display: flex; flex-direction: column; background: var(--card); border-top: 2px solid var(--line); box-shadow: 0 -4px 16px rgba(20, 30, 60, .12); padding-bottom: env(safe-area-inset-bottom); }
#memo[hidden] { display: none; }
.memo-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; max-width: 560px; width: 100%; margin: 0 auto; }
.memo-bar b { flex: 1; font-size: .9rem; }
.memo-bar button { border: 0; background: var(--soft); border-radius: 8px; padding: 6px 10px; font-size: .85rem; font-weight: 600; }
.memo-bar button.on { background: var(--primary); color: var(--primary-ink); }
#memo canvas { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; display: block; touch-action: none; cursor: crosshair;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 24px 24px; }
body.memo-open #app { padding-bottom: calc(46vh + 24px); }

/* 練習プリント（画面ではプレビュー、印刷すると紙に） */
.sheet { --primary: #3550d8; --ng: #c0392b; --soft: #eef1fd; --line: #cfd4e0; --text: #111; --muted: #555; background: #fff; color: #111; border-radius: 6px; padding: 16px; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.sh-page + .sh-page { margin-top: 28px; padding-top: 18px; border-top: 2px dashed #bbb; }
.sh-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; border-bottom: 2px solid #111; padding-bottom: 6px; margin-bottom: 10px; font-size: .9rem; }
.sh-sub { margin-left: 10px; padding: 1px 8px; border: 1px solid #111; border-radius: 4px; font-size: .8rem; }
.sh-meta { font-size: .8rem; }
.sh-qs, .sh-as { margin: 0; padding-left: 1.6em; }
.sh-q, .sh-a { padding: 8px 0 10px; border-bottom: 1px solid #ddd; break-inside: avoid; }
.sh-skill { font-size: .7rem; color: #666; }
.sheet .q { font-size: 1rem; font-weight: 500; line-height: 1.7; }
.sheet .form { font-size: .75rem; color: #555; }
.sheet .fig { max-width: 260px; max-height: 170px; margin: 6px 0 2px; }
.sheet .conds, .sheet .proof { background: none; border: 1px solid #ccc; font-size: .9rem; padding: 6px 10px; }
.sh-blank { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font-size: .9rem; }
.sh-blank .ul { display: inline-block; width: 5em; border-bottom: 1px solid #111; margin: 0 2px; }
.sh-ch { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; margin-top: 4px; font-size: .9rem; }
.sh-work { height: 70px; }
.sh-ans { font-weight: 700; margin-top: 2px; }
.sh-a .exp { font-size: .85rem; color: #333; margin-top: 4px; padding-left: 8px; border-left: 3px solid #ddd; }
@media print {
  @page { size: A4; margin: 12mm; }
  .sheet { box-shadow: none; padding: 0; border-radius: 0; }
  .sh-page + .sh-page { margin-top: 0; padding-top: 0; border-top: 0; }
  .sh-page.brk { break-before: page; }
  .sh-work { height: 34mm; }
  #memo { display: none !important; }
  body.memo-open #app { padding-bottom: 0; }
}
