/* ===== Nawigacja w nagłówku ===== */
.topnav { display: flex; gap: 4px; margin-left: 18px; }
.topnav a { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: var(--radius); color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; }
.topnav a svg { width: 17px; height: 17px; }
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a.active { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 600px) { .topnav { margin-left: 4px; } .topnav a { padding: 0 10px; } }
@media (max-width: 480px) { .topbar:has(.topnav) .brand-text { display: none; } .topbar:has(.topnav) { gap: 6px; } }

.tag.danger { background: var(--danger-soft); color: var(--danger); }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }

/* ===== Kalendarz: tydzień ===== */
.cal-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-range { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 21px; }
.cal-week { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cal-head, .cal-body { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); }
.cal-head { border-bottom: 1px solid var(--border); }
.cal-dh { padding: 8px 6px; text-align: center; border-left: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.cal-dh b { display: block; font-size: 19px; font-weight: 600; color: var(--text); font-family: var(--serif); }
.cal-dh.today b { color: var(--on-accent); background: var(--accent); width: 32px; height: 32px; line-height: 32px; border-radius: 50%; margin: 2px auto 0; }
.cal-body { position: relative; }
.cal-hours { position: relative; }
.cal-hours span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-hours span:first-child { transform: none; top: 2px !important; }
.cal-col {
  position: relative; border-left: 1px solid var(--border); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--border) calc(var(--hour) - 1px), var(--border) var(--hour));
}
.cal-col.today { background-color: var(--accent-soft); }
@media (hover: hover) {
  .cal-col:hover { background-color: color-mix(in srgb, var(--surface-2) 45%, transparent); }
  .cal-col.today:hover { background-color: var(--accent-soft); }
}
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); pointer-events: none; z-index: 2; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

.cal-ev {
  position: absolute; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; overflow: hidden;
  padding: 4px 7px; border: 0; border-left: 3px solid var(--tone); border-radius: 6px; cursor: pointer; text-align: left;
  background: color-mix(in srgb, var(--tone) 16%, var(--surface)); color: var(--text); font: inherit;
}
.cal-ev:hover { background: color-mix(in srgb, var(--tone) 26%, var(--surface)); }
.cal-ev .n { font-weight: 600; font-size: 12.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 18px); }
.cal-ev .t { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-ev.short { flex-direction: row; align-items: center; gap: 6px; padding-top: 2px; padding-bottom: 2px; }
.cal-ev .badge { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 3px; border-radius: 9px; font-size: 10px; font-weight: 700; }
.cal-ev .badge svg { width: 11px; height: 11px; stroke-width: 3; }
.cal-ev .badge.ok { background: var(--tag-ok-bg); color: var(--tag-ok-fg); }
.cal-ev .badge.due { background: var(--danger); color: #fff; }
.cal-ev.st-unpaid { box-shadow: inset 0 0 0 1px var(--danger); }
.cal-ev.st-cancelled { opacity: .55; background: var(--surface-2); border-left-style: dashed; }
.cal-ev.st-cancelled .n { text-decoration: line-through; }

/* Lista dni („agenda”) – na telefonie do wyboru zamiast siatki */
.cal-agenda { display: none; }
.ag-day { margin-bottom: 14px; }
.ag-date { font-weight: 600; font-size: 13px; color: var(--muted); margin: 0 2px 6px; }
.ag-date::first-letter { text-transform: uppercase; }
.ag-day.today .ag-date { color: var(--accent); }
.ag-row {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 6px; padding: 10px 12px; font: inherit; color: inherit; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--tone); border-radius: 10px;
}
.ag-time { display: flex; flex-direction: column; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 44px; }
.ag-time small, .ag-name small { font-weight: 400; color: var(--muted); font-size: 12px; }
.ag-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 500; }
.ag-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-row.st-cancelled { opacity: .6; }
.ag-row.st-cancelled .ag-name { text-decoration: line-through; }
/* Telefon: ta sama siatka tygodnia, ale kilka dni na szerokość ekranu – przesuwanie palcem w bok
   (dni „zatrzaskują się” na krawędzi), oś godzin i nagłówki dni przyklejone. */
.cal-mode { display: none; }
@media (max-width: 760px) {
  .cal-week {
    --hw: 40px; --days: 3;
    --colw: calc((100vw - 28px - var(--hw)) / var(--days));
    container-type: inline-size;
    overflow: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory; scroll-padding-left: var(--hw);
    max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); min-height: 280px;
  }
  @supports (width: 1cqw) { .cal-week > * { --colw: calc((100cqw - var(--hw)) / var(--days)); } }
  .cal-head, .cal-body { grid-template-columns: var(--hw) repeat(7, var(--colw)); width: max-content; min-width: 100%; }
  .cal-head { position: sticky; top: 0; z-index: 5; background: var(--surface); }
  .cal-head > :first-child, .cal-hours { position: sticky; left: 0; background: var(--surface); }
  .cal-head > :first-child { z-index: 1; }
  .cal-hours { z-index: 4; }
  .cal-hours span { right: 5px; font-size: 10.5px; }
  .cal-dh { scroll-snap-align: start; padding: 6px 2px; }
  .cal-dh b { font-size: 17px; }
  .cal-ev { padding: 3px 5px; border-radius: 5px; }
  .cal-ev .n { font-size: 12px; }
  .cal-ev .t { font-size: 11px; }
  .cal-ev.short .t { display: none; }
  /* Przełącznik „Kalendarz / Lista” */
  .cal-mode { display: flex; flex: 1 1 180px; max-width: 230px; }
  .cal-week { scrollbar-width: none; }
  .cal-week::-webkit-scrollbar { display: none; }
  .cal-mode button { min-height: 36px; }
  .cal-list .cal-week { display: none; }
  .cal-list .cal-agenda { display: block; }
}
@media (min-width: 520px) and (max-width: 760px) { .cal-week { --days: 5; } }

/* Do rozliczenia */
.dues { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.due-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; flex-wrap: wrap; }
.due-row + .due-row { border-top: 1px solid var(--border); }
.due-name { font-weight: 600; color: var(--text); text-decoration: none; }
.due-name:hover { color: var(--accent); }
.due-sum { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ===== Okno zajęć ===== */
.ev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ev-flags { display: flex; gap: 10px; flex-wrap: wrap; }
.ev-flag { cursor: pointer; position: relative; }
.ev-flag input { position: absolute; opacity: 0; pointer-events: none; }
.ev-flag span { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 20px; font-weight: 500; color: var(--muted); }
.ev-flag span svg { width: 15px; height: 15px; }
.ev-flag input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.ev-flag input:checked + span { background: var(--tag-ok-bg); color: var(--tag-ok-fg); border-color: transparent; }
.ev-flag:last-child input:checked + span { background: var(--surface-2); color: var(--text); }

/* ===== Zajęcia na stronie ucznia ===== */
.events-box { margin-bottom: 30px; }
.ev-list { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ev-group { padding: 8px 14px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.ev-row { display: grid; grid-template-columns: 150px 100px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 9px 14px; cursor: pointer; }
.ev-row + .ev-row { border-top: 1px solid var(--border); }
.ev-row:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.ev-date { font-weight: 500; }
.ev-time, .ev-price { font-variant-numeric: tabular-nums; color: var(--muted); }
.ev-note { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-pay { border: 0; cursor: pointer; font: inherit; font-size: 12px; }
.ev-pay:hover { box-shadow: inset 0 0 0 1px currentColor; }
.ev-row.st-cancelled .ev-date, .ev-row.st-cancelled .ev-time { text-decoration: line-through; opacity: .7; }
.ev-more { margin: 6px 8px; }
@media (max-width: 640px) {
  .ev-row { grid-template-columns: 1fr auto; gap: 2px 10px; }
  .ev-time { grid-row: 2; }
  .ev-note { display: none; }
  .ev-price { grid-column: 2; grid-row: 1; }
  .ev-pay, .ev-row > .tag { grid-column: 2; grid-row: 2; justify-self: end; }
}

/* ===== Subskrypcja w telefonie ===== */
.notice { display: flex; gap: 10px; padding: 11px 13px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; margin-bottom: 14px; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.notice.warn { background: var(--tag-warn-bg); color: var(--tag-warn-fg); }
.sub-box { display: flex; gap: 16px; align-items: flex-start; }
.sub-qr { flex: none; width: 150px; height: 150px; background: #fff; border-radius: 10px; padding: 6px; border: 1px solid var(--border); }
.sub-qr svg { width: 100%; height: 100%; display: block; }
.sub-steps { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.5; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 520px) { .sub-box { flex-direction: column; align-items: center; } }

/* ===== Portal ucznia: najbliższe zajęcia ===== */
.upcoming { margin-bottom: 26px; }
.upcoming h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 0 0 10px; }
.upcoming h2 svg { width: 19px; height: 19px; color: var(--accent); }
.upcoming-list { display: flex; gap: 10px; flex-wrap: wrap; }
.up-item { display: flex; flex-direction: column; gap: 2px; padding: 11px 15px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; min-width: 200px; }
.up-day { font-weight: 600; }
.up-day::first-letter { text-transform: uppercase; }
.up-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.up-item.cancelled { opacity: .65; border-left-color: var(--border); }
.up-item.cancelled .up-day, .up-item.cancelled .up-time { text-decoration: line-through; }
.up-item .tag { align-self: flex-start; margin-top: 4px; }

/* ===== Przychody ===== */
:root {
  --inc-paid: #2f8159;
  --inc-unpaid: #c98a1c;
  --inc-planned: #4a8fc4;
}
:root[data-theme="dark"] {
  --inc-paid: #3c9468;
  --inc-unpaid: #bf8728;
  --inc-planned: #4a8ec4;
}
.inc-year { align-items: center; gap: 4px; }
.inc-year .icon-btn { text-decoration: none; }
.inc-year-label { font-family: var(--serif); font-size: 17px; font-weight: 500; min-width: 170px; text-align: center; }
.inc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.inc-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.inc-tile.hero { grid-column: span 2; }
@media (max-width: 520px) { .inc-tile.hero { grid-column: auto; } }
.inc-tile-label { color: var(--muted); font-size: 12.5px; }
.inc-tile-value { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.inc-tile.hero .inc-tile-value { font-size: 40px; line-height: 1.1; }
.inc-tile-sub { color: var(--muted); font-size: 12.5px; }
.inc-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.inc-card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.inc-card-head h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 19px; margin-right: auto; }
.inc-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.inc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.inc-sw-paid { background: var(--inc-paid); }
.inc-sw-unpaid { background: var(--inc-unpaid); }
.inc-sw-planned { background: var(--inc-planned); }
.inc-chart { position: relative; width: 100%; overflow: hidden; }
.inc-svg { display: block; }
.inc-paid { fill: var(--inc-paid); }
.inc-unpaid { fill: var(--inc-unpaid); }
.inc-planned { fill: var(--inc-planned); }
.inc-grid { stroke: var(--border); stroke-width: 1; }
.inc-axis { stroke: var(--hover-border); stroke-width: 1; }
.inc-tick, .inc-month { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.inc-month.now { fill: var(--text); font-weight: 700; }
.inc-label { fill: var(--text); font-size: 12px; font-weight: 600; }
.inc-hit { fill: transparent; cursor: default; outline: none; }
.inc-hit.on { fill: var(--accent-soft); }
.inc-tip { position: absolute; pointer-events: none; min-width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 9px 12px; font-size: 13px; z-index: 2; }
.inc-tip b { display: block; margin-bottom: 4px; text-transform: capitalize; }
.inc-tip-row { display: flex; align-items: center; gap: 7px; padding: 1px 0; }
.inc-tip-row span:last-child { margin-left: auto; font-variant-numeric: tabular-nums; }
.inc-tip-row.total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; font-weight: 700; }
.inc-tip-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.inc-table-wrap { margin-top: 10px; }
.inc-table-wrap summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.inc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 8px; }
.inc-table th { text-align: right; font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.inc-table td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
.inc-table th:first-child, .inc-table td:first-child { text-align: left; }
.inc-table tr:last-child td { border-bottom: 0; }
.inc-table tr.now td { background: var(--accent-soft); }
/* Jedna tabela (wspólne kolumny nagłówka i wierszy); na wąskim ekranie przewija się w bok cały blok. */
.inc-scroll { overflow-x: auto; }
.inc-table.people { min-width: 640px; }
.inc-person { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 500; }
.inc-person:hover { color: var(--accent); }
/* Węższy ekran: w menu same ikony (podpis w podpowiedzi), żeby pasek się mieścił */
@media (max-width: 920px) {
  .topnav a .hide-xs { display: none; }
  .topbar .user { display: none; }
}
/* Telefon: nawigacja panelu jako dolny pasek (pod kciukiem), z podpisami; nad paskiem home iPhone'a */
@media (max-width: 600px) {
  .topnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; gap: 0;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 4px max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 1px solid var(--border);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .topnav a { position: relative; flex-direction: column; justify-content: center; gap: 2px; height: 54px; padding: 0 2px; font-size: 11.5px; font-weight: 600; border-radius: 12px; }
  .topnav a .hide-xs { display: inline; }
  .topnav a svg { width: 22px; height: 22px; }
  .topnav a.active { background: none; color: var(--accent); }
  .topnav a.active svg { background: var(--accent-soft); border-radius: 999px; padding: 3px 14px; width: 52px; height: 28px; margin: -3px 0; box-sizing: border-box; }
  .topnav .nav-badge { position: absolute; top: 4px; left: calc(50% + 8px); margin: 0; }
  .topbar:has(.topnav) .brand-text { display: block; }
  body:has(> .topbar .topnav) { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  body:has(> .topbar .topnav) #toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
  /* Klawiatura otwarta – pasek nie wisi nad nią */
  body:has(:is(input, textarea, select):focus) .topnav { display: none; }
}

/* ===== Umawianie przez stronę ===== */
.cal-avail { position: absolute; left: 0; right: 0; background: var(--accent-soft); border-left: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); pointer-events: auto; }
.cal-ev.cal-request { --tone: var(--chalk); z-index: 2; background: color-mix(in srgb, var(--chalk) 14%, var(--surface)); border: 1.5px dashed var(--chalk); border-left-width: 3px; border-left-style: solid; }
.cal-ev.cal-request .n { display: inline-flex; align-items: center; gap: 4px; }
.cal-ev.cal-request .n svg { width: 12px; height: 12px; flex: none; }
.bk-box { background: var(--surface); border: 1px solid var(--chalk); border-radius: 12px; padding: 14px 16px 6px; margin-bottom: 16px; }
.bk-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.bk-head h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 19px; display: inline-flex; align-items: center; gap: 8px; }
.bk-head h2 svg { width: 18px; height: 18px; color: var(--chalk); }
.bk-row { display: grid; grid-template-columns: 190px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.bk-when b { display: block; }
.bk-when b::first-letter { text-transform: uppercase; }
.bk-when span { color: var(--muted); font-size: 13px; }
.bk-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.bk-who small { flex-basis: 100%; color: var(--muted); font-size: 12.5px; }
.bk-contact { font-size: 13px; }
.bk-parent { font-size: 13px; color: var(--muted); }
.bk-actions { display: flex; gap: 6px; }
@media (max-width: 640px) { .bk-row { grid-template-columns: 1fr; gap: 6px; } }
.av-switch { display: flex; gap: 8px; align-items: center; margin: -4px 0 14px; cursor: pointer; font-weight: 500; }
.av-switch input { width: 16px; height: 16px; accent-color: var(--accent); }
.av-week { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.av-day { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 8px; padding: 6px 10px; border-top: 1px solid var(--border); }
.av-day:first-child { border-top: 0; }
.av-dname { font-size: 13.5px; }
.av-dname::first-letter { text-transform: uppercase; }
.av-wins { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.av-win { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); border-radius: 8px; padding: 3px 3px 3px 6px; }
.av-win .input { height: 30px; padding: 0 4px; width: 92px; font-size: 13px; }
.av-win .icon-btn { width: 26px; height: 26px; }
.av-win .icon-btn svg { width: 14px; height: 14px; }
.av-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.av-chips .tag button { border: 0; background: none; padding: 0; margin-left: 2px; cursor: pointer; color: inherit; display: inline-grid; }
.av-chips .tag button svg { width: 12px; height: 12px; }
.topnav .nav-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--chalk); color: #1c1b18; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; margin-left: -2px; }
@media (max-width: 480px) { .av-day { grid-template-columns: 1fr; } }

/* ===== Kalendarz ucznia ===== */
.my-cal { margin-bottom: 28px; }
.my-cal-head { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.my-cal-head h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 0; }
.my-cal-head h2 svg { width: 19px; height: 19px; color: var(--accent); }
#next-lesson::first-letter { text-transform: uppercase; }
.my-cal-nav { align-items: center; gap: 4px; }
.my-cal-range { font-family: var(--serif); font-weight: 500; font-size: 17px; margin-left: 6px; }
.my-week .cal-col { cursor: default; }
.my-week .cal-col:hover { background-color: transparent; }
.my-week .cal-col.today, .my-week .cal-col.today:hover { background-color: var(--accent-soft); }
.cal-ev.my-lesson { --tone: var(--accent); cursor: default; }
.cal-ev.my-request { --tone: var(--chalk); cursor: default; background: color-mix(in srgb, var(--chalk) 12%, var(--surface)); border: 1.5px dashed var(--chalk); border-left-width: 3px; border-left-style: solid; }
.cal-ev.st-cancelled { --tone: var(--border); opacity: .6; }
.cal-ev.st-cancelled .n, .cal-ev.st-cancelled .t { text-decoration: line-through; }
.ag-row.my-lesson { --tone: var(--accent); cursor: default; }
.ag-row.my-request { --tone: var(--chalk); cursor: default; }
.my-cal-empty { margin: 10px 0 0; }
.bill-buyer { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 10px; }
.bill-row .btn { flex: none; }

/* Zajęty czas prowadzącego (blokada zapisów) */
.cal-ev.cal-busy {
  --tone: var(--muted); z-index: 1; color: var(--muted);
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, color-mix(in srgb, var(--surface-2) 40%, var(--surface)) 6px 12px);
}
.cal-ev.cal-busy .n { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.cal-ev.cal-busy .n svg { width: 12px; height: 12px; flex: none; }
.ag-row.cal-busy-row { --tone: var(--muted); background: var(--surface-2); }
.ag-row.cal-busy-row .tag svg { width: 11px; height: 11px; }
.ag-row.cal-request-row { --tone: var(--chalk); border-style: dashed; border-left-style: solid; border-color: var(--chalk); }

/* ===== Telefon: kalendarz, prośby, rozliczenia, okna ===== */
@media (max-width: 600px) {
  /* „Dodaj zajęcia” jako pływający przycisk nad dolnym paskiem */
  #cal-add {
    position: fixed; z-index: 25; right: max(16px, env(safe-area-inset-right)); bottom: calc(74px + env(safe-area-inset-bottom));
    height: 52px; min-height: 52px; padding: 0 20px 0 16px; border-radius: 26px; box-shadow: var(--shadow-lg); font-size: 15px;
  }
  body:has(:is(input, textarea, select):focus) #cal-add { display: none; }
  .cal-nav { gap: 8px 10px; margin-bottom: 10px; }
  .cal-nav .row { gap: 4px; }
  .cal-range { font-size: 19px; flex: 1 1 calc(100% - 160px); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cal-nav > .spacer { display: none; }
  .cal-nav > .hint { order: 5; flex: 1 1 auto; text-align: right; }
  .cal-mode { order: 4; }
  .cal-box { margin: 0 calc(-1 * max(14px, env(safe-area-inset-left)) + 6px); }
  .bk-box { padding: 12px 14px 4px; }
  .bk-actions .btn { flex: 1; min-height: 44px; }
  .due-row { padding: 12px 14px; }
  .due-sum { margin-left: 0; }
  .due-row .btn { margin-left: auto; min-height: 40px; }
  .ev-flag span { height: 44px; }
  .pf-chip span { height: 40px; }
  /* Dostępność: jeden dzień = nazwa nad oknami godzin */
  .av-day { grid-template-columns: 1fr; padding: 8px 10px; }
  .av-win .input { width: 104px; height: 40px; }
  .av-win .icon-btn { width: 36px; height: 36px; }
  .sub-qr { width: 180px; height: 180px; }
  .ev-row { padding: 11px 14px; }
  .ev-pay { min-height: 30px; padding: 4px 10px; }
  /* Przychody: tabele jako karty (etykiety z data-label) */
  .inc-table.cards { min-width: 0; }
  .inc-table.cards thead { display: none; }
  .inc-table.cards tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .inc-table.cards tr:last-child { border-bottom: 0; }
  .inc-table.cards td { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 3px 0; border: 0; white-space: normal; }
  .inc-table.cards td::before { content: attr(data-label); font-size: 11.5px; color: var(--muted); font-weight: 500; }
  .inc-table.cards td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .inc-table.cards td:first-child::before { display: none; }
  .inc-table.cards tr.now { background: var(--accent-soft); border-radius: 10px; padding-left: 10px; padding-right: 10px; }
  .inc-table.cards tr.now td { background: none; }
  .inc-tile.hero .inc-tile-value { font-size: 34px; }
  .inc-card { padding: 14px; }
  .inc-year-label { min-width: 0; flex: 1; }
}
@media (max-width: 600px) { .inc-table-wrap summary { padding: 10px 0; } }
