/* Trip builder. Builds on /styles.css tokens. */
body.builder { padding-bottom: 88px; }
.hidden { display: none !important; }
/* undo the landing page's waitlist form layout */
.builder form { display: block; margin: 0; max-width: none; gap: 0; }

.appbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--fjord), var(--deep));
  color: #fff;
}
.appbar .brand img { height: 32px; width: auto; display: block; }
.beta { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); border: 1px solid rgba(244,166,58,.5); border-radius: 999px; padding: 2px 8px; }
.acct { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.appbar .link { color: #fff; }

button { font: inherit; }
.pill {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 9px 16px; cursor: pointer; font-weight: 600;
}
.appbar .pill { color: #fff; border-color: rgba(255,255,255,.45); padding: 6px 14px; font-size: 14px; }
.link { background: none; border: 0; color: var(--teal); cursor: pointer; font-weight: 600; padding: 6px; }
.btn:disabled, .pill:disabled { opacity: .45; cursor: default; }

/* Step navigation */
.steps { background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.steps ol { display: flex; gap: 4px; list-style: none; margin: 0 auto; padding: 8px 16px; max-width: 1080px; }
.steps button {
  white-space: nowrap; background: none; border: 0; cursor: pointer;
  padding: 8px 12px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 600;
}
.steps button .n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--text); font-size: 12px; margin-right: 6px; }
.steps button[aria-current="step"] { background: rgba(46,196,176,.14); color: var(--teal); }
.steps button[aria-current="step"] .n, .steps button.done .n { background: var(--teal); color: #fff; }

/* Steps */
.step { display: none; padding: 28px 0 12px; }
.step.active { display: block; }
.step h1 { font-size: clamp(24px, 4vw, 32px); line-height: 1.2; margin: 0 0 8px; color: var(--text); letter-spacing: -.01em; }
.sub { font-size: 17px; margin: 26px 0 10px; }
.sub small, label small { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); margin: 0 0 16px; }
.hint.small { font-size: 13px; margin-top: 8px; }

label { display: block; font-weight: 600; font-size: 15px; margin: 14px 0 0; }
input[type=text], input[type=search], input[type=number], input[type=date], input[type=email], select, textarea {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; font-weight: 400; color: var(--text);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 14px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 1px; }
.row { display: grid; gap: 0 14px; }
.row.two { grid-template-columns: 1fr 1fr; }
.row.three { grid-template-columns: 1fr 1fr 1fr; align-items: end; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input, .toggle input { width: 20px; height: 20px; accent-color: var(--teal); }
.check.tall { min-height: 48px; }

/* Segmented choices */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--line); padding: 4px; border-radius: 999px; margin: 8px 0 6px; }
.seg button { border: 0; background: none; padding: 9px 16px; border-radius: 999px; cursor: pointer; color: var(--text); font-weight: 600; }
.seg button[aria-checked="true"] { background: var(--card); color: var(--teal); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 500;
}
.chip[aria-pressed="true"] { border-color: var(--teal); background: rgba(46,196,176,.14); color: var(--teal); font-weight: 700; }

/* Place search */
.search { position: relative; max-width: 620px; }
.results {
  position: absolute; z-index: 1001; left: 0; right: 0; top: calc(100% + 4px);
  list-style: none; margin: 0; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.18); max-height: 320px; overflow: auto;
}
.results li { padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.results li[aria-selected="true"], .results li:hover { background: rgba(46,196,176,.14); }
.results .k { font-size: 12px; color: var(--muted); margin-left: 6px; text-transform: capitalize; }

.where-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-top: 16px; }
.map { height: 420px; border-radius: 16px; border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.leaflet-container { font: inherit; }

.places { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.places li {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.places .num { width: 26px; height: 26px; border-radius: 50%; background: var(--fjord); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.places .name { font-weight: 600; line-height: 1.3; }
.places .meta { grid-column: 2 / 4; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.places .meta label { margin: 0; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.places .meta input[type=number] { width: 64px; margin: 0; padding: 4px 8px; }
.places .meta input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--amber); }
.places .acts { display: flex; gap: 2px; }
.places .acts button { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 16px; padding: 4px 6px; border-radius: 8px; }
.places .acts button:hover { background: var(--line); color: var(--text); }
.count { color: var(--muted); font-weight: 500; }
.empty { color: var(--muted); font-size: 14px; }

/* Pace cards */
.pace { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pace button {
  text-align: left; background: var(--card); color: var(--text);
  border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer;
}
.pace b { display: block; font-size: 17px; margin-bottom: 4px; }
.pace span { color: var(--muted); font-size: 14px; }
.pace button[aria-checked="true"] { border-color: var(--teal); background: rgba(46,196,176,.10); }
.pace button[aria-checked="true"] b { color: var(--teal); }

/* Interest equaliser */
.eq { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.eqi {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  position: relative;
}
.eqi .ic { font-size: 22px; line-height: 1; }
.eqi .lb { font-size: 13px; font-weight: 600; text-align: center; line-height: 1.25; min-height: 2.5em; display: flex; align-items: center; }
.eqi .val { font-size: 12px; color: var(--muted); font-weight: 600; min-height: 1.2em; }
.eqi .rm { position: absolute; top: 4px; right: 6px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; }
.bar {
  width: 40px; height: 132px; display: flex; flex-direction: column-reverse; gap: 4px;
  touch-action: none; cursor: ns-resize; border-radius: 10px; padding: 2px; user-select: none;
}
.bar .seg5 { flex: 1; border-radius: 6px; background: var(--line); transition: background .08s; }
.bar .seg5.on { background: var(--teal); }
.bar[aria-valuenow="5"] .seg5.on { background: var(--amber); }
.bar:focus-visible { outline: 2px solid var(--teal-bright); }
.builder form.add-row { display: flex; gap: 8px; margin-top: 14px; max-width: 480px; flex-direction: row; }
.add-row input { margin: 0; }

/* Toggles */
.toggle { display: flex; align-items: center; gap: 12px; font-size: 17px; margin: 18px 0 4px; cursor: pointer; }

/* Review */
.summary { margin-top: 18px; display: grid; gap: 10px; }
.summary .blk { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.summary h3 { margin: 0 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.summary p { margin: 2px 0; white-space: pre-line; }

/* Numbered place pins on the map */
.pinnum {
  display: grid !important; place-items: center;
  background: #0E4A66; color: #fff; font-weight: 700; font-size: 13px;
  border: 2px solid #fff; border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.pinnum.must { background: #F4A63A; color: #1A1206; }
.summary .warn { color: #D4572B; font-weight: 600; }
.savepanel {
  margin-top: 22px; padding: 18px 20px; border-radius: 16px;
  border: 1.5px solid var(--teal); background: rgba(46,196,176,.08);
}
.savepanel h2 { margin: 0 0 4px; font-size: 20px; }
.savepanel .hint { margin-bottom: 12px; }
.builder form.save-row { display: flex; gap: 8px; max-width: 520px; }
.save-row input { margin: 0; flex: 1; min-width: 0; }
.save-row .btn { white-space: nowrap; }
.savepanel.flash { animation: flash 1s ease; }
@keyframes flash { 30% { box-shadow: 0 0 0 4px rgba(46,196,176,.45); } }
/* Drafted plan */
.planpanel { margin-top: 22px; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.planpanel h2 { margin: 0 0 4px; font-size: 20px; }
.planpanel .actions { margin-top: 8px; }
.planmap { height: 360px; margin: 14px 0; }
.planbody h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 22px 0 8px; }
.planbody .lead { font-size: 17px; line-height: 1.5; margin: 0 0 6px; }
.planbody ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bases li { display: flex; gap: 10px; align-items: center; }
.bases .num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--fjord); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.pday { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-top: 10px; }
.pday h4 { margin: 0 0 6px; font-size: 17px; }
.pday h4 small { color: var(--muted); font-weight: 500; }
.pday .travel { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.pday .items li { display: grid; grid-template-columns: 84px 1fr; gap: 2px 10px; }
.pday .when { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: capitalize; padding-top: 2px; }
.pday .why { grid-column: 2; color: var(--muted); font-size: 14px; }
.pday .note { margin: 10px 0 0; font-size: 14px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; border: 1px solid var(--line); color: var(--muted); }
.tag.warn { border-color: rgba(212,87,43,.5); color: #D4572B; }
.musts li .ok { color: var(--teal); font-weight: 700; }
.musts li .no { color: #D4572B; font-weight: 700; }
.heads li::before { content: "⚠ "; color: var(--amber); }
.fine { color: var(--muted); font-size: 13px; margin-top: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }

/* Bottom step bar */
.stepbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
}
.stepbar-in { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.draft { font-size: 13px; color: var(--muted); text-align: center; }

/* Dialogs */
.dlg {
  border: 0; border-radius: 20px; padding: 24px; width: min(440px, calc(100vw - 32px));
  background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.dlg::backdrop { background: rgba(5, 20, 30, .55); }
.dlg h2 { margin: 0 0 6px; }
.dlg-x { position: absolute; top: 10px; right: 12px; }
.dlg-x button { background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--muted); }
.dlg form#signinForm { display: grid; gap: 10px; margin: 0; max-width: none; }
.triplist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.triplist li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.triplist .pill { padding: 6px 14px; }
.dlg { overflow-x: hidden; }
.triplist .t { flex: 1 1 160px; min-width: 0; }
.triplist .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.triplist .t small { color: var(--muted); }

@media (max-width: 860px) {
  .where-grid { grid-template-columns: 1fr; }
  .map { height: 340px; }
  .pace { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .row.two, .row.three { grid-template-columns: 1fr; }
  .eq { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .bar { height: 116px; width: 36px; }
  .beta { display: none; }
  .draft { display: none; }
  .builder form.save-row { flex-direction: column; }
  .planmap { height: 280px; }
  .pday .items li { grid-template-columns: 1fr; }
  .pday .why { grid-column: 1; }
}
