/* Availability and location voting */
.selection-page {
  display: grid;
  gap: 22px;
  color: var(--ink);
}
.app:has(.selection-page) { background: var(--paper); }
.app:has(.selection-page) .topbar { min-height: var(--header-height); }
.app:has(.selection-page) .topbar .title { font: var(--text-label); }
.app:has(.selection-page) .topbar .iconbtn { border: 0; background: transparent; box-shadow: none; }
.app:has(.selection-page .schedule-dock) { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
.selection-heading { margin: 6px 0 2px; }
.selection-heading h1 { font: var(--text-title); letter-spacing: var(--tracking-title); }
.selection-heading p { margin-top: 8px; color: var(--sub); font: var(--text-support); }
.schedule-editor, .place-editor { min-width: 0; }
.selection-page .candidate-calendar {
  margin: 0;
  padding: 8px 0 16px;
  border: 0;
  border-radius: 0;
  background: #fff;
}
.selection-page .calendar-month-title { min-height: 40px; margin: 0 0 12px; }
.selection-page .calendar-month-title h2 { font: var(--text-section); letter-spacing: var(--tracking-title); }
.calendar-legend { display: flex; align-items: center; gap: 5px; color: var(--sub); font-size: var(--type-caption); }
.calendar-legend::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.month-controls { display: flex; gap: 3px; }
.month-arrow {
  width: 44px; height: 44px; display: grid; place-content: center;
  background: var(--mist); border: 0; border-radius: 50%; cursor: pointer; font-size: 22px; line-height: 1;
}
.month-arrow:disabled { color: #b9b8c4; border-color: transparent; cursor: default; }
.selection-page .candidate-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px 1px; }
.selection-page .calendar-weekday { padding: 0 0 4px; font-size: var(--type-caption); color: var(--sub); }
.selection-page .calendar-day, .coach-anchor {
  width: min(100%, 44px); height: 42px; aspect-ratio: auto; margin: 0 auto;
  padding: 0; border-radius: 50%; font-size: var(--type-size); font-weight: 400;
}
.selection-page .calendar-day.inactive { color: #777783; }
.selection-page .calendar-day.candidate { color: var(--ink); background: var(--accent-soft); font-weight: 600; }
.selection-page .calendar-day.recommended { background: var(--accent-soft); box-shadow: none; }
.calendar-day .date-sticker { position: absolute; width: 17px; height: 17px; object-fit: contain; right: -4px; top: -4px; }
.date-sticker-key { display: flex; align-items: center; gap: 4px; margin-top: 8px; color: var(--sub); font-size: var(--type-caption); }
.date-sticker-key img { width: 19px; height: 17px; object-fit: contain; }
.selection-page .calendar-day .calendar-favorite { top: -3px; right: -3px; color: var(--accent-ink); }
.calendar-favorite .tool-art { width:16px; height:16px; }
.selection-page .selection-toolbar, .place-list-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 1px 10px;
}
.selection-toolbar h2, .place-list-title h2 { font: var(--text-section); }
.selection-toolbar h2 span, .place-list-title h2 span { color: var(--ink); font-variant-numeric: tabular-nums; }
.selection-toolbar p, .place-saved { margin: 2px 0 0; color: var(--sub); font-size: var(--type-caption); }
.selection-page .all-available { min-height: 44px; padding: 6px 12px; background: var(--mist); color: var(--charcoal); border: 0; border-radius: 10px; }
.selection-page .slot-cards { gap: 0; }
.slot-group { min-width: 0; padding: 18px 0 5px; border-top: 1px solid var(--line); }
.slot-group h3 { font: var(--text-label); }
.selection-page .slot-card { margin: 0; padding: 10px 0 13px; border: 0; box-shadow: none; border-radius: 0; background: transparent; }
.selection-page .slot-card + .slot-card { border-top: 1px solid var(--line); padding-top: 12px; }
.selection-page .slot-card:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 4px; border-radius: 4px; }
.selection-page .slot-heading { margin-bottom: 9px; }
.selection-page .slot-heading p { margin: 0; font-size: var(--type-size); color: var(--ink); }
.selection-page .slot-votes { display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; color: var(--sub); background: none; }
.slot-votes .date-sticker { width: 19px; height: 18px; object-fit: contain; }
.selection-page .schedule-options { padding: 0; gap: 6px; border: 0; background: none; }
.selection-page .schedule-options span {
  flex-direction: row; min-height: 44px; padding: 4px; gap: 5px; border: 0;
  border-radius: 10px; background: var(--mist); color: var(--charcoal); font-size: var(--type-support); font-weight: 450;
}
.selection-page .schedule-options i { font-size: var(--type-size); color: var(--sub); }
.selection-page .schedule-options input:checked + span { background:var(--action); color:var(--white); font-weight: 600; box-shadow: none; }
.selection-page .schedule-options .is-maybe input:checked + span { background: var(--mist); color: var(--ink); box-shadow: inset 0 0 0 1px var(--muted); }
.selection-page .schedule-options .is-no input:checked + span { background: var(--charcoal); color: #fff; box-shadow: none; }
.selection-page .schedule-options input:focus-visible + span { outline: 2px solid var(--charcoal); outline-offset: 2px; }
.selection-page .schedule-options input:checked + span i { color: inherit; }
.selection-page .favorite-date { min-height: 38px; width: auto; margin: 4px 0 -4px auto; padding: 3px 0 3px 8px; border: 0; color: var(--sub); font: inherit; font-size: var(--type-caption); }
.selection-page .favorite-date[aria-pressed=true] { color: var(--accent-ink); }
.favorite-date .tool-art { width:18px; height:18px; }
.selection-page .favorite-date[hidden], .draft-action:has([hidden]) { display: none; }
.selection-page .schedule-dock {
  position: fixed; z-index: 12; bottom: 0; width: min(100%, 480px); padding: 12px var(--page-inset) var(--screen-bottom);
  left: 50%; transform: translateX(-50%); border-radius: 0; background: #fff; border-top: 1px solid var(--line);
  box-shadow: none;
}
.selection-page .selection-progress { gap: 12px; margin-bottom: 8px; }
.selection-page .progress-value { color: var(--sub); font-size: var(--type-caption); }
.selection-page .selection-progress progress { height: 4px; }
.selection-page .selection-progress progress::-webkit-progress-value { background: var(--accent); transition: none; }
.selection-page .selection-progress progress::-moz-progress-bar { background: var(--accent); }
.selection-page .schedule-dock .btn { border: 0; min-height: 49px; border-radius: 12px; font-size: var(--type-size); font-weight: 600; color:var(--white); background:var(--action); transition: none; }
.selection-page .schedule-dock .btn:disabled { color: var(--sub); background: var(--line); }
.selection-page .schedule-dock .selection-status { font-size: var(--type-caption); margin: 5px 0 0; }
.selection-page .selection-status:empty, .place-error:empty { display: none; }
.selection-page .soft-details { box-shadow: none; border: 0; border-block: 1px solid var(--line); border-radius: 0; background: #fff; }
.selection-page .soft-details > summary { padding-top: 13px; padding-bottom: 13px; min-height: 48px; }
.selection-page .soft-details > summary > span { display: inline; margin: 0 0 0 7px; font-size: var(--type-caption); }
.selection-edit-link { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--type-size); color: var(--sub); }
.selection-fixed { background: var(--tint); border-radius: 14px; padding: 20px; }
.selection-fixed p, .selection-fixed small { color: var(--sub); font-size: var(--type-size); }
.selection-fixed h2 { margin: 5px 0; font: var(--text-section); }
.selection-fixed .row { margin-top: 9px; }
.place-list-title { margin: 4px 0 12px; }
.place-options, .place-management { display: grid; gap: 9px; }
.place-option { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; }
.place-option:has(:checked) { border-color: var(--accent-soft); background: var(--tint); }
.place-option .check, .place-option .check.on { align-items: center; gap: 12px; flex: 1; padding: 15px; margin: 0; min-width: 0; border: 0; background: transparent; box-shadow: none; }
.place-option input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.place-text { display: block; min-width: 0; }
.place-text strong { font-size: var(--type-size); font-weight: 550; word-break: break-word; }
.place-text small { margin-left: 6px; color: var(--sub); font-size: var(--type-size); }
.place-text > span { display: block; margin-top: 4px; color: var(--sub); font-size: var(--type-size); }
.place-map { display: inline-flex; align-items: center; flex: none; min-height: 44px; margin-right: 13px; color: var(--accent-ink); font-size: var(--type-caption); text-decoration: none; }
.selection-page .place-status { margin: 0 0 7px; font-size: var(--type-caption); color: var(--sub); text-align: left; }
.place-results h2 { font: var(--text-section); }

.midpoint-panel {display:grid;gap:24px}
.midpoint-panel h2 {margin:0;font:var(--text-section);letter-spacing:var(--tracking-title)}
.midpoint-panel h3 {font:var(--text-label)}
.midpoint-origin:empty {display:none}
.midpoint-form {display:grid;gap:10px}
.midpoint-form :is(input, select) {min-width:0;width:100%;min-height:46px;background:#fff}
.midpoint-form .err:empty {display:none}
.origin-actions {display:flex;gap:8px}
.origin-actions .primary {min-height:44px;flex:1}
.coordinate-pair {display:grid;grid-template-columns:1fr 1fr;gap:10px}
.coordinate-pair[hidden] {display:none}
.origin-saved {display:flex;align-items:center;gap:6px;margin-top:10px;padding:10px 0;border-bottom:1px solid var(--line)}
.origin-saved .tool-art,.midpoint-result-head .tool-art {width:28px;height:28px;margin-right:4px}
.origin-saved .grow {min-width:0;overflow-wrap:anywhere}
.origin-saved small {display:block;color:var(--sub);font-size:var(--type-size)}
.midpoint-result {display:grid;gap:12px;padding:18px;border:0;border-radius:12px;background:var(--mist)}
.midpoint-result p {margin:0;color:var(--sub);font-size:var(--type-size);line-height:1.55}
.midpoint-result-head {display:flex;gap:7px;align-items:center}
.midpoint-result>.btn.small {justify-self:start}
.midpoint-nearby {display:grid;gap:10px;border-top:1px solid var(--line);padding-top:14px}
.midpoint-place {display:flex;align-items:center;gap:6px;padding:10px 0;border-bottom:1px solid var(--line)}
.midpoint-place strong {font-weight:550}

/* A native modal keeps the spotlighted date and the close control in the same tab order. */
html:has(.date-coach[open]) { overflow: hidden; }
.date-coach {
  position: fixed; inset: 0; margin: 0; height: 100%; width: 100%; max-height: none; max-width: none;
  padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); overflow: hidden;
}
.date-coach::backdrop { background: transparent; }
.selection-page .date-coach > .calendar-day {
  position: absolute; left: var(--spot-x); top: var(--spot-y); width: var(--spot-w); height: var(--spot-h);
  margin: 0; border-radius: 50%; background: var(--accent-soft); color: var(--ink); font-size: var(--type-size);
  box-shadow: 0 0 0 4px #fff, 0 0 0 200vmax rgba(27, 26, 35, .66);
}
.date-coach .calendar-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.coach-copy {
  position: absolute; display: flex; gap: 11px; align-items: flex-start; width: max-content; max-width: min(312px, calc(100vw - 24px));
  padding: 14px 16px 7px; background: #fff; border-radius: 10px; box-shadow: 0 6px 24px #24232c1a;
}
.coach-copy::before {
  position: absolute; content: ''; width: 10px; height: 10px; top: -5px; left: clamp(12px, var(--arrow-x), calc(100% - 12px));
  transform: translateX(-50%) rotate(45deg); background: #fff;
}
.coach-copy.above::before { top: auto; bottom: -5px; }
.coach-bear { width: 43px; height: 43px; object-fit: contain; margin-top: 2px; }
.coach-copy h2 { font: var(--text-label); }
.coach-copy p { margin-top: 3px; color: var(--sub); font: var(--text-support); }
.coach-dismiss { min-height: 38px; margin-top: 1px; padding: 0 4px 0 0; border: 0; background: transparent; color: var(--accent-ink); font-size: var(--type-size); cursor: pointer; }
@media (max-width: 359px) {
  .selection-page .calendar-day, .coach-anchor { height: 38px; }
  .place-option .check { padding: 12px 10px; }
}
