/* rodzic.css — portal rodzica (rodzic.php); ładowany także w rodzic_login.php i zapisy.html (tam po nim public.css).
   Warstwa wizualna premium — 23.09.2026. Tokeny :root, body/typografia, przyciski, pola, powłoka modali, toasty,
   badge, pigułki .st-* — style.css; keyframes i animacje — motion.css. Tutaj: szkielet portalu, nagłówek, nawigacja dolna/górna,
   zakładki dzieci, kafelki, karty sesji, wiersze, ogłoszenia, płatności, czat, konto, wnętrza modali, skeleton. */

/* ===== szkielet strony ===== */
body.portal { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body.portal main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--container-portal);
  margin: 0 auto;
  padding: 16px var(--gutter) calc(72px + env(safe-area-inset-bottom, 0px));
}
body.portal .panel { padding: 16px; border-radius: var(--r-lg); margin-bottom: 16px; }
body.portal h2 {
  font-family: var(--font-sans);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: var(--track-snug);
  line-height: var(--lh-snug);
  color: var(--heading); /* nagłówki sekcji w ciemnej lawendzie — jak w panelu */
  margin-bottom: 12px;
}
/* ikona przed tytułem sekcji (wstawia markup) */
body.portal .panel > h2, body.portal .list-header h2 { display: flex; align-items: center; gap: 8px; }
body.portal .panel > h2 > .ico, body.portal .list-header h2 > .ico, body.portal .modal h2 > .ico { margin-right: 0; }
body.portal .list-header h2 { margin: 0; }
body.portal .list-header { margin-bottom: 12px; gap: 12px; }
body.portal h3 { font-family: var(--font-sans); font-size: var(--fs-base); font-weight: 600; letter-spacing: -0.006em; line-height: 1.35; color: var(--text); }
body.portal a { color: var(--lav-700); }
.small-text { font-size: var(--fs-sm); }
body.portal .signup-hint { font-size: var(--fs-sm); line-height: 1.5; color: var(--muted); }
#pay-hint { padding: 4px 2px 0; }
body.portal .st-pill { white-space: normal; }
/* numer konta / tytuł przelewu: mono, ale bez łamania w środku grupy cyfr */
body.portal .mono {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums lining-nums;
  word-break: normal;
  overflow-wrap: anywhere;
}

/* przykład tytułu w tekście (span) — bez mono; numer konta w <dd class="mono"> zostaje w mono */
body.portal span.mono { font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; }

/* przyciski .small w portalu — cel dotyku 40 px */
body.portal button.small,
body.portal .small { min-height: 40px; height: auto; padding: 0 14px; font-size: var(--fs-md); line-height: 1.2; }

/* ===== nagłówek portalu — fioletowy pasek, białe logo ===== */
.portal-head { padding: env(safe-area-inset-top, 0px) var(--gutter) 0; }
.portal-head .header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 52px;
  max-width: var(--container-portal);
  margin: 0 auto;
}
.portal-head .brand {
  font-family: var(--font-logo);
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff; /* logo: czysta biel */
  letter-spacing: 0;
  line-height: 1;
  display: inline-block;
  text-align: center;
}
/* podpis „studio”: letter-spacing/padding-left kalibrowane pod literę O — bez zmian */
.portal-head .brand span {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.36em;
  letter-spacing: 0.313em;
  padding-left: 0.313em;
  text-transform: lowercase;
  display: block;
  margin-top: -0.1rem;
  color: #ffffff; /* logo: czysta biel */
  opacity: 1;
  white-space: nowrap;
}
.portal-head .head-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.portal-head #ph-name {
  color: var(--on-header-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 34vw;
}
.portal-head .logout-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: var(--r-pill);
  background: rgba(36, 28, 61, .2); /* przyciemniona pigułka: biel 6,0:1 */
  color: var(--on-header);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-fast) var(--ease-standard), border-color var(--t-fast) var(--ease-standard);
}
.portal-head .logout-link:hover { background: rgba(36, 28, 61, .3); border-color: rgba(255, 255, 255, .7); text-decoration: none; }
.portal-head .logout-link:active { background: rgba(36, 28, 61, .38); }
.portal-head .logout-link > .ui { font-size: 14px; margin-right: 0; }
/* pasek zakładek w nagłówku — tylko od 700 px */
.portal-head .top-nav { display: none; }
@media (max-width: 700px) {
  /* telefon: dolna nawigacja, więc nagłówek nie musi być przyklejony ani rozmyty */
  .portal-head { position: static; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ===== zakładki dzieci — pastylki konta (wyższy poziom niż segment) ===== */
.child-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
  max-width: var(--container-portal);
  margin: 0 auto;
  padding: 12px var(--gutter) 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.child-tabs::-webkit-scrollbar { display: none; }
.child-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 34px;
  min-height: 0;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--text-2);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--sh-1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-fast) var(--ease-standard), border-color var(--t-fast) var(--ease-standard),
    color var(--t-fast), box-shadow var(--t-base) var(--ease-out), transform var(--t-micro) var(--ease-out);
}
.child-tab:hover { background: #fff; border-color: var(--border-hover); color: var(--text); }
.child-tab:active { transform: scale(.96); }
.child-tab.active { background: var(--lav-600); border-color: var(--lav-600); color: #fff; box-shadow: var(--sh-accent); }
.child-tab.active:hover { background: var(--lav-700); border-color: var(--lav-700); color: #fff; }
.child-tab:focus-visible { outline: none; box-shadow: var(--ring); }
@media (max-width: 700px) {
  /* pasek dzieci zostaje na górze przy przewijaniu (nagłówek jest statyczny) */
  .child-tabs {
    position: sticky;
    top: 0;
    z-index: 30;
    padding-bottom: 8px;
    background: rgba(243, 239, 250, .86); /* = --bg */
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
  }
}

/* ===== widoki (JS przełącza .active) ===== */
.pv { display: none; }
.pv.active { display: block; }

/* ===== dolna nawigacja (telefon) =====
   .top-nav w nagłówku ma też klasę .bottom-nav — reguły mobilne wyłącznie po #bottom-nav, żeby nie wyciekły na desktop */
#bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--hairline);
  box-shadow: none;
}
#bottom-nav button {
  flex: 1 1 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 56px;
  height: auto;
  padding: 8px 4px 6px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--n-600); /* 5,6:1 */
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: color var(--t-fast) var(--ease-standard);
}
#bottom-nav button:hover { background: none; color: var(--n-700); }
#bottom-nav button:active { transform: none; background: none; }
#bottom-nav button.active { color: var(--lav-700); }
#bottom-nav button:focus-visible { outline: none; box-shadow: var(--ring-inset); border-radius: var(--r-md); }
#bottom-nav button .nav-lbl { font-size: inherit; }
/* ikony nawigacji: glif mono <svg class="gl"> (icons/glyphs.svg) wewnątrz .nav-ico — jak iOS tab bar:
   nieaktywny n-500, aktywny lav-600 (kolor przez currentColor); ruch (spring) na kontenerze .nav-ico */
.nav-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  line-height: 0;
  transform: translateZ(0);
  transition: transform var(--t-enter) var(--ease-spring);
}
#bottom-nav button .gl, .top-nav button .gl {
  display: block;
  width: 26px;
  height: 26px;
  color: var(--n-600);
  transition: color var(--t-fast) var(--ease-standard);
}
#bottom-nav button:hover .gl { color: var(--n-700); }
#bottom-nav button.active .gl, .top-nav button.active .gl { color: var(--lav-600); }
#bottom-nav button.active .nav-ico { transform: translateY(-1px) scale(1.08); }
#bottom-nav button:active .nav-ico { transform: scale(.9); transition-duration: var(--t-micro); }
/* licznik nieprzeczytanych nad ikoną */
#bottom-nav button .nav-badge {
  position: absolute;
  top: 4px;
  left: calc(50% + 6px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  margin: 0;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red-600);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  font-variant-numeric: tabular-nums;
}

/* ===== bannery / alerty — z ikoną (maska), tinta + tekst -fg ===== */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  margin-bottom: 8px;
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1.43;
}
.banner::before {
  content: '';
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--bi) center / contain no-repeat;
  mask: var(--bi) center / contain no-repeat;
}
.banner.info {
  --bi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E");
  background: var(--info-bg);
  border-color: var(--info-line);
  color: var(--info-fg);
}
.banner.warn {
  --bi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 2.5 20h19z'/%3E%3Cpath d='M12 10v4M12 17h.01'/%3E%3C/svg%3E");
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn-fg);
}
.banner span { flex: 1 1 12rem; }
.banner .small { flex: 0 0 auto; min-height: 36px; }
#home-alerts:empty, #acc-pending:empty { display: none; }

/* ===== kafelki Start / statystyki ===== */
.home-tiles, .stat-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.home-tiles:empty { display: none; }
/* trzeci kafelek nie zostaje sierotą */
.home-tiles .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  text-align: left;
  transition: background-color var(--t-fast) var(--ease-standard), border-color var(--t-fast) var(--ease-standard),
    box-shadow var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
}
.tile > .ico, .tile > .tile-ico { margin-bottom: 4px; }
.tile strong {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: var(--track-tight);
  line-height: var(--lh-tight);
  color: var(--text);
  font-variant-numeric: tabular-nums lining-nums;
}
.tile span { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); line-height: 1.35; }
/* kafelek-przycisk: reset wysokości i układu z button, chevron w rogu */
.tile-btn {
  height: auto;
  min-height: 0;
  padding: 14px 36px 14px 16px;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: 0;
  white-space: normal;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tile-btn::after {
  content: '';
  position: absolute;
  top: 16px;
  right: 14px;
  width: 18px;
  height: 18px;
  background: var(--n-400);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--t-base) var(--ease-out), background-color var(--t-fast);
}
.tile-btn:hover { background: #fff; border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--sh-2); }
.tile-btn:hover::after { background: var(--lav-600); transform: translateX(2px); }
.tile-btn:active { transform: scale(.98); box-shadow: var(--sh-1); }
.tile-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.tile.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.tile.warn:hover { background: var(--warn-bg); border-color: var(--amber-500); }
.tile.warn strong { color: var(--warn-fg); }
.tile.warn.tile-btn::after, .tile.warn.tile-btn:hover::after { background: var(--warn-fg); }
/* Obecność: cztery liczby w jednym pasku (jak Apple Health), nie cztery ramki */
.stat-tiles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.stat-tiles .tile { border: 0; border-radius: 0; box-shadow: none; align-items: center; text-align: center; padding: 12px 4px 10px; gap: 2px; }
.stat-tiles .tile + .tile { border-left: 1px solid var(--border); }
.stat-tiles .tile strong { font-size: var(--fs-xl); }
.stat-tiles .tile:first-child strong { color: var(--lav-700); }
.stat-tiles .tile span { font-size: var(--fs-2xs); letter-spacing: .01em; line-height: 1.25; }
.stat-tiles.skeleton { border: 0; box-shadow: none; }

/* ===== informacja o grupie nad listą zajęć ===== */
.group-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: none;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--muted);
}
.group-info::before {
  content: '';
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  background: var(--lav-600);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20a6.5 6.5 0 0 1 13 0'/%3E%3Cpath d='M16 4.5a3.5 3.5 0 0 1 0 7M21.5 20a6.5 6.5 0 0 0-5-6.3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20a6.5 6.5 0 0 1 13 0'/%3E%3Cpath d='M16 4.5a3.5 3.5 0 0 1 0 7M21.5 20a6.5 6.5 0 0 0-5-6.3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.badge-enrolling {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--warn-bg);
  color: var(--warn-fg);
  font-size: var(--fs-2xs);
  font-weight: 600;
  line-height: 1.4;
  vertical-align: 1px;
}

/* ===== karta sesji (Start) — data w tintowanym bloku, pasek statusu 3 px z lewej ===== */
.session-card {
  display: flex;
  gap: 12px;
  padding: 12px 14px 12px 12px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--st-unmarked);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  transition: border-color var(--t-fast) var(--ease-standard), box-shadow var(--t-base) var(--ease-out);
}
.session-card .sc-date {
  flex: 0 0 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 8px 4px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--lav-50);
  color: var(--text);
  text-align: center;
}
.sc-date .sc-day {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}
.sc-date .sc-num {
  font-family: var(--font-sans);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: var(--track-tight);
  line-height: 1.15;
  color: var(--text);
  font-variant-numeric: tabular-nums lining-nums;
}
.sc-date .sc-time { font-size: var(--fs-sm); font-weight: 600; color: var(--lav-700); font-variant-numeric: tabular-nums lining-nums; }
.session-card .sc-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sc-title { font-size: var(--fs-base); font-weight: 600; letter-spacing: -0.006em; line-height: 1.3; }
.sc-meta { font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; }
.sc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.sc-actions .deadline { flex-basis: 100%; }

/* ===== wiersz sesji / zgłoszenia / prośby / dzieci ===== */
.session-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  min-height: var(--row-h-mobile);
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  font-size: var(--fs-md);
  line-height: 1.35;
  transition: background-color var(--t-fast) var(--ease-standard), border-color var(--t-fast) var(--ease-standard);
}
/* pasek statusu tylko tam, gdzie JS nadaje .st-b-* (listy zgłoszeń i dzieci go nie mają) */
.session-row[class*="st-b-"] { border-left-width: 3px; }
.session-row .sr-main { flex: 1 1 200px; min-width: 0; }
.session-row .sr-main strong { font-weight: 600; letter-spacing: -0.005em; font-variant-numeric: tabular-nums lining-nums; }
.session-row .sr-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.session-row .muted { margin-top: 2px; }

/* kolory paska wg statusu (klasy z JS, !important zostaje) */
.st-b-present { border-left-color: var(--st-present) !important; }
.st-b-absent { border-left-color: var(--st-absent) !important; }
.st-b-reported { border-left-color: var(--st-reported) !important; }
.st-b-cancelled { border-left-color: var(--st-cancelled) !important; opacity: 1; }
.st-b-cancelled .sc-title { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(107, 104, 117, .55); }
.st-b-upcoming { border-left-color: var(--st-upcoming) !important; }
.st-b-guest { border-left-color: var(--st-guest) !important; }
.st-b-unmarked { border-left-color: var(--st-unmarked) !important; }

/* nagłówki miesięcy / dni — overline bez linii */
body.portal .month-h {
  font-family: var(--font-sans);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
  margin: 16px 0 8px;
  padding: 0;
  border: 0;
}
body.portal .month-h:first-child { margin-top: 0; }
#mk-slots .month-h { position: sticky; top: 0; z-index: 1; background: #fff; padding: 6px 0; margin-top: 8px; }

.deadline { font-size: var(--fs-sm); color: var(--muted); font-style: normal; line-height: 1.4; }
#abs-deadline { margin: 0; }

/* ===== ogłoszenia ===== */
body.portal .ann-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--lav-400);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  line-height: 1.45;
}
body.portal .ann-card.pinned { background: var(--amber-50); border-color: var(--amber-200); border-left-color: var(--amber-500); }
.ann-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ann-head strong {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 600;
  letter-spacing: -0.006em;
  line-height: 1.35;
  color: var(--text);
}
.ann-text { white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
body.portal .ann-card > small { font-size: var(--fs-xs); color: var(--muted); }
.ann-photo { display: block; max-width: 100%; max-height: 300px; border-radius: var(--r-md); margin: 4px 0 0; object-fit: cover; }

/* ===== płatności — karta miesiąca ===== */
.pay-month {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--st-unmarked);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.pay-month.pm-paid { background: var(--st-present-bg); border-color: var(--st-present-line); }
.pay-month.pm-unpaid { background: var(--st-absent-bg); border-color: var(--st-absent-line); }
.pay-month.pm-upcoming { background: var(--lav-50); border-color: var(--lav-200); }
.pm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px 10px; flex-wrap: wrap; }
.pm-head strong {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 600;
  letter-spacing: -0.006em;
  line-height: 1.35;
  color: var(--text);
}
.pm-meta, .pm-title, .pm-due-date {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.45;
  font-variant-numeric: tabular-nums lining-nums;
}
.pm-title strong, .pm-due-date strong { color: var(--text); font-weight: 600; }
.pm-due-date { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.pm-due-date .ui, .pm-due-date .ico { flex: 0 0 auto; color: var(--lav-700); }
.pm-due-date.late, .pm-due-date.late strong, .pm-due-date.late .ui { color: var(--danger-fg); }
.pm-due-date.late { font-weight: 600; }
.pm-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.pm-actions .deadline { margin: 0; }

/* nadchodząca płatność (następny miesiąc) */
.pay-upcoming {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  margin-bottom: 16px;
  background: var(--lav-50);
  border: 1px solid var(--lav-300);
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 3px var(--lav-50);
}
.pay-upcoming h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 600;
  letter-spacing: -0.006em;
  color: var(--text);
}
.pay-upcoming .pay-month { margin-bottom: 0; }
.pay-upcoming-sum { margin: 0; font-size: var(--fs-md); color: var(--muted); line-height: 1.45; }
.pay-upcoming-sum strong {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: var(--track-snug);
  color: var(--text);
  font-variant-numeric: tabular-nums lining-nums;
}
.pay-section-h { margin: 16px 0 8px; font-family: var(--font-sans); font-size: var(--fs-base); font-weight: 600; letter-spacing: -0.006em; color: var(--text); }

/* sposoby płatności: gotówka na recepcji albo przelew */
.pay-howto {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.pay-howto h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 600;
  letter-spacing: -0.006em;
  color: var(--text);
}
.pay-opt { display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-md); line-height: 1.45; }
.pay-opt > div { flex: 1 1 auto; min-width: 0; }
.pay-opt strong { font-weight: 600; }
/* ikona sposobu płatności: <img class="ico ico-lg"> (kafelek iOS 40 px z icons.css — bez dodatkowej tinty; klasa .pay-opt-ico zostaje — JS) */
.pay-opt-ico {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 0;
  line-height: 0;
}
.pay-kv { margin: 8px 0 0; }

/* pary etykieta–wartość (dane do przelewu) */
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: var(--fs-md);
  align-items: baseline;
}
.kv dt { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); white-space: nowrap; }
.kv dd { margin: 0; min-width: 0; }

/* ===== terminy odrabiania (modal) ===== */
#mk-slots { max-height: min(60vh, 32rem); overflow-y: auto; padding-right: 0; overscroll-behavior: contain; }
#mk-credits { margin: 0; }
.slot-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  min-height: var(--row-h);
  padding: 10px 12px;
  margin-bottom: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  line-height: 1.35;
  transition: border-color var(--t-fast) var(--ease-standard), background-color var(--t-fast) var(--ease-standard);
}
.slot-card.full { opacity: 1; background: var(--bg-hover); color: var(--muted); }
.slot-main { flex: 1 1 180px; min-width: 0; }
.slot-main strong { font-weight: 600; font-variant-numeric: tabular-nums lining-nums; }
.slot-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ===== czat — jak iMessage ===== */
.chat-panel { display: flex; flex-direction: column; }
/* „Do kogo” = pastylka zamiast surowego selecta */
body.portal .msg-to { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0 0 10px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
body.portal .msg-to select {
  display: inline-block;
  width: auto;
  min-height: 32px;
  height: 32px;
  margin: 0;
  padding: 0 30px 0 12px;
  border: 0;
  border-radius: var(--r-pill);
  background-color: var(--lav-50);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2362509a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  box-shadow: none;
  color: var(--lav-700);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
body.portal .msg-to select:hover { background-color: var(--lav-100); }
body.portal .msg-to select:focus { outline: none; border: 0; box-shadow: var(--ring); }
body.portal .chat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 12rem;
  max-height: min(55vh, 30rem);
  margin: 0 0 10px;
  padding: 10px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow-y: auto;
  overscroll-behavior: contain;
}
body.portal .chat .empty { margin: auto; }
body.portal .chat-msg {
  align-self: flex-start;
  max-width: 82%;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 6px;
  font-size: var(--fs-md);
  line-height: 1.45;
  box-shadow: var(--sh-1);
  white-space: normal;
}
body.portal .chat-msg.me {
  align-self: flex-end;
  background: var(--lav-600);
  border-color: var(--lav-600);
  color: #fff;
  border-radius: 16px;
  border-bottom-right-radius: 6px;
}
.chat-msg .chat-text { white-space: pre-wrap; word-break: break-word; }
body.portal .chat-msg .chat-time { display: block; font-size: var(--fs-2xs); color: var(--muted); margin-top: 3px; white-space: nowrap; opacity: 1; }
body.portal .chat-msg.me .chat-time { text-align: right; color: rgba(255, 255, 255, .85); }
.chat-who { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); opacity: 1; margin-bottom: 2px; }
body.portal .chat-msg.me a { color: rgba(255, 255, 255, .92); text-decoration: underline; text-underline-offset: 2px; }
/* załączniki wiadomości od studia */
.chat-atts { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.chat-att { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 500; color: var(--lav-700); word-break: break-word; }
.chat-att .ui { flex: 0 0 auto; font-size: 14px; }
.chat-att small { color: var(--muted); font-weight: 400; }
body.portal .chat-msg.me .chat-att, body.portal .chat-msg.me .chat-att small { color: rgba(255, 255, 255, .85); }
/* pole + pigułka „Wyślij” */
.msg-form { display: flex; gap: 8px; align-items: flex-end; }
.msg-form textarea { flex: 1 1 auto; resize: none; min-height: 44px; padding: 11px 16px; border-radius: 22px; font-size: 16px; line-height: 1.35; }
.msg-form button { flex: 0 0 auto; align-self: flex-end; height: 44px; min-height: 44px; padding: 0 18px; border-radius: 22px; }
.msg-form button .ui { font-size: 18px; }

/* ===== konto ===== */
#acc-pending .banner { margin-top: 6px; }
body.portal input, body.portal select, body.portal textarea { font-size: 16px; } /* bez zoomu na iOS */
/* pole tylko do odczytu (e-mail = login) wyraźnie inne niż edytowalne — specyficzność ponad globalne input:not(...)×4 */
body.portal input:disabled:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]) {
  background: var(--n-100);
  border-color: transparent;
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  box-shadow: none;
  opacity: 1;
}
/* kod SMS powiązania — duże, rozstrzelone cyfry */
#lv-code {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: .35em;
  text-align: center;
  padding-left: calc(12px + .35em);
  font-variant-numeric: tabular-nums lining-nums;
}
#lv-code::placeholder { font-family: var(--font-sans); font-size: 16px; font-weight: 400; letter-spacing: 0; }
#lv-name-wrap { margin-top: 0; }

/* ===== puste stany ===== */
body.portal .empty {
  display: block;
  padding: 24px 16px;
  text-align: center;
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1.45;
  color: var(--muted);
}
body.portal .empty a { font-weight: 600; }
body.portal .empty .ico { display: block; margin: 0 auto 8px; filter: drop-shadow(0 6px 12px rgba(var(--ink), .18)); }

/* ===== skeleton (ładowanie) — tło; shimmer (@keyframes skel) daje motion.css ===== */
.skeleton {
  position: relative;
  min-height: 52px;
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--n-100) 25%, var(--n-50) 50%, var(--n-100) 75%);
  background-size: 200% 100%;
  color: transparent;
}
.skeleton > * { visibility: hidden; }
#home-next.skeleton, #home-ann.skeleton, #att-list.skeleton, #pay-rows.skeleton, #acc-children.skeleton { min-height: 96px; }
#att-stats.skeleton { min-height: 68px; border-radius: var(--r-lg); }
#chat.skeleton { min-height: 12rem; }

/* ===== toast w portalu — nad dolną nawigacją ===== */
body.portal .toast { bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }

/* ===== modale w portalu (powłoka i arkusz mobilny — style.css) ===== */
body.portal .modal { gap: 12px; }
body.portal .modal h2 { display: flex; align-items: center; gap: 8px; }
body.portal .modal .sms-meta { font-size: var(--fs-md); line-height: 1.45; color: var(--muted); }
body.portal .modal #abs-info { font-weight: 600; color: var(--text); }
body.portal .modal label { gap: 6px; }
body.portal .modal .form-actions { margin-top: 8px; gap: 8px; flex-wrap: wrap; flex-direction: row-reverse; justify-content: flex-start; } /* jak w panelu: akcja główna po prawej */
body.portal .modal .signup-hint { margin: 0; }
body.portal .modal .kv { margin: 4px 0; }
@media (max-width: 700px) {
  body.portal .modal .form-actions button { flex: 1 1 calc(50% - 4px); min-height: 44px; }
  /* modal blokujący (hasło tymczasowe) — bez uchwytu arkusza, bo nie da się go zamknąć gestem */
  #pw-force-modal .modal::before { display: none; }
}

/* ===== szerokie ekrany ===== */
@media (min-width: 700px) {
  body.portal main { padding: 20px var(--gutter) 32px; }
  body.portal .panel { padding: 20px; }
  .portal-head { padding: 0 var(--gutter); }
  .portal-head .brand { font-size: 1.5rem; }
  .portal-head #ph-name { max-width: 24rem; }

  /* górna nawigacja = białe podkreślenie 3 px na fioletowym pasku, jak zakładki panelu */
  .portal-head .top-nav {
    position: static;
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    max-width: var(--container-portal);
    height: var(--nav-h);
    margin: 0 auto;
    padding: 0;
    gap: 4px;
    background: none;
    border: 0;
    box-shadow: none;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .portal-head .top-nav::-webkit-scrollbar { display: none; }
  .portal-head .top-nav button {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    height: var(--nav-h);
    min-height: 0;
    margin: 0;
    padding: 0 12px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--on-header-2);
    font-family: inherit;
    font-size: var(--fs-base);
    font-weight: 500;
    letter-spacing: -0.006em;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--t-fast) var(--ease-standard);
  }
  .portal-head .top-nav button:hover { background: none; color: var(--on-header); }
  .portal-head .top-nav button:active { transform: none; }
  .portal-head .top-nav button.active { background: none; color: var(--on-header); font-weight: 600; }
  .portal-head .top-nav button::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--on-header);
    transform: scaleX(0);
    transition: transform var(--t-base) var(--ease-out);
  }
  .portal-head .top-nav button.active::after { transform: scaleX(1); }
  .portal-head .top-nav button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9); border-radius: var(--r-sm); }
  .portal-head .top-nav .nav-ico { width: 20px; height: 20px; }
  .portal-head .top-nav button .gl { width: 18px; height: 18px; }
  .portal-head .top-nav button.active .nav-ico { transform: none; }
  .portal-head .top-nav button .gl { color: var(--on-header-2); }
  .portal-head .top-nav { --gl-hole: #a794c0; } /* wycięcia glifów w kolorze fioletowego paska (nie białe kółko) */
  .portal-head .top-nav button:hover .gl { color: var(--on-header); }
  .portal-head .top-nav button.active .gl { color: var(--on-header); }
  .portal-head .top-nav .nav-lbl { font-size: inherit; }
  .portal-head .top-nav .nav-badge {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: 2px;
    padding: 0 5px;
    border-radius: 9px;
    background: #fff; /* na fioletowym pasku: biała pastylka z czerwoną liczbą */
    color: var(--red-700);
    font-size: var(--fs-2xs);
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
  }
  #bottom-nav { display: none; }
  body.portal .toast { bottom: 20px; }

  .child-tabs { padding: 14px var(--gutter) 0; }
  .home-tiles { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .home-tiles .tile:last-child:nth-child(odd) { grid-column: auto; }
  .stat-tiles .tile { padding: 14px 8px 12px; }
  .stat-tiles .tile span { font-size: var(--fs-xs); }
  .session-card { padding: 12px 16px 12px 14px; }
  .session-card .sc-date { flex-basis: 64px; }
  .sc-date .sc-num { font-size: 18px; }
  .session-row { min-height: var(--row-h); padding: 8px 12px; border-radius: var(--r-md); margin-bottom: 6px; }
  body.portal .chat { max-height: 28rem; }
  .msg-form textarea { min-height: 48px; }
}

/* desktop z kursorem: karty reagują obramowaniem (bez transformu — nie są klikalne) */
@media (hover: hover) and (pointer: fine) {
  .session-card:hover, .pay-month:hover, .slot-card:hover, body.portal .ann-card:hover { border-color: var(--border-strong); }
  .pay-month.pm-paid:hover { border-color: var(--st-present); }
  .pay-month.pm-unpaid:hover { border-color: var(--st-absent); }
  .pay-month.pm-upcoming:hover { border-color: var(--lav-300); }
}

/* drobne ekrany: pięć zakładek musi się zmieścić */
@media (max-width: 360px) {
  #bottom-nav button { font-size: 10px; padding: 7px 2px 5px; }
  .nav-ico { width: 24px; height: 24px; }
  #bottom-nav button .gl { width: 22px; height: 22px; }
  .session-card .sc-date { flex-basis: 54px; }
  .sc-date .sc-num { font-size: var(--fs-base); }
  .stat-tiles .tile span { font-size: 10px; }
  .portal-head #ph-name { max-width: 30vw; }
}

/* ===== redukcja ruchu (globalne zerowanie — style.css); tu tylko stany statyczne ===== */
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: var(--n-100); }
  #bottom-nav { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
  .child-tabs { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
}
