.modal {
  width: min(620px, calc(100% - 30px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 22px;
  background: white;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(5, 39, 70, 0.28);
}

.modal::backdrop {
  background: rgba(7, 35, 61, 0.52);
  backdrop-filter: blur(5px);
}

.patient-modal-inner,
.appointment-modal form {
  padding: 28px;
}

.modal-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.modal-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: 24px;
}

.modal-heading p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.close-button {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #edf4f8;
  color: #587087;
  font-size: 22px;
}

.patient-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eef7ff, #f8fcff);
}

.patient-hero .avatar {
  width: 52px;
  height: 52px;
  font-size: 14px;
}

.patient-hero h3,
.patient-hero p {
  margin: 0;
}

.patient-hero h3 {
  font-size: 17px;
}

.patient-hero p {
  color: var(--muted);
  font-size: 11px;
}

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

.detail-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.detail-card small,
.detail-card strong {
  display: block;
}

.detail-card small {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.detail-card strong {
  margin-top: 4px;
  font-size: 11px;
}

.journey-section {
  margin-top: 22px;
}

.journey-section h3 {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: 15px;
}

.journey-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.journey-item {
  display: grid;
  grid-template-columns: 16px 55px 1fr auto;
  gap: 9px;
  align-items: start;
  min-height: 52px;
  color: var(--muted);
  font-size: 11px;
}

.journey-dot {
  position: relative;
  width: 10px;
  height: 10px;
  margin-top: 3px;
  border: 2px solid white;
  border-radius: 50%;
  background: #22a983;
  box-shadow: 0 0 0 2px #bce8dc;
}

.journey-dot::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 2px;
  width: 2px;
  height: 31px;
  background: #dce9ee;
}

.journey-item:last-child .journey-dot::after {
  display: none;
}

.journey-item.next .journey-dot {
  background: var(--blue);
  box-shadow: 0 0 0 2px #c9e3fb;
}

.journey-item b {
  color: var(--ink);
  font-size: 10px;
}

.journey-status {
  padding: 3px 7px;
  border-radius: 99px;
  background: var(--mint);
  color: var(--green);
  font-size: 8px;
  font-weight: 800;
}

.journey-item.next .journey-status {
  background: var(--sky);
  color: var(--blue);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.button-secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--blue);
}

.appointment-modal label {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  color: #587087;
  font-size: 11px;
  font-weight: 700;
}

.appointment-modal input,
.appointment-modal select {
  width: 100%;
  padding: 0 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.button-full {
  width: 100%;
  margin-top: 20px;
}

.form-note {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100% - 40px));
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--navy);
  color: white;
  font-size: 12px;
  box-shadow: 0 20px 45px rgba(8, 45, 82, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

