/* Public design handoff: common tokens; page layouts stay scoped. */
:root {
  --brand-primary: #243645;
  --brand-primary-dark: #172633;
  --brand-primary-soft: #f5f6f4;
  --text-primary: #243645;
  --text-muted: #626b71;
  --text-soft: #626b71;
  --page-bg: #fff;
  --surface-muted: #fff;
  --surface-line: #dfe3e4;
  --border-color: #dfe3e4;
  --radius-control: 3px;
  --shadow-sm: none;
  --shadow-md: none;
}
body { background: #fff; line-height: 1.8; }
.home-page .container, .site-header .container, .site-footer .container { max-width: 1168px; }
.navbar-custom { background: #fff; border-bottom: 1px solid var(--border-color); box-shadow: none; }
.navbar-custom .navbar-brand, .navbar-custom .nav-link { color: var(--brand-primary); }
.navbar-custom .nav-link:hover, .navbar-custom .nav-link:focus { color: var(--brand-primary-dark); background: var(--brand-primary-soft); }
.navbar-custom .nav-link[href="/signup"] { background: #fff; color: var(--brand-primary); border: 1px solid var(--brand-primary); }
.navbar-custom .nav-link[href="/login"] { border-color: var(--border-color); }
.navbar-custom .nav-link:focus-visible, .navbar-toggler:focus-visible, .site-footer a:focus-visible { outline-color: #537795; }
.navbar-toggler { border: 1px solid var(--border-color); }
.site-footer { background: var(--brand-primary-soft); border-top: 1px solid var(--border-color); color: var(--text-primary) !important; }
.site-footer a, .site-footer-title, .site-footer-text, .site-footer-bottom { color: var(--text-primary); }
.site-footer-links a { color: var(--text-muted); }
.site-footer a:hover { color: var(--brand-primary-dark); }
.site-footer-bottom { border-color: var(--border-color); }
.btn { border-radius: var(--radius-control); font-weight: 500; }
.form-control, .form-select { border-radius: var(--radius-control); }
.home-page, .refined-listing-page, .profile-detail-page:has(.teacher-profile-layout) { font-size: 15px; overflow-wrap: anywhere; }
.home-page h1, .home-page h2, .home-page h3, .teacher-listing-page h2, .teacher-profile-section h2 { font-weight: 500; text-align: left; }
.home-page h2::before, .home-page h2::after, .teacher-listing-page h2::before, .teacher-listing-page h2::after { content: none; }

/* Home: whitespace and rules, while keeping the existing explanatory copy. */
.home-page .home-hero { padding: 64px 0 48px; background: #fff; text-align: left; border: 0; }
.home-page .home-hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.home-page .home-hero-copy { max-width: none; text-align: left; }
.home-page .home-hero-title { font-size: 38px; line-height: 1.6; letter-spacing: .02em; margin: 16px 0 24px; }
.home-page .home-lead { max-width: 600px; font-size: 15px; line-height: 1.9; margin: 0 0 24px; }
.home-page .home-hero-actions { justify-content: flex-start; flex-wrap: wrap; gap: 12px; }
.home-page .home-hero-actions .btn { min-width: 0; font-size: 14px; }
.home-page .home-eyebrow { color: var(--text-muted); font-weight: 400; font-size: 12px; }
.home-intro-flow { border-left: 1px solid var(--border-color); padding-left: 32px; }
.home-intro-flow > p { font-size: 22px; line-height: 1.8; margin-bottom: 24px; }
.home-intro-flow ol { list-style: none; padding: 0; margin: 0; }
.home-intro-flow li { display: grid; grid-template-columns: 80px 1fr; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--border-color); font-size: 13px; }
.home-page .home-section { padding: 48px 0; background: #fff !important; border: 0; }
.home-page .home-section > .container { border-top: 1px solid var(--border-color); padding-top: 32px; }
.home-page .home-regions { padding: 0; }
.home-page .teacher-area-links { padding: 24px 0; margin: 0; border: 0; background: #fff; }
.home-page .home-section-heading { text-align: left; max-width: none; margin: 0 0 24px; }
.home-page .home-section-heading h2 { font-size: 24px; margin: 0; padding: 0; }
.home-page .home-section-lead { text-align: left; font-size: 15px; max-width: none; margin: 0 0 24px; }
.home-page .card, .home-page .home-seo-item { border: 0; border-radius: 0; box-shadow: none !important; background: #fff; }
.home-page .home-list-card { padding: 0; }
.home-page .home-list-card-header { display: none; }
.home-teacher-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.home-page .home-teacher-grid .home-list-row { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 8px; border-top: 1px solid var(--border-color); border-bottom: 0; padding: 24px 0; color: var(--text-primary); text-decoration: none; }
.home-page .home-teacher-grid .home-list-row:hover span { text-decoration: underline; text-underline-offset: 5px; }
.home-page .home-list-row span { font-size: 18px; font-weight: 500; }
.home-page .home-list-row small { max-width: 100%; white-space: normal; color: var(--text-muted); font-size: 13px; }
.home-page .home-guide-panel { border: 0; border-radius: 0; padding: 0; margin: 0; background: #fff; }
.home-page .home-guide-title { padding: 0; font-size: 24px; }
.home-page .home-guide-title::after { content: none; }
.home-page .home-guide-links { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; gap: 16px 24px; }
.home-page .home-guide-links a { background: #fff; border: 0; border-top: 1px solid var(--border-color); border-radius: 0; padding: 16px 0; font-weight: 400; }
.home-page .home-students { margin-top: 32px; }
.home-page .home-students .home-list-card-header { display: block; }
.home-page .home-students .home-list-card-header h4 { font-size: 18px; font-weight: 500; }
.home-page .home-students .home-list-row { display: flex; justify-content: space-between; gap: 16px; }
.home-page .home-feature-card .card-title { text-align: left !important; font-size: 18px; font-weight: 500; }
.home-page .home-feature-card .card-body, .home-page .home-step-card .card-body, .home-page .home-seo-item { padding: 24px 0; border-top: 1px solid var(--border-color); }
.home-page .home-seo-item h3, .home-page .home-step-card .card-title { font-size: 18px; font-weight: 500; }
.home-page .home-seo-item p { font-size: 15px; }
.home-page .home-seo-grid { gap: 24px 32px; }
.home-page .about-me .text-center { text-align: left !important; }

/* Teacher list: a full-width, native collapsible filter and aligned rows. */
.refined-listing-page { display: block; width: calc(100% - 48px); max-width: 1120px; margin: 32px auto 64px; }
.refined-listing-page .listing-header { padding: 0; margin: 0 0 16px; text-align: left; }
.refined-listing-page .listing-header h1 { font-size: 30px; font-weight: 500; text-align: left; }
.teacher-listing-page .listing-description { margin: 16px 0; font-size: 15px; }
.teacher-listing-page .listing-benefits { font-size: 12px; font-weight: 400; margin-bottom: 24px; }
.refined-listing-page .listing-search { position: static; max-height: none; overflow: visible; width: 100%; padding: 0; border: 0; border-radius: 0; margin: 0 0 24px; background: #fff; }
.refined-listing-page .listing-search-summary { display: inline-flex; flex-wrap: nowrap; max-width: 100%; box-sizing: border-box; padding: 10px 16px; min-height: 44px; border: 1px solid var(--border-color); border-radius: 3px; font-size: 14px; gap: 16px; }
.refined-listing-page .listing-search-summary::after { background: transparent; border: 0; flex: 0 0 28px; width: 28px; height: auto; }
.refined-listing-page .listing-search-title { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.refined-listing-page .listing-search-title > i { flex-shrink: 0; }
.refined-listing-page .listing-search-active { min-width: 0; overflow-wrap: anywhere; }
.refined-listing-page .listing-search[open] .listing-search-summary { margin-bottom: 16px; padding-bottom: 10px; }
.refined-listing-page .listing-search .search-bar { background: var(--brand-primary-soft); padding: 24px; border: 0; margin: 0; }
.refined-listing-page .listing-search .row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px !important; }
.refined-listing-page .listing-search .form-label { font-size: 13px; font-weight: 400; }
.refined-listing-page .listing-search-actions { flex-direction: row; flex-wrap: wrap; margin-top: 24px; }
.refined-listing-page .listing-search-actions .btn { width: auto; min-width: 0; }
.refined-listing-page .listing-active-filters { margin-bottom: 24px; }
.refined-listing-page .listing-active-filters a { border-radius: 3px; background: var(--brand-primary-soft); border-color: var(--border-color); color: var(--text-primary); font-size: 13px; font-weight: 400; overflow-wrap: anywhere; }
.listing-results-heading { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--brand-primary); padding-bottom: 16px; }
.refined-listing-page .listing-count, .listing-order { margin: 0; font-size: 14px; font-weight: 400; }
.listing-order { color: var(--text-muted); }
.listing-edit-sort { margin-left: 8px; }
.refined-listing-page .listing-results { display: block; width: 100%; }
.refined-listing-page .listing-card { display: grid; grid-template-columns: minmax(0, 1fr) 190px; padding: 32px 0; margin: 0; border: 0; border-bottom: 1px solid var(--border-color); border-radius: 0; background: #fff; box-shadow: none; gap: 24px; transform: none; }
.refined-listing-page .listing-card:hover { box-shadow: none; border-color: var(--border-color); transform: none; }
.teacher-listing-page .listing-card-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px 24px; }
.teacher-listing-page .listing-card-title { display: flex; flex-direction: column; align-items: flex-start; margin: 0; gap: 8px; }
.refined-listing-page .listing-card .userName { font-size: 20px; font-weight: 500; }
.teacher-listing-page .listing-card-subtitle { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.teacher-listing-page .listing-last-login { text-align: left; display: flex; gap: 8px; font-size: 12px; }
.teacher-listing-page .listing-last-login time { font-size: 12px; font-weight: 400; }
.teacher-listing-page .listing-meta { grid-column: 2; grid-row: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.teacher-listing-page .listing-meta > div:nth-child(3), .teacher-listing-page .listing-meta > div:last-child { display: none; } /* University and rate already have prominent positions. */
.teacher-listing-page .listing-meta dt { font-weight: 400; }
.teacher-listing-page .listing-meta dd { font-size: 14px; font-weight: 400; white-space: normal; overflow: visible; }
.teacher-listing-page .listing-subjects { grid-column: 1 / -1; margin: 8px 0 0; }
.teacher-listing-page .listing-subject-group { border: 0; border-radius: 0; padding: 0; background: #fff; }
.teacher-listing-page .listing-subject-label { min-width: 64px; color: var(--text-muted); font-weight: 400; }
.teacher-listing-page .listing-subject-values { font-weight: 400; font-size: 14px; }
.teacher-listing-page .listing-excerpt-block { grid-column: 1 / -1; margin-top: 8px; }
.refined-listing-page .listing-card .listing-excerpt { font-size: 14px; font-weight: 400; color: var(--text-muted); line-height: 1.9; }
.teacher-listing-page .listing-card-action { display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-end; flex-wrap: nowrap; min-width: 0; gap: 12px; width: auto; padding: 0; border: 0; background: #fff; }
.teacher-listing-page .listing-card-action .btn { min-width: 0; width: auto; font-size: 13px; }
.listing-rate { font-size: 13px; margin: 0 0 16px; text-align: right; }
.listing-rate span { display: block; color: var(--text-muted); font-size: 12px; }
.listing-rate strong { font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Teacher profile: source copy first; fee and existing consultation action alongside. */
.profile-detail-page:has(.teacher-profile-layout) { max-width: 1120px; padding-top: 16px; }
.profile-detail-page:has(.teacher-profile-layout) .profile-detail-card { border: 0; border-radius: 0; box-shadow: none; }
.profile-detail-page:has(.teacher-profile-layout) .profile-detail-header { padding: 0 0 32px; background: #fff; border-bottom: 1px solid var(--border-color); }
.profile-detail-page:has(.teacher-profile-layout) .profile-detail-header h1 { font-size: 30px; font-weight: 500; }
.profile-heading-meta { color: var(--text-muted); margin: 16px 0 0; }
.teacher-profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 48px; padding-top: 32px; align-items: start; }
.teacher-contact { grid-column: 2; grid-row: 1; background: var(--brand-primary-soft); padding: 24px; font-size: 13px; }
.teacher-contact-rate { margin: 0 0 24px; }
.teacher-contact-rate span { display: block; color: var(--text-muted); margin-bottom: 8px; }
.teacher-contact-rate strong { font-size: 30px; font-weight: 500; font-variant-numeric: tabular-nums; }
.teacher-contact .profile-mobile-action { display: block; padding: 0; margin: 0 0 16px; }
.teacher-contact .btn { width: 100%; min-width: 0; font-size: 14px; }
.teacher-contact > p:not(.teacher-contact-rate) { color: var(--text-muted); line-height: 1.9; }
.teacher-profile-layout .profile-detail-body { grid-column: 1; grid-row: 1; padding: 0; display: block; }
.teacher-profile-section + .teacher-profile-section { margin-top: 40px; }
.teacher-profile-section h2 { font-size: 20px; border-bottom: 1px solid var(--border-color); padding: 0 0 16px; margin: 0 0 20px; }
.teacher-profile-section h2::before, .teacher-profile-section h2::after { content: none; }
.teacher-profile-section .wraptext { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.9; }
.teacher-profile-section .profile-detail-grid { display: block; }
.teacher-profile-section .profile-detail-grid > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; padding: 12px 0; background: #fff; border: 0; border-bottom: 1px solid var(--border-color); border-radius: 0; }
.teacher-profile-section .profile-detail-grid dt { font-weight: 400; font-size: 14px; color: var(--text-muted); }
.teacher-profile-section .profile-detail-grid dd { font-size: 15px; font-weight: 400; margin: 0; overflow-wrap: anywhere; }
.listing-search-close[hidden] { display: none; }
.profile-detail-page:has(.teacher-profile-layout) .profile-detail-actions { background: #fff; border: 0; padding: 32px 0; justify-content: flex-start; }
.profile-detail-page:has(.teacher-profile-layout) .profile-related-card { border: 0; border-radius: 0; border-top: 1px solid var(--border-color); padding: 24px 0; background: #fff; }
.profile-detail-page:has(.teacher-profile-layout) .profile-related h2 { font-size: 20px; text-align: left; font-weight: 500; }

@media (max-width: 991.98px) {
  .home-page .home-hero-grid { gap: 32px; }
  .refined-listing-page .listing-search .row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .teacher-profile-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 32px; }
}
@media (max-width: 767.98px) {
  .home-page .container { padding-left: 20px; padding-right: 20px; }
  .home-page .home-hero { padding: 32px 0; }
  .home-page .home-hero-grid { grid-template-columns: 1fr; }
  .home-page .home-hero-title { font-size: 29px; }
  .home-intro-flow { border-left: 0; border-top: 1px solid var(--border-color); padding: 24px 0 0; }
  .home-intro-flow > p { font-size: 18px; }
  .home-page .home-section { padding: 24px 0; }
  .home-page .home-regions { padding: 0; }
  .home-page .home-section > .container { padding-top: 24px; }
  .home-page .home-section-heading h2, .home-page .home-guide-title { font-size: 21px; }
  .home-teacher-grid, .home-page .home-guide-links { grid-template-columns: 1fr; gap: 0; }
  .home-page .home-teacher-grid .home-list-row { padding: 20px 0; }
  .refined-listing-page { width: calc(100% - 40px); margin: 24px auto 40px; }
  .profile-detail-page:has(.teacher-profile-layout) .profile-detail-header h1 { font-size: 25px; }
  .refined-listing-page .listing-search .search-bar { padding: 16px; }
  .refined-listing-page .listing-search .row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px !important; }
  .refined-listing-page .listing-search .form-control, .refined-listing-page .listing-search .form-select { font-size: 16px; }
  .refined-listing-page .listing-search .row > :last-child { grid-column: auto; }
  .refined-listing-page .listing-search-actions .btn { flex: 1 1 auto; }
  .refined-listing-page .listing-search-actions .listing-search-close { flex: 0 0 100%; }
  .refined-listing-page .listing-card { grid-template-columns: minmax(0, 1fr) 104px; gap: 12px; padding: 24px 0; }
  .teacher-listing-page .listing-card-main { display: contents; }
  .teacher-listing-page .listing-card-title { grid-column: 1; grid-row: 1; }
  .refined-listing-page .listing-card .userName { font-size: 18px; }
  .teacher-listing-page .listing-card-action { grid-column: 2; grid-row: 1; gap: 8px; }
  .teacher-listing-page .listing-card-action .btn { flex: none; font-size: 12px; padding: 8px; min-height: 44px; }
  .listing-rate { margin-bottom: 4px; }
  .listing-rate strong { font-size: 23px; }
  .teacher-listing-page .listing-meta { grid-column: 1 / -1; grid-row: auto; }
  .teacher-listing-page .listing-subjects, .teacher-listing-page .listing-excerpt-block { grid-column: 1 / -1; }
  .teacher-listing-page .listing-last-login { flex-direction: column; gap: 0; }
  .teacher-listing-page .listing-benefits { gap: 8px 16px; }
  .teacher-listing-page .contract-data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-detail-page:has(.teacher-profile-layout) { padding: 0 20px; }
  .teacher-profile-layout { grid-template-columns: 1fr; gap: 32px; padding-top: 24px; }
  .teacher-contact { grid-column: 1; grid-row: 1; padding: 20px; }
  .teacher-profile-layout .profile-detail-body { grid-row: 2; }
  .teacher-profile-section .profile-detail-grid > div { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; }
  .teacher-profile-section + .teacher-profile-section { margin-top: 32px; }
}
@media (max-width: 359.98px) {
  .refined-listing-page .listing-search .row { grid-template-columns: 1fr; }
  .teacher-profile-section .profile-detail-grid > div { grid-template-columns: 1fr; gap: 4px; }
  .navbar-custom .navbar-brand { font-size: 18px; margin-right: 0; }
}
