/* The planner: one conversation, one question at a time, with what snowglobe shows sitting
   in the conversation under the message it belongs to. Tapping a card opens the whole of
   it in a sheet over the conversation. */

.sg {
  --sg-width: 640px;
  --sg-canvas: #F3F6FA;
  --sg-muted: #4F5D78;
  --sg-hairline: #E2E8F0;
  --sg-tint: #E3F4F3;
  --sg-blush: #FCE7F1;
  --sg-question: 1.25rem;
  --sg-radius: 20px;
  --sg-shadow: 0 1px 2px rgb(20 33 61 / 0.06), 0 12px 32px -14px rgb(20 33 61 / 0.3);
  --sg-shadow-hover: 0 1px 2px rgb(20 33 61 / 0.06), 0 20px 44px -16px rgb(20 33 61 / 0.38);
  --sg-shadow-small: 0 1px 2px rgb(20 33 61 / 0.07);
  --sg-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--sg-canvas); color: var(--night);
}

/* The bar along the top */

.sg-top {
  flex: none; height: 56px; position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 6px 0 var(--gutter);
  background: #FFFFFF; border-bottom: 1px solid var(--sg-hairline);
}
.sg-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--night); text-decoration: none; }
.sg-brand__name { font-family: var(--display); font-size: 1rem; letter-spacing: -0.01em; }
.sg-top__actions { display: flex; align-items: center; gap: 2px; }

.sg-pill {
  min-height: 40px; display: inline-flex; align-items: center; gap: 6px;
  padding: 0 10px 0 12px; border-radius: var(--radius-chip);
  border: 1px solid var(--line); background: #FFFFFF; color: var(--night);
  font-weight: 700; font-size: 0.875rem; box-shadow: var(--sg-shadow-small);
  animation: sg-arrive 0.3s var(--sg-ease);
}
.sg-pill:hover { border-color: var(--night); }
.sg-pill svg:first-child { color: var(--teal-ink); }

.sg-icon-button {
  width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--night); list-style: none; cursor: pointer;
}
.sg-icon-button:hover { background: var(--snow); }
.sg-icon-button::-webkit-details-marker { display: none; }
.sg-icon-button--soft { background: var(--snow); }

.sg-menu { position: relative; }
.sg-menu__panel {
  position: absolute; right: 4px; top: 48px; z-index: 5; min-width: 230px;
  padding: 8px; border-radius: 16px; background: #FFFFFF; box-shadow: var(--sg-shadow); border: 1px solid var(--sg-hairline);
  animation: sg-arrive 0.2s var(--sg-ease);
}
.sg-menu__item {
  display: block; width: 100%; padding: 12px; border: 0; border-radius: 10px; background: none;
  text-align: left; color: var(--night); text-decoration: none; font-weight: 600;
}
.sg-menu__item:hover { background: var(--snow); }
.sg-menu__trust { display: flex; align-items: center; gap: 12px; margin: 4px 12px 8px; }

/* The conversation */

/* The conversation scrolls itself (see the chat controller), so the browser mustn't also
   move it when a card arrives above the question. */
.sg-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; display: flex; flex-direction: column; }
/* Short conversations sit at the bottom, by the buttons that answer them. */
.sg-log__items {
  flex: 1 0 auto; width: 100%; box-sizing: border-box;
  list-style: none; margin: 0 auto; padding: 20px var(--gutter) 28px; max-width: var(--sg-width);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 22px;
}

.sg-text { font-size: 1.0625rem; line-height: 1.55; text-wrap: pretty; }
.sg-text p, .sg-text ul { margin: 0 0 0.55em; }
.sg-text > :last-child { margin-bottom: 0; }
.sg-text ul { padding-left: 1.2em; }
.sg-text strong { font-weight: 700; }

.sg-question { margin: 0; font-size: var(--sg-question); line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
.sg-question--first { font-size: 1.375rem; }
.sg-question__hint { display: block; margin-top: 6px; font-size: 0.9375rem; line-height: 1.45; font-weight: 400; letter-spacing: 0; color: var(--sg-muted); text-wrap: pretty; }

/* The first screen: the globe in its night sky, the greeting and the first question. */
.sg-welcome { display: flex; flex-direction: column; gap: 18px; }
.sg-log__items:has(> .sg-welcome:only-child) > .sg-welcome { flex: 1; }
.sg-still {
  position: relative; flex: 1 1 auto; margin: -20px calc(-1 * var(--gutter)) 0;
  min-height: 210px; max-height: 50dvh; aspect-ratio: 716 / 480; overflow: hidden;
  background:
    radial-gradient(1.5px 1.5px at 12% 22%, rgb(255 255 255 / 0.8), transparent),
    radial-gradient(1px 1px at 26% 70%, rgb(255 255 255 / 0.6), transparent),
    radial-gradient(1.5px 1.5px at 84% 18%, rgb(255 255 255 / 0.75), transparent),
    radial-gradient(1px 1px at 70% 82%, rgb(255 255 255 / 0.55), transparent),
    radial-gradient(1px 1px at 92% 56%, rgb(255 255 255 / 0.6), transparent),
    radial-gradient(1px 1px at 6% 52%, rgb(255 255 255 / 0.5), transparent),
    radial-gradient(120% 95% at 50% 40%, #233A6C 0%, #14213D 55%, #0A1328 100%);
}
.sg-log__items:has(> .sg-welcome:only-child) .sg-still { aspect-ratio: auto; }
/* The still's own sky is darker than the one drawn here, so lightening it leaves only the globe. */
.sg-still__image { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: lighten; }
.sg-still__explore {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); min-height: 44px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px; padding: 0 18px 0 14px;
  border: 0; border-radius: var(--radius-chip); background: rgb(255 255 255 / 0.95); color: var(--night);
  font-weight: 700; font-size: 0.9375rem; box-shadow: 0 6px 18px rgb(6 12 30 / 0.45);
}
.sg-still__explore:hover { background: #FFFFFF; }
.sg-welcome__words { display: flex; flex-direction: column; gap: 14px; }

.sg-said { align-self: flex-end; max-width: 82%; animation: sg-arrive 0.25s var(--sg-ease); }
.sg-said p { margin: 0; padding: 10px 16px; border-radius: 20px 20px 6px 20px; background: var(--night); color: #FFFFFF; font-size: 1rem; line-height: 1.45; }

.sg-answer { display: flex; flex-direction: column; gap: 16px; }
.sg-answer__body { display: flex; flex-direction: column; gap: 8px; }
.sg-answer__body > .sg-text { animation: sg-fade 0.3s ease-out; }
.sg-answer__body:empty, .sg-answer__cards:empty { display: none; }
.sg-answer__cards { display: flex; flex-direction: column; gap: 16px; }

.sg-thinking {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 4px 14px 4px 6px;
  border-radius: var(--radius-chip); background: #FFFFFF; box-shadow: var(--sg-shadow-small), 0 0 0 1px var(--sg-hairline);
  color: var(--sg-muted); font-size: 0.9375rem; font-weight: 600; animation: sg-arrive 0.25s var(--sg-ease);
}

/* Cards */

.sg-card {
  position: relative; border-radius: var(--sg-radius); overflow: hidden; background: #FFFFFF; box-shadow: var(--sg-shadow);
}
.sg-card--new { animation: sg-rise 0.45s var(--sg-ease) both; }
.sg-card--opens { transition: box-shadow 0.2s ease, transform 0.15s ease; }
.sg-card--opens:hover { box-shadow: var(--sg-shadow-hover); }
.sg-card--opens:active { transform: scale(0.985); }
/* The title's link covers the whole card, so a tap anywhere on it opens it. */
.sg-card__link { color: inherit; text-decoration: none; }
.sg-card__link::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.sg-card__link:focus-visible { outline: none; }
.sg-card__link:focus-visible::after { outline: 3px solid var(--night); outline-offset: -3px; }

.sg-card__media { position: relative; }
.sg-card__photo { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--placeholder); }
.sg-card__photo--empty, .sg-gallery__photo--empty {
  aspect-ratio: 16 / 7;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120' preserveAspectRatio='none'%3E%3Cpath d='M0 92 60 44l38 30 62-58 66 64 40-30 54 42 46-26 34 26v28H0z' fill='%2394AACB'/%3E%3Cpath d='M0 106c60-14 120-6 200-12s140 8 200-2v28H0z' fill='%23FFFFFF'/%3E%3C/svg%3E") bottom / 100% 75% no-repeat,
    linear-gradient(180deg, #8EC5F0 0%, #CFE4F7 100%);
}
.sg-badge {
  position: absolute; left: 12px; top: 12px; z-index: 1; margin: 0;
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 5px;
  border-radius: var(--radius-chip); background: rgb(255 255 255 / 0.95); color: var(--night);
  font-size: 0.8125rem; font-weight: 700; box-shadow: 0 2px 10px rgb(6 12 30 / 0.28);
}
.sg-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.sg-card__kicker { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal-ink); }
.sg-card__title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.1875rem; line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
.sg-card__sub { margin: -2px 0 0; font-size: 0.9375rem; line-height: 1.4; color: var(--sg-muted); }
.sg-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--sg-hairline);
}
.sg-card__more { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; font-weight: 700; font-size: 0.9375rem; white-space: nowrap; color: var(--night); }
.sg-card__more svg { transition: transform 0.2s var(--sg-ease); }
.sg-card--opens:hover .sg-card__more svg { transform: translateX(3px); }

.sg-price { margin: 0; font-size: 0.875rem; line-height: 1.3; color: var(--sg-muted); }
.sg-price strong { font-family: var(--display); font-weight: 400; font-size: 1.0625rem; color: var(--night); }

.sg-ticks { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 0.9875rem; line-height: 1.4; }
.sg-ticks li { display: flex; gap: 10px; align-items: flex-start; }
.sg-ticks svg { flex: none; width: 20px; height: 20px; padding: 3px; margin-top: 0; border-radius: 50%; background: var(--sg-tint); color: var(--teal-ink); }

.sg-card-group { display: flex; flex-direction: column; gap: 12px; }
.sg-alternatives { display: flex; flex-direction: column; gap: 8px; }
.sg-alternatives__title { margin: 2px 0 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sg-muted); }
.sg-alternatives__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.sg-alternative {
  display: flex; flex-direction: column; align-items: stretch; padding: 0; overflow: hidden;
  border: 0; border-radius: 16px; background: #FFFFFF; color: var(--night); text-align: left;
  box-shadow: var(--sg-shadow-small), 0 0 0 1px var(--sg-hairline); transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.sg-alternative:hover { box-shadow: var(--sg-shadow); }
.sg-alternative:active { transform: scale(0.98); }
.sg-alternative__photo { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--placeholder); }
.sg-alternative__photo.sg-card__photo--empty { aspect-ratio: 16 / 9; }
.sg-alternative__words { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; }
.sg-alternative__name { font-weight: 700; font-size: 1rem; line-height: 1.25; }
.sg-alternative__difference { flex: 1; font-size: 0.8125rem; line-height: 1.35; color: var(--sg-muted); }
.sg-alternative__ask { display: inline-flex; align-items: center; gap: 2px; margin-top: 6px; font-size: 0.8125rem; font-weight: 700; color: var(--teal-ink); }

/* A day there */
.sg-day__moments { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; position: relative; }
.sg-day__moments::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 2px; border-radius: 1px; background: linear-gradient(var(--teal), #A9DCF2); opacity: 0.45; }
.sg-day__moment { display: grid; grid-template-columns: 12px 1fr; column-gap: 14px; position: relative; }
.sg-day__moment::before { content: ""; grid-row: 1 / span 2; width: 12px; height: 12px; margin-top: 4px; box-sizing: border-box; border-radius: 50%; background: #FFFFFF; border: 2.5px solid var(--teal); }
.sg-day__time { grid-column: 2; font-size: 0.8125rem; font-weight: 700; color: var(--teal-ink); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.sg-day__words { grid-column: 2; font-size: 0.9375rem; line-height: 1.45; color: var(--sg-muted); }
.sg-day__words strong { display: block; font-size: 1rem; color: var(--night); }

/* The slopes */
.sg-slopes__map { position: relative; aspect-ratio: 16 / 10; background: #0E1830; }
.sg-slopes__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.sg-slopes__map .globe ~ .sg-slopes__poster { display: none; }
.sg-slopes__open { position: absolute; inset: 0; z-index: 2; border: 0; background: transparent; padding: 0; }
.sg-slopes__label, .sg-slopes__badge {
  position: absolute; top: 12px; min-height: 34px; display: inline-flex; align-items: center; gap: 6px;
  padding: 0 12px; border-radius: var(--radius-chip); background: rgb(255 255 255 / 0.95); color: var(--night);
  font-weight: 700; font-size: 0.8125rem; box-shadow: 0 2px 10px rgb(6 12 30 / 0.3);
}
.sg-slopes__label { left: 12px; z-index: 3; pointer-events: none; max-width: calc(100% - 150px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-slopes__badge { right: 12px; }
.sg-slopes__note { margin: 0; padding: 12px 16px 14px; font-size: 0.9375rem; line-height: 1.45; }

/* A comparison with snowglobe's pick */
.sg-compare__head { display: flex; gap: 14px; align-items: center; }
.sg-compare__thumb { width: 64px; height: 64px; flex: none; border-radius: 14px; object-fit: cover; aspect-ratio: auto; background: var(--placeholder); }
.sg-compare__thumb.sg-card__photo--empty { aspect-ratio: 1; }
.sg-compare__head .sg-card__title { margin-top: 2px; }
.sg-pros { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.9875rem; line-height: 1.4; }
.sg-pros__item { display: flex; gap: 10px; align-items: flex-start; }
.sg-pros__mark { width: 20px; height: 20px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: 0.9375rem; line-height: 1; }
.sg-pros__item--plus .sg-pros__mark { background: var(--sg-tint); color: var(--teal-ink); }
.sg-pros__item--minus .sg-pros__mark { background: var(--sg-blush); color: var(--magenta-deep); }

.sg-chosen {
  align-self: center; display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 16px 8px 12px;
  border-radius: var(--radius-chip); background: var(--sg-tint); color: var(--teal-ink); font-size: 0.875rem; font-weight: 700;
  animation: sg-pop 0.4s var(--sg-ease);
}

/* The trip, as a ticket */
.sg-ticket__head { padding: 18px 18px 20px; background: var(--night); color: #FFFFFF; display: flex; flex-direction: column; gap: 6px; }
.sg-ticket__head .sg-card__kicker { color: #5CF2E8; }
.sg-ticket__dates { margin: 0; font-size: 0.9375rem; color: rgb(247 249 252 / 0.85); }
.sg-ticket__tear {
  height: 22px; position: relative;
  background:
    radial-gradient(circle at 0 50%, var(--sg-canvas) 10px, transparent 10.5px) left center / 22px 22px no-repeat,
    radial-gradient(circle at 100% 50%, var(--sg-canvas) 10px, transparent 10.5px) right center / 22px 22px no-repeat;
}
.sg-ticket__tear::before { content: ""; position: absolute; left: 20px; right: 20px; top: 50%; border-top: 2px dashed var(--line); }
.sg-ticket__lines { list-style: none; margin: 0; padding: 0 18px; display: flex; flex-direction: column; gap: 12px; font-size: 0.9875rem; line-height: 1.4; }
.sg-ticket__lines li { display: flex; gap: 12px; align-items: flex-start; }
.sg-ticket__lines svg { flex: none; width: 30px; height: 30px; padding: 6px; margin-top: -4px; border-radius: 50%; background: var(--snow); color: var(--night-soft); }
.sg-ticket__total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 16px 18px 0; padding-top: 14px; border-top: 1px solid var(--sg-hairline); color: var(--sg-muted); }
.sg-ticket__total strong { font-family: var(--display); font-weight: 400; font-size: 1.375rem; color: var(--night); }
.sg-ticket .sg-card__foot { margin: 12px 18px 16px; }

.sg-legacy .sg-card__body { gap: 4px; }
.sg-nowrap { white-space: nowrap; }

/* The buttons that answer the latest question, and the composer */

.sg-foot {
  flex: none; position: relative; z-index: 2; background: #FFFFFF; padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -1px 0 var(--sg-hairline), 0 -14px 28px -24px rgb(20 33 61 / 0.4);
}
.sg-foot__inner { position: relative; max-width: var(--sg-width); margin: 0 auto; padding: 12px var(--gutter); display: flex; flex-direction: column; gap: 12px; }
.sg-chips { display: flex; flex-direction: column; gap: 10px; max-height: 50dvh; overflow-y: auto; margin: -4px; padding: 4px; }
.sg-chips:empty { display: none; }
.sg-chips__row { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-chips__row > * { animation: sg-arrive 0.3s var(--sg-ease) both; }
.sg-chips__row > :nth-child(2) { animation-delay: 40ms; }
.sg-chips__row > :nth-child(3) { animation-delay: 80ms; }
.sg-chips__row > :nth-child(4) { animation-delay: 120ms; }
.sg-chips__row > :nth-child(n+5) { animation-delay: 160ms; }
.sg-ask { display: flex; flex-direction: column; gap: 12px; }

.sg-chip {
  min-height: 44px; padding: 0 15px; border-radius: var(--radius-chip);
  border: 1px solid #C5D0E1; background: #FFFFFF; color: var(--night); box-shadow: var(--sg-shadow-small);
  font-size: 0.9375rem; font-weight: 700; line-height: 1.2; text-align: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.sg-chip:hover { border-color: var(--night); }
.sg-chip:active { transform: scale(0.97); }
.sg-chip[aria-pressed="true"], .sg-chip[aria-expanded="true"] { background: var(--night); border-color: var(--night); color: #FFFFFF; }
.sg-chip--toggle[aria-pressed="true"]::before { content: "✓ "; }
.sg-chip--primary { background: var(--magenta); border-color: var(--magenta); color: #FFFFFF; box-shadow: 0 8px 18px -8px rgb(230 0 126 / 0.7); }
.sg-chip--primary:hover { background: var(--magenta-deep); border-color: var(--magenta-deep); }
.sg-chip--small { min-height: 36px; font-size: 0.875rem; }
.sg-chip-form { display: contents; }

.sg-button {
  min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--radius-chip);
  background: var(--night); color: #FFFFFF; font-weight: 700; font-size: 1rem;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.sg-button:hover { background: #22325A; }
.sg-button:active { transform: scale(0.98); }
.sg-button:disabled { opacity: 0.4; cursor: default; transform: none; }
.sg-button--primary { background: var(--magenta); box-shadow: 0 8px 18px -8px rgb(230 0 126 / 0.7); }
.sg-button--primary:hover { background: var(--magenta-deep); }
.sg-loves { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

.sg-panel {
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start; padding: 16px;
  border-radius: 18px; background: #FFFFFF; border: 1px solid var(--sg-hairline); box-shadow: var(--sg-shadow);
  animation: sg-arrive 0.25s var(--sg-ease);
}
.sg-panel__fields { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.sg-panel__fields--row { flex-direction: row; flex-wrap: wrap; }
.sg-panel__group { display: flex; flex-direction: column; gap: 6px; }
.sg-panel__heading { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sg-muted); }
.sg-panel__hint { margin: 0 0 10px; font-size: 0.9375rem; color: var(--sg-muted); }
.sg-panel__error { margin: 0; color: var(--magenta-deep); font-weight: 600; font-size: 0.875rem; }
.sg-panel__error:empty { display: none; }
.sg-panel__done { margin: 0; font-weight: 700; }
.sg-save [data-step=form] { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; width: 100%; }

.sg-stepper { display: grid; grid-template-columns: 1fr 44px 40px 44px; align-items: center; gap: 4px; width: 100%; max-width: 320px; }
.sg-stepper__label { font-weight: 700; }
.sg-stepper button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #C5D0E1; background: #FFFFFF; color: var(--night); font-size: 1.25rem; font-weight: 700; box-shadow: var(--sg-shadow-small); }
.sg-stepper button:hover { border-color: var(--night); }
.sg-stepper button:disabled { opacity: 0.3; cursor: default; }
.sg-stepper output { text-align: center; font-family: var(--display); font-size: 1.125rem; }
.sg-ages { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; width: 100%; }
.sg-ages:empty { display: none; }

.sg-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.875rem; font-weight: 700; }
.sg-field--wide { width: 100%; }
.sg-field input, .sg-field select {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--control-border); border-radius: 12px;
  background: #FFFFFF; color: var(--night); font: inherit; font-weight: 400; font-size: 1rem;
}
.sg-check { display: flex; gap: 8px; align-items: center; font-size: 0.875rem; }

.sg-composer { position: relative; display: flex; align-items: center; }
.sg-composer__input {
  flex: 1; min-width: 0; height: 48px; padding: 0 56px 0 18px; border-radius: 24px;
  border: 1px solid #C5D0E1; background: var(--sg-canvas); color: var(--night); font: inherit; font-size: 1rem;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.sg-composer__input::placeholder { color: #6A7690; }
.sg-composer__input:focus { background: #FFFFFF; border-color: var(--night); outline: none; box-shadow: 0 0 0 3px rgb(20 33 61 / 0.12); }
.sg-composer__send {
  position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: var(--night); color: #FFFFFF; transition: opacity 0.15s ease, transform 0.1s ease;
}
.sg-composer__send:active { transform: scale(0.94); }
.sg-composer__send:disabled { opacity: 0.3; cursor: default; }

.sg-jump {
  position: absolute; top: -52px; left: 50%; transform: translateX(-50%); min-height: 36px; padding: 0 16px;
  border: 0; border-radius: var(--radius-chip); background: var(--night); color: #FFFFFF; font-weight: 700; box-shadow: var(--sg-shadow);
  animation: sg-arrive 0.2s var(--sg-ease);
}
.sg-failure { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--magenta-deep); font-weight: 600; }

/* "Your trip": what snowglobe has understood, from the bottom of the screen */

.sg-sheet {
  margin: auto auto 0; width: 100%; max-width: var(--sg-width); max-height: 88dvh; padding: 0;
  border: 0; border-radius: 24px 24px 0 0; background: #FFFFFF; color: var(--night);
}
.sg-sheet[open] { animation: sg-rise 0.3s var(--sg-ease); }
.sg-sheet::backdrop { background: rgb(11 20 42 / 0.5); }
.sg-sheet__panel { padding: 10px var(--gutter) calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; }
.sg-sheet__handle { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line); }
.sg-sheet__head { display: flex; align-items: center; justify-content: space-between; }
.sg-sheet__title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.125rem; }
.sg-sheet__rows { list-style: none; margin: 0; padding: 0; }
.sg-sheet__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--sg-hairline); }
.sg-sheet__row:last-child { border-bottom: 0; }
.sg-sheet__words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sg-sheet__label, .sg-sheet__note { font-size: 0.8125rem; color: var(--sg-muted); }
.sg-sheet__value { font-weight: 600; }
.sg-sheet__value--empty { color: var(--sg-muted); font-weight: 400; }
.sg-link-button { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--night); font-weight: 700; font-size: 0.875rem; text-decoration: underline; text-underline-offset: 3px; }

/* A card opened: everything about what it shows, over the conversation */

.sg-details {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--sg-canvas); color: var(--night);
}
.sg-details[open] { display: flex; flex-direction: column; animation: sg-sheet-up 0.32s var(--sg-ease); }
.sg-details::backdrop { background: rgb(11 20 42 / 0.45); }
.sg-details__bar {
  flex: none; height: 56px; display: flex; align-items: center; gap: 4px; padding: 0 12px 0 4px;
  background: #FFFFFF; border-bottom: 1px solid var(--sg-hairline);
}
.sg-details__title { margin: 0; min-width: 0; font-weight: 700; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-details__body { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.sg-details__loading { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50%; margin: 0; color: var(--sg-muted); font-weight: 600; }

.sg-detail { max-width: var(--sg-width); margin: 0 auto; padding-bottom: 8px; }
.sg-detail > * + * { margin-top: 12px; }

.sg-gallery { position: relative; }
.sg-gallery__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: #0E1830; }
.sg-gallery__track::-webkit-scrollbar { display: none; }
.sg-gallery__photo { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 3; max-height: 56dvh; object-fit: cover; scroll-snap-align: start; }
.sg-gallery__count {
  position: absolute; right: 12px; bottom: 12px; margin: 0; padding: 3px 10px; border-radius: var(--radius-chip);
  background: rgb(11 20 42 / 0.65); color: #FFFFFF; font-size: 0.8125rem; font-weight: 700; pointer-events: none;
}
.sg-gallery .sg-badge { top: 14px; left: 14px; }

.sg-detail__head { padding: 18px var(--gutter) 2px; display: flex; flex-direction: column; gap: 6px; }
.sg-detail__title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.625rem; line-height: 1.2; letter-spacing: -0.015em; text-wrap: balance; }
.sg-detail__title:focus { outline: none; }
.sg-detail__sub { margin: 0; font-size: 1rem; line-height: 1.45; color: var(--sg-muted); }
.sg-detail__lede { margin: 6px 0 0; font-size: 1.0625rem; line-height: 1.55; text-wrap: pretty; }
.sg-detail__price { margin: 6px 0 0; display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 6px; font-size: 0.9375rem; color: var(--sg-muted); }
.sg-detail__price strong { font-family: var(--display); font-weight: 400; font-size: 1.25rem; color: var(--night); }
.sg-detail__price span:last-child { flex-basis: 100%; }
.sg-detail__price span:first-child:not(:last-child) { flex-basis: auto; }

.sg-detail__section {
  margin-inline: var(--gutter); padding: 18px; border-radius: var(--sg-radius); background: #FFFFFF;
  box-shadow: var(--sg-shadow-small), 0 0 0 1px var(--sg-hairline);
}
.sg-detail__section--why { background: linear-gradient(180deg, #FFFFFF, #F8FDFC); box-shadow: var(--sg-shadow-small), 0 0 0 1px #CBEBE8; }
.sg-detail__heading { margin: 0 0 12px; font-size: 1.125rem; line-height: 1.3; font-weight: 700; }
.sg-detail__heading small { display: block; margin-top: 2px; font-size: 0.875rem; font-weight: 400; color: var(--sg-muted); }
.sg-detail__section > p, .sg-detail__more > p { margin: 0 0 0.6em; line-height: 1.55; }
.sg-detail__section > p:last-child { margin-bottom: 0; }
.sg-detail__note { font-size: 0.875rem; color: var(--sg-muted); }
.sg-detail__more summary { cursor: pointer; font-weight: 700; color: var(--night); padding: 6px 0; }

.sg-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; }
.sg-facts--wide { grid-column: 1 / -1; }
.sg-facts dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sg-muted); }
.sg-facts dd { margin: 3px 0 0; font-weight: 700; line-height: 1.35; }
.sg-facts .piste-bar { display: block; width: 100%; height: 8px; margin-top: 8px; border-radius: 4px; overflow: hidden; }
.sg-facts__key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 0.8125rem; font-weight: 400; color: var(--sg-muted); }
.sg-facts__key i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }

.sg-scores { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sg-score { padding: 12px 0; border-top: 1px solid var(--sg-hairline); }
.sg-score:first-child { padding-top: 0; border-top: 0; }
.sg-score:last-child { padding-bottom: 0; }
.sg-score__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; }
.sg-score__notes { margin: 4px 0 0 !important; font-size: 0.9375rem; line-height: 1.45; color: var(--sg-muted); }
.sg-score--yours .sg-score__head::after { content: none; }
.sg-pips { display: inline-flex; gap: 4px; }
.sg-pips i { width: 10px; height: 10px; border-radius: 50%; background: var(--sg-hairline); }
.sg-pips i.on { background: var(--teal); }

.sg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.sg-list li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
.sg-list li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--teal); }
.sg-list--watch li::before { background: var(--sun); }

.sg-stays { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sg-stay { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--sg-hairline); }
.sg-stay:first-child { border-top: 0; padding-top: 0; }
.sg-stay__photo { width: 64px; height: 48px; border-radius: 10px; object-fit: cover; aspect-ratio: auto; }
.sg-stay__photo.sg-card__photo--empty { aspect-ratio: auto; }
.sg-stay__name { font-weight: 700; line-height: 1.3; }
.sg-stay__meta { display: block; font-size: 0.8125rem; font-weight: 400; color: var(--sg-muted); }
.sg-stay__price { text-align: right; font-size: 0.8125rem; color: var(--sg-muted); white-space: nowrap; }
.sg-stay__price strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1rem; color: var(--night); }

.sg-compared { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.sg-compared th, .sg-compared td { padding: 10px 6px; border-top: 1px solid var(--sg-hairline); text-align: left; vertical-align: top; }
.sg-compared thead > tr > * { border-top: 0; padding-top: 0; vertical-align: top; }
.sg-compared tbody th { font-weight: 700; color: var(--sg-muted); font-size: 0.8125rem; width: 34%; }
.sg-compared td { width: 33%; font-weight: 600; }
.sg-compared__photo { display: block; width: 100%; aspect-ratio: 4 / 3; margin-bottom: 8px; border-radius: 12px; object-fit: cover; }
.sg-compared__name { display: block; font-family: var(--display); font-weight: 400; font-size: 1rem; line-height: 1.25; }
.sg-compared__pick { display: inline-block; margin-top: 4px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal-ink); }
.sg-compared .best { color: var(--teal-ink); }

.sg-detail__actions {
  position: sticky; bottom: 0; z-index: 2; margin-top: 16px; padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  background: linear-gradient(rgb(243 246 250 / 0), var(--sg-canvas) 24px);
}
.sg-detail__actions .sg-chip, .sg-detail__actions .sg-button { flex: 1 1 auto; }
.sg-detail__actions form { display: contents; }

.sg-detail__summary { color: var(--night); }
.sg-detail__section--quiet:not(:has(li)) { display: none; }
.sg-detail__section--plain { margin-inline: var(--gutter); padding: 0 4px; }
.sg-facts__key .piste-easy { background: var(--piste-easy); }
.sg-facts__key .piste-intermediate { background: var(--piste-intermediate); }
.sg-facts__key .piste-advanced { background: var(--piste-advanced); }
.sg-facilities { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sg-facilities li { padding: 4px 10px; border-radius: var(--radius-chip); background: var(--snow); font-size: 0.8125rem; font-weight: 600; }
.sg-stay--single { border-top: 0; padding: 0; grid-template-columns: 64px 1fr; }
.sg-plan { margin: 16px 0 12px; padding: 4px 14px; border-radius: 14px; background: var(--sg-canvas); }
.sg-plan__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--sg-hairline); }
.sg-plan__row:first-child { border-top: 0; }
.sg-plan__row dt { color: var(--sg-muted); }
.sg-plan__row dd { margin: 0; font-weight: 700; }
.sg-plan__row--today dt { color: var(--night); font-weight: 700; }
.sg-plan__row--today dd, .sg-plan__row--total dd { font-family: var(--display); font-weight: 400; font-size: 1.125rem; }
.sg-detail .trust { margin: 12px 0 0; font-size: 0.8125rem; color: var(--sg-muted); }

/* The old holiday page's pieces, written for one group, as they sit in a sheet */
.sg-detail .story-section { margin: 0; }
.sg-detail .section-title { margin: 0 0 12px; font-family: var(--text); font-size: 1.125rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--night); }
.sg-detail .story-reasons, .sg-detail .story-know, .sg-detail .story-ideas { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.sg-detail .story-reasons p, .sg-detail .story-know p, .sg-detail .story-ideas p { margin: 2px 0 0; color: var(--sg-muted); line-height: 1.5; }
.sg-detail .story-quote { margin: 0 0 14px; padding: 12px 16px; border-radius: 14px; background: var(--sg-tint); }
.sg-detail .story-quote p { margin: 0; font-weight: 600; }
.sg-detail .story-quote footer { margin-top: 4px; font-size: 0.8125rem; color: var(--teal-ink); }
.sg-detail .story-hero__title { margin: 0 0 14px; font-family: var(--display); font-weight: 400; font-size: 1.125rem; line-height: 1.35; color: var(--night); text-shadow: none; }
.sg-detail .story-leg p + p { margin-top: 2px; }

/* The map, full screen: the globe to explore, or a resort's slopes */

.sg-overlay {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0E1830; color: var(--night);
}
.sg-overlay[open] { display: flex; flex-direction: column; animation: sg-fade 0.25s ease-out; }
.sg-overlay::backdrop { background: #0E1830; }
.sg-overlay__bar { flex: none; height: 56px; display: flex; align-items: center; gap: 6px; padding: 0 16px 0 6px; background: #FFFFFF; border-bottom: 1px solid var(--sg-hairline); }
.sg-overlay__title { margin: 0 0 0 4px; font-size: 1.0625rem; }
.sg-overlay__stage { position: relative; flex: 1; min-height: 0; }
.sg-overlay__hint {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3; margin: 0; white-space: nowrap;
  padding: 6px 14px; border-radius: var(--radius-chip); background: rgb(255 255 255 / 0.94); font-size: 0.8125rem; font-weight: 600; color: var(--night-soft);
}
.sg-overlay__loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; color: var(--powder); z-index: 1; }
.sg-overlay__resort {
  position: absolute; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 3; max-width: 480px; margin: 0 auto;
  padding: 16px 18px 18px; border-radius: var(--sg-radius); background: #FFFFFF; box-shadow: 0 20px 40px -12px rgb(6 12 30 / 0.6);
  display: flex; flex-direction: column; gap: 6px; animation: sg-rise 0.3s var(--sg-ease);
}
.sg-overlay__resort-name { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.25rem; }
.sg-overlay__resort-line { margin: 0; font-size: 0.9375rem; color: var(--sg-muted); }
.sg-overlay__resort-line:empty, .sg-overlay__resort-price:empty { display: none; }
.sg-overlay__resort-price { margin: 0; font-weight: 700; font-size: 0.9375rem; }
.sg-overlay__resort .sg-button { margin-top: 6px; width: 100%; }

.sg .globe { position: absolute; inset: 0; width: auto; height: auto; }
/* MapLibre's own stylesheet arrives with the map, after this one, so these need to outrank it. */
.sg .globe .globe__map { position: absolute; inset: 0; }
.sg-overlay .sg-icon-button:focus-visible { outline-offset: -4px; }
.sg-overlay .maplibregl-ctrl-top-right { top: 52px; }
.globe--still .maplibregl-ctrl, .globe--still .globe__credit { display: none; }

/* A page of its own, for a card opened in a new tab */
.sg--page .sg-details__body { flex: 1; }

@keyframes sg-arrive { from { opacity: 0; transform: translateY(6px); } }
@keyframes sg-fade { from { opacity: 0; } }
@keyframes sg-rise { from { opacity: 0; transform: translateY(18px) scale(0.985); } }
@keyframes sg-pop { 0% { opacity: 0; transform: scale(0.8); } 60% { transform: scale(1.04); } }
@keyframes sg-sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes sg-sheet-in { from { transform: translateX(48px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .sg *, .sg *::before, .sg *::after, .sg::backdrop { animation: none !important; transition: none !important; }
}

@media (min-width: 720px) {
  .sg { --sg-question: 1.375rem; }
  .sg-still { margin: 0; border-radius: 28px; max-height: 380px; }
  /* With room to spare, the first screen sits in the middle rather than down by the buttons. */
  .sg-log__items:has(> .sg-welcome:only-child) { justify-content: center; }
  .sg-log__items:has(> .sg-welcome:only-child) > .sg-welcome { flex: 0 1 auto; }
  .sg-log__items:has(> .sg-welcome:only-child) .sg-still { aspect-ratio: 716 / 480; max-height: 420px; }
  .sg-alternatives__list { gap: 12px; }
}

/* On a wide screen a card opens beside the conversation rather than over it. */
@media (min-width: 960px) {
  .sg-details { width: min(600px, 100%); margin: 0 0 0 auto; border-left: 1px solid var(--sg-hairline); box-shadow: -30px 0 60px -30px rgb(11 20 42 / 0.45); }
  .sg-details[open] { animation-name: sg-sheet-in; }
  .sg-details::backdrop { background: rgb(11 20 42 / 0.25); }
  .sg-gallery__photo { aspect-ratio: 16 / 10; }
}
