:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Light only: soft neutral greys with orange highlights. */
  --bg: #f6f6f5;
  --surface: #ffffff;
  --text: #1f1f1f;
  --muted: #636363;
  --faint: #8a8a8a;
  --grey-soft: #efefed; /* quiet buttons */
  --grey-hover: #e3e3e0;
  --grey-ink: #454545;
  --border: #e7e7e5;
  --border-strong: #d4d4d1;
  --accent: #d64200; /* vivid orange, still 4.5:1 with white text and on white */
  --accent-hover: #b33600;
  --accent-ink: #b33600; /* orange text on the orange tint, where --accent is too light */
  --accent-soft: #ffeadb;
  --accent-text: #ffffff;
  --highlight: #ff6a00; /* brightest orange, for decoration only (map routes) */
  --success-soft: #e9f5ee;
  --success: #1d6b45;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --michelin: #b3121f;
  --michelin-soft: #fdeceb;
  --shadow: 0 1px 2px rgb(20 20 20 / 4%), 0 8px 24px rgb(20 20 20 / 5%);
  --radius: 14px;
  --radius-sm: 10px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-hover);
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

/* --- Top bar ------------------------------------------------------------ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 32px;
  height: 32px;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

/* --- Buttons ------------------------------------------------------------ */

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.text-button {
  border: 0;
  background: none;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: 6px;
  color: var(--accent);
  font-weight: 550;
  cursor: pointer;
}

.text-button:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.text-button.small {
  font-size: 14px;
}

/* --- Plan form ------------------------------------------------------------ */

.plan {
  padding-top: 8vh;
}

.plan h1 {
  margin: 0;
  font-size: clamp(28px, 4.5vw, 38px);
  line-height: 1.15;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.lede {
  margin: 10px 0 28px;
  color: var(--muted);
  font-size: 17px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.trip-form {
  display: grid;
  gap: 20px;
  padding: 24px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field-footer:has(.hint:empty):has(.text-button[hidden]) {
  display: none;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.location {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}

.location .text-button {
  color: var(--accent-ink);
}

.location-icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: var(--accent);
}

.location.is-busy .location-icon {
  animation: pulse 1.2s ease-in-out infinite;
}

.location-text {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  column-gap: 8px;
  min-width: 0;
}

#from-location-title {
  font-weight: 600;
}

.location-detail {
  color: var(--muted);
}

/* --- Combobox ------------------------------------------------------------- */

.combobox {
  position: relative;
}

.combobox input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 17px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.combobox input::placeholder {
  color: var(--faint);
}

.combobox input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.listbox {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.option {
  display: flex;
  flex-direction: column;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.option[aria-selected="true"],
.option:hover {
  background: var(--accent-soft);
}

.option-name {
  font-weight: 450;
}

.option-name mark {
  background: none;
  color: inherit;
  font-weight: 700;
}

.option-detail {
  color: var(--muted);
  font-size: 14px;
}

.listbox-message {
  padding: 9px 12px;
  color: var(--muted);
  font-size: 14px;
}

/* Destinations after the first */

.more-stops {
  display: grid;
  gap: 16px;
}

.more-stops:empty {
  display: none;
}

.stop {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--grey-soft);
}

.stop legend {
  float: left; /* keeps the legend inside the box */
  padding: 0;
}

.stop-from {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.stop .remove-stop {
  justify-self: start;
  color: var(--muted);
  margin: 0;
}

.add-stop {
  justify-self: start;
  margin: -8px 0 0;
}

.stop-mode {
  display: grid;
  gap: 4px;
}

.stop-mode-label,
.mode-switch-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.stop-mode-label .select,
.mode-switch-label .select {
  flex: 1;
  min-width: 200px;
}

.mode-switch-label {
  margin-top: 6px;
  font-size: 13px;
}

.mode-switch-label .select select {
  height: 34px;
  font-size: 14px;
}

.stop-mode-hint {
  margin: 0;
  color: var(--faint);
  font-size: 13px;
}

.stop-mode-hint:empty {
  display: none;
}

.agenda-place {
  margin-left: 8px;
  color: var(--accent-ink);
  font-weight: 600;
}

.form-hint {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.form-hint:empty {
  display: none;
}

.form-error {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 15px;
}

/* --- Selects ---------------------------------------------------------------- */

.field-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.select {
  position: relative;
}

.select select {
  width: 100%;
  height: 52px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 17px;
  appearance: none;
  cursor: pointer;
}

.select select:hover {
  border-color: var(--accent);
}

.select select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Chevron drawn with borders so it follows the theme colors. */
.select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* --- Dates ------------------------------------------------------------------ */

.optional {
  margin-left: 6px;
  color: var(--faint);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.date-field {
  position: relative;
}

.date-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 17px;
  text-align: left;
  cursor: pointer;
}

.date-button:hover,
.date-button[aria-expanded="true"] {
  border-color: var(--accent);
}

.date-button svg,
.trip-dates svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: var(--muted);
}

.date-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-value.is-empty {
  color: var(--faint);
}

.date-nights {
  flex: none;
  color: var(--muted);
  font-size: 15px;
}

.calendar {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cal-status {
  flex: 1;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.cal-nav {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.cal-nav:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.cal-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.cal-months {
  display: flex;
  gap: 28px;
}

.cal-month-title {
  margin-bottom: 6px;
  text-align: center;
  font-weight: 650;
}

.cal-grid {
  border-collapse: separate;
  border-spacing: 0 2px;
}

.cal-grid th {
  width: 40px;
  padding-bottom: 4px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
}

.cal-grid td {
  padding: 0;
}

.cal-day {
  position: relative;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.cal-day:not(.is-disabled, .is-start, .is-end, .in-range):hover {
  background: var(--accent-soft);
}

.cal-day.in-range:hover {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.cal-day.is-today::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: currentColor;
}

.cal-grid td.in-range {
  background: var(--accent-soft);
}

.cal-grid td.range-start {
  background: linear-gradient(to right, transparent 50%, var(--accent-soft) 50%);
}

.cal-grid td.range-end {
  background: linear-gradient(to left, transparent 50%, var(--accent-soft) 50%);
}

.cal-day.is-start,
.cal-day.is-end {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 650;
}

.cal-day.is-disabled {
  color: var(--faint);
  opacity: 0.45;
  cursor: default;
}

.cal-day:focus-visible {
  outline-offset: -2px;
}

.cal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.cal-done {
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  cursor: pointer;
}

.trip-header {
  display: grid;
  gap: 4px;
}

.trip-dates {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  margin-left: -10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.trip-meta {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.trip-dates:hover,
.trip-dates[aria-expanded="true"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* --- Chat ------------------------------------------------------------------ */

.chat {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
}

.trip-route {
  margin: 0;
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.trip-route .arrow {
  color: var(--faint);
  font-weight: 400;
  margin: 0 6px;
}

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

.messages,
.message,
.message .text {
  min-width: 0;
}

.message .text,
.message.user,
.result-body {
  overflow-wrap: anywhere;
}

.message.user {
  align-self: flex-end;
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius) var(--radius) 4px var(--radius);
  background: var(--accent);
  color: var(--accent-text);
}

.message.agent {
  display: grid;
  gap: 14px;
  max-width: 100%;
}

.message.agent .text > :first-child {
  margin-top: 0;
}

.message.agent .text > :last-child {
  margin-bottom: 0;
}

.message.agent .text p,
.message.agent .text ul,
.message.agent .text ol {
  margin: 0 0 10px;
}

.message.agent .text ul,
.message.agent .text ol {
  padding-left: 22px;
}

.message.agent .text li + li {
  margin-top: 4px;
}

.message.error {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 15px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.chip {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
}

.chip:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dock {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 12px;
  margin: 0 -8px;
  padding: 8px 8px 16px;
  background: var(--bg);
}

/* Fade content out as it scrolls under the dock. */
.dock::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 24px;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.composer:focus-within {
  border-color: var(--accent);
}

.composer textarea {
  flex: 1;
  min-height: 40px;
  max-height: 160px;
  padding: 8px 0;
  border: 0;
  resize: none;
  background: transparent;
  line-height: 1.45;
}

.composer textarea:focus {
  outline: none;
}

.send-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  cursor: pointer;
}

.send-button svg {
  width: 18px;
  height: 18px;
  fill: var(--accent-text);
}

.send-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* --- Result cards ------------------------------------------------------------ */

.results {
  overflow: hidden;
}

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

.results-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.results-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.result-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.result {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 14px 18px;
}

.result + .result {
  border-top: 1px solid var(--border);
}

.result.no-image {
  grid-template-columns: 1fr;
}

.thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--border);
}

.thumb.placeholder {
  background:
    radial-gradient(circle at 50% 42%, var(--border-strong) 0 7px, transparent 8px),
    var(--accent-soft);
}

.result-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.result-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-weight: 600;
}

.result-meta,
.result-note {
  color: var(--muted);
  font-size: 14px;
}

.result-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 15px;
}

.result-quote {
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
}

.result-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 14px;
}

.badge {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

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

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

.results-footnote {
  margin: 0;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.results-footnote + .results-footnote {
  border-top: 0;
  padding-top: 0;
}

.link-buttons {
  display: grid;
  gap: 8px;
  padding: 14px 18px;
}

.link-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 550;
  text-decoration: none;
}

.link-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.link-button .external {
  color: var(--faint);
  font-size: 14px;
  font-weight: 400;
}

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

.recommendation strong {
  display: block;
  font-size: 17px;
}

.recommendation p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* --- Agenda ------------------------------------------------------------------ */

.agenda-days {
  margin: 0;
  padding: 0;
  list-style: none;
}

.agenda-day {
  padding: 14px 18px 16px;
}

.agenda-day + .agenda-day {
  border-top: 1px solid var(--border);
}

.agenda-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.agenda-day-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.agenda-date {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 500;
}

/* Calls to action on the agenda: solid orange pills, like the main button. */
.map-button,
.pdf-button,
.swap-button {
  display: inline-flex;
  flex: none;
  align-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(20 20 20 / 12%);
  transition: background 120ms ease, transform 120ms ease;
}

.map-button,
.pdf-button {
  gap: 7px;
  padding: 8px 16px;
  font-size: 14px;
}

.map-button:hover:not(:disabled),
.pdf-button:hover:not(:disabled),
.swap-button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.map-button:active:not(:disabled),
.pdf-button:active:not(:disabled),
.swap-button:active:not(:disabled) {
  transform: translateY(1px);
}

.map-button svg,
.pdf-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.pdf-button.is-busy {
  cursor: progress;
  opacity: 0.8;
}

.agenda-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
}

.pdf-error {
  color: var(--danger);
}

.agenda-items {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agenda-item {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  align-items: start;
  gap: 12px;
  margin: 0 -8px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.agenda-item.is-new {
  background: var(--accent-soft);
  animation: settle 2.4s ease-out 0.4s forwards;
}

.agenda-item.is-moved .agenda-time {
  color: var(--accent-ink);
  font-weight: 600;
}

@keyframes settle {
  to {
    background: transparent;
  }
}

/* Swap and Share are quieter than the main actions: grey pills. */
.share-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--grey-soft);
  color: var(--grey-ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.share-button:hover {
  border-color: var(--faint);
  background: var(--grey-hover);
  color: var(--text);
}

.share-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.agenda-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swap-button {
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid var(--border-strong);
  background: var(--grey-soft);
  color: var(--grey-ink);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}

.swap-button:hover:not(:disabled) {
  border-color: var(--faint);
  background: var(--grey-hover);
  color: var(--text);
}

.swap-button svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.swap-button:disabled {
  opacity: 0.45;
  box-shadow: none;
  cursor: not-allowed;
}

.agenda-time {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.agenda-activity {
  font-weight: 550;
}

.agenda-meta {
  color: var(--muted);
  font-size: 14px;
}

.agenda-header p.agenda-costs {
  margin-top: 2px;
  color: var(--text);
  font-size: 13px;
}

.agenda-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
}

.agenda.is-drafting button:disabled {
  opacity: 0.45;
  box-shadow: none;
  cursor: not-allowed;
}

.agenda.is-drafting .agenda-day:last-child {
  animation: arrive 400ms ease-out;
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.agenda-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 6px;
  font-size: 13px;
}

/* Where to book: a flight, a hotel room or a table. */
.book-link {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid #f6c3a6;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.book-link:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

.phone-link {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.phone-link:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

.flight-option {
  color: var(--muted);
}

.agenda-flight {
  background: var(--grey-soft);
}

.agenda-flight .agenda-time svg {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  fill: var(--accent);
}

.agenda.is-outdated .results-header {
  border-bottom: 0;
}

/* --- Swap popup ---------------------------------------------------------------- */

.swap-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.swap-dialog[open] {
  display: flex;
}

.swap-dialog::backdrop {
  background: rgb(30 30 30 / 35%);
}

.swap-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.swap-body {
  overflow-y: auto;
  padding: 6px 18px 18px;
}

.swap-error {
  margin: 12px 18px 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
}

.swap-group h3 {
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.swap-list {
  display: grid;
  gap: 8px;
}

.swap-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.swap-option:hover:not(:disabled),
.swap-option.is-busy {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.swap-option:disabled:not(.is-busy) {
  opacity: 0.5;
  cursor: wait;
}

.swap-option-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.swap-option-title {
  font-weight: 600;
}

.swap-option-meta {
  color: var(--muted);
  font-size: 14px;
}

.swap-empty {
  margin: 18px 0 6px;
  color: var(--muted);
}

/* --- Share popup ----------------------------------------------------------------- */

.share-body {
  display: grid;
  gap: 8px;
  padding: 16px 18px 20px;
}

.share-link-row {
  display: flex;
  gap: 8px;
}

.share-link-row input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--grey-soft);
  color: var(--muted);
  font: 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.share-status {
  min-height: 1.2em;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.share-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.share-action:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.share-action:disabled,
.share-action[aria-disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.open-saved {
  margin: -6px 0 0;
  text-align: center;
}

/* --- Trip summary (the opening message) ------------------------------------------ */

.trip-summary-title {
  margin: 0 0 6px;
  font-weight: 700;
}

.message.user.trip-summary {
  padding: 12px 16px;
}

.trip-summary dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 14px;
  margin: 0;
}

.trip-summary dt {
  opacity: 0.85;
  font-size: 14px;
}

.trip-summary dd {
  margin: 0;
  font-weight: 600;
}

/* --- Day map ------------------------------------------------------------------ */

.day-map {
  width: min(1120px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 32px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.day-map::backdrop {
  background: rgb(30 30 30 / 35%);
}

.day-map-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.day-map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.day-map-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

.day-map-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--accent-soft);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: var(--muted);
}

.day-map-body {
  display: grid;
  grid-template-columns: 1fr 360px;
  flex: 1;
  min-height: 0;
}

.day-map-canvas {
  position: relative;
  min-height: 0;
  background: var(--bg);
}

.day-map-timeline {
  overflow-y: auto;
  border-left: 1px solid var(--border);
}

.day-map-loading,
.day-map-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  margin: 0;
  padding: 24px;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

.day-map-timeline .day-map-loading {
  height: auto;
  padding: 32px 18px;
}

/* Schedule */

.tl {
  margin: 0;
  padding: 14px 18px 4px;
  list-style: none;
}

.tl-stop {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 8px;
  margin: 0 -8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.tl-stop:hover,
.tl-stop.is-active {
  background: var(--accent-soft);
}

.tl-marker {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 700;
}

.tl-stop.is-missing .tl-marker {
  background: var(--border-strong);
  color: var(--text);
}

.tl-times {
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.tl-title {
  font-weight: 550;
  line-height: 1.35;
}

.tl-place {
  color: var(--muted);
  font-size: 13px;
}

.tl-note {
  font-size: 13px;
}

.tl-note.is-late {
  color: var(--danger);
}

.tl-leg {
  margin-left: 13px;
  padding: 6px 0 6px 25px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-size: 13px;
}

.tl-leg.mode-walk {
  border-left-style: dotted;
}

.tl-leg.mode-drive {
  border-left-color: var(--muted);
}

.tl-leg.mode-unknown {
  border-left: 2px dashed var(--border-strong);
}

.tl-travel {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  font-variant-numeric: tabular-nums;
}

.tl-mode {
  color: var(--text);
  font-weight: 550;
}

.tl-free {
  margin-bottom: 2px;
  font-style: italic;
}

.tl-footer {
  display: grid;
  gap: 8px;
  padding: 10px 18px 18px;
}

.tl-zone,
.tl-warning {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.tl-warning {
  color: var(--danger);
}

/* Map pins and travel labels (Google Maps advanced markers) */

.map-pin {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 3px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 6px rgb(20 20 20 / 18%);
  font: 600 12px/1 var(--font);
  white-space: nowrap;
  transform: translateY(-4px);
}

.map-pin-number {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 12px;
}

.map-pin.is-active {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
}

.map-leg {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--text);
  color: var(--surface);
  font: 600 11px/1.4 var(--font);
  white-space: nowrap;
  opacity: 0.88;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }

  .spinner {
    animation: none;
    border-top-color: var(--border-strong);
  }
}

@media (max-width: 560px) {
  .topbar,
  main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .plan {
    padding-top: 4vh;
  }

  .trip-form {
    padding: 18px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .result {
    grid-template-columns: 56px 1fr;
    padding: 12px 14px;
  }

  .thumb {
    width: 56px;
    height: 56px;
  }

  .calendar {
    padding: 12px;
  }

  .agenda-day {
    padding: 12px 14px 14px;
  }

  .agenda-item {
    grid-template-columns: 64px 1fr auto;
    gap: 10px;
  }

  .swap-button {
    padding: 6px 10px;
  }

  .swap-dialog {
    width: 100vw;
    max-height: 90dvh;
    margin: auto auto 0;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .day-map {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .day-map-body {
    grid-template-columns: 1fr;
    grid-template-rows: 42% 1fr;
  }

  .day-map-timeline {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .cal-day,
  .cal-grid th {
    width: 38px;
  }

  .cal-day {
    height: 38px;
  }
}

/* --- Reminders popup ---------------------------------------------------------------- */

.remind-body {
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.remind-phones {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.remind-phone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.remind-number {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.remind-badge {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 13px;
  font-weight: 600;
}

.remind-badge.is-waiting {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.remind-phone.is-active .text-button {
  margin-left: auto;
}

.remind-verify {
  display: flex;
  flex: 1 1 100%;
  gap: 8px;
}

.remind-row-actions {
  display: flex;
  gap: 14px;
}

.remind-form {
  display: grid;
  gap: 8px;
}

.remind-inputs {
  display: grid;
  gap: 8px;
}

.remind-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 6px;
  align-items: center;
}

.remind-input.has-channel {
  grid-template-columns: auto 1fr auto;
}

.remind-channel-select select {
  height: 42px;
}

.remind-hint {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.remind-input input,
.remind-code {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.remind-code {
  flex: 1;
  max-width: 180px;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

.remind-input input:focus,
.remind-code:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.remind-remove {
  width: 36px;
  height: 36px;
  font-size: 20px;
  line-height: 1;
}

.remind-error {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.remind-error:empty {
  display: none;
}

.remind-phone .remind-error {
  flex-basis: 100%;
}

.remind-add {
  justify-self: start;
}

.remind-consent {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* --- A trip's day, read-only (the link in a reminder) --------------------------------- */

.chat.is-read-only .dock {
  display: none;
}

.read-only-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 -8px;
  padding: 12px 8px 16px;
  background: var(--bg);
}

.read-only-bar[hidden] {
  display: none;
}

.read-only-bar p {
  margin: 0;
  color: var(--muted);
}

.read-only-bar .primary-button {
  width: auto;
  padding-inline: 20px;
  text-decoration: none;
}

.agenda-day.is-focus {
  background: var(--accent-soft);
  box-shadow: inset 4px 0 0 var(--accent);
}

/* --- Change dates popup ---------------------------------------------------------------- */

.dates-body {
  display: grid;
  gap: 14px;
  padding-top: 14px;
}

.dates-stops {
  display: grid;
  gap: 14px;
}

.dates-stop {
  display: grid;
  gap: 6px;
}

/* In the popup, a calendar opens in place (the popup scrolls) rather than floating over it. */
.dates-dialog .calendar {
  position: static;
  width: auto;
  max-width: none;
  margin-top: 8px;
  box-shadow: none;
}

.change-dates {
  margin-top: 6px;
}

/* --- Regenerate popup ---------------------------------------------------------------- */

.regen-body {
  display: grid;
  gap: 8px;
  padding-top: 14px;
}

.regen-body textarea {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.regen-body textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.regen-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.regen-actions .primary-button {
  width: auto;
  height: 40px;
  padding-inline: 20px;
}

.error-retry {
  margin-left: 10px;
}

/* "Continue with Google" in the reminders popup */
.remind-google {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.remind-google[hidden] {
  display: none;
}

.remind-or {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.remind-or::before,
.remind-or::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

/* --- Emailing a trip, in the Share popup ------------------------------------------- */

.share-emails {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.share-emails[hidden] {
  display: none;
}

.share-emails h3 {
  margin: 0;
}

.share-email-field {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

textarea.share-email-field {
  resize: vertical;
}

.share-email-field:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.remind-badge.is-expired {
  background: var(--grey-soft);
  color: var(--muted);
}

/* --- Profile: the menu at the top right, and the profile popup ------------------------- */

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-menu {
  position: relative;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.profile-button:hover,
.profile-button[aria-expanded="true"] {
  border-color: var(--accent);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar:empty::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 2c-5 0-9 2.5-9 6v2h18v-2c0-3.5-4-6-9-6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.menu[hidden] {
  display: none;
}

.menu button {
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.menu button:hover,
.menu button:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-ink);
  outline: none;
}

.profile-body {
  display: grid;
  gap: 14px;
  padding-top: 14px;
}

.profile-signin {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.profile-providers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.provider-button {
  justify-content: center;
  width: 100%;
  min-height: 42px;
}

.profile-email-link {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-email-link input {
  flex: 1 1 200px;
}

.profile-account {
  margin: 0;
  color: var(--muted);
}

.profile-form {
  display: grid;
  gap: 8px;
}

.profile-section {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 700;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.profile-grid .field-label {
  display: grid;
  gap: 6px;
}

.profile-grid select {
  height: 44px;
  font-size: 15px;
}

.profile-interests {
  margin: 0;
  padding: 0;
  border: 0;
}

#profile-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.toggle-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-chip span {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
}

.toggle-chip input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.toggle-chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.profile-trips {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-trips a {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}

.profile-trips a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.profile-trip-title {
  font-weight: 650;
}

.profile-trip-meta,
.profile-trips .empty {
  color: var(--muted);
  font-size: 14px;
}

.profile-delete {
  justify-self: start;
  color: var(--danger);
}

.trip-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.save-preferences-status {
  min-height: 0;
  margin: 0;
  color: var(--success);
  font-size: 14px;
}

.save-preferences-status:empty {
  display: none;
}
