/* tutors.css — каталог репетиторов и страница репетитора (публичные, индексируются).
   Поверх site.css (токены, шапка, подвал). Референсы: Preply/Profi.ru — профиль
   с карточкой записи сбоку; Peerlist/Substack — список людей строками. */
:root { --soft2: #eceff0; --accent-soft: rgba(13,106,79,.10); --danger: #b42318; --warn-ink: #5c3f0b; --sidebar-w: 252px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --soft2: #1c232a; --accent-soft: rgba(61,211,156,.14); --danger: #ff8a7a; --warn-ink: #f3dca0; } }
:root[data-theme="dark"] { --soft2: #1c232a; --accent-soft: rgba(61,211,156,.14); --danger: #ff8a7a; --warn-ink: #f3dca0; }

[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.btn { min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1.5px solid transparent; font: 700 15px/1 var(--f-body); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--soft); color: var(--ink); }
.btn:disabled { opacity: .6; cursor: default; }

/* вошедшим — меню кабинета вместо публичной шапки */
.page { min-height: 100dvh; display: flex; flex-direction: column; }
.page > main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px var(--gutter) 64px; }
html.in-app .site-nav, html.in-app .site-footer { display: none; }
html.in-app .page { margin-left: var(--sidebar-w); transition: margin-left .2s ease; }
/* в кабинете — как остальные страницы: по левому краю, до 1200 px */
html.in-app .page > main { max-width: 1200px; margin: 0; padding: 24px 24px 64px; }
html.in-app .page.sb-collapsed > main { padding-left: 68px; }
@media (max-width: 900px) { html.in-app .page { margin-left: 0; } html.in-app .page > main { padding-top: 72px; } html.in-app .page.sb-collapsed > main { padding-left: var(--gutter); } }
.nav-cat { text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 8px; color: var(--ink); }
.nav-reg { min-height: 40px; padding: 0 14px; font-size: 14px; }
@media (max-width: 520px) { .nav-cat { display: none; } }

html.in-app .crumbs { display: none; }
.app-kicker { display: none; margin: 0 0 10px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
html.in-app .app-kicker { display: block; }  /* в кабинете путь есть в меню; крошки — для гостей и поисковиков */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

/* ── каталог ── */
.cat-head h1 { font: 800 clamp(26px, 4vw, 40px)/1.15 var(--f-display); margin: 0 0 8px; text-wrap: balance; }
.cat-sub { color: var(--muted); margin: 0 0 18px; max-width: 64ch; }
html.in-app .cat-head h1 { font-size: 26px; line-height: 1.2; margin-top: 4px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; }
.chip:hover { background: var(--soft); color: var(--ink); }
.chip b { font-weight: 500; font-size: 12px; color: var(--muted); }
.chip[aria-current="page"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
button.chip { background: none; font-family: inherit; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cat-exams { margin-top: -4px; }
.cat-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 16px; }
.cat-q { flex: 1 1 260px; max-width: 420px; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--muted); }
.cat-q:focus-within { border-color: var(--accent); }
.cat-q input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 15px; }
.cat-chk { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; min-height: 44px; cursor: pointer; }
.cat-chk input { width: 18px; height: 18px; accent-color: var(--accent); }
.cat-sel { min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; }
.cat-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; }
.tc + .tc { border-top: 1px solid var(--line); }
.tc-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px 18px; color: var(--ink); text-decoration: none; }
.tc-link:hover { background: var(--soft); color: var(--ink); }
.tc:first-child .tc-link { border-radius: 14px 14px 0 0; }
.tc:last-child .tc-link { border-radius: 0 0 14px 14px; }
.tc-ava, .tp-ava { border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font: 700 18px var(--f-body); overflow: hidden; flex-shrink: 0; }
.tc-ava { width: 56px; height: 56px; }
.tc-ava img, .tp-ava img { width: 100%; height: 100%; object-fit: cover; }
.tc-body { display: grid; gap: 3px; min-width: 0; }
.tc-name { font-weight: 700; font-size: 17px; }
/* «Проверен» — документ об образовании проверен модератором (PRODUCT-19) */
.tc-verified { display: inline-flex; align-items: center; gap: 4px; margin: 2px 0 4px; font-size: 13px; font-weight: 600; color: var(--accent); }
.tc-verified .i { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tc-role { font-size: 15px; }
.tc-meta { font-size: 14px; color: var(--muted); }
.tc-bio { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.tc-side { display: grid; justify-items: end; gap: 6px; text-align: right; white-space: nowrap; }
.tc-price { font-size: 14px; color: var(--muted); }
.tc-price b { color: var(--ink); font-size: 16px; }
.tc-closed { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--soft2); border-radius: 999px; padding: 3px 10px; }
.cat-empty { text-align: center; color: var(--muted); padding: 40px 16px; border: 1px dashed var(--line); border-radius: 14px; }
@media (max-width: 640px) {
  .tc-link { grid-template-columns: auto minmax(0, 1fr); padding: 14px; }
  .tc-side { grid-column: 2; justify-items: start; text-align: left; display: flex; gap: 10px; align-items: center; }
  .tc-ava { width: 48px; height: 48px; font-size: 16px; }
}

/* ── страница репетитора ── */
.tp { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.tp-hero { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 8px; }
.tp-ava { width: 96px; height: 96px; font-size: 30px; }
.tp-id h1 { font: 800 clamp(24px, 3.4vw, 34px)/1.15 var(--f-display); margin: 4px 0 6px; overflow-wrap: anywhere; text-wrap: balance; }
.tp-role { margin: 0 0 6px; font-size: 17px; }
.tp-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 15px; margin: 0 0 10px; }
.tp-rate { display: inline-flex; align-items: center; gap: 4px; }
.tp-rate svg { width: 16px; height: 16px; fill: var(--marker); stroke: var(--warn-ink); stroke-width: 1.2; }
.tp-rate b { color: var(--ink); }
.tp-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tp-tags li { padding: 4px 12px; border-radius: 999px; background: var(--tag-bg); color: var(--accent); font-size: 14px; font-weight: 600; }
.tp-sec { padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--line); }
.tp-sec h2 { font: 700 20px/1.3 var(--f-body); margin: 0 0 12px; display: flex; align-items: baseline; gap: 8px; }
.tp-sec h2 .cnt { font-size: 14px; color: var(--muted); font-weight: 500; }
.tp-bio p { margin: 0 0 10px; white-space: pre-line; overflow-wrap: anywhere; }
.tp-note { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.tp-prices { width: 100%; border-collapse: collapse; }
.tp-prices th, .tp-prices td { padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.tp-prices td { text-align: right; font-weight: 600; white-space: nowrap; }
.tp-prices small { font-weight: 400; color: var(--muted); font-family: var(--f-body); }
.tp-prices tr:last-child th, .tp-prices tr:last-child td { border-bottom: 0; }
.tp-slots { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; }
.tp-slots li { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; min-height: 56px; }
.tp-slots li + li { border-top: 1px solid var(--line); }
.tp-slots .d { font-weight: 700; width: 28px; }
.tp-slots .t { font-weight: 600; }
.tp-slots .m { color: var(--muted); font-size: 14px; flex: 1; }
.tp-slot { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 600 14px var(--f-body); cursor: pointer; }
.tp-slot:hover:not(:disabled) { background: var(--soft); }
.tp-slot:disabled { opacity: .5; cursor: default; }
.tp-bars { display: grid; gap: 8px; margin-bottom: 16px; max-width: 460px; }
.tp-bar { display: grid; grid-template-columns: 140px minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: 14px; }
.tp-bar .tr { height: 6px; border-radius: 3px; background: var(--soft2); overflow: hidden; }
.tp-bar .tr span { display: block; height: 100%; background: var(--accent); }
.tp-bar b { text-align: right; }
.tp-revs { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.tp-rev { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tp-rev .h { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 14px; }
.tp-rev .h time { color: var(--muted); margin-left: auto; }
.tp-rev p { margin: 6px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.tp-side { position: sticky; top: 88px; }
html.in-app .tp-side { top: 24px; }
.tp-card { border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: grid; gap: 12px; background: var(--bg); }
.tp-st { justify-self: start; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--soft2); color: var(--muted); }
.tp-st--open { background: var(--accent-soft); color: var(--accent); }
.tp-price { margin: 0; color: var(--muted); font-size: 15px; }
.tp-price b { color: var(--ink); font-size: 22px; }
.tp-actions { display: grid; gap: 8px; }
.tp-actions .btn { width: 100%; }
.tp-state { font-size: 15px; padding: 10px 12px; border-radius: 10px; background: var(--soft); }
.tp-state b { display: block; }
.tp-state small { color: var(--muted); font-size: 13px; }
.tp-link { background: none; border: 0; padding: 0; min-height: 32px; color: var(--muted); font: 600 14px var(--f-body); text-decoration: underline; cursor: pointer; justify-self: start; }
.tp-link:hover { color: var(--ink); }
.tp-hint { margin: 0; font-size: 13px; }
.tp-404 { text-align: center; padding: 64px 16px; }
.tp-404 h1 { font: 800 28px var(--f-display); margin: 0 0 10px; }
.tp-404 p { color: var(--muted); margin: 0 0 20px; }
@media (max-width: 900px) {
  .tp { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tp-side { position: sticky; top: auto; bottom: 0; order: 2; margin: 24px calc(-1 * var(--gutter)) 0; z-index: 5; }
  .tp-card { border-radius: 16px 16px 0 0; border-width: 1px 0 0; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom, 0px)); grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; box-shadow: 0 -6px 20px var(--shadow); }
  .tp-card .tp-st, .tp-card .tp-hint { display: none; }
  .tp-actions { grid-auto-flow: column; }
  .tp-actions .btn { width: auto; }
  .tp-actions .btn-ghost { display: none; }
  .tp-price b { font-size: 18px; }
  /* «Запрос отправлен» и другие состояния: цену прячем, состояние — на всю ширину */
  .tp-card.has-state { grid-template-columns: minmax(0, 1fr); }
  .tp-card.has-state .tp-price { display: none; }
  .tp-card.has-state .tp-actions { grid-auto-flow: row; }
  .tp-card.has-state .tp-state { padding: 8px 12px; font-size: 14px; }
}
@media (max-width: 520px) {
  .tp-hero { gap: 14px; }
  .tp-ava { width: 72px; height: 72px; font-size: 24px; }
  .tp-bar { grid-template-columns: 110px minmax(0, 1fr) 32px; }
  .tp-slots .m { display: none; }
}

/* диалоги */
.dlg-ov { position: fixed; inset: 0; z-index: 400; background: rgba(10,14,20,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dlg { background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 480px; max-height: 90dvh; overflow: auto; box-shadow: 0 20px 50px var(--shadow); }
.dlg-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 0; }
.dlg-h h3 { font: 800 18px var(--f-display); margin: 0; }
.dlg-x { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 10px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.dlg-x:hover { background: var(--soft); color: var(--ink); }
.dlg-b { padding: 12px 20px 4px; display: grid; gap: 14px; }
.dlg-f { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.dlg-f select, .dlg-f textarea, .dlg-f input { min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: 400 15px var(--f-body); width: 100%; }
.dlg-f textarea { resize: vertical; min-height: 96px; }
.dlg-err { color: var(--danger); font-size: 14px; min-height: 1.3em; margin: 0; }
.dlg-ft { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 20px 18px; }
.rv-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; font-size: 15px; color: var(--ink); font-weight: 400; }
.rv-row input { grid-column: 1 / -1; accent-color: var(--accent); min-height: 32px; }
@media (max-width: 640px) {
  .dlg-ov { align-items: flex-end; padding: 0; }
  .dlg { max-width: none; border-radius: 16px 16px 0 0; }
  .dlg-ft { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  .dlg-ft .btn { flex: 1; }
}
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); width: max-content; z-index: 500; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 15px; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px var(--shadow); }
@media (max-width: 600px) { .toast { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); font-size: 14px; padding: 10px 14px; border-radius: 10px; } }
@media (prefers-reduced-motion: reduce) { .btn, .tc-link { transition: none; } }
