/* Phiếu bài tập in riêng: trên màn hình là hai tờ giấy A4; khi in, mỗi tờ một trang, ẩn thanh công cụ */
:root { color-scheme: light; --ink: #2f3b57; --soft: #5b6a86; --line: #c9bd9d; --paper: #fffdf6; }
* { box-sizing: border-box; }
body { margin: 0; background: #ece6d6; color: var(--ink); font: 16px/1.6 "Segoe UI", Arial, sans-serif; }
h1, h2, .ws-brand, .ws-btn, .ws-back, .ws-tag { font-family: "Comfortaa", "Segoe UI", Arial, sans-serif; font-weight: 700; }
:focus-visible { outline: 3px solid #b67744; outline-offset: 3px; }

.ws-tools { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px max(16px, calc((100% - 820px) / 2)); background: #174e98; color: #fff; }
.ws-back { color: #fff; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 22px; }
.ws-back:hover { background: #ffffff1f; }
.ws-tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ws-count { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.ws-count select { min-height: 40px; border-radius: 10px; border: 0; padding: 0 8px; font: inherit; }
.ws-btn { min-height: 44px; padding: 8px 18px; border-radius: 14px; border: 0; background: #ffd56b; color: #3a2a00; font-size: 15px; cursor: pointer; }
.ws-btn.quiet { background: transparent; color: #fff; border: 1.5px solid #ffffff88; }

.ws-sheets { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 24px 12px 60px; }
.ws-page { width: min(210mm, 100%); min-height: 297mm; padding: 18mm 16mm; background: var(--paper); border-radius: 6px;
  box-shadow: 0 2px 0 #d8cfb8, 0 12px 28px #4a402822; }
.ws-head { border-bottom: 2px solid var(--line); padding-bottom: 10px; margin-bottom: 14px; }
.ws-brand { margin: 0; font-size: 13px; color: #8a6a2a; letter-spacing: .02em; }
.ws-head h1 { margin: 4px 0 2px; font-size: 26px; line-height: 1.25; }
.ws-head h2 { margin: 4px 0 2px; font-size: 22px; }
.ws-meta { margin: 0; color: var(--soft); font-size: 14px; }
.ws-note { margin: 6px 0 0; color: var(--soft); font-size: 14px; }
.ws-list { margin: 0; padding-left: 24px; }
.ws-item { margin: 0 0 16px; break-inside: avoid; page-break-inside: avoid; }
.ws-tag { margin: 0; font-size: 12px; color: #8a6a2a; }
.ws-q { margin: 2px 0 6px; font-size: 16px; }
.ws-lines { display: flex; flex-direction: column; gap: 14px; margin: 10px 0 8px; }
.ws-line { display: block; border-bottom: 1px dashed #b9ae92; height: 1px; }
.ws-answer-line { margin: 4px 0 0; font-size: 15px; letter-spacing: .04em; }
.ws-key-answer { margin: 0 0 2px; font-weight: 700; }
.ws-steps { margin: 0; padding-left: 18px; color: var(--soft); font-size: 15px; }
.ws-req { margin: 4px 0 0; font-size: 12.5px; color: #7a8599; }
.ws-fine { margin-top: 18px; font-size: 12px; color: #7a8599; }

@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .ws-tools { display: none !important; }
  .ws-sheets { padding: 0; gap: 0; }
  .ws-page { width: auto; min-height: auto; border-radius: 0; box-shadow: none; padding: 14mm 14mm; }
  .ws-answers { break-before: page; page-break-before: always; }
}
@media (max-width: 600px) { .ws-page { padding: 18px 14px; min-height: 0; } }
