/* Worksheet Maker + Doc Maker. Screen chrome uses the site tokens; the paper itself is toner-saving B&W. */
.tool-hero { padding: 124px 0 36px; }
.tool-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 0 0 6px; }
.tool-hero p { margin: 0; max-width: 46em; }
.tool-hero .wrap { display: flex; gap: 20px; align-items: end; justify-content: space-between; flex-wrap: wrap; }
.tool-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-tabs a { text-decoration: none; font-weight: 600; font-size: .875rem; padding: 9px 14px; border-radius: .5rem; background: #fff; border: 1.5px solid var(--hair-2); border-radius: 999px; color: var(--ink); }
.tool-tabs a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }

.tool { display: grid; grid-template-columns: 350px minmax(0, 1fr); align-items: start; gap: 16px; padding: 20px 12px 40px; }
.tool-panel { border: var(--line); background: var(--card); position: sticky; top: 96px; height: calc(100vh - 112px); border-radius: .75rem; overflow-y: auto; padding: 18px 18px 60px; }
.tool-stage { border-radius: .75rem; background: var(--paper-2); padding: 22px 22px 60px; min-height: calc(100vh - 72px); overflow-x: hidden; }
.tool-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 auto 18px; max-width: 820px; }
.tool-bar .grow { flex: 1; }
.tool-bar .btn { padding: .7em 1em; font-size: .95rem; }
.tool-bar .info { font-weight: 700; font-size: .9rem; color: var(--ink-2); }

.pg { margin: 0 0 20px; }
.pg > h3 { font: 800 .78rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--sky); margin: 0 0 10px; }
.fld { display: block; margin: 0 0 10px; font-weight: 700; font-size: .86rem; }
.fld input[type=text], .fld select, .fld textarea, .inp {
  display: block; width: 100%; margin-top: 4px; font: 500 .95rem/1.3 var(--body); padding: 9px 10px; border: 1px solid var(--hair-2);
  border-radius: 9px; background: #fff; color: var(--ink);
}
.fld textarea { min-height: 96px; resize: vertical; }
.seg { display: flex; margin-top: 4px; border: 1px solid var(--hair-2); border-radius: 9px; overflow: hidden; }
.seg button { flex: 1; font: 700 .86rem/1 var(--body); padding: 9px 4px; border: 0; border-left: 1px solid var(--hair-2); background: #fff; color: var(--ink); cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed=true] { background: var(--sun); }
.chk { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; padding: 4px 0; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.mini { font: 700 .82rem/1 var(--body); padding: 7px 10px; border: 1px solid var(--hair-2); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; }
.mini:hover { background: var(--sun); }
.mini.hot { background-image: var(--g-dark); border-color: transparent; color: #fff; }
.rowx { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hint { font-size: .82rem; color: var(--muted); margin: 6px 0 0; }

/* chosen topics */
.picked { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.picked li { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; border: 1px solid var(--hair-2); border-radius: 9px; padding: 6px 6px 6px 10px; background: var(--paper); font-weight: 600; font-size: .9rem; }
.picked .step { display: flex; align-items: center; border: 1px solid var(--hair-2); border-radius: 7px; overflow: hidden; background: #fff; }
.picked .step button, .picked .x { width: 26px; height: 26px; border: 0; background: #fff; font: 800 1rem/1 var(--body); cursor: pointer; color: var(--ink); }
.picked .step button:hover, .picked .x:hover { background: var(--sun); }
.picked .step span { min-width: 26px; text-align: center; font-size: .88rem; }
.picked .x { border: 1px solid var(--hair-2); border-radius: 7px; }
.picked-empty { border: 2px dashed var(--muted); border-radius: 9px; padding: 12px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.topics { border: 1px solid var(--hair-2); border-radius: 9px; max-height: 300px; overflow-y: auto; background: #fff; }
.topics h4 { font: 800 .74rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase; margin: 0; padding: 9px 10px 6px; background: var(--paper-2); position: sticky; top: 0; }
.topics button { display: flex; width: 100%; justify-content: space-between; gap: 8px; text-align: left; font: 600 .9rem/1.25 var(--body); padding: 7px 10px; border: 0; border-top: 1px solid var(--hair); background: #fff; color: var(--ink); cursor: pointer; }
.topics button:hover { background: var(--paper-2); }
.topics button.on { background: #e9f8f1; }
.topics button b { font-weight: 800; color: var(--sky); }
.topics button.on b { color: var(--mint); }

/* ---------- the paper ---------- */
.paper { margin: 0 auto; width: 794px; transform-origin: top left; }   /* A4 at 96 dpi: 794 x 1123 px */
.sheet {
  --pf: Helvetica, Arial, sans-serif; --fs: 15px;
  background: #fff; color: #000; width: 794px; min-height: 1118px; padding: 52px 58px 46px; margin: 0 0 22px;
  border: 1px solid var(--hair-2); box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04); font: var(--fs)/1.4 var(--pf); position: relative;
  display: flex; flex-direction: column;
}
.sheet.f-serif { --pf: Georgia, "Times New Roman", serif; }
.sheet.f-hand { --pf: "Chalkboard SE", "Comic Sans MS", "Comic Neue", cursive; }
.sheet.s-s { --fs: 13.5px; } .sheet.s-l { --fs: 17px; }
.sheet [contenteditable]:focus { outline: 2px dashed var(--sky); outline-offset: 2px; }
.sheet [contenteditable]:empty::before { content: attr(data-ph); color: #b3b3b3; }
.sh-head { border-bottom: 2.5px solid #000; padding-bottom: 8px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.sh-head h2 { font: 800 1.5em/1.12 var(--pf); letter-spacing: 0; margin: 0; }
.sh-head .sub { font-size: .9em; margin-top: 2px; }
.sh-head .ver { border: 2px solid #000; border-radius: 6px; padding: 2px 9px; font-weight: 800; white-space: nowrap; }
.sh-name { display: flex; gap: 18px; font-size: .92em; margin-bottom: 14px; }
.sh-name span { flex: 1; border-bottom: 1.3px solid #000; padding-bottom: 2px; white-space: nowrap; }
.sh-name span.n { flex: 2.4; }
.sh-sec { font: 800 1.02em/1.2 var(--pf); margin: 14px 0 3px; padding-bottom: 3px; border-bottom: 1.3px solid #000; display: flex; justify-content: space-between; gap: 12px; break-after: avoid; }
.sh-dirs { font-style: italic; font-size: .93em; margin: 4px 0 8px; break-after: avoid; }
.sh-grid { display: grid; gap: 0; grid-template-columns: repeat(var(--c, 2), minmax(0, 1fr)); margin-bottom: 4px; }
.pb { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 7px; padding: 9px 10px 4px 2px; break-inside: avoid; align-content: start; }
.boxed .pb { border: 1px solid #8c8c8c; margin: -1px 0 0 -1px; padding: 9px 10px 4px 9px; }
.pb .pn { font-weight: 800; }
.pb .pq { min-width: 0; overflow-wrap: break-word; }
.pb .pw { grid-column: 1 / -1; }
.pb .fig, .blk .fig { display: block; margin: 6px 0 0; max-width: 100%; height: auto; font-family: var(--pf); }
.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .86em; line-height: 1.12; margin: 0 .12em; }
.fr > span:first-child { border-bottom: 1.3px solid currentColor; padding: 0 .28em 1px; }
.fr > span:last-child { padding: 1px .28em 0; }
.rt > span { border-top: 1.3px solid currentColor; padding: 0 .12em 0 .08em; }
sup, sub { font-size: .7em; line-height: 0; }
.sh-foot { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; font-size: 10.5px; color: #555; }
.key-list { columns: 3; column-gap: 26px; margin: 4px 0 0; padding: 0; list-style: none; }
.key-list.c2 { columns: 2; } .key-list.c1 { columns: 1; }
.key-list li { break-inside: avoid; padding: 3.5px 0; border-bottom: 1px dotted #999; display: flex; gap: 8px; }
.key-list li b { min-width: 1.9em; }

.related { max-width: 820px; margin: 10px auto 0; }
.related h3 { margin: 0 0 12px; }
.related .rel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.related a { display: block; text-decoration: none; background: var(--card); border: var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); font-size: .84rem; font-weight: 700; line-height: 1.25; }
.related a:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-lg); }
.related img { width: 100%; aspect-ratio: 1; object-fit: cover; border-bottom: var(--line); }
.related span { display: block; padding: 8px 10px 0; }
.related em { display: block; padding: 4px 10px 10px; font-style: normal; color: var(--tomato-d); }

/* ---------- Doc Maker blocks ---------- */
.doc-flow { display: flex; flex-wrap: wrap; align-content: flex-start; }
.blk { position: relative; width: 100%; padding: 5px 4px; border-radius: 4px; break-inside: avoid; }
.blk.half { width: 50%; }
.blk:hover { box-shadow: inset 0 0 0 1px #c9d9f5; }
.blk.sel { box-shadow: inset 0 0 0 2px var(--sky); }
.blk-tools { position: absolute; right: 2px; top: -13px; display: none; gap: 2px; z-index: 5; background: var(--ink); border-radius: 7px; padding: 2px; font-family: var(--body); }
.blk:hover > .blk-tools, .blk.sel > .blk-tools { display: flex; }
.blk-tools button { border: 0; background: none; color: #fff; font: 700 12px/1 var(--body); padding: 5px 6px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.blk-tools button:hover { background: var(--tomato); }
.b-head h2 { font: 800 1.55em/1.12 var(--pf); letter-spacing: 0; margin: 0; }
.b-head .hd { border-bottom: 2.5px solid #000; padding-bottom: 7px; margin-bottom: 10px; }
.b-head .sub { font-size: .92em; }
.b-sec .t { font: 800 1.05em/1.2 var(--pf); border-bottom: 1.3px solid #000; padding-bottom: 3px; margin-top: 6px; }
.b-text .t { white-space: pre-wrap; }
.b-text.dirs .t { font-style: italic; }
.b-q { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 7px; align-content: start; }
.b-q .pn { font-weight: 800; }
.b-q .body { min-width: 0; }
.b-q .t { white-space: pre-wrap; min-height: 1.3em; }
.b-q .pw { grid-column: 1 / -1; }
.doc-boxed .b-q { border: 1px solid #8c8c8c; margin: -1px 0 0 -1px; padding: 9px 10px 4px 9px; border-radius: 0; }
.mc-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.mc-list.one { grid-template-columns: 1fr; }
.mc-list li { display: flex; gap: 7px; align-items: baseline; }
.mc-list .ltr { width: 1.45em; height: 1.45em; flex: none; border: 1.3px solid #000; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .78em; font-weight: 700; cursor: pointer; }
.mc-list .ltr.ok { box-shadow: 0 0 0 2px var(--mint); }
.mc-list .t { flex: 1; min-width: 2em; }
.tf { margin-top: 5px; font-weight: 700; letter-spacing: .04em; }
.tf span { border: 1.3px solid #000; border-radius: 5px; padding: 1px 9px; margin-right: 8px; cursor: pointer; }
.tf span.ok { box-shadow: 0 0 0 2px var(--mint); }
.wlines div { border-bottom: 1.2px solid #000; height: 27px; }
.ans-edit { grid-column: 1 / -1; display: flex; gap: 6px; align-items: baseline; font: 600 11.5px/1.3 var(--body); color: #1a7a55; margin-top: 3px; }
.ans-edit .t { flex: 1; min-height: 1.3em; border-bottom: 1px dotted #7fc8a9; white-space: pre-wrap; }
.b-note .bx { border: 2px solid #000; border-radius: 8px; padding: 9px 12px; }
.b-note .ttl { font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: .82em; margin-bottom: 3px; }
.b-note .t { white-space: pre-wrap; }
.b-table table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.b-table td { border: 1.2px solid #000; padding: 6px 8px; vertical-align: top; min-height: 1.4em; height: 30px; white-space: pre-wrap; overflow-wrap: break-word; }
.b-table tr.th td { font-weight: 800; border-bottom-width: 2.4px; }
.b-grid .gwrap { display: flex; gap: 14px; align-items: flex-start; }
.b-grid svg { flex: none; }
.b-img img { max-width: 100%; display: block; }
.b-break { border-top: 2px dashed var(--sky); margin: 10px 0; text-align: center; font: 700 11px/1 var(--body); color: var(--sky); padding-top: 4px; }
.doc-list { display: grid; gap: 6px; margin-bottom: 10px; }
.doc-list button { text-align: left; font: 700 .9rem/1.25 var(--body); padding: 8px 10px; border: 1px solid var(--hair-2); border-radius: 9px; background: #fff; cursor: pointer; color: var(--ink); }
.doc-list button[aria-current] { background: var(--sun); }
.doc-list small { display: block; font-weight: 500; color: var(--muted); }
.palette { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.palette button { text-align: left; }
.sell-out { font: 500 .84rem/1.4 var(--body); white-space: pre-wrap; border: 1px solid var(--hair-2); border-radius: 9px; padding: 10px; background: #fffbea; max-height: 260px; overflow: auto; margin: 8px 0; }

@media (max-width: 1000px) {
  .tool { grid-template-columns: 1fr; }
  .tool-panel { position: static; height: auto; border-right: 0; border-bottom: var(--line); padding-bottom: 20px; }
  .tool-stage { padding: 16px 12px 40px; }
  .related .rel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@page { size: A4; margin: 0; }   /* no page margin = the browser has no room for its date / title / URL lines; the sheet carries its own padding */
@media print {
  .topbar, .site-head, .site-foot, .mk-band, .mtt-toast, .tool-hero, .tool-panel, .tool-bar, .related, .blk-tools, .ans-edit, .toast, .sr, .no-print { display: none !important; }
  html, body { background: #fff !important; }
  .tool { display: block; border: 0; }
  .tool-stage { padding: 0; background: none; min-height: 0; overflow: visible; }
  html, body, main, .mk-sheet, .tool, .tool-stage { margin: 0 !important; padding: 0 !important; width: auto !important; min-width: 0 !important; }
  .paper { width: 794px !important; transform: none !important; height: auto !important; margin: 0 !important; }
  .sheet { border: 0; box-shadow: none; margin: 0; -webkit-box-decoration-break: clone; box-decoration-break: clone; -webkit-print-color-adjust: exact; print-color-adjust: exact; }   /* same box as on screen */
  .sheet + .sheet { break-before: page; }
  .blk:hover, .blk.sel { box-shadow: none; }
  .b-break { break-after: page; border: 0; height: 0; margin: 0; padding: 0; overflow: hidden; }
  .mc-list .ltr.ok, .tf span.ok { box-shadow: none; }
  .sheet [contenteditable]:empty::before { content: ""; }
}

/* start from a lesson (course -> topic -> lesson) */
.lesson-find { border: 2px solid var(--ink); border-radius: 16px; padding: 14px 14px 12px; margin-bottom: 22px; background: var(--sun); }
.lesson-find > h3 { color: var(--ink); }
.lesson-find .fld select { text-overflow: ellipsis; }
.lf-out { font-size: .88rem; }
.lf-out p { margin: 4px 0 8px; }
.lf-ok b { color: var(--ink); }
.lf-none { font-weight: 700; color: var(--ink); }
.lf-link { display: inline-block; margin-top: 8px; font-weight: 700; color: var(--sky); text-decoration: underline; text-underline-offset: 3px; }
@media print { .lesson-find { display: none !important; } }

.sk-add { width: 100%; padding: 11px 10px; font-size: .9rem; border-radius: 999px; }
.picked { margin-bottom: 14px; }

/* question-bank items */
.sheet .mcq { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 14px; margin-top: 6px; }
.sheet .mcq > div { display: block; }
.sheet .qfig { margin: 8px 0 2px; }
.sheet .qfig svg { max-width: 100%; height: auto; display: block; }
.sheet .katex { font-size: 1.04em; }
.sheet .pq b { font-weight: 700; }
.lf-or { margin: 10px 0 6px !important; font-size: .8rem; color: var(--muted); }
.sheet .pq .big { font-size: 1.25em; font-weight: 700; margin: 6px 0; }
.sheet .pq .tt { border-collapse: collapse; margin: 6px 0 0; font-size: .92em; }
.sheet .pq .tt td, .sheet .pq .tt th { border: 1.5px solid #111; padding: 2px 9px; text-align: center; font-weight: 600; }
.sheet .pq svg.fig { max-width: 100%; height: auto; }

/* ---------- membership: meter bar, dialogs, print lock ---------- */
.mbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; max-width: 820px; margin: 0 auto 14px; padding: 10px 14px; background: #fff; border: var(--line); border-radius: 16px; font-size: .9rem; color: var(--ink-2); }
.mbar-t b { color: var(--ink); }
.mbar-a { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mbar-e { font-size: .8rem; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtag { display: inline-block; background: var(--ink); color: #fff !important; border-radius: 999px; padding: 2px 9px; font-size: .68rem; letter-spacing: .08em; margin-right: 4px; }
.mdlg { width: min(440px, calc(100% - 28px)); border: 0; border-radius: 24px; padding: 28px 26px 22px; color: var(--ink-2); box-shadow: var(--shadow-lg); }
.mdlg::backdrop { background: rgba(11, 31, 77, .45); }
.mdlg h3 { font-size: 1.45rem; margin: 0 28px .5em 0; }
.mdlg p { margin: 0 0 14px; }
.mdlg form { display: grid; gap: 12px; margin-bottom: 8px; }
.mdlg-x { position: absolute; right: 14px; top: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--paper-2); color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.mdlg-note { background: var(--sun); border-radius: 12px; padding: 10px 12px; font-weight: 600; color: var(--ink); }
.mdlg-msg { min-height: 1.2em; margin: 10px 0 0 !important; font-size: .9rem; font-weight: 600; color: var(--ink); }
.mdlg-msg.bad { color: var(--tomato-d); }
.mdlg-small { font-size: .82rem; color: var(--muted); margin: 12px 0 0 !important; }
.mdlg-link { font-weight: 800; color: var(--sky); }
.mdlg-demo { margin-top: 8px; font-size: .86rem; }
.mplan { display: flex; justify-content: space-between; gap: 14px; align-items: center; background: var(--sun); border-radius: 16px; padding: 16px 18px; margin: 4px 0 14px; }
.mplan b { display: block; font-size: 1.05rem; color: var(--ink); margin-bottom: 4px; }
.mplan span { display: block; font-size: .86rem; }
.mprice { font-size: 2rem; font-weight: 800; letter-spacing: -.04em; color: var(--ink); white-space: nowrap; }
.mprice small { font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.print-lock { display: none; }
@media print {
  .mbar, .mdlg { display: none !important; }
  body:not(.print-ok) .paper, body:not(.print-ok) .tool { display: none !important; }
  body:not(.print-ok) .print-lock { display: block !important; padding: 1in .6in; font: 600 14pt/1.5 Helvetica, Arial, sans-serif; color: #000; }
}

/* generator gate: nothing opens before sign-in */
body.gen-wait .tool, body.gen-locked .tool { display: none !important; }
body.gen-wait .tool-hero::after { opacity: 1; }
.gen-gate { padding: 28px 12px 72px; }
.gen-gate-card { width: min(940px, 100%); margin: 0 auto; display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; align-items: center; padding: clamp(22px, 4vw, 40px); background: #fff; border: 2px solid var(--ink); border-radius: 28px; box-shadow: var(--shadow-lg); }
.gen-gate-copy h2 { margin-bottom: .35em; }
.gen-gate-copy ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: .95rem; }
.gen-gate-copy li { display: flex; gap: 9px; align-items: flex-start; }
.gen-gate-copy li::before { content: "check_circle"; font-family: "Material Symbols Rounded"; font-size: 1.2rem; line-height: 1.3; color: var(--mint); flex: none; }
.gen-gate-form { background: var(--sun); border-radius: 20px; padding: 22px; }
.gen-gate-form form { display: grid; gap: 12px; }
@media (max-width: 760px) { .gen-gate-card { grid-template-columns: 1fr; } }
@media print { .gen-gate { display: none !important; } }

/* ---- review fixes: usage meter, gate, phone controls ---- */
.mmeter { display: inline-block; width: 64px; height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; vertical-align: middle; margin: 0 8px 0 4px; }
.mmeter i { display: block; height: 100%; border-radius: 999px; background: var(--sky); }
.gen-gate-form { align-self: center; }
.gen-gate-form::after { content: "We only use your details to run your account."; display: block; margin-top: 10px; font-size: .8rem; color: var(--muted); }
@media (max-width: 1000px) {
  .picked .step button, .picked .x { width: 38px; height: 38px; }
  .picked .step span { min-width: 30px; }
  .seg button { min-height: 42px; }
  .mini { min-height: 40px; padding: 9px 12px; }
  .tool-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; max-width: none; margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: var(--line); box-shadow: 0 -10px 26px -18px rgba(11, 31, 77, .45); flex-wrap: nowrap; overflow-x: auto; }
  .tool-bar .grow, .tool-bar .info { display: none; }
  .tool-bar .btn { flex: none; min-height: 44px; }
  .tool-stage { padding-bottom: 96px; }
  body:has(.tool-bar) .mtt-toast { bottom: 84px; }
}
@media print { .tool-bar { display: none !important; } }

/* continuation pages of a long worksheet */
.sh-cont { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1.3px solid #000; padding-bottom: 5px; margin-bottom: 10px; font-size: .86em; }
.sh-cont b { font-weight: 800; }
.sh-cont span { color: #555; }
@media print { .sheet { break-after: page; break-inside: avoid; overflow: hidden; } .sheet:last-child { break-after: auto; } #docSheet, #keySheet { break-inside: auto; overflow: visible; } }

/* ---------- account forms (sign up / log in / Google) ---------- */
.m-auth { display: grid; gap: 12px; }
.m-auth form { display: grid; gap: 12px; margin: 0; }
.m-auth label { display: grid; gap: 5px; font-weight: 700; font-size: .9rem; color: var(--ink); }
.m-auth input { width: 100%; min-height: 46px; padding: 10px 14px; border: 1.5px solid #b9c4de; border-radius: 12px; background: #fff; font: inherit; font-weight: 500; color: var(--ink); }
.m-auth input:focus-visible { outline: 3px solid rgba(31, 94, 255, .35); border-color: var(--sky, #1f5eff); }
.m-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #e6edfb; border-radius: 999px; }
.m-tabs button { min-height: 40px; border: 0; border-radius: 999px; background: transparent; font: inherit; font-weight: 800; color: var(--muted); cursor: pointer; }
.m-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(11, 31, 77, .18); }
.m-g { display: flex; justify-content: center; min-height: 44px; }
.m-or { display: flex; align-items: center; gap: 10px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.m-or::before, .m-or::after { content: ""; flex: 1; height: 1px; background: #c5cfe6; }
.m-link { justify-self: center; min-height: 40px; padding: 6px 10px; border: 0; background: none; font: inherit; font-size: .88rem; font-weight: 700; color: var(--sky, #1f5eff); text-decoration: underline; cursor: pointer; }
.m-lead { margin: 0 !important; font-size: .92rem; }
.m-auth .mdlg-msg { margin: 0 !important; }
@media (max-width: 380px) { .m-two { grid-template-columns: 1fr; } }
