/* Matma Radar: jeden styl dla landingów, stron publicznych i aplikacji.
   Kartka w kratkę, niebieski atrament (Kalam), czerwony długopis nauczyciela, nagłówki Bricolage Grotesque.
   Ładowany przed arkuszami aplikacji: te korzystają z tych samych zmiennych (--bg, --ink, --line, --soft, --ok, --bad). */

:root {
  --bg: #f7f5ef; --sheet: #fffefa; --ink: #16181d; --muted: #5c606b; --faint: #9a9ca3;
  --line: #e2ded3; --soft: #efece3; --ok: #2f7a45; --bad: #c7362c; --bar: #16181d;
  --pen: #1d3a8f; --pen-hover: #142b6e; --red: #c7362c; --grid: #dfe6ef;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --d: "Bricolage Grotesque", var(--sans); --h: Kalam, "Comic Neue", cursive;
}
:root[data-theme="dark"] {
  --bg: #141519; --sheet: #1b1d22; --ink: #f1efe8; --muted: #a4a7af; --faint: #6d7079;
  --line: #2b2e35; --soft: #20232a; --ok: #6fcf8f; --bad: #ff8a7a; --bar: #f1efe8;
  --pen: #9db4ff; --pen-hover: #c0cfff; --red: #ff8a7a; --grid: #252a36;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--d); letter-spacing: -.02em; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ── nagłówek (wspólny) ── */
.top { position: relative; z-index: 5; border-bottom: 1px solid var(--line); background: var(--bg); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 0 22px; height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none;
  font: 800 1.25rem/1 var(--d); letter-spacing: -.03em; flex: none; }
.brand .logo { width: 28px; height: 28px; color: var(--ink); flex: none; display: block; }
.top nav { display: flex; gap: 20px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.top nav::-webkit-scrollbar { display: none; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap;
  padding: 6px 0; border-bottom: 2px solid transparent; }
.top nav a:hover, .top nav a.on { border-bottom-color: var(--red); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; flex: none; }
@media (max-width: 760px) {
  .top-in { flex-wrap: wrap; height: auto; padding-top: 12px; gap: 6px 16px; }
  .top nav { order: 3; flex-basis: 100%; gap: 18px; padding-bottom: 6px; }
  .top nav.short { order: 0; flex-basis: auto; justify-content: flex-end; padding-bottom: 0; }
  .top-in:has(nav.short) { height: 64px; padding-top: 0; flex-wrap: nowrap; }
  .top nav a.opt { display: none; }
}

/* ── przyciski (wspólne) ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px;
  padding: 12px 22px; font: 700 1rem/1.1 var(--d); letter-spacing: -.01em; cursor: pointer;
  background: var(--pen); color: #fff; text-decoration: none; transition: background .12s, transform .12s; }
.btn:hover:not(:disabled) { background: var(--pen-hover); }
:root[data-theme="dark"] .btn { color: #0e1530; }
.btn:disabled { opacity: .35; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.ghost:hover:not(:disabled) { background: var(--soft); }
.btn.sm { padding: 8px 15px; font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ── stopka (wspólna) ── */
.gfoot { border-top: 2px solid var(--ink); margin-top: 72px; background: var(--bg); font-size: 14px; }
main + .gfoot { margin-top: 0; }
.gfoot-in { max-width: 1120px; margin: 0 auto; padding: 40px 22px 110px; display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr); gap: 28px; }
.fbrand p { color: var(--muted); font-size: 14px; margin: 12px 0 0; max-width: 280px; line-height: 1.5; }
.fcol h4 { font-size: 14px; margin: 4px 0 10px; }
.fcol a { display: block; color: var(--muted); text-decoration: none; padding: 4px 0; }
.fcol a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); }
.fbottom { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 18px; color: var(--muted); font-size: 13px; }
.fbottom p { margin: .35em 0; }
.fbottom a { color: var(--muted); margin-right: 16px; }
@media (max-width: 760px) {
  .gfoot-in { grid-template-columns: 1fr 1fr; gap: 22px; }
  .fbrand { grid-column: 1 / -1; }
}

/* ── baner cookies (wspólny) ── */
#cc { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; background: var(--sheet); border: 2px solid var(--ink);
  border-radius: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.2); padding: 18px; max-width: 600px; margin: 0 auto; font-size: .92rem; display: none; }
#cc.on { display: block; }
#cc p { margin: 0 0 14px; color: var(--muted); }
#cc .row { display: flex; gap: 8px; flex-wrap: wrap; }
#cc .row button { flex: 1 1 150px; padding: 12px; border-radius: 999px; font: 700 .95rem var(--d); cursor: pointer; border: 2px solid var(--ink); }
#cc .acc { background: var(--ink); color: var(--bg); }
#cc .rej { background: transparent; color: var(--ink); }
#cc .opts { display: none; margin: 0 0 14px; }
#cc.more .opts { display: block; }
#cc .opts label { display: flex; gap: 10px; padding: 5px 0; align-items: flex-start; }
#cc .lnk { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; font: inherit; margin-top: 10px; }
