/* The review helper.
   Ground: a garden at dusk. Figure: a slip of paper under a lantern.
   Marigold is spent once — on the button that opens the listing.

   Every colour below is a default. A business that has set a theme is served
   /theme.css after this file, which redefines these same properties from its
   own four colours — so nothing here may hardcode a colour that a theme would
   need to change. If you add a rule with a literal hex in it, add a property
   for it here too, or that rule will be the one that stays jade on a themed
   page. See theme.js. */

:root {
  --shade: #0c1f19;
  --shade-deep: #06110e;
  --paper: #f3ecdc;
  /* Text on the page, as opposed to the card. See theme.js. */
  --on-shade: #f3ecdc;
  --paper-shadow: #ded3bc;
  --ink: #1b2a23;
  --ink-soft: #5d6b62;
  --jade: #82b49b;
  /* Secondary text. A real colour rather than the accent at half alpha: over
     the ground that composited to about 2.3:1, while every rule in the page
     assumed the 4.5:1 the solid accent clears. See theme.js. */
  --jade-soft: #6d8c7e;
  --jade-dim: rgba(130, 180, 155, 0.5);
  --jade-line: rgba(130, 180, 155, 0.24);
  --marigold: #e9a03b;
  --marigold-soft: rgba(233, 160, 59, 0.12);
  --marigold-lift: #f2ac4c;
  --on-marigold: #22190a;
  --glow-strong: rgba(233, 160, 59, 0.16);
  --glow-faint: rgba(233, 160, 59, 0.04);
  --jade-wash: rgba(130, 180, 155, 0.08);
  --jade-tint: rgba(130, 180, 155, 0.12);
  --jade-tint-strong: rgba(130, 180, 155, 0.2);
  /* Something has gone wrong and the guest needs to read it. Warm rather than
     red, and derived from the highlight so a themed page says it in that
     theme's voice instead of reverting to this one's. */
  --warn: #eec27c;

  --display: 'Trirong', Georgia, 'Times New Roman', serif;
  --ui: 'Bai Jamjuree', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

* {
  box-sizing: border-box;
}

/* The topic picker's browse button and the length selector are toggled with
   `hidden`, and an element that also sets its own display would otherwise win
   — the user-agent rule this replaces loses to any inline style. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

/* --backdrop and --scrim are only defined by /theme.css, and only when this
   venue has a photograph. Without them the two layers collapse to nothing and
   the gradients below are the whole background, exactly as they were.

   The scrim is not decoration: every text colour on this page is held to a
   contrast ratio against --shade, and a photograph behind them would make those
   numbers meaningless. theme.js picks the scrim's opacity so the composite
   still clears every ratio against a pure white photo and a pure black one —
   see scrimFor. Weakening it here breaks that guarantee silently. */
body {
  background: var(--shade-deep);
  background-image:
    radial-gradient(
      120% 62% at 50% -8%,
      var(--glow-strong) 0%,
      var(--glow-faint) 42%,
      transparent 72%
    ),
    linear-gradient(var(--scrim, transparent), var(--scrim, transparent)),
    var(--backdrop, none),
    linear-gradient(180deg, var(--shade) 0%, var(--shade-deep) 100%);
  background-size: auto, auto, cover, auto;
  background-position: center, center, center, center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--jade);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  width: min(34rem, 100%);
  margin: 0 auto;
  padding: clamp(2rem, 7vw, 3.5rem) clamp(1.25rem, 5vw, 2rem)
    calc(2.5rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 5vw, 2.5rem);
}

/* ------------------------------------------------------------- masthead -- */

.masthead {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.gear {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.125rem;
  height: 2.125rem;
  margin: -0.375rem -0.25rem -0.375rem 0;
  padding: 0;
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--jade-soft);
  cursor: pointer;
  transition:
    color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}

.gear:hover {
  color: var(--jade);
  border-color: var(--jade-line);
}

.gear svg {
  width: 1.0625rem;
  height: 1.0625rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* The venue's mark, above its name.
   Height-capped rather than width-capped: logos arrive at wildly different
   aspect ratios, and a wide wordmark constrained by width becomes a hairline
   while a square one constrained by height stays the size you expect. */
.logo {
  display: block;
  max-height: 2.75rem;
  max-width: min(60%, 12rem);
  width: auto;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 0.6rem;
}

/* The mark sits on its own line above the name, so the language selector keeps
   the top row to itself. */
.masthead-top {
  flex-wrap: wrap;
}

.masthead-top .logo {
  flex-basis: 100%;
}

.eyebrow {
  margin: 0;
  font-size: 0.688rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--jade-soft);
}

.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2rem, 9vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--on-shade);
}

.title-dot {
  color: var(--marigold);
}

/*
 * Rule, lozenge, rule — the table card's ornament, on the screen it leads to.
 *
 * Left-aligned rather than centred, because this page is left-aligned and the
 * card is not; copying the geometry instead of the placement is how a motif
 * travels between two layouts without looking pasted.
 *
 * Hairlines and one hollow mark, the same as the card, so a venue whose accent
 * is pale gets an ornament that is still there rather than one that has
 * vanished into the background.
 */
.ornament {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.9rem 0 0.15rem;
}

.ornament::before,
.ornament::after {
  content: "";
  height: 1px;
  background: var(--jade-line);
}

.ornament::before {
  width: 2.25rem;
}

/* The trailing rule fades out rather than stopping, so the ornament reads as
   the start of the page's text rather than as a divider across it. */
.ornament::after {
  flex: 1;
  max-width: 7rem;
  background: linear-gradient(to right, var(--jade-line), transparent);
}

.ornament span {
  width: 5px;
  height: 5px;
  border: 1px solid var(--marigold);
  transform: rotate(45deg);
}

.lede {
  margin: 0.25rem 0 0;
  max-width: 30ch;
  font-size: 0.938rem;
  line-height: 1.55;
  color: var(--jade);
}

/* ----------------------------------------------------------------- note -- */

/*
 * The guest's own note.
 *
 * Quiet, because most guests will never use it: the review is already written
 * by the time anybody reads this far, and a box competing with it would make
 * the page look like a form. It asks a question rather than labelling a field,
 * which is what gets somebody to answer.
 */
.note-wrap {
  margin-top: 1rem;
}

.label-note {
  display: block;
  margin-bottom: 0.4rem;
}

.note {
  width: 100%;
  font: inherit;
  font-size: 0.938rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  /*
   * --paper, not --ink.
   *
   * --ink is the text colour derived for the paper surface — the review card
   * — and this box sits on the dark ground instead. Using it here put dark
   * text on a dark background at a contrast of 1.24, which is a box a guest
   * can type into and not see what they typed. The ground's text colour is
   * --paper, which is what the title above it uses.
   */
  color: var(--on-shade);
  background: rgba(243, 236, 220, 0.06);
  border: 1px solid var(--jade-line);
}

.note::placeholder {
  color: var(--jade-soft);
}

.note:focus-visible {
  outline: 2px solid var(--marigold);
  outline-offset: 2px;
}

/*
 * Why a note was turned down, under the box that caused it.
 *
 * Not in the notice line at the top, where the writer's own failures go: a
 * guest has to be able to see which thing they typed is being objected to,
 * and the notice is nowhere near it.
 */
.note-help:empty {
  display: none;
}

.note-help {
  margin: 0.45rem 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--warn);
}

/* ---------------------------------------------------------------- chips -- */

.label {
  margin: 0 0 0.75rem;
  font-size: 0.688rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--jade-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  appearance: none;
  border: 1px solid var(--jade-line);
  background: transparent;
  color: var(--jade);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition:
    border-color 0.18s var(--ease),
    background-color 0.18s var(--ease),
    color 0.18s var(--ease);
}

.chip:hover:not([aria-pressed='true']):not([aria-checked='true']) {
  border-color: var(--jade-dim);
  color: var(--on-shade);
}

/* Topics are toggles and lengths are a radiogroup, so the selected state arrives
   under two different attributes. It looks the same either way — a guest is not
   being told which ARIA role they are tapping. */
.chip[aria-pressed='true'],
.chip[aria-checked='true'] {
  background: var(--paper);
  border-color: var(--on-shade);
  color: var(--ink);
}

/* Opens the rest of the topic set. Deliberately not a chip: it is not a topic,
   and something that looks tappable-but-different is how a guest can tell. */
.browse {
  appearance: none;
  display: block;
  margin: 0.5rem 0 -0.35rem;
  /* Vertical padding, not margin: the text is one line of 0.813rem and a 17px
     tap target on a phone is a miss waiting to happen. The rule is drawn with
     text-decoration rather than a border so growing the target does not push
     the underline away from the words. */
  padding: 0.5rem 0.1rem;
  border: 0;
  background: transparent;
  color: var(--jade-soft);
  font-family: inherit;
  font-size: 0.813rem;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--jade-line);
  text-underline-offset: 0.28em;
  cursor: pointer;
  transition:
    color 0.18s var(--ease),
    text-decoration-color 0.18s var(--ease);
}

.browse:hover,
.browse:focus-visible {
  color: var(--on-shade);
  text-decoration-color: var(--jade-dim);
}

/* ---------------------------------------------------------------- sheet -- */

/* Every topic, in a modal. The picker offers ten of maybe fifty; this is where
   the rest live, so it has to be comfortable to scan rather than clever.

   A <dialog>, so the backdrop, Escape, the focus trap and the inertness of the
   page behind it are the browser's job rather than ours. Everything below is
   appearance only. */
.sheet {
  /* Fixed rather than the UA default of centred-and-absolute: on a phone this
     is a bottom sheet, and it has to sit against the viewport. */
  position: fixed;
  inset: auto 0 0 0;
  margin: 0 auto;
  width: min(34rem, 100%);
  /* The user-agent sheet caps a dialog at calc(100% - 6px - 2em), which on a
     phone leaves a bottom sheet floating 19px off each edge instead of flush
     against them. Width above is the intent; this is what lets it hold. */
  max-width: 100%;
  max-height: min(78vh, 40rem);
  box-sizing: border-box;
  padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
  border: 1px solid var(--jade-line);
  /* Square along the bottom edge: it is flush with it. */
  border-radius: 1.1rem 1.1rem 0 0;
  background: var(--shade-deep);
  color: var(--jade);
  overflow: hidden;
  /* Grid, so the header and the search field stay put and only the list
     scrolls. */
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0.9rem;
}

/* [open] rather than the bare element, because a dialog is display:none until
   it is opened and a grid declaration would override that. */
.sheet:not([open]) {
  display: none;
}

.sheet::backdrop {
  background: rgba(6, 17, 14, 0.72);
  backdrop-filter: blur(2px);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sheet-title {
  margin: 0;
  font-size: 0.813rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--jade-soft);
}

.sheet-close {
  appearance: none;
  border: 1px solid var(--jade-line);
  background: transparent;
  color: var(--jade);
  font-family: inherit;
  font-size: 0.813rem;
  font-weight: 600;
  /* Same tap target as a chip: it is the only way out on a phone that has no
     Escape key and no room for a backdrop to tap. */
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition:
    border-color 0.18s var(--ease),
    color 0.18s var(--ease);
}

.sheet-close:hover,
.sheet-close:focus-visible {
  border-color: var(--jade-dim);
  color: var(--on-shade);
}

/* Filters the list below. Only ever seen over eleven topics or more — the
   button that opens this sheet is hidden when everything already fits in the
   picker — so it is never a search box over a handful of chips. */
.sheet-search {
  appearance: none;
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--jade-line);
  border-radius: 999px;
  background: var(--jade-wash);
  color: var(--on-shade);
  font-family: inherit;
  /* 1rem, not the 0.875rem a chip uses: iOS zooms the whole page when a field
     under 16px takes focus, and a page zoomed inside a modal cannot be zoomed
     back out by the guest. */
  font-size: 1rem;
  transition: border-color 0.18s var(--ease);
}

.sheet-search::placeholder {
  color: var(--jade-soft);
}

.sheet-search:focus-visible {
  outline: none;
  border-color: var(--jade-dim);
}

/* The scrolling half. Wraps the chips and the empty line so that swapping one
   for the other cannot change what scrolls. */
.sheet-body {
  overflow-y: auto;
  /* Room for the last row's focus ring, which a flush edge would clip. */
  padding: 0.2rem 0.2rem 0.4rem;
  margin: -0.2rem;
  overscroll-behavior: contain;
}

.sheet-chips {
  align-content: start;
}

.sheet-empty {
  margin: 0.4rem 0.2rem;
  font-size: 0.875rem;
  color: var(--jade-soft);
}

/* Wide enough for the sheet to sit as a panel rather than an edge. */
@media (min-width: 34rem) {
  .sheet {
    inset: 0;
    /* All four insets plus auto margins is the centring every engine has
       agreed on for twenty years. align-self would also do it here, but only
       in the browsers that apply box alignment to absolutely positioned boxes,
       and this page is read on whatever phone scanned the code. */
    margin: auto;
    border-radius: 1.1rem;
    padding-bottom: 1.25rem;
  }
}

/* ----------------------------------------------------------------- slip -- */

.label-slip {
  margin-bottom: 0.625rem;
}

/*
 * The card is clip-path'd, which would eat a box-shadow — so the drop shadow
 * lives on the wrapper as a filter instead.
 *
 * Two of them, because a light page needs a different thing from a dark one.
 * On a dark page the cast is what lifts the card off the ground and the
 * hairline is transparent. On a light page the card can be the same shade as
 * the page behind it, and a zero-blur shadow in `--paper-edge` traces the torn
 * outline that a border could not — a border would be clipped along with
 * everything else.
 */
.slip-wrap {
  filter: drop-shadow(0 0 0.7px var(--paper-edge, transparent))
    drop-shadow(0 22px 34px var(--paper-cast, rgba(0, 0, 0, 0.45)));
}

.slip {
  position: relative;
  background: var(--paper);
  padding: 1.375rem 1.25rem 2.25rem;
  border-radius: 3px;
  /* torn along the bottom, as if pulled from a pad */
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 7px),
    92% calc(100% - 2px),
    84% calc(100% - 9px),
    76% calc(100% - 4px),
    67% calc(100% - 10px),
    58% calc(100% - 3px),
    49% calc(100% - 8px),
    40% calc(100% - 2px),
    31% calc(100% - 9px),
    22% calc(100% - 4px),
    13% calc(100% - 10px),
    6% calc(100% - 3px),
    0 calc(100% - 8px)
  );
}

.review {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  resize: none;
  overflow: hidden;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--ink);
}

.review::placeholder {
  color: var(--ink-soft);
  opacity: 0.6;
}

.review:focus {
  outline: 2px solid var(--ink-soft);
  outline-offset: 6px;
  border-radius: 2px;
}

/* Fresh text rises into place. Transform only, and no fill-mode: the review
   must be readable even if the animation never runs — a throttled background
   tab or a stalled frame should not leave a guest with invisible text. */
.review.settling {
  animation: settle 0.34s var(--ease);
}

@keyframes settle {
  from {
    transform: translateY(6px);
  }
  to {
    transform: none;
  }
}

/* --------------------------------------------------------- loading state -- */

/* In normal flow, not overlaid: the slip sizes to the skeleton while loading,
   so there is no old text underneath holding the card at its previous height.
   The bar rhythm roughly matches three lines of the review type. */
.skeleton {
  display: none;
  flex-direction: column;
  gap: 1.375rem;
  padding: 0.375rem 0 0.5rem;
}

.skeleton span {
  height: 0.6875rem;
  border-radius: 2px;
  background: var(--paper-shadow);
  animation: breathe 1.25s var(--ease) infinite;
}

.skeleton span:nth-child(2) {
  width: 88%;
  animation-delay: 0.14s;
}

.skeleton span:nth-child(3) {
  width: 52%;
  animation-delay: 0.28s;
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.9;
  }
}

.slip[aria-busy='true'] .skeleton {
  display: flex;
}

.slip[aria-busy='true'] .review {
  display: none;
}

/* --------------------------------------------------------------- notice -- */

.notice {
  margin: 0.75rem 0 0;
  min-height: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--jade-soft);
}

.notice[data-tone='error'] {
  color: var(--warn);
}

/*
 * The copy confirmation is the one notice a guest has to act on — it is the
 * instruction for the next thing they do, on a page they are already leaving.
 * Weighted so it is not mistaken for the running commentary the same line
 * carries the rest of the time.
 */
.notice[data-tone='done'] {
  color: var(--jade);
  font-weight: 500;
}

/* ---------------------------------------------------------------- setup -- */

/*
 * Shown when the venue's setup is unfinished, above everything.
 *
 * A working-looking form over a page that can post nothing is worse than an
 * honest refusal: the guest writes a review, finds nothing to press, and
 * leaves — and because the owner's review list only holds reviews somebody
 * took to a listing, their dashboard says "Nothing yet" and they conclude the
 * product is broken. Nobody could see the one fact that explained it.
 */
.setup-notice {
  margin: 0 0 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--warn);
  border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  /* --warn, not --ink. This page is dark: --ink is the *paper* theme's text
     colour and lands at 1.29 against this background — legible in a mockup and
     invisible on the page. Measured, not guessed. */
  color: var(--warn);
  font-size: 0.9rem;
  line-height: 1.5;
}

.setup-notice[hidden] {
  display: none;
}

.setup-notice p {
  margin: 0;
}

.setup-fix {
  display: inline-block;
  margin-top: 0.45rem;
  color: var(--warn);
  font-weight: 500;
}

.setup-fix[hidden] {
  display: none;
}

/* -------------------------------------------------------------- actions -- */

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.actions-row {
  display: flex;
  gap: 0.625rem;
}

.btn {
  appearance: none;
  font-family: inherit;
  font-size: 0.938rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.95rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition:
    background-color 0.18s var(--ease),
    border-color 0.18s var(--ease),
    color 0.18s var(--ease),
    opacity 0.18s var(--ease);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn-quiet {
  flex: 1;
  border: 1px solid var(--jade-line);
  background: transparent;
  color: var(--on-shade);
}

.btn-quiet:hover:not(:disabled) {
  border-color: var(--jade-dim);
  background: var(--jade-wash);
}

.btn-go {
  border: 1px solid var(--marigold);
  background: var(--marigold);
  color: var(--on-marigold);
}

.btn-go:hover:not(:disabled) {
  background: var(--marigold-lift);
  border-color: var(--marigold-lift);
}

/* Two places to post, one accent. Marigold is still spent once — as a fill —
   so the second listing is the outline of the same colour. Whichever button
   ends up alone on the page gets the fill instead (app.js drops the class). */
.btn-go-second {
  background: transparent;
  color: var(--marigold);
}

.btn-go-second:hover:not(:disabled) {
  background: var(--marigold-soft);
  border-color: var(--marigold);
}

.btn-small {
  flex: none;
  align-self: flex-start;
  font-size: 0.813rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
}

.hint {
  margin: 0.125rem 0 0;
  text-align: center;
  font-size: 0.813rem;
  color: var(--jade-soft);
}

/* ---------------------------------------------------------------- focus -- */

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

.review:focus-visible {
  outline-color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* The listing buttons, built from whichever links the business has set. They
   stack, and each carries its brand mark beside the label — so the button needs
   to be a flex row rather than centred text. */
.destinations {
  display: grid;
  gap: 0.6rem;
}

.destinations .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.destinations svg {
  flex: 0 0 auto;
}

/* The review-language selector, where the settings gear used to sit. Quiet on
   purpose: a guest who needs it will look for their own script, and one who
   does not should barely notice it. */
.lang {
  appearance: none;
  border: 1px solid var(--jade);
  border-radius: 999px;
  background: var(--jade-tint);
  color: var(--on-shade);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 2rem 0.45rem 0.95rem;
  cursor: pointer;
  /* The native arrow disappears once appearance is stripped, and a select with
     no arrow reads as a label rather than a control — which is the whole
     problem when a guest needs to find it without being able to read the page. */
  background-image: linear-gradient(45deg, transparent 50%, var(--jade) 50%),
    linear-gradient(135deg, var(--jade) 50%, transparent 50%);
  background-position: right 1.05rem center, right 0.8rem center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.lang:hover,
.lang:focus-visible {
  border-color: var(--on-shade);
  background-color: var(--jade-tint-strong);
}

.lang option {
  background-color: var(--paper);
  color: var(--ink);
}

/* One row per listing: the brand mark on its own tile, then the button. The
   mark is kept off the button's fill because these logos come with clear-space
   and background rules, and a four-colour G on marigold satisfies neither. */
.destination {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
}

/* Each listing is an anchor rather than a button, because a control whose job
   is to go somewhere should be a link — see renderDestinations for why that
   turned out to matter. `.btn` was written for <button>, which brings neither
   an underline nor a block layout with it, so both are set here. */
.destination .btn {
  flex: 1;
  display: block;
  text-align: center;
  text-decoration: none;
}

.destination-mark {
  flex: 0 0 auto;
  width: 3rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  /* Plain and light, which is what every one of these guidelines asks for. */
  background: var(--paper);
}

/* The stand-in for a platform with no mark in the icon set. Its background is
   set inline, from that platform's own brand colour.

   White on purpose, and not a theme property. The tile is that company's colour
   whatever palette the business chose, exactly as the real marks are never
   recoloured — a letter tinted to match the page has stopped standing in for
   the same thing. At this size and weight it clears the 3:1 that large text
   asks for against every brand colour on the list. */
.destination-initial {
  color: #fff;
  font-family: var(--ui);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
}

/* ----------------------------------------------------------------- 404 -- */

/* The page a mistyped address lands on.

   It shares this stylesheet with the guest page, so it inherits the palette,
   the two typefaces and the garden-at-dusk background without restating any of
   them — which also means a change to the theme reaches this page rather than
   leaving one screen behind on last season's colours.

   Everything below is layout for one screen: a numeral centred in the viewport,
   the explanation under it, and one way out. */

.error {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 6vw, 3rem);
  padding-bottom: calc(clamp(1.5rem, 6vw, 3rem) + env(safe-area-inset-bottom));
  text-align: center;
}

.error-inner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  max-width: 32rem;
}

/* The glow behind the numeral. Sized in ems so it tracks the digits as they
   scale, and pushed behind everything so the text sits on top of its own
   light rather than beside it. */
.error-inner::before {
  content: '';
  position: absolute;
  top: 42%;
  left: 50%;
  width: 22rem;
  height: 22rem;
  max-width: 120vw;
  max-height: 120vw;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    var(--glow-strong) 0%,
    var(--glow-faint) 45%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
  animation: error-breathe 7s var(--ease) infinite;
}

.error-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.688rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--jade-soft);
}

/* The numeral. Optical size rather than a fixed one: it is the whole design at
   this size, and on a narrow phone it has to give way to the words under it. */
.error-code {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(6rem, 34vw, 13rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--on-shade);
  /* The same warmth the background carries, so the digits sit in the scene
     rather than on top of it. */
  text-shadow: 0 0 60px rgba(233, 160, 59, 0.18);
}

/* Marigold is spent once on this page, exactly as it is on the guest page —
   there, the button that opens the listing; here, the nought in the middle. */
.error-code span {
  color: var(--marigold);
}

.error-title {
  margin: 0.9rem 0 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.5rem, 6vw, 2rem);
  line-height: 1.15;
  color: var(--on-shade);
}

.error-lede {
  margin: 0.75rem 0 0;
  max-width: 30rem;
  font-size: 0.938rem;
  line-height: 1.6;
  color: var(--jade);
}

/* The address that failed, in the typeface a machine would set it in — it is a
   string to check character by character, not prose to read. */
.error-host {
  margin: 1.25rem 0 0;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--jade-line);
  border-radius: 999px;
  background: var(--jade-wash);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.813rem;
  /* Full jade, not the dimmed one. This is the string somebody has to compare
     against what is printed on their table, character by character, and the
     dimmed jade sits at 2.9:1 — under the 4.5 every other piece of text in this
     product is held to. Its subordinate place is made by the border and the
     size, which cost nothing in legibility. */
  color: var(--jade);
  word-break: break-all;
}

.error-actions {
  margin-top: 1.75rem;
}

/* The only anchor styled as a button on the platform. `.btn` was written for
   <button>, which has no underline to clear; an <a> brings one with it. */
.error-actions .btn {
  display: inline-block;
  text-decoration: none;
}

.error-note {
  margin: 1.5rem 0 0;
  font-size: 0.813rem;
  line-height: 1.6;
  /* Same reasoning as the address above: this is a sentence to read, not a
     label to glance at. The eyebrow keeps the dimmed jade because it is a
     wordmark the title repeats, and because every other screen sets it that
     way. */
  color: var(--jade);
}

/* Each part arrives just after the one above it. Small distances and a short
   duration: this is a page somebody reached by accident, and it should be
   settled by the time they have focused on it. */
.error-inner > * {
  animation: error-rise 0.5s var(--ease) both;
}

.error-inner > *:nth-child(2) {
  animation-delay: 0.06s;
}
.error-inner > *:nth-child(3) {
  animation-delay: 0.12s;
}
.error-inner > *:nth-child(4) {
  animation-delay: 0.18s;
}
.error-inner > *:nth-child(5) {
  animation-delay: 0.24s;
}
.error-inner > *:nth-child(6) {
  animation-delay: 0.3s;
}

@keyframes error-rise {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes error-breathe {
  0%,
  100% {
    opacity: 0.75;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
  }
}

/* Motion is decoration here and nothing depends on it, so it comes off
   entirely rather than being slowed down. */
@media (prefers-reduced-motion: reduce) {
  .error-inner > *,
  .error-inner::before {
    animation: none;
  }
}

/* -------------------------------------------------------------------------- */
/* The guest app (welcome.html)                                               */
/* -------------------------------------------------------------------------- */

/* The sign-up is built from the review page's own pieces — the masthead, the
   labels, the note field, the buttons — so the two read as one venue's pages.
   Once the guest is in, it is an app: a bar with whose app it is, tiles to tap,
   and the way to the review page. Every colour is the theme's. */

.welcome-start,
.app-home {
  display: grid;
  gap: clamp(1.5rem, 5vw, 2rem);
}

.welcome-form {
  display: grid;
  gap: 1rem;
}

.welcome-form .btn-go {
  width: 100%;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--on-shade);
  cursor: pointer;
}

.consent input {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  accent-color: var(--marigold);
}

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

/* ------------------------------------------------------------- app bar -- */

.app-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: calc(0.7rem + env(safe-area-inset-top)) clamp(1.25rem, 5vw, 2rem) 0.7rem;
  background: color-mix(in srgb, var(--shade) 90%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--jade-line);
  color: var(--on-shade);
}

/* Under the bar the page needs less air above it: the bar is the masthead. */
.app-bar:not([hidden]) + .page {
  padding-top: 1.5rem;
}

.app-bar-logo {
  display: block;
  height: 1.75rem;
  width: auto;
  max-width: 7rem;
  object-fit: contain;
}

.app-bar-name {
  min-width: 0;
  font-family: var(--display);
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-hello {
  display: grid;
  gap: 0.4rem;
}

.app-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.6rem, 7vw, 2.1rem);
  line-height: 1.12;
  color: var(--on-shade);
}

/* --------------------------------------------------------------- tiles -- */

.tiles {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 30rem) {
  .tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* A whole tile to tap, not a word: these are opened with a thumb, often one-
   handed with a bag in the other. */
.tile {
  height: 100%;
  min-height: 6.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.95rem;
  border: 1px solid var(--jade-line);
  border-radius: 14px;
  background: var(--jade-wash);
  color: var(--on-shade);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
  transition:
    background-color 0.18s var(--ease),
    border-color 0.18s var(--ease),
    transform 0.18s var(--ease);
}

.tile:hover {
  border-color: var(--jade-dim);
  background: var(--jade-tint);
}

.tile:active {
  transform: scale(0.97);
}

.tile-label {
  overflow-wrap: anywhere;
}

/* The softphone tile is a button, drawn as a tile. */
button.tile {
  width: 100%;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

/* Once the softphone tile shows, the phone number behind it is the same
   action twice. */
.tile-voice:not([hidden]) + .tile-fallback {
  display: none;
}

.tile-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  background: var(--jade-tint-strong);
  color: var(--jade);
}

.tile-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ------------------------------------------------------------- install -- */

.install-card {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--jade-dim);
  border-radius: 16px;
  background: var(--jade-tint);
  color: var(--on-shade);
}

.install-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.install-title {
  margin: 0.15rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.install-lede {
  margin: 0.3rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--jade-soft);
}

.install-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.install-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.step-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--jade-line);
  border-radius: 8px;
  color: var(--jade);
}

.step-icon svg {
  width: 1rem;
  height: 1rem;
}

.install-actions {
  display: flex;
  gap: 0.6rem;
}

.install-actions .btn {
  flex: 1;
  padding-block: 0.8rem;
}

/* ------------------------------------------------------- review, foot -- */

/* The one outline in the highlight on this screen: the venue's reason for
   having Reviewslip at all. */
.review-cta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--marigold);
  border-radius: 16px;
  background: var(--marigold-soft);
  color: var(--on-shade);
  text-decoration: none;
}

.review-cta::after {
  content: "\203A";
  margin-left: auto;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--marigold);
}

.review-cta .tile-icon {
  background: var(--marigold);
  color: var(--on-marigold);
}

.review-cta-text {
  display: grid;
  gap: 0.15rem;
}

.review-cta-title {
  font-weight: 700;
}

.review-cta-action {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--marigold);
}

.app-foot {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.813rem;
  color: var(--jade-soft);
}

.link-button {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--on-shade);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .tile {
    transition: none;
  }

  .tile:active {
    transform: none;
  }
}
