@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800;900&display=swap');

:root {
  --blue: #1c9ebd;
  --blue-dark: #087f99;
  --green: #aeca20;
  --navy: #082b55;
  --text: #36566f;
  --muted: #7890a3;
  --line: #dbe9ef;
  --bg: #f5fbfc;
  --soft-blue: #eaf8fb;
  --white: #ffffff;
  --shadow: 0 14px 34px rgba(8, 43, 85, 0.08);
  --radius: 22px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.35;
}

button,
input {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.page {
  width: min(var(--max), calc(100% - 24px));
  margin: 0 auto;
  padding: 14px 0 36px;
}

.header {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(8, 43, 85, 0.08);
  border-radius: 16px;
  padding: 10px 12px 8px;
  margin-bottom: 6px;
}

.header__main {
  display: grid;
  gap: 0;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 0;
}

.brand__logo {
  width: clamp(220px, 68vw, 420px);
  height: auto;
  flex: 0 0 auto;
}

.contacts {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  flex-wrap: nowrap;
  margin-bottom: 8px;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(8, 43, 85, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: 0.16s ease;
}

.contact-chip--icon {
  min-height: 68px;
  min-width: 68px;
  width: 68px;
  padding: 0;
  justify-content: center;
}

.contact-chip--icon svg {
  width: 32px;
  height: 32px;
}

.contact-chip--pdf {
  border-color: rgba(174, 202, 32, 0.5);
  background: linear-gradient(150deg, #f7fce2 0%, #ffffff 100%);
  color: var(--blue-dark);
}

.contact-chip:hover {
  border-color: rgba(28, 158, 189, 0.5);
  background: #fff;
  transform: translateY(-1px);
}

.contact-chip--pdf:hover {
  border-color: rgba(28, 158, 189, 0.55);
  background: linear-gradient(150deg, #f3fada 0%, #ffffff 100%);
}

.contact-chip--pdf:disabled {
  opacity: 0.62;
  cursor: wait;
  transform: none;
  filter: saturate(0.8);
}

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

.search {
  margin-bottom: 14px;
  position: sticky;
  top: 8px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 50px;
  gap: 8px;
  align-items: center;
}

.search input {
  width: 100%;
  height: 50px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  border-radius: 999px;
  padding: 0 18px;
  color: var(--navy);
  outline: none;
  box-shadow: 0 8px 20px rgba(8, 43, 85, 0.055);
  font-weight: 800;
  font-size: 0.95rem;
}

.search input:focus {
  border-color: rgba(28, 158, 189, 0.65);
  box-shadow: 0 0 0 4px rgba(28, 158, 189, 0.12);
}

.search button {
  height: 50px;
  width: 50px;
  border: 1px solid rgba(28, 158, 189, 0.35);
  border-radius: 999px;
  background: linear-gradient(145deg, #1c9ebd, #087f99);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(8, 43, 85, 0.16);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.search button svg {
  width: 22px;
  height: 22px;
}

.search button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(28, 158, 189, 0.18);
}

@media (hover: hover) and (pointer: fine) {
  .search button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(8, 43, 85, 0.22);
  }
}

.search button:active {
  transform: translateY(0);
  filter: saturate(0.95);
}

.specialties {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 18px;
}

.specialty {
  min-height: 116px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 14px;
  cursor: pointer;
  padding: 10px 8px;
  box-shadow: 0 4px 12px rgba(8, 43, 85, 0.045);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}

.specialty::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .specialty:hover {
    transform: translateY(-1px);
    border-color: rgba(28, 158, 189, 0.5);
    box-shadow: 0 8px 18px rgba(8, 43, 85, 0.08);
  }
}

.specialty.is-active {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(28, 158, 189, 0.24);
}

.specialty.is-active::before {
  background: linear-gradient(180deg, #1c9ebd 0%, #aeca20 100%);
}

.specialty:focus-visible {
  outline: none;
  border-color: rgba(28, 158, 189, 0.72);
  box-shadow: 0 0 0 3px rgba(28, 158, 189, 0.18);
}

.specialty__icon {
  width: 60px;
  height: 60px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, #f2fbfe 0%, #e8f7fc 100%);
  color: var(--blue-dark);
  font-weight: 900;
  font-size: 1rem;
  border: 1px solid rgba(28, 158, 189, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.specialty__icon svg {
  width: 40px;
  height: 40px;
  display: block;
}

.specialty.is-active .specialty__icon {
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.28);
}

.specialty__name {
  display: block;
  color: var(--navy);
  font-size: 0.84rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.specialty.is-active .specialty__name {
  color: var(--white);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 12px;
  scroll-margin-top: 70px;
}

.section-head h2 {
  color: var(--navy);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.section-head span {
  color: var(--muted);
  font-weight: 850;
  font-size: 0.95rem;
}

.doctors {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.doctor {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 100%;
}

.doctor__photo {
  height: 190px;
  background: var(--soft-blue);
  overflow: hidden;
}

.doctor__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.doctor__body {
  padding: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue-dark);
  font-size: 0.76rem;
  font-weight: 950;
  margin-bottom: 10px;
}

.doctor h3 {
  color: var(--navy);
  font-size: 1.15rem;
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 9px;
}

.doctor p {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.empty {
  grid-column: 1 / -1;
  background: var(--white);
  border: 1px dashed rgba(28, 158, 189, 0.45);
  border-radius: 22px;
  padding: 24px;
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

@media (max-width: 1100px) {
  .specialties {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .doctors {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .header {
    padding: 9px 10px;
  }

  .brand__logo {
    width: 210px;
  }

  .specialties {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .doctors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 16px, var(--max));
    padding-top: 8px;
  }

  .header {
    border-radius: 14px;
    padding: 8px;
    margin-bottom: 8px;
  }

  .header__main {
    gap: 6px;
  }

  .brand {
    gap: 8px;
  }

  .brand__logo {
    width: 196px;
  }

  .contacts {
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 1px;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .contacts::-webkit-scrollbar {
    display: none;
  }

  .contact-chip {
    min-height: 28px;
    padding: 0 9px;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .contact-chip--icon {
    min-height: 60px;
    min-width: 60px;
    width: 60px;
    padding: 0;
  }

  .contact-chip--icon svg {
    width: 28px;
    height: 28px;
  }

  .search {
    top: 6px;
    margin-bottom: 10px;
  }

  .search input {
    height: 44px;
    font-size: 0.86rem;
    padding: 0 14px;
  }

  .search {
    grid-template-columns: 1fr 44px;
  }

  .search button {
    width: 44px;
    height: 44px;
  }

  .search button svg {
    width: 20px;
    height: 20px;
  }

  .specialties {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .specialty {
    min-height: 96px;
    padding: 8px;
    border-radius: 14px;
    gap: 7px;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .specialty::before {
    top: 6px;
    bottom: 6px;
  }

  .specialty__icon {
    width: 54px;
    height: 54px;
    border-radius: 10px;
    font-size: 0.82rem;
  }

  .specialty__icon svg {
    width: 36px;
    height: 36px;
  }

  .specialty__name {
    font-size: 0.74rem;
    line-height: 1.1;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: row;
    margin-top: 18px;
    scroll-margin-top: 60px;
  }

  .section-head h2 {
    font-size: 1.45rem;
  }

  .section-head span {
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .doctors {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .doctor {
    display: grid;
    grid-template-columns: 96px 1fr;
    border-radius: 18px;
  }

  .doctor__photo {
    height: 100%;
    min-height: 124px;
  }

  .doctor__body {
    padding: 13px;
  }

  .doctor h3 {
    font-size: 1rem;
  }

  .doctor p {
    font-size: 0.8rem;
  }
}

@media print {
  body {
    background: #fff;
  }

  .search,
  .specialties {
    display: none;
  }

  .header,
  .doctor {
    box-shadow: none;
  }

  .doctors {
    grid-template-columns: repeat(3, 1fr);
  }
}
