/* Generator sprawdzianów (/generator-sprawdzianow/): screen preview as A4 paper + print. Layout agreed with the owner 2026-11-26:
   test = two columns + answer table, kartkówka = statement in a grey box + notebook grid, one-line header, watermark at the bottom. */
.tg-wrap{max-width:1000px;padding-block:1.5rem 4rem}
.tg-head{max-width:760px}.tg-head h1{font-size:clamp(1.8rem,4.5vw,2.8rem);line-height:1.15;margin:.3rem 0 .6rem}.tg-head p{line-height:1.65}
.tg-form-box{margin:1.2rem 0;border:1px solid var(--border,#d8dbe3);border-radius:14px;padding:.4rem 1.1rem;background:var(--surface,#fff)}
.tg-form-box>summary{cursor:pointer;font-weight:700;padding:.6rem 0;min-height:44px;display:flex;align-items:center}
.tg-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:.9rem 1.1rem;padding:.4rem 0 1.1rem}
.tg-form label{display:flex;flex-direction:column;gap:.3rem;font-size:.92rem;font-weight:600}
.tg-form select,.tg-form input[type=number],.tg-form input[type=text]{min-height:44px;padding:.45rem .6rem;border:1px solid var(--border-strong,#b8bdc9);border-radius:10px;font:inherit;font-weight:400;background:var(--surface,#fff);color:var(--ink,#111)}
.tg-layouts{grid-column:1/-1;border:0;padding:0;margin:0;display:flex;flex-wrap:wrap;gap:.5rem 1.2rem}
.tg-layouts legend{font-weight:600;font-size:.92rem;margin-bottom:.3rem}
.tg-radio{flex-direction:row!important;align-items:center;gap:.45rem!important;font-weight:400!important;min-height:44px}
.tg-wide{grid-column:1/-1}.tg-form button{justify-self:start;min-height:48px}
.tg-toolbar{display:flex;flex-wrap:wrap;gap:.7rem;margin:1rem 0 .4rem}.tg-toolbar>*{min-height:44px;display:inline-flex;align-items:center}
.tg-note{font-size:.88rem;color:var(--ink-2,#444);max-width:780px}
.tg-warn{padding:.7rem 1rem;border-radius:10px;background:#fff4d6;color:#4a3800;border:1px solid #f0d58a}
.tg-about ol{line-height:1.7}
.tg-pick{margin-top:2rem}.tg-pick h2 small,.tg-key h3 small{font-weight:400;font-size:.8em;color:#555}
.tg-pick-list{padding-left:1.2rem}.tg-pick-list li{margin:.9rem 0;line-height:1.55}
.tg-pick-act{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;margin-top:.35rem}.tg-pick-act a{min-height:40px;display:inline-flex;align-items:center}
.tg-pages{display:flex;gap:1rem;align-items:center;margin-top:1rem}

/* --- the paper (same markup on screen and in print) --- */
.tg-sheets{display:flex;flex-direction:column;gap:1.4rem;margin-top:1rem}
.tg-sheet{background:#fff;color:#111;max-width:210mm;width:100%;margin:0 auto;padding:11mm 12mm;box-shadow:0 2px 14px rgba(0,0,0,.12);border-radius:4px;
  font:9.6pt/1.38 "Times New Roman",Cambria,"Liberation Serif",serif;overflow-x:auto}
.tg-sheet .katex{color:#111}
.tg-hdr{border-bottom:1.5px solid #111;padding-bottom:4px;font-size:10pt}.tg-h1,.tg-h2{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 14px}.tg-h2{margin-top:6px}
.tg-hdr b{font-size:11pt}.tg-hdr .tg-score{margin-left:auto;font-weight:700}.tg-hdr .tg-grp{border:1.5px solid #111;border-radius:4px;padding:0 6px;font-size:10.5pt}
.tg-ins{font-size:8.8pt;margin:5px 0;color:#222}
.tg-card{border-collapse:collapse;width:100%;margin:4px 0 8px;table-layout:fixed}
.tg-card td{border:1px solid #111;height:12mm;vertical-align:top;padding:1px 3px;font-size:7.5pt}
.tg-cols{column-count:2;column-gap:8mm;column-rule:1px solid #111}
.tg-ci{display:flex;gap:4px;break-inside:avoid;border-bottom:1px solid #111;padding:3px 0 4px;margin-bottom:3px}
.tg-n{min-width:16px}.tg-cb{flex:1;min-width:0}.tg-cb p,.tg-ot p{margin:0 0 2px}
.tg-cb ul{list-style:none;margin:2px 0 0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:1px 8px}
.tg-cb li{display:flex;align-items:center;gap:5px;margin:1px 0}
.tg-box{display:inline-block;width:6mm;height:3.6mm;border:1px solid #111;flex:none}
.tg-oi{margin-top:6px;break-inside:avoid}
.tg-ob{display:flex;gap:8px;align-items:flex-start;background:#ececec;padding:5px 8px;border-radius:2px;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.tg-zn{white-space:nowrap}.tg-ot{flex:1;min-width:0}
.tg-pts{font:8pt Arial,sans-serif;border:1px solid #111;border-radius:8px;padding:0 6px;white-space:nowrap}
.tg-grid{border:1px solid #9aa3b2;-webkit-print-color-adjust:exact;print-color-adjust:exact;
  background-image:linear-gradient(#c3c9d4 1px,transparent 1px),linear-gradient(90deg,#c3c9d4 1px,transparent 1px);background-size:5mm 5mm}
.tg-ans{margin:4px 0 0;display:flex;gap:6px;align-items:flex-end;font-size:9.5pt}.tg-ans span{flex:0 0 60mm;border-bottom:1px solid #555;height:13px}
.tg-foot{display:flex;justify-content:space-between;font-size:8.5pt;margin-top:6px;border-top:1px solid #999;padding-top:3px}
.tg-sheet .display{margin:.2rem 0;overflow-x:auto}
/* figures: black on white whatever the site theme (app.css colours them with theme variables) */
.tg-sheet .task-figure.tg-fig{margin:2px 0;padding:0;border:0;background:none;width:34mm;flex:none}
.tg-cb .task-figure.tg-fig{width:40mm}
.tg-sheet .tg-fig svg{max-height:30mm;stroke:#111}
.tg-sheet .tg-fig svg text,.tg-sheet .tg-fig .fig-label,.tg-sheet .tg-fig .fig-point{fill:#111}
.tg-sheet .tg-fig .fig-line{stroke:#111}.tg-sheet .tg-fig .fig-angle,.tg-sheet .tg-fig .fig-accent{stroke:#111}
.tg-sheet .tg-fig .fig-label-accent{fill:#111}.tg-sheet .tg-fig .fig-fill{fill:#fff}.tg-sheet .tg-fig .fig-fill-accent{fill:#e6e6e6}
.tg-sheet .tg-fig .fig-hidden,.tg-sheet .tg-fig .fig-muted{stroke:#666}.tg-sheet .tg-fig .fig-grid{stroke:#ccc}.tg-sheet .tg-fig .fig-axis{stroke:#333}
/* per-problem controls: screen only */
.tg-ctl{display:flex;flex-wrap:wrap;gap:.2rem .8rem;margin-top:3px;font:12px/1.4 Inter,Arial,sans-serif}
.tg-ctl a{color:#1d4ed8;padding:2px 0}
/* answer key */
.tg-key h3{font:700 10.5pt Arial,sans-serif;margin:10px 0 4px}
.tg-keyline{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:11pt;margin:0}
.tg-keyt{border-collapse:collapse;width:100%;font-size:9.5pt;margin-top:4px}.tg-keyt td{border-bottom:1px solid #ddd;padding:3px 6px;vertical-align:top}
.tg-url{font-size:7.5pt;color:#444;word-break:break-all;width:55%}
.tg-scale{display:flex;flex-wrap:wrap;gap:2px 14px;font-size:9pt;margin:2px 0}

@media (max-width:640px){.tg-sheet{padding:6mm 4mm}.tg-cols{column-count:1;column-rule:0}}

@media print{
  @page{size:A4 portrait;margin:11mm 12mm 14mm;
    @bottom-center{content:"Wygenerowano w generatorze sprawdzianów DTF Math · math.decodethefuture.org/generator-sprawdzianow/";font:7pt Arial,sans-serif;color:#888}}
  html,body{background:#fff!important;color:#111!important}
  body>*:not(main){display:none!important}
  main>*:not(.tg-wrap){display:none!important}
  .tg-wrap{max-width:none;padding:0;margin:0}
  .tg-wrap>*:not(.tg-sheets){display:none!important}
  .tg-sheets{display:block;margin:0}
  .tg-sheet{box-shadow:none;border-radius:0;padding:0;max-width:none;overflow:visible;break-after:page}
  .tg-sheet:last-child{break-after:auto}
  .tg-ctl{display:none!important}
  body:not(.tg-print-key) .tg-key{display:none!important}
  body.tg-print-key .tg-sheet:not(.tg-key){display:none!important}
}
.tg-form [hidden]{display:none!important}
