/* =========================================================
   maxedu — część aplikacyjna (rejestr produktowy)
   Oferty + filtry, szczegóły oferty + kalendarz, logowanie,
   panel użytkownika, czat.
   ========================================================= */

/* ---------- Lista ofert + filtry ---------- */
.offers-layout {
  display: grid; grid-template-columns: 280px 1fr;
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
  padding-bottom: clamp(32px, 5vw, 56px);
}
@media (max-width: 880px) { .offers-layout { grid-template-columns: 1fr; } }

.filters {
  /* bez sticky — filtry przewijają się razem z listą */
  background: var(--surface);
  border-radius: var(--r-l);
  padding: 22px;
  align-self: start;
}
.filters h2 { font-family: var(--f-sans); font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; }
.filters fieldset { border: none; margin: 0; padding: 16px 0 4px; border-top: 1px solid var(--line); margin-top: 14px; }
.filters fieldset:first-of-type { border-top: none; margin-top: 6px; padding-top: 8px; }
.filters legend { font-weight: 700; font-size: 0.9375rem; padding: 0 0 8px; }
.filters .check-row { margin-bottom: 7px; font-size: 0.9375rem; }
.filters .check-row span:not(.check-count) { flex: 1; display: inline-flex; align-items: center; gap: 6px; }
.filters .check-count { color: var(--muted); font-size: 0.8125rem; font-weight: 600; }

.price-inputs { display: flex; align-items: center; gap: 8px; }
.price-inputs input { padding: 8px 10px; }
.price-inputs span { color: var(--muted); }

.filters-clear {
  width: 100%; margin-top: 16px;
  background: none; border: none; cursor: pointer;
  color: var(--brand-strong); font-weight: 700; font-size: 0.9375rem;
  padding: 10px; border-radius: var(--r-s);
}
.filters-clear:hover { background: var(--brand-soft); }

/* przełącznik filtrów na mobile */
.filters-toggle { display: none; }
@media (max-width: 880px) {
  .filters-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    margin-bottom: 4px;
  }
  .filters { display: none; position: static; }
  .filters.open { display: block; }
}

/* pasek nad wynikami */
.results-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.results-count { margin: 0; font-weight: 700; font-size: 1.05rem; }
.results-count b { color: var(--brand-strong); }
.results-sort { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.results-sort label { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.results-sort select { width: auto; padding: 8px 34px 8px 12px; font-size: 0.9375rem; }

.active-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.active-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--brand-soft); color: var(--brand-strong);
  border: none; border-radius: var(--r-pill);
  padding: 5px 12px; font-size: 0.875rem; font-weight: 700; cursor: pointer;
}
.active-chip:hover { background: oklch(0.90 0.05 45); }
.active-chip svg { flex: none; }

/* wiersz oferty */
.offers-list { display: grid; gap: 14px; }
.offer-row {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 16px 20px; align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 20px 22px;
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.offer-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.offer-row .avatar { --av-size: 52px; width: 52px; height: 52px; }

.offer-main { min-width: 0; }
.offer-title {
  font-family: var(--f-serif); font-size: 1.22rem; font-weight: 600;
  line-height: 1.25; margin: 0 0 6px; letter-spacing: -0.005em;
}
.offer-title a { color: var(--ink); text-decoration: none; }
.offer-title a:hover { color: var(--brand-strong); }
.offer-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }
.offer-desc {
  color: var(--muted); font-size: 0.9375rem; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.offer-tutor { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 0.9375rem; font-weight: 600; }
.offer-tutor .avatar { --av-size: 26px; width: 26px; height: 26px; }

.offer-side { text-align: right; display: grid; gap: 10px; justify-items: end; }
.offer-price { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.offer-price small { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }

@media (max-width: 640px) {
  .offer-row { grid-template-columns: auto 1fr; }
  .offer-side { grid-column: 1 / -1; grid-template-columns: 1fr auto; text-align: left; justify-items: start; align-items: center; }
}

/* ---------- Szczegóły oferty ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.9375rem;
  margin-bottom: 4px;
}
.back-link:hover { color: var(--ink); }

.detail-layout {
  display: grid; grid-template-columns: 1fr 380px;
  gap: clamp(24px, 4vw, 44px);
  align-items: start;
  padding-bottom: clamp(32px, 5vw, 56px);
}
@media (max-width: 940px) { .detail-layout { grid-template-columns: 1fr; } }

.detail-title { font-size: clamp(1.7rem, 3.2vw, 2.3rem); margin: 8px 0 14px; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }

.detail-tutor {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border-radius: var(--r-l);
  padding: 20px 22px; margin-bottom: 28px;
}
.detail-tutor .avatar { --av-size: 64px; width: 64px; height: 64px; }
.detail-tutor h2 { font-size: 1.25rem; margin-bottom: 2px; }
.detail-tutor .tutor-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.detail-tutor .tutor-id { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.detail-tutor p { font-size: 0.9375rem; color: var(--muted); margin: 0; }
.detail-tutor .tutor-subjects { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.detail-desc h2 { font-size: 1.35rem; margin-bottom: 0.6em; }
.detail-desc p { color: var(--ink); }

.paused-banner {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--warn-soft); color: oklch(0.38 0.09 75);
  border-radius: var(--r-m); padding: 16px 18px;
  font-weight: 600; margin-bottom: 24px;
}

/* karta rezerwacji */
.booking-card {
  position: sticky; top: 84px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 24px;
  box-shadow: var(--shadow-1);
}
@media (max-width: 940px) { .booking-card { position: static; } }
.booking-card h2 { font-family: var(--f-sans); font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.booking-card .booking-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 18px; }

.cal-days {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px; margin-bottom: 16px;
}
.cal-day {
  border: 1.5px solid var(--line); background: var(--bg);
  border-radius: var(--r-s); cursor: pointer;
  padding: 7px 2px; text-align: center;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.cal-day .d-dow { display: block; font-size: 0.7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.cal-day .d-num { display: block; font-size: 1.02rem; font-weight: 700; }
.cal-day:hover:not(:disabled) { border-color: var(--accent); }
.cal-day[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.cal-day[aria-pressed="true"] .d-dow, .cal-day[aria-pressed="true"] .d-num { color: oklch(0.97 0.01 180); }
.cal-day:disabled { opacity: 0.38; cursor: not-allowed; }

/* nagłówek wyboru dnia + przełącznik pełnego kalendarza */
.day-picker-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.day-picker-head label { margin: 0; }
.link-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--brand-strong); font-weight: 700; font-size: 0.875rem;
  padding: 2px 4px; border-radius: var(--r-s);
}
.link-toggle:hover { background: var(--brand-soft); }

/* mini-kalendarz miesięczny w umawianiu */
.mini-cal { margin-top: 4px; }
.mini-cal-head { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px; }
.mini-cal-title {
  font-weight: 700; font-size: 0.95rem; min-width: 148px; text-align: center;
  text-transform: capitalize;
}
.mini-cal-nav {
  border: 1.5px solid var(--line-strong); background: var(--bg);
  border-radius: var(--r-s); cursor: pointer;
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem; line-height: 1; color: var(--ink);
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.mini-cal-nav:hover:not(:disabled) { border-color: var(--accent); background: var(--surface); }
.mini-cal-nav:disabled { opacity: 0.35; cursor: not-allowed; }
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mini-dow { font-size: 0.68rem; font-weight: 700; color: var(--muted); text-align: center; text-transform: uppercase; padding-bottom: 2px; }
.mini-day {
  aspect-ratio: 1; border: 1.5px solid transparent; background: var(--surface);
  border-radius: var(--r-s); cursor: pointer;
  font-weight: 600; font-size: 0.9rem; color: var(--ink);
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.mini-day.is-empty { visibility: hidden; }
.mini-day:hover:not(:disabled) { border-color: var(--accent); }
.mini-day[aria-pressed="true"] { background: var(--accent); color: oklch(0.97 0.01 180); border-color: var(--accent); }
.mini-day.has-free:not([aria-pressed="true"]) { box-shadow: inset 0 -3px 0 -1px var(--accent); }
.mini-day:disabled { background: transparent; color: var(--muted); opacity: 0.4; cursor: not-allowed; }

.slot-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.slot {
  border: 1.5px solid var(--line-strong); background: var(--bg);
  border-radius: var(--r-s); cursor: pointer;
  padding: 7px 13px; font-weight: 600; font-size: 0.9375rem;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.slot:hover { border-color: var(--accent); }
.slot[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: oklch(0.97 0.01 180); }

.slots-empty { color: var(--muted); font-size: 0.9375rem; padding: 6px 0 2px; }

.booking-summary {
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--r-m); padding: 12px 15px;
  font-weight: 700; font-size: 0.9375rem;
  margin: 14px 0;
}
.booking-info {
  background: var(--surface); border-radius: var(--r-m);
  padding: 14px 16px; font-size: 0.9375rem; color: var(--muted);
}
.booking-success { text-align: center; padding: 18px 4px 6px; }
.booking-success .dot {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--ok-soft); color: var(--ok);
  display: flex; align-items: center; justify-content: center;
}
.booking-success h3 { font-family: var(--f-sans); font-weight: 700; font-size: 1.15rem; }
.booking-success p { color: var(--muted); font-size: 0.9375rem; }

/* ---------- Logowanie / rejestracja ---------- */
.auth-wrap {
  max-width: 620px; margin-inline: auto;
  padding-block: clamp(28px, 5vw, 56px);
}
.auth-card { box-shadow: var(--shadow-1); }
.auth-tabs { display: flex; gap: 6px; background: var(--surface); border-radius: var(--r-pill); padding: 5px; margin-bottom: 28px; }
.auth-tab {
  flex: 1; border: none; background: transparent; cursor: pointer;
  padding: 11px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 1rem; color: var(--muted);
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.auth-tab[aria-selected="true"] { background: var(--ink); color: var(--dark-ink); }

.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
@media (max-width: 520px) { .role-cards { grid-template-columns: 1fr; } }
.role-card { position: relative; }
.role-card input { position: absolute; opacity: 0; inset: 0; }
.role-card label {
  display: block; cursor: pointer;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-m);
  padding: 16px 18px;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.role-card label b { display: block; font-size: 1.05rem; margin-bottom: 3px; }
.role-card label span { color: var(--muted); font-size: 0.875rem; }
.role-card input:checked + label { border-color: var(--brand); background: var(--brand-soft); }
.role-card input:checked + label b { color: var(--brand-strong); }
.role-card input:focus-visible + label { outline: 2px solid var(--brand-strong); outline-offset: 2px; }

.pass-rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 0.875rem; }
.pass-rules li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.pass-rules li::before {
  content: ''; width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--line-strong);
}
.pass-rules li.met { color: var(--ok); font-weight: 600; }
.pass-rules li.met::before {
  border-color: var(--ok); background: var(--ok);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.tutor-note {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--r-m); padding: 14px 16px;
  font-size: 0.9375rem; font-weight: 600;
  margin-bottom: 20px;
}
.tutor-note svg { flex: none; margin-top: 2px; }

.demo-hint { margin-top: 22px; font-size: 0.9375rem; }
.demo-hint summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.demo-hint summary:hover { color: var(--ink); }
.demo-hint table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.demo-hint td, .demo-hint th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); font-size: 0.875rem; }
.demo-hint th { color: var(--muted); font-weight: 700; }
.demo-hint code { background: var(--surface); padding: 2px 7px; border-radius: 5px; font-size: 0.85em; }
.demo-accounts tbody tr { cursor: pointer; transition: background var(--t-fast) var(--ease-out); }
.demo-accounts tbody tr:hover,
.demo-accounts tbody tr:focus-visible { background: var(--brand-soft); outline: none; }

.form-msg { border-radius: var(--r-m); padding: 13px 16px; font-weight: 600; font-size: 0.9375rem; margin-bottom: 18px; }
.form-msg-err { background: var(--err-soft); color: var(--err); }
.form-msg-ok { background: var(--ok-soft); color: var(--ok); }

.auth-subtitle { font-family: var(--font-display); font-size: 1.375rem; font-weight: 700; margin: 0 0 8px; text-wrap: balance; }
.auth-lead { margin: 0 0 20px; max-width: 42ch; }
.auth-forgot-row { margin: 8px 0 0; text-align: right; }
.auth-back-row { margin: 16px 0 0; text-align: center; }
.auth-text-link {
  background: none; border: none; padding: 0;
  font: inherit; font-size: 0.9375rem; font-weight: 600;
  color: var(--brand-strong); cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-text-link:hover { color: var(--brand); }
.forgot-demo { margin-top: 16px; padding: 14px 16px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); }
.forgot-demo .btn { margin-top: 10px; }

/* ---------- Panel użytkownika ---------- */
.panel-layout {
  display: grid; grid-template-columns: 250px 1fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  padding-bottom: clamp(32px, 5vw, 56px);
}
@media (max-width: 820px) { .panel-layout { grid-template-columns: 1fr; } }

.panel-nav {
  position: sticky; top: 80px;
  background: var(--surface); border-radius: var(--r-l);
  padding: 14px;
}
@media (max-width: 820px) { .panel-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; } }
.panel-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: var(--r-m);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.9857rem;
  transition: background var(--t-fast) var(--ease-out);
}
.panel-nav a:hover { background: oklch(0.94 0.008 40); }
.panel-nav a[aria-current="true"] { background: var(--ink); color: var(--dark-ink); }
.panel-nav a svg { flex: none; opacity: 0.75; }
.panel-nav .nav-badge {
  margin-left: auto; background: var(--brand); color: oklch(0.99 0.004 45);
  border-radius: var(--r-pill); font-size: 0.75rem; font-weight: 700;
  min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 6px;
}

.panel-user {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px 18px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 820px) { .panel-user { display: none; } }
.panel-user .avatar { --av-size: 44px; width: 44px; height: 44px; }
.panel-user b { display: block; font-size: 0.9857rem; line-height: 1.3; }
.panel-user div span { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }

.panel-section h1 { font-size: clamp(1.6rem, 3vw, 2rem); margin-bottom: 4px; }
.panel-section > .lead { color: var(--muted); margin-bottom: 26px; }

/* profil */
.avatar-edit { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.avatar-edit .avatar { --av-size: 84px; width: 84px; height: 84px; }
.avatar-edit-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.id-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border-radius: var(--r-pill);
  padding: 6px 14px; font-size: 0.875rem; font-weight: 700; color: var(--muted);
}
.id-badge b { color: var(--ink); }

.subject-toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.subject-toggle { position: relative; }
.subject-toggle input { position: absolute; opacity: 0; inset: 0; }
.subject-toggle label {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 15px; border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong);
  font-weight: 600; font-size: 0.9375rem;
  transition: all var(--t-fast) var(--ease-out);
}
.subject-toggle input:checked + label { background: var(--brand); border-color: var(--brand); color: oklch(0.99 0.004 45); }
.subject-toggle input:focus-visible + label { outline: 2px solid var(--brand-strong); outline-offset: 2px; }

.radio-row { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-row label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }

/* moje oferty */
.my-offer {
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px 18px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 18px 20px; margin-bottom: 12px;
}
.my-offer.paused { background: var(--surface); }
.my-offer h3 { font-size: 1.12rem; margin-bottom: 6px; }
.my-offer h3 a { color: var(--ink); text-decoration: none; }
.my-offer h3 a:hover { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; }
.my-offer .offer-meta { margin-bottom: 0; }
.my-offer-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .my-offer { grid-template-columns: 1fr; }
  .my-offer-actions { justify-content: flex-start; }
}
.icon-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid var(--line-strong); background: var(--bg);
  border-radius: var(--r-pill); cursor: pointer; text-decoration: none;
  padding: 7px 15px; font-weight: 600; font-size: 0.875rem; color: var(--ink);
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.icon-btn:hover { border-color: var(--ink); background: var(--surface); }
.icon-btn-danger { color: var(--err); border-color: oklch(0.85 0.06 27); }
.icon-btn-danger:hover { background: var(--err-soft); border-color: var(--err); }

.offer-form-wrap { margin-bottom: 26px; }
.profile-gate {
  border: 1.5px solid var(--warn); background: var(--warn-soft);
  border-radius: var(--r-l); padding: clamp(16px, 3vw, 22px); margin-bottom: 24px;
}
.profile-gate h3 {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-sans); font-weight: 700; font-size: 1.12rem; color: var(--warn); margin-bottom: 8px;
}
.profile-gate h3 svg { flex: none; }
.profile-gate p { margin-bottom: 10px; }
.profile-gate ul { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 5px; }
.profile-gate li { list-style: disc; }
.offer-form {
  border: 1.5px solid var(--brand); border-radius: var(--r-l);
  padding: clamp(18px, 3vw, 26px); margin-top: 14px;
}
.offer-form h3 { font-family: var(--f-sans); font-weight: 700; font-size: 1.15rem; }

/* kalendarz korepetytora (zajęcia + dyspozycje) */
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-title { font-weight: 700; font-size: 1.15rem; min-width: 172px; text-align: center; text-transform: capitalize; }
.cal-head .icon-btn { font-size: 1.2rem; line-height: 1; padding: 5px 14px; }
.cal-legend { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.cal-legend .lg-avail { background: var(--accent-soft); border: 1px solid var(--accent); }
.cal-legend .lg-weekly { background: transparent; border: 1.5px dashed var(--accent); }
.cal-legend .lg-book { background: var(--brand); border-radius: 3px; width: 12px; height: 12px; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow {
  font-size: 0.75rem; font-weight: 700; color: var(--muted);
  text-align: center; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 4px 0;
}
.cal-cell {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  min-height: 82px; padding: 6px 7px;
  border: 1.5px solid var(--line); border-radius: var(--r-s);
  background: var(--bg); cursor: pointer; text-align: left; font: inherit;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.cal-cell:hover { border-color: var(--accent); }
.cal-cell[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cal-cell.is-past { opacity: 0.5; }
.cal-cell.is-empty { visibility: hidden; }
.c-num { font-weight: 700; font-size: 0.9375rem; line-height: 1.4; }
.cal-cell.is-today .c-num {
  background: var(--brand); color: oklch(0.99 0.004 45);
  border-radius: var(--r-pill); padding: 0 8px; margin-left: -3px;
}
.c-range {
  font-size: 0.6875rem; font-weight: 700; white-space: nowrap;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 4px; padding: 1px 6px;
}
.c-range.from-weekly { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent-soft); outline: 1.5px dashed oklch(0.60 0.07 180); outline-offset: -1.5px; }
.c-more { font-size: 0.6875rem; color: var(--muted); font-weight: 700; }
/* kwadracik z liczbą zajęć danego dnia */
.c-count {
  margin-top: auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--brand); color: oklch(0.99 0.004 45);
  border-radius: 5px; font-size: 0.75rem; font-weight: 700; line-height: 1;
}
.c-count svg { opacity: 0.85; }

@media (max-width: 640px) {
  .cal-grid { gap: 4px; }
  .cal-cell { min-height: 52px; padding: 4px 5px; }
  .c-range, .c-more { display: none; }
  .cal-cell.has-avail::before { content: ''; display: block; width: 100%; height: 4px; border-radius: 2px; background: var(--accent); order: 2; }
  .c-count { order: 3; min-width: 18px; height: 18px; font-size: 0.7rem; }
}

.day-editor {
  margin-top: 18px;
  border: 1.5px solid var(--line); border-radius: var(--r-l);
  padding: clamp(18px, 3vw, 26px);
}
.day-editor h3 { font-size: 1.3rem; }
.day-editor h3::first-letter { text-transform: uppercase; }
.de-label { font-weight: 700; font-size: 0.9375rem; margin: 14px 0 8px; }
.day-bookings { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.day-bookings li {
  display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border-radius: var(--r-m);
  padding: 9px 13px; font-size: 0.9375rem;
}
.range-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.range-row input[type="time"] { width: 132px; }
.avail-remove {
  border: none; background: none; cursor: pointer;
  color: var(--muted); padding: 8px; border-radius: var(--r-s);
  display: inline-flex;
}
.avail-remove:hover { color: var(--err); background: var(--err-soft); }

/* zgłaszanie przedmiotu spoza listy */
.custom-subject { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.custom-subject input { flex: 1; min-width: 220px; }
.pending-subjects { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pending-subject {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--warn-soft); color: var(--warn);
  border-radius: var(--r-pill); padding: 6px 14px;
  font-size: 0.875rem; font-weight: 700;
}

/* rezerwacje */
.booking-item {
  border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 20px 22px; margin-bottom: 14px;
}
.booking-item-head { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.booking-item-head h3 { font-size: 1.15rem; margin: 0; flex: 1; min-width: 200px; }
.booking-when {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 0.9857rem; margin-bottom: 6px;
}
.booking-when svg { color: var(--accent); flex: none; }
.booking-person { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.booking-person .avatar { --av-size: 26px; width: 26px; height: 26px; }
.booking-note {
  background: var(--surface); border-radius: var(--r-m);
  padding: 12px 15px; font-size: 0.9375rem; color: var(--ink);
  margin-bottom: 12px;
}
.booking-note b { color: var(--muted); font-size: 0.8125rem; display: block; margin-bottom: 2px; }
.booking-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.turn-hint { display: block; font-size: 0.875rem; font-weight: 600; color: var(--muted); margin: 4px 0 2px; }
.turn-hint.turn-mine { color: var(--brand-strong); }
.turn-hint.turn-mine::before { content: '● '; }

/* karta zmiany hasła w profilu */
.password-card {
  margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line);
  max-width: 620px;
}
.password-card h2 { font-family: var(--f-sans); font-size: 1.15rem; font-weight: 700; margin-bottom: 14px; }

.proposal-box {
  border: 1.5px solid var(--accent); background: var(--accent-soft);
  border-radius: var(--r-m); padding: 14px 16px; margin-bottom: 12px;
  font-size: 0.9375rem;
}
.proposal-box b { color: var(--accent); }
.proposal-box p { margin: 6px 0 0; color: var(--ink); }

.propose-form {
  border-top: 1px solid var(--line); margin-top: 14px; padding-top: 16px;
}
.propose-form .form-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .propose-form .form-grid3 { grid-template-columns: 1fr; } }

/* link do spotkania */
.meet-link-row { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.meet-link-row input { flex: 1; min-width: 220px; }
.meet-locked {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface); border-radius: var(--r-m);
  padding: 12px 15px; font-size: 0.9375rem; color: var(--muted);
  margin-top: 12px;
}
.meet-locked svg { flex: none; margin-top: 2px; }
.meet-ready {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--ok-soft); color: var(--ok);
  border-radius: var(--r-m); padding: 11px 16px;
  font-weight: 700; font-size: 0.9375rem; text-decoration: none;
  margin-top: 12px;
}
.meet-ready:hover { background: oklch(0.90 0.07 155); color: var(--ok); }

/* Google Calendar — akcja przy rezerwacji (nie przy dyspozycyjności) */
.gcal-row { margin-top: 12px; }
.gcal-btn { margin-top: 0; }

/* czat */
.chat-box { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.chat-thread {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 320px; overflow-y: auto;
  padding: 4px 2px; margin-bottom: 12px;
}
.chat-msg { max-width: 78%; display: flex; flex-direction: column; }
.chat-msg .bubble {
  display: inline-block;             /* dymek dopasowany do treści, nie na całą szerokość */
  width: fit-content; max-width: 100%;
  padding: 9px 14px; border-radius: 16px;
  font-size: 0.9375rem; line-height: 1.45;
  background: var(--surface); color: var(--ink);
  word-break: break-word;
}
/* metadane pod dymkiem — ułożone pionowo, żeby nie zajmowały szerokości */
.chat-msg .msg-meta { display: flex; flex-direction: column; line-height: 1.25; margin-top: 3px; padding-inline: 6px; }
.chat-msg .msg-who { font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.chat-msg .msg-when { font-size: 0.68rem; color: var(--muted); }
.chat-mine { align-self: flex-end; align-items: flex-end; text-align: right; }
.chat-mine .bubble { background: var(--brand-soft); color: oklch(0.30 0.07 40); border-bottom-right-radius: 5px; }
.chat-theirs { align-self: flex-start; align-items: flex-start; }
.chat-theirs .bubble { border-bottom-left-radius: 5px; }
.chat-empty { color: var(--muted); font-size: 0.9375rem; text-align: center; padding: 10px; }

.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; }

/* ---------- Zakładka Wiadomości ---------- */
.messages-layout {
  display: grid; grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px; align-items: stretch;
  border: 1px solid var(--line); border-radius: var(--r-l);
  overflow: hidden; min-height: 460px;
}
@media (max-width: 720px) { .messages-layout { grid-template-columns: 1fr; } }

.conv-list { background: var(--surface); border-right: 1px solid var(--line); padding: 10px; overflow-y: auto; max-height: 560px; }
@media (max-width: 720px) { .conv-list { border-right: none; border-bottom: 1px solid var(--line); max-height: 260px; } }
/* kafelek rozmowy — flex (odporny na brak godziny/podglądu) */
.conv-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left; cursor: pointer;
  background: none; border: none; border-radius: var(--r-m);
  padding: 11px 12px; font: inherit; color: var(--ink);
  transition: background var(--t-fast) var(--ease-out);
}
.conv-item:hover { background: oklch(0.94 0.008 40); }
.conv-item[aria-current="true"] { background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.conv-item .avatar { --av-size: 40px; width: 40px; height: 40px; flex: none; }
.conv-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.conv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.conv-name {
  font-weight: 700; font-size: 0.95rem; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
}
.conv-time { font-size: 0.72rem; color: var(--muted); font-weight: 600; flex: none; white-space: nowrap; }
.conv-preview { font-size: 0.85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-preview-empty { font-style: italic; }
.conv-role { font-size: 0.72rem; font-weight: 700; color: var(--accent); }

.conv-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.conv-header {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.conv-header .avatar { --av-size: 40px; width: 40px; height: 40px; flex: none; }
.conv-header-id { min-width: 0; flex: 1; }
.conv-header-id b { display: inline-flex; align-items: center; gap: 6px; font-size: 1rem; }
.conv-header-id span { display: block; font-size: 0.8125rem; color: var(--muted); font-weight: 600; }

/* rozwijana lista wspólnych ofert w nagłówku rozmowy */
.shared-offers { margin-left: auto; position: relative; }
.shared-offers > summary {
  list-style: none; cursor: pointer;
  font-size: 0.875rem; font-weight: 700; color: var(--brand-strong);
  padding: 7px 12px; border-radius: var(--r-pill); border: 1.5px solid var(--line-strong);
  white-space: nowrap;
}
.shared-offers > summary::-webkit-details-marker { display: none; }
.shared-offers > summary::after { content: ' ▾'; }
.shared-offers[open] > summary::after { content: ' ▴'; }
.shared-offers > summary:hover { background: var(--brand-soft); border-color: var(--brand); }
.shared-offers-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: var(--z-dropdown);
  width: min(360px, 78vw); max-height: 300px; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-m);
  box-shadow: var(--shadow-2); padding: 8px;
}
.shared-group {
  font-size: 0.7rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin: 4px 0 6px; padding: 6px 10px;
  background: var(--surface); border-radius: var(--r-s);
}
.shared-group + .shared-offer { margin-top: 0; }
.shared-offers-list .shared-group:not(:first-child) { margin-top: 12px; }
.shared-offer {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center;
  padding: 9px 10px; border-radius: var(--r-s); text-decoration: none; color: var(--ink);
}
.shared-offer:hover { background: var(--surface); color: var(--ink); }
.shared-offer-when { font-size: 0.78rem; color: var(--muted); font-weight: 700; }
.shared-offer-title { grid-column: 1; font-size: 0.9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shared-offer .status-pill { grid-column: 2; grid-row: 1 / 3; }

.conv-body { flex: 1; display: flex; flex-direction: column; padding: 16px 18px; min-height: 0; }
.conv-body .chat-thread { flex: 1; max-height: 380px; }
.conv-empty-main {
  display: flex; align-items: center; justify-content: center; text-align: center;
  height: 100%; padding: 40px; color: var(--muted);
}

/* sekcja zakończonych */
.past-details { margin-top: 26px; }
.past-details summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 8px 0; }
.past-details summary:hover { color: var(--ink); }
.past-details .booking-item { opacity: 0.75; }

/* ---------- Oferty: weryfikacja i oceny ---------- */
.offer-avatar { position: relative; }
/* zweryfikowaną ofertę oznacza pełne obramowanie w kolorze akcentu + odznaka
   przy nazwisku — bez bocznego paska (side-stripe to sygnał AI-slopu). */
.offer-verified { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-soft); }
.offer-tutor { flex-wrap: wrap; }
.offer-tutor-name { font-weight: 600; }
.offer-tutor .rating-line { margin-left: 4px; }

/* filtr daty w panelu filtrów */
.date-filter { display: flex; align-items: center; gap: 6px; }
.date-filter input[type="date"] { flex: 1; }
.date-clear {
  border: 1.5px solid var(--line-strong); background: var(--bg); cursor: pointer;
  width: 38px; height: 38px; border-radius: var(--r-s); font-size: 1.2rem; line-height: 1; color: var(--muted); flex: none;
}
.date-clear:hover { border-color: var(--err); color: var(--err); background: var(--err-soft); }

/* ---------- Opinie na profilu korepetytora ---------- */
.tutor-rating { margin: 4px 0 8px; }
.report-offer-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: 0.875rem; padding: 4px 0;
}
.report-offer-btn:hover { color: var(--err); }

.reviews { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line); }
.reviews-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.reviews-head h2 { margin: 0; font-size: 1.5rem; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.reviews-avg { font-family: var(--f-sans); font-size: 1rem; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.reviews-list { display: grid; gap: 14px; }
.review { border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px 20px; }
.review-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.review-head .avatar { --av-size: 36px; width: 36px; height: 36px; }
.review-head b { font-size: 0.95rem; }
.review-stars { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.review-date { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.review-report {
  margin-left: auto; border: none; background: none; cursor: pointer;
  color: var(--muted); padding: 6px; border-radius: var(--r-s); display: inline-flex;
}
.review-report:hover { color: var(--err); background: var(--err-soft); }
.review-text { margin: 0; color: var(--ink); }

/* formularz wystawiania opinii */
.review-form { border: 1.5px solid var(--brand); border-radius: var(--r-l); padding: 20px; margin-bottom: 16px; }
.review-form label { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: 6px; }
.star-input { display: flex; gap: 4px; margin-bottom: 16px; }
.star-btn { border: none; background: none; cursor: pointer; padding: 2px; line-height: 0; }
.star-btn svg { fill: var(--line-strong); transition: fill var(--t-fast) var(--ease-out); }
.star-btn.on svg, .star-btn:hover svg { fill: oklch(0.72 0.15 75); }

/* ---------- Panel administratora ---------- */
.admin-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px 20px; margin-bottom: 12px;
}
.admin-item-col { flex-direction: column; align-items: stretch; }
.admin-item-main h3 { margin: 0 0 4px; font-size: 1.15rem; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-meta { font-size: 0.8125rem; color: var(--muted); font-weight: 600; margin: 0; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.verify-tutor { display: flex; align-items: center; gap: 14px; }
.verify-tutor .avatar { --av-size: 44px; width: 44px; height: 44px; }
.admin-review-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-review-text { margin: 0 0 12px; color: var(--ink); font-style: italic; }
.admin-reports { background: var(--surface); border-radius: var(--r-m); padding: 12px 14px; font-size: 0.9375rem; }
.admin-report-reason { display: inline-block; color: var(--ink); }
.admin-report-reason em { color: var(--muted); font-style: normal; }
.admin-reports b { display: block; font-size: 0.8125rem; color: var(--muted); margin-bottom: 4px; }
.admin-link { font-size: 0.875rem; font-weight: 700; }
.admin-item-col .admin-actions { justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.admin-item-main h3 a, .verify-tutor h3 a { color: var(--ink); text-decoration: none; }
.admin-item-main h3 a:hover { color: var(--brand-strong); }

/* ---------- Profil użytkownika ---------- */
.profile-card {
  display: flex; gap: clamp(16px, 3vw, 26px); align-items: center;
  background: var(--surface); border-radius: var(--r-l);
  padding: clamp(20px, 3vw, 30px); margin-bottom: 20px; flex-wrap: wrap;
}
.profile-avatar .avatar { --av-size: 96px; width: 96px; height: 96px; }
.profile-id h1 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin: 0 0 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.profile-rating { margin-top: 4px; }
.profile-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 24px;
  margin: 0 0 24px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-l);
}
.profile-facts div { margin: 0; }
.profile-facts dt { font-size: 0.8125rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 4px; }
.profile-facts dd { margin: 0; font-size: 0.9857rem; display: flex; gap: 6px; flex-wrap: wrap; }
.profile-bio { margin-bottom: 24px; }
.profile-bio h2, .profile-offers h2 { font-size: 1.35rem; margin-bottom: 0.5em; }
.profile-offers { margin-bottom: 8px; }
.profile-offers-list { display: grid; gap: 10px; }
.profile-offer {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px 18px;
  text-decoration: none; color: var(--ink);
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.profile-offer:hover { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.profile-offer-title { font-family: var(--f-serif); font-weight: 600; font-size: 1.08rem; }
.profile-offer-meta { display: flex; align-items: center; gap: 10px; }
.tutor-name-link { color: inherit; text-decoration: none; }
.tutor-name-link:hover { color: var(--brand-strong); text-decoration: underline; }
.profile-card { position: relative; }
.profile-report {
  align-self: flex-start; margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1.5px solid var(--line-strong); border-radius: var(--r-pill);
  cursor: pointer; color: var(--muted); font-weight: 600; font-size: 0.8125rem; padding: 6px 12px;
  transition: color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.profile-report:hover { color: var(--err); border-color: var(--err); }
@media (max-width: 560px) { .profile-report { margin-left: 0; } }

/* ID rezerwacji na karcie */
.booking-id {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--muted); background: var(--surface);
  padding: 2px 8px; border-radius: var(--r-s); font-variant-numeric: tabular-nums;
}

/* zakładka Opinie — lista osób do oceny */
.review-people { display: grid; gap: 12px; }
.review-person {
  display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px 20px;
}
.review-person-main { display: flex; align-items: center; gap: 14px; }
.review-person-main .avatar { --av-size: 44px; width: 44px; height: 44px; }
.review-person-main b { display: block; font-size: 1rem; }
.review-person-main b a { color: var(--ink); text-decoration: none; }
.review-person-main b a:hover { color: var(--brand-strong); }
.review-person-role { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.review-person-done { display: inline-flex; align-items: center; gap: 8px; }
.review-person-form { grid-column: 1 / -1; }
.review-person-form:not([hidden]) { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 2px; }
@media (max-width: 560px) { .review-person { grid-template-columns: 1fr; } .review-person-action { justify-self: start; } }

/* ---------- Kalendarz ucznia: kolory statusów ---------- */
.cal-legend .lg-ok, .cal-legend .lg-you, .cal-legend .lg-wait { width: 12px; height: 12px; border-radius: 3px; }
.cal-legend .lg-ok { background: var(--ok); }
.cal-legend .lg-you { background: var(--accent); }
.cal-legend .lg-wait { background: var(--warn); }
/* wpis w kalendarzu: kolorowa kropka wiodąca + tint tła (bez bocznego paska) */
.ev {
  display: flex; align-items: center; gap: 5px; width: 100%; margin-top: 3px;
  font-size: 0.68rem; font-weight: 700; line-height: 1.3;
  padding: 2px 6px; border-radius: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ev::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ev-ok { background: var(--ok-soft); color: var(--ok); }
.ev-you { background: var(--accent-soft); color: var(--accent); }
.ev-other { background: oklch(0.94 0.03 300); color: oklch(0.42 0.12 300); }
.ev-wait { background: var(--warn-soft); color: var(--warn); }
/* pozycja w dniu: kolorowa kropka statusu zamiast paska bocznego */
.day-booking { position: relative; }
@media (max-width: 640px) { .ev { display: none; } }

/* ---------- Załączniki w czacie ---------- */
.chat-form { align-items: center; }
.attach-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: var(--r-pill); cursor: pointer;
  color: var(--muted); border: 1.5px solid var(--line-strong);
  transition: color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.attach-btn:hover { color: var(--brand-strong); border-color: var(--brand); }
.attach-preview { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: var(--r-m); padding: 8px 12px; margin-bottom: 8px; }
.attach-preview img { width: 40px; height: 40px; object-fit: cover; border-radius: var(--r-s); }
.attach-file-ico { font-size: 1.3rem; }
.attach-name { flex: 1; min-width: 0; font-size: 0.875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-remove { border: none; background: none; cursor: pointer; font-size: 1.3rem; line-height: 1; color: var(--muted); }
.attach-remove:hover { color: var(--err); }
.msg-attach-img { display: block; margin-top: 4px; }
.msg-attach-img img { max-width: 220px; max-height: 220px; border-radius: var(--r-m); border: 1px solid var(--line); }
.msg-attach-file {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 8px 12px; font-size: 0.875rem; font-weight: 600; color: var(--ink); text-decoration: none;
}
.msg-attach-file:hover { border-color: var(--line-strong); color: var(--ink); }
.chat-mine .msg-attach-img, .chat-mine .msg-attach-file { margin-left: auto; }

/* =========================================================
   v4 — ulubione, płatności, potwierdzanie lekcji, spory,
   filtrowanie rezerwacji, sortowanie / edycja opinii.
   ========================================================= */

/* ---------- Ulubione (serduszko) ---------- */
.fav-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 42px; height: 42px; padding: 0; flex: none;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--bg); color: var(--muted); cursor: pointer;
  transition: color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.fav-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.fav-btn.is-fav { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.fav-btn svg { flex: none; }
.fav-btn-labeled { width: auto; padding: 0 18px; height: 42px; font-weight: 600; font-size: 0.9375rem; }
.fav-label { white-space: nowrap; }

.detail-actions { margin: 4px 0 18px; }

.fav-list { display: grid; gap: 14px; }
.fav-offer {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px 16px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px 18px;
}
.fav-offer-main h3 { font-family: var(--f-sans); font-size: 1.0625rem; font-weight: 700; margin: 0 0 8px; }
.fav-offer-main h3 a { color: var(--ink); text-decoration: none; }
.fav-offer-main h3 a:hover { color: var(--brand-strong); }
.fav-offer-tutor { font-size: 0.9375rem; color: var(--muted); font-weight: 600; margin-top: 8px; }
.fav-offer-side { display: grid; gap: 10px; justify-items: end; }
@media (max-width: 560px) {
  .fav-offer { grid-template-columns: auto 1fr; }
  .fav-offer-side { grid-column: 1 / -1; grid-auto-flow: column; justify-content: start; }
}

/* ---------- Plakietka weryfikacji: wersja duża (profil) ---------- */
.verified-badge-lg {
  gap: 6px; font-size: 0.95rem; padding: 5px 12px;
  background: var(--accent-soft); border-radius: var(--r-pill);
}
.profile-id h1 { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Zwijana zmiana hasła ---------- */
.password-collapse { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); max-width: 620px; }
.password-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  cursor: pointer; list-style: none;
  font-family: var(--f-sans); font-weight: 700; font-size: 1.1rem;
  padding: 6px 0;
}
.password-summary::-webkit-details-marker { display: none; }
.password-summary-label { display: inline-flex; align-items: center; gap: 8px; }
.password-summary-label svg { color: var(--muted); flex: none; }
.password-summary-side { display: inline-flex; align-items: center; gap: 10px; }
.password-summary-hint { font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.password-chevron { display: inline-flex; color: var(--muted); flex: none; transition: transform var(--t-med) var(--ease-out); }
.password-summary:hover .password-chevron { color: var(--ink); }
.password-collapse[open] > .password-summary .password-chevron { transform: rotate(180deg); }
.password-collapse[open] > .password-summary .password-summary-hint { display: none; }
.password-collapse .password-card { margin-top: 16px; padding-top: 0; border-top: none; }
.danger-collapse .password-summary-label,
.danger-collapse .password-summary-label svg { color: var(--err); }

/* ---------- Wyszukiwarki (rezerwacje + administrator) ---------- */
.search-field { position: relative; display: flex; align-items: center; }
.search-field svg { position: absolute; left: 15px; color: var(--muted); pointer-events: none; }
.search-field input {
  width: 100%; height: 46px; padding: 0 16px 0 44px;
  background: var(--surface); border: 1.5px solid transparent; border-radius: var(--r-pill);
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.search-field input:hover { background: oklch(0.955 0.006 40); }
.search-field input:focus { background: var(--bg); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-field input::-webkit-search-cancel-button { cursor: pointer; }

/* ---------- Rezerwacje: szukaj + filtr + sekcje ---------- */
.bookings-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.bookings-search { flex: 1; min-width: 220px; }
.bookings-tools select {
  width: auto; min-width: 190px; height: 46px; padding: 0 40px 0 16px;
  background-color: var(--surface); border-color: transparent; border-radius: var(--r-pill);
}
.bookings-tools select:hover { background-color: oklch(0.955 0.006 40); }
.bookings-tools .icon-btn { height: 46px; }
.bookings-subhead { font-family: var(--f-sans); font-size: 1.05rem; font-weight: 700; margin: 24px 0 12px; }
.settle-block { margin-bottom: 6px; }
.settle-block .booking-item { border-color: var(--warn); }
.booking-flash { animation: bookingFlash 2.2s var(--ease-out); }
@keyframes bookingFlash {
  0%, 30% { box-shadow: 0 0 0 3px var(--brand-soft); border-color: var(--brand); }
  100% { box-shadow: none; }
}

/* ---------- Płatność ---------- */
.pay-box {
  border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 14px 16px; margin-top: 12px; background: var(--surface);
}
.pay-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pay-head svg { color: var(--accent); flex: none; }
.pay-head b { font-size: 0.9375rem; }
.pay-amounts { display: flex; flex-direction: column; gap: 3px; font-size: 0.9375rem; }
.pay-net { color: var(--muted); }
.pay-net b { color: var(--ink); }
.pay-btn { margin-top: 12px; }

/* ---------- Rozliczenie / potwierdzenie odbycia ---------- */
.confirm-box {
  border: 1.5px solid var(--warn); background: var(--warn-soft);
  border-radius: var(--r-m); padding: 14px 16px; margin-top: 12px;
}
.confirm-box > b { color: var(--warn); }
.settle-note {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: var(--r-m); padding: 12px 15px; margin-top: 12px; font-size: 0.9375rem;
}
.settle-note svg { flex: none; margin-top: 1px; }
.settle-ok { background: var(--ok-soft); color: var(--ok); }
.settle-ok b { color: var(--ok); }

/* ---------- Spór (widok użytkownika i wspólne elementy czatu) ---------- */
.dispute-box {
  border: 1.5px solid var(--err); background: var(--err-soft);
  border-radius: var(--r-m); padding: 14px 16px; margin-top: 12px;
}
.dispute-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.dispute-head svg { color: var(--err); flex: none; }
.dispute-head b { font-size: 0.9857rem; }
.dispute-box .hint { color: var(--ink); }
.dispute-chat { margin-top: 12px; background: var(--bg); border-radius: var(--r-m); padding: 12px; }
.dispute-chat-label { font-size: 0.8125rem; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.dispute-thread { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; max-height: 260px; overflow-y: auto; }
.dispute-msg { font-size: 0.9375rem; padding: 8px 12px; border-radius: var(--r-m); max-width: 88%; }
.dispute-who { display: block; font-size: 0.72rem; font-weight: 700; opacity: 0.75; margin-bottom: 2px; }
.dispute-mine { align-self: flex-end; background: var(--brand); color: oklch(0.99 0.004 45); }
.dispute-admin { align-self: flex-start; background: var(--surface); color: var(--ink); }
.dispute-mine .msg-attach-img img, .dispute-mine .msg-attach-file { border-color: oklch(0.99 0.004 45 / 0.35); }
.dispute-mine .msg-attach-file { background: oklch(0.99 0.004 45 / 0.16); color: oklch(0.99 0.004 45); }
.dispute-compose { margin-top: 2px; }
.dispute-form { display: flex; gap: 8px; align-items: center; }
.dispute-form input[type="text"] { flex: 1; min-width: 0; }
.dispute-form .attach-btn { width: 40px; height: 40px; }
.dispute-form .btn { flex: none; }
.dispute-msg .msg-attach-img { margin-top: 6px; }
.dispute-msg .msg-attach-img img { max-width: min(200px, 100%); max-height: 180px; }
.dispute-msg .msg-attach-file { margin-top: 6px; max-width: 100%; }

/* ---------- Spory (panel administratora) ---------- */
.dispute-admin-card .dispute-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0; }
@media (max-width: 700px) { .dispute-admin-card .dispute-cols { grid-template-columns: 1fr; } }
.dispute-col { border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px; }
.dispute-col-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.dispute-col-head .avatar { --av-size: 30px; width: 30px; height: 30px; }
.dispute-col-head b a { color: var(--ink); text-decoration: none; }
.dispute-col-head b a:hover { color: var(--brand-strong); }
.admin-dispute-thread { background: var(--surface); border-radius: var(--r-s); padding: 10px; }
.dispute-verdict { border-top: 1px solid var(--line); padding-top: 14px; }
.dispute-verdict > b { display: block; margin-bottom: 10px; }

/* ---------- Wyszukiwarka administratora (po ID) ---------- */
.admin-search { margin-bottom: 20px; max-width: 520px; }

/* ---------- Opinie: sortowanie, edycja, wymagane gwiazdki ---------- */
.reviews-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.reviews-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--muted); font-weight: 600; }
.reviews-sort select { width: auto; min-width: 175px; padding: 8px 12px; }
.reviews-sort-label { white-space: nowrap; }
.review-edit {
  margin-left: auto; border: 1px solid var(--line-strong); background: var(--bg); cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: 0.8125rem;
  padding: 5px 12px; border-radius: var(--r-pill);
  transition: color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.review-edit:hover { color: var(--brand-strong); border-color: var(--brand); }

/* ---------- Kwota w potwierdzeniu rezerwacji ---------- */
.booking-amount {
  display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap;
  margin: 12px 0; background: var(--brand-soft); border-radius: var(--r-m); padding: 12px 16px;
}
.booking-amount span { font-size: 0.875rem; color: var(--brand-strong); font-weight: 600; }
.booking-amount b { font-size: 1.2rem; color: var(--brand-strong); }

/* ---------- Podgląd prowizji przy tworzeniu oferty ---------- */
.rate-breakdown {
  margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface); padding: 10px 14px; max-width: 340px;
}
.rate-bd-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 0.9375rem; padding: 3px 0; }
.rate-bd-row span { color: var(--muted); }
.rate-bd-row b { color: var(--ink); }
.rate-bd-net { border-top: 1px solid var(--line); margin-top: 3px; padding-top: 7px; }
.rate-bd-net span { color: var(--ok); font-weight: 600; }
.rate-bd-net b { color: var(--ok); }
.rate-bd-com span:last-child { color: var(--muted); }

/* =========================================================
   v5 — wyszukiwarka przy sortowaniu, kolejność sekcji oferty,
   krok weryfikacji rezerwacji, wyraźniejsze separatory.
   ========================================================= */

/* ---------- Wyszukiwarka obok sortowania (lista ofert) ---------- */
.results-search { flex: 1 1 260px; min-width: 200px; }
.results-bar .results-sort { margin-left: 0; }
@media (max-width: 560px) { .results-search { flex-basis: 100%; } }

/* ---------- Szczegóły oferty: umawianie PRZED opiniami ---------- */
/* Desktop: opis w kol. 1 / wiersz 1, opinie w kol. 1 / wiersz 2, karta umawiania w kol. 2. */
.detail-layout > #detail-main { grid-column: 1; grid-row: 1; }
.detail-layout > #booking-aside { grid-column: 2; grid-row: 1 / span 2; }
.detail-layout > .reviews-section { grid-column: 1; grid-row: 2; margin-top: 4px; }
/* Telefon: jedna kolumna, kolejność źródłowa = opis → umawianie → opinie. */
@media (max-width: 940px) {
  .detail-layout > #detail-main,
  .detail-layout > #booking-aside,
  .detail-layout > .reviews-section { grid-column: 1; grid-row: auto; }
}

/* ---------- Większy nagłówek karty umawiania ---------- */
.booking-card h2 { font-size: 1.5rem; letter-spacing: -0.01em; }

/* ---------- Krok „Sprawdź szczegóły" przed rezerwacją ---------- */
.booking-review { margin: 6px 0 14px; }
.booking-review > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.booking-review > div:last-child { border-bottom: none; }
.booking-review dt { color: var(--muted); font-size: 0.875rem; font-weight: 600; flex: none; }
.booking-review dd { margin: 0; text-align: right; font-weight: 600; }

/* ---------- Wyraźniejsze separatory sekcji rezerwacji (jak „wspólne oferty") ---------- */
.bookings-subhead {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-sans); font-size: 0.78rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 7px 15px; margin: 28px 0 14px;
}
.bookings-subhead::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.bookings-subhead.sub-settle { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.bookings-subhead.sub-settle::before { background: var(--warn); }
.bookings-subhead.sub-upcoming { color: var(--brand-strong); background: var(--brand-soft); border-color: transparent; }
.bookings-subhead.sub-upcoming::before { background: var(--brand); }

.past-details { margin-top: 28px; }
.past-details > summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-family: var(--f-sans); font-size: 0.78rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 7px 15px;
}
.past-details > summary::-webkit-details-marker { display: none; }
.past-details > summary::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.past-details > summary::after { content: '▾'; margin-left: 2px; font-size: 0.7rem; }
.past-details[open] > summary::after { content: '▴'; }
.past-details > summary:hover { color: var(--ink); border-color: var(--line-strong); }
