/* =====================================================================
 * ⛏ 方塊學習冒險 — 麥塊像素方塊冒險風樣式表（含乾淨 A4 紙本考卷列印）
 * ===================================================================== */
:root {
  --bg: #1d2b1f;
  --panel: #f4efe2;
  --panel-light: #ffffff;
  --ink: #2a2a2a;
  --muted: #666666;
  --line: #6b4f2a;
  --accent: #3aafa9;
  --accent-d: #2b7a78;
  --ok-bg: #d4edda;
  --ok-ink: #155724;
  --bad-bg: #f8d7da;
  --bad-ink: #721c24;
  --gold: #ffd34d;
  --wood-btn: #c98b2b;
  --wood-btn-b: #6b4a14;
  --grass-btn: #5a8f3c;
  --grass-btn-b: #2f4f1f;
  --water-btn: #3570c4;
  --water-btn-b: #1e4278;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  line-height: 1.6;
  background: var(--bg) linear-gradient(
    180deg,
    #6fb6e8 0,
    #9ad0f0 140px,
    #5aa83c 140px,
    #5aa83c 158px,
    #7a4e25 158px,
    #4b3017 440px,
    #2b2b2b 920px
  );
  background-attachment: fixed;
}

.app-shell {
  max-width: 920px;
  margin: 0 auto;
  padding-bottom: 36px;
}

.hidden {
  display: none !important;
}

/* ==================== 像素方塊與 3D 按鈕 ==================== */
.blk {
  display: inline-block;
  background-size: cover;
  image-rendering: pixelated;
  vertical-align: middle;
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.25), inset 2px 2px 0 rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}
.blk.dim {
  filter: grayscale(1) brightness(0.6);
}
.blk.fill {
  width: 100% !important;
  height: 100% !important;
  box-shadow: none;
}

button, .filebtn {
  font: inherit;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--grass-btn);
  border: 3px solid var(--grass-btn-b);
  border-radius: 4px;
  padding: 8px 16px;
  margin: 3px;
  min-height: 42px;
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.25), inset 3px 3px 0 rgba(255, 255, 255, 0.2);
  transition: filter 0.12s, transform 0.08s;
  text-decoration: none;
}
button:hover:not(:disabled), .filebtn:hover {
  filter: brightness(1.09);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

button.ghost {
  background: #7c7c7c;
  border-color: #4a4a4a;
}
button.wood {
  background: var(--wood-btn);
  border-color: var(--wood-btn-b);
}
button.water {
  background: var(--water-btn);
  border-color: var(--water-btn-b);
}
button.danger {
  background: #b8433a;
  border-color: #6b1f1a;
}
button.big {
  font-size: 20px;
  padding: 12px 26px;
  background: var(--wood-btn);
  border-color: var(--wood-btn-b);
}
button.sm-btn {
  font-size: 14px;
  padding: 4px 11px;
  min-height: 34px;
  margin: 2px;
}
button.tab-btn {
  background: #555555;
  border-color: #333333;
  font-size: 15px;
  padding: 6px 14px;
  min-height: 38px;
}
button.tab-btn.active {
  background: var(--wood-btn);
  border-color: var(--wood-btn-b);
  box-shadow: 0 0 0 2px var(--gold);
}

/* ==================== 頂部玩家 HUD ==================== */
.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(0, 0, 0, 0.62);
  border: 2px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
}
.who {
  display: flex;
  gap: 10px;
  align-items: center;
}
.who b {
  font-size: 17px;
}
.who small {
  display: block;
  color: #cceeff;
  font-size: 13px;
}
.inv {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.inv span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
}
.audio-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.sfx-btn, .bgm-btn {
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: none;
  font-size: 13px;
  padding: 4px 10px;
  min-height: 36px;
  margin: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.sfx-btn:hover, .bgm-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
.bgm-btn.playing {
  border-color: #ffd34d;
  background: rgba(255, 211, 77, 0.22);
}

/* ==================== 標題與頂列 ==================== */
.title {
  color: #ffffff;
  text-align: center;
  font-size: clamp(28px, 5vw, 36px);
  margin: 6px 0 0;
  text-shadow: 3px 3px 0 #2f4f1f;
  letter-spacing: 2px;
}
.sub {
  color: #ffffff;
  text-align: center;
  margin: 4px 0 14px;
  text-shadow: 1px 1px 2px #000000;
  font-size: 15px;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bar h2 {
  color: #ffffff;
  margin: 0;
  font-size: 21px;
  text-shadow: 2px 2px 0 #000000;
}

/* ==================== 首頁：今日任務與六大生態域 ==================== */
.quest {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--panel);
  border: 4px solid var(--line);
  padding: 13px 16px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 14px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.1s;
}
.quest:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}
.quest.done {
  opacity: 0.85;
}
.quest b {
  font-size: 18px;
}
.quest small, .biome small, .layer small, .mine-h small {
  display: block;
  color: #5d5347;
  font-size: 13px;
}

.biomes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 10px;
}
.biome {
  background: var(--panel);
  border: 4px solid var(--line);
  border-radius: 6px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.12s, border-color 0.12s;
}
.biome:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
}
.biome b {
  display: block;
  font-size: 19px;
  margin-top: 6px;
}
.biome .b-stat {
  display: inline-block;
  margin-top: 5px;
  font-size: 12px;
  font-weight: bold;
  background: #e5dcc9;
  color: #4a371c;
  padding: 1px 7px;
  border-radius: 3px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  justify-content: center;
  align-items: center;
}
.row.between {
  justify-content: space-between;
}

/* ==================== 生態域：礦坑與 5 層關卡 ==================== */
.mode-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(0, 0, 0, 0.42);
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.mines {
  display: grid;
  gap: 14px;
}
.mine {
  background: var(--panel);
  border: 4px solid var(--line);
  border-radius: 6px;
  padding: 13px 15px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22);
}
.mine-h {
  position: relative;
  margin-bottom: 10px;
  padding-right: 78px;
}
.mine-h b {
  font-size: 18px;
}
.pct {
  position: absolute;
  right: 0;
  top: 0;
  background: var(--accent-d);
  color: #ffffff;
  padding: 2px 9px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: bold;
}

.layers {
  display: grid;
  gap: 7px;
}
.layer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  background: #ffffff;
  border: 2px solid #d7cbb8;
  transition: border-color 0.12s;
}
.layer.clickable {
  cursor: pointer;
}
.layer.clickable:hover {
  border-color: var(--accent);
  background: #fafefe;
}
.layer.lock {
  background: #eae6dd;
  color: #8c857b;
}
.layer.pass {
  border-color: #5a8f3c;
  background: #f5fbf2;
}
.layer-info {
  flex: 1;
  min-width: 140px;
}
.layer-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.layer .score {
  font-weight: bold;
  color: var(--accent-d);
  white-space: nowrap;
  font-size: 14px;
}

/* ==================== 作答、檢查時間與結算 ==================== */
.tip {
  background: #fff9e6;
  border: 3px solid #d4a11e;
  border-left: 7px solid #e0a800;
  padding: 10px 14px;
  border-radius: 4px;
  margin: 10px 0;
  font-size: 15px;
}

.strip {
  display: flex;
  gap: 7px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 12px 0;
  min-height: 52px;
}
.strip .cell {
  width: 48px;
  height: 48px;
  border: 2px dashed rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.strip .cell.now {
  border: 3px solid var(--gold);
  transform: translateY(-4px);
}
.strip .cell.done .blk {
  opacity: 0.78;
}
.strip .cell.broken {
  animation: pop 0.45s ease;
  background: rgba(0, 0, 0, 0.28);
}
.strip .cell.cracked {
  animation: shake 0.4s ease;
}
.crack {
  position: absolute;
  inset: 2px;
  background-size: cover;
  image-rendering: pixelated;
  pointer-events: none;
}
@keyframes pop {
  0% { transform: scale(1.22); background: rgba(255, 255, 255, 0.55); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.card {
  background: var(--panel);
  border: 4px solid var(--line);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22);
}
.card.small {
  padding: 12px 16px;
}
.card.ok {
  border-color: #5a8f3c;
}
.card.bad {
  border-color: #b8433a;
}

.q-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.qno {
  font-size: 14px;
  color: #6b5d4d;
  font-weight: bold;
}
.q-tag {
  display: inline-block;
  background: #e5dcc9;
  color: #4a371c;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
}
.context-note {
  background: #eef6ff;
  border: 1px solid #c3dcf7;
  border-radius: 4px;
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #24486e;
}

.qt {
  font-size: 20px;
  font-weight: 600;
  margin: 4px 0 12px;
}

.svg {
  text-align: center;
  background: #ffffff;
  border: 1px dashed #b2d8d8;
  border-radius: 6px;
  padding: 10px;
  margin: 8px 0 12px;
  overflow-x: auto;
}
.svg svg {
  max-width: 100%;
  height: auto;
}

.opts {
  display: grid;
  gap: 8px;
}
.opts.tf-grid {
  grid-template-columns: repeat(2, 1fr);
}
.opt {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 2px solid #cbbca3;
  border-radius: 4px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 18px;
  min-height: 48px;
}
.opt:hover {
  border-color: var(--accent);
  background: #f5fbfb;
}
.opt.sel {
  border-color: var(--accent-d);
  background: #e4f6f5;
  font-weight: bold;
}
.opt input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-d);
  flex-shrink: 0;
}

.ans {
  font-size: 19px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
input[type="text"], input[type="search"], select, textarea {
  font: inherit;
  font-size: 17px;
  padding: 7px 10px;
  border: 3px solid #998870;
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
}
.ans input[type="text"] {
  font-size: 20px;
  width: 190px;
  text-align: center;
}
input[type="text"]:focus, select:focus, textarea:focus {
  border-color: var(--accent-d);
  outline: none;
}

.check-h {
  background: #fff3cd;
  border: 4px solid #c98b2b;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 16px;
}
.check-h ul {
  margin: 6px 0;
  padding-left: 22px;
}

.result {
  background: var(--panel);
  border: 4px solid var(--line);
  border-radius: 6px;
  padding: 18px;
  text-align: center;
  margin-bottom: 14px;
  font-size: 17px;
}
.result.win {
  border-color: #e0a800;
  background: #fffbe6;
}
.big-score {
  font-size: 46px;
  font-weight: bold;
  color: #b8433a;
  line-height: 1.1;
  margin-bottom: 6px;
}
.result.win .big-score {
  color: #2f7a2c;
}
.caught, .msg {
  margin-top: 8px;
  font-weight: bold;
  color: #6b4a14;
}
.gain {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-weight: bold;
}

.trap {
  background: #fde2e1;
  color: #8a1c1c;
  padding: 6px 10px;
  border-radius: 4px;
  margin: 6px 0;
  font-weight: bold;
  font-size: 15px;
}
.exp {
  background: #eef6ff;
  padding: 7px 10px;
  border-radius: 4px;
  margin: 6px 0;
  font-size: 15px;
}
.fix {
  background: #ffffff;
  border: 2px dashed #c98b2b;
  padding: 10px 12px;
  border-radius: 4px;
  margin-top: 8px;
}
.fix.fixed {
  border-color: #5a8f3c;
  background: var(--ok-bg);
  color: var(--ok-ink);
  font-weight: bold;
}
.fix input[type="text"] {
  width: 150px;
  font-size: 17px;
}

/* ==================== 我的基地（14x8 方塊建築） ==================== */
.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}
.pal {
  background: var(--panel);
  border: 3px solid var(--line);
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  text-align: center;
  min-width: 72px;
}
.pal small {
  display: block;
  font-size: 12px;
  font-weight: bold;
  margin-top: 2px;
}
.pal.sel {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold);
}

.world {
  display: grid;
  gap: 0;
  background: linear-gradient(#8fd0f5, #cdeefc);
  border: 4px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.wc {
  aspect-ratio: 1;
  border: 1px dotted rgba(255, 255, 255, 0.35);
  cursor: pointer;
  display: block;
}
.wc.ground {
  background: #5aa83c;
}
.wc:hover {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

/* ==================== 3D 立體麥塊基地與工作台 ==================== */
.voxel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.voxel-stage {
  border: 4px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #8fd0f5;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28);
  margin-bottom: 10px;
}
.voxel-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* iPad / 平板觸控與全螢幕安全區最佳化 */
body {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-tap-highlight-color: transparent;
}
button, .biome, .layer, .pal, .opt, .quest {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.voxel-help {
  background: #fff9e6;
  border: 3px solid #d4a11e;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 14px;
  margin-bottom: 10px;
}

.craft-panel {
  background: var(--panel);
  border: 4px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.craft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.craft-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ffffff;
  border: 2px solid #d7cbb8;
  border-radius: 4px;
  padding: 8px 10px;
}
.craft-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.craft-info small {
  display: block;
  font-size: 12px;
  color: #666;
}

/* ==================== 自訂出題與家長區 ==================== */
.checklist-grid {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 2px solid #d7cbb8;
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
}
.check-row.checked {
  border-color: var(--grass-btn);
  background: #f4fbf1;
}
.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--grass-btn);
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 14px;
  background: #ffffff;
}
.tbl th, .tbl td {
  border: 1px solid #cbbca3;
  padding: 6px;
  text-align: center;
}
.tbl th {
  background: #e9e0cf;
}
.tbl td.g {
  background: var(--ok-bg);
  color: var(--ok-ink);
  font-weight: bold;
}
.tbl td.r {
  background: var(--bad-bg);
  color: var(--bad-ink);
}
.tbl small {
  color: #666;
}
.note {
  color: #5d5347;
  font-size: 14px;
  margin: 6px 0;
}

.manage-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 10px 0;
}
@media (min-width: 680px) {
  .manage-filters {
    grid-template-columns: 160px 140px 130px 1fr;
  }
}
.manage-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  background: #ffffff;
  border: 2px solid #d7cbb8;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

/* ==================== Modal ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.modal-dialog {
  background: var(--panel);
  border: 4px solid var(--line);
  border-radius: 6px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 2px solid #d7cbb8;
}
.modal-header h2 {
  margin: 0;
  font-size: 20px;
}
.modal-body {
  padding: 14px 16px;
}
.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 4px;
}
.form-group input[type="text"],
.form-group select,
.form-group textarea {
  width: 100%;
  font-size: 15px;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 580px) {
  .form-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .form-grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 8px;
  border-top: 2px solid #d7cbb8;
}

/* ==================== 吐司通知 ==================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(130px);
  background: #222222;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 6px;
  border: 3px solid var(--gold);
  font-size: 16px;
  font-weight: bold;
  transition: transform 0.25s;
  z-index: 300;
  text-align: center;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ==================== A4 紙本考卷列印區 ==================== */
.print-sheet {
  background: #ffffff;
  color: #111111;
  max-width: 210mm;
  margin: 12px auto 0;
  padding: 16mm 15mm;
  border: 4px solid var(--line);
  border-radius: 4px;
}
.p-header {
  text-align: center;
  border-bottom: 2px solid #222222;
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.p-header h1 {
  font-size: 22px;
  margin: 0 0 4px;
}
.p-sub {
  font-size: 14px;
  color: #444;
  margin: 0 0 8px;
}
.p-student-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  font-weight: bold;
}
.p-questions-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.p-question {
  margin-bottom: 16px;
  break-inside: avoid;
}
.p-question.has-workspace {
  padding-bottom: 36px;
}
.p-stem {
  font-size: 15px;
  margin-bottom: 5px;
}
.p-svg-wrap {
  margin: 6px 0 8px 18px;
  padding: 6px;
  border: 1px dashed #bbbbbb;
  display: inline-block;
  max-width: 100%;
}
.p-svg-wrap svg {
  max-width: 100%;
  height: auto;
  display: block;
}
.p-opts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 16px;
  padding-left: 18px;
  font-size: 14px;
}
.p-tf, .p-blank {
  padding-left: 18px;
  font-size: 14px;
}
.print-answer-page {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 2px dashed #666;
  page-break-before: always;
}
.p-key-list {
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.65;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }
  body {
    background: #ffffff !important;
    padding: 0 !important;
  }
  .no-print, .hud, .bar, .toast, .modal-backdrop {
    display: none !important;
  }
  .app-shell {
    max-width: none !important;
    padding: 0 !important;
  }
  .print-sheet {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
  }
}

@media (max-width: 600px) {
  body { padding: 10px; }
  .qt { font-size: 18px; }
  .strip .cell { width: 42px; height: 42px; }
  .opts.tf-grid { grid-template-columns: 1fr; }
}
