/* Tutor search (/tuition/find-tutors and the landing pages that share Views/Tuition/Search.cshtml).
   Builds on tuition.css (.tu variables, buttons, pager). Prefix ts-. Light + dark. */
.ts { --ts-h1: #064e4a; --ts-h2: #0d9488; --ts-h3: #155e75; background: var(--tu-soft); overflow-x: clip; }
html[data-theme="dark"] .ts { --ts-h1: #041f1e; --ts-h2: #0b4f4a; --ts-h3: #0c2f3d; background: transparent; color-scheme: dark; }
.ts h1, .ts h2, .ts h3 { font-family: 'Montserrat', 'Montserrat Fallback', sans-serif; }

/* ---------------- header + search bar (the bar hangs over the band's lower edge) ---------------- */
.ts-hero { position: relative; padding: 92px 0 0; color: #fff; isolation: isolate; }
.ts-hero::before { content: ''; position: absolute; inset: 0 0 34px; z-index: -1;
    background: radial-gradient(700px 320px at 90% 0, rgba(45, 212, 191, .3), transparent 60%), linear-gradient(135deg, var(--ts-h1), var(--ts-h2) 55%, var(--ts-h3)); }
.ts-hero .tu-wrap { padding-top: 0; padding-bottom: 0; }
.ts-hero .tu-crumbs { margin: 0 0 8px; color: rgba(255, 255, 255, .8); }
.ts-hero h1 { margin: 0 0 4px; color: #fff; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); line-height: 1.18; font-weight: 800; }
.ts-lead { margin: 0 0 14px; max-width: 720px; color: rgba(255, 255, 255, .88) !important; font-size: .95rem; line-height: 1.5; }
.ts-modes { display: inline-flex; gap: 4px; padding: 5px 5px 0; border-radius: 14px 14px 0 0; background: rgba(255, 255, 255, .14); }
.ts-modes label { margin: 0; cursor: pointer; }
.ts-modes input, .ts-pills input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ts-modes span { display: block; padding: 7px 16px; border-radius: 10px 10px 0 0; font-size: .84rem; font-weight: 700; color: rgba(255, 255, 255, .9); white-space: nowrap; }
.ts-modes input:checked + span { background: var(--tu-card); color: var(--tu-brand); }
.ts-modes input:focus-visible + span { outline: 3px solid #fde68a; outline-offset: -3px; }
.ts-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; padding: 6px; border-radius: 0 18px 18px 18px; background: var(--tu-card); color: var(--tu-ink);
    border: 1px solid var(--tu-line); border-top: 0; box-shadow: 0 22px 44px -26px rgba(2, 6, 23, .55); }
.ts-go { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; padding: 0 28px; border: 0; border-radius: 12px; cursor: pointer;
    background: linear-gradient(135deg, #c2410c, #b45309); color: #fff; font-weight: 800; font-size: 1rem; white-space: nowrap; }
.ts-go:hover { filter: brightness(1.08); }
.ts-go:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }

/* ---------------- layout + filters ---------------- */
.ts-layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 20px; align-items: start; padding-top: 22px; padding-bottom: 20px; }
.ts-open, .ts-backdrop, .ts-close { display: none; }
.ts-filters { position: sticky; top: 92px; display: flex; flex-direction: column; max-height: calc(100vh - 104px); border-radius: 18px; background: var(--tu-card); border: 1px solid var(--tu-line); overflow: hidden; }
.ts-filters-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--tu-line); }
.ts-filters-head h2 { margin: 0 auto 0 0; font-size: 1rem; font-weight: 800; }
.ts-filters-head a { font-size: .82rem; font-weight: 700; color: var(--tu-brand) !important; text-decoration: none; }
.ts-filters-body { display: grid; gap: 16px; padding: 16px; overflow-y: auto; scrollbar-width: thin; }
.ts-filters-foot { padding: 12px 16px; border-top: 1px solid var(--tu-line); }
.ts-filters-foot .tu-btn { width: 100%; }
.ts-group, .ts-sub { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 10px; }
.ts-group + .ts-group { padding-top: 16px; border-top: 1px solid var(--tu-line); }
.ts-group legend, .ts-sub legend { float: left; width: 100%; margin: 0; padding: 0; font-size: .84rem; font-weight: 800; color: var(--tu-ink); }
.ts-group legend + *, .ts-sub legend + * { clear: both; }
.ts-sub legend { font-size: .78rem; color: var(--tu-ink2); }
.ts-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ts-pills label { margin: 0; cursor: pointer; position: relative; }
.ts-pills span { display: block; padding: 6px 11px; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--tu-ink2); background: var(--tu-soft); border: 1px solid var(--tu-line); white-space: nowrap; }
.ts-pills label:hover span { border-color: var(--tu-brand); }
.ts-pills input:checked + span { background: #0f766e; border-color: #0f766e; color: #fff; }
.ts-pills input:focus-visible + span { outline: 3px solid #2563eb; outline-offset: 2px; }
.ts-switch { display: flex; align-items: center; gap: 12px; margin: 0; cursor: pointer; position: relative; }
.ts-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ts-switch-ui { flex: none; width: 40px; height: 24px; border-radius: 999px; background: #94a3b8; position: relative; transition: background .15s; }
.ts-switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.ts-switch input:checked + .ts-switch-ui { background: #0f766e; }
.ts-switch input:checked + .ts-switch-ui::after { transform: translateX(16px); }
.ts-switch input:focus-visible + .ts-switch-ui { outline: 3px solid #2563eb; outline-offset: 2px; }
.ts-switch b { display: block; font-size: .88rem; }
.ts-switch small { display: block; font-size: .76rem; color: var(--tu-ink2); }
.ts-more summary { cursor: pointer; font-size: .84rem; font-weight: 800; color: var(--tu-brand); }
.ts-more[open] > * + * { margin-top: 12px; }

/* ---------------- results ---------------- */
.ts-results { min-width: 0; }
.ts-head { min-height: 42px; }
.ts-head .tu-res-count b { font-size: 1.15rem; }
.ts-sort select { background: var(--tu-card); }
.ts-quick { display: flex; gap: 8px; margin: 0 0 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ts-quick::-webkit-scrollbar { display: none; }
.ts-quick button { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--tu-line); background: var(--tu-card); color: var(--tu-ink); font-size: .82rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s; }
.ts-quick button i { color: var(--tu-brand); }
.ts-quick button:hover { border-color: var(--tu-brand); }
.ts-quick button[aria-pressed="true"] { background: #0f766e; border-color: #0f766e; color: #fff; }
.ts-quick button[aria-pressed="true"] i { color: #fff; }
.ts-quick button:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.ts-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.ts-chips a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; text-decoration: none !important; color: #0f766e !important; background: rgba(13, 148, 136, .12); }
.ts-chips a:hover { background: rgba(13, 148, 136, .22); }
.ts-chips .is-clear { background: none; color: var(--tu-ink2) !important; text-decoration: underline !important; }
html[data-theme="dark"] .ts-chips a:not(.is-clear) { color: #5eead4 !important; }
.ts-list { display: grid; gap: 12px; }
.ts-results.is-loading .ts-list { opacity: .55; transition: opacity .15s; }
.ts-row { position: relative; display: grid; grid-template-columns: 88px minmax(0, 1fr) 190px; gap: 18px; padding: 18px; border-radius: 18px; background: var(--tu-card); border: 1px solid var(--tu-line); transition: border-color .15s, box-shadow .15s, transform .15s; }
.ts-row:hover { border-color: rgba(13, 148, 136, .55); box-shadow: 0 20px 36px -26px rgba(15, 23, 42, .55); }
.ts-row.is-featured { border-color: rgba(245, 158, 11, .65); background: linear-gradient(180deg, rgba(254, 243, 199, .45), transparent 70%), var(--tu-card); }
html[data-theme="dark"] .ts-row.is-featured { background: linear-gradient(180deg, rgba(245, 158, 11, .09), transparent 70%), var(--tu-card); }
.ts-photo { position: relative; display: block; width: 88px; height: 88px; text-decoration: none !important; }
.ts-photo img { display: block; width: 88px; height: 88px; border-radius: 20px; object-fit: cover; background: var(--tu-soft); }
.ts-initials { display: flex; align-items: center; justify-content: center; width: 88px; height: 88px; border-radius: 20px; color: #fff; font: 800 1.7rem/1 'Montserrat', 'Montserrat Fallback', sans-serif; letter-spacing: .02em;
    background: var(--c, #0f766e); background: linear-gradient(135deg, var(--c, #0f766e), color-mix(in srgb, var(--c, #0f766e) 70%, #000)); }
.ts-photo-tick { position: absolute; right: -4px; bottom: -4px; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .78rem; color: #fff; background: #0284c7; border: 3px solid var(--tu-card); }
.ts-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ts-name h3 { margin: 0; font-size: 1.08rem; font-weight: 800; line-height: 1.3; }
.ts-name h3 a { color: var(--tu-ink) !important; text-decoration: none; }
.ts-name h3 a:hover { color: var(--tu-brand) !important; text-decoration: underline; }
.ts-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.ts-badge.is-ver { background: #e0f2fe; color: #075985; }
.ts-badge.is-prem { background: #ede9fe; color: #5b21b6; }
.ts-badge.is-feat { background: #fef3c7; color: #92400e; }
html[data-theme="dark"] .ts-badge.is-ver { background: rgba(56, 189, 248, .16); color: #7dd3fc; }
html[data-theme="dark"] .ts-badge.is-prem { background: rgba(167, 139, 250, .18); color: #c4b5fd; }
html[data-theme="dark"] .ts-badge.is-feat { background: rgba(245, 158, 11, .16); color: #fcd34d; }
.ts-rate-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; margin: 3px 0 0; font-size: .84rem; }
.ts-rate { color: var(--tu-ink); }
.ts-rate i { color: #f59e0b; }
.ts-rate small { color: var(--tu-ink2); font-size: .8rem; }
.ts-rate.is-none { display: inline-flex; padding: 1px 8px; border-radius: 6px; font-size: .74rem; font-weight: 700; color: #0f766e; background: rgba(13, 148, 136, .1); }
html[data-theme="dark"] .ts-rate.is-none { color: #5eead4; }
.ts-place { color: var(--tu-ink2); }
.ts-place i { color: var(--tu-brand); margin-right: 3px; }
.ts-headline { margin: 6px 0 0; font-size: .9rem; line-height: 1.45; color: var(--tu-ink2) !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ts-tags { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ts-tags li { padding: 3px 10px; border-radius: 8px; font-size: .78rem; font-weight: 700; color: #115e59; background: rgba(13, 148, 136, .1); }
html[data-theme="dark"] .ts-tags li { color: #99f6e4; background: rgba(45, 212, 191, .12); }
.ts-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--tu-line); }
.ts-facts div { min-width: 0; }
.ts-facts dt { margin: 0; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--tu-ink2); }
.ts-facts dd { margin: 1px 0 0; font-size: .85rem; font-weight: 600; line-height: 1.35; color: var(--tu-ink); overflow-wrap: anywhere; }
.ts-facts dd i { color: var(--tu-brand); margin-right: 4px; }
.ts-side { display: flex; flex-direction: column; gap: 8px; padding-left: 18px; border-left: 1px solid var(--tu-line); }
.ts-fee b { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.1; color: #0f766e; }
.ts-fee small { display: block; font-size: .78rem; color: var(--tu-ink2); }
html[data-theme="dark"] .ts-fee b { color: #5eead4; }
.ts-demo { font-size: .78rem; font-weight: 700; color: #b45309; }
html[data-theme="dark"] .ts-demo { color: #fbbf24; }
.ts-side .tu-btn { width: 100%; justify-content: center; }
.ts-side .tu-btn:first-of-type { margin-top: auto; }
.ts .tu-btn:not(.tu-btn-ghost) { background: #0f766e; }
.ts-post { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 16px 18px; border-radius: 18px; text-decoration: none !important; color: var(--tu-ink) !important; background: var(--tu-card); border: 1px dashed var(--tu-brand); }
.ts-post:hover { border-style: solid; }
.ts-post-ico { flex: none; width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: var(--tu-brand); background: rgba(13, 148, 136, .12); }
.ts-post > span:nth-child(2) { flex: 1; min-width: 0; }
.ts-post b, .ts-post small { display: block; }
.ts-post small { color: var(--tu-ink2); font-size: .84rem; }
.ts-empty { padding: 40px 22px; border-radius: 20px; text-align: center; background: var(--tu-card); border: 1px solid var(--tu-line); }
.ts-empty-ico { width: 64px; height: 64px; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--tu-brand); background: rgba(13, 148, 136, .12); }
.ts-empty h2 { margin: 14px 0 6px; font-size: 1.25rem; font-weight: 800; }
.ts-empty p { margin: 0 auto 18px; max-width: 440px; color: var(--tu-ink2); line-height: 1.55; }
.ts-empty-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ---------------- below the results ---------------- */
.ts-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding-top: 10px; padding-bottom: 10px; }
.ts-links h2 { margin: 0 0 10px; font-size: 1rem; font-weight: 800; }
.ts-links p { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.ts-links a { padding: 6px 12px; border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--tu-ink) !important; text-decoration: none !important; background: var(--tu-card); border: 1px solid var(--tu-line); }
.ts-links a:hover { border-color: var(--tu-brand); }
.ts-links small { color: var(--tu-ink2); }
.ts-teach-wrap { padding-top: 16px; padding-bottom: 40px; }
.ts-teach { display: flex; align-items: center; gap: 18px; padding: 20px 22px; border-radius: 20px; color: #fff; background: linear-gradient(135deg, #1e1b4b, #4338ca 65%, #6d28d9); }
.ts-teach-ico { flex: none; width: 50px; height: 50px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; background: rgba(255, 255, 255, .16); }
.ts-teach > div { flex: 1; min-width: 0; }
.ts-teach h2 { margin: 0 0 2px; font-size: 1.15rem; font-weight: 800; color: #fff; }
.ts-teach p { margin: 0; color: rgba(255, 255, 255, .9) !important; font-size: .92rem; }
.ts .ts-teach .tu-btn { background: #fbbf24; color: #1f1300 !important; }

/* ---------------- tablets and phones: filters become a bottom sheet ---------------- */
@media (max-width: 991.98px) {
    .ts-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    /* stays in reach under the site header while the results scroll */
    .ts-open { position: sticky; top: 74px; z-index: 20; align-self: start; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px; border-radius: 14px; border: 1px solid var(--tu-line); background: var(--tu-card); color: var(--tu-ink); font-weight: 800; font-size: .92rem; cursor: pointer; box-shadow: 0 10px 24px -18px rgba(2, 6, 23, .6); }
    .ts-open b { min-width: 22px; padding: 0 6px; border-radius: 999px; background: #0f766e; color: #fff; font-size: .76rem; line-height: 22px; text-align: center; }
    .ts-open b[hidden] { display: none; }
    .ts-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 10040; background: rgba(2, 6, 23, .55); }
    .ts-filters { display: none; }
    .ts-filters.is-open { display: flex; position: fixed; inset: auto 0 0; top: auto; z-index: 10050; max-height: 88vh; max-height: 88dvh; border-radius: 22px 22px 0 0; border-width: 1px 0 0; }
    .ts-close { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--tu-soft); color: var(--tu-ink); cursor: pointer; }
    .ts-pills span { padding: 9px 14px; font-size: .86rem; }
    .ts-filters-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
    html.ts-locked { overflow: hidden; }
}
@media (max-width: 767.98px) {
    .ts-hero { padding-top: 78px; }
    .ts-modes { display: flex; }
    .ts-modes label { flex: 1; text-align: center; }
    .ts-modes span { padding: 9px 4px; }
    .ts-fields { grid-template-columns: minmax(0, 1fr); border-radius: 0 0 18px 18px; }
    .ts-go { margin-top: 4px; }
    .ts-hero::before { inset: 0 0 120px; }
    .ts-row { grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; padding: 14px; }
    .ts-photo { grid-row: 1 / 3; }
    .ts-photo, .ts-photo img, .ts-initials { width: 64px; height: 64px; border-radius: 16px; }
    .ts-initials { font-size: 1.3rem; }
    .ts-photo-tick { width: 22px; height: 22px; font-size: .66rem; border-width: 2px; }
    .ts-name h3 { font-size: 1rem; }
    .ts-headline, .ts-tags, .ts-facts { grid-column: 1 / -1; }
    .ts-body { display: contents; }
    .ts-name, .ts-rate-line { grid-column: 2; }
    .ts-rate-line { align-self: start; }
    .ts-name { align-self: end; }
    .ts-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ts-side { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 10px; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--tu-line); }
    .ts-fee { grid-column: 1; }
    .ts-demo { grid-column: 2; text-align: right; }
    .ts-side .tu-btn, .ts-side .tu-btn:first-of-type { margin: 0; min-height: 44px; }
    .ts-links { grid-template-columns: minmax(0, 1fr); }
    .ts-teach { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .ts * { transition: none !important; } }
