/* unamotion — the demo page (views/demo.templ, demo.js): the form on bare Daybook paper between two stripes, a sky above and a meadow below. Both stripes are
   transparent where the paper shows, so the page reads as one sheet. Sizes hang off --mh, the meadow's height. */
:root {
  --mh: clamp(227px, 38.9svh, 389px);
  --sh: clamp(160px, 35svh, 340px);
}
html, body { margin: 0; background: var(--db-bg); }

.dm {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ------------------------------------------------ the stripes */
.dm-band { position: absolute; left: 0; right: 0; pointer-events: none; }
.dm-sky { top: 0; height: var(--sh); overflow: hidden; }
.dm-loop {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  background-repeat: repeat-x;
  background-size: auto 100%;
  will-change: transform;
}

/* Safari on iOS 26 paints its status bar and the band round its toolbar in one flat colour, taken from a fixed strip on
   that edge of the screen (it no longer reads theme-color). The top one hands it the sky's own top edge, picked off the
   art over the paper; the bottom one the paper (a flat green there looked nothing like paint, and fading the meadow's
   foot into the paper looked worse). Both fade out so the strips themselves don't show. */
.dm-tint {
  position: fixed;
  left: 0; right: 0;
  height: 12px;
  z-index: 1;
  pointer-events: none;
}
.dm-tint--sky { top: 0; background-color: #CBE4F0; mask-image: linear-gradient(#000, transparent); }
.dm-tint--meadow { bottom: 0; background-color: var(--db-bg); mask-image: linear-gradient(transparent, #000); }

/* The meadow's transparent top may run behind the form; only the part with paint on it holds space. */
.dm-ground {
  position: relative;
  flex: none;
  height: calc(var(--mh) * .87);
  margin-top: auto;
  pointer-events: none;
}
.dm-world { bottom: 0; height: var(--mh); overflow: hidden; }
.dm-land { transition: opacity .5s ease; }
.dm-kindworld { opacity: 0; transition: opacity 1.1s ease; }
/* the world comes in over the land, and only then does the land go, so the paper never shows through */
[data-on] .dm-kindworld { opacity: 1; }
[data-on] .dm-land { opacity: 0; transition-delay: .9s; }
@media (prefers-reduced-motion: reduce) { .dm-land, .dm-kindworld { transition: none; } }
.dm-rider {
  position: absolute;
  left: 0;
  bottom: 21.8%;   /* the tyres run on the path */
  will-change: transform;
}
.dm-rider img { position: absolute; display: block; }
.dm-body { position: relative !important; width: 100%; height: auto; }
.dm-spokes { will-change: transform; }
.dm-shadow {
  position: absolute;
  left: 4%; right: 4%; bottom: -2.5%; height: 7%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--db-fg) 22%, transparent), transparent);
}

/* ------------------------------------------------ the bar and the form */
.dm-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 40px);
  font: 500 20px/1 var(--font-db);
  letter-spacing: -.02em;
}
.dm-bar a { color: var(--db-fg); text-decoration: none; }

.dm-main {
  position: relative;
  z-index: 2;
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding-top: calc(var(--sh) * .12);
  padding-bottom: 8px;
}
.dm-say { width: min(100vw - 32px, 880px); margin: 0 0 18px 50%; transform: translateX(-50%); text-align: center; }
.dm-h1 {
  margin: 0;
  font: 500 var(--db-size-heading)/1.1 var(--font-db);
  letter-spacing: -.03em;
  text-wrap: balance;
}
.dm-lead {
  margin: 8px auto 0;
  color: var(--db-fg-2);
  font: 400 var(--db-size-lead)/1.4 var(--font-db);
  text-wrap: balance;
}

/* One headline at a time: the promise on the first step, then each question leads. */
.dm:not([data-at="kind"]) .dm-say { display: none; }
.dm:not([data-at="kind"]) .dm-main { padding-top: calc(var(--sh) * .17); }

.dm-form { display: grid; gap: 12px; }
.dm-top { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
.dm-back {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: -6px; padding: 4px 8px 4px 6px;
  border: 0; border-radius: 8px; background: none;
  color: var(--db-fg-2);
  font: 500 var(--db-size-body)/1 var(--font-db);
  cursor: pointer;
}
.dm-back:hover { background: var(--db-card); color: var(--db-fg); }
.dm-back svg { width: 16px; height: 16px; }
.dm-count { margin-left: auto; color: var(--db-fg-2); font: 500 var(--db-size-body)/1 var(--font-db); }
.dm-track { height: 3px; border-radius: 2px; background: var(--db-card-2); overflow: hidden; }
.dm-track i {
  display: block; height: 100%; width: 100%;
  background: var(--db-field);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  transition: transform .5s var(--ease-db);
}

.dm-step { margin: 0; padding: 0; border: 0; min-width: 0; }
.dm-step[hidden] { display: none; }
.dm-q {
  display: block;
  width: 100%;
  margin: 10px 0 16px;
  padding: 0;
  font: 500 calc(var(--db-size-heading) * .85)/1.12 var(--font-db);
  letter-spacing: -.03em;
  outline: 0;
}
.dm-hint { margin: -8px 0 14px; color: var(--db-fg-2); font: 400 var(--db-size-body)/1.4 var(--font-db); }

.dm-opts { display: grid; gap: 8px; }
.dm-opts[hidden], .dm-field[hidden] { display: none; }
.dm-opts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dm-opt { position: relative; display: block; cursor: pointer; }
.dm-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.dm-opt span {
  display: grid;
  gap: 3px;
  height: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--db-card);
  color: var(--db-fg);
  transition: background-color var(--duration-db) var(--ease-db), color var(--duration-db) var(--ease-db);
}
.dm-opt b { font: 500 var(--db-size-lead)/1.25 var(--font-db); letter-spacing: -.015em; }
.dm-opt small { font: 400 var(--db-size-body)/1.3 var(--font-db); color: var(--db-fg-2); }
.dm-opts--tight { gap: 6px; }
.dm-opts--tight .dm-opt span { padding: 9px 13px; }
.dm-opts--tight .dm-opt b { font: 450 var(--db-size-body)/1.25 var(--font-db); letter-spacing: -.01em; }
.dm-opt:hover span { background: var(--db-card-2); }
.dm-opt input:checked + span { background: var(--db-field); color: var(--db-field-ink); }
.dm-opt input:checked + span small { color: inherit; opacity: .78; }
.dm-opt input:focus-visible + span { outline: 2px solid var(--db-focus); outline-offset: 2px; }
.dm-opt input:disabled { cursor: default; }
.dm-opt:has(input:disabled) { cursor: default; }
.dm-opt:hover input:disabled + span, .dm-opt input:disabled + span { background: var(--db-card); color: var(--db-fg-3); }

.dm-field { display: grid; gap: 6px; margin-top: 12px; font: 500 var(--db-size-body)/1.3 var(--font-db); color: var(--db-fg); }
.dm-field input, .dm-field textarea {
  padding: 11px 12px;
  border: 1px solid var(--db-card-3);
  border-radius: 10px;
  background: var(--db-raised);
  color: var(--db-fg);
  font: 400 var(--db-size-lead)/1.3 var(--font-db);
}
.dm-field textarea { resize: vertical; min-height: 66px; }
.dm-field input:focus-visible, .dm-field textarea:focus-visible { outline: 2px solid var(--db-focus); outline-offset: 1px; }
.dm-fields { display: grid; gap: 10px; }
.dm-fields--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.dm-fields .dm-field { margin-top: 0; gap: 4px; }
.dm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The pages a business can share: each field looks like the place it points to. The Instagram and TikTok colours are
   theirs, not Daybook's, and stay in this block. */
.dm-socials {
  --ig: linear-gradient(45deg, #feda75, #fa7e1e 25%, #d62976 50%, #962fbf 75%, #4f5bd5);
  --tt-cyan: #25f4ee;
  --tt-red: #fe2c55;
  display: grid;
  gap: 12px;
}
.dm-social { display: flex; align-items: center; min-width: 0; cursor: text; }
.dm-social input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  color: inherit;
  font: 400 var(--db-size-lead)/1.2 var(--font-db);
}
.dm-social-pre { flex: none; color: var(--db-fg-2); font: 400 var(--db-size-lead)/1.2 var(--font-db); }
.dm-social-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-right: 12px; border-radius: 12px; }
.dm-social-icon svg { width: 26px; height: 26px; display: block; }
.dm-social--ig, .dm-social--tt { height: 58px; padding: 5px 14px 5px 5px; box-sizing: border-box; border-radius: 16px; }
.dm-social--ig { border: 2px solid transparent; background: linear-gradient(var(--db-raised), var(--db-raised)) padding-box, var(--ig) border-box; }
.dm-social--ig .dm-social-icon { color: #fff; background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.dm-social--ig:focus-within { outline: 2px solid #d62976; outline-offset: 2px; }
.dm-social--tt { background: #010101; color: #fff; box-shadow: -2px -2px 0 var(--tt-cyan), 2px 2px 0 var(--tt-red); margin: 2px; }
.dm-social--tt .dm-social-pre { color: rgb(255 255 255 / .55); }
.dm-social--tt input::placeholder { color: rgb(255 255 255 / .45); }
.dm-social--tt input { caret-color: var(--tt-cyan); }
.dm-social--tt:focus-within { box-shadow: -3px -3px 0 var(--tt-cyan), 3px 3px 0 var(--tt-red); }
/* the website: a small browser window, its address bar the field */
.dm-browser { border: 1px solid var(--db-card-3); border-radius: 14px; background: var(--db-card); padding: 7px 8px 8px; }
.dm-browser-bar { display: flex; gap: 5px; margin: 0 0 6px 4px; }
.dm-browser-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--db-card-3); }
.dm-social--web { height: 40px; padding: 0 14px 0 10px; border-radius: 999px; background: var(--db-raised); }
.dm-social--web:focus-within { outline: 2px solid var(--db-focus); outline-offset: 1px; }
.dm-globe { flex: none; width: 20px; height: 20px; margin-right: 8px; color: var(--db-field); }
[data-else-field] { margin-top: 6px; }
[data-else-field] input { padding: 8px 12px; }

/* the field people never see, for robots; the shared icon, drawn only where it's used */
.dm-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.dm-defs { position: absolute; }

/* when the answers didn't get through */
.dm-err { margin: 0; color: var(--db-fg); font: 500 var(--db-size-body)/1.35 var(--font-db); }
.dm-err[hidden] { display: none; }

.dm-foot { display: flex; justify-content: flex-end; min-height: 44px; }
.dm-foot[hidden] { display: none; }

/* the calendar: the visitor's time zone, then the month on one side and the day's times on the other */
.dm-zone { position: relative; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 12px; }
.dm-zone-label { color: var(--db-fg-2); font: 400 var(--db-size-body)/1.3 var(--font-db); }
.dm-zone-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; max-width: 100%; padding: 6px 10px 6px 12px; border: 0; border-radius: 10px; background: var(--db-card); color: var(--db-fg); font: 400 var(--db-size-body)/1.25 var(--font-db); text-align: left; cursor: pointer; }
.dm-zone-btn:hover, .dm-zone-btn[aria-expanded="true"] { background: var(--db-card-2); }
.dm-zone-btn:focus-visible { outline: 2px solid var(--db-focus); outline-offset: 1px; }
.dm-zone-btn > svg { flex: none; width: 18px; height: 18px; color: var(--db-fg-2); }
.dm-zone-btn b { font-weight: 500; }
.dm-zone-btn [data-zone-now] { margin-left: 4px; color: var(--db-fg-2); font-variant-numeric: tabular-nums; }
.dm-zone-btn .dm-zone-chev { width: 16px; height: 16px; transition: transform .16s; }
.dm-zone-btn[aria-expanded="true"] .dm-zone-chev { transform: rotate(180deg); }
.dm-zone-pop { position: absolute; top: calc(100% + 6px); left: 0; width: min(25rem, 100%); padding: 6px; border-radius: 14px; background: var(--db-raised); box-shadow: 0 0 0 1px var(--db-card-3), 0 14px 34px -14px color-mix(in srgb, var(--db-fg) 35%, transparent); }
.dm-zone-pop[hidden] { display: none; }
.dm-zone-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 8px; background: var(--db-card); color: var(--db-fg-2); }
.dm-zone-search:focus-within { outline: 2px solid var(--db-focus); outline-offset: -1px; }
.dm-zone-search svg { flex: none; width: 18px; height: 18px; }
.dm-zone-search input { flex: 1; min-width: 0; height: 40px; padding: 0; border: 0; outline: 0; background: none; color: var(--db-fg); font: 400 var(--db-size-body)/1.2 var(--font-db); }
.dm-zone-search input::placeholder { color: var(--db-fg-3); opacity: 1; }
.dm-zone-list { max-height: 17.5rem; margin: 6px 0 0; padding: 0; overflow-y: auto; list-style: none; overscroll-behavior: contain; }
.dm-zone-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.dm-zone-list li:hover, .dm-zone-list li[data-active] { background: var(--db-card); }
.dm-zone-list li[aria-selected="true"] { background: var(--db-field-soft); }
.dm-zone-words { display: grid; gap: 1px; min-width: 0; }
.dm-zone-words b { font: 500 var(--db-size-body)/1.25 var(--font-db); color: var(--db-fg); overflow-wrap: anywhere; }
.dm-zone-words em { margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: var(--db-card-2); color: var(--db-fg-2); font: 500 var(--db-size-caption)/1.3 var(--font-db); }
.dm-zone-words small { color: var(--db-fg-2); font: 400 var(--db-size-ui)/1.25 var(--font-db); }
.dm-zone-list time { flex: none; color: var(--db-fg-2); font: 400 var(--db-size-ui)/1.25 var(--font-db); font-variant-numeric: tabular-nums; }
.dm-zone-none { margin: 10px; color: var(--db-fg-2); font: 400 var(--db-size-body)/1.3 var(--font-db); }
.dm-zone-none[hidden] { display: none; }
.dm-zone[hidden], .dm-month[hidden] { display: none; }
.dm-cal-say { margin: 0 0 12px; color: var(--db-fg); font: 500 var(--db-size-body)/1.35 var(--font-db); }
.dm-cal-say[hidden] { display: none; }
.dm-retry { padding: 0; border: 0; background: none; color: var(--db-fg); font: 500 var(--db-size-body)/1.3 var(--font-db); text-align: left; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.dm-turnstile { margin-top: 12px; }
.dm-cal { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
.dm-month, .dm-times { padding: 12px 14px 14px; border-radius: 14px; background: var(--db-card); }
.dm-month-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dm-month-bar b { font: 500 var(--db-size-lead)/1.2 var(--font-db); letter-spacing: -.015em; }
.dm-month-bar button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--db-fg); cursor: pointer; }
.dm-month-bar button:hover:not(:disabled) { background: var(--db-card-2); }
.dm-month-bar button:disabled { color: var(--db-card-3); cursor: default; }
.dm-month-bar svg { width: 18px; height: 18px; }
.dm-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.dm-days i { padding: 2px 0 4px; color: var(--db-fg-2); font: 500 var(--db-size-body)/1.2 var(--font-db); text-align: center; }
.dm-days button {
  height: 36px; padding: 0;
  border: 0; border-radius: 9px;
  background: var(--db-raised); color: var(--db-fg);
  font: 500 var(--db-size-body)/1 var(--font-db);
  cursor: pointer;
}
.dm-days button:hover:not(:disabled) { background: var(--db-card-2); }
.dm-days button:disabled { background: none; color: var(--db-fg-3); font-weight: 400; cursor: default; }
.dm-days button[aria-pressed="true"], .dm-slots button[aria-pressed="true"], .dm-slots button[aria-pressed="true"]:hover { background: var(--db-field); color: var(--db-field-ink); }
.dm-times { display: flex; flex-direction: column; gap: 10px; }
.dm-times > b { font: 500 var(--db-size-lead)/1.25 var(--font-db); letter-spacing: -.015em; }
.dm-slots { display: grid; gap: 6px; max-height: 15.5rem; overflow-y: auto; padding: 2px; }
.dm-slots button {
  height: 38px; padding: 0;
  border: 0; border-radius: 9px;
  background: var(--db-raised); color: var(--db-fg);
  font: 500 var(--db-size-body)/1 var(--font-db);
  cursor: pointer;
}
.dm-slots button:hover { background: var(--db-card-2); }
.dm-slots .dm-hint { margin: 0; }
.dm-no-time { margin-top: auto; padding: 4px 0 0; border: 0; background: none; color: var(--db-fg-2); font: 400 var(--db-size-body)/1.3 var(--font-db); text-align: left; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.dm-no-time:hover { color: var(--db-fg); }
.dm-cal button:focus-visible { outline: 2px solid var(--db-focus); outline-offset: 1px; }

/* the last page: when, and everything they told us, set out like a record in a card, what the demo shows first leading it. The progress is finished with, so it goes. */
.dm[data-at="sum"] .dm-top, .dm[data-at="sum"] .dm-track { display: none; }
.dm-booked { display: flex; align-items: center; gap: 10px; margin: -4px 0 10px; padding: 12px 14px; border-radius: 12px; background: var(--db-field); color: var(--db-field-ink); font: 500 var(--db-size-lead)/1.25 var(--font-db); letter-spacing: -.015em; }
.dm-booked[hidden] { display: none; }
.dm-booked svg { flex: none; width: 22px; height: 22px; }
.dm-yours { gap: 6px; padding: 12px 20px 6px; color: var(--db-fg); }
.dm-yours-title { margin: 0; font: 500 var(--db-size-lead)/1.25 var(--font-db); letter-spacing: -.015em; }
.dm-rows [data-row="busy"], .dm-rows [data-row="find"] { grid-column: span 2; }
.dm-rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
.dm-rows > div { padding: 8px 0; border-top: 1px solid var(--db-card-2); min-width: 0; }
.dm-rows > div[hidden] { display: none; }
.dm-rows dt { margin-bottom: 2px; color: var(--db-fg-2); font: 500 var(--db-size-body)/1.3 var(--font-db); }
.dm-rows dd { margin: 0; font: 400 var(--db-size-body)/1.35 var(--font-db); white-space: pre-line; overflow-wrap: anywhere; }

@media (max-width: 560px) {
  :root { --mh: clamp(195px, 30.3svh, 281px); --sh: clamp(110px, 20svh, 190px); }
  .dm-main, .dm:not([data-at="kind"]) .dm-main { padding-top: calc(var(--sh) * .08); }
  .dm-opts--2 { grid-template-columns: minmax(0, 1fr); }
  [data-step="kind"] .dm-opts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dm-field input, .dm-field textarea { font-size: 16px; }
  .dm-fields--2 { grid-template-columns: minmax(0, 1fr); }
  [data-step="kind"] .dm-opt small { display: none; }
  .dm-cal, .dm-rows { grid-template-columns: minmax(0, 1fr); }
  .dm-slots { max-height: none; overflow: visible; }
  .dm-zone-label { flex-basis: 100%; }
  .dm-zone-btn { width: 100%; }
  .dm-zone-btn .dm-zone-chev { margin-left: auto; }
  .dm-zone-pop { width: 100%; }
  .dm-zone-search input { font-size: 16px; }
  .dm-rows [data-row="busy"], .dm-rows [data-row="find"] { grid-column: auto; }
  .dm-foot .db-btn { width: 100%; }
}

/* after booking, and a visitor's own page */
.dm-booked-more { margin: 0 0 12px; }
.dm-booked-more[hidden] { display: none; }
.dm-booked-more a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.dm-manage-do { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }
.dm-manage-do .dm-no-time { margin: 0; padding: 0; }
.dm-manage-foot { justify-content: space-between; gap: 10px; margin-top: 14px; }
[data-manage-view][hidden], [data-manage-pick][hidden], [data-manage-do][hidden], [data-manage-ask][hidden] { display: none; }

/* Short laptop screens: the stripe gets a little lower and the form a little closer, so the whole of the longest
   questions still fits above the road. */
@media (max-height: 880px) and (min-width: 561px) {
  :root { --mh: clamp(200px, 31svh, 389px); }
  .dm-main, .dm:not([data-at="kind"]) .dm-main { padding-top: calc(var(--sh) * .03); }
  .dm-bar { padding-block: 10px; }
  .dm-lead { margin-top: 4px; }
  .dm-say { margin-bottom: 10px; }
  .dm-q { margin: 6px 0 12px; }
  .dm-opt span { padding: 8px 14px; }
  .dm-opts--tight .dm-opt span { padding: 7px 12px; }
  .dm-field input { padding: 9px 12px; }
  .dm-days button { height: 30px; }
  .dm-slots button { height: 34px; }
}
