/* Dziennik Alma Mater - parent pages. Mobile first. Type: main text 18 px (1.125rem), nothing under 16 px (D044). ASCII only (served next to ISO-8859-2 pages).
   World: almamater.pl (white ground, navy shell, red only for attention, system font stack, 8px buttons). */

:root {
  --am-navy: #1b418d;
  --am-navy-deep: #13306a;
  --am-navy-ink: #102654;
  --am-navy-tint: #eef2fa;
  --am-navy-line: #d5ddef;
  --am-red: #e31c2a;
  --am-red-text: #b3121e;
  --am-red-tint: #fdeced;
  --am-ok: #1d6b43;
  --am-ok-tint: #e8f4ee;
  --am-ink: #1c2230;
  --am-text: #3f4552;
  --am-muted: #5f6675;
  --am-line: #e2e6ee;
  --am-ground: #f3f5f9;
  --am-card: #ffffff;
  --am-shadow: 0 5px 15px rgba(16, 38, 84, .08);
  --am-shadow-lift: 0 10px 28px rgba(16, 38, 84, .14);
  --am-radius: 8px;
  --am-radius-card: 14px;
  --am-gutter: 16px;
  --am-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
/* Narrow phones: 4 px less at the screen edges and inside cards, so 18 px text keeps its room (D044) */
@media (max-width: 400px) { :root { --am-gutter: 12px; } }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--am-ground);
  color: var(--am-text);
  font: 400 1.125rem/1.55 var(--am-font);
  -webkit-tap-highlight-color: transparent;
}

::selection { background: #c9d6f3; color: var(--am-navy-ink); }
a { color: var(--am-navy); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--am-navy-deep); }
:focus-visible { outline: 3px solid #7fa0e6; outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { color: var(--am-ink); line-height: 1.2; margin: 0; text-wrap: balance; }
p { margin: 0; }
.bsp-num { font-variant-numeric: tabular-nums lining-nums; }
.bsp-visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Shell: navy band ---------- */
.bsp-band {
  background: var(--am-navy);
  color: #fff;
  padding: 12px var(--am-gutter) 56px;
  padding-top: max(12px, env(safe-area-inset-top));
}
.bsp-band__inner { max-width: 1120px; margin: 0 auto; }
.bsp-band__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bsp-logo { display: block; height: 30px; width: auto; }
.bsp-logout {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .45); border-radius: var(--am-radius);
  color: #fff; text-decoration: none; font-weight: 700; font-size: 1rem; letter-spacing: .02em; text-transform: uppercase;
}
.bsp-logout:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.bsp-logout svg { width: 18px; height: 18px; }

.bsp-who { margin-top: 16px; }
.bsp-who__name { color: #fff; font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; overflow-wrap: break-word; overflow-wrap: anywhere; }
.bsp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.bsp-chips li {
  padding: 4px 10px; border-radius: 14px; /* not a full pill: a long level description wraps */ background: rgba(255, 255, 255, .14);
  color: #e9eefb; font-size: 1rem; font-weight: 600;
}
.bsp-who__meta { margin-top: 8px; color: #dbe4f7; font-size: 1rem; }

/* ---------- Top bar: full-colour logo on white, like the almamater.pl header ---------- */
.bsp-topbar { background: #fff; border-bottom: 1px solid var(--am-line); padding: 8px var(--am-gutter); padding-top: max(8px, env(safe-area-inset-top)); }
.bsp-topbar__inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bsp-topbar .bsp-logo { height: 54px; }
.bsp-topbar .bsp-logout { color: var(--am-navy); border-color: var(--am-navy-line); }
.bsp-topbar .bsp-logout:hover { background: var(--am-navy-tint); color: var(--am-navy-deep); }
.bsp-band { padding-top: 18px; }

/* ---------- Page ---------- */
.bsp-page { max-width: 1120px; margin: -40px auto 0; padding: 0 var(--am-gutter) 32px; }

.bsp-card {
  background: var(--am-card); border-radius: var(--am-radius-card); box-shadow: var(--am-shadow);
  padding: 20px var(--am-gutter);
}

/* ---------- "Najnowsze" summary (the signature) ---------- */
.bsp-now h2 { font-size: 1.3125rem; }
.bsp-now__status { margin-top: 6px; color: var(--am-muted); font-size: 1.125rem; }

/* Last lesson as one field: when, then the teacher's text whole (topic and homework are not split, D033) */
.bsp-lesson { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--am-navy-tint); }
.bsp-lesson__when { color: var(--am-navy); font-size: 1rem; font-weight: 700; }
.bsp-lesson__meta { display: block; margin-top: 1px; color: var(--am-text); font-size: 1rem; font-weight: 400; }
.bsp-lesson__label { margin-top: 8px; color: var(--am-muted); font-size: 1rem; font-weight: 600; }
.bsp-lesson__text { margin-top: 2px; color: var(--am-ink); font-size: 1.125rem; line-height: 1.5; overflow-wrap: break-word; overflow-wrap: anywhere; text-wrap: pretty; }
@media (max-width: 399px) { .bsp-lesson { padding: 12px; } }
.bsp-nw { white-space: nowrap; }
.bsp-now__next { margin-top: 12px; color: var(--am-ink); font-size: 1.125rem; font-weight: 700; }
.bsp-now__results { margin-top: 20px; }
.bsp-now__subhead { color: var(--am-ink); font-size: 1.125rem; font-weight: 700; }
.bsp-now__subhead span { color: var(--am-muted); font-weight: 400; font-size: 1rem; }
.bsp-results { margin: 8px 0 0; padding: 0; list-style: none; }
.bsp-results li { border-top: 1px solid var(--am-line); }
.bsp-results li:first-child { border-top: 0; }
.bsp-results a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 6px 0; color: inherit; text-decoration: none;
}
.bsp-results__cat { color: var(--am-ink); font-size: 1.125rem; overflow-wrap: break-word; overflow-wrap: anywhere; }
.bsp-results__cat small { display: block; color: var(--am-muted); font-size: 1rem; }
.bsp-results__marks { display: flex; gap: 6px; flex-shrink: 0; }
.bsp-results__final { color: var(--am-navy-ink); font-weight: 700; text-align: right; }
.bsp-now__more { margin-top: 4px; font-size: 1rem; }
.bsp-mark-big {
  min-width: 48px; padding: 4px 8px; border-radius: 10px; background: var(--am-navy-tint);
  color: var(--am-navy-ink); font-size: 1.625rem; font-weight: 800; text-align: center; line-height: 1.25;
}

/* two boxes side by side while each has room for "usprawiedliwione" at 16 px, otherwise one under the other */
.bsp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.25rem, 1fr)); gap: 8px; margin: 18px 0 0; }
.bsp-fact { padding: 10px 12px; border: 1px solid var(--am-line); border-radius: 12px; }
.bsp-fact dt { color: var(--am-muted); font-size: 1rem; }
.bsp-fact dd { margin: 2px 0 0; color: var(--am-ink); font-size: 1.3125rem; font-weight: 700; }
.bsp-fact dd small { display: block; color: var(--am-muted); font-size: 1rem; font-weight: 400; }
.bsp-fact--wide { grid-column: 1 / -1; }
.bsp-fact--wide dd { font-size: 1.125rem; }
.bsp-fact--wide a { display: flex; align-items: center; min-height: 44px; font-weight: 700; }

/* ---------- Section buttons ---------- */
.bsp-nav { margin-top: 16px; }
.bsp-nav h2 { font-size: 1rem; color: var(--am-muted); font-weight: 600; margin: 0 0 8px 2px; }
.bsp-nav ul { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 0; list-style: none; }
.bsp-nav a {
  display: flex; flex-direction: column; justify-content: center; min-height: 64px; padding: 10px 14px;
  border-radius: var(--am-radius); background: var(--am-card); box-shadow: var(--am-shadow);
  border: 1px solid var(--am-navy-line); color: var(--am-navy); text-decoration: none;
  transition: transform .12s ease-out, box-shadow .12s ease-out;
}
.bsp-nav a:active { transform: scale(.98); box-shadow: none; }
@media (hover: hover) { .bsp-nav a:hover { box-shadow: var(--am-shadow-lift); border-color: #b9c7e6; } }
.bsp-nav__label { font-size: 1.125rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.bsp-nav__hint { color: var(--am-muted); font-size: 1rem; }

/* ---------- Sections ---------- */
.bsp-section { margin-top: 28px; scroll-margin-top: 12px; }
.bsp-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 10px; }
.bsp-section__head h2 { font-size: 1.5625rem; }
.bsp-top { font-size: 1rem; font-weight: 600; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }

/* Semester switch: from the second semester on (termconfig = 2), opens on the current one */
.bsp-seg { display: none; margin: 0 0 12px; padding: 4px; border-radius: 10px; background: #e7ebf3; }
.bsp-js .bsp-seg { display: inline-flex; } /* the switch needs the script; without it both semesters are listed */
.bsp-seg a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 8px;
  color: var(--am-text); text-decoration: none; font-weight: 700; font-size: 1rem;
}
.bsp-seg a[aria-current="true"] { background: #fff; color: var(--am-navy); box-shadow: 0 1px 3px rgba(16, 38, 84, .12); }
[hidden] { display: none !important; }
/* without JS both semesters are listed, each under its own heading; with JS the switch names the semester */
.bsp-term-h { margin: 0 0 10px; color: var(--am-ink); font-size: 1.125rem; }
.bsp-js .bsp-term-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bsp-section .bsp-card + .bsp-card { margin-top: 12px; }

/* Marks */
.bsp-cats { margin: 0; padding: 0; list-style: none; }
.bsp-cat { padding: 14px 0; border-top: 1px solid var(--am-line); }
.bsp-cat:first-child { border-top: 0; padding-top: 2px; }
.bsp-cat__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bsp-cat__name { color: var(--am-ink); font-size: 1.125rem; font-weight: 700; overflow-wrap: break-word; overflow-wrap: anywhere; }
.bsp-cat__changed { display: block; color: var(--am-muted); font-size: 1rem; font-weight: 400; }
.bsp-cat__new {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--am-red-tint);
  color: var(--am-red-text); font-size: 1rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px;
}
.bsp-term { flex-shrink: 0; text-align: right; }
.bsp-term small { display: block; color: var(--am-muted); font-size: 1rem; }
.bsp-term strong { color: var(--am-navy-ink); font-size: 1.125rem; }
.bsp-marks { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.bsp-mark {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 52px; min-height: 52px;
  padding: 4px 8px; border-radius: 10px; background: var(--am-navy-tint); color: var(--am-navy-ink);
}
.bsp-mark__label { color: var(--am-muted); font-size: 1rem; font-weight: 700; letter-spacing: .02em; line-height: 1.1; }
.bsp-mark__value { font-size: 1.375rem; font-weight: 800; line-height: 1.2; }
.bsp-mark--away { background: #f4f5f7; }
.bsp-mark--away .bsp-mark__value { color: var(--am-muted); font-size: 1.125rem; }

.bsp-more { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--am-line); }
.bsp-more > summary {
  display: flex; align-items: center; gap: 8px; min-height: 48px; cursor: pointer; list-style: none;
  color: var(--am-navy); font-weight: 700;
}
.bsp-more > summary::-webkit-details-marker { display: none; }
.bsp-more > summary svg { width: 18px; height: 18px; transition: transform .15s ease-out; }
.bsp-more[open] > summary svg { transform: rotate(180deg); }
.bsp-more__body { padding: 0 0 8px; color: var(--am-muted); }
.bsp-more__list .bsp-days { padding-bottom: 6px; }
.bsp-more__end { padding-bottom: 6px; }
.bsp-more__end a { display: inline-flex; align-items: center; min-height: 44px; color: var(--am-navy); font-weight: 600; }
.bsp-legend { margin-top: 12px; color: var(--am-muted); font-size: 1rem; }
.bsp-legend b { color: var(--am-text); }

/* Desktop table of marks */
.bsp-table { display: none; width: 100%; border-collapse: collapse; table-layout: fixed; }
.bsp-table th, .bsp-table td { padding: 12px 10px; border-top: 1px solid var(--am-line); text-align: left; vertical-align: top; }
.bsp-table thead th { border-top: 0; color: var(--am-muted); font-size: 1rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
/* fixed widths for the short columns, the rest for the marks */
.bsp-table thead th:first-child { width: 36%; }
.bsp-table thead th:last-child { width: 7.5rem; }
.bsp-table__final { display: block; margin-top: 4px; color: var(--am-muted); font-size: 1rem; font-weight: 400; }
.bsp-table__final b { color: var(--am-navy-ink); }
.bsp-table th[scope="row"] { overflow-wrap: break-word; overflow-wrap: anywhere; }
.bsp-table td.bsp-num { color: var(--am-muted); font-size: 1rem; }
.bsp-table .bsp-marks { margin: 0; }

/* Lessons */
.bsp-days { margin: 0; padding: 0; list-style: none; }
.bsp-day { padding: 14px 0; border-top: 1px solid var(--am-line); }
.bsp-day:first-child { border-top: 0; padding-top: 2px; }
.bsp-day__date { color: var(--am-ink); font-weight: 700; }
.bsp-day__date small { color: var(--am-muted); font-weight: 400; font-size: 1rem; }
.bsp-day__nr { margin-top: 10px; color: var(--am-muted); font-size: 1rem; font-weight: 700; }
.bsp-day__text { margin-top: 4px; color: var(--am-ink); line-height: 1.5; overflow-wrap: break-word; overflow-wrap: anywhere; }
.bsp-day--entry .bsp-day__date { color: var(--am-muted); font-size: 1rem; }
.bsp-month { padding: 18px 0 6px; border-top: 1px solid var(--am-line); color: var(--am-muted); font-size: 1rem; font-weight: 700; }
.bsp-month + .bsp-day { border-top: 0; padding-top: 4px; }
.bsp-section__note { margin: -2px 0 12px; color: var(--am-muted); font-size: 1rem; }

/* Links typed by the teacher (wordwall etc.): open in a new tab, long addresses wrap */
.bsp-link { padding: 6px 0; color: var(--am-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: break-word; overflow-wrap: anywhere; }
.bsp-link__icon { width: .8em; height: .8em; margin-left: 3px; vertical-align: -1px; }
.bsp-link:hover { color: var(--am-red-text); }
.bsp-muted { color: var(--am-muted); font-weight: 400; }

/* Attendance */
/* sums as label-number rows: "usprawiedliwione" never has to fit a narrow box (D044) */
.bsp-sum { max-width: 28rem; margin: 0 0 14px; padding: 2px 14px; border-radius: 12px; background: var(--am-navy-tint); }
.bsp-sum div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px solid var(--am-navy-line); }
.bsp-sum div:first-child { border-top: 0; }
.bsp-sum dt { color: var(--am-text); }
.bsp-sum dd { margin: 0; color: var(--am-navy-ink); font-size: 1.375rem; font-weight: 800; }
.bsp-rows { margin: 0; padding: 0; list-style: none; }
/* a day: the date, then its tags; on a narrow phone the tags go under the date */
.bsp-rows li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; padding: 12px 0; border-top: 1px solid var(--am-line); }
.bsp-rows li:first-child { border-top: 0; }
.bsp-rows__date { color: var(--am-ink); font-weight: 700; font-variant-numeric: tabular-nums lining-nums; }
.bsp-rows__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.bsp-more > .bsp-rows { padding-bottom: 6px; }
.bsp-tag { padding: 2px 10px; border-radius: 999px; font-size: 1rem; font-weight: 700; white-space: nowrap; }
.bsp-tag--ok { background: var(--am-ok-tint); color: var(--am-ok); }
.bsp-tag--warn { background: var(--am-red-tint); color: var(--am-red-text); }
.bsp-tag--late { background: #fff4dc; color: #7a4b00; }

/* Announcements */
.bsp-ann { border-top: 1px solid var(--am-line); }
.bsp-ann:first-child { border-top: 0; }
.bsp-ann > summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0;
  cursor: pointer; list-style: none; color: var(--am-ink); font-weight: 700; font-size: 1.125rem;
}
.bsp-ann > summary::-webkit-details-marker { display: none; }
.bsp-ann > summary small { display: block; color: var(--am-muted); font-weight: 400; font-size: 1rem; }
.bsp-ann > summary svg { flex-shrink: 0; width: 20px; height: 20px; color: var(--am-navy); transition: transform .15s ease-out; }
.bsp-ann[open] > summary svg { transform: rotate(180deg); }
.bsp-ann__body { padding: 0 0 16px; }
.bsp-ann__body, .bsp-ann__body * { font-size: 1.125rem !important; font-family: inherit !important; line-height: 1.55 !important; color: inherit !important; }
.bsp-ann__body p { margin: 0 0 10px; }
/* text from the panel's editor: no justified or indented text, images and tables within the card, long words wrap */
.bsp-ann__body { overflow-wrap: break-word; overflow-wrap: anywhere; }
.bsp-ann__body * { text-align: left !important; text-indent: 0 !important; }
.bsp-ann__body img { max-width: 100%; height: auto; }
.bsp-ann__body table { width: auto !important; max-width: 100%; }
.bsp-ann__by { margin-top: 6px; color: var(--am-muted); font-size: 1rem; font-style: italic; }

/* Timetable */
.bsp-plan { margin: 0; padding: 0; list-style: none; }
.bsp-plan > li { padding: 12px 0; border-top: 1px solid var(--am-line); }
.bsp-plan > li:first-child { border-top: 0; padding-top: 2px; }
.bsp-plan b { display: block; color: var(--am-ink); }
/* a day: its name, then its lesson hours as small tags that wrap evenly (no separator left at a line end) */
.bsp-plan__hours { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.bsp-plan__hours li { padding: 2px 10px; border-radius: 10px; background: var(--am-navy-tint); color: var(--am-navy-ink); font-variant-numeric: tabular-nums lining-nums; }
@media (min-width: 560px) {
  .bsp-plan > li { display: grid; grid-template-columns: 10rem 1fr; gap: 12px; align-items: start; }
  .bsp-plan__hours { margin-top: 0; }
}

.bsp-empty { padding: 18px 16px; border-radius: 12px; background: #f4f5f7; color: var(--am-text); }
.bsp-empty b { color: var(--am-ink); }

/* Footer */
.bsp-foot { max-width: 1120px; margin: 0 auto; padding: 8px var(--am-gutter) 32px; padding-bottom: max(32px, env(safe-area-inset-bottom)); color: var(--am-muted); font-size: 1rem; }
.bsp-foot p + p { margin-top: 6px; }
.bsp-foot small { font-size: 1rem; }

/* ---------- Login ---------- */
.bsp-login { max-width: 480px; }
.bsp-login h1 { font-size: 1.75rem; }
.bsp-field { margin-top: 18px; }
.bsp-field label { display: block; color: var(--am-ink); font-weight: 700; }
.bsp-field input {
  display: block; width: 100%; min-height: 52px; margin-top: 6px; padding: 10px 14px;
  border: 1px solid #b8c0cf; border-radius: var(--am-radius); background: #fff; color: var(--am-ink);
  font: 400 1.25rem/1.3 var(--am-font);
}
.bsp-field input:focus { border-color: var(--am-navy); outline: 3px solid #c9d6f3; outline-offset: 0; }
.bsp-field input::placeholder { color: #a9b1c1; opacity: 1; }
/* PIN: 5 digits (D049, D051: maxlength 5), five faint slots, each typed character (a dot, or a digit after "Pokaz",
   D073) above its own, the field just as wide. A monospace font makes every character 1ch wide; a slot is 1ch plus the
   letter spacing, drawn as a line. The "Pokaz / Ukryj" button stands to the right (shown by the page's script). */
.bsp-pin { display: flex; align-items: stretch; gap: 10px; margin-top: 6px; }
.bsp-field .bsp-pin input { margin-top: 0; }
.bsp-pin__show {
  flex: none; min-width: 5.5rem; min-height: 52px; padding: 0 16px; border: 1px solid #b8c0cf; border-radius: var(--am-radius);
  background: #fff; color: var(--am-navy); cursor: pointer; font: 700 1rem/1 var(--am-font);
}
.bsp-pin__show:hover { border-color: var(--am-navy); }
.bsp-pin__show:focus-visible { border-color: var(--am-navy); outline: 3px solid #c9d6f3; outline-offset: 0; }
#bsp-pin {
  flex: none; width: calc(5 * 1.9ch + 30px); max-width: 100%; padding-left: 14px; padding-right: 14px;
  font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, "Roboto Mono", "Courier New", monospace; font-size: 1.5rem; letter-spacing: .9ch;
  background-image: repeating-linear-gradient(to right, #a9b1c1 0, #a9b1c1 1ch, transparent 1ch, transparent 1.9ch);
  background-size: calc(4 * 1.9ch + 1ch) 2px; background-repeat: no-repeat; background-origin: content-box;
  background-position: 0 calc(100% - 1px);
}
.bsp-field__hint { margin-top: 6px; color: var(--am-muted); font-size: 1rem; }
.bsp-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; margin-top: 22px;
  border: 0; border-radius: var(--am-radius); background: var(--am-navy); color: #fff; cursor: pointer;
  font: 700 1.125rem/1 var(--am-font); letter-spacing: .04em; text-transform: uppercase;
  transition: background .12s ease-out, transform .12s ease-out;
}
.bsp-btn:hover { background: var(--am-navy-deep); }
.bsp-btn:active { transform: scale(.985); }
.bsp-help { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--am-line); font-size: 1rem; }
.bsp-help a { font-weight: 700; white-space: nowrap; }
.bsp-alert { margin-bottom: 16px; padding: 14px 16px; border-radius: 12px; background: var(--am-red-tint); color: #5c0a10; }
.bsp-alert b { display: block; color: var(--am-red-text); font-size: 1.125rem; }
.bsp-welcome { margin-top: 16px; }
.bsp-welcome__body, .bsp-welcome__body * { font-size: 1.125rem !important; font-family: inherit !important; color: inherit !important; }
.bsp-welcome__body p { margin: 0 0 10px; }
.bsp-welcome__body * { line-height: 1.55 !important; background: transparent !important; text-indent: 0 !important; text-align: left !important; }
.bsp-welcome__body table { width: auto !important; max-width: 100%; }
.bsp-welcome__body img { max-width: 100%; height: auto; }
.bsp-welcome__body p:last-child { margin-bottom: 0; }
.bsp-welcome__heading { color: var(--am-ink); }
.bsp-check h2 { font-size: 1.3125rem; }
.bsp-check__list { margin: 10px 0 0; padding-left: 20px; }
.bsp-check__list li { margin-top: 8px; padding-left: 2px; }
.bsp-check__list li::marker { color: var(--am-navy); }
.bsp-check__call { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--am-line); }
.bsp-check__call a { font-weight: 700; white-space: nowrap; }

/* ---------- Labels, back-to-top, grading scale, footer ---------- */
.bsp-totop {
  position: fixed; right: 16px; bottom: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 10;
  display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 18px; border-radius: 999px;
  background: var(--am-navy); color: #fff; font-weight: 700; font-size: 1rem; text-decoration: none; box-shadow: var(--am-shadow-lift);
  transition: opacity .2s ease-out, transform .2s ease-out;
}
.bsp-totop:hover { color: #fff; background: var(--am-navy-deep); }
.bsp-totop svg { width: 18px; height: 18px; }
.bsp-totop.is-hidden { opacity: 0; transform: translateY(12px); pointer-events: none; }
/* the two scale tables side by side only where each has room ("niedostateczny (1, 2)" on one line), else stacked */
.bsp-scale { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 12px 24px; align-items: start; margin: 8px 0 10px; }
.bsp-scale table { width: 100%; border-collapse: collapse; color: var(--am-text); font-size: 1rem; }
.bsp-scale caption { text-align: left; color: var(--am-ink); font-weight: 700; padding-bottom: 4px; }
.bsp-scale td { padding: 5px 0; border-top: 1px solid var(--am-line); }
.bsp-scale td + td { text-align: right; white-space: nowrap; }
.bsp-foot { border-top: 1px solid var(--am-line); margin-top: 24px; padding-top: 20px; }
.bsp-foot__grid { display: grid; gap: 14px; }
.bsp-foot__title { color: var(--am-ink); font-weight: 700; font-size: 1rem; }
.bsp-foot__tel { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--am-navy); font-size: 1.3125rem; font-weight: 800; text-decoration: none; }
.bsp-foot__tel svg { width: 20px; height: 20px; }
/* the two links in one row below 900px (owner, 2026-10-15): almamater.pl left, the feedback link right; with "Na gore"
   (bsp-foot--totop: it floats bottom right) the feedback link left, almamater.pl in the middle, the right end free */
.bsp-foot__links { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; }
.bsp-foot__links a { white-space: nowrap; }
.bsp-foot .bsp-foot__links p + p { margin-top: 0; }
.bsp-foot--totop .bsp-foot__links { display: grid; grid-template-columns: 1fr auto 1fr; }
@media (min-width: 900px) {
  .bsp-foot__grid { grid-template-columns: repeat(3, auto); justify-content: space-between; align-items: start; }
  .bsp-foot__links, .bsp-foot--totop .bsp-foot__links { display: block; }
  .bsp-foot .bsp-foot__links p + p { margin-top: 6px; }
}

/* ---------- Wider screens ---------- */
@media (min-width: 560px) {
  .bsp-nav ul { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  :root { --am-gutter: 28px; }
  .bsp-topbar .bsp-logo { height: 66px; }
  .bsp-who__name { font-size: 2.25rem; }
  /* the left column scrolls with the page: pinned, it is taller than a laptop screen and hid "Przejdz do" (stage 5.4) */
  .bsp-layout { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
  .bsp-nav ul { grid-template-columns: 1fr 1fr; }
  .bsp-main { padding-top: 52px; }
  .bsp-main .bsp-section:first-child { margin-top: 0; }
  .bsp-section__head h2 { font-size: 1.75rem; }
  .bsp-login-wrap { display: grid; grid-template-columns: 480px 1fr; gap: 24px; align-items: start; }
  .bsp-welcome { margin-top: 0; }
}
/* the marks table only where the main column has room for it (about 640 px); narrower: the phone list */
@media (min-width: 1100px) {
  .bsp-cats--phone { display: none; }
  .bsp-table { display: table; }
}

/* ---------- Pages without a new view, in a plain card (PLAN.md 4.2) ----------
   All gradebook pages have their own views (steps 4.4-4.7); what remains are the stock Joomla pages reachable by
   address only (Start, Joomla login, search, the "no access" text). Their fixed-width tables and images stay
   usable in a white card that scrolls sideways by itself, so the page never does. */
.bsp-legacy { max-width: 1120px; margin: 16px auto 32px; padding: 0 var(--am-gutter); }
.bsp-legacy__card {
  background: var(--am-card); border-radius: var(--am-radius-card); box-shadow: var(--am-shadow);
  padding: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.bsp-legacy__card table { border-collapse: collapse; }
.bsp-legacy__card img { max-width: none; }
.bsp-legacy__card .componentheading { margin-bottom: 12px; color: var(--am-ink); font-size: 1.375rem; font-weight: 700; }
.bsp-legacy__card input[type="text"], .bsp-legacy__card input[type="password"] { font-size: 1.125rem; }
.bsp-modules { max-width: 1120px; margin: 0 auto 16px; padding: 0 var(--am-gutter); }
