.provider-page {
  width: 100%;
  max-width: var(--w-work);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 44px) var(--page-gutter) 96px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.provider-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: end;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(28px, 4vw, 56px);
  border: 1px solid var(--border);
  border-radius: clamp(22px, 3vw, 34px);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.provider-hero::before {
  position: absolute;
  top: 0;
  left: clamp(28px, 4vw, 56px);
  width: 72px;
  height: 4px;
  border-radius: 0 0 999px 999px;
  background: var(--primary);
  content: "";
}

.provider-eyebrow {
  display: block;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.provider-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.provider-hero h1 span { color: var(--primary); }

.provider-hero-copy p {
  max-width: var(--w-reading);
  margin: 16px 0 0;
  color: var(--text-soft);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.55;
}

.provider-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 6px 6px 6px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--bg);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  color: var(--text-muted);
}

.provider-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent), 0 12px 32px rgba(15, 23, 42, 0.08);
}

.provider-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.provider-search button,
.filter-apply {
  min-height: 50px;
  border: 1px solid var(--primary);
  border-radius: 13px;
  background: var(--primary);
  color: #fff;
  padding: 0 22px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.provider-search button:hover,
.filter-apply:hover { box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 25%, transparent); }
.provider-search button:active,
.filter-apply:active { transform: scale(0.98); }

.filter-mount { margin-top: 22px; }
.provider-filters {
  display: flex;
  align-items: end;
  gap: 12px;
}

.provider-filters > label:not(.rated-check) {
  display: grid;
  gap: 6px;
  flex: 1 1 220px;
  max-width: 340px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.provider-filters select,
.sort-label select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  padding: 0 40px 0 14px;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.rated-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.rated-check input { position: absolute; opacity: 0; pointer-events: none; }
.check-ui {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border: 1.5px solid var(--border-strong);
  border-radius: 7px;
  color: transparent;
}
.rated-check input:checked + .check-ui { border-color: var(--primary); background: var(--primary); color: #fff; }
.rated-check input:focus-visible + .check-ui { outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent); outline-offset: 2px; }

.provider-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 14px;
}
.provider-count { color: var(--text-soft); font-size: 15px; font-weight: 700; }
.provider-toolbar-actions { display: flex; align-items: center; gap: 10px; }
.sort-label { min-width: 210px; }
.filter-open { display: none; }

.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(14px, 1.6vw, 24px);
}

.provider-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.provider-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-md); }
.provider-card:active { transform: translateY(-1px) scale(0.995); }
.provider-card.is-highlighted { box-shadow: 0 0 0 1px var(--star), var(--shadow-sm); }

.provider-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 168px;
  overflow: hidden;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 42px;
  font-weight: 800;
}
.provider-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.provider-card:hover .provider-cover img { transform: scale(1.025); }
.provider-body { display: flex; flex: 1; flex-direction: column; padding: 18px; }
.provider-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.provider-category,
.provider-sponsored {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.provider-category { background: var(--primary-light); color: var(--primary-dark); }
.provider-sponsored { border: 1px solid var(--border); color: var(--text-muted); }
.provider-name { margin: 13px 0 0; font-size: 20px; line-height: 1.2; letter-spacing: -0.02em; }
.provider-title { min-height: 20px; margin: 4px 0 0; color: var(--text-soft); font-size: 14px; font-weight: 600; }
.provider-facts { display: flex; flex-wrap: wrap; gap: 7px 13px; margin-top: 12px; color: var(--text-muted); font-size: 13px; }
.provider-facts span { display: inline-flex; align-items: center; gap: 5px; }
.provider-rating { color: var(--star-text, #9a6700); font-weight: 750; }
.provider-desc {
  display: -webkit-box;
  min-height: 63px;
  margin: 13px 0 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.provider-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.provider-badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; background: var(--warning-bg, #fef3c7); color: var(--warning-text, #92400e); padding: 5px 9px; font-size: 11px; font-weight: 750; }
.provider-badge.level { background: var(--success-bg, #dcfce7); color: var(--success-text, #166534); }
.provider-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); color: var(--primary); font-size: 14px; font-weight: 750; }
.provider-card-footer svg { transition: transform 0.18s ease; }
.provider-card:hover .provider-card-footer svg { transform: translateX(3px); }

.provider-empty { padding: clamp(40px, 8vw, 90px) 20px; border: 1px dashed var(--border-strong); border-radius: 20px; background: var(--surface); text-align: center; }
.provider-empty svg { color: var(--primary); }
.provider-empty h2 { margin: 14px 0 6px; font-size: 22px; }
.provider-empty p { max-width: 520px; margin: 0 auto; color: var(--text-soft); }
.provider-empty a,
.provider-empty button,
.load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 20px;
  border: 1px solid var(--primary);
  border-radius: 13px;
  background: var(--primary);
  color: #fff;
  padding: 0 20px;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.load-more-wrap { display: flex; justify-content: center; }

.sk-card { min-height: 390px; padding: 0 18px 18px; }
.sk-card i,
.sk-card b,
.sk-card em { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border) 37%, var(--bg-subtle) 63%); background-size: 400% 100%; animation: providerShimmer 1.35s ease infinite; }
.sk-card i { height: 168px; margin: 0 -18px 18px; border-radius: 0; }
.sk-card b { width: 46%; height: 18px; margin: 12px 0; }
.sk-card b + b { width: 72%; height: 14px; }
.sk-card em { width: 100%; height: 62px; margin-top: 22px; }
@keyframes providerShimmer { to { background-position: -100% 50%; } }

.filter-sheet { display: none; }

@media (max-width: 768px) {
  .provider-page { padding: 16px 16px 88px; }
  .provider-hero { display: block; padding: 28px 20px 20px; border-radius: 24px; }
  .provider-hero::before { left: 20px; }
  .provider-eyebrow { margin-bottom: 10px; font-size: 10px; }
  .provider-hero h1 { font-size: clamp(32px, 10vw, 42px); }
  .provider-hero-copy p { margin-top: 12px; font-size: 15px; }
  .provider-search { grid-template-columns: auto minmax(0, 1fr); min-height: 56px; margin-top: 22px; padding: 5px 14px; border-radius: 15px; }
  .provider-search button { grid-column: 1 / -1; width: calc(100% + 28px); min-height: 52px; margin: 3px -14px -5px; border-radius: 0 0 14px 14px; }
  .filter-mount { display: none; }
  .provider-toolbar { margin: 18px 0 12px; }
  .provider-count { font-size: 14px; }
  .provider-toolbar-actions { gap: 7px; }
  .filter-open { display: inline-flex; min-height: 44px; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); padding: 0 12px; font: inherit; font-size: 13px; font-weight: 700; }
  .filter-open.active { border-color: var(--primary); color: var(--primary); }
  .filter-open span { display: inline-flex; min-width: 18px; height: 18px; align-items: center; justify-content: center; border-radius: 999px; background: var(--primary); color: #fff; font-size: 10px; }
  .filter-open span[hidden] { display: none; }
  .sort-label { min-width: 0; width: 142px; }
  .sort-label select { min-height: 44px; padding-left: 10px; font-size: 13px; }
  .provider-grid { grid-template-columns: 1fr; gap: 14px; }
  .provider-cover { height: 148px; }
  .provider-body { padding: 16px; }
  .provider-name { font-size: 19px; }
  .provider-desc { min-height: 0; -webkit-line-clamp: 2; }

  .filter-sheet[open] {
    position: fixed;
    inset: auto 0 0;
    z-index: 120;
    display: flex;
    width: 100%;
    max-height: min(78dvh, 620px);
    flex-direction: column;
    margin: 0;
    border: 0;
    border-radius: 24px 24px 0 0;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 -20px 60px rgba(15, 23, 42, 0.24);
    animation: filterUp 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .filter-sheet::backdrop { background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(2px); }
  .filter-sheet-head { padding: 9px 18px 13px; border-bottom: 1px solid var(--border); }
  .filter-handle { display: block; width: 40px; height: 4px; margin: 0 auto 12px; border-radius: 999px; background: var(--border-strong); }
  .filter-sheet-head > div { display: flex; align-items: center; justify-content: space-between; }
  .filter-sheet-head h2 { margin: 0; font-size: 20px; }
  .filter-sheet-head button { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border: 0; border-radius: 999px; background: var(--bg-subtle); color: var(--text); }
  .filter-sheet-body { overflow-y: auto; padding: 18px; }
  .filter-sheet .provider-filters { display: grid; gap: 16px; }
  .filter-sheet .provider-filters > label:not(.rated-check) { max-width: none; font-size: 13px; }
  .filter-sheet .provider-filters select { min-height: 52px; font-size: 16px; }
  .filter-sheet .rated-check { min-height: 52px; }
  .filter-sheet-actions { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 10px; padding: 13px 18px calc(13px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); }
  .filter-reset { min-height: 50px; border: 1px solid var(--border-strong); border-radius: 13px; background: var(--surface); color: var(--text-soft); font: inherit; font-weight: 700; }
  .filter-reset:disabled { opacity: 0.45; }
}

@keyframes filterUp { from { transform: translateY(26px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .provider-card,
  .provider-cover img,
  .provider-card-footer svg,
  .provider-search button,
  .filter-apply { transition: none; }
  .provider-card:hover,
  .provider-card:active { transform: none; }
  .sk-card i,
  .sk-card b,
  .sk-card em { animation: none; }
  .filter-sheet[open] { animation: none; }
}
