/* The one house: header and tabs shared by every student page (student-shell.js).
   One row on wide screens; on phones the tabs move to a fixed bar at the bottom. */
/* The shell host must not be a stacking context: `.program-card > *` gives every card child
   `position: relative; z-index: 1`, which would trap the fixed tab bar under the map. */
#studentShell { position: static; z-index: auto; }

.student-shell-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  margin: 0 0 18px;
  padding: 8px 18px;
  border: 1px solid var(--student-line, #dce4ef);
  border-radius: 20px;
  background: white;
  box-shadow: var(--student-shadow, 0 6px 22px rgb(16 39 84 / 6%));
}

.student-shell-brand {
  flex: 0 0 auto;
  display: block;
  width: 112px;
}

.student-shell-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.student-shell-back {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--student-line, #dce4ef);
  border-radius: 14px;
  color: var(--student-ink, #102754);
  font-weight: 800;
  text-decoration: none;
}

.student-shell-tabs {
  display: flex;
  gap: 6px;
  margin-inline: auto;
}

.student-shell-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px 0 8px;
  border-radius: 14px;
  color: #46556f;
  font-weight: 800;
  text-decoration: none;
}

.student-shell-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--student-ink, #102754);
  background: var(--student-page, #f7f9fc);
}

.student-shell-icon svg { width: 20px; height: 20px; }
.student-shell-icon[data-tone="map"] { background: var(--student-soft, #e4faff); }
.student-shell-icon[data-tone="backpack"] { background: #ece6ff; }
.student-shell-icon[data-tone="progress"] { background: #fff3c4; }
.student-shell-icon[data-tone="payments"] { background: #e9f6ef; }
.student-shell-tab:hover { background: var(--student-page, #f7f9fc); color: var(--student-ink, #102754); }
.student-shell-tab.is-active { background: var(--student-soft, #e4faff); color: var(--student-ink, #102754); font-weight: 900; }
.student-shell-tab.is-active .student-shell-icon[data-tone="map"] { background: #55dfff; }
.student-shell-tab.is-active .student-shell-icon[data-tone="backpack"] { background: #c9b8ff; }
.student-shell-tab.is-active .student-shell-icon[data-tone="progress"] { background: #ffdb4d; }
.student-shell-tab.is-active .student-shell-icon[data-tone="payments"] { background: #9fd8b6; }

.student-shell-user {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.student-shell-join {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--student-ink, #102754);
  color: white;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}

.student-shell-join svg { flex: 0 0 auto; width: 20px; height: 20px; }
.student-shell-join:hover { background: #1b3a78; }
.student-shell-join-short { display: none; }

.student-shell-progress {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--student-soft, #e4faff);
  color: var(--student-ink, #102754);
  font-size: .9rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.student-shell-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid white;
  background: var(--student-primary, #ffdb4d);
  color: var(--student-ink, #102754);
  box-shadow: 0 2px 0 rgb(16 39 84 / 15%);
  font-weight: 900;
  overflow: hidden;
  text-decoration: none;
}

.student-shell-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Tablets: everything sits a little closer, the class button keeps one short word (only its
   icon under 820px), and the logo gives way before a tab wraps. */
@media (min-width: 761px) and (max-width: 999px) {
  .student-shell-bar { gap: 10px; }
  .student-shell-brand { flex: 0 1 112px; width: auto; min-width: 60px; }
  .student-shell-tabs { gap: 4px; }
  .student-shell-tab { padding: 0 10px 0 6px; white-space: nowrap; }
  .student-shell-join { gap: 6px; padding: 0 12px; }
  .student-shell-join-long { display: none; }
  .student-shell-join-short { display: inline; }
}

@media (min-width: 761px) and (max-width: 819px) {
  .student-shell-join-short { display: none; }
}

@media (max-width: 760px) {
  .student-shell-bar { gap: 10px; min-height: 64px; padding: 8px 12px; margin-bottom: 14px; }
  /* The logo gives way first, so the class button keeps its word on a 360px phone. */
  .student-shell-brand { flex: 0 1 92px; width: auto; min-width: 56px; }
  .student-shell-user { margin-left: auto; }
  .student-shell-avatar { width: 44px; height: 44px; }
  .student-shell-join { gap: 6px; padding: 0 12px; }
  .student-shell-join-long { display: none; }
  .student-shell-join-short { display: inline; }
  @media (max-width: 359px) { .student-shell-join-short { display: none; } }

  .student-shell-tabs {
    position: fixed;
    z-index: 60;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    /* Three tabs, or four once Płatności joins them. */
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 4px;
    margin: 0;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    background: white;
    border-top: 1px solid var(--student-line, #dce4ef);
    box-shadow: 0 -6px 22px rgb(16 39 84 / 8%);
  }

  .student-shell-tab {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 60px;
    padding: 5px 2px;
    border-radius: 12px;
    font-size: .8rem;
  }

  .student-shell-icon { width: 34px; height: 34px; }
  .student-shell-icon svg { width: 21px; height: 21px; }

  /* Room for the bottom bar. While a film or a game is open, the bar steps aside. */
  body.has-student-shell { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  body.is-playing .student-shell-tabs { display: none; }
}

/* Home: the greeting, the next activity and the map (programs.html). The strip of
   island artwork that used to sit behind the greeting showed too little of it to mean anything. */
.home-greeting {
  margin: 0 0 14px;
  /* Clear of the page card's rounded corner, which would cut the first letter. */
  padding: 6px 8px 0;
  color: var(--student-ink, #102754);
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.home-aside { display: grid; gap: 14px; min-width: 0; }
.home-aside .new-from-class { margin: 0; }

.home-next {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 2px solid var(--student-primary, #ffdb4d);
  border-radius: 20px;
  background: white;
  box-shadow: var(--student-shadow, 0 6px 22px rgb(16 39 84 / 6%));
}

.home-next .eyebrow { margin: 0; font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: #5b3fd1; }
.home-next h2 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.6rem); line-height: 1.15; overflow-wrap: anywhere; }
.home-next p { margin: 0; color: var(--student-muted, #647087); font-weight: 700; font-size: .92rem; }
.home-next-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.home-next-chips span { padding: 4px 9px; border-radius: 999px; background: var(--student-soft, #e4faff); font-size: .74rem; font-weight: 900; }
.home-next-chips span[data-done] { background: var(--student-success-soft, #e9f6ef); color: var(--student-success, #176342); }
.home-next-chips span[data-game] { background: #e9f6ef; color: #176342; }

.home-next-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  margin-top: 4px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: var(--student-primary, #ffdb4d);
  color: var(--student-ink, #102754);
  box-shadow: 0 3px 0 rgb(16 39 84 / 12%);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.home-next-empty { padding: 16px 18px; border: 1px dashed #b9c6d8; border-radius: 20px; color: var(--student-muted, #647087); font-weight: 700; }

/* The student's classes (student-classes.js): the next one and the way in, then the list. */
.home-classes {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 2px solid #55dfff;
  border-radius: 20px;
  background: white;
  box-shadow: var(--student-shadow, 0 6px 22px rgb(16 39 84 / 6%));
}

.home-classes .eyebrow { margin: 0; font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--student-muted, #647087); }
.home-classes h2 { margin: 0; font-size: clamp(1.2rem, 2.2vw, 1.45rem); line-height: 1.2; font-variant-numeric: tabular-nums; }
.home-classes p { margin: 0; color: var(--student-muted, #647087); font-weight: 700; font-size: .92rem; }

.home-classes-join {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 6px;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--student-ink, #102754);
  color: white;
  font-weight: 900;
  text-decoration: none;
}

.home-classes-join:hover { background: #1b3a78; }
.home-classes-more { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--student-line, #dce4ef); }
.home-classes-more summary { display: flex; align-items: baseline; gap: 8px; min-height: 32px; cursor: pointer; font-weight: 900; font-size: .86rem; }
.home-classes-more summary small { color: var(--student-muted, #647087); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-classes-more[open] summary small { display: none; }
.home-classes-more summary { list-style: none; }
.home-classes-more summary::-webkit-details-marker { display: none; }
.home-classes-more summary::after { content: ""; flex: 0 0 auto; align-self: center; width: 8px; height: 8px; margin: 0 4px 4px auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.home-classes-more[open] summary::after { margin-bottom: -4px; transform: rotate(-135deg); }
.home-classes-more ul { display: grid; margin: 4px 0 0; padding: 0; list-style: none; }
.home-classes-more li { display: flex; align-items: center; gap: 10px; min-height: 36px; border-top: 1px solid #eef2f8; font-weight: 700; font-variant-numeric: tabular-nums; }
.home-classes-more li:first-child { border-top: 0; }
.home-classes-day { flex: 0 0 6.2em; font-weight: 900; }
.home-classes-more li.is-off span { color: #8a94a8; text-decoration: line-through; }
.home-classes-more em { margin-left: auto; padding: 2px 9px; border-radius: 999px; font-style: normal; font-size: .76rem; font-weight: 900; white-space: nowrap; }
.home-classes-more em[data-note="off"] { background: #fdecec; color: #8a1f1f; }
.home-classes-more em[data-note="tag"] { background: var(--student-soft, #e4faff); color: var(--student-ink, #102754); }

.home-progress { display: grid; gap: 8px; padding: 14px 18px; border: 1px solid var(--student-line, #dce4ef); border-radius: 20px; background: white; }
.home-progress .eyebrow { margin: 0; font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--student-muted, #647087); }
.home-progress strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.home-progress-bar { height: 10px; border-radius: 999px; background: #e9f2ff; overflow: hidden; }
.home-progress-bar span { display: block; height: 100%; background: var(--student-success, #176342); }
.home-progress small { color: var(--student-muted, #647087); font-weight: 700; }

/* New stops carry the same yellow as everything new. */
.adventure-stop.is-assigned .adventure-stop-card { border: 2px solid var(--student-primary, #ffdb4d); background: #fffdf3; }
.adventure-stop.is-assigned .adventure-stop-status { background: #fff0bd; color: #7a4f00; }

@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; gap: 14px; }
  .home-greeting { margin-bottom: 12px; }
  .home-progress { display: none; }
}

/* The stop as a sheet: on phones it rises from the bottom over the map; on wide screens it
   stays a centred card. What is done shows a tick, what comes next a yellow edge. */
.adventure-sheet-handle { display: none; }

.adventure-resource-heading { position: relative; }
.adventure-resource-progress {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--student-success-soft, #e9f6ef);
  color: var(--student-success, #176342);
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}

body .adventure-action { position: relative; }
/* The badge is now the last child; the text column keeps its two lines. */
body .adventure-action > span:nth-of-type(2), body .adventure-resource-heading > span:nth-of-type(2) { display: grid; }
body .adventure-action.is-next { border: 2px solid var(--student-primary, #ffdb4d); background: #fffdf3; }
body .adventure-action.is-next > span:first-child { background: var(--student-primary, #ffdb4d); }
body .adventure-action.is-done { background: var(--student-page, #f7f9fc); }
body .adventure-action.is-done > span:first-child { background: var(--student-success-soft, #e9f6ef); color: var(--student-success, #176342); }
body .adventure-action.is-done strong { color: var(--student-muted, #647087); }
.adventure-action-next {
  position: absolute;
  top: -10px;
  right: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--student-primary, #ffdb4d);
  color: var(--student-ink, #102754);
  font-size: .68rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

body .adventure-dialog-navigation { grid-template-columns: 1fr auto 1fr; }
body .adventure-dialog-navigation button:first-child { justify-self: stretch; }
body .adventure-dialog-navigation button:first-child,
body .adventure-dialog-navigation button:last-child { color: #5b3fd1; background: #f3f0ff; border-color: #e3dcff; }
body .adventure-dialog-navigation button:nth-child(2) { min-width: 120px; }

@media (max-width: 760px) {
  body .adventure-dialog {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 24px);
    margin: 0;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -12px 40px rgb(16 39 84 / 18%);
  }
  body .adventure-dialog-card { min-height: 0; }
  .adventure-sheet-handle {
    position: absolute;
    z-index: 2;
    top: 8px;
    left: 50%;
    display: block;
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: rgb(255 255 255 / 85%);
    transform: translateX(-50%);
  }
  body .adventure-dialog-landscape { height: 76px; min-height: 76px; }
  body .adventure-dialog-theme-icon { width: 52px; height: 52px; font-size: 1.3rem; border-width: 4px; border-radius: 16px; }
  body .adventure-dialog-content { padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px)); gap: 12px; }
  body .adventure-dialog h2 { font-size: clamp(1.5rem, 7vw, 1.9rem); }
  body .adventure-dialog-navigation { grid-template-columns: 1fr auto 1fr; }
  body .adventure-dialog-navigation button:first-child,
  body .adventure-dialog-navigation button:nth-child(2),
  body .adventure-dialog-navigation button:last-child { grid-row: auto; grid-column: auto; }
  body .adventure-dialog-navigation button:nth-child(2) { min-width: 0; }
  body .adventure-dialog-navigation button { padding-inline: 10px; font-size: .92rem; }
}

/* The player page: the stop you came from, its film and games, what to do next. */
.stage-header {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 18px 20px;
  border: 1px solid var(--student-line, #dce4ef);
  border-radius: 20px;
  background: white;
  box-shadow: var(--student-shadow, 0 6px 22px rgb(16 39 84 / 6%));
}
.stage-header .eyebrow { margin: 0; font-size: .74rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: #5b3fd1; }
.stage-header h1 { margin: 0; font-size: clamp(1.5rem, 3.4vw, 2.1rem); line-height: 1.12; overflow-wrap: anywhere; }
.stage-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; margin-top: 6px; }
.stage-action {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--student-line, #dce4ef);
  border-radius: 16px;
  background: white;
  color: var(--student-ink, #102754);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.stage-action > span:first-child { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--student-soft, #e4faff); font-size: 1rem; font-weight: 900; }
.stage-action > span:nth-of-type(2) { display: grid; gap: 1px; min-width: 0; }
.stage-action small { font-size: .74rem; font-weight: 800; color: var(--student-muted, #647087); }
.stage-action strong { font-size: 1rem; font-weight: 800; }
.stage-action:hover { border-color: #245bb1; }
.stage-action.is-next { border: 2px solid var(--student-primary, #ffdb4d); background: #fffdf3; }
.stage-action.is-next > span:first-child { background: var(--student-primary, #ffdb4d); }
.stage-action.is-done { background: var(--student-page, #f7f9fc); }
.stage-action.is-done > span:first-child { background: var(--student-success-soft, #e9f6ef); color: var(--student-success, #176342); }
.stage-action.is-done strong { color: var(--student-muted, #647087); }
.stage-action-next {
  position: absolute; top: -10px; right: 12px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--student-primary, #ffdb4d); color: var(--student-ink, #102754);
  font-size: .66rem; font-style: normal; font-weight: 900; letter-spacing: .04em; text-transform: uppercase;
}
.stage-progress { margin: 2px 0 0; color: var(--student-success, #176342); font-size: .88rem; font-weight: 800; }
body .assignments-panel { margin-top: 24px; }

/* Practice pages (book, Teens): the same house around the shared practice renderer. */
body.practice-page { background: var(--student-page, #f7f9fc); color: var(--student-ink, #102754); font-family: Nunito, "Segoe UI", system-ui, sans-serif; }
body.practice-page #studentShell { width: min(1200px, 100%); margin: 0 auto; padding: 20px 24px 0; box-sizing: border-box; }
body.practice-page .practice-main { max-width: 1152px; padding: 0 24px 48px; }
body.practice-page .ts-canvas, body.practice-page .tp-sheet { font-family: inherit; color: var(--student-ink, #102754); background: white; border: 1px solid var(--student-line, #dce4ef); border-radius: 20px; box-shadow: var(--student-shadow, 0 6px 22px rgb(16 39 84 / 6%)); }
body.practice-page .ts-canvas h1, body.practice-page .ts-canvas h2, body.practice-page .ts-canvas h3 { color: var(--student-ink, #102754); font-weight: 800; }
body.practice-page .ts-eyebrow { color: var(--student-muted, #647087); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; font-size: .76rem; }
body.practice-page #practice-status { margin: 0 0 12px; padding: 0 4px; background: transparent; color: var(--student-muted, #647087); font-size: .9rem; font-weight: 800; line-height: 1.5; }
body.practice-page #practice-status:empty { display: none; }
body.practice-page #practice-error { background: #fff0bd; color: #7a4f00; border: 1px solid #f1d98a; border-radius: 16px; }
body.practice-page #practice-feedback { border: 1px solid var(--student-line, #dce4ef); border-left: 5px solid var(--student-success, #176342); border-radius: 16px; }
body.practice-page .tp-student-actions { margin-top: 16px; padding: 16px 18px; border: 1px solid var(--student-line, #dce4ef); border-top-width: 1px; border-radius: 20px; background: white; }
body.practice-page .tp-student-actions button { min-height: 48px; padding: 0 18px; border-radius: 14px; font: inherit; font-weight: 900; font-size: 1rem; color: var(--student-ink, #102754); background: white; border: 1px solid var(--student-line, #dce4ef); }
body.practice-page #practice-submit { background: var(--student-primary, #ffdb4d); border-color: transparent; box-shadow: 0 3px 0 rgb(16 39 84 / 12%); }
body.practice-page .tp-student-actions p { margin: 0; color: var(--student-muted, #647087); font-weight: 700; }
body.practice-page .ti-actions button, body.practice-page .ti-mobile-nav button, body.practice-page .ti-mobile-tools > button { font: inherit; font-weight: 800; border-radius: 14px; border: 1px solid var(--student-line, #dce4ef); background: white; color: var(--student-ink, #102754); }
body.practice-page .ti-actions button:first-child, body.practice-page .ti-mobile-nav button:last-child, body.practice-page .ti-mobile-tools > button:first-child { background: var(--student-primary, #ffdb4d); color: var(--student-ink, #102754); border-color: transparent; box-shadow: 0 3px 0 rgb(16 39 84 / 12%); }
body.practice-page .ti-actions button:first-child .ti-pl, body.practice-page .ti-mobile-nav button:last-child .ti-pl { color: #5a4a10; }
body.practice-page .ti-tile { border-color: var(--student-line, #dce4ef); border-radius: 14px; box-shadow: none; font: inherit; }
body.practice-page .ti-tile:hover, body.practice-page .ti-slot:hover { border-color: #245bb1; background: var(--student-soft, #e4faff); }
body.practice-page .ti-tile[aria-pressed=true] { background: var(--student-soft, #e4faff); border-color: #55dfff; box-shadow: none; }
body.practice-page .ti-tile[aria-pressed=true]:before { color: #1d57ad; }
body.practice-page .tp-block h2 { font-size: 1.35rem; }
body.practice-page .ts-help { border: 1px solid var(--student-line, #dce4ef); border-radius: 14px; background: var(--student-page, #f7f9fc); }
body.practice-page .ts-help > summary { color: var(--student-ink, #102754); font-weight: 800; }

.practice-skeleton { display: grid; gap: 12px; padding: 20px; border: 1px solid var(--student-line, #dce4ef); border-radius: 20px; background: white; margin: 0 0 12px; }
.practice-skeleton span { display: block; height: 18px; border-radius: 999px; background: linear-gradient(90deg, #eef2f8 0%, #f7f9fc 50%, #eef2f8 100%); background-size: 200% 100%; animation: practice-shimmer 1.2s linear infinite; }
.practice-skeleton span:nth-child(1) { width: 40%; height: 28px; }
.practice-skeleton span:nth-child(2) { width: 90%; }
.practice-skeleton span:nth-child(3) { width: 75%; }
.practice-skeleton span:nth-child(4) { width: 55%; height: 48px; border-radius: 14px; }
@keyframes practice-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .practice-skeleton span { animation: none; } }

.practice-done { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 16px; padding: 0 18px; border-radius: 14px; background: var(--student-primary, #ffdb4d); color: var(--student-ink, #102754); font-weight: 900; text-decoration: none; box-shadow: 0 3px 0 rgb(16 39 84 / 12%); }

@media (max-width: 760px) {
  body.practice-page #studentShell { padding: 12px 12px 0; }
  body.practice-page .practice-main { padding: 0 12px 32px; }
}

/* Cancel or change a class (student-class-changes.js), under the classes card. */
.class-changes ul { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.class-changes li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.class-change-choices { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.class-change-choices .class-change-button { margin-left: 0; }
.class-change-button { min-height: 40px; margin-left: auto; padding: 0 14px; border: 2px solid var(--student-line, #dce4ef); border-radius: 12px; background: white; color: var(--student-ink, #102754); font: inherit; font-weight: 900; cursor: pointer; }
.class-change-confirm { display: grid; flex-basis: 100%; gap: 8px; }
.class-change-confirm label { display: grid; gap: 6px; font-weight: 800; }
.class-change-confirm textarea { padding: 10px; border: 2px solid var(--student-line, #dce4ef); border-radius: 12px; font: inherit; }
.class-change-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.class-change-hint { margin: 6px 0 0; }
/* What the family just did, above the fold: in sight without opening anything. */
.home-classes .class-change-notice, .class-change-notice { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--student-soft, #e4faff); color: var(--student-ink, #102754); font-weight: 800; font-size: .92rem; }
.class-change-error { color: #b42318 !important; }

/* The family's account (student-family.js): a payments button and a bell in the
   header, before the avatar, and their sheet (from the bottom on phones, a panel
   under the header on wider screens). Empty until the school switches it on. */
.student-shell-family { display: inline-flex; align-items: center; gap: 8px; }
.student-shell-family:empty { display: none; }
.family-wallet, .family-bell { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border-radius: 12px; font: inherit; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; }
.family-wallet { padding: 0 11px; border: 0; text-decoration: none; }
.family-wallet svg, .family-bell svg { flex: 0 0 auto; width: 20px; height: 20px; }
.family-wallet[data-tone="due"] { background: #fff0dc; color: #9a4b00; }
.family-wallet[data-tone="paid"] { background: #e9f6ef; color: #176342; }
.family-wallet[data-tone="wait"] { background: #eef2f8; color: #3c4a63; }
.family-bell { position: relative; width: 42px; padding: 0; border: 1px solid var(--student-line, #dce4ef); background: white; color: var(--student-ink, #102754); }
.family-bell b { position: absolute; top: -7px; right: -7px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #d93a3a; color: white; font-size: .72rem; }
.family-wallet:focus-visible, .family-bell:focus-visible, .family-close:focus-visible, .family-pay:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; }

.family-shade { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; background: rgb(16 39 84 / 38%); }
.family-shade[hidden] { display: none; }
.family-sheet { box-sizing: border-box; width: 100%; max-height: 85vh; overflow: auto; padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px)); border-radius: 26px 26px 0 0; background: white; color: var(--student-ink, #102754); font-family: inherit; box-shadow: 0 -10px 30px rgb(16 39 84 / 18%); }
.family-grab { display: block; width: 44px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: var(--student-line, #dce4ef); }
.family-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.family-sheet-head h2 { margin: 0; font-size: 1.3rem; font-weight: 900; }
.family-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--student-page, #f7f9fc); color: var(--student-ink, #102754); font: inherit; font-weight: 900; cursor: pointer; }
.family-sheet-sub { margin: 16px 0 6px; font-size: .78rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: var(--student-muted, #647087); }
.family-sheet-sub:first-of-type { margin-top: 4px; }
.family-sheet ul { display: grid; margin: 0; padding: 0; list-style: none; }
.family-empty { margin: 4px 0; color: var(--student-muted, #647087); font-weight: 700; }
.family-error { margin: 0 0 10px; color: #b42318; font-weight: 800; }
.family-line { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: .95rem; font-weight: 700; }
.family-line span:last-child { font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; }
.family-line.is-credit { color: #176342; }
.family-pay { display: block; width: 100%; min-height: 50px; margin: 0 0 14px; border: 0; border-radius: 14px; background: var(--student-primary, #ffdb4d); color: var(--student-ink, #102754); font: inherit; font-size: 1.08rem; font-weight: 900; cursor: pointer; }
.family-pay:disabled { opacity: .7; cursor: wait; }
.family-msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--student-line, #dce4ef); }
.family-msg:first-child { border-top: 0; }
.family-msg i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--student-soft, #e4faff); font-style: normal; font-weight: 900; }
.family-msg div { display: grid; gap: 2px; min-width: 0; }
.family-msg strong { font-size: .98rem; }
.family-msg.is-new strong::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: #d93a3a; vertical-align: 2px; }
.family-msg span { color: var(--student-muted, #647087); font-size: .92rem; font-weight: 700; overflow-wrap: anywhere; }
.family-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.family-req { display: grid; justify-items: start; gap: 4px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--student-line, #dce4ef); border-radius: 14px; }
.family-req strong { font-size: .95rem; }
.family-req span:not(.family-pill) { color: var(--student-muted, #647087); font-weight: 700; overflow-wrap: anywhere; }
.family-pill { padding: 2px 8px; border-radius: 8px; background: #fff0dc; color: #9a4b00; font-size: .75rem; font-weight: 900; }
.family-pill[data-tone="done"] { background: #e9f6ef; color: #176342; }

@media (min-width: 761px) {
  .family-shade { align-items: flex-start; justify-content: flex-end; padding: var(--family-top, 92px) 24px 24px; background: rgb(16 39 84 / 18%); }
  .family-sheet { width: min(420px, 100%); max-height: calc(100vh - var(--family-top, 92px) - 24px); padding: 16px 18px 20px; border-radius: 22px; box-shadow: 0 16px 40px rgb(16 39 84 / 22%); }
  .family-grab { display: none; }
}

/* Phones: the logo and the class button give way so the payments button and the bell fit. */
@media (max-width: 760px) {
  .student-shell-user { gap: 8px; }
  .student-shell-user:has(.student-shell-family:not(:empty)) .student-shell-progress { display: none; }
  .family-wallet { min-height: 40px; padding: 0 9px; }
  .family-wallet svg { display: none; }
}
@media (max-width: 420px) {
  .student-shell-user:has(.student-shell-family:not(:empty)) .student-shell-join-short { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .family-sheet { animation: family-up .22s ease-out; }
  @keyframes family-up { from { transform: translateY(30px); opacity: .6; } }
}

/* Płatności (platnosci.html): on top what there is to pay now, how the bill was
   worked out under it, what happened with the payments, and every invoice by year. */
.family-hero { display: grid; gap: 4px; margin-bottom: 12px; padding: 14px; border-radius: 16px; background: var(--student-page, #f7f9fc); }
.family-hero[data-tone="due"] { background: #fff0dc; }
.family-hero[data-tone="ok"] { background: #e9f6ef; }
.family-hero-caption { margin: 0; color: var(--student-muted, #647087); font-size: .92rem; font-weight: 800; }
.family-hero-amount { margin: 0 0 4px; font-size: 1.6rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.family-hero[data-tone="due"] .family-hero-amount { color: #9a4b00; }
.family-hero[data-tone="ok"] .family-hero-amount { color: #176342; font-size: 1.25rem; }
.family-hero-note { margin: 2px 0 0; color: var(--student-muted, #647087); font-size: .9rem; font-weight: 700; }
.family-hero[data-tone="due"] .family-hero-note { color: #9a4b00; }
.family-hero[data-tone="ok"] .family-hero-note { color: #176342; }
.family-hero[data-tone="credit"] { background: var(--student-soft, #e4faff); }
.family-hero[data-tone="credit"] .family-hero-amount { color: #176342; }
.family-hero .family-pay { margin: 4px 0 0; }
.family-invoice { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 4px; border: 2px solid #9fd8b6; border-radius: 14px; color: #176342; font-weight: 900; text-decoration: none; }
.family-line.is-total { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--student-line, #dce4ef); font-weight: 900; }
.family-classes li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 7px 0; border-top: 1px solid #eef2f8; font-size: .92rem; font-weight: 700; }
.family-classes li:first-child { border-top: 0; }
.family-class-when { font-weight: 900; font-variant-numeric: tabular-nums; }
.family-class-value { justify-self: end; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.family-class-state { justify-self: start; padding: 1px 8px; border-radius: 8px; font-style: normal; font-size: .76rem; font-weight: 900; background: #eef2f8; color: #3c4a63; }
.family-class-state[data-tone="paid"], .family-class-state[data-tone="free"] { background: #e9f6ef; color: #176342; }
.family-class-state[data-tone="due"] { background: #fff0dc; color: #9a4b00; }
.family-classes li small { grid-column: 1 / -1; color: var(--student-muted, #647087); font-weight: 700; }
.family-classes li[data-state="free"] .family-class-when { color: #8a94a8; text-decoration: line-through; }

/* The school's WhatsApp: in the bell, on the profile, and next to a change asked inside 24 hours. */
.family-whatsapp { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; margin: 0 0 12px; padding: 0 16px; border-radius: 14px; background: #167a45; color: white; font-weight: 900; text-decoration: none; }
.family-whatsapp:hover { background: #10603a; }
.family-whatsapp:focus-visible, .class-change-whatsapp a:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; }
.profile-contact { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--student-line, #dce4ef); }
.profile-contact p { margin: 0; color: var(--student-muted, #647087); font-weight: 700; }
.profile-contact .family-whatsapp { margin: 0; }
.class-change-whatsapp { margin: 0; font-weight: 800; }
.class-change-whatsapp a { color: #167a45; font-weight: 900; }
.family-invoices li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--student-line, #dce4ef); }
.family-invoices li:first-child { border-top: 0; }
.family-invoices li > span:first-child { display: grid; min-width: 0; }
.family-invoices strong { font-weight: 900; overflow-wrap: anywhere; }
.family-invoices small { color: var(--student-muted, #647087); font-weight: 700; }
.family-invoice-amount { font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.family-invoices a { grid-column: 1 / -1; color: #1d5fbf; font-weight: 900; }

/* The map's class card: only the next class; «Wszystkie lekcje» opens the rest in a sheet. */
.home-classes-all { justify-self: start; min-height: 40px; margin-top: 4px; padding: 0 2px; border: 0; background: none; color: #1d5fbf; font: inherit; font-size: .92rem; font-weight: 900; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.home-classes-all:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; border-radius: 6px; }
.home-classes-list { display: grid; margin: 0; padding: 0; list-style: none; }
.home-classes-list li { display: flex; align-items: center; gap: 10px; min-height: 40px; border-top: 1px solid #eef2f8; font-weight: 700; font-variant-numeric: tabular-nums; }
.home-classes-list li:first-child { border-top: 0; }
.home-classes-list li.is-off span { color: #8a94a8; text-decoration: line-through; }
.home-classes-list em { margin-left: auto; padding: 2px 9px; border-radius: 999px; font-style: normal; font-size: .76rem; font-weight: 900; white-space: nowrap; }
.home-classes-list em[data-note="off"] { background: #fdecec; color: #8a1f1f; }
.home-classes-list em[data-note="tag"] { background: var(--student-soft, #e4faff); color: var(--student-ink, #102754); }
/* «Wszystkie lekcje»: this month, then next month apart as a plan the family is not charged for yet. */
.home-classes-month + .home-classes-month { margin-top: 18px; padding-top: 14px; border-top: 2px dashed var(--student-line, #dce4ef); }
.home-classes-month .family-sheet-sub { margin-top: 4px; }
.home-classes-month.is-plan .family-sheet-sub { color: var(--student-ink, #102754); }
.home-classes-plan { margin: -2px 0 8px; color: var(--student-muted, #647087); font-size: .86rem; font-weight: 700; }

/* Płatności, the page: one column the width of a phone, like a bill. */
.payments-head, .payments-body, .payments-off { width: min(560px, 100%); margin-left: auto; margin-right: auto; }
.payments-head { display: grid; gap: 2px; margin: 4px 0 14px; padding: 0 2px; }
.payments-head .eyebrow { margin: 0; }
.payments-head h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 900; }
.payments-body { display: block; }
.payments-page .status-box[hidden] { display: none; }
.payments-body .family-hero { padding: 18px; border-radius: 20px; }
.payments-body .family-hero-amount { font-size: 2rem; }
.payments-body .family-sheet-sub { margin-top: 22px; }
.payments-body .family-msgs { padding: 0; margin: 0; list-style: none; }
.payments-off { margin: 8px 2px 0; padding: 14px 16px; border-radius: 16px; background: var(--student-page, #f7f9fc); color: var(--student-muted, #647087); font-weight: 700; }
/* Jak policzyliśmy: folded under the amount, a line per class and what each one brought. */
.family-detail { margin: -4px 0 12px; padding: 0 14px 12px; border: 1px solid var(--student-line, #dce4ef); border-radius: 16px; }
.family-detail summary { display: flex; align-items: baseline; gap: 8px; min-height: 48px; padding: 10px 0 4px; cursor: pointer; font-weight: 900; list-style: none; }
.family-detail summary::-webkit-details-marker { display: none; }
.family-detail summary small { flex: 1; color: var(--student-muted, #647087); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-detail summary::after { content: ""; flex: 0 0 auto; align-self: center; width: 8px; height: 8px; margin: 0 4px 4px 0; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.family-detail[open] summary::after { margin-bottom: -4px; transform: rotate(-135deg); }
.family-detail summary:focus-visible, .family-year summary:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; border-radius: 8px; }
/* Faktury: a year per fold, the one in course open, each invoice with its month, amount, day paid and page. */
.family-year { border-top: 1px solid var(--student-line, #dce4ef); }
.family-year:first-of-type { border-top: 0; }
.family-year summary { display: flex; align-items: baseline; gap: 10px; min-height: 52px; padding: 10px 2px; cursor: pointer; list-style: none; }
.family-year summary::-webkit-details-marker { display: none; }
.family-year summary strong { font-size: 1.15rem; font-weight: 900; }
.family-year summary small { flex: 1; color: var(--student-muted, #647087); font-weight: 700; }
.family-year summary::after { content: ""; flex: 0 0 auto; align-self: center; width: 9px; height: 9px; margin: 0 6px 4px 0; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.family-year[open] summary::after { margin-bottom: -4px; transform: rotate(-135deg); }
.family-year .family-invoices { margin: 0 0 8px; padding: 0 2px; list-style: none; }
.family-year .family-invoices li:first-child { border-top: 1px solid #eef2f8; }
.family-invoice-soon { grid-column: 1 / -1; color: var(--student-muted, #647087); font-weight: 700; }
/* The home's card, only while something is to pay: the amount, Zapłać, the way to Płatności. */
.home-payments { display: grid; gap: 6px; padding: 16px 18px; border: 2px solid #ffb86b; border-radius: 20px; background: #fff8ef; box-shadow: var(--student-shadow, 0 6px 22px rgb(16 39 84 / 6%)); }
.home-payments[data-tone="wait"] { border-color: var(--student-line, #dce4ef); background: white; }
.home-payments .eyebrow { margin: 0; font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: #9a4b00; }
.home-payments[data-tone="wait"] .eyebrow { color: var(--student-muted, #647087); }
.home-payments h2 { margin: 0; font-size: clamp(1.2rem, 2.2vw, 1.45rem); line-height: 1.2; font-variant-numeric: tabular-nums; }
.home-payments p { margin: 0; color: var(--student-muted, #647087); font-weight: 700; font-size: .92rem; }
.home-payments .family-pay { margin: 6px 0 0; }
.home-payments .family-error { margin: 0; }
.home-payments-note { color: #9a4b00; }
.home-payments-more { justify-self: start; min-height: 36px; display: inline-flex; align-items: center; color: #1d5fbf; font-size: .92rem; font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
.home-payments-more:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; border-radius: 6px; }

/* The regulamin's small card on the home (student-terms.js): one box, Akceptuję, ✕. */
#homeTerms:empty { display: none; }
.home-terms { position: relative; padding: 14px 44px 14px 16px; border: 1px solid var(--student-line, #dce4ef); border-radius: 18px; background: white; box-shadow: var(--student-shadow, 0 6px 22px rgb(16 39 84 / 6%)); }
.home-terms-form { display: grid; gap: 10px; margin: 0; }
.home-terms .terms-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-weight: 700; font-size: .95rem; line-height: 1.35; color: var(--student-ink, #17213a); cursor: pointer; }
.home-terms .terms-check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: #245bb1; cursor: pointer; }
.home-terms .terms-check a { color: #1d5fbf; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.home-terms-accept { justify-self: start; min-height: 38px; padding: 6px 18px; border: 0; border-radius: 12px; background: #ffd84d; color: #17213a; font: inherit; font-weight: 900; cursor: pointer; }
.home-terms-accept:disabled { opacity: .45; cursor: not-allowed; }
.home-terms-close { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 10px; background: none; color: var(--student-muted, #647087); font: inherit; font-weight: 900; cursor: pointer; }
.home-terms-close:hover, .home-terms-close:focus-visible { background: #f1f4fa; }
.home-terms-message { margin: 0; font-size: .88rem; font-weight: 800; color: #ae2c43; }
.home-terms-message:empty { display: none; }
.home-terms-message[data-state="success"] { color: var(--student-success, #1f7a4d); }
