/* Xami – wspólne style. Motyw: kartka z zeszytu w kratkę. */
@font-face { font-family: "Atkinson"; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson"; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson"; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson"; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper: #fbfdff;
  --grid: #d3e3f1;
  --grid-strong: #b9d0e6;
  --margin: #e0525e;
  --ink: #1d3557;
  --ink-soft: #3d5a80;
  --graphite: #2f343a;
  --muted: #5f6b77;
  --ok: #2b8a3e;
  --line: #c9d6e2;
  --cell: 20px;
  --radius: 6px;
  --font: "Atkinson", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.5; color: var(--graphite); background: var(--paper); }

.paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  min-height: 100vh;
}
.paper::before { /* czerwony margines zeszytu */
  content: ""; position: fixed; top: 0; bottom: 0; left: 72px; width: 2px; background: var(--margin); opacity: .75; pointer-events: none;
}

.sheet { max-width: 820px; padding: 32px 24px 64px 104px; }

.masthead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 40px; }
.wordmark { font-size: 40px; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; line-height: 1; }
.who { color: var(--muted); margin-right: 8px; }
.inline { display: inline; }

h1 { font-size: 30px; line-height: 1.2; color: var(--ink); margin: 0 0 8px; font-weight: 700; }
.intro { margin-bottom: 24px; max-width: 60ch; }
.intro p { margin: 0; }

label { display: block; font-weight: 700; color: var(--ink); font-size: 15px; }
.hint { font-weight: 400; color: var(--muted); }
input { display: block; width: 100%; margin-top: 4px; font: inherit; color: var(--graphite); padding: 9px 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; }
input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(29, 53, 87, .18); }

.btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 15px; font-weight: 700;
  padding: 9px 16px; border-radius: var(--radius); border: 1.5px solid var(--ink); background: #fff; color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 42px; }
.btn:hover { background: #eef4fa; }
.btn:focus-visible, .link-btn:focus-visible, .menu-item:focus-visible, .board-name:focus-visible { outline: 3px solid var(--ink-soft); outline-offset: 2px; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #24426b; }
.btn-quiet { border-color: transparent; background: transparent; }
.link-btn { font: inherit; background: none; border: 0; color: var(--ink); text-decoration: underline; cursor: pointer; padding: 0; }

.form-card { display: grid; gap: 16px; max-width: 420px; background: #fff; border: 1.5px solid var(--line); border-radius: 8px; padding: 24px; }
.new-board { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 12px; align-items: end; background: #fff;
  border: 1.5px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 32px; }

.notice { background: #fff; border-left: 4px solid var(--ink); padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 24px; }
.notice p { margin: 0 0 8px; }
.notice-ok { border-left-color: var(--ok); }
.notice-error { border-left-color: var(--margin); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { margin: 0; font-size: 14px; }

.board-list { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--grid-strong); }
.board-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1.5px solid var(--grid-strong); }
.board-name { font-size: 21px; font-weight: 700; color: var(--ink); text-decoration: none; }
.board-name:hover { text-decoration: underline; }
.board-meta { display: block; color: var(--muted); font-size: 15px; }
.board-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.more { position: relative; }
.more summary { list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1.5px solid var(--line); border-radius: 8px;
  padding: 6px; min-width: 260px; z-index: 5; box-shadow: 0 8px 24px rgba(29, 53, 87, .14); }
.menu-item { display: block; width: 100%; text-align: left; font: inherit; font-size: 15px; background: none; border: 0; padding: 9px 10px; border-radius: 4px; cursor: pointer; color: var(--graphite); }
.menu-item:hover { background: #eef4fa; }
.menu-item.danger { color: #b3261e; }
.empty { color: var(--muted); }
.colophon { margin-top: 64px; color: var(--muted); font-size: 14px; }

@media (max-width: 720px) {
  .paper::before { left: 20px; }
  .sheet { padding: 20px 16px 48px 36px; }
  .new-board { grid-template-columns: 1fr; }
  .board-row { flex-direction: column; align-items: flex-start; }
  .board-actions { flex-wrap: wrap; }
}

/* ---------- 0.3: panel kont ---------- */
.panel-nav { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.panel-nav a { color: var(--ink); text-decoration: none; font-weight: 700; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.panel-nav a:hover { border-bottom-color: var(--grid-strong); }
.panel-nav a[aria-current="page"] { border-bottom-color: var(--margin); }
.panel-nav a:focus-visible { outline: 3px solid var(--ink-soft); outline-offset: 2px; }

select { display: block; width: 100%; margin-top: 4px; font: inherit; color: var(--graphite); padding: 9px 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; }
select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(29, 53, 87, .18); }
h2 { font-size: 21px; line-height: 1.25; color: var(--ink); margin: 0 0 4px; }

.form-card.wide { max-width: 640px; }
.form-card + .form-card { margin-top: 20px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--graphite); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }
.crumbs { margin: -24px 0 12px; font-size: 15px; color: var(--muted); }
.crumbs a { color: var(--ink); }

.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 20px; overflow: hidden; }
.seg a { padding: 8px 14px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; }
.seg a + a { border-left: 1.5px solid var(--line); }
.seg a[aria-current="page"] { background: var(--ink); color: #fff; }

.panel-section { margin-top: 36px; max-width: 640px; }
.panel-section .copy-row { margin: 8px 0 12px; }
.inline-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-stack { display: grid; gap: 12px; max-width: 420px; margin-top: 8px; }
.danger-zone { border-top: 1.5px solid var(--grid-strong); padding-top: 20px; }
.danger-zone p { margin: 0 0 12px; }
.btn-danger { border-color: #b3261e; color: #b3261e; }
.btn-danger:hover { background: #fdeceb; }

.data-table { width: 100%; border-collapse: collapse; background: #fff; border: 1.5px solid var(--line); border-radius: 8px; margin-bottom: 28px; font-size: 16px; }
.data-table th { text-align: left; font-size: 14px; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1.5px solid var(--line); }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr.inactive td { color: var(--muted); }
.data-table .right { text-align: right; }
.badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: #eef2f6; color: var(--graphite); }
.badge-admin { background: var(--ink); color: #fff; }
.badge-off { background: #fdeceb; color: #b3261e; }
.simple-list { list-style: none; padding: 0; margin: 8px 0 0; }
.simple-list li { padding: 6px 0; border-bottom: 1px solid var(--grid); }
.simple-list a { font-weight: 700; color: var(--ink); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .04em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .masthead { flex-direction: column; align-items: flex-start; gap: 12px; }
  .data-table th:nth-child(3), .data-table td:nth-child(3), .data-table th:nth-child(4), .data-table td:nth-child(4) { display: none; }
}

.badge-break { background: #fff4e0; color: #8a5300; }

/* ---------- 0.4: bank zadań, arkusze, zeszyt ---------- */
.plain-fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 16px; min-width: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; align-items: center; }
.filters select, .filters input { font: inherit; font-size: 15px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 6px; background: #fff; }
.task-form textarea { font-family: inherit; }
.task-img { display: flex; gap: 16px; align-items: center; }
.task-img img { max-width: 220px; max-height: 160px; border: 1px solid var(--line); border-radius: 6px; }
.danger-zone { display: block; margin-top: 16px; }
.section-title { font-size: 20px; color: var(--ink); margin: 28px 0 10px; }
.data-table tr.weak td:first-child { color: #b3261e; font-weight: 700; }
.data-table .ord { width: 64px; font: inherit; padding: 4px 6px; border: 1.5px solid var(--line); border-radius: 6px; }
.sheet-form .form-card { margin-bottom: 8px; }
.board-actions .btn-quiet + .btn-quiet { margin-left: 0; }
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr; } }

/* 0.6: zero bez kreski (liceum: nie myli się ze zbiorem pustym ∅) – sama cyfra 0 z kroju Lexend (OFL) */
@font-face { font-family: "AlmiriZero"; font-weight: 400; font-display: swap; src: url("fonts/lexend-zero-400.woff2") format("woff2"); unicode-range: U+0030; }
@font-face { font-family: "AlmiriZero"; font-weight: 700; font-display: swap; src: url("fonts/lexend-zero-700.woff2") format("woff2"); unicode-range: U+0030; }
body.plain-zero { --font: "AlmiriZero", "Atkinson", "Segoe UI", system-ui, sans-serif; font-family: var(--font); }

/* ---------- 1.0: kalendarz, rodzic, języki ---------- */
.cal-list { display: grid; gap: 14px; margin-bottom: 28px; }
.cal-day { background: #fff; border: 1.5px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.cal-day.cal-today { border-color: var(--ink); }
.cal-day h2 { font-size: 16px; margin: 0 0 6px; color: var(--ink); }
.cal-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cal-day li { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.cal-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); min-width: 104px; }
.badge-soft { background: #e7f5ff; color: #1864ab; }
.parent-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 22px; }
.parent-sum div { background: #fff; border: 1.5px solid var(--line); border-radius: 8px; padding: 12px; text-align: center; }
.parent-sum strong { display: block; font-size: 28px; color: var(--ink); }
.parent-sum span { color: var(--muted); font-size: 14px; }
.lang-switch { display: inline-flex; gap: 10px; margin-left: 8px; }
.lang-switch a { color: var(--ink); }
.lang-switch a[aria-current] { font-weight: 700; text-decoration: none; }
@media (max-width: 640px) { .parent-sum { grid-template-columns: repeat(2, 1fr); } }

/* ===== 1.0 (Xami): rozwiązanie obejrzane, kopie tablicy, kopia zadania ===== */
.badge-warn { background: #fff4e6; color: #8a4b00; font-weight: 600; }
.copy-choice { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy-label { font-weight: 700; color: var(--graphite); }
.copy-row { margin: 0 0 12px; }
.source-note { margin: -4px 0 12px; }
.snap-new { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 14px; }
.snap-new input { flex: 1 1 320px; }
.snap-comment-form { display: flex; gap: 6px; }
.snap-comment-form input { flex: 1; min-width: 160px; }
.nowrap { white-space: nowrap; }
.btn-sm { font-size: 14px; padding: 5px 10px; }

/* ===== 1.1: miniatury rozwiązań w zeszycie ===== */
.nb-shot { display: inline-block; margin-top: 6px; }
.nb-shot img { max-width: 220px; max-height: 170px; border: 1px solid var(--line, #d3e3f1); border-radius: 6px; background: #fff; display: block; }

/* ---------- 2.1: panel szkoły ---------- */
.usage { display: flex; flex-wrap: wrap; gap: 20px 40px; }
.usage-item { flex: 1 1 200px; min-width: 0; }
.usage-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.usage-head b { font-size: 1.25rem; }
.usage meter { display: block; width: 100%; height: 12px; margin-top: 8px; }
.usage-item.over .usage-head span, .usage-item.over .hint { color: #9E2430; }
.notice-warn { background: #FFFBEA; border-color: #F1DE9A; }
.row-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px 0; }
.row-form > span { flex: 1 1 220px; }
.row-form select, .row-form input { width: auto; min-width: 12em; }
.row-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.inline-details { display: inline-block; vertical-align: middle; }
.inline-details summary { list-style: none; cursor: pointer; }
.inline-details[open] { display: block; margin-top: 6px; }
.danger { color: #9E2430; }
.btn.btn-ink.danger { background: #9E2430; color: #fff; }
.plain-list { list-style: none; margin: 4px 0 12px; padding: 0; }
.plain-list li { padding: 6px 0; border-top: 1px solid #E3ECF5; }
.grid-2.top { align-items: start; }
.notice-support { background: #EEF4FA; border-color: #1D3557; color: #1D3557; font-weight: 700; }

/* ---------- 2.2: panel operatora ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: #EEF4FA; }
.tabs a { padding: 8px 14px; border-radius: 9px; color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { background: #fff; font-weight: 700; }
.badge.state-trial { background: #FFF2C2; color: #6B4E00; }
.badge.state-active { background: #DDF0E4; color: #1F6B3A; }
.badge.state-suspended, .badge.state-deleting { background: #FBE3E5; color: #9E2430; }
.badge.state-deleted, .badge.state-pending { background: #EEF4FA; color: #5A6672; }
pre.small { font-size: 12px; white-space: pre-wrap; max-width: 60ch; }

/* ---------- 2.3: rejestracja ---------- */
.signup { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.signup-pitch { flex: 1 1 320px; max-width: 460px; }
.signup .form-card { flex: 1 1 380px; max-width: 540px; }
.signup-note { padding: 12px 14px; border-left: 4px solid #FFE27A; background: #fff; border-radius: 0 10px 10px 0; }
.addr { display: flex; align-items: stretch; border: 1.5px solid #b7c9db; border-radius: 10px; overflow: hidden; background: #fff; }
.addr input { border: 0; flex: 1 1 auto; min-width: 0; box-shadow: none; }
.addr > span { display: flex; align-items: center; padding: 0 10px; background: #EEF4FA; color: #5A6672; white-space: nowrap; font-weight: 400; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hint.ok { color: #1F6B3A; font-weight: 700; }
.wizard-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; padding: 0; margin: 0 0 16px; }
.wizard-steps li { display: flex; gap: 8px; align-items: center; color: #5A6672; }
.wizard-steps li[aria-current="step"] { color: var(--ink); font-weight: 700; }
.wizard-steps .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid #b7c9db; }
.wizard-steps .done .dot { background: var(--ink); color: #fff; border-color: var(--ink); }
.wizard-steps li[aria-current="step"] .dot { background: #FFE27A; border-color: var(--ink); }
