.detail-main {
  padding-top: 16px;
  padding-bottom: 0;
}

.doctor-detail {
  display: grid;
  grid-template-columns: minmax(300px, 0.66fr) minmax(0, 1.34fr);
  gap: 14px;
  align-items: stretch;
  min-width: 0;
}

.schedule-stop-notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #f0d2c5;
  border-radius: 8px;
  background: #fff7f2;
}

.schedule-stop-notice h2 {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 900;
}

.schedule-stop-notice .stop-list {
  display: grid;
  gap: 6px;
}

.schedule-stop-notice .stop-item {
  margin: 0;
  padding: 6px 9px;
  font-size: 12px;
}

.doctor-schedule {
  position: relative;
  min-width: 0;
  height: 100%;
  overflow: visible;
  padding: 20px 22px;
}

.doctor-profile {
  position: sticky;
  top: 92px;
  height: 100%;
  overflow: visible;
  padding: 20px 22px;
}

.profile-head {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(238, 227, 216, 0.84);
}

.profile-head img,
.detail-fallback {
  width: 92px;
  height: 128px;
  border-radius: 8px;
  object-fit: cover;
  background: #f2e5db;
}

.detail-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: 36px;
  font-weight: 900;
}

.profile-head h1 {
  margin: 0;
  color: #211713;
  font-size: 26px;
  line-height: 1.2;
}

.profile-head p {
  margin: 6px 0 0;
  color: #75675f;
}

.detail-section {
  padding-top: 14px;
}

.detail-section h2,
.schedule-head h2 {
  margin: 0 0 8px;
  color: #211713;
  font-size: 18px;
}

.detail-section p {
  margin: 0;
  color: #5f524b;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
}

.price-row,
.stop-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.price-item,
.stop-item {
  padding: 10px 13px;
  border-radius: 8px;
  background: #fff7ef;
  color: #6d5c54;
  font-size: 14px;
}

.stop-item {
  background: #fff7ef;
  color: #75675f;
  font-weight: 400;
}

.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 18px;
}

.schedule-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.schedule-head p {
  margin: 4px 0 0;
  color: #75675f;
  font-size: 13px;
}

.date-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
  margin-bottom: 12px;
  padding: 0;
}

.date-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 6px 5px;
  border: 1px solid #eadbd0;
  border-radius: 8px;
  background: #fffdf9;
  color: #5f524b;
  font-weight: 600;
}

.date-tab-day {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.date-tab-week {
  display: block;
  margin-top: 3px;
  color: #8a7e77;
  font-size: 12px;
  line-height: 1.15;
}

.date-tab.is-active {
  border-color: var(--brand);
  background: #fff2e8;
  color: var(--brand);
}

.date-tab.is-active .date-tab-week {
  color: var(--brand);
}

.period-list {
  display: grid;
  gap: 10px;
}

.period-detail {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid #eadbd0;
  border-radius: 8px;
  background: #fffdf9;
}

.period-name {
  color: #211713;
  font-size: 17px;
  font-weight: 600;
}

.period-meta {
  color: #685a53;
  font-size: 14px;
  font-weight: 400;
}

.period-meta strong {
  display: block;
  color: #211713;
  font-weight: 400;
}

.period-fee {
  display: block;
  margin-top: 4px;
  color: var(--brand);
  font-weight: 500;
}

.period-action {
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 8px;
}

.period-action .btn-primary,
.period-action .btn-onsite,
.period-action .status-badge {
  min-width: 96px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
}

.period-action .btn-primary {
  border-color: #3fc51d;
  background: #3fc51d;
  color: #fff;
}

.period-action .btn-onsite {
  border-color: #955b3a;
  background: #955b3a;
  color: #fff;
}

.period-action .status-badge {
  color: #fff;
}

.period-action .status-bookable,
.period-action .status-today {
  background: #3fc51d;
}

.period-action .status-stopped,
.period-action .status-holiday {
  background: #ff4b55;
}

.period-action .status-onsite {
  background: #955b3a;
}

.period-action .status-full,
.period-action .status-soon,
.period-action .status-empty {
  background: #a9542c;
}

.schedule-empty {
  padding: 28px;
  border: 1px dashed #ead9c9;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
}

@keyframes detail-skeleton-shimmer {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

.detail-skeleton-block {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: #f4ebe3;
  background-image: linear-gradient(90deg, #f4ebe3 0%, #fff8f1 48%, #f4ebe3 100%);
  background-size: 220% 100%;
  animation: detail-skeleton-shimmer 1.18s ease-in-out infinite;
}

.detail-skeleton-photo,
.detail-skeleton-period span {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: #f4ebe3;
  background-image: linear-gradient(90deg, #f4ebe3 0%, #fff8f1 48%, #f4ebe3 100%);
  background-size: 220% 100%;
  animation: detail-skeleton-shimmer 1.18s ease-in-out infinite;
}

.detail-skeleton-photo {
  width: 92px;
  height: 128px;
}

.detail-skeleton-copy {
  display: grid;
  gap: 12px;
}

.detail-skeleton-name {
  width: 118px;
  height: 28px;
}

.detail-skeleton-title {
  width: 86px;
  height: 16px;
}

.detail-skeleton-heading {
  width: 96px;
  height: 22px;
  margin-bottom: 14px;
}

.detail-skeleton-text {
  width: 100%;
  height: 15px;
  margin-top: 9px;
}

.detail-skeleton-text.is-short {
  width: 72%;
}

.detail-skeleton-text.is-medium {
  width: 84%;
}

.detail-skeleton-schedule-title {
  width: 112px;
  height: 24px;
}

.detail-skeleton-schedule-subtitle {
  width: 260px;
  max-width: 72vw;
  height: 14px;
  margin-top: 10px;
}

.detail-skeleton-tabs {
  display: grid;
  grid-template-columns: repeat(3, 96px);
  gap: 8px;
  margin-bottom: 16px;
}

.detail-skeleton-tab {
  height: 58px;
}

.detail-skeleton-period {
  display: grid;
  grid-template-columns: 86px 1fr 96px;
  gap: 14px;
  align-items: center;
  min-height: 92px;
  padding: 16px 18px;
  border: 1px solid #eadbd0;
  border-radius: 8px;
  background: #fffdf9;
}

.detail-skeleton-period span {
  height: 18px;
}

.detail-skeleton-period span:nth-child(2) {
  height: 34px;
}

.detail-skeleton-period span:nth-child(3) {
  height: 40px;
  border-radius: 999px;
}

@media (max-width: 980px) {
  .doctor-detail {
    grid-template-columns: 1fr;
  }

  .doctor-profile {
    position: static;
  }

}

@media (max-width: 860px) {
  .doctor-detail {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
  }

  .doctor-schedule {
    width: 100%;
    min-width: 0;
    max-height: none;
    overflow: visible;
    padding: 20px;
  }

  .doctor-profile {
    display: contents;
  }

  .profile-head {
    order: 2;
    margin: 0;
    padding: 14px 16px 18px;
    border: 1px solid #eadbd0;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: #fff;
  }

  .detail-section p {
    display: block;
    overflow: visible;
  }

  .doctor-schedule {
    order: 3;
    height: auto;
    margin-bottom: 12px;
    padding-top: 20px;
  }

  .detail-section {
    margin: 0;
    padding: 0 16px 14px;
    border-right: 1px solid #eadbd0;
    border-left: 1px solid #eadbd0;
    background: #fff;
  }

  .detail-section:first-of-type {
    order: 4;
    padding-top: 20px;
    border-top: 1px solid #eadbd0;
    border-radius: 8px 8px 0 0;
  }

  .detail-section:last-of-type {
    order: 5;
    padding-bottom: 20px;
    border-bottom: 1px solid #eadbd0;
    border-radius: 0 0 8px 8px;
  }
}

@media (max-width: 640px) {

  .profile-head {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 14px;
  }

  .profile-head img,
  .detail-fallback {
    width: 78px;
    height: 108px;
  }

  .detail-skeleton-photo {
    width: 78px;
    height: 108px;
  }

  .profile-head h1 {
    font-size: 24px;
  }

  .schedule-head {
    display: block;
  }

  .doctor-schedule {
    padding-right: 16px;
    padding-left: 16px;
  }

  .date-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px;
    overflow: visible;
    padding: 2px 0 8px;
  }

  .date-tab {
    flex: 0 0 50px;
    width: 50px;
    min-height: 60px;
    padding: 5px 4px;
    border: 1px solid #8d5d41;
    border-radius: 8px;
    color: #7a553f;
  }

  .date-tab.is-active {
    border-color: #7a553f;
    background: #7a553f;
    color: #fff;
    box-shadow: 0 10px 20px rgba(80, 42, 20, 0.16);
  }

  .date-tab-day {
    order: 2;
    margin-top: 3px;
    color: #6e4935;
    font-size: 13px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .date-tab-week {
    order: 1;
    margin-top: 0;
    color: #7a553f;
    font-size: 12px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .date-tab.is-active .date-tab-day,
  .date-tab.is-active .date-tab-week {
    color: #fff;
  }

  @media (min-width: 390px) {
    .date-tabs {
      gap: 4px;
    }
  }

  @media (max-width: 380px) {
    .date-tabs {
      gap: 4px;
    }

    .date-tab {
      flex-basis: 45px;
      width: 45px;
      min-height: 55px;
      padding: 4px 3px;
    }

    .date-tab-day {
      margin-top: 2px;
      font-size: 12px;
    }

    .date-tab-week {
      font-size: 11px;
    }
  }

  .detail-skeleton-tabs {
    display: flex;
    grid-template-columns: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 8px;
    overflow: hidden;
  }

  .detail-skeleton-tab {
    flex: 0 0 74px;
    width: 74px;
    height: 72px;
  }

  .period-detail {
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 5px 10px;
    align-items: center;
  }

  .detail-skeleton-period {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .period-name {
    grid-column: 1 / 2;
    grid-row: 1;
  }

  .period-meta {
    grid-column: 1 / 2;
    grid-row: 2;
    min-width: 0;
  }

  .period-action {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    align-self: center;
    justify-self: end;
  }

  .period-action .btn-primary,
  .period-action .btn-onsite,
  .period-action .status-badge {
    min-width: 88px;
    min-height: 34px;
    padding: 0 14px;
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  .doctor-schedule {
    padding-right: 12px;
    padding-left: 12px;
  }

}
