/* Termometr na lekcję — style ekranu. Podstawa wspólna z Zegarem i Działaniami na lekcję (ta sama paleta, przyciski, słoneczko). */
:root {
  --sky: #dff1ff;
  --cream: #fff8e6;
  --ink: #1d2b4f;
  --ink-soft: #4a5a7d;
  --paper: #ffffff;
  --line: #c9d8ea;
  --blue: #1f66d6;
  --blue-dark: #174fa8;
  --sun: #ffd23f;
  --sun-dark: #e0a800;
  --sun-ink: #7a5a00;
  --green: #2e9e5b;
  --green-bg: #dcf5e4;
  --red: #e8523f;
  --red-bg: #ffe3dd;
  --orange: #f28c28;
  --face: #fffdf7;
  --face-ink: #1d2b4f;
  --radius: 22px;
  --hand: "Segoe Print", "Chalkboard SE", "Comic Sans MS", "Bradley Hand", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--sky); }
body {
  margin: 0; min-height: 100vh;
  background: linear-gradient(180deg, var(--sky) 0%, #eef7ff 45%, var(--cream) 100%);
  color: var(--ink); font-family: var(--body); font-size: 18px; line-height: 1.4;
  display: flex; flex-direction: column;
}
body.follow-on { padding-bottom: 120px; }

a { color: var(--blue-dark); }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- nagłówek ---------- */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px; padding: 14px 20px 6px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand .logo { width: 56px; height: 56px; flex: none; }
.top h1 { margin: 0; font-family: var(--hand); font-size: 32px; line-height: 1.1; }
.top h1 span { color: var(--blue); }
.top .sub { margin: 2px 0 0; color: var(--ink-soft); font-size: 16px; }
.modes { display: flex; gap: 8px; flex-wrap: wrap; }
.modes .btn { border-width: 3px; }
.modes .btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; min-width: 44px; padding: 8px 20px;
  font-size: 20px; font-weight: 700; line-height: 1.15;
  border-radius: 999px; border: 3px solid var(--ink);
  background: var(--paper); color: var(--ink);
  text-decoration: none; box-shadow: 0 3px 0 var(--ink);
  transition: transform .08s ease;
}
.btn:hover { background: #f3f8ff; }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn:focus-visible, .toggle:focus-visible, .seg button:focus-visible, .answer:focus-visible, .option:focus-visible {
  outline: 4px solid var(--blue); outline-offset: 3px;
}
.btn[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue-dark); box-shadow: 0 3px 0 var(--blue-dark); }
.btn--gold { background: var(--sun); border-color: var(--sun-dark); box-shadow: 0 3px 0 var(--sun-dark); }
.btn--gold:hover { background: #ffdc66; }
.btn--blue { background: var(--blue); color: #fff; border-color: var(--blue-dark); box-shadow: 0 3px 0 var(--blue-dark); }
.btn--blue:hover { background: #2b74e6; }
.btn--ghost { background: transparent; box-shadow: none; border-color: var(--ink-soft); }
.btn--big { font-size: 24px; min-height: 62px; padding: 10px 28px; }
.btn--sq { min-width: 62px; font-size: 30px; padding: 4px 14px; }
.btn:disabled { opacity: .4; cursor: default; transform: none; }

/* ---------- pasek ustawień ---------- */
.settings {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px;
  margin: 6px 20px 0; padding: 10px 16px; border-radius: var(--radius);
  background: rgba(255,255,255,.7); border: 2px dashed var(--line);
}
.group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.group .lbl { color: var(--ink-soft); font-size: 16px; margin-right: 4px; }
.level-btn { flex-direction: column; gap: 0; padding: 6px 16px; line-height: 1.1; min-height: 54px; }
.level-btn small { font-size: 13px; font-weight: 500; opacity: .85; }
.seg { display: inline-flex; border-radius: 999px; overflow: hidden; border: 3px solid var(--ink); background: var(--paper); }
.seg button { min-height: 44px; padding: 6px 14px; border: 0; background: transparent; font-size: 18px; font-weight: 700; }
.seg button + button { border-left: 3px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.toggle {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 10px 4px 4px;
  border-radius: 999px; border: 2px solid transparent; background: transparent; font-size: 18px; font-weight: 600;
}
.toggle .sw { width: 48px; height: 28px; border-radius: 14px; background: #b9c8dd; position: relative; flex: none; border: 2px solid var(--ink); }
.toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); box-sizing: border-box; }
.toggle[aria-checked="true"] .sw { background: var(--green); }
.toggle[aria-checked="true"] .sw::after { left: 22px; }

main { flex: 1; padding: 16px 20px 24px; }

/* ---------- maskotka: słoneczko ---------- */
.mascot { display: flex; align-items: flex-start; gap: 10px; }
.mascot .sun { width: 110px; height: 110px; flex: none; }
.bubble {
  position: relative; flex: 1; min-height: 60px; padding: 12px 16px; border-radius: 20px;
  background: var(--paper); border: 3px solid var(--ink); font-family: var(--hand); font-size: 21px; line-height: 1.3;
}
.bubble::before, .bubble::after { content: ""; position: absolute; left: -16px; top: 26px; border: 8px solid transparent; border-right-color: var(--ink); border-left: 0; }
.bubble::after { left: -12px; border-right-color: var(--paper); }
.bubble.ok { background: var(--green-bg); border-color: var(--green); }
.bubble.ok::after { border-right-color: var(--green-bg); } .bubble.ok::before { border-right-color: var(--green); }
.bubble.bad { background: var(--red-bg); border-color: var(--red); }
.bubble.bad::after { border-right-color: var(--red-bg); } .bubble.bad::before { border-right-color: var(--red); }
.sun .ray { stroke: var(--sun-dark); stroke-width: 6; stroke-linecap: round; }
.sun .disc { fill: var(--sun); stroke: var(--sun-dark); stroke-width: 3; }
.sun .eye, .sun .brow, .sun .mouth, .sun .eye-happy { display: none; }
.sun .eye { fill: var(--ink); }
.sun .cheek { fill: #ffb2a6; opacity: .8; }
.sun .brow, .sun .mouth, .sun .eye-happy { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.sun .mouth--big { fill: #b23a2e; stroke-width: 3; }
.sun .mouth--o { fill: #b23a2e; }
.sun--idle .eye, .sun--idle .mouth--smile { display: block; }
.sun--happy .eye-happy, .sun--happy .mouth--big { display: block; }
.sun--think .eye, .sun--think .brow, .sun--think .mouth--o { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .sun .rays { transform-origin: 60px 60px; animation: spin 40s linear infinite; }
  .sun--happy { animation: bounce .6s ease; }
  .sun--think { animation: tilt .5s ease; }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes bounce { 0%,100% { transform: translateY(0) } 30% { transform: translateY(-12px) scale(1.06) } 60% { transform: translateY(0) } 80% { transform: translateY(-5px) } }
  @keyframes tilt { 0%,100% { transform: rotate(0) } 40% { transform: rotate(-10deg) } 70% { transform: rotate(6deg) } }
}

/* ---------- tryb: na tablicę ---------- */
.board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 900px) { .board { grid-template-columns: minmax(0, 1fr) 380px; } }
.stage-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.stage { width: min(100%, 66vh); aspect-ratio: 1 / 1; }
:fullscreen .stage { width: min(100%, 76vh); }
.task-banner {
  width: min(100%, 66vh); text-align: center; font-family: var(--hand); font-size: clamp(24px, 4vh, 40px); font-weight: 700; line-height: 1.2;
  padding: 10px 16px; border-radius: var(--radius); background: var(--paper); border: 3px solid var(--sun-dark);
}
.task-banner .big { color: var(--blue); }
.task-banner small { display: block; font-family: var(--body); font-size: 18px; font-weight: 500; color: var(--ink-soft); }
.answer {
  width: min(100%, 66vh); min-height: 96px; padding: 12px 18px; border-radius: var(--radius);
  border: 3px dashed var(--ink-soft); background: var(--paper); text-align: center; line-height: 1.2;
}
.answer .hint { font-size: 20px; color: var(--ink-soft); }
.answer .w { display: block; font-family: var(--hand); font-size: clamp(26px, 4.5vh, 44px); font-weight: 700; }
.answer .d { display: block; font-size: clamp(26px, 4.5vh, 44px); font-weight: 700; color: var(--blue); }
.answer .x { display: block; font-size: 20px; color: var(--ink-soft); margin-top: 4px; }
.answer.open { border-style: solid; border-color: var(--blue); }

.panel { display: flex; flex-direction: column; gap: 14px; }
.panel h3 { margin: 4px 0 0; font-family: var(--hand); font-size: 20px; font-weight: 700; color: var(--ink-soft); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row .btn { flex: 1 1 auto; }
.stepper { display: grid; grid-template-columns: 62px 1fr 62px; gap: 8px; align-items: center; }
.stepper .name { text-align: center; font-size: 20px; font-weight: 600; }
.note { color: var(--ink-soft); font-size: 16px; margin: 0; }

/* ---------- tryb: ćwiczenie ---------- */
.ex-wrap { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.ex { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.ex-progress { display: flex; justify-content: space-between; align-items: center; color: var(--ink-soft); font-size: 18px; font-weight: 600; }
.ex-progress .bar { flex: 1; height: 12px; margin: 0 14px; background: #fff; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; }
.ex-progress .bar i { display: block; height: 100%; background: var(--green); width: 0; }
.ex-q { font-family: var(--hand); font-size: clamp(26px, 3.5vw, 38px); font-weight: 700; text-align: center; line-height: 1.2; margin: 0; }
.ex-q small { display: block; font-family: var(--body); font-size: 18px; font-weight: 500; color: var(--ink-soft); margin-top: 4px; }
.ex-clock { width: min(100%, 52vh, 440px); aspect-ratio: 1; margin: 0 auto; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .options { grid-template-columns: 1fr; } }
.option {
  min-height: 80px; padding: 10px 14px; border-radius: var(--radius); border: 3px solid var(--ink);
  background: var(--paper); text-align: center; line-height: 1.15; box-shadow: 0 3px 0 var(--ink);
}
.option .d { display: block; font-size: 32px; font-weight: 700; }
.option .w { display: block; font-family: var(--hand); font-size: 19px; color: var(--ink-soft); }
.option:hover { background: #f3f8ff; }
.option.ok { border-color: var(--green); background: var(--green-bg); box-shadow: 0 3px 0 var(--green); }
.option.bad { border-color: var(--red); background: var(--red-bg); box-shadow: 0 3px 0 var(--red); }
.option:disabled { cursor: default; }
.inputs { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.inputs label { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 16px; color: var(--ink-soft); font-weight: 600; }
.inputs input {
  width: 112px; min-height: 64px; font: inherit; font-size: 34px; font-weight: 700; text-align: center;
  border-radius: var(--radius); border: 3px solid var(--ink); background: var(--paper); color: var(--ink);
}
.inputs .colon { font-size: 40px; font-weight: 700; margin-top: 18px; }
.feedback { padding: 14px 18px; border-radius: var(--radius); font-size: 22px; line-height: 1.3; text-align: center; border: 3px solid var(--line); background: var(--paper); }
.feedback.ok { border-color: var(--green); background: var(--green-bg); }
.feedback.bad { border-color: var(--red); background: var(--red-bg); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 560px) { .compare { grid-template-columns: 1fr; } }
.compare figure { margin: 0; text-align: center; }
.compare figcaption { font-family: var(--hand); font-size: 20px; color: var(--ink-soft); margin-bottom: 6px; }
.compare .mini { width: min(100%, 240px); aspect-ratio: 1; margin: 0 auto; }
.ex-end { text-align: center; display: flex; flex-direction: column; gap: 18px; align-items: center; padding: 20px 0; }
.ex-end .score { font-family: var(--hand); font-size: clamp(34px, 6vw, 60px); font-weight: 700; margin: 0; }
.ex-start { text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; padding: 10px 0; }
.ex-start p { max-width: 560px; margin: 0; color: var(--ink-soft); }

/* ---------- tryb: karta pracy ---------- */
.sheet-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1000px) { .sheet-layout { grid-template-columns: 340px minmax(0, 1fr); } }
.sheet-settings { display: flex; flex-direction: column; gap: 16px; padding: 16px; border-radius: var(--radius); background: rgba(255,255,255,.7); border: 2px dashed var(--line); }
.sheet-settings input[type="number"] {
  width: 120px; min-height: 48px; font: inherit; font-size: 22px; font-weight: 700; text-align: center;
  border-radius: 999px; border: 3px solid var(--ink); background: var(--paper); color: var(--ink);
}
.print-hint { margin: 0; font-size: 16px; color: var(--blue-dark); font-weight: 600; }

.paper {
  background: #fff; color: #000; width: 100%; max-width: 210mm; margin: 0 auto;
  padding: 12mm 12mm; box-shadow: 0 8px 30px rgba(29,43,79,.25); font-size: 12pt; font-family: var(--body);
}
.paper + .paper { margin-top: 20px; }
.paper h2 { margin: 0; font-size: 15pt; display: inline; }
.paper h2 + span { margin-left: 3mm; }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6mm; border-bottom: 1.2pt solid #000; padding-bottom: 1.5mm; margin-bottom: 3mm; }
.sheet-head .fields { display: flex; gap: 8mm; font-size: 11pt; white-space: nowrap; }
.sheet-head .fields span { display: inline-block; border-bottom: 1pt solid #000; min-width: 40mm; }
.sheet-head .fields .data-f span { min-width: 24mm; }
.sheet-foot { margin-top: 3mm; padding-top: 1mm; border-top: .6pt solid #999; font-size: 9pt; color: #333; display: flex; justify-content: space-between; }

/* ---------- zaproszenie ---------- */
.follow {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--ink); color: #fff; border-top: 4px solid var(--sun);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 20px;
  padding: 12px 56px 12px 20px; font-size: 18px; line-height: 1.3;
}
.follow p { margin: 0; max-width: 620px; }
.follow .btn { box-shadow: none; }
.follow .close { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: #fff; font-size: 26px; line-height: 1; }
.follow .close:hover { background: rgba(255,255,255,.15); }

/* ---------- sekcja opisowa pod aplikacją ---------- */
.seo { max-width: 780px; margin: 36px auto 0; padding: 28px 20px 8px; border-top: 2px dashed var(--line); font-size: 18px; line-height: 1.55; }
.seo h2 { font-family: var(--hand); font-size: 30px; margin: 28px 0 10px; line-height: 1.15; }
.seo h2:first-child { margin-top: 0; }
.seo h3 { font-size: 21px; margin: 22px 0 6px; }
.seo p { margin: 0 0 12px; }
.seo .levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0 6px; }
@media (max-width: 640px) { .seo .levels { grid-template-columns: 1fr; } }
.seo .levels a { display: block; padding: 14px 16px; border-radius: var(--radius); border: 3px solid var(--ink); background: var(--paper); color: var(--ink); text-decoration: none; box-shadow: 0 3px 0 var(--ink); }
.seo .levels a:hover { background: #f3f8ff; }
.seo .levels a strong { display: block; font-family: var(--hand); font-size: 22px; }
.seo .levels a span { color: var(--ink-soft); font-size: 16px; }
.seo .faq h3 { font-family: var(--hand); font-size: 22px; }
footer { padding: 14px 20px; text-align: center; color: var(--ink-soft); font-size: 15px; }
footer a { color: var(--ink-soft); }

.tests { max-width: 900px; margin: 0 auto 16px; padding: 12px 16px; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); font-family: ui-monospace, Consolas, monospace; font-size: 14px; white-space: pre-wrap; }
.tests .fail { color: var(--red); }
.tests .pass { color: var(--green); }

@media (max-width: 480px) {
  .top { padding: 12px 14px 6px; }
  .top h1 { font-size: 26px; }
  .brand .logo { width: 44px; height: 44px; }
  .settings { margin: 6px 12px 0; padding: 8px 10px; }
  main { padding-left: 12px; padding-right: 12px; }
  .btn { padding: 8px 14px; }
  .mascot .sun { width: 80px; height: 80px; }
  .bubble { font-size: 19px; }
}


/* ---------- termometr ---------- */
.term-host { display: block; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; border-radius: 18px; }
.term-host svg { display: block; width: 100%; height: 100%; }
.term-host--rysuj { cursor: grab; }
.term-host--rysuj.dragging { cursor: grabbing; }
.term-host--rysuj:focus-visible { outline: 4px solid var(--blue); outline-offset: 4px; }
.term-host .t-liq, .term-host .t-uchwyt { transition: y .12s ease-out, height .12s ease-out, transform .12s ease-out; }
.term-host.dragging .t-liq, .term-host.dragging .t-uchwyt { transition: none; }
@media (prefers-reduced-motion: reduce) { .term-host .t-liq, .term-host .t-uchwyt { transition: none; } }

/* ---------- pasek ustawień: skala ---------- */
.scale-set { position: relative; }
.scale-set > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 6px 16px; border-radius: 999px; border: 2px solid var(--ink-soft);
  font-size: 17px; font-weight: 700; color: var(--ink);
}
.scale-set > summary::-webkit-details-marker { display: none; }
.scale-set > summary::after { content: "▾"; font-size: 14px; }
.scale-set[open] > summary::after { content: "▴"; }
.scale-set > summary:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }
.scale-set .scale-body {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-top: 10px;
  padding: 12px 14px; border-radius: 16px; background: var(--paper); border: 2px solid var(--line);
}
.scale-set label.f { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; color: var(--ink-soft); }
.scale-set select {
  min-height: 44px; font: inherit; font-size: 18px; font-weight: 700; color: var(--ink);
  padding: 4px 10px; border-radius: 12px; border: 3px solid var(--ink); background: var(--paper);
}
.scale-set .note { flex-basis: 100%; }

/* ---------- tryb: pokaż termometr ---------- */
.show { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 900px) { .show { grid-template-columns: minmax(0, 1fr) 380px; } }
.show .stage-wrap { align-items: center; }
/* wysokość ustawia app.js (dopasujTermometry), tak żeby cały termometr — od °C po bańkę — mieścił się na ekranie */
.term-stage { height: 420px; width: 100%; }
.readout {
  width: 100%; min-height: 110px; padding: 12px 18px; border-radius: var(--radius);
  border: 3px dashed var(--ink-soft); background: var(--paper); text-align: center; line-height: 1.2;
}
.readout .hint { font-size: 20px; color: var(--ink-soft); }
.readout .d { display: block; font-size: clamp(40px, 7vh, 64px); font-weight: 800; color: var(--ink); letter-spacing: .01em; }
.readout .d.neg { color: var(--blue-dark); }
.readout .d.pos { color: #b8321f; }
.readout .w { display: block; font-family: var(--hand); font-size: 22px; font-weight: 700; color: var(--ink-soft); }
.readout.open { border-style: solid; border-color: var(--blue); }
.stepper .name { font-size: 18px; }
.soon { max-width: 640px; margin: 30px auto; text-align: center; padding: 24px; border-radius: var(--radius); background: var(--paper); border: 3px dashed var(--line); }
.soon h2 { font-family: var(--hand); margin: 0 0 8px; }

/* ---------- ćwiczenie i tablica: zwarty nagłówek, więcej miejsca na termometr ---------- */
.mode-tablica .top .sub, .mode-cwiczenie .top .sub { display: none; }
.mode-tablica .top, .mode-cwiczenie .top { padding-top: 8px; padding-bottom: 2px; }
.mode-tablica .top h1, .mode-cwiczenie .top h1 { font-size: 26px; }
.mode-tablica .brand .logo, .mode-cwiczenie .brand .logo { width: 42px; height: 42px; }
.mode-tablica main, .mode-cwiczenie main { padding-top: 10px; }

/* ---------- zwinięty pasek ustawień (ćwiczenie i tablica) ---------- */
.set-summary { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 16px; color: var(--ink-soft); }
.set-summary .sum-text { flex: 1 1 280px; }
.set-summary .sum-text strong { color: var(--ink); }
.settings.collapsed { padding-top: 6px; padding-bottom: 6px; }
.settings.collapsed > :not(.set-summary) { display: none !important; }
.settings:not(.collapsed) .set-summary { padding-bottom: 8px; border-bottom: 2px dashed var(--line); }

/* ---------- pasek zadań (ćwiczenie i tablica) ---------- */
.task-bar { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding-top: 8px; border-top: 2px dashed var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 40px; padding: 4px 14px; border-radius: 999px; border: 2px solid var(--ink-soft); background: var(--paper); font-size: 16px; font-weight: 700; }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue-dark); color: #fff; }
.chip[aria-pressed="true"]::before { content: "✓ "; }
.chip:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }
.btn--sm { min-height: 40px; padding: 4px 14px; font-size: 16px; border-width: 2px; }
#segN button { min-width: 48px; }

/* ---------- termometry w zadaniach ---------- */
.tfig { margin: 0; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; background: transparent; border: 3px solid transparent; border-radius: 18px; }
.tfig .term-fit svg { height: 100%; width: auto; }
.tfig .tcap { font-family: var(--hand); font-size: 20px; font-weight: 700; min-height: 28px; line-height: 28px; text-align: center; color: var(--ink); }
.tletter { position: absolute; left: 4px; top: 2px; font-family: var(--hand); font-size: 26px; font-weight: 700; color: var(--blue-dark); }
.tbadge { position: absolute; right: 2px; top: 2px; width: 40px; height: 40px; border-radius: 50%; background: var(--sun); border: 3px solid var(--sun-dark); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; }
.tpick { cursor: pointer; border-color: var(--line); background: var(--paper); box-shadow: 0 3px 0 var(--line); }
.tpick:hover:not(:disabled) { border-color: var(--blue); }
.tpick:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }
.tpick:disabled { cursor: default; }
.tpick.picked { border-color: var(--sun-dark); }
.tfig.ok { border-color: var(--green); background: var(--green-bg); }
.tfig.bad { border-color: var(--red); background: var(--red-bg); }
.tfig.shown { border-color: var(--blue); }

/* ---------- ćwiczenie ---------- */
.ex-side .mascot .sun { width: 54px; height: 54px; }
.ex-side .mascot .bubble { font-size: 17px; padding: 6px 12px; min-height: 0; line-height: 1.25; }
.ex-side .mascot .bubble::before, .ex-side .mascot .bubble::after { top: 16px; }
#view-cwiczenie .ex-wrap { max-width: 1200px; gap: 10px; }
.ex { gap: 12px; }
.ex-story { margin: 0; text-align: center; font-size: 21px; line-height: 1.4; }
.ex-q .big { color: var(--blue); white-space: nowrap; }
.ex-body { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 16px 28px; }
.ex-terms { display: flex; flex-wrap: nowrap; justify-content: center; gap: 10px; }
.ex-side { flex: 1 1 200px; min-width: 190px; max-width: 320px; display: flex; flex-direction: column; gap: 10px; }
.ex-side .feedback { font-size: 20px; text-align: left; }
.feedback .big { display: block; font-size: 30px; font-weight: 800; }
.feedback .why { display: block; margin-top: 4px; }
.options--col { grid-template-columns: 1fr; }
.options--col .option { min-height: 64px; }
.options--col .option .d { font-size: 30px; }
.keypad { display: flex; flex-direction: column; gap: 8px; }
.kp-display { display: flex; align-items: baseline; justify-content: center; gap: 8px; min-height: 58px; padding: 6px 14px; border-radius: var(--radius); border: 3px solid var(--ink); background: var(--paper); font-size: 40px; font-weight: 800; }
.kp-display.empty .kp-val { color: var(--ink-soft); }
.kp-display.ok { border-color: var(--green); background: var(--green-bg); }
.kp-display.bad { border-color: var(--red); background: var(--red-bg); }
.kp-unit { font-size: 28px; }
.kp-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kp-key { min-height: 50px; border-radius: 16px; border: 3px solid var(--ink); background: var(--paper); font-size: 26px; font-weight: 800; box-shadow: 0 3px 0 var(--ink); }
.kp-key:active { transform: translateY(3px); box-shadow: none; }
.kp-key.kp-sign { background: #dcecff; }
.kp-key:disabled, .kp-ok:disabled { opacity: .45; }
.errs { text-align: left; max-width: 640px; margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.errs span { display: block; color: var(--ink-soft); font-size: 16px; }
@media (max-width: 600px) {
  .mascot .sun { width: 58px; height: 58px; }
  .bubble { font-size: 17px; padding: 8px 12px; min-height: 0; }
  .ex-q { font-size: 24px; }
  .ex-story { font-size: 18px; }
  .ex-side { min-width: 170px; }
  .kp-key { min-height: 48px; }
  .tfig .tcap { font-size: 17px; }
}

/* ---------- na tablicę ---------- */
.bd { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 900px) { .bd { grid-template-columns: minmax(0, 1fr) 420px; } }
.bd-stage { display: flex; justify-content: center; align-items: flex-start; gap: 18px; flex-wrap: nowrap; }
.bd-stage .tfig .tcap { font-size: 26px; }
.bd-stage .tletter { font-size: 34px; }
.bd-panel { gap: 16px; }
.bd-count { margin: 0; color: var(--ink-soft); font-size: 18px; font-weight: 600; }
.bd-task { padding: 14px 18px; border-radius: var(--radius); background: var(--paper); border: 3px solid var(--sun-dark); }
.bd-story { margin: 0 0 8px; font-size: 24px; line-height: 1.35; }
.bd-q { margin: 0; font-family: var(--hand); font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; line-height: 1.2; }
.bd-q .big { color: var(--blue); white-space: nowrap; }
.bd-panel .answer .d { display: block; font-size: clamp(34px, 5vh, 54px); font-weight: 800; color: var(--blue); }
.bd-panel .answer .x { font-size: 21px; color: var(--ink); line-height: 1.35; }
#view-tablica:fullscreen { background: var(--sky); padding: 16px 20px; overflow: auto; }
#view-pokaz:fullscreen { background: var(--sky); padding: 16px 20px; }

/* ---------- karta pracy ---------- */
.sheet-settings input[type="text"] { width: 100%; min-height: 46px; font: inherit; font-size: 17px; padding: 6px 12px; border-radius: 14px; border: 3px solid var(--ink); background: var(--paper); color: var(--ink); }
.sheet-settings .group.col { flex-direction: column; align-items: flex-start; }
.kinds { display: grid; grid-template-columns: 1fr; gap: 6px; width: 100%; }
.kinds .btn { justify-content: flex-start; text-align: left; min-height: 46px; font-size: 17px; padding: 6px 14px; }
.paper { padding: 15mm; min-height: 297mm; display: flex; flex-direction: column; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.paper .sheet-body { flex: 1; }
.sheet-head { flex-wrap: wrap; gap: 2mm 6mm; }
.sheet-head .title { flex: 1 1 95mm; }
.sheet-head .fields { margin-left: auto; }
.paper .grp { font-size: 11pt; font-weight: 700; margin: 0 3mm; }
.kinstr { margin: 0 0 3mm; font-size: 11.5pt; }
.kinstr small { display: block; font-size: 10pt; color: #333; }
.ksec { margin: 3mm 0 2mm; font-size: 11.5pt; font-weight: 700; }
.ksec small { display: block; font-size: 10pt; font-weight: 400; color: #333; }
.kt svg { display: block; height: 100%; width: auto; margin: 0 auto; }
.kgrid { display: grid; gap: 3mm 2mm; }
.kcell { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1mm; }
.kcell .no, .ktask .no { position: absolute; left: 0; top: 0; font-size: 10pt; font-weight: 700; }
.kval { font-size: 14pt; font-weight: 800; line-height: 7mm; height: 7mm; }
.kans { font-size: 12pt; line-height: 7mm; height: 7mm; white-space: nowrap; }
.kans .line { display: inline-block; width: 13mm; border-bottom: 1pt solid #000; height: 5mm; vertical-align: bottom; }
.ans { color: #c0392b; font-weight: 800; }
.bw .ans { color: #000; text-decoration: underline; }
.kpairs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm; }
.kpair { border: .8pt solid #999; border-radius: 3mm; padding: 2mm; text-align: center; }
.kpair p { margin: 0 0 1mm; font-size: 11pt; }
.kpair-t { display: flex; justify-content: space-around; }
.kpick { position: relative; padding: 1mm 1.5mm; border: 1.4pt solid transparent; border-radius: 50%; display: flex; flex-direction: column; align-items: center; }
.kpick.kcirc { border-color: #c0392b; }
.bw .kpick.kcirc { border-color: #000; }
.kl { font-size: 12pt; font-weight: 800; line-height: 6mm; }
.kuloz { display: flex; justify-content: space-around; }
.kbox { width: 11mm; height: 11mm; border: 1.2pt solid #000; border-radius: 1.5mm; font-size: 16pt; font-weight: 800; line-height: 11mm; text-align: center; }
.ktasks { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm 5mm; }
.ktask { position: relative; border: .8pt solid #999; border-radius: 3mm; padding: 2mm 3mm; display: flex; flex-direction: column; }
.kstory { margin: 0 0 1mm 4mm; font-size: 10.5pt; line-height: 1.3; min-height: 18mm; }
.ktask-t { display: flex; justify-content: space-around; }
.ktask-t figure { margin: 0; text-align: center; }
.ktask-t figcaption { font-size: 10pt; font-weight: 700; line-height: 5mm; }
.kodp { margin: 1mm 0 0; font-size: 11pt; line-height: 7mm; }
.kodp .line { display: inline-block; width: 14mm; border-bottom: 1pt solid #000; height: 5mm; vertical-align: bottom; }

/* ---------- okno „Udostępnij uczniom" (jak w ortografii) ---------- */
dialog.share { border: 4px solid var(--ink); border-radius: var(--radius); padding: 20px; max-width: min(92vw, 560px); color: var(--ink); background: var(--paper); font-family: var(--body); }
dialog.share::backdrop { background: rgba(29,43,79,.55); }
dialog.share h2 { margin: 0 0 8px; font-family: var(--hand); font-size: 26px; }
dialog.share .link { width: 100%; font: inherit; font-size: 15px; padding: 8px 10px; border-radius: 12px; border: 3px solid var(--ink); word-break: break-all; }
dialog.share canvas { display: block; margin: 12px auto; width: min(60vw, 260px); height: auto; image-rendering: pixelated; }
dialog.share .row { justify-content: center; }
dialog.share .copied { color: var(--green); font-weight: 700; }

/* ---------- telefon: zwarty nagłówek, żeby termometr dostał jak najwięcej wysokości ---------- */
@media (max-width: 600px) {
  .top { gap: 8px; padding-bottom: 4px; }
  .top .sub { display: none; }
  .modes { display: grid; grid-template-columns: repeat(4, auto); gap: 5px; width: 100%; }
  .modes .btn { min-height: 40px; padding: 4px 6px; font-size: 14px; border-width: 2px; }
  .settings { gap: 6px 10px; padding: 6px 8px; }
  .settings .group[aria-label="Poziom"] { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .level-btn { min-height: 44px; padding: 4px 6px; font-size: 16px; }
  .level-btn small { display: none; }
  .scale-set > summary { min-height: 38px; padding: 4px 12px; font-size: 15px; }
  main { padding-top: 8px; }
  .sum-typy { display: none; }
}

/* kontrola druku (narzedzia-dev/karty.mjs): kartka w wymiarach obszaru druku A4 z marginesami 15 mm */
body.kontrola .paper { width: 180mm; max-width: none; height: 266mm; min-height: 0; padding: 0; box-shadow: none; margin: 0 0 10mm; }

/* ---------- pakiet na cały rok (jak w ortografii) ---------- */
.pakiet { max-width: 980px; margin: 32px auto 0; padding: 0 20px; }
.pakiet-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 24px; border-radius: var(--radius); background: var(--ink); color: #fff; border-top: 5px solid var(--sun); }
@media (min-width: 860px) { .pakiet-wrap { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); align-items: center; } }
.pakiet-badge { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--sun); color: var(--sun-ink); font-weight: 700; font-size: 14px; }
.pakiet-copy h2 { margin: 10px 0 8px; font-family: var(--hand); font-size: 30px; line-height: 1.15; }
.pakiet-copy h2 em { font-style: normal; color: var(--sun); }
.pakiet-copy p { margin: 0 0 10px; font-size: 17px; line-height: 1.5; color: #e6ecf7; }
.pakiet-perks { margin: 0; padding-left: 20px; font-size: 16px; color: #e6ecf7; }
.pakiet-perks li { margin-bottom: 4px; }
.pakiet-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 18px; background: var(--paper); color: var(--ink); }
.pakiet-card select { min-height: 50px; font: inherit; font-size: 20px; font-weight: 700; padding: 0 14px; border-radius: 999px; border: 3px solid var(--ink); background: var(--paper); color: var(--ink); }
.pakiet-card .note { font-size: 14px; }
.pakiet-dlg .gdpr { font-size: 13px; color: var(--ink-soft); line-height: 1.4; margin: 10px 0 0; }
.pakiet-dlg .ml-embedded { min-height: 120px; }
/* formularz MailerLite: chowamy jego nagłówek i dopasowujemy kolory do palety narzędzia */
.pakiet-dlg .ml-form-embedContent { display: none !important; }
.pakiet-dlg .ml-form-embedWrapper.embedForm { background-color: transparent !important; max-width: none !important; }
.pakiet-dlg .ml-form-embedBody { padding: 0 !important; }
.pakiet-dlg .ml-form-embedSubmit { margin-top: 10px !important; }
.pakiet-dlg #mlb2-46069408.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input.form-control { border: 3px solid var(--ink) !important; border-radius: 999px !important; padding: 12px 16px !important; font-family: var(--body) !important; font-size: 17px !important; color: var(--ink) !important; background: #fff !important; }
.pakiet-dlg #mlb2-46069408.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input.form-control::placeholder { color: var(--ink-soft) !important; }
.pakiet-dlg #mlb2-46069408.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button.primary { background: var(--sun) !important; color: var(--ink) !important; border: 3px solid var(--sun-dark) !important; border-radius: 999px !important; font-family: var(--body) !important; font-weight: 700 !important; font-size: 18px !important; padding: 12px 20px !important; }
.pakiet-dlg .ml-form-successBody { padding: 0 !important; }
