.sheet-wrap { width: 100%; overflow: hidden; margin: 8px 0; }
.sheet {
  --ink: #1b2a4a; --deep: #0b4a9e; --dot: #1565e0; --pale: #e4f1ff; --edge: #a9cdf5; --head: #cfe3ff;
  width: 794px; min-height: 1123px; padding: 0 0 18px; transform-origin: top left;
  background: #fff; color: var(--ink); font-size: 14px; line-height: 1.5;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.sheet .bar { padding: 22px 28px; background: var(--deep); border-radius: 0 0 14px 14px; }
.sheet .bar h2 { margin: 0; font-size: 30px; color: #fff; text-align: left; }
.sheet .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 16px 16px 0; align-items: start; }
.sheet [data-p]:empty { display: inline-block; min-width: 3em; min-height: 1.2em; }
.sheet .sec { background: var(--pale); border: 1.5px solid var(--edge); border-radius: 16px; padding: 10px 12px 12px; break-inside: avoid; }
.sheet .sec:last-child:nth-child(odd) { grid-column: 1 / -1; }
.sheet h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 18px; color: var(--deep); }
.sheet h3 [data-p] { flex: 1; min-width: 0; }
.sheet .dot { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--dot); color: #fff; font-size: 15px; font-weight: 700; }
.sheet .icon { flex: none; font-size: 28px; line-height: 1; }
.sheet ul, .sheet ol { margin: 0; padding: 8px 12px 8px 28px; background: #fff; border-radius: 10px; }
.sheet li { margin: 3px 0; overflow-wrap: anywhere; }
.sheet table { width: 100%; margin-top: 8px; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.sheet ul + table { margin-top: 8px; }
.sheet th, .sheet td { padding: 5px 7px; border: 1px solid var(--edge); text-align: left; overflow-wrap: anywhere; }
.sheet th { background: var(--head); color: var(--deep); }
.sheet .formula { margin: 8px 0 0; padding: 9px 12px; background: #fff; border: 1.5px dashed var(--dot); border-radius: 10px; font-weight: 700; font-size: 16px; }
.sheet .formula b { color: var(--deep); }
.sheet .answers ol { columns: 2; }
.sheet [contenteditable]:focus { outline: 1.5px dashed #5b8ee6; outline-offset: 2px; border-radius: 4px; }
.sheet [contenteditable] { caret-color: var(--dot); }
.sheet-tools { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.sheet-tools .btn { min-height: 48px; }

@media print {
  @page { size: A4 portrait; margin: 0; }
  body[data-screen=sheet] { background: #fff; }
  body[data-screen=sheet] #status, body[data-screen=sheet] .top, body[data-screen=sheet] .work-card, body[data-screen=sheet] .sheet-tools, body[data-screen=sheet] .fb-open, body[data-screen=sheet] #app > p { display: none !important; }
  body[data-screen=sheet], body[data-screen=sheet] #app { margin: 0; max-width: none; padding: 0; }
  body[data-screen=sheet] #app > div > .muted { display: none !important; }
  body[data-screen=sheet] .sheet-wrap { height: auto !important; margin: 0; overflow: visible; }
  body[data-screen=sheet] .sheet { transform: none !important; width: 210mm; }
  .sheet [contenteditable]:focus { outline: none; }
}
