:root {
  --border: #cfcfcf;
  --pane-height: 52mm;
}
* { box-sizing: border-box; }
body {
  font-family: Arial, sans-serif;
  margin: 20px;
  color: #111;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  background: #fff;
}
h1 {
  text-align: center;
  margin: 0 0 10px;
  font-size: 26px;
}
.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 14px;
}
button {
  font-size: 15px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f6f6f6;
  cursor: pointer;
}

.sheet {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-width: 980px;
  margin: 0 auto;
}
.task {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.1fr;
  gap: 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  page-break-inside: avoid;
  align-items: stretch;
  background: #fff;
}
.task h2 {
  margin: 0 0 6px;
  font-size: 18px;
}
.task-text,
.calc-panel {
  display: flex;
  flex-direction: column;
}
.fact-box {
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  padding: 10px 12px;
  min-height: var(--pane-height);
}
.box-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #54606e;
}
.values {
  margin: 0;
  padding-left: 18px;
  line-height: 1.45;
}
.formula,
.instruction {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.4;
}
.sketch-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: var(--pane-height);
}
.sketch {
  width: 100%;
  height: var(--pane-height);
}
.lbl { font: 12px Arial, sans-serif; fill: #000; }
.calc-panel .box-title {
  margin-bottom: 8px;
}
.calc-grid {
  width: 100%;
  height: var(--pane-height);
  border: 1px solid #bdbdbd;
  border-radius: 8px;
  background: #fff;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.35) 1px, transparent 1px),
    linear-gradient(to right, rgba(0,0,0,0.60) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.60) 1px, transparent 1px);
  background-size:
    5mm 5mm, 5mm 5mm, 25mm 25mm, 25mm 25mm;
  background-position: 0 0, 0 0, 0 0, 0 0;
}
@supports not (background-size: 5mm 5mm) {
  .calc-grid {
    background-size: 19px 19px, 19px 19px, 95px 95px, 95px 95px;
  }
}

.answer { display: none; }

@page { size: A4 portrait; margin: 10mm; }
@media print {
  .controls { display: none; }
  body { margin: 0; }
  h1 { font-size: 20px; margin: 0 0 6px; }
  .sheet { gap: 8px; }
  .task {
    gap: 8px;
    padding: 8px;
    border-width: 1px;
  }
  .task h2 { font-size: 16px; }
  .formula,
  .instruction,
  .values { font-size: 14px; }
}
