.brand__logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all var(--dur-normal) var(--ease-premium);
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--primary-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-soft);
  color: var(--text-main);
}

.btn--ghost:hover {
  background: var(--bg-soft);
  border-color: var(--lavender);
}

.btn--soft {
  background: var(--lavender-soft);
  color: var(--primary);
}

.btn--soft:hover {
  background: var(--lavender);
  transform: translateY(-1px);
}

.btn--peach {
  background: var(--peach);
  color: #fff;
}

.btn--peach:hover {
  filter: brightness(1.05);
  box-shadow: var(--shadow-sm);
}

.alert {
  margin-bottom: 24px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert--error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.alert--info {
  background: var(--lavender-soft);
  border-color: var(--lavender);
  color: var(--primary);
}

.alert--success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

/* === Inputs & Forms === */
.input-group {
  margin-bottom: 16px;
}

.label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-main);
}

.input, .select {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
  transition: all var(--dur-fast) ease;
}

.input:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--lavender-soft);
}

/* === Cards === */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-normal) var(--ease-premium);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

/* === Badges === */
.badge--lavender { background: var(--lavender-soft); color: var(--primary); }
.badge--peach { background: var(--peach-soft); color: #c2410c; }
.badge--success { background: #dcfce7; color: #15803d; }

/* === Spinners === */
.spinner--sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner--inline {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.skeleton-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  min-height: 120px;
  background: linear-gradient(110deg, #eef2f6 8%, #f8fafc 18%, #eef2f6 33%);
  background-size: 200% 100%;
  animation: shimmer 1.25s ease-in-out infinite;
  border: 1px solid var(--border);
}

.skeleton-card--visit {
  min-height: 168px;
}

.skeleton-card--ds {
  min-height: 148px;
}

.skeleton-list {
  display: grid;
  gap: 16px;
}

.btn--loading:disabled,
.btn.btn-loading:disabled {
  opacity: 0.88;
}

.booking-layout.booking-layout--loading {
  position: relative;
}

.booking-layout.booking-layout--loading::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 200;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid #e5e7eb;
  border-top-color: #00a38a;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
  pointer-events: none;
}

.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1200;
  width: min(420px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  background: var(--surface);
}

.toast--info {
  background: var(--info-soft);
  border-color: #cfe0f7;
  color: #255f9f;
}

.toast--error {
  background: var(--danger-soft);
  border-color: #f2c4c4;
  color: #962a2a;
}

.toast--warning {
  background: #fff8e6;
  border-color: #f0e0b0;
  color: #7a5a00;
}

.toast__text {
  font-size: 14px;
  line-height: 1.35;
}

.active-profile-chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(131, 109, 207, 0.16);
  background: rgba(131, 109, 207, 0.06);
}

.active-profile-chip--inline {
  margin-top: 14px;
}

.active-profile-chip--card {
  margin-top: 10px;
  width: fit-content;
}

.active-profile-chip__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.active-profile-chip__name {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-main);
}

.active-profile-chip__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.toast__close {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
}

.hero-card,
.feature-card,
.filter-card,
.item-card,
.doctor-card,
.summary-card,
.result-card,
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
}

.hero-card__aside {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 240px;
}

.feature-card {
  padding: 18px;
  text-decoration: none;
  color: inherit;
}

.feature-card--accent {
  background: linear-gradient(180deg, #f3fffd 0%, #eef8f7 100%);
}

.feature-card__icon {
  font-size: 28px;
  margin-bottom: 14px;
}

.feature-card__title {
  font-size: 20px;
  margin-bottom: 8px;
}

.feature-card__text {
  color: var(--text-soft);
}

.filter-card {
  padding: 16px;
  margin-bottom: 18px;
}

.filter-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.filter-form--booking .field {
  /* Не даём полям вылезать за границы карточки на узких экранах */
  min-width: min(100%, 140px);
}

.filter-form--cabinet.filter-form--booking .field {
  min-width: min(100%, 140px);
}

.filter-form--booking .field,
.filter-form--booking .field__control {
  max-width: 100%;
}

.filter-card--booking {
  padding: 12px 14px;
}

.filter-card--booking .filter-form__row--fields {
  gap: 10px;
}

.filter-card--booking .field {
  gap: 6px;
}

.filter-card--booking .field__label {
  font-size: 13px;
  font-weight: 600;
}

.filter-card--booking .field__control {
  min-height: 40px;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 14px;
}

.filter-card--booking .filter-form__dates-pair {
  gap: 10px;
}

.filter-card--booking .filter-form__actions {
  gap: 10px;
}

.filter-card--booking .filter-form__actions .btn {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.summary-card--booking-premium .summary-list dt {
  font-size: 12px;
}

.summary-card--booking-premium .summary-list dd {
  font-size: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.field--check {
  flex-direction: row;
  align-items: center;
  min-height: 44px;
}

.field__label {
  font-size: 14px;
  color: var(--text-soft);
  font-weight: 600;
}

.field__control {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: all 0.25s var(--ease-premium);
}

.field__control:focus {
  border-color: rgba(0, 163, 138, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 163, 138, 0.14);
}

.field__control--textarea {
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
}

.field__control--center {
  text-align: center;
  letter-spacing: 0.06em;
  font-size: 20px;
  font-weight: 700;
}

.item-card,
.doctor-card {
  padding: 18px;
}

.item-card__head,
.doctor-card {
  display: flex;
  gap: 14px;
}

.doctor-card {
  align-items: flex-start;
  border-radius: 16px;
  min-height: 164px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}

.doctor-card:hover {
  transform: translateY(-2px);
  border-color: rgba(29, 169, 160, 0.38);
  box-shadow: 0 14px 26px rgba(31, 45, 61, 0.10);
  background: #fbfefe;
}

.doctor-card--selected {
  border-color: rgba(29, 169, 160, 0.55);
  box-shadow: 0 0 0 3px rgba(29, 169, 160, 0.14), 0 12px 24px rgba(31, 45, 61, 0.08);
  background: linear-gradient(180deg, #f8fffe 0%, #f3fbfa 100%);
}

.item-card__head {
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.item-card__title,
.doctor-card__title,
.section-title,
.page-title {
  font-weight: 800;
}

.page-title {
  font-size: 32px;
  line-height: 1.15;
}

.section-title {
  font-size: 20px;
}

.item-card__title {
  font-size: 18px;
  line-height: 1.16;
}

.file-icon {
  display: inline-block;
  margin-right: 6px;
  font-size: 18px;
  vertical-align: -1px;
}

.item-card__meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 13px;
}

.item-card__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.item-card__grid--single {
  grid-template-columns: 1fr;
}

.item-card__label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.item-card__value {
  font-weight: 600;
}

.item-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.appointment-card__actions {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  align-items: center;
}

.appointment-card__cancel-form {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1 1 100%;
}

@media (min-width: 640px) {
  .appointment-card__cancel-form {
    flex: 1 1 280px;
  }
}

.appointment-card__cancel-comment {
  flex: 1 1 160px;
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.appointment-card__cancel-comment:focus {
  border-color: rgba(29, 169, 160, 0.55);
  box-shadow: 0 0 0 3px rgba(29, 169, 160, 0.12);
}

.appointment-card__cancel-comment::placeholder {
  color: var(--text-muted);
}

.item-card--service {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}

.item-card--service:hover {
  transform: translateY(-2px);
  border-color: rgba(29, 169, 160, 0.36);
  box-shadow: 0 14px 26px rgba(31, 45, 61, 0.10);
  background: #fbfefe;
}

.item-card--selected {
  border-color: rgba(29, 169, 160, 0.55);
  box-shadow: 0 0 0 3px rgba(29, 169, 160, 0.14), 0 12px 24px rgba(31, 45, 61, 0.08);
  background: linear-gradient(180deg, #f8fffe 0%, #f3fbfa 100%);
}

.doctor-card__media {
  width: 92px;
  flex: 0 0 92px;
}

.doctor-card__media img,
.doctor-card__placeholder {
  width: 92px;
  height: 92px;
  border-radius: 20px;
  object-fit: cover;
}

.doctor-card__placeholder {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  font-weight: 700;
}

.doctor-card__body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doctor-card__title {
  font-size: 20px;
  line-height: 1.22;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 48px;
}

.doctor-card__subtitle {
  color: var(--primary-dark);
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doctor-card__text {
  margin-top: 10px;
  color: var(--text-soft);
}

.doctor-card__actions {
  margin-top: auto;
  padding-top: 6px;
}

@media (max-width: 1100px) {
  .doctor-card {
    min-height: 0;
  }

  .doctor-card__title {
    min-height: 0;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.badge--soft {
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.badge--upcoming {
  background: var(--info-soft);
  color: var(--info);
}

.badge--completed {
  background: var(--success-soft);
  color: var(--success);
}

.badge--refused {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge--default,
.badge--unknown {
  background: var(--surface-soft);
  color: var(--text-soft);
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
}

.empty-state.compact {
  padding: 18px;
  text-align: left;
}

.empty-state__title {
  font-size: 22px;
  margin-bottom: 8px;
}

.empty-state__text {
  color: var(--text-soft);
  margin-bottom: 16px;
}

.summary-card {
  padding: 18px;
}

.summary-card__title {
  font-size: 20px;
  margin-bottom: 14px;
}

.summary-list {
  display: grid;
  gap: 12px;
}

.summary-list dt {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.summary-list dd {
  font-weight: 700;
}

.slot-option {
  display: block;
}

.slot-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.slot-option__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 72px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: .2s ease;
}

.slot-option__content:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 169, 160, 0.35);
  box-shadow: 0 10px 18px rgba(31, 45, 61, 0.08);
}

.slot-option__date {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: .02em;
}

.slot-option__time {
  font-size: 18px;
  font-weight: 800;
}

.slot-option__meta {
  color: var(--text-soft);
  font-size: 13px;
}

.slot-option input:checked + .slot-option__content {
  border-color: rgba(29, 169, 160, 0.5);
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(29, 169, 160, 0.14), 0 8px 18px rgba(31, 45, 61, 0.09);
}

.auth-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 4px 0 8px;
}

.auth-page .auth-card {
  width: min(100%, 520px);
  padding: 20px 22px 22px;
}

.auth-page .auth-card__intro {
  margin-bottom: 14px;
}

.auth-page .auth-card__intro .page-title {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  margin: 0 0 6px;
  line-height: 1.25;
}

.auth-page .auth-card__intro .page-subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.auth-page .auth-card__intro .eyebrow {
  margin-bottom: 6px;
}

.auth-page .auth-card .form-row + .form-row {
  margin-top: 12px;
}

.auth-page .auth-card .field__control {
  min-height: 42px;
  border-radius: 12px;
  padding: 0 12px;
}

.auth-page .auth-card .btn--wide {
  min-height: 42px;
  margin-top: 4px;
}

.auth-page .auth-card .form-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.35;
}

.form-card {
  padding: 0;
  border: none;
  box-shadow: none;
}

.form-row + .form-row {
  margin-top: 16px;
}

.form-note {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 13px;
}

.result-card {
  max-width: 680px;
  margin: 36px auto 0;
  padding: 36px;
  text-align: center;
}

.result-card--error {
  border-color: #efcccc;
}

.result-card__icon {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 18px;
}

.result-card__id {
  margin: 18px 0;
  font-size: 18px;
  font-weight: 700;
}

.result-card__details {
  width: min(100%, 560px);
  margin: 18px auto 0;
  padding: 18px 20px;
  border: 1px solid rgba(125, 102, 214, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
}

.result-card__detail-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(125, 102, 214, 0.1);
}

.result-card__detail-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.result-card__detail-row span {
  color: var(--text-secondary);
}

.result-card__detail-row strong {
  color: var(--text-primary);
  text-align: right;
}

.result-card__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.price-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 800;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.page-subtitle,
.section-link {
  color: var(--text-soft);
}

.section-link {
  text-decoration: none;
  font-weight: 600;
}

.step-accordion {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.step-accordion + .step-accordion {
  margin-top: 10px;
}

.step-accordion__summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.step-accordion__summary::-webkit-details-marker {
  display: none;
}

.step-accordion__picked {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 62%;
}

.step-accordion__picked-text {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-accordion__body {
  padding: 0 16px 16px;
}

.booking-layout--loading .step-accordion__body {
  position: relative;
  min-height: 132px;
  overflow: hidden;
}

.booking-layout--loading .step-accordion__body > * {
  opacity: 0;
}

.booking-layout--loading .step-accordion__body::before {
  content: "";
  position: absolute;
  inset: 0 16px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background:
    linear-gradient(90deg, rgba(245, 249, 252, .6) 0%, rgba(255, 255, 255, .95) 48%, rgba(245, 249, 252, .6) 100%),
    linear-gradient(180deg, #f4f8fb 0%, #eef3f8 100%);
  background-size: 240% 100%, 100% 100%;
  animation: bookingSkeleton 1.05s ease-in-out infinite;
}

.booking-layout--loading .step-accordion[data-step="1"] .step-accordion__body::before {
  inset: 0 16px 16px;
  border: none;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(245, 249, 252, .65) 0%, rgba(255, 255, 255, .96) 48%, rgba(245, 249, 252, .65) 100%),
    linear-gradient(#eef3f8, #eef3f8) 0 0 / calc(50% - 8px) 120px no-repeat,
    linear-gradient(#eef3f8, #eef3f8) 100% 0 / calc(50% - 8px) 120px no-repeat;
  animation: bookingSkeleton 1.05s ease-in-out infinite;
}

.booking-layout--loading .step-accordion[data-step="2"] .step-accordion__body::before {
  inset: 0 16px 16px;
  border: none;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(245, 249, 252, .65) 0%, rgba(255, 255, 255, .96) 48%, rgba(245, 249, 252, .65) 100%),
    linear-gradient(#eef3f8, #eef3f8) 0 0 / 100% 72px no-repeat,
    linear-gradient(#eef3f8, #eef3f8) 0 84px / 100% 72px no-repeat,
    linear-gradient(#eef3f8, #eef3f8) 0 168px / 100% 72px no-repeat;
  animation: bookingSkeleton 1.05s ease-in-out infinite;
}

.booking-layout--loading .step-accordion[data-step="3"] .step-accordion__body::before {
  inset: 0 16px 16px;
  border: none;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(245, 249, 252, .65) 0%, rgba(255, 255, 255, .96) 48%, rgba(245, 249, 252, .65) 100%),
    linear-gradient(#eef3f8, #eef3f8) 0 0 / calc(25% - 9px) 64px no-repeat,
    linear-gradient(#eef3f8, #eef3f8) 25% 0 / calc(25% - 9px) 64px no-repeat,
    linear-gradient(#eef3f8, #eef3f8) 50% 0 / calc(25% - 9px) 64px no-repeat,
    linear-gradient(#eef3f8, #eef3f8) 75% 0 / calc(25% - 9px) 64px no-repeat;
  animation: bookingSkeleton 1.05s ease-in-out infinite;
}

.booking-layout--loading .summary-card {
  position: relative;
  overflow: hidden;
}

.booking-layout--loading .summary-list {
  opacity: 0;
}

.booking-layout--loading .summary-card::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 58px;
  bottom: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background:
    linear-gradient(90deg, rgba(245, 249, 252, .6) 0%, rgba(255, 255, 255, .95) 48%, rgba(245, 249, 252, .6) 100%),
    linear-gradient(180deg, #f4f8fb 0%, #eef3f8 100%);
  background-size: 240% 100%, 100% 100%;
  animation: bookingSkeleton 1.05s ease-in-out infinite;
}

/* Context loading: keep already selected earlier steps visible. */
.booking-layout--loading[data-loading-scope="after-doctor"] .step-accordion[data-step="1"] .step-accordion__body,
.booking-layout--loading[data-loading-scope="after-service"] .step-accordion[data-step="1"] .step-accordion__body,
.booking-layout--loading[data-loading-scope="after-service"] .step-accordion[data-step="2"] .step-accordion__body {
  min-height: 0;
}

.booking-layout--loading[data-loading-scope="after-doctor"] .step-accordion[data-step="1"] .step-accordion__body > *,
.booking-layout--loading[data-loading-scope="after-service"] .step-accordion[data-step="1"] .step-accordion__body > *,
.booking-layout--loading[data-loading-scope="after-service"] .step-accordion[data-step="2"] .step-accordion__body > * {
  opacity: 1;
}

.booking-layout--loading[data-loading-scope="after-doctor"] .step-accordion[data-step="1"] .step-accordion__body::before,
.booking-layout--loading[data-loading-scope="after-service"] .step-accordion[data-step="1"] .step-accordion__body::before,
.booking-layout--loading[data-loading-scope="after-service"] .step-accordion[data-step="2"] .step-accordion__body::before {
  content: none;
}

@media (max-width: 1100px) {
  .booking-layout--loading .step-accordion[data-step="1"] .step-accordion__body::before {
    background:
      linear-gradient(90deg, rgba(245, 249, 252, .65) 0%, rgba(255, 255, 255, .96) 48%, rgba(245, 249, 252, .65) 100%),
      linear-gradient(#eef3f8, #eef3f8) 0 0 / 100% 112px no-repeat,
      linear-gradient(#eef3f8, #eef3f8) 0 124px / 100% 112px no-repeat;
    animation: bookingSkeleton 1.05s ease-in-out infinite;
  }

  .booking-layout--loading .step-accordion[data-step="3"] .step-accordion__body::before {
    background:
      linear-gradient(90deg, rgba(245, 249, 252, .65) 0%, rgba(255, 255, 255, .96) 48%, rgba(245, 249, 252, .65) 100%),
      linear-gradient(#eef3f8, #eef3f8) 0 0 / calc(33.333% - 8px) 64px no-repeat,
      linear-gradient(#eef3f8, #eef3f8) 33.333% 0 / calc(33.333% - 8px) 64px no-repeat,
      linear-gradient(#eef3f8, #eef3f8) 66.666% 0 / calc(33.333% - 8px) 64px no-repeat;
    animation: bookingSkeleton 1.05s ease-in-out infinite;
  }
}

@media (max-width: 720px) {
  .booking-layout--loading .step-accordion[data-step="3"] .step-accordion__body::before {
    background:
      linear-gradient(90deg, rgba(245, 249, 252, .65) 0%, rgba(255, 255, 255, .96) 48%, rgba(245, 249, 252, .65) 100%),
      linear-gradient(#eef3f8, #eef3f8) 0 0 / calc(50% - 8px) 64px no-repeat,
      linear-gradient(#eef3f8, #eef3f8) 50% 0 / calc(50% - 8px) 64px no-repeat,
      linear-gradient(#eef3f8, #eef3f8) 0 76px / calc(50% - 8px) 64px no-repeat,
      linear-gradient(#eef3f8, #eef3f8) 50% 76px / calc(50% - 8px) 64px no-repeat;
    animation: bookingSkeleton 1.05s ease-in-out infinite;
  }
}

.step-accordion--pulse {
  animation: stepPulse 1.6s ease-out;
}

@keyframes stepPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 180, 160, .45);
    border-color: rgba(40, 180, 160, .6);
  }
  100% {
    box-shadow: var(--shadow-sm);
    border-color: var(--border);
  }
}

@keyframes bookingSkeleton {
  0% {
    background-position: 0% 0, 0 0;
  }
  100% {
    background-position: 100% 0, 0 0;
  }
}

.loader {
  display: inline-flex;
  gap: 6px;
}

.loader__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
  animation: pulse 1s infinite ease-in-out;
}

.loader__dot:nth-child(2) {
  animation-delay: .15s;
}

.loader__dot:nth-child(3) {
  animation-delay: .3s;
}

@keyframes pulse {
  0%, 100% { transform: translateY(0); opacity: .5; }
  50% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 720px) {
  .page-title {
    font-size: 26px;
  }

  .hero-card,
  .item-card__grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    flex-direction: column;
  }

  .auth-card {
    padding: 18px 16px 20px;
  }

  .result-card {
    padding: 24px;
  }
}

/* ——— Premium patient cabinet (visits, header, filters) ——— */

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
}

.page-title,
.section-title {
  letter-spacing: -0.02em;
}

.page-head--visits .page-title {
  font-weight: 700;
  font-size: clamp(26px, 4vw, 32px);
}

.site-header--premium {
  box-shadow: 0 4px 24px rgba(31, 45, 61, 0.08);
}

.site-header__brand-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.site-header--premium .brand {
  gap: 10px;
}

.site-header--premium .brand__logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 15px;
}

.site-header--premium .brand__name {
  font-size: 16px;
}

.site-header--premium .brand__sub {
  font-size: 12px;
}

.site-header__greeting {
  margin: 0;
  font-size: 15px;
  color: var(--text-soft);
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.site-header__greeting strong {
  color: var(--text);
  font-weight: 700;
}

.site-header__patient-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(160deg, var(--primary-soft), #fff);
  border: 2px solid rgba(0, 163, 138, 0.32);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--primary-dark);
  flex-shrink: 0;
}

@media (min-width: 1101px) {
  .site-header__top {
    align-items: center;
  }

  .site-header__actions {
    align-items: center;
  }
}

.cabinet-nav--tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  padding: 0;
  margin: 0 -4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.cabinet-nav--tabs .cabinet-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 48px;
  padding: 10px 14px;
  margin-bottom: -1px;
  border-radius: 0;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-weight: 600;
  text-decoration: none;
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    background-color 0.25s ease;
}

.cabinet-nav--tabs .cabinet-nav__link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  opacity: 0;
  transition:
    transform 0.3s var(--ease-premium),
    opacity 0.25s ease;
  transform-origin: center;
}

.cabinet-nav--tabs .cabinet-nav__link:hover {
  color: var(--text);
  background: rgba(0, 163, 138, 0.06);
}

.cabinet-nav--tabs .cabinet-nav__link.is-active {
  background: transparent;
  border-color: transparent;
  border-bottom-color: transparent;
  color: var(--primary-dark);
  font-weight: 700;
}

.cabinet-nav--tabs .cabinet-nav__link.is-active::after {
  transform: scaleX(1);
  opacity: 1;
}

.cabinet-nav--tabs .cabinet-nav__icon {
  flex-shrink: 0;
  opacity: 0.88;
}

.cabinet-nav--tabs .cabinet-nav__link.is-active .cabinet-nav__icon {
  opacity: 1;
  color: var(--primary);
}

.filter-card--appointments,
.filter-card--cabinet {
  padding: 20px 22px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  background: linear-gradient(180deg, #fff 0%, #fafcfd 100%);
  transition: box-shadow 0.25s var(--ease-premium);
}

.cabinet-animate .filter-card--appointments:focus-within,
.cabinet-animate .filter-card--cabinet:focus-within {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

.filter-form--appointments,
.filter-form--cabinet {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
}

.filter-form--appointments .field__label {
  font-size: 12px;
}

.filter-form--appointments .field__control {
  min-height: 38px;
  font-size: 13px;
  padding: 0 10px;
}

.filter-form--appointments .filter-form__actions .btn {
  min-height: 36px;
  font-size: 13px;
  padding: 0 12px;
}

.filter-form__row--highlight {
  width: 100%;
}

.field--check-prominent {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: 0;
  width: 100%;
  max-width: 420px;
  padding: 14px 18px;
  margin: 0;
  background: var(--primary-soft);
  border-radius: 14px;
  border: 1px solid rgba(0, 163, 138, 0.24);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.field--check-prominent:hover {
  border-color: rgba(0, 163, 138, 0.4);
  box-shadow: 0 6px 18px rgba(0, 163, 138, 0.1);
}

.field--check-prominent input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.field--check-subtle {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 160px;
}

.field--check-subtle input {
  accent-color: var(--primary);
}

.filter-form__row--fields {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  width: 100%;
}

.filter-form__dates-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1 1 100%;
  width: 100%;
}

.filter-form__dates-pair .field {
  flex: 1 1 0;
  min-width: 0;
}

@media (min-width: 960px) {
  .filter-form__dates-pair {
    flex-wrap: nowrap;
    flex: 1 1 320px;
    max-width: 420px;
    width: auto;
  }
}

.filter-form__row--fields > label.field,
.filter-form__row--fields > label.field--check {
  flex: 1 1 140px;
  min-width: min(100%, 140px);
}

.filter-form__row--fields .filter-form__dates-pair {
  min-width: min(100%, 220px);
}

.filter-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  flex: 1 1 100%;
  margin-top: 4px;
}

@media (min-width: 1100px) {
  .filter-form__actions {
    flex: 0 0 auto;
    margin-top: 0;
    margin-left: auto;
  }
}

.btn--text-reset {
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  min-height: auto;
  padding: 10px 8px;
  box-shadow: none;
}

.btn--text-reset:hover {
  color: var(--primary-dark);
  transform: none;
  background: transparent;
}

.btn--text-reset:active {
  transform: none;
}

.btn--outline {
  background: transparent;
  border: 2px solid rgba(0, 163, 138, 0.42);
  color: var(--primary-dark);
}

.btn--outline:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: scale(1.03);
}

.btn--outline-danger {
  border-color: var(--danger-border);
  color: #dc2626;
}

.btn--outline-danger:hover {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.7);
  color: #b91c1c;
  transform: scale(1.03);
}

.btn--lg-empty {
  min-height: 52px;
  padding: 0 28px;
  font-size: 16px;
}

/* Анимации дизайн-системы: появление списков и карточек */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px) translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateZ(0);
  }
}

.animated,
.animate-fade-up {
  opacity: 0;
  animation: fadeUp var(--dur-fade-up) var(--ease-premium) forwards;
  will-change: transform, opacity;
}

.item-card.visit-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 0;
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  background: linear-gradient(180deg, #fff 0%, #fafcfd 100%);
  transform: translateZ(0);
  transition: all 0.25s var(--ease-premium);
}

.item-card.visit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.visit-card__accent {
  width: 6px;
  flex-shrink: 0;
  background: var(--visit-upcoming-accent);
}

.visit-card--completed .visit-card__accent {
  background: var(--visit-completed-accent);
}

.visit-card--refused .visit-card__accent {
  background: #9e9e9e;
}

.visit-card--unknown .visit-card__accent,
.visit-card--default .visit-card__accent {
  background: var(--border-strong);
}

.visit-card--refused {
  background: var(--visit-refused-surface);
}

.visit-card__inner {
  flex: 1;
  min-width: 0;
  padding: 20px 20px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.visit-card__head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.visit-card__hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.visit-card__date-block {
  flex: 1;
  min-width: 0;
}

.visit-card__date-heading--hero {
  font-size: clamp(24px, 4.8vw, 34px);
  letter-spacing: -0.035em;
}

.visit-card__price-estimate {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-soft);
  font-weight: 500;
}

.visit-card__price-estimate strong {
  color: var(--text);
  font-weight: 700;
}

.visit-card__price-estimate--hint {
  color: var(--text-muted);
}

.visit-card__date-heading {
  margin: 0;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
}

.visit-card .badge--status {
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 9999px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.item-card.visit-card:hover .badge--status {
  transform: scale(1.03);
}

.visit-card .badge--upcoming {
  background: rgba(30, 136, 229, 0.12);
  color: #1565c0;
  border: 1px solid rgba(30, 136, 229, 0.22);
}

.visit-card .badge--completed {
  background: rgba(76, 175, 80, 0.14);
  color: #2e7d32;
  border: 1px solid rgba(76, 175, 80, 0.25);
}

.visit-card .badge--unknown,
.visit-card .badge--default {
  background: var(--surface-soft);
  color: var(--text-soft);
  border: 1px solid var(--border);
}

.badge--refused-muted {
  background: #e8eaed !important;
  color: var(--text-soft) !important;
  border: 1px solid var(--border) !important;
}

.badge__icon {
  margin-right: 6px;
}

.badge__icon--danger {
  color: #c62828;
}

.visit-card__doctor-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.visit-card__doctor-row--lg {
  gap: 16px;
  margin-bottom: 18px;
}

.doctor-avatar--lg {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
}

.doctor-avatar {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(0, 163, 138, 0.18);
  background: var(--surface-soft);
}

.visit-card__doctor-main {
  flex: 1;
  min-width: 0;
}

.visit-card__doctor-name {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}

.visit-card__time-main {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.visit-card__time-text {
  font-variant-numeric: tabular-nums;
}

.visit-card__details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.visit-card__line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
}

.visit-card__line-icon {
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  font-size: 16px;
  line-height: 1.4;
}

.visit-card__line-body {
  flex: 1;
  min-width: 0;
}

.visit-card__line-label {
  display: inline;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 6px;
}

.visit-card__line--confirmation {
  padding-top: 4px;
  margin-top: 2px;
  border-top: 1px dashed rgba(0, 0, 0, 0.06);
}

.visit-card__confirm-emoji {
  font-size: 15px;
  line-height: 1.5;
}

.visit-card__confirm-status {
  font-weight: 700;
}

.visit-card__confirm-status--yes {
  color: #2e7d32;
}

.visit-card__confirm-status--no {
  color: #e65100;
}

.visit-card__confirm-status--unknown {
  color: var(--text-soft);
  font-weight: 600;
}

.visit-card__confirm-mis-title {
  display: inline;
  margin-left: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.visit-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.visit-card__footer-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.visit-card__footer-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  justify-content: flex-end;
}

.visit-card__cancel-form.appointment-card__cancel-form {
  flex: 0 1 auto;
}

@media (max-width: 640px) {
  .visit-card__footer-secondary {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .visit-card__cancel-form {
    flex: 1 1 100%;
  }
}

.empty-state--visits-premium {
  border: none;
  border-radius: 16px;
  padding: 40px 28px 44px;
  background: linear-gradient(180deg, #fff 0%, #f4faf9 100%);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.empty-state--visits-premium .empty-state__title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.empty-state__visual {
  margin-bottom: 20px;
}

.empty-state__illustration {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.empty-state--visits-premium .empty-state__text {
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.item-card,
.doctor-card,
.filter-card {
  border-radius: 16px;
}

/* ——— Единая дизайн-система ЛК: ds-card, запись, главная ——— */

.page-head--cabinet .page-title {
  font-size: clamp(24px, 3.5vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.site-header__greeting--premium {
  font-size: 15px;
  line-height: 1.4;
}

.site-header__greeting-name {
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.ds-card {
  position: relative;
}

.ds-card__accent {
  width: 6px;
  flex-shrink: 0;
  background: var(--primary);
  align-self: stretch;
}

.ds-card__inner {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ds-card__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.ds-card__actions {
  margin-top: auto;
  padding-top: 12px;
}

.item-card.ds-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  border: none;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transform: translateZ(0);
  transition: all 0.25s var(--ease-premium);
}

.item-card.ds-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.item-card.ds-card .ds-card__inner {
  padding: 20px;
}

.item-card.ds-card .item-card__head {
  margin-bottom: 14px;
}

.item-card.ds-card .item-card__grid {
  margin-bottom: 0;
}

.badge--ds-pill {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 9999px;
}

.file-card__top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 0;
}

.file-card__icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--primary-soft);
  border: 1px solid rgba(0, 163, 138, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.file-card__head-text {
  flex: 1;
  min-width: 0;
}

.file-card {
  padding: 20px;
}

.file-card__title {
  margin-bottom: 2px;
  font-size: 1.125rem;
}

.file-card__meta {
  color: var(--text-muted);
}

.file-card__top .badge--ds-pill {
  flex-shrink: 0;
  align-self: flex-start;
}

.file-card__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin-left: auto;
}

.file-card__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.doctor-card.ds-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transform: translateZ(0);
  transition: all 0.25s var(--ease-premium);
}

.doctor-card.ds-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.doctor-card.ds-card .doctor-card__row {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
  padding: 18px 20px 18px 16px;
}

.doctor-card.ds-card .doctor-card__media {
  flex: 0 0 92px;
}

.item-card.ds-card.item-card--service .item-card__head {
  margin-bottom: 12px;
}

.item-card.ds-card.item-card--service.item-card--selected .ds-card__accent {
  background: var(--primary-dark);
}

.summary-card--booking-premium {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, #fafcfd 100%);
  position: relative;
}

.summary-card--booking-premium::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--primary);
  border-radius: 16px 0 0 16px;
}

.summary-card--booking-premium .summary-card__title {
  padding-left: 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.summary-card--booking-premium .summary-list {
  padding-left: 8px;
}

.booking-main .step-accordion {
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 163, 138, 0.12);
}

.booking-main .step-accordion__summary:hover {
  background: rgba(0, 163, 138, 0.04);
}

.slots-grid--premium .slot-option__content {
  border-radius: 14px;
  min-height: 76px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transform: translateZ(0);
  transition: all 0.25s var(--ease-premium);
}

.slots-grid--premium .slot-option__content:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.slots-grid--premium .slot-option__time {
  font-size: 19px;
}

.hero-card--cabinet-premium {
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  background: linear-gradient(135deg, #fff 0%, #f4fbfa 100%);
}

.feature-tile--premium {
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transform: translateZ(0);
  transition: all 0.25s var(--ease-premium);
}

.feature-tile--premium:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.empty-state--cabinet-premium {
  border: none;
  border-radius: 16px;
  padding: 36px 24px 40px;
  background: linear-gradient(180deg, #fff 0%, #f7fafc 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.empty-state--cabinet-premium .empty-state__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.empty-state--compact-premium {
  border-radius: 16px;
  border: 1px dashed rgba(0, 163, 138, 0.28);
  background: rgba(0, 163, 138, 0.04);
  padding: 22px 20px;
}

.empty-state--compact-premium .empty-state__text {
  margin: 0;
  color: var(--text-soft);
  font-weight: 500;
}

.empty-state__illustration--sm {
  width: 96px;
  height: 96px;
}

.result-card--cabinet-premium {
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
}

.result-card--cabinet-premium.result-card--error {
  border-color: rgba(239, 68, 68, 0.35);
  background: linear-gradient(180deg, #fff 0%, #fff8f8 100%);
}

@media (max-width: 720px) {
  .file-card__top {
    flex-wrap: wrap;
  }

  .file-card__top .badge--ds-pill {
    width: 100%;
    margin-top: 4px;
  }
}

/* ——— Главная ЛК: приветствие ——— */

.dashboard-hero.hero-card {
  flex-direction: column;
  align-items: stretch;
  padding: clamp(22px, 4vw, 32px);
}

.dashboard-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: clamp(20px, 4vw, 32px);
  align-items: start;
}

.dashboard-hero__title {
  font-size: clamp(32px, 5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-top: 6px;
}

.dashboard-hero__lead {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.5;
  max-width: 52ch;
}

.dashboard-hero__patient-meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-soft);
  max-width: 52ch;
}

.dashboard-hero__patient-meta-item {
  display: inline-block;
}

.dashboard-hero__contacts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-hero__contacts--clinic .dashboard-contact-tile {
  border-radius: 999px;
  background: rgba(212, 243, 238, 0.35);
  border-color: rgba(0, 163, 138, 0.22);
  box-shadow: none;
}

.dashboard-contact-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transform: translateZ(0);
  transition: all 0.25s var(--ease-premium);
}

.dashboard-contact-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 163, 138, 0.28);
}

.dashboard-contact-tile__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dashboard-contact-tile__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dashboard-contact-tile__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.dashboard-contact-tile__value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

.section-block--dashboard-visits {
  margin-top: 32px;
}

.section-head--dashboard {
  align-items: center;
  margin-bottom: 16px;
}

.section-title--dashboard {
  font-size: clamp(20px, 2.5vw, 24px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-link--premium {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  font-weight: 700;
  font-size: 15px;
  color: var(--primary-dark);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.section-link--premium::after {
  content: "→";
  font-size: 16px;
  transition: transform 0.25s ease;
}

.section-link--premium:hover {
  color: var(--primary);
  background: rgba(0, 163, 138, 0.08);
}

.section-link--premium:hover::after {
  transform: translateX(3px);
}

@media (max-width: 1100px) {
  .dashboard-hero__grid {
    grid-template-columns: 1fr;
  }
}

/* Анимации дизайн-системы: утилиты, микро-анимации, доступность */

@keyframes badgePop {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes emptyIllustrationFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.02);
  }
}

.cabinet-animate .ds-card .badge--ds-pill {
  animation: badgePop 0.4s var(--ease-premium) 0.4s both;
}

.cabinet-animate .empty-state__illustration,
.cabinet-animate .empty-state__illustration--sm {
  animation: emptyIllustrationFloat 4s ease-in-out infinite;
}

@media (max-width: 768px) {
  :root {
    --dur-fade-up: 0.32s;
    --stagger-step: 0.024s;
  }

  .item-card.visit-card:hover,
  .item-card.ds-card:hover,
  .doctor-card.ds-card:hover,
  .feature-tile--premium:hover,
  .dashboard-contact-tile:hover,
  .slots-grid--premium .slot-option__content:hover {
    transform: none !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.09) !important;
  }

  .item-card.visit-card:active,
  .item-card.ds-card:active,
  .doctor-card.ds-card:active,
  .feature-tile--premium:active,
  .dashboard-contact-tile:active {
    transform: scale(0.98) translateZ(0) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08) !important;
  }

  .btn--primary:hover,
  .btn--ghost:hover,
  .btn--soft:hover,
  .btn--outline:hover,
  .btn--outline-danger:hover,
  .btn--danger:hover {
    transform: none;
    filter: none;
  }

  .btn--primary:active,
  .btn--ghost:active,
  .btn--soft:active,
  .btn--outline:active {
    transform: scale(0.96);
  }

  .slots-grid--premium .slot-option__content:active {
    transform: scale(0.98);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  }

  .skeleton-card {
    animation-duration: 0.85s;
  }

  .booking-layout.booking-layout--loading::after {
    animation-duration: 0.65s;
  }
}

/* === Дизайн-система анимаций v2.0 === */

@keyframes fadeUpScale {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.96) translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) translateZ(0);
  }
}

@keyframes skeletonShimmerPremium {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.cabinet-animate .item-card.visit-card,
.cabinet-animate .item-card.ds-card,
.cabinet-animate .doctor-card.ds-card,
.cabinet-animate .dashboard-contact-tile,
.cabinet-animate .feature-tile--premium,
.cabinet-animate .slots-grid--premium .slot-option__content,
.cabinet-animate .btn {
  transition: transform 0.25s var(--ease-premium), opacity 0.25s ease;
  backface-visibility: hidden;
}

.cabinet-animate .animated,
.cabinet-animate .animate-fade-up {
  opacity: 0;
  animation: fadeUpScale 0.55s var(--ease-premium) forwards;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.cabinet-animate .appointment-card,
.cabinet-animate .document-card,
.cabinet-animate .file-card,
.cabinet-animate .doctor-card,
.cabinet-animate .time-slot,
.cabinet-animate .quick-card {
  opacity: 0;
  animation: fadeUpScale 0.55s var(--ease-premium) forwards;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.cabinet-animate .cards-list--appointments > .appointment-card:nth-child(1),
.cabinet-animate .cards-list--ds > .document-card:nth-child(1),
.cabinet-animate .cards-list--ds > .file-card:nth-child(1),
.cabinet-animate .doctor-grid--premium > .doctor-card:nth-child(1),
.cabinet-animate .slots-grid--premium > .time-slot:nth-child(1),
.cabinet-animate .cards-list--booking-services > .quick-card:nth-child(1) {
  animation-delay: 30ms;
}

.cabinet-animate .cards-list--appointments > .appointment-card:nth-child(2),
.cabinet-animate .cards-list--ds > .document-card:nth-child(2),
.cabinet-animate .cards-list--ds > .file-card:nth-child(2),
.cabinet-animate .doctor-grid--premium > .doctor-card:nth-child(2),
.cabinet-animate .slots-grid--premium > .time-slot:nth-child(2),
.cabinet-animate .cards-list--booking-services > .quick-card:nth-child(2) {
  animation-delay: 65ms;
}

.cabinet-animate .cards-list--appointments > .appointment-card:nth-child(3),
.cabinet-animate .cards-list--ds > .document-card:nth-child(3),
.cabinet-animate .cards-list--ds > .file-card:nth-child(3),
.cabinet-animate .doctor-grid--premium > .doctor-card:nth-child(3),
.cabinet-animate .slots-grid--premium > .time-slot:nth-child(3),
.cabinet-animate .cards-list--booking-services > .quick-card:nth-child(3) {
  animation-delay: 100ms;
}

.cabinet-animate .cards-list--appointments > .appointment-card:nth-child(4),
.cabinet-animate .cards-list--ds > .document-card:nth-child(4),
.cabinet-animate .cards-list--ds > .file-card:nth-child(4),
.cabinet-animate .doctor-grid--premium > .doctor-card:nth-child(4),
.cabinet-animate .slots-grid--premium > .time-slot:nth-child(4),
.cabinet-animate .cards-list--booking-services > .quick-card:nth-child(4) {
  animation-delay: 135ms;
}

.cabinet-animate .cards-list--appointments > .appointment-card:nth-child(5),
.cabinet-animate .cards-list--ds > .document-card:nth-child(5),
.cabinet-animate .cards-list--ds > .file-card:nth-child(5),
.cabinet-animate .doctor-grid--premium > .doctor-card:nth-child(5),
.cabinet-animate .slots-grid--premium > .time-slot:nth-child(5),
.cabinet-animate .cards-list--booking-services > .quick-card:nth-child(5) {
  animation-delay: 170ms;
}

.cabinet-animate .cards-list--appointments > .appointment-card:nth-child(6),
.cabinet-animate .cards-list--ds > .document-card:nth-child(6),
.cabinet-animate .cards-list--ds > .file-card:nth-child(6),
.cabinet-animate .doctor-grid--premium > .doctor-card:nth-child(6),
.cabinet-animate .slots-grid--premium > .time-slot:nth-child(6),
.cabinet-animate .cards-list--booking-services > .quick-card:nth-child(6) {
  animation-delay: 205ms;
}

.cabinet-animate .cards-list--appointments > .appointment-card:nth-child(7),
.cabinet-animate .cards-list--ds > .document-card:nth-child(7),
.cabinet-animate .cards-list--ds > .file-card:nth-child(7),
.cabinet-animate .doctor-grid--premium > .doctor-card:nth-child(7),
.cabinet-animate .slots-grid--premium > .time-slot:nth-child(7),
.cabinet-animate .cards-list--booking-services > .quick-card:nth-child(7) {
  animation-delay: 240ms;
}

.cabinet-animate .cards-list--appointments > .appointment-card:nth-child(8),
.cabinet-animate .cards-list--ds > .document-card:nth-child(8),
.cabinet-animate .cards-list--ds > .file-card:nth-child(8),
.cabinet-animate .doctor-grid--premium > .doctor-card:nth-child(8),
.cabinet-animate .slots-grid--premium > .time-slot:nth-child(8),
.cabinet-animate .cards-list--booking-services > .quick-card:nth-child(8) {
  animation-delay: 275ms;
}

.cabinet-animate .page-head--cabinet,
.cabinet-animate .hero-card--cabinet-premium {
  opacity: 0;
  animation: fadeUpScale 0.55s var(--ease-premium) forwards;
}

.cabinet-animate .filter-card--appointments,
.cabinet-animate .filter-card--cabinet {
  opacity: 0;
  animation: fadeUpScale 0.55s var(--ease-premium) 60ms forwards;
}

.cabinet-animate .alert {
  opacity: 0;
  animation: fadeUpScale 0.5s var(--ease-premium) forwards;
}

.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--lavender-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  vertical-align: middle;
  flex-shrink: 0;
  animation: spin 1s linear infinite;
}

.spinner-dual {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--lavender-soft);
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  border-radius: 50%;
  vertical-align: middle;
  animation: spin 1.1s linear infinite;
}

.skeleton {
  background: linear-gradient(90deg, #f1f1f1 25%, #e5e5e5 50%, #f1f1f1 75%);
  background-size: 200% 100%;
  animation: skeletonShimmerPremium 1.8s linear infinite;
}

.skeleton-card {
  background: linear-gradient(90deg, #f1f1f1 25%, #e5e5e5 50%, #f1f1f1 75%);
  background-size: 200% 100%;
  animation: skeletonShimmerPremium 1.8s linear infinite;
}

.btn--loading,
.btn.btn-loading,
.btn-loading {
  position: relative;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.btn--loading::after,
.btn.btn-loading::after,
.btn-loading::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
  vertical-align: middle;
}

.btn--primary.btn--loading::after,
.btn--primary.btn-loading::after {
  border-color: rgba(255, 255, 255, 0.55);
  border-top-color: transparent;
}

@media (max-width: 768px) {
  .cabinet-animate .animated,
  .cabinet-animate .animate-fade-up,
  .cabinet-animate .appointment-card,
  .cabinet-animate .document-card,
  .cabinet-animate .file-card,
  .cabinet-animate .doctor-card,
  .cabinet-animate .time-slot,
  .cabinet-animate .quick-card {
    animation: fadeUpScale 0.4s var(--ease-premium) forwards !important;
    animation-delay: 0ms !important;
  }

  .cabinet-animate .page-head--cabinet,
  .cabinet-animate .hero-card--cabinet-premium,
  .cabinet-animate .filter-card--appointments,
  .cabinet-animate .filter-card--cabinet,
  .cabinet-animate .alert {
    animation: fadeUpScale 0.4s var(--ease-premium) forwards !important;
    animation-delay: 0ms !important;
  }

  .cabinet-animate .appointment-card:hover,
  .cabinet-animate .document-card:hover {
    transform: none !important;
  }
}

@media (hover: none), (pointer: coarse) {
  .cabinet-animate .item-card.visit-card:hover,
  .cabinet-animate .item-card.ds-card:hover,
  .cabinet-animate .doctor-card.ds-card:hover,
  .cabinet-animate .feature-tile--premium:hover,
  .cabinet-animate .dashboard-contact-tile:hover,
  .cabinet-animate .slots-grid--premium .slot-option__content:hover,
  .cabinet-animate .btn--primary:hover,
  .cabinet-animate .btn--ghost:hover,
  .cabinet-animate .btn--soft:hover,
  .cabinet-animate .btn--outline:hover,
  .cabinet-animate .btn--outline-danger:hover,
  .cabinet-animate .btn--danger:hover {
    transform: none !important;
    filter: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .cabinet-animate .page-head--cabinet,
  .cabinet-animate .hero-card--cabinet-premium,
  .cabinet-animate .filter-card--appointments,
  .cabinet-animate .filter-card--cabinet,
  .cabinet-animate .alert,
  .cabinet-animate .animated,
  .cabinet-animate .animate-fade-up,
  .cabinet-animate .appointment-card,
  .cabinet-animate .document-card,
  .cabinet-animate .file-card,
  .cabinet-animate .doctor-card,
  .cabinet-animate .time-slot,
  .cabinet-animate .quick-card {
    opacity: 1 !important;
    transform: none !important;
  }

  .cabinet-animate .ds-card .badge--ds-pill {
    opacity: 1 !important;
    transform: none !important;
  }

  .cabinet-animate .empty-state__illustration,
  .cabinet-animate .empty-state__illustration--sm {
    transform: none !important;
  }
}

/* ——— Премиум ЛК: шапка, прокси, анализы, чат, оплата, модалка анкеты ——— */

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

.site-header__actions {
  position: relative;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.btn--header-compact {
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
}

.header-dropdown {
  position: relative;
  z-index: 220;
}

.header-dropdown__trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(131, 109, 207, 0.12);
  background: rgba(131, 109, 207, 0.035);
  color: var(--text);
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.header-dropdown__trigger:hover {
  border-color: rgba(131, 109, 207, 0.22);
  background: rgba(131, 109, 207, 0.1);
}

.header-notifications__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  color: #fff;
  background: #e53935;
  pointer-events: none;
}

.header-dropdown__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 14px);
  width: min(388px, calc(100vw - 32px));
  max-height: min(68vh, 720px);
  overflow: hidden;
  padding: 0;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfaff 100%);
  border: 1px solid rgba(131, 109, 207, 0.16);
  box-shadow:
    0 20px 60px rgba(36, 28, 68, 0.16),
    0 8px 24px rgba(36, 28, 68, 0.08);
  z-index: 260;
}

.header-notifications__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(131, 109, 207, 0.12);
  background: linear-gradient(180deg, rgba(131, 109, 207, 0.08) 0%, rgba(131, 109, 207, 0.02) 100%);
}

.header-notifications__head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-notifications__head-form {
  margin: 0;
}

.header-notifications__title {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.header-notifications__all {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary-dark);
  text-decoration: none;
}

.header-notifications__all:hover {
  text-decoration: underline;
}

.header-notifications__all-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.header-notifications__all--muted {
  color: var(--text-muted);
  text-decoration: none;
  cursor: default;
}

.header-notifications__empty {
  margin: 0;
  padding: 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-soft);
}

.header-notifications__list {
  list-style: none;
  margin: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(58vh, 620px);
  overflow-y: auto;
}

.header-notifications__item {
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(131, 109, 207, 0.05);
  border: 1px solid rgba(131, 109, 207, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.header-notifications__item--unread {
  border-color: rgba(131, 109, 207, 0.2);
  background: linear-gradient(180deg, rgba(131, 109, 207, 0.1) 0%, rgba(131, 109, 207, 0.04) 100%);
  box-shadow: inset 3px 0 0 rgba(131, 109, 207, 0.55);
}

.header-notifications__item-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
}

.header-notifications__item-top,
.header-notifications__item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.header-notifications__item-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.header-notifications__item-kind {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(131, 109, 207, 0.1);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.header-notifications__item-priority {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.header-notifications__item-priority--critical {
  background: rgba(217, 48, 37, 0.12);
  color: #c5221f;
}

.header-notifications__item-priority--high {
  background: rgba(245, 124, 0, 0.12);
  color: #b75c00;
}

.header-notifications__item-priority--normal {
  background: rgba(46, 125, 50, 0.1);
  color: #2e7d32;
}

.header-notifications__item-body {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.4;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.header-notifications__item-time {
  font-size: 12px;
  color: var(--text-muted);
}

.header-notifications__item-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.header-notifications__item-form {
  margin: 0;
}

.header-notifications__item-form .header-notifications__item-link {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.header-notifications__item-link:hover {
  text-decoration: underline;
}

.header-dropdown__panel::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 18px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-top: 1px solid rgba(131, 109, 207, 0.16);
  border-left: 1px solid rgba(131, 109, 207, 0.16);
  transform: rotate(45deg);
}

.proxy-access {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(0, 163, 138, 0.35);
  background: rgba(0, 163, 138, 0.04);
  max-width: 220px;
}

.proxy-access__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.proxy-access__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.proxy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.proxy-chip__av {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.proxy-chip--active {
  border-color: rgba(0, 163, 138, 0.45);
  box-shadow: 0 2px 10px rgba(0, 163, 138, 0.15);
}

.proxy-chip--pending {
  opacity: 0.72;
}

@media (max-width: 1100px) {
  .proxy-access {
    display: none;
  }
}

.doctor-card__estimate {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-soft);
}

.doctor-card__estimate strong {
  color: var(--text);
}

.doctor-card__estimate--hint {
  color: var(--text-muted);
}

.badge--new {
  background: rgba(30, 136, 229, 0.14);
  color: #1565c0;
  border: 1px solid rgba(30, 136, 229, 0.28);
}

.badge--today {
  background: rgba(0, 163, 138, 0.12);
  color: var(--primary-dark);
  border: 1px solid rgba(0, 163, 138, 0.28);
}

.cards-list--results {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-lab-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, #fafcfd 100%);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.25s var(--ease-premium),
    box-shadow 0.25s ease;
}

.result-lab-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.result-lab-card__icon {
  color: var(--primary-dark);
}

.result-lab-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.result-lab-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.result-lab-card__meta {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-soft);
}

.result-lab-card__content {
  min-width: 0;
}

.result-lab-card__action {
  justify-self: end;
}

.premium-tabs {
  margin-bottom: 32px;
}

.premium-tabs__scroller {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

.premium-tabs__tab {
  flex: 0 0 auto;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-soft);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.premium-tabs__tab.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.premium-tabs__panel {
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.timeline-premium__item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 16px;
  align-items: start;
}

.timeline-premium__dot {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 163, 138, 0.2);
}

.timeline-premium__date {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.timeline-premium__text {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-soft);
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.07);
  min-height: 420px;
  background: #fff;
}

.chat-layout__sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface-soft);
}

.chat-thread-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-thread-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

a.chat-thread-item {
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}

a.chat-thread-item:focus-visible {
  outline: 2px solid var(--primary, #00a38a);
  outline-offset: 2px;
}

.chat-thread-item.is-active {
  background: #fff;
  border-color: var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chat-thread-item__avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.chat-thread-item__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-thread-item__name {
  font-weight: 700;
  font-size: 14px;
}

.chat-thread-item__preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-layout__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.chat-header__doctor {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header__avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.chat-header__name {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.chat-header__status {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-soft);
}

.chat-status--read {
  color: #2e7d32;
  font-weight: 600;
}

.chat-messages {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, #fafcfd 0%, #fff 40%);
  overflow-y: auto;
}

.chat-bubble {
  max-width: min(100%, 420px);
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.45;
}

.chat-bubble--in {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-bubble--out {
  align-self: flex-end;
  background: var(--primary-soft);
  border: 1px solid rgba(0, 163, 138, 0.25);
  border-bottom-right-radius: 4px;
}

.chat-bubble__meta {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.chat-bubble__read {
  color: #2e7d32;
  font-weight: 600;
}

.chat-composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.chat-composer__input {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font: inherit;
  resize: vertical;
}

.chat-composer__file {
  align-self: center;
}

.chat-composer__hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .header-dropdown__panel {
    right: -6px;
    top: calc(100% + 10px);
    width: min(360px, calc(100vw - 18px));
  }

  .header-notifications__head {
    padding-inline: 14px;
  }

  .header-notifications__list {
    padding: 10px;
  }

  .chat-layout {
    grid-template-columns: 1fr;
  }

  .chat-layout__sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .chat-thread-list {
    flex-direction: row;
    overflow-x: auto;
  }
}

.invoice-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 16px;
}

.invoice-card__amount {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary-dark);
}

.notifications-groups {
  display: grid;
  gap: 18px;
}

.notifications-group__head {
  margin-bottom: 10px;
}

.notifications-group__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.notifications-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notifications-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  background:
    radial-gradient(circle at top right, rgba(131, 109, 207, 0.12), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #faf8fd 100%);
}

.notifications-overview__stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.notifications-overview__stat {
  min-width: 150px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(131, 109, 207, 0.12);
}

.notifications-overview__stat--accent {
  background: rgba(131, 109, 207, 0.09);
}

.notifications-overview__label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.notifications-overview__value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.notifications-overview__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.notifications-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notifications-filters__chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-main);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.notifications-filters__chip.is-active {
  background: var(--lavender-soft);
  border-color: rgba(131, 109, 207, 0.2);
  color: var(--primary);
}

.notifications-list__item {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notifications-list__item--unread {
  border-color: rgba(30, 136, 229, 0.3);
  box-shadow: 0 4px 16px rgba(30, 136, 229, 0.08);
}

.notifications-list__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.notifications-list__badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge--priority {
  border: 1px solid transparent;
}

.badge--priority-critical {
  background: rgba(217, 48, 37, 0.12);
  border-color: rgba(217, 48, 37, 0.14);
  color: #c5221f;
}

.badge--priority-high {
  background: rgba(245, 124, 0, 0.12);
  border-color: rgba(245, 124, 0, 0.14);
  color: #b75c00;
}

.badge--priority-normal {
  background: rgba(46, 125, 50, 0.08);
  border-color: rgba(46, 125, 50, 0.12);
  color: #2e7d32;
}

.notifications-list__title {
  font-weight: 700;
  font-size: 16px;
}

.notifications-list__body {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.45;
}

.notifications-list__time {
  font-size: 12px;
  color: var(--text-muted);
}

.notifications-list__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.notifications-list__status {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.notifications-list__status--done {
  color: var(--text-muted);
}

.notifications-list__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.notifications-list__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.notifications-list__actions form {
  margin: 0;
}

.push-setup {
  display: grid;
  gap: 10px;
}

.push-setup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.push-setup__status {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.settings-card {
  margin-top: 28px;
  padding: 22px 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, #f7fafc 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.settings-card__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .notifications-overview {
    padding: 18px;
  }

  .notifications-overview,
  .notifications-overview__actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .notifications-overview__stats,
  .notifications-filters {
    width: 100%;
  }

  .notifications-overview__stat {
    flex: 1 1 100%;
    min-width: 0;
  }

  .notifications-settings-form__grid {
    grid-template-columns: 1fr;
  }

  .notifications-list__bottom {
    flex-direction: column;
    align-items: stretch;
  }

  .notifications-list__actions {
    width: 100%;
    justify-content: stretch;
  }

  .notifications-list__actions .btn {
    min-height: 44px;
    flex: 1 1 auto;
  }

  .push-setup__actions {
    flex-direction: column;
  }

  .push-setup__actions .btn {
    width: 100%;
    min-height: 46px;
  }
}

.settings-card__text {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.5;
}

.notifications-settings-form {
  display: grid;
  gap: 20px;
}

.notifications-settings-form__section {
  display: grid;
  gap: 12px;
}

.notifications-settings-form__subtitle {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-strong);
}

.notifications-settings-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.notifications-settings-form__actions {
  display: flex;
  justify-content: flex-start;
}

.notifications-settings-form__disabled {
  opacity: 0.65;
}

.modal-premium {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-premium[hidden] {
  display: none !important;
}

.modal-premium__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.modal-premium__dialog {
  position: relative;
  width: min(480px, 100%);
  max-height: min(90vh, 640px);
  overflow: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.modal-premium__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 0;
}

.modal-premium__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-premium__close {
  border: none;
  background: var(--surface-soft);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
}

.modal-premium__body {
  padding: 16px 22px;
}

.modal-premium__lead {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.5;
}

.modal-premium__note {
  margin: 12px 0 0;
}

.previsit-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-premium__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--border);
}

body.modal-premium-open {
  overflow: hidden;
}

.btn--disabled {
  opacity: 0.55;
  pointer-events: none;
}

.cabinet-animate .result-lab-card,
.cabinet-animate .premium-tabs__panel.is-active {
  opacity: 0;
  animation: fadeUpScale 0.55s var(--ease-premium) forwards;
}

.cabinet-animate .chat-layout {
  opacity: 0;
  animation: fadeUpScale 0.55s var(--ease-premium) 40ms forwards;
}

@media (max-width: 768px) {
  .result-lab-card {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .result-lab-card__action {
    justify-self: start;
  }

  .cabinet-animate .result-lab-card,
  .cabinet-animate .premium-tabs__panel.is-active,
  .cabinet-animate .chat-layout {
    animation: fadeUpScale 0.4s var(--ease-premium) forwards !important;
    animation-delay: 0ms !important;
  }
}

@media (hover: none), (pointer: coarse) {
  .result-lab-card:hover {
    transform: none;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  }

}


/* Header polish overrides */
.header-dropdown__trigger {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid rgba(131, 109, 207, 0.08);
  background: rgba(131, 109, 207, 0.035);
}

.header-dropdown__trigger:hover {
  border-color: rgba(131, 109, 207, 0.16);
  background: rgba(131, 109, 207, 0.07);
}

.header-notifications__badge {
  top: -2px;
  right: -2px;
  min-width: 17px;
  height: 17px;
  line-height: 17px;
}
