.visit-planner {
  --vp-ink: #102b4b;
  --vp-blue: #1359db;
  --vp-line: #ccdbea;
  position: fixed;
  inset: 0;
  width: min(38rem, calc(100vw - 2rem));
  max-width: none;
  max-height: min(88vh, 52rem);
  max-height: min(88dvh, 52rem);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 24px;
  background: white;
  color: var(--vp-ink);
  box-shadow: 0 32px 100px #06162d40;
  font-family: inherit;
  text-align: left;
}

.visit-planner::backdrop { background: rgb(10 27 49 / 58%); }
html:has(.visit-planner[open]) { overflow: hidden; }
.visit-planner [hidden] { display: none !important; }
.vp-shell, .vp-shell * { box-sizing: border-box; }
.vp-shell { position: relative; padding: clamp(1.4rem, 5vw, 2.5rem); }
.vp-shell :is(button, select, input) { font: inherit; }
.vp-shell :is(button, select, label.vp-choice) { cursor: pointer; }
.vp-shell :is(button, a, select, input):focus-visible { outline: 3px solid #225bb9; outline-offset: 3px; }
.vp-shell .vp-close {
  position: absolute; top: 1rem; right: 1rem; width: 2.65rem; height: 2.65rem;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: #edf4fc; color: var(--vp-ink); padding: 0;
  font-family: system-ui, sans-serif; font-size: 1.55rem; font-weight: 400; line-height: 1;
}
.vp-header { margin: 0 0 1.65rem; padding-right: 2rem; }
.vp-header h2 {
  margin: 0 0 .65rem; font: inherit; font-size: clamp(1.9rem, 4.5vw, 2.65rem);
  letter-spacing: -.05em; font-weight: 650; line-height: 1.05; color: var(--vp-ink);
}
.vp-header h2:focus { outline: none; }
.vp-header p, .vp-list p, .vp-note, .vp-status {
  margin: 0; color: #496176; font-size: .96rem; line-height: 1.55; letter-spacing: 0;
}
.vp-form fieldset { padding: 0; margin: 0 0 1.4rem; min-width: 0; border: 0; }
.vp-form legend, .vp-timing-label {
  display: block; margin: 0 0 .6rem; padding: 0; color: var(--vp-ink);
  font-size: .96rem; font-weight: 650;
}
.vp-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.vp-choice {
  display: flex; align-items: center; gap: .55rem; padding: .9rem .75rem;
  border: 1px solid var(--vp-line); border-radius: .8rem; color: var(--vp-ink);
  font-size: .95rem; font-weight: 600; line-height: 1.25;
}
.vp-choice:has(input:checked) { background: #eef5ff; border-color: var(--vp-blue); color: #114cbd; }
.vp-choice input { appearance: auto; width: 1rem; height: 1rem; margin: 0; flex: none; accent-color: var(--vp-blue); }
.vp-timing-label span { margin-left: .2rem; color: #5d7185; font-size: .8rem; font-weight: 400; }
.vp-form select {
  width: 100%; min-height: 3rem; padding: .7rem; border: 1px solid var(--vp-line);
  border-radius: .65rem; color: var(--vp-ink); background-color: white;
}
.vp-form-actions, .vp-result-actions {
  display: flex; gap: .55rem; align-items: center; flex-wrap: wrap;
  padding-top: 1.2rem; margin-top: 1.4rem; border-top: 1px solid #deE7f0;
}
.vp-shell :is(.vp-primary, .vp-secondary, .vp-edit) {
  display: inline-flex; align-items: center; justify-content: center; gap: .8rem;
  min-height: 2.75rem; padding: .68rem 1.15rem; border: 1px solid transparent; border-radius: 999px;
  font-size: .89rem; font-weight: 650; line-height: 1.25; text-align: center;
}
.vp-shell .vp-primary { color: white; background: var(--vp-blue); }
.vp-shell .vp-primary:hover { background: #0846b8; }
.vp-shell .vp-secondary { color: var(--vp-blue); border-color: var(--vp-line); background: white; }
.vp-shell .vp-edit { color: #344c63; background: transparent; text-decoration: underline; text-underline-offset: .15rem; }
.vp-note { padding: .8rem 1rem; margin-bottom: 1rem; background: #edf5ff; border-radius: .65rem; color: #294c70; }
.vp-list { list-style: none; counter-reset: planner-item; padding: 0; margin: 0; }
.vp-list li { position: relative; counter-increment: planner-item; padding: .85rem 0 .85rem 2.55rem; border-top: 1px solid #dee7f0; }
.vp-list li::before {
  content: counter(planner-item); position: absolute; left: 0; top: .85rem; display: grid; place-items: center;
  width: 1.8rem; height: 1.8rem; border: 1px solid #cbdaec; border-radius: 50%; color: var(--vp-blue);
  font: 600 .8rem/1 system-ui, sans-serif; font-variant-numeric: tabular-nums;
}
.vp-list strong { display: block; font-size: 1rem; font-weight: 650; }
.vp-list p { margin-top: .2rem; font-size: .9rem; }
.vp-hospitals { margin-top: 1rem; }
.vp-hospitals h3 { font-size: 1rem; font-weight: 650; margin: 0 0 .45rem; }
.vp-hospital-links { display: grid; gap: .35rem; }
.vp-source { display: flex; align-items: center; justify-content: space-between; gap: .7rem; line-height: 1.4; padding: .75rem 1rem; border-radius: .65rem; background: #edf5ff; color: #0e4cb1; font-weight: 600; text-decoration: none; }
.vp-source::after { content: '→'; flex: none; }
.vp-source:hover { text-decoration: underline; text-underline-offset: .15rem; }
.vp-status:not(:empty) { margin-top: .65rem; }
@media (max-width: 520px) {
  .vp-options { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .vp-shell { padding: 1.25rem; }
  .vp-close { right: .65rem; top: .65rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .visit-planner[open] { animation: vp-appear .2s ease-out both; }
  @keyframes vp-appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
}
