.compact-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.compact-card-grid .card > div {
  padding: 17px 18px 18px;
}

.compact-card-grid .card {
  display: flex;
  flex-direction: column;
}

.compact-card-grid .card > div {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.compact-card-grid .card h2,
.compact-card-grid .card h3 {
  margin-bottom: 7px;
  font-size: 1.08rem;
  line-height: 1.25;
}

.compact-card-grid .card p {
  margin-bottom: 10px;
  font-size: .92rem;
  line-height: 1.45;
}

.compact-card-grid .card p:last-child {
  margin-bottom: 0;
}

.compact-card-grid .service-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.compact-card-grid .service-card p { -webkit-line-clamp: 3; }
.compact-card-grid .service-card span:last-child { margin-top: auto; padding-top: 3px; }

.compact-card-grid .service-card img {
  height: 155px;
}

.compact-card-grid .service-card span {
  font-size: .9rem;
}

.doctor-text-grid {
  display: grid;
  gap: 14px;
}

.doctor-home-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.doctor-directory-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.doctor-text-card {
  display: flex;
  min-width: 0;
  min-height: 108px;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 5px 18px #211a1f0a;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.doctor-text-card:hover {
  border-color: #6f194b66;
  box-shadow: 0 9px 24px #211a1f14;
  text-decoration: none;
  transform: translateY(-2px);
}

.doctor-text-card h2,
.doctor-text-card h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.doctor-text-card p {
  margin: 0;
  color: var(--sub);
  font-size: .84rem;
  line-height: 1.42;
}

.compact-page-head {
  padding-block: 38px;
}

.compact-page-head .breadcrumbs {
  margin-bottom: 18px;
}

.compact-page-head h1 {
  margin-bottom: 8px;
  font-size: clamp(1.9rem, 3.7vw, 2.7rem);
}

.compact-page-head .lead {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.compact-detail-section {
  padding-block: 48px 64px;
}

.doctor-profile-no-photo {
  max-width: 920px;
}

.doctor-details {
  min-width: 0;
}

.detail-label {
  display: block;
  margin-bottom: 9px;
  color: var(--primary);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list li,
.tag-list a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary);
  font-size: .88rem;
  font-weight: 700;
}

.tag-list a:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

.doctor-specialties {
  margin-bottom: 22px;
}

.doctor-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.doctor-info-block {
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.doctor-info-block-wide {
  grid-column: 1 / -1;
}

.doctor-info-block h2 {
  margin: 0 0 7px;
  font-size: 1.05rem;
}

.doctor-info-block p {
  margin: 0;
  color: var(--sub);
  line-height: 1.55;
}

.doctor-directions {
  margin-top: 22px;
}

.category-intro {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  margin-bottom: 38px;
}

.category-intro-no-image {
  display: block;
  max-width: 850px;
}

.category-intro img {
  width: 100%;
  max-height: 250px;
  aspect-ratio: 4 / 3;
  margin: 0;
  object-fit: cover;
  border-radius: 10px;
}

.category-intro .prose {
  font-size: 1rem;
  line-height: 1.7;
}

.category-prices > h2,
.category-doctors > h2 {
  margin-bottom: 18px;
  font-size: 1.55rem;
}

.category-doctors {
  margin-top: 38px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.compact-price-list .price-group {
  margin-bottom: 9px;
}

.compact-price-list .price-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  font-size: 1.05rem;
}

.price-count {
  color: var(--sub);
  font-size: .82rem;
  font-weight: 400;
  white-space: nowrap;
}

.compact-price-list .price-body {
  padding: 18px;
}

.compact-price-list th,
.compact-price-list td,
.category-prices th,
.category-prices td {
  padding: 10px 12px;
}

@media (max-width: 1050px) {
  .compact-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .doctor-home-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .doctor-directory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .compact-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doctor-home-grid,
  .doctor-directory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .category-intro { grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 600px) {
  .compact-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .compact-card-grid .card > div { padding: 13px; }
  .compact-card-grid .service-card img { height: 120px; }
  .compact-card-grid .card h2, .compact-card-grid .card h3 { font-size: .98rem; }
  .compact-card-grid .card p { font-size: .82rem; }
  .doctor-home-grid,
  .doctor-directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .doctor-text-card { min-height: 102px; padding: 14px; }
  .doctor-text-card h2,
  .doctor-text-card h3 { font-size: .94rem; }
  .compact-page-head { padding-block: 30px; }
  .compact-detail-section { padding-block: 32px 48px; }
  .category-intro { grid-template-columns: 1fr; }
  .category-intro img { max-height: 220px; aspect-ratio: 16 / 9; }
  .doctor-info-grid { grid-template-columns: 1fr; }
  .doctor-info-block-wide { grid-column: auto; }
  .compact-price-list .price-group summary { align-items: flex-start; flex-direction: column; gap: 3px; }
}

@media (max-width: 400px) {
  .doctor-home-grid,
  .doctor-directory-grid { grid-template-columns: 1fr; }
  .doctor-text-card { min-height: 96px; }
}
