/* Trip access and planner dialogs. */
html[data-theme="dark"] .access-screen {
  background: radial-gradient(ellipse at 24% 20%, #243c55, transparent 55%),
              radial-gradient(ellipse at 78% 73%, #182d3d, transparent 55%), var(--theme-subtle);
}
html[data-theme="dark"] .access-card {
  background: var(--glass);
  border-color: var(--line);
}
html[data-theme="dark"] .access-card h1 { color: var(--ink); }
html[data-theme="dark"] .access-card :is(p, label, .access-hint) { color: var(--muted); }
html[data-theme="dark"] .access-card .access-error { color: var(--theme-error); }
html[data-theme="dark"] :is(.access-card input, .pl-modal input:not([type="checkbox"]), .pl-modal textarea, .pl-modal select) {
  background: var(--theme-subtle);
  border-color: var(--theme-border);
  color: var(--ink);
}
html[data-theme="dark"] :is(.access-card input, .pl-modal input, .pl-modal textarea, .pl-search input)::placeholder { color: var(--muted); }
html[data-theme="dark"] :is(#access-submit, .pl-modal .pl-primary) {
  background: var(--theme-action);
  border-color: transparent;
  color: var(--theme-on-action);
}
html[data-theme="dark"] :is(#access-submit, .pl-modal .pl-primary):hover:enabled {
  background: color-mix(in srgb, var(--theme-action), white 12%);
}
html[data-theme="dark"] .pl-modal {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
}
html[data-theme="dark"] .pl-modal::backdrop { background: rgb(5 9 16 / 62%); }
html[data-theme="dark"] :is(.pl-modal-head, .pl-modal-footer, .pl-fieldset, .pl-empty) { border-color: var(--line); }
html[data-theme="dark"] .pl-modal-footer { background: var(--surface); }
html[data-theme="dark"] :is(.pl-modal input:not([type="checkbox"]), .pl-modal textarea, .pl-modal select):focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-soft);
}
html[data-theme="dark"] .pl-check input { accent-color: var(--theme-action); }
html[data-theme="dark"] :is(.pl-modal .pl-secondary, .pl-modal .pl-icon-button, .stay-geocode-result, .stay-pick-banner > button) {
  background: var(--theme-raised);
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="dark"] :is(.pl-modal .pl-secondary, .pl-modal .pl-icon-button, .stay-geocode-result, .stay-pick-banner > button):hover:enabled {
  background: var(--theme-hover);
}
html[data-theme="dark"] .pl-modal .pl-danger {
  background: #9c342f;
  border-color: transparent;
  color: #fff6f5;
}
html[data-theme="dark"] .pl-modal .pl-danger:hover:enabled { background: #b5453f; }
html[data-theme="dark"] .pl-danger-text { color: var(--theme-error) !important; }
html[data-theme="dark"] :is(.pl-panel-head h2, .pl-modal-head h2, .pl-label, .pl-fieldset legend, .stay-extra > summary, .stay-preview strong) {
  color: var(--ink);
}
html[data-theme="dark"] :is(.pl-intro, .pl-help, .pl-footnote, .pl-label > span, .pl-check, .pl-empty, .pl-no-results, .pl-eyebrow,
  .pl-section-head > span, .pl-location-action > span, .route-clear-description) { color: var(--muted); }
html[data-theme="dark"] :is(.stay-price-summary, .stay-preview, .stay-preview > img, .pl-category-tag, .pl-category-tag.stay) {
  background: var(--theme-raised);
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="dark"] :is(.stay-pick-banner, .pl-notice) {
  background: var(--theme-raised);
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="dark"] :is(.pl-notice .pl-text-button, .pl-text-button, .stay-pick-banner > span > .pl-icon) { color: var(--blue); }
html[data-theme="dark"] .pl-notice[data-kind="error"] { border-inline-start-color: var(--theme-error); color: var(--theme-error); }
html[data-theme="dark"] .pl-notice[data-kind="warning"] { color: var(--amber); }
html[data-theme="dark"] .pl-notice[data-kind="success"] { color: var(--theme-success); }

/* Route workspace and map labels. */
html[data-theme="dark"] :is(#workspace-plan, #route-drawer.route-drawer, #workspace-plan #route-drawer.route-drawer) {
  background: var(--surface);
  border-color: var(--line);
}
html[data-theme="dark"] #atlas-toolbar .map-options .atlas-tag {
  background: var(--theme-raised);
  border-color: var(--theme-border);
  color: var(--ink);
  box-shadow: none;
}
html[data-theme="dark"] #atlas-toolbar .map-options .atlas-tag:hover:enabled { background: var(--theme-hover); }
html[data-theme="dark"] #route-drawer .route-entry { background: var(--surface); }
html[data-theme="dark"] #route-drawer.is-content-scrolled .route-entry { background: var(--workspace-sticky-surface, var(--glass)); }
html[data-theme="dark"] #route-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow);
}
html[data-theme="dark"] #route-button:is(:hover, [aria-expanded="true"]) {
  background: var(--theme-hover);
  border-color: var(--theme-border);
}
html[data-theme="dark"] :is(.route-itinerary-style, .route-total-icon, .workspace-route-stop-number, .route-stop-number) {
  background: var(--theme-subtle);
  color: var(--muted);
}
html[data-theme="dark"] .route-itinerary-style > button { color: var(--muted); }
html[data-theme="dark"] .route-itinerary-style > button[aria-pressed="true"] { background: var(--theme-raised); color: var(--ink); }
html[data-theme="dark"] .route-itinerary-style > button[aria-pressed="false"]:hover { background: var(--theme-hover); color: var(--ink); }
html[data-theme="dark"] :is(#route-drawer .route-stop-number, .route-add-index, .route-add-stop, .route-leg-inline, .route-total,
  .route-stop-main strong, .route-legs strong, .route-legs p, .route-suggestion strong, .pl-section-head h3) { color: var(--ink); }
html[data-theme="dark"] :is(.route-stop-main small, #route-drawer .route-stop-main small, .route-leg-number, .route-leg-number span,
  .route-legs p > span, .route-legs em, .route-total div > span, .route-leg-distance, .route-empty, .route-suggestion small,
  #route-drawer .route-suggestion small, .route-suggestion > .pl-icon, .route-save-status, #route-drawer .route-save-status,
  .workspace-route-stops small, .workspace-route-warnings, .itinerary-mini-dates) { color: var(--muted); }
html[data-theme="dark"] #route-drawer .route-save-status[data-kind="error"] { color: var(--theme-error); }
html[data-theme="dark"] #route-drawer .route-save-status[data-kind="warning"] { color: var(--amber); }
html[data-theme="dark"] :is(.route-stop, .route-shared-days, .route-results) { border-color: var(--line); }
html[data-theme="dark"] :is(.route-stop, .route-total, .route-stop-main > img, .route-suggestion > img, .is-drag-source .route-stop-row) {
  background: var(--surface);
}
html[data-theme="dark"] :is(.route-shared-date, .route-save-status[data-dirty="true"]) { color: var(--blue); }
html[data-theme="dark"] :is(.route-stop-number, .route-leg-inline)::before,
html[data-theme="dark"] .route-stop-number::after {
  background-image: radial-gradient(circle, var(--theme-faint) .9px, transparent 1.4px);
}
html[data-theme="dark"] .pl-category-text {
  background: transparent;
  color: var(--muted);
}
html[data-theme="dark"] :is(#route-drawer .route-notes, .route-leg-skeleton) { background: var(--theme-raised); color: var(--muted); }
html[data-theme="dark"] .route-leg-spinner { border-color: var(--theme-border); border-top-color: var(--blue); }
html[data-theme="dark"] :is(.route-stop-actions .pl-small-icon, .route-stop-row .pl-small-icon, .route-stop-period-control) { color: var(--muted); }
html[data-theme="dark"] :is(#route-drawer .pl-icon-button, #route-drawer .route-action) { background: transparent; color: var(--ink); }
html[data-theme="dark"] #workspace-routes .workspace-route-stops button { background: transparent; color: var(--ink); }
html[data-theme="dark"] :is(.route-suggestion:hover, .route-stop-actions .pl-small-icon:hover, .route-stop-row .pl-small-icon:hover,
  .route-stop-period-control:hover, #route-drawer .pl-icon-button:hover:enabled, #route-drawer .route-action:hover:enabled,
  #workspace-routes .workspace-route-stops button:hover) { background: var(--theme-hover); color: var(--ink); }
html[data-theme="dark"] .pl-search { background: var(--theme-raised); border-color: var(--line); color: var(--muted); }
html[data-theme="dark"] .pl-search input { color: var(--ink); }
html[data-theme="dark"] .pl-search:focus-within { outline-color: var(--blue); border-color: var(--blue); }
html[data-theme="dark"] :is(.route-scroll, .pl-modal-scroll) { scrollbar-color: var(--theme-border) transparent; }
html[data-theme="dark"] .route-waypoint-tooltip { background: var(--surface); color: var(--ink); }

html[data-theme="dark"] #place-dialog .detail-actions .detail-route-control {
  --split-divider-color: var(--theme-border);
  background: var(--theme-raised);
  border-color: var(--line);
}
html[data-theme="dark"] #place-dialog .detail-actions .detail-route-control.is-in-route { border-color: var(--blue); }
html[data-theme="dark"] #place-dialog .detail-route-control > :is(#detail-route-button, .detail-route-repeat) { color: var(--ink); }
html[data-theme="dark"] #place-dialog .detail-route-control > :is(#detail-route-button, .detail-route-repeat):hover:enabled { background: var(--theme-hover); }
html[data-theme="dark"] #place-dialog .detail-route-control > .detail-route-repeat:focus-visible { outline-color: var(--blue); }
html[data-theme="dark"] #place-dialog #detail-route-button.is-in-route > .route-action-icon { color: var(--blue); }

/* Itinerary fields and diary widgets. */
html[data-theme="dark"] :is(#planner-ui, #route-drawer) {
  --itinerary-field-bg: var(--theme-raised);
  --itinerary-secondary-text: var(--muted);
}
html[data-theme="dark"] #plan-itinerary-slot { --itinerary-field-hover: var(--theme-hover); }
html[data-theme="dark"] #route-drawer[data-itinerary-style="flat"] #plan-itinerary-slot {
  --itinerary-action-color: var(--blue);
  --itinerary-field-hover: var(--blue-soft);
}
html[data-theme="dark"] #plan-itinerary-slot .atlas-sticker {
  --atlas-sticker-paper: transparent;
  color: var(--ink);
  filter: none;
}
html[data-theme="dark"] #plan-itinerary-slot .atlas-sticker > .atlas-sticker-copy { color: inherit; }
html[data-theme="dark"] .itinerary-period:has(+ .itinerary-period)::before { background: var(--theme-border); }
html[data-theme="dark"] .itinerary-period-index { color: var(--ink); }
html[data-theme="dark"] :is(.itinerary-period-index > span, .itinerary-widget-stop-number) { background: var(--surface); }
html[data-theme="dark"] :is(.itinerary-popover, .itinerary-inline-search) {
  --popover-pointer-fill: var(--surface);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
  color: var(--ink);
}
html[data-theme="dark"] :is(.itinerary-location-input, .itinerary-location-search, .itinerary-stop-period, .itinerary-date-fields input,
  .itinerary-time-input, .itinerary-diary-text, .itinerary-diary-token, .itinerary-diary-option, .itinerary-widget,
  .itinerary-widget-form-title, .itinerary-widget-selected-place, .itinerary-widget-search-result, .itinerary-section-heading,
  #plan-itinerary-slot .itinerary-custom-value, #plan-itinerary-slot :is(.itinerary-arrival-transport, .itinerary-arrival-time,
  .itinerary-day-transit, .itinerary-add-stop, .itinerary-add-period),
  #plan-itinerary-slot :is(.itinerary-location-menu, .itinerary-location-options, .itinerary-field-options) > button) { color: var(--ink); }
html[data-theme="dark"] .itinerary-diary-text.is-empty::before,
html[data-theme="dark"] .itinerary-lodging:not(:last-child) > .itinerary-stop-chip::after,
html[data-theme="dark"] :is(.itinerary-period-toggle, .itinerary-period-estimate, .itinerary-list-comma, .itinerary-stop-duration,
  .itinerary-date-fields > label, .itinerary-date-fields > label > span, .itinerary-field-form > label, .itinerary-diary-picker-heading,
  .itinerary-diary-field:not(.is-filled) .itinerary-diary-value, .itinerary-diary-widget-option > .icon,
  .itinerary-diary-edit, .itinerary-diary-remove, .itinerary-diary-widget-remove,
  [data-kind="lodging"] .route-leg-inline, :is(.itinerary-location-menu, .itinerary-location-options) > p,
  .itinerary-widget-place-copy small, .itinerary-widget-route-meta, .itinerary-widget-route-total, .itinerary-widget-route-arrow,
  .itinerary-widget-stop-number, .itinerary-widget-stop-action, .itinerary-widget-route-settings, .itinerary-widget-form-label,
  .itinerary-widget-row-action, .itinerary-widget-empty-results, button.itinerary-widget-place:disabled) { color: var(--muted); }
html[data-theme="dark"] :is(.itinerary-date-toggle:is(:hover, [aria-expanded="true"]), .itinerary-clear-period, .itinerary-clear-period:hover,
  .itinerary-field-form > .atlas-tag, .itinerary-diary-insert, .itinerary-diary-create, .itinerary-widget-use-period,
  #plan-itinerary-slot .itinerary-add-field,
  #plan-itinerary-slot :is(.itinerary-arrival-menu, .itinerary-mode-options, .itinerary-time-options) > .atlas-tag[aria-pressed="true"]) { color: var(--blue); }
html[data-theme="dark"] :is(.itinerary-field-form input, .itinerary-widget-form :is(input, select), .itinerary-widget-thumbnail,
  .itinerary-structured .itinerary-remove-field) { background: var(--theme-raised); color: var(--ink); }
html[data-theme="dark"] #plan-itinerary-slot :is(.itinerary-remove-value, .itinerary-add-location, .itinerary-stop-chip > .route-stop-remove) { color: var(--muted); }
@media (hover: hover) and (pointer: fine) {
  html[data-theme="dark"] #plan-itinerary-slot :is(.itinerary-remove-value, .itinerary-stop-chip > .route-stop-remove) { background: var(--surface); }
  html[data-theme="dark"] .itinerary-stop-chip > .route-stop-period-control { background: var(--surface); }
}
html[data-theme="dark"] :is(.itinerary-diary-option:is(:hover, :focus-visible), button.itinerary-widget-place:hover:enabled,
  button.itinerary-widget-selected-place:is(:hover, [aria-pressed="true"]), .itinerary-widget-search-result:hover, .itinerary-widget-row-action:hover:enabled,
  #plan-itinerary-slot :is(.itinerary-remove-value, .itinerary-add-location, .itinerary-stop-chip > .route-stop-remove):hover,
  #plan-itinerary-slot :is(.itinerary-location-menu, .itinerary-location-options, .itinerary-field-options) > button:hover,
  #plan-itinerary-slot :is(.itinerary-arrival-menu, .itinerary-mode-options, .itinerary-date-actions, .itinerary-time-menu,
  .itinerary-time-options) > .atlas-tag:hover) { background: var(--theme-hover); }
html[data-theme="dark"] :is(.itinerary-diary-insert, #plan-itinerary-slot .itinerary-add-field, .itinerary-widget-use-period):hover { background: var(--blue-soft); }
html[data-theme="dark"] :is(.itinerary-diary-edit:is(:hover, [aria-expanded="true"]), .itinerary-diary-remove:hover,
  .itinerary-diary-widget-remove:hover, #route-drawer .itinerary-widget-stop-action:hover) { color: var(--ink); }
html[data-theme="dark"] .itinerary-period :is(.itinerary-date-fields input, .itinerary-time-input):focus-visible { box-shadow: inset 0 -1px var(--blue); }
html[data-theme="dark"] .itinerary-widget-ticket > .itinerary-widget-place { text-decoration-color: var(--theme-border); }
html[data-theme="dark"] .itinerary-widget-stop:not(:last-child)::before { border-inline-start-color: var(--theme-faint); }

/* Date ranges and primary itinerary actions. */
html[data-theme="dark"] .itinerary-calendar-summary { border-bottom-color: var(--line); }
html[data-theme="dark"] .itinerary-calendar-summary > button { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] #plan-itinerary-slot .itinerary-calendar-summary > button:hover { background: var(--theme-hover); }
html[data-theme="dark"] .itinerary-calendar-summary > button[aria-pressed="true"] { box-shadow: inset 0 -2px var(--blue); color: var(--blue); }
html[data-theme="dark"] :is(.itinerary-calendar-summary > button > span, .itinerary-calendar-weekday) { color: var(--muted); }
html[data-theme="dark"] :is(.itinerary-calendar-nav, .itinerary-calendar-month > h4, .itinerary-calendar-day) { color: var(--ink); }
html[data-theme="dark"] :is(.itinerary-calendar-nav:hover:enabled, .itinerary-calendar-day:hover > span) { background: var(--theme-hover); }
html[data-theme="dark"] .itinerary-calendar-day:is([aria-current="date"], [data-range="preview-end"]) > span { box-shadow: inset 0 0 0 1px var(--blue); }
html[data-theme="dark"] .itinerary-calendar-day[data-range="between"] { background: var(--blue-soft); }
html[data-theme="dark"] .itinerary-calendar-day[data-range="start"] { background: linear-gradient(to right, transparent 50%, var(--blue-soft) 50%); }
html[data-theme="dark"] .itinerary-calendar-day:is([data-range="end"], [data-range="preview-end"]) { background: linear-gradient(to left, transparent 50%, var(--blue-soft) 50%); }
html[data-theme="dark"] .itinerary-calendar-day[data-endpoint] > span { box-shadow: none; }
html[data-theme="dark"] :is(.itinerary-calendar-day[data-endpoint] > span,
  #plan-itinerary-slot .itinerary-date-fields.is-range-calendar .itinerary-save-dates, .itinerary-widget-save) {
  background: var(--theme-action);
  color: var(--theme-on-action);
}
html[data-theme="dark"] :is(#plan-itinerary-slot .itinerary-date-fields.is-range-calendar .itinerary-save-dates, .itinerary-widget-save):hover:enabled {
  background: color-mix(in srgb, var(--theme-action), white 12%);
}
