/*
  BusyCal Bookings: host dashboard styles.

  Loaded after the public stylesheet (style.css) and its dark palette (dark.css), and never
  changes them. Everything here builds on their tokens, so the dashboard has the same type,
  colors, spacing, radii, motion and light and dark behavior as the booking pages. Where a
  rule here only adds a variant of a public component, it says so. The design source is
  design/dashboard/dashboard.css; this file keeps the parts the current screens use.

  The same posture as the public pages applies: every action is a link, a form or a
  <details> disclosure, so the dashboard works without scripts. The Content Security
  Policy blocks inline styles, inline scripts and data: URIs, so every icon is inline SVG
  in the markup and every style lives in this file.

  The dashboard always uses the default BusyCal accent and follows the system appearance.
  A host's own accent, theme, background and cover apply to their public pages; Settings >
  Appearance chooses them and shows them in private previews of the real pages.

  Breakpoints follow the public pages: phones below 640 px, tablets from 640 px, two
  columns from 880 px, desktop from 1024 px.

  Sections:
    1. Dashboard tokens
    2. App frame: bar, main navigation, account menu, footer
    3. Page heading and back link
    4. Panels, rows and key and value lists
    5. Tabs
    6. Status tags and dots
    7. Notices (variants of .notice)
    8. Buttons (variants of .btn) and menus
    9. Overview
   10. Bookings: one booking, its tools and booking someone in
   11. Booking pages: list, editor, settings and availability
   12. Settings layout
   13. Appearance
   14. Confirmation screens and errors
   15. Sign-in
   16. Phones
   17. Updates in place: busy controls, messages beside an action, motion
   18. Refinements: the dashboard's polished look (design/2a/)
   19. Preferences, forced colors and print
*/

/* ---------- 1. Dashboard tokens ---------- */

:root {
  /* The dashboard is wider than a booking page: two columns plus a side menu fit at 1120. */
  --app-shell: 1120px;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;

  /* Status dot colors. Dots never carry meaning alone; each sits beside its text. */
  --dot-on: var(--success-fill);
  --dot-link: var(--accent-fill);
  --dot-off: var(--text-disabled);
  --dot-warn: var(--warn-fill);

  /*
    Motion. Things arrive with a quick ease-out and leave a little faster, so the screen
    settles before the next action. The public stylesheet turns every transition and
    animation off for people who ask for reduced motion; page-editor.js checks the same
    preference before it animates anything itself.
  */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --motion-quick: 140ms;
  --motion: 200ms;
}

/* ---------- 2. App frame ---------- */

/*
  The bar sits on the page background, above the accent glow the public pages use, so the
  dashboard opens with the same light wash at the top. It does not stick: the page scrolls
  as one.
*/
.appbar {
  width: 100%;
  max-width: calc(var(--app-shell) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--space-4) var(--gutter) 0;
}

.appbar-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand tools"
    "nav nav";
  align-items: center;
  gap: var(--space-3) var(--space-4);
}

.appbar-brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  justify-self: start;
  min-width: 0;
  min-height: var(--target);
  padding-right: var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.appbar-brand .mark {
  width: 28px;
  height: 28px;
  flex: none;
}

/*
  While Bookings is in beta, an accent tag follows the brand in both host headers: the bar,
  and the brand alone above the sign-in and error screens. A hairline keeps the pill's shape
  clear on the page background, where its tint alone barely shows, and the tag drops the
  brand's tighter letter spacing. Its narrower padding leaves room for the whole name at
  360 px. The tag never shrinks: on a narrower screen the brand's name ends in an ellipsis
  instead of wrapping, so the bar keeps its height. When the beta ends, delete this block,
  the two tags in host/header.html and brand_beta in the host language tables.
*/
.appbar-brand:has(> .appbar-beta) {
  max-width: 100%;
}

.appbar-brand > span:has(+ .appbar-beta) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appbar-beta {
  flex: none;
  padding-inline: 6px;
  box-shadow: inset 0 0 0 1px var(--accent-line);
  letter-spacing: normal;
}

.appbar-tools {
  grid-area: tools;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/*
  The public profile link is a shortcut on wide screens: a round globe button beside the
  account menu, so it never takes room from the section labels. Its address is in its name
  and its tooltip, and the account menu shows it as text; Overview and Settings > Profile
  show it too.
*/
.appbar-profile {
  display: none;
  text-decoration: none;
}

/*
  Main navigation: four sections, each a link. The current one carries aria-current. A label
  never breaks inside a word, in any language. On phones each section starts at the width of
  its label on one line and the four share what is left, so a long single word such as
  "Boekingspagina’s" keeps its room and a label of several words stays on one line while the
  row has space; only then can it wrap, and only between words. From 880 px the labels never
  wrap.
*/
.appnav {
  grid-area: nav;
}

.appnav ul {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.appnav li {
  flex: 1 1 auto;
}

.appnav a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: var(--space-1) 2px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  /* Chinese, Japanese and Korean names break only at a space, like the others. */
  word-break: keep-all;
}

/*
  On the narrowest phones the labels are one step smaller, so the longest names (Italian and
  Portuguese "booking pages") still fit on one line at 390 px; at 360 px only those two wrap,
  between words. Below 360 px they are one step smaller again, so the longest single words
  (German and Dutch) still fit side by side.
*/
@media (max-width: 419px) {
  .appnav a {
    font-size: 0.6875rem;
  }
}

@media (max-width: 359px) {
  .appnav a {
    font-size: 0.625rem;
  }
}

.appnav a:hover {
  background: var(--surface-3);
  color: var(--text);
}

.appnav a[aria-current] {
  background: var(--seg-active);
  color: var(--text);
  font-weight: var(--weight-semibold);
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.12), 0 0 0 1px var(--line);
}

.appnav .icon {
  width: 20px;
  height: 20px;
}

.appnav a[aria-current] .icon {
  color: var(--accent-ink);
}

/* A small count beside a heading, such as the requests waiting for an answer. */
.count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-full);
  background: var(--warn-soft);
  color: var(--warn-ink);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  vertical-align: 2px;
}

/*
  On phones the section's count sits on the corner of its icon, so the label keeps its width.
  It is placed from the centre, where the icon is, because each section's width follows its
  label, and it never passes the section's own edge.
*/
.appnav .count {
  position: absolute;
  top: 4px;
  right: max(2px, calc(50% - 33px));
}

/* Account menu: photo or initial; the menu names the account and signs out. */
.account > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--target);
  padding: 2px var(--space-2) 2px 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-2);
}

.account > summary:hover,
.account[open] > summary {
  background: var(--surface-2);
  color: var(--text);
}

.account .chev {
  width: 16px;
  height: 16px;
  color: var(--text-3);
  transition: transform 0.15s ease;
}

.account[open] .chev {
  transform: rotate(180deg);
}

.account .popover {
  width: 288px;
  padding: var(--space-2);
}

.account-who {
  display: grid;
  gap: 2px;
  padding: var(--space-3);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--space-2);
}

.account-name {
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}

/* The email, then the public profile's address while it can be opened; both can be copied. */
.account-email,
.account-url {
  font-size: var(--text-sm);
  color: var(--text-3);
  overflow-wrap: anywhere;
}

/* Photos; the same circle and ring as the public .avatar. */
.avatar--sm {
  width: 36px;
  height: 36px;
  box-shadow: none;
}

.avatar--lg {
  width: 96px;
  height: 96px;
}

/* Without a photo, an initial on a tinted circle stands in. */
.avatar--initials {
  display: inline-grid;
  place-items: center;
  flex: none;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: 0.02em;
}

.avatar--initials.avatar--lg {
  font-size: var(--text-xl);
}

.app .site-foot {
  padding-top: var(--space-8);
}

/*
  The dashboard language sits in the footer of every signed-in screen, on its own line
  under the links. It is a plain form: the globe, the menu, then Change Language, a word
  no screen's own Save shares.
*/
.language-form {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-2);
}

.language-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-3);
}

.language-label .icon {
  width: 18px;
  height: 18px;
}

.select--compact select {
  min-height: 36px;
  padding-top: 4px;
  padding-bottom: 4px;
}

/*
  From 880 px each section is one line, its icon beside its label, and the bar adds the
  profile shortcut. The sections keep their own row under the brand and the tools until the
  bar has its full width: the longest names (Italian and Portuguese) need about 650 px, which
  the middle of one row only has from 1200 px.
*/
@media (min-width: 880px) {
  .appbar {
    padding-top: var(--space-5);
  }

  .appbar-inner {
    row-gap: var(--space-4);
  }

  .appnav ul {
    display: flex;
    justify-self: center;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
  }

  .appnav a {
    flex-direction: row;
    gap: var(--space-2);
    min-height: 36px;
    padding: 0 var(--space-4);
    font-size: var(--text-sm);
    white-space: nowrap;
  }

  .appnav .icon {
    width: 18px;
    height: 18px;
  }

  .appnav .count {
    position: static;
  }

  /* The shortcut matches the account menu's height: a circle around the globe. */
  .appbar-profile {
    display: inline-grid;
    place-items: center;
    width: var(--target);
    min-height: var(--target);
    padding: 0;
    border-radius: var(--radius-full);
  }
}

@media (min-width: 1200px) {
  .appbar-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand nav tools";
    gap: var(--space-6);
  }
}

/* ---------- 3. Page heading ---------- */

.shell--app {
  --shell: var(--app-shell);
}

/* Narrow single-task screens, such as a confirmation, inside the app frame. */
.shell--task {
  --shell: 680px;
}

.page-head {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.page-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
}

.page-head-row > :first-child {
  flex: 1 1 320px;
  min-width: 0;
}

.page-heading {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.page-lead {
  max-width: 68ch;
  margin-top: var(--space-1);
  color: var(--text-2);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.page-head .actions {
  flex: 0 1 auto;
}

.page-head .notices,
.page-head .tabs {
  margin-top: var(--space-3);
}

/* A settings form's result sits in the heading's notices, which space it themselves. */
.page-head .result-note {
  margin-bottom: 0;
}

/* The way back to the list a screen belongs to. */
.crumb {
  justify-self: start;
  margin-left: calc(-1 * var(--space-1));
  padding: 0 var(--space-1);
  color: var(--text-2);
}

.crumb:hover {
  color: var(--text);
}

/* A screen without a page heading row, such as one booking, starts with its way back. */
.crumb-row {
  margin-bottom: var(--space-4);
}

/* ---------- 4. Panels and rows ---------- */

/* Screens stack panels with even spacing. */
.stack {
  display: grid;
  gap: var(--space-6);
  min-width: 0;
  align-content: start;
}

/* Two columns from 880 px: the main column and a narrower side column. */
.columns {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 880px) {
  .columns {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    align-items: start;
  }

  /* With nothing for the side column, the main column takes the full width. */
  .columns--single {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* A panel is a card in the dashboard: the page-card surface, border and shadow. */
.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-5) var(--space-6) var(--space-4);
}

.panel-head > div {
  flex: 1 1 240px;
  min-width: 0;
}

.panel-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.panel-lead {
  margin-top: var(--space-1);
  max-width: 68ch;
  font-size: var(--text-sm);
  color: var(--text-2);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.panel-body {
  display: grid;
  gap: var(--space-5);
  padding: 0 var(--space-6) var(--space-6);
}

.panel-body--ruled {
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

/* A panel whose screen heading names it has no head of its own, such as Access's first card. */
.panel-body--solo {
  padding-top: var(--space-5);
}

.panel-text {
  max-width: 68ch;
  color: var(--text-2);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

/* A ruled block that brings its own padding, such as an empty state. */
.panel-split {
  border-top: 1px solid var(--line);
}

.panel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--text-2);
}

.panel-foot > span {
  flex: 1 1 260px;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* A panel that is only one row of text and its button, such as Sign out everywhere. */
.panel-foot--solo {
  border-top: 0;
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
}

/* Rows of a list inside a panel, separated by hairlines. */
.rows {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line);
}

/* A list with nothing in it, such as links before any page is on, leaves no stray rule. */
.rows:empty {
  display: none;
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-4) var(--space-6);
}

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

.row--top {
  align-items: start;
}

.row-lead {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
}

.row-lead > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.row-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text-2);
}

.row-icon .icon {
  width: 18px;
  height: 18px;
}

.row-icon--warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.row-title {
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}

/* A row's title with a status tag beside it; the tag moves under the name when space runs out. */
.row-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px var(--space-2);
  min-width: 0;
}

/* A booking whose invitee details were removed keeps its row, in quieter text. */
.row-title--muted {
  color: var(--text-2);
}

.row-sub {
  font-size: var(--text-sm);
  color: var(--text-2);
  overflow-wrap: anywhere;
}

/* A meeting that will no longer take place keeps its time, struck through as on the invitee's
   own card; its tag or its list says why in words. */
.row-sub--off time {
  text-decoration: line-through;
  text-decoration-color: var(--text-3);
}

.row-meta {
  font-size: var(--text-sm);
  color: var(--text-3);
  overflow-wrap: anywhere;
}

/*
  Several short facts about one row, such as when a browser signed in, was last seen and
  expires. On phones each fact starts on a line of its own. On wider screens they share a
  line with a dot between them, and a fact that doesn't fit moves to the next line whole.
  A fact longer than its row still wraps inside itself rather than overflow. The dot is
  drawn, so it is never read aloud.
*/
.meta-list > li {
  display: block;
}

@media (min-width: 640px) {
  .meta-list > li {
    display: inline-block;
    max-width: 100%;
  }

  .meta-list > li:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 3px;
    height: 3px;
    margin: 0 0.55em;
    border-radius: var(--radius-full);
    background: currentColor;
    vertical-align: middle;
  }
}

.row-aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

/*
  A row whose title is a link covers the whole row with that link, like the public page
  cards. Buttons and links in .row-aside stay above it, so they still work.
*/
.row-link {
  color: inherit;
  text-decoration: none;
}

.row-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.row-link:focus-visible {
  outline: none;
}

.row:has(.row-link:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

.row:has(.row-link):hover {
  background: var(--surface-2);
}

.row-link:hover .row-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.row-aside > *,
.row .chev-right {
  position: relative;
  z-index: 1;
}

.chev-right {
  width: 18px;
  height: 18px;
  color: var(--text-3);
}

.row:has(.row-link) .chev-right {
  z-index: 0;
}

/*
  A request row's answers, and a withdrawal's Dismiss Notice, follow its text: under it on
  phones, beside it from 640 px. The name link still covers the row, and the controls sit
  above that link as their own, after it in the Tab order.
*/
.row--answer .row-answer {
  grid-column: 1;
  grid-row: 2;
  justify-content: flex-start;
  padding-left: calc(36px + var(--space-3));
}

.row--answer .chev-right {
  grid-column: 2;
  grid-row: 1;
}

@media (min-width: 640px) {
  .row--answer {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .row--answer .row-answer {
    grid-column: 2;
    grid-row: 1;
    padding-left: 0;
    justify-content: flex-end;
  }

  .row--answer .chev-right {
    grid-column: 3;
  }
}

/* Rounded bottom corners for the last row so its hover fill follows the panel. Longhands, so
   a list's first row can round its top corners too when it is also the last. */
.panel > .rows:last-child > .row:last-child {
  border-bottom-left-radius: calc(var(--radius-lg) - 1px);
  border-bottom-right-radius: calc(var(--radius-lg) - 1px);
}

/*
  A list whose screen already names it, such as the list under the Bookings tabs, has no
  head of its own: it starts with its first row or its empty state, without a rule above.
*/
.panel--list > .rows,
.panel--list > .panel-split {
  border-top: 0;
}

.panel--list > .rows > .row:first-child {
  border-top-left-radius: calc(var(--radius-lg) - 1px);
  border-top-right-radius: calc(var(--radius-lg) - 1px);
}

/* Key and value pairs in settings and details: label column, value column. */
.kv {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px var(--space-5);
}

.kv > div {
  display: grid;
  gap: 2px;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.kv > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.kv > div:last-child {
  padding-bottom: 0;
}

.kv dt {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-3);
  overflow-wrap: anywhere;
}

.kv dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.kv dd > .tag {
  white-space: normal;
}

/* A time's zone, in a quieter value of its own under the time, such as Access's Last shared. */
.kv dd.kv-zone {
  font-size: var(--text-sm);
  color: var(--text-2);
}

.kv > div:has(> .kv-zone) {
  row-gap: 2px;
}

@media (min-width: 640px) {
  .kv > div {
    grid-template-columns: minmax(120px, 200px) minmax(0, 1fr);
    gap: var(--space-5);
    align-items: baseline;
  }

  /* Answers keep the question above the answer: questions can be long. */
  .kv--stacked > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  /* A value whose label is its heading's word keeps that label for screen readers only, so
     the value takes the whole row, such as a page's questions under Questions. */
  .kv > div.kv-value {
    grid-template-columns: minmax(0, 1fr);
  }

  .kv > div > .kv-zone {
    grid-column: 2;
  }
}

/*
  A fact that needs the host, such as a calendar BusyCal couldn't update for this booking: the
  warning sign before the sentence, in the attention tone, and the sentence wraps beside it.
*/
.kv dd.kv-warning {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: var(--warn-ink);
  font-weight: var(--weight-medium);
}

.kv dd.kv-warning > .icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

/* Values the host or invitee wrote across several lines keep their line breaks. */
.answer-text {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/*
  A page description is the public page's sanitized Markdown, so it keeps the public .prose
  rhythm for paragraphs, lists, emphasis and links. A line break inside a paragraph reads as
  a space there too, and the measure stays readable on wide screens.
*/
.kv dd.prose {
  max-width: 68ch;
}

/* Empty lists keep the public .state layout inside a panel. */
.panel .state {
  padding: var(--space-8) var(--space-6) var(--space-10);
}

/* ---------- 5. Tabs ---------- */

/*
  Link tabs reuse the public segmented control's look. Each tab is a link to its own
  address, so lists can be bookmarked and work with the back button.
*/
.tabs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  width: max-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-4);
  border-radius: 9px;
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  text-align: center;
}

.tabs a:hover {
  color: var(--text);
  background: var(--surface-3);
}

.tabs a[aria-current] {
  background: var(--seg-active);
  color: var(--text);
  font-weight: var(--weight-semibold);
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.12), 0 0 0 1px var(--line);
}

/* ---------- 6. Status tags and dots ---------- */

/* Variants of the public .tag: a tint and an icon or dot, always with words. */
.tag {
  gap: 5px;
}

.tag .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

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

.tag--warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.tag--danger {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.tag--accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/*
  The default length, after its length wherever a page's lengths are listed: the Pages card,
  one page, and the length choices of Book Someone In and Show Availability. It sits on the
  text's line and keeps the length's own size and weight, so the list still reads as text.
*/
.default-mark {
  margin-inline-start: 6px;
  padding: 0 6px;
  font-weight: var(--weight-medium);
  line-height: 1.5;
}

.seg [aria-current] .default-mark {
  background: var(--surface-2);
}

/* Tags that hold a phrase may wrap. */
.tag--wrap {
  white-space: normal;
  text-align: start;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--dot-off);
}

.dot--on {
  background: var(--dot-on);
}

.dot--link {
  background: var(--dot-link);
}

.dot--warn {
  background: var(--dot-warn);
}

/* A page's state: dot, then words, such as "Link only · Paused" or "Not on your profile · Paused". */
.state-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-2);
}

.state-line .sep {
  color: var(--text-3);
}

/* ---------- 7. Notices ---------- */

/* The public .notice is the base. These add success and danger tones and trailing links. */
.notice--success {
  background: var(--success-soft);
}

.notice--success > .icon {
  color: var(--success-ink);
}

/*
  The one-time result of a form, shown once on the screen the form returns to: the success
  tone when the answer was made, the attention tone when nothing changed.
*/
.result-note {
  margin-bottom: var(--space-6);
}

.crumb-row + .result-note {
  margin-top: calc(-1 * var(--space-1));
  margin-bottom: var(--space-5);
}

.notice--danger {
  background: var(--danger-soft);
}

.notice--danger > .icon {
  color: var(--danger-ink);
}

.notice .notice-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-2);
}

.notice-actions .link {
  min-height: 32px;
}

.notice--danger .link {
  color: var(--danger-ink);
}

.notice--warn .link {
  color: var(--warn-ink);
}

.notices {
  display: grid;
  gap: var(--space-3);
}

/* ---------- 8. Buttons and menus ---------- */

/* Destructive confirmation, as in the public design's Cancel Booking. */
.btn-danger {
  background: var(--danger-fill);
  color: var(--on-fill);
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.14);
}

.btn-danger:hover {
  background: color-mix(in oklab, var(--danger-fill) 88%, black);
}

/* A quiet button for an extra action beside the main ones, such as cancelling a request. */
.btn-quiet {
  background: transparent;
  color: var(--accent-ink);
}

.btn-quiet:hover {
  background: var(--accent-soft);
}

/* A quiet destructive link that leads to its confirmation, as at the end of Sign-in and security. */
.btn-danger-quiet {
  background: transparent;
  border-color: color-mix(in oklab, var(--danger-ink) 45%, transparent);
  color: var(--danger-ink);
}

.btn-danger-quiet:hover {
  background: var(--danger-soft);
}

.btn .icon {
  width: 18px;
  height: 18px;
}

/* A button that can't act yet, such as Create Booking on a day without times. */
.btn[disabled] {
  opacity: 0.5;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-primary[disabled]:hover {
  background: var(--accent-fill);
}

/* Forms that hold only a button sit inline beside links and other buttons. */
.inline-form {
  display: inline-flex;
}

/* Disclosure menus of actions: links and buttons in one list. */
.menu-list {
  display: grid;
  gap: 2px;
  list-style: none;
  padding: 0;
}

.menu-list form {
  display: block;
}

.menu-list a,
.menu-list button {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.menu-list a:hover,
.menu-list button:hover {
  background: var(--surface-2);
}

.menu-list .icon {
  width: 18px;
  height: 18px;
  color: var(--text-3);
}

/* An item that leads to a destructive confirmation, such as a page's Delete…. */
.menu-list .is-danger,
.menu-list .is-danger .icon {
  color: var(--danger-ink);
}

.menu-list .is-danger:hover {
  background: var(--danger-soft);
}

.menu-list hr {
  height: 1px;
  margin: var(--space-1) var(--space-2);
  border: 0;
  background: var(--line);
}

/* An item that can't act right now, such as Move Up on the first page, keeps its place. */
.menu-list button[disabled] {
  color: var(--text-disabled);
  cursor: not-allowed;
}

.menu-list button[disabled]:hover {
  background: none;
}

.menu-list button[disabled] .icon {
  color: var(--text-disabled);
}

/*
  A page's "More actions" menu: an icon button whose name is for screen readers only, with
  the menu opening under it toward the start edge. The public .more is a description's
  "Show more" disclosure, so these rules also undo its link color, spacing and turning icon.
*/
.menu.more > summary {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 0;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-2);
}

.menu.more > summary:hover,
.menu.more[open] > summary {
  background: var(--surface-2);
  color: var(--text);
}

.menu.more > summary .icon,
.menu.more[open] > summary .icon {
  width: 20px;
  height: 20px;
  transform: none;
}

.menu.more > .popover {
  width: 260px;
  margin-top: 0;
  padding: var(--space-2);
}

/*
  Motion, kept short and only where a state changes: a control that answers the pointer
  eases into its hover color, and a menu that opens fades in from just above its place
  (only with script; without it the menu opens at once). Nothing moves on its own. A one-time result has no motion of its own: an update in place
  fades it in with its transition (section 17), and a full page load shows it at once. The
  public stylesheet turns every transition and animation off when the visitor prefers
  reduced motion.
*/
.btn,
.link,
.crumb,
.tabs a,
.seg a,
.appnav a,
.subnav a,
.section-nav a,
.menu-list a,
.menu-list button,
.menu > summary,
.settings-card,
.page-item-title a,
.row:has(.row-link),
.affix,
.swatch-option {
  transition-property: background-color, border-color, color, box-shadow;
  transition-duration: 0.12s;
  transition-timing-function: ease;
}

@keyframes popover-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* Without script the menus are the plain forms path, which opens them at once. */
@media (scripting: enabled) {
  .menu[open] > .popover {
    animation: popover-in 0.14s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
}

/* ---------- 9. Overview ---------- */

/* Quick facts about the account, each with an icon, a title and a sentence. */
.health {
  display: grid;
  gap: var(--space-4);
  list-style: none;
  padding: 0;
}

.health li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px var(--space-3);
  align-items: start;
  font-size: var(--text-sm);
}

/* Only the leading icon takes the state color; a link's arrow keeps the link's color. */
.health li > .icon {
  grid-row: 1 / span 2;
  margin-top: 1px;
  color: var(--text-3);
}

.health .is-good > .icon {
  color: var(--success-ink);
}

.health .is-warn > .icon {
  color: var(--warn-ink);
}

.health .is-bad > .icon {
  color: var(--danger-ink);
}

/* Text sits beside the icon, so a page with several warnings lists each under its title. */
.health-title,
.health-body,
.health-action {
  grid-column: 2;
}

.health-title {
  font-weight: var(--weight-semibold);
  color: var(--text);
  overflow-wrap: anywhere;
}

.health-body {
  color: var(--text-2);
  overflow-wrap: anywhere;
}

/* A notice whose one line is several sentences reads at the body weight. */
.notice-title--plain {
  font-weight: var(--weight-regular);
}

/* A shareable address with its own open link. */
.share {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.share-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}

/* A shared page's name and its state share a line, and the state wraps under a long name. */
.share-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px var(--space-3);
  min-width: 0;
}

/* A fact under a notice's explanation, such as when busy times were last shared. As a
   third line it would fall into the icon's column, so it is placed beside the icon. */
.notice-fact {
  grid-column: 2;
  margin-top: var(--space-1);
  font-variant-numeric: tabular-nums;
}

/*
  The calendars whose busy times are old, inside the busy-time notice that explains them, on
  Overview, Access and the availability check: how many there are, then each calendar's name
  and account over when its busy times were last updated. Like .notice-fact, they sit
  beside the icon rather than fall into its column.
*/
.busy-facts {
  grid-column: 2;
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.busy-facts-count {
  font-weight: var(--weight-medium);
}

.busy-facts-list {
  display: grid;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
}

.busy-facts-list > li {
  display: grid;
  min-width: 0;
}

.busy-facts-name {
  font-weight: var(--weight-medium);
  overflow-wrap: anywhere;
}

.busy-facts-age {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/*
  More than three calendars fold under the count, a native disclosure drawn like the notice's
  links, in its tone, whose chevron turns when it opens. The whole list then opens in place,
  with no height limit or scrolling of its own.
*/
.busy-facts-more > summary {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  width: fit-content;
  min-height: 32px;
  border-radius: var(--radius-sm);
  list-style: none;
  cursor: pointer;
  font-weight: var(--weight-semibold);
}

.busy-facts-more > summary::-webkit-details-marker {
  display: none;
}

.busy-facts-more > summary:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.notice--warn .busy-facts-more > summary {
  color: var(--warn-ink);
}

.notice--danger .busy-facts-more > summary {
  color: var(--danger-ink);
}

.busy-facts-more > summary .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.busy-facts-more[open] > summary .icon {
  transform: rotate(180deg);
}

.busy-facts-more > .busy-facts-list {
  margin-top: var(--space-1);
}

@media (max-width: 639px) {
  .busy-facts-more > summary {
    min-height: var(--target);
  }
}

.share-url {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  min-width: 0;
}

.url {
  min-width: 0;
  font-size: var(--text-sm);
  color: var(--text-2);
  overflow-wrap: anywhere;
  user-select: all;
}

/* ---------- 10. One booking and its tools ---------- */

/* The booking's own screen: a summary column and the details beside it. */
.booking-layout {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 880px) {
  .booking-layout {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    align-items: start;
  }

  .booking-summary {
    position: sticky;
    top: var(--space-6);
  }
}

/* The public status hero, turned to the start edge, with the calendar page badge. */
.booking-hero {
  display: grid;
  justify-items: start;
  gap: var(--space-3);
  padding: var(--space-6);
  background: linear-gradient(180deg, var(--accent-band) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--line);
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}

.booking-hero .datebadge {
  margin-bottom: var(--space-2);
}

.booking-hero .page-heading {
  font-size: var(--text-lg);
}

.booking-hero .seal {
  width: 32px;
  height: 32px;
  right: -10px;
  bottom: -10px;
}

.booking-hero .seal .icon {
  width: 17px;
  height: 17px;
}

.seal--muted {
  background: var(--text-3);
}

.booking-actions {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6) var(--space-6);
}

.booking-actions .note {
  font-size: var(--text-sm);
  color: var(--text-2);
}

/*
  The controls that can succeed now, under the facts. A request's two answers share one row
  evenly; cancelling it is the quiet extra below. A confirmed booking has only its quiet
  destructive Cancel Booking….
*/
.booking-controls {
  display: grid;
  justify-items: start;
  gap: var(--space-3);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.btn-row--answer {
  justify-self: stretch;
}

.btn-row--answer > * {
  flex: 1 1 0;
}

.btn-row--answer .btn {
  width: 100%;
  white-space: nowrap;
}

/*
  A confirmed booking's Reschedule… and Cancel Booking… share their row and fill it. When a
  language's labels don't fit side by side, each takes a line of its own, in their order.
*/
.btn-row--fill {
  justify-self: stretch;
}

.btn-row--fill > .btn {
  flex: 1 1 auto;
}

/* Each part of a booking's details is its own titled block. */
.detail {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.detail + .detail {
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

.detail-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

/* Removing the invitee's details ends the panel that shows them: what it removes, then the
   button at the end edge, which keeps its place when there is nothing to say before it. */
.detail-remove {
  justify-content: flex-end;
}

.more-results {
  display: flex;
  justify-content: center;
  padding: var(--space-4) var(--space-6) var(--space-6);
  border-top: 1px solid var(--line);
}

/*
  Rescheduling uses the public picker card. The band names the page and says when the
  booking is now; the chosen day's heading starts with Today, with a drawn dot after it.
*/
.reschedule .host-name .sep,
.times-day .sep {
  margin: 0 var(--space-2);
  color: var(--text-3);
}

/* The band's note has two lines under its title, both beside the clock. */
.reschedule .band-note > p {
  grid-column: 2;
}

/* The booking's own time, in its place in the list. It is not a link, so it is drawn dashed. */
.slot--current {
  gap: 2px;
  border-style: dashed;
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text-2);
}

.slot--current .tag {
  padding: 0 var(--space-2);
  font-size: 0.6875rem;
}

/*
  When no time can be offered at all, a card takes the picker's place: why, then the screen
  that fixes it when that is in the dashboard, and the way back to the booking under it. A
  page that is turned off shows its title beside its state, as on Pages.
*/
.closed-pane {
  display: grid;
  justify-items: start;
  gap: var(--space-5);
}

.closed-note {
  justify-self: stretch;
  padding: var(--space-4) var(--space-5);
}

/* Every line of the card sits beside its icon, however many lines the reason brings. */
.closed-note > :not(.icon) {
  grid-column: 2;
}

.closed-note > .notice-title {
  font-size: var(--text-base);
}

.closed-note > .notice-body {
  max-width: 68ch;
}

.closed-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
}

.closed-page {
  min-width: 0;
  font-weight: var(--weight-semibold);
  color: var(--text);
  overflow-wrap: anywhere;
}

/* The attention card for a time taken between screens, under the day's heading. */
.times-pane > .alert {
  margin-top: var(--space-5);
}

/*
  The move question: the current time and the new one as tickets, side by side from 640 px,
  each start over its end. When the dashboard's zone differs, the same two times follow in
  it below a dashed rule.
*/
.move {
  display: grid;
  gap: var(--space-4);
}

.move > div {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  min-width: 0;
}

.move-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.move .ticket {
  align-items: start;
  gap: var(--space-3);
  height: 100%;
  padding: var(--space-4);
}

.move .ticket-time {
  font-size: var(--text-sm);
}

/* The current time is muted rather than struck through: its start and end each wrap. */
.ticket--old {
  background: var(--surface);
}

.ticket--old .ticket-time {
  font-weight: var(--weight-semibold);
  color: var(--text-2);
}

.ticket-icon--muted {
  background: var(--surface-2);
  color: var(--text-3);
}

.move-elsewhere {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--line-strong);
}

.move-zone {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.move-elsewhere .kv {
  font-size: var(--text-sm);
}

@media (min-width: 640px) {
  .move {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/*
  Booking someone in, in the narrow task column: a bar that chooses the page and the day,
  then the day's times and the invitee's details as panels. From 640 px the bar's two
  fields and Show Times share one row, the button level with the fields.
*/
.booking-pick {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6) var(--space-6);
}

@media (min-width: 640px) {
  .booking-pick {
    grid-template-columns: minmax(0, 1fr) minmax(0, 12.5rem) auto;
    align-items: end;
  }
}

/* The page menu, the day field and Show Times share one height, so their labels line up:
   a date field otherwise draws taller than a menu in some browsers. */
.booking-pick .input,
.booking-pick .select select {
  height: var(--target);
  padding-top: 0;
  padding-bottom: 0;
}

/* Several lengths sit at the end of the day's heading and keep their own width. */
.panel-head > .seg {
  flex: none;
}

/* The length and zone under the day's heading, closer than the band's page facts. */
.booking-facts {
  gap: var(--space-1) var(--space-5);
  margin-top: var(--space-2);
}

.booking-facts > li {
  min-height: 0;
}

/* The times start at the panel's rule; each later part of the day keeps the public gap. */
.booking-times .slot-group:first-of-type {
  margin-top: 0;
}

/* A day without times keeps the public empty state, inside the panel's own padding. */
.panel-body > .state {
  padding: var(--space-4) 0 var(--space-2);
}

/* The line that says the page's checkbox questions aren't asked here: quieter than a field,
   with its icon, where those questions would be. */
.panel-body.form > .form-note {
  font-size: var(--text-sm);
  color: var(--text-2);
}

/* ---------- 11. Booking pages ---------- */

.page-list {
  display: grid;
  gap: var(--space-4);
  list-style: none;
  padding: 0;
}

/* A page in the host's list: the public page card, with its state and link. */
.page-item {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.page-item--off {
  background: var(--surface-2);
  box-shadow: none;
}

/* A warning about one page keeps the reading width of the card's calendar fact. */
.page-warning {
  max-width: 640px;
}

.page-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.page-item-head > div:first-child {
  display: grid;
  gap: var(--space-1);
  flex: 1 1 260px;
  min-width: 0;
}

.page-item-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.page-item-title a {
  color: inherit;
  text-decoration: none;
}

.page-item-title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.page-item .meta {
  gap: var(--space-1) var(--space-4);
}

.page-item .meta > li {
  min-height: 24px;
}

.page-item-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.page-item-foot > p {
  flex: 1 1 240px;
  min-width: 0;
}

/* View Settings, Preview and the menu sit close together, with the menu last. */
.page-item-foot .actions {
  gap: var(--space-2);
}

/*
  One page's settings: the section list beside one long form, as in the editor's design.
  On phones and tablets the list is a strip of sections that stays at the top while the
  form scrolls; from 1024 px it is a column beside the form. With script, a marker slides to
  the section being read and a dot marks each section holding changes that aren't saved.
*/
.editor {
  display: grid;
  gap: var(--space-5);
  min-width: 0;
}

/*
  Section links stay ordinary anchors and scroll smoothly unless reduced motion is asked
  for. Scrolling to a field, by the browser or by a summary link, keeps it clear of the
  sticky strip above and the save bar below.
*/
html:has(#page-form) {
  scroll-padding-top: var(--space-6);
  scroll-padding-bottom: 104px;
}

@media (prefers-reduced-motion: no-preference) {
  html:has(#page-form) {
    scroll-behavior: smooth;
  }
}

/* Controls the script shows or hides keep `hidden` whatever display their class sets. */
.editor [hidden] {
  display: none !important;
}

/*
  Long text grows with its content and stops at 480 px, then scrolls. Without
  field-sizing the script sizes visible boxes from their content; without script they keep
  their rows and the native resize handle.
*/
#page-form textarea {
  min-height: 6rem;
  max-height: 480px;
  overflow-y: auto;
}

@supports (field-sizing: content) {
  #page-form textarea {
    field-sizing: content;
  }
}

.section-nav {
  position: sticky;
  top: 0;
  z-index: 11;
  /* The strip scrolls its own links, so it never widens the page beyond the window. */
  min-width: 0;
  margin: 0 calc(var(--gutter) * -1);
  padding: var(--space-2) var(--gutter);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.section-nav ul {
  position: relative;
  display: flex;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.section-nav ul::-webkit-scrollbar {
  display: none;
}

/* The strip's end edge fades, so sections past the window's width read as one swipe away. */
@media (max-width: 1023px) {
  .section-nav ul {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
}

.section-nav li {
  flex: none;
}

.section-nav a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--motion) var(--ease-out);
}

.section-nav a:hover {
  color: var(--text);
}

.section-nav a[aria-current="true"] {
  color: var(--accent-ink);
}

.section-nav .icon {
  flex: none;
  width: 16px;
  height: 16px;
}

/*
  The marker under the current section: one element the script moves with transforms, so
  it glides between sections instead of jumping. Without script there is no marker and no
  current section, only the links.
*/
.section-marker {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: var(--marker-width, 0);
  height: var(--marker-height, 0);
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  opacity: 0;
  transform: translate(var(--marker-x, 0), var(--marker-y, 0));
  transition:
    transform var(--motion) var(--ease-out),
    width var(--motion) var(--ease-out),
    height var(--motion) var(--ease-out),
    opacity var(--motion-quick) linear;
  pointer-events: none;
}

.section-marker.is-placed {
  opacity: 1;
}

/* A section holding changes that aren't saved: a small accent dot after its name. */
.section-nav a.has-changes::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-inline-start: -2px;
  border-radius: 50%;
  background: var(--accent-fill);
}

@media (min-width: 1024px) {
  .editor {
    grid-template-columns: 184px minmax(0, 1fr);
    align-items: start;
    gap: var(--space-6);
  }

  .section-nav {
    top: var(--space-6);
    margin: 0;
    padding: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .section-nav ul {
    display: grid;
    gap: 2px;
    overflow: visible;
  }

  .section-nav a {
    min-height: 40px;
    border-radius: var(--radius-sm);
  }

  .section-nav a:hover {
    background: var(--surface-3);
  }

  .section-nav a[aria-current="true"]:hover {
    background: none;
  }

  .section-marker {
    border-radius: var(--radius-sm);
  }

  .section-nav a.has-changes::after {
    margin-inline-start: auto;
  }
}

/* Sections land below the strip on phones and tablets, and below the frame's top on wide screens. */
.form-section,
.group,
.item-card,
.date-row,
.day-row,
.range-slot {
  scroll-margin-top: 72px;
}

@media (min-width: 1024px) {
  .form-section,
  .group,
  .item-card,
  .date-row,
  .day-row,
  .range-slot {
    scroll-margin-top: var(--space-6);
  }
}

.form-section > .panel-head {
  padding-bottom: var(--space-5);
}

.section-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: var(--space-2);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  vertical-align: 2px;
}

/* A group inside a section, like the groups of the Mac editor's tabs. */
.group {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-5) var(--space-6) var(--space-6);
  border-top: 1px solid var(--line);
}

.group-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}

/*
  On narrow phones the page's address sits on its own line inside the link field, above the
  link the host types, so a long username never squeezes the field.
*/
@media (max-width: 479px) {
  #page-form .affix {
    flex-wrap: wrap;
  }

  #page-form .affix-text {
    flex: 1 1 100%;
    max-width: none;
    padding: 8px 12px 0;
    font-size: var(--text-xs);
  }

  #page-form .affix .input {
    padding-top: 2px;
    padding-left: 12px;
  }
}

/* A heading that names one control is that control's label, so it carries no second label. */
.group-title label {
  cursor: default;
}

/*
  The event title's two tokens. With script each becomes a small button that types the
  token at the cursor; without script they read as code inside the hint.
*/
.token {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875em;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color var(--motion-quick) linear, border-color var(--motion-quick) linear;
}

.token:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

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

/* An address shown as a value reads as text, in the system monospace face. */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--surface-3);
  overflow-wrap: anywhere;
}

.row-title code {
  padding: 0;
  background: none;
  font-size: 0.9375em;
  font-weight: var(--weight-medium);
}

/*
  A setting BusyCal on the Mac owns. It sits where the control would be, at the size of a
  field, and says what is set and where to change it. The Mac drawing marks it.
*/
.mac-fact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 2px var(--space-3);
  min-height: var(--target);
  max-width: 640px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.mac-fact > .icon {
  grid-row: 1 / span 2;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  color: var(--text-3);
}

.mac-fact-value {
  font-weight: var(--weight-medium);
  overflow-wrap: anywhere;
}

.mac-fact-note {
  font-size: var(--text-sm);
  color: var(--text-3);
  overflow-wrap: anywhere;
}

/* A calendar's account after its name, quieter, as a time's zone follows the time in a row. */
.mac-fact-account {
  font-weight: var(--weight-regular);
  color: var(--text-2);
}

.mac-fact--missing {
  border-style: dashed;
  border-color: var(--line-strong);
}

.mac-fact--missing .mac-fact-value {
  color: var(--text-2);
}

/* Field labels outside a <label>: a read-only value has a name but no control. */
.fact-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text);
}

/*
  When a page was created and, once it changed after that, last modified: quiet secondary
  text, not a notice or a card. Each fact is its label, then its time, which carries on in
  the same line and wraps like text. The two facts share a line where they fit and each
  takes a line of its own where they don't. A gap parts them rather than a dot: each label
  already marks where its fact starts, and a gap leaves no stray mark at the end of a line
  when the facts wrap. In the editor they sit under the title; on one page's screen they
  close the facts, lined up with the text inside the sections.
*/
.page-times {
  display: flex;
  flex-wrap: wrap;
  gap: 2px var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-2);
}

.page-times > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.page-times dt,
.page-times dd,
.page-times dd > p {
  display: inline;
}

.page-times dt {
  margin-inline-end: 0.4em;
  color: var(--text-3);
  font-weight: var(--weight-medium);
}

.page-times dd {
  font-variant-numeric: tabular-nums;
}

/* Under the editor's title, a little closer to it than the heading's notices. */
.page-head > .page-times {
  margin-top: calc(-1 * var(--space-1));
}

.stack > .page-times {
  padding-inline: var(--space-6);
}

/*
  The code that shows a booking page on the host's own website, on that page's screen. It is
  text to select and copy, not a setting, so it sits on a value's quiet fill in the monospace
  face. It keeps the fields' 16 px, so iOS doesn't zoom into it, and it grows to show the
  whole code where the browser can size it.
*/
.embed-code .textarea {
  min-height: 0;
  background: var(--surface-2);
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}

@supports (field-sizing: content) {
  .embed-code .textarea {
    field-sizing: content;
  }
}

/*
  The page editor: the section list beside one long form, as in design/dashboard/
  page-editor.html. A group's lead appears only for a fact the host can't see, and the row
  the last in-form button added is marked, so the host finds it when the form comes back.
*/
.group-head {
  display: grid;
  gap: 2px;
}

.group-lead {
  max-width: 68ch;
  font-size: var(--text-sm);
  color: var(--text-2);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

/* A section with a refused setting says so in the list, with an icon and hidden words. */
.section-nav .has-error,
.section-nav .has-error[aria-current="true"] {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

/*
  What a page still needs before it can be turned on, beside Visibility: one warning per
  need, each with its next step. A link inside a warning keeps the warning's color.
*/
.needs {
  display: grid;
  gap: 6px;
  margin-bottom: var(--space-3);
}

.field-warning a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.field-warning a .icon,
.notice-actions a .icon {
  width: 14px;
  height: 14px;
  margin: 0;
}

/*
  Three short fields side by side from 640 px: the buffers and notice, and the limits. Each
  column is wide enough for a menu's Other row on one line in every language.
*/
.field-trio {
  display: grid;
  align-items: start;
  gap: var(--space-4);
  max-width: 720px;
}

@media (min-width: 640px) {
  .field-trio {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* A checkbox with its title and explanation, as a plain row rather than a card. */
.toggle {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 2px var(--space-3);
  align-items: start;
  max-width: 640px;
  cursor: pointer;
}

.toggle input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--accent-fill);
  cursor: pointer;
}

.toggle-title {
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}

.toggle .hint,
.toggle .error-text {
  grid-column: 2;
}

/* Beside a field, a checkbox lines up with the field's control rather than its label. */
.field-pair > .toggle {
  align-self: end;
  padding-bottom: var(--space-1);
}

/*
  Lengths are checkbox chips in the look of the public time chips, with a check mark as
  well as the fill. The input covers its chip, so the whole chip is the target.
*/
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  position: relative;
  display: inline-flex;
}

.chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 72px;
  min-height: 40px;
  padding: 0 var(--space-4);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--accent-ink);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chip .icon {
  display: none;
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.chip input:checked + span {
  border-color: var(--accent-fill);
  background: var(--accent-fill);
  color: var(--on-fill);
}

.chip input:checked + span .icon {
  display: block;
}

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

.chip:hover input:not(:checked) + span {
  background: var(--accent-soft);
}

.field--error .chip span {
  border-color: var(--danger-ink);
}

.chip span {
  transition:
    background-color var(--motion-quick) linear,
    border-color var(--motion-quick) linear,
    color var(--motion-quick) linear;
}

/* A length the host just typed arrives as a chip, or a matching chip glows once. */
@keyframes chip-arrive {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}

@keyframes chip-glow {
  50% {
    box-shadow: 0 0 0 4px var(--accent-wash);
  }
}

.chip.is-new span {
  animation: chip-arrive var(--motion) var(--ease-out);
}

.chip.is-glowing span {
  animation: chip-glow 600ms var(--ease-out);
}

/*
  Any other length, typed where the chips end: the box reads as one more chip, with its
  label and unit inside. Return, a comma or leaving the box turns the number into a chip.
*/
.chip-other {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 var(--space-3);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.chip-other:focus-within {
  border-style: solid;
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.chip-other .input {
  width: 4.5rem;
  min-height: 28px;
  padding: 2px 8px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-3);
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.chip-other .input:focus-visible {
  outline: none;
}

.chip-other .input[aria-invalid="true"] {
  color: var(--danger-ink);
}

.lengths > .error-text {
  margin-top: var(--space-2);
}

/* Default sits under the chips once two or more are chosen, and names the length people see first. */
.length-default {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.length-default .label {
  font-weight: var(--weight-medium);
  color: var(--text-2);
}

.length-default .select select {
  min-width: 8.5rem;
}

/* A number, or a list of numbers, with its unit on the same line. */
.with-unit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.with-unit .input,
.input--short {
  width: 9rem;
}

.unit {
  font-size: var(--text-sm);
  color: var(--text-2);
}

/*
  Any other number of minutes: the Other box and its unit in a row of their own under the
  menu, quieter than the menu so the presets stay the first choice. A refused minutes field
  outlines only the control whose value was used; the other one keeps its plain border.
*/
.minutes-other {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-1);
}

.minutes-other-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-2);
}

.minutes-other .with-unit .input {
  width: 5.5rem;
}

.minutes-field.field--error .select select:not([aria-invalid="true"]),
.minutes-field.field--error .input:not([aria-invalid="true"]) {
  border-color: var(--line-strong);
}

/*
  With script, Other is the menu's last entry and its box appears under the menu only once
  chosen. The menu already says Other, so the box keeps that word for screen readers only.
*/
.minutes-other.is-chosen .minutes-other-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* A setting's effect shown as an example that follows its value, such as three start times. */
.hint.example {
  font-variant-numeric: tabular-nums;
}

/* Dates and clock times keep their figures in columns. */
.input--date,
.input--time {
  font-variant-numeric: tabular-nums;
}

.input--date {
  max-width: 220px;
}

.input--time {
  width: 100%;
  min-width: 0;
  padding-left: 10px;
  padding-right: 6px;
}

/* A clock field whose own value was refused, inside a set of hours with two fields. */
.input--error {
  border-color: var(--danger-ink);
}

/*
  Weekly hours: one row per day, Monday first. Each day's row holds its hours, and with
  script a + at its end adds hours to that day; without script the day is chosen beside Add
  Hours under the list. On phones a day's hours sit under its name. A day without hours says
  so on the quieter surface, on its name's line.
*/
.days {
  display: grid;
  list-style: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

/*
  A list refused for its count, which is refused before any row is checked: the weekly
  hours' box takes the outline, and the controls inside keep their plain borders, except
  one that was itself refused.
*/
.days.field--error {
  border-color: var(--danger-ink);
}

.days.field--error .input:not([aria-invalid="true"]),
.days.field--error .select select:not([aria-invalid="true"]),
.item-list.field--error .input:not([aria-invalid="true"]) {
  border-color: var(--line-strong);
}

.day-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name add" "ranges ranges";
  align-items: start;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-4);
  transition: background-color var(--motion) linear;
}

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

.day-row > .day-name {
  grid-area: name;
}

.day-row > .day-ranges {
  grid-area: ranges;
}

.day-row > .day-add {
  grid-area: add;
  margin-top: 4px;
}

/* A day without hours says so on the quieter surface, beside its name on phones too. */
.day-row--off {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "name ranges add";
  align-items: center;
  background: var(--surface-2);
}

.day-row--off > .day-add {
  margin-top: 0;
}

.days > .day-row:first-child {
  border-radius: calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px) 0 0;
}

.days > .day-row:last-child {
  border-radius: 0 0 calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px);
}

.day-name {
  display: flex;
  align-items: center;
  min-height: var(--target);
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}

/* Day names start in lowercase in several languages; as a row's name the first letter is raised. */
.day-name > span {
  display: inline-block;
}

.day-name > span::first-letter {
  text-transform: uppercase;
}

/* Hours whose stored day is none of the seven get a day menu in the name's place. */
.day-name.field {
  display: grid;
}

.day-ranges {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.unavailable {
  font-size: var(--text-sm);
  color: var(--text-3);
}

/* From 640 px the + sits right after the day's hours, where the next hours would go. */
@media (min-width: 640px) {
  .day-row,
  .day-row--off {
    grid-template-columns: 160px minmax(0, 420px) auto;
    grid-template-areas: "name ranges add";
    justify-content: start;
  }
}

/*
  One set of hours: two clock fields and Remove, then the note for hours that end the next
  day and a refused field's message, each across the row.
*/
.range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  max-width: 420px;
}

.range > .error-text,
.range > .range-note {
  grid-column: 1 / -1;
}

.range-dash {
  color: var(--text-3);
}

.range-note {
  margin-top: -2px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-3);
}

/*
  Hours, a date, a question or a location that the last in-form button added, after the
  form came back from the server: the row glows, then settles. Without motion it keeps the
  ring, so the host can still find it.
*/
@keyframes row-highlight {
  from,
  45% {
    border-color: var(--accent-fill);
    box-shadow: 0 0 0 3px var(--accent-wash);
  }
}

.range--new .input,
.date-row--new,
.item-card--new {
  animation: row-highlight 2.6s var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  .range--new .input,
  .date-row--new,
  .item-card--new {
    border-color: var(--accent-fill);
    box-shadow: 0 0 0 3px var(--accent-wash);
  }
}

/* Remove, Move Up and Move Down on a row: the public icon button with a hidden name. */
.icon-btn {
  cursor: pointer;
  font: inherit;
  transition: background-color var(--motion-quick) linear, color var(--motion-quick) linear;
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

.icon-btn--danger:hover {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

/* A move that can't happen, such as Move Up on the first question, keeps its place. */
.icon-btn[disabled] {
  cursor: default;
  opacity: 0.45;
}

.icon-btn[disabled]:hover {
  background: var(--surface);
  color: var(--text-2);
}

/* Specific dates: the date with Add Hours and Remove beside it, then its hours or "Closed all day". */
.date-row {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-3) var(--space-4) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.date-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
}

.date-row-head .field {
  flex: 0 1 220px;
  min-width: 0;
}

.date-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  min-height: var(--target);
}

/* Questions and locations: one card each, with Move Up, Move Down and Remove. */
.item-list {
  display: grid;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
}

/* An empty list takes no space, so the group's gap doesn't double above its add buttons. */
.item-list:not(:has(> li)) {
  display: none;
}

.item-card {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-4) var(--space-5) var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

/*
  The tools stay at the end of the head's row and the kind name wraps between words beside
  them. The name's narrowest width is its longest word, so a word too long for that space
  moves the tools to a row of their own, still at the end, instead of breaking.
*/
.item-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
}

.item-card-kind {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--text-2);
  overflow-wrap: break-word;
}

.item-card-kind .option-icon {
  flex: none;
  width: 32px;
  height: 32px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}

.item-card-kind .option-icon .icon {
  width: 18px;
  height: 18px;
}

.item-tools {
  flex: none;
  display: flex;
  gap: var(--space-1);
  margin-inline-start: auto;
}

/* The add buttons under a list, with their label or limit beside them. */
.add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

/* A note under a group's controls, such as what video calls need, in quieter text. */
.group > .form-note {
  font-size: var(--text-sm);
  color: var(--text-2);
}

/*
  BusyCal's help on meeting accounts, at the end of a sentence about video calls: inline with
  the text, with the outside-link icon at the text's size. Inside a warning it takes the
  warning's color, as the other links there do.
*/
.help-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: var(--weight-medium);
}

.help-link .icon {
  flex: none;
  width: 14px;
  height: 14px;
}

/* Under a video location's menu: who creates the call for the service chosen, or a warning. */
.service-notes {
  display: grid;
  gap: 6px;
}

/*
  A warning that belongs to one field before anything is refused, such as a saved video
  service that isn't available for the page: the error text's shape, in the attention color.
*/
.field-warning {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--warn-ink);
  overflow-wrap: anywhere;
}

.field-warning .icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

/*
  Fields that belong to one choice show once it is made, where the browser can tell: a
  dropdown question's choices, the most guests and the booking window's two kinds. Browsers
  without :has() show them all, and the form saves only what the choice uses. Choices or a
  guest limit already written, or refused, always show, so they can be cleared.
*/
@supports selector(:has(*)) {
  .item-card .choices:not(.choices--kept),
  .guests-field .guest-limit:not(.guest-limit--kept),
  .window .window-rolling,
  .window .window-dates {
    display: none;
  }

  .item-card:has(option[value="dropdown"]:checked) .choices,
  .guests-field:has(input[value="limited"]:checked) .guest-limit,
  .window:has(input[value="rolling"]:checked) .window-rolling,
  .window:has(input[value="dates"]:checked) .window-dates {
    display: grid;
  }

  /* What guests receive matters only while guests are allowed. */
  .guests-field:has(input[value="none"]:checked) .guests-hint {
    display: none;
  }

  /*
    A video location's menu keeps only the note for the service chosen: that service's
    sentence, or the warning while a saved service that isn't available stays chosen.
  */
  .service-field:not(:has(option[value="zoom"]:checked)) .service-notes > [data-service="zoom"],
  .service-field:not(:has(option[value="google_meet"]:checked)) .service-notes > [data-service="google_meet"],
  .service-field:not(:has(option[value="microsoft_teams"]:checked)) .service-notes > [data-service="microsoft_teams"],
  .service-field:not(:has(option[value="skype"]:checked)) .service-notes > [data-service="skype"],
  .service-field:not(:has(option[value="webex"]:checked)) .service-notes > [data-service="webex"],
  .service-field:not(:has(option[data-unavailable]:checked)) .service-notes > [data-service="unavailable"] {
    display: none;
  }

  /*
    Add bookings to keeps one line about the chosen calendar under its label: the hint, or a
    warning in its place while the chosen calendar can't take new bookings. That is a saved
    calendar that BusyCal doesn't list, or one whose account is turned off in BusyCal. The line
    is the menu's description, so it stays true while the menu changes. The count of calendars
    BusyCal left out, when there is one, follows it whichever calendar is chosen.
  */
  .calendar-field:has(option[data-unavailable]:checked) .calendar-hint:has([data-calendar-missing]) > [data-calendar-hint],
  .calendar-field:not(:has(option[data-unavailable]:checked)) [data-calendar-missing],
  .calendar-field:has(option[data-account-disabled]:checked) .calendar-hint:has([data-calendar-account-off]) > [data-calendar-hint],
  .calendar-field:not(:has(option[data-account-disabled]:checked)) [data-calendar-account-off] {
    display: none;
  }
}

/* The two windows read as one choice at a field's width; each one's fields sit under it. */
.window .options {
  max-width: 640px;
}

.window .window-rolling,
.window .window-dates {
  padding-inline-start: 44px;
}

@media (max-width: 639px) {
  .window .window-rolling,
  .window .window-dates {
    padding-inline-start: 0;
  }
}

/* Markdown help, opened in place under the description. */
.help-disclosure > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 32px;
  list-style: none;
  cursor: pointer;
  color: var(--accent-ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.help-disclosure > summary::-webkit-details-marker {
  display: none;
}

.help-disclosure > summary .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.help-disclosure[open] > summary .icon {
  transform: rotate(180deg);
}

.help-table {
  width: 100%;
  margin: var(--space-2) 0;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.help-table th,
.help-table td {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
  overflow-wrap: anywhere;
}

/*
  A result never breaks inside a word: the table narrows the syntax column instead. Korean
  and Chinese results would otherwise break between any two syllables or characters.
*/
.help-table td + td {
  overflow-wrap: break-word;
  word-break: keep-all;
}

.help-table th {
  color: var(--text-3);
  font-weight: var(--weight-semibold);
}

/* The example link looks like a link and goes nowhere, so the form is never left. */
.help-link {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

/*
  The save bar stays at the bottom of the window while the form scrolls under it. It says
  only what is true now: nothing while the form matches the page, and a quiet note with a
  dot once it holds changes the page doesn't have yet. While a save is on its way, its
  button shows a spinner and further presses wait.

  The bar is not a card: its buttons and note stand on the page itself, with no border,
  fill or shadow. Behind them is the page's own background, which fades in from nothing
  over the bar's first 24 px and is solid for the 8 px above the buttons, so fields that
  scroll under the bar fade out before they reach the note or a button, with no edge to
  see. The bar reaches the window's bottom edge, so nothing shows under the buttons either.
  At the end of the form, where the bar no longer floats, the negative margin takes back
  part of the form's gap, so the buttons stay near the last section.
*/
.savebar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3) var(--space-4);
  margin-top: calc(-1 * var(--space-4));
  padding: var(--space-8) 0 var(--space-4);
  background: linear-gradient(to bottom, transparent, var(--bg) var(--space-6));
}

.savebar-state {
  flex: 1 1 220px;
  min-width: 0;
}

.savebar-note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-left: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-2);
}

.savebar-note:not([hidden]) {
  animation: note-arrive var(--motion) var(--ease-out);
}

@keyframes note-arrive {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}

.savebar-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.savebar .actions {
  gap: var(--space-2);
}

/* A save on its way: the pressed button keeps its words and gains a spinner. */
.btn.is-busy {
  cursor: progress;
}

.btn.is-busy::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentcolor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn.is-busy::before {
    border-right-color: currentcolor;
    opacity: 0.6;
  }
}

/*
  The time zone menu with its search above it, drawn as one control: typing narrows the
  menu and never changes the zone. Without script only the menu shows.
*/
.zone-picker {
  display: grid;
}

.zone-search {
  position: relative;
}

.zone-search > .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-3);
  translate: 0 -50%;
  pointer-events: none;
}

.zone-search .input {
  padding-left: 38px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.zone-search .input::-webkit-search-cancel-button {
  cursor: pointer;
}

.zone-search:not([hidden]) + .select select {
  margin-top: -1px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.zone-search .input:focus-visible,
.zone-search + .select select:focus-visible {
  position: relative;
  z-index: 1;
}

/*
  Replies go to: the menu, and with script Add Address… beside it. Add bookings to: the
  calendar menu, and without script Update beside it.
*/
.reply-picker,
.calendar-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.reply-picker > .select,
.calendar-picker > .select {
  flex: 1 1 280px;
  min-width: 0;
  max-width: 420px;
}

.reply-picker > .btn,
.calendar-picker > .btn {
  flex: none;
}

/*
  Add bookings to shows each calendar's color as BusyCal does: a small filled circle before
  its name. A menu can't draw it in its closed control, so the chosen calendar's circle sits
  inside the control's start edge, and the name moves over only while a circle shows. The
  circle takes the server's color through its fill attribute, never a style attribute, and a
  faint ring keeps a pale color visible on the field in light and dark.
*/
.select--calendar .calendar-dot {
  position: absolute;
  top: 50%;
  inset-inline-start: 14px;
  z-index: 1;
  display: block;
  width: 12px;
  height: 12px;
  translate: 0 -50%;
  pointer-events: none;
}

.calendar-dot svg {
  display: block;
  width: 100%;
  height: 100%;
}

.calendar-dot circle {
  stroke: color-mix(in oklab, var(--text) 16%, transparent);
  stroke-width: 1;
}

.select--calendar:has(> .calendar-dot:not([hidden])) select {
  padding-inline-start: 34px;
}

/*
  Where the browser can draw a menu's options itself (a customizable select, with attributes
  read as colors), the open menu shows every calendar's circle before its name too, read from
  the option's data-calendar-color, after the browser's own check mark for the chosen one, as
  in BusyCal's menus. The menu opens as the dashboard's other menus do: a raised card with a
  hairline and the menus' shadow. Calendars without a color keep an empty place, so the names
  line up; the first entry and Not on your Mac sit outside the account groups and have none.
  Other browsers keep their own menu, and the circle in the control still names the chosen
  calendar's color.
*/
@supports (appearance: base-select) and (background-color: attr(data-calendar-color type(<color>), transparent)) {
  #calendar,
  #calendar::picker(select) {
    appearance: base-select;
  }

  /* The wrapper's chevron stays the menu's one sign, as on the other menus. */
  #calendar::picker-icon {
    display: none;
  }

  #calendar::picker(select) {
    max-block-size: min(420px, 60vh);
    margin-block: var(--space-1);
    padding: var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    box-shadow: var(--shadow-pop);
    color: var(--text);
  }

  #calendar optgroup {
    padding-block: var(--space-1);
    color: var(--text-3);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
  }

  #calendar optgroup + optgroup {
    margin-block-start: var(--space-1);
    border-block-start: 1px solid var(--line);
  }

  #calendar option {
    gap: var(--space-2);
    min-block-size: 40px;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
  }

  #calendar option:hover,
  #calendar option:focus-visible {
    background: var(--surface-2);
  }

  #calendar option::checkmark {
    color: var(--accent-ink);
  }

  #calendar optgroup > option::before {
    content: "";
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: attr(data-calendar-color type(<color>), transparent);
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--text) 16%, transparent);
  }

  #calendar optgroup > option:not([data-calendar-color])::before {
    box-shadow: none;
  }
}

/*
  A verification that answered after the dialog closed leaves the address in the menu without
  choosing it, and one line under the menu says so until the host chooses or opens the dialog.
*/
.reply-told {
  color: var(--text-2);
  overflow-wrap: anywhere;
  animation: note-arrive var(--motion) var(--ease-out);
}

/* The menu glows once when the address just verified in the dialog becomes its choice. */
@keyframes field-glow {
  40% {
    border-color: var(--accent-fill);
    box-shadow: 0 0 0 4px var(--accent-wash);
  }
}

.is-glowing select,
select.is-glowing {
  animation: field-glow 900ms var(--ease-out);
}

/*
  Adding a reply address: a modal card on the dashboard's surface, the settings screen's two
  forms one after the other. It fades and lifts in, and the step it shows changes with a
  short cross-fade, keeping its width.
*/
.dialog {
  width: min(460px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - 2 * var(--space-6));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  overflow: auto;
}

.dialog::backdrop {
  background: rgb(10 14 22 / 0.42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.dialog[open] {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--motion) var(--ease-out),
    transform var(--motion) var(--ease-out),
    overlay var(--motion) allow-discrete,
    display var(--motion) allow-discrete;
}

.dialog[open]::backdrop {
  opacity: 1;
  transition:
    opacity var(--motion) linear,
    overlay var(--motion) allow-discrete,
    display var(--motion) allow-discrete;
}

.dialog:not([open]) {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition:
    opacity var(--motion-quick) var(--ease-in),
    transform var(--motion-quick) var(--ease-in),
    overlay var(--motion-quick) allow-discrete,
    display var(--motion-quick) allow-discrete;
}

@starting-style {
  .dialog[open] {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  .dialog[open]::backdrop {
    opacity: 0;
  }
}

.dialog-step {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6);
}

.dialog-step.is-arriving {
  animation: step-arrive var(--motion) var(--ease-out);
}

@keyframes step-arrive {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
}

.dialog-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

/* The address the code went to, with the way back to change it right after it. */
.dialog-lead {
  display: grid;
  justify-items: start;
  gap: 2px;
  margin-top: calc(var(--space-2) * -1);
  color: var(--text-2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.dialog-back {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font: inherit;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

.dialog-back:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.dialog-lead strong {
  color: var(--text);
  font-weight: var(--weight-semibold);
}

.dialog-step .code-input {
  max-width: 220px;
}

.dialog-resend {
  display: grid;
  justify-items: start;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.dialog-resend .btn {
  margin-inline-start: calc(var(--space-3) * -1);
}

.dialog-sent {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--success-ink);
}

.dialog-sent:empty {
  display: none;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding-top: var(--space-2);
}

.dialog-actions .btn[aria-disabled="true"] {
  cursor: progress;
  opacity: 0.7;
}

@media (max-width: 479px) {
  .dialog-step {
    padding: var(--space-5);
  }

  .dialog-actions > .btn {
    flex: 1 1 auto;
  }
}

/*
  The form's first, hidden button is its default, so Return in a field saves rather than
  adding or removing hours, a question or a location.
*/
.default-submit {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/*
  A page's availability uses the public picker card: the page in the band with its lengths
  and zone, the month at the start, and the chosen day as a timeline of the one reason each
  start time is or isn't offered. Every day links to its reasons, so a day with nothing
  offered keeps the plain tile and only gains a quiet hover.
*/
.check-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

/* Lengths as links, in the look of the public segmented control's buttons. */
.seg a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 var(--space-3);
  border-radius: 9px;
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  text-decoration: none;
}

.seg a:hover {
  color: var(--text);
  background: var(--surface-3);
}

.seg a[aria-current] {
  background: var(--seg-active);
  color: var(--text);
  font-weight: var(--weight-semibold);
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.12), 0 0 0 1px var(--line);
}

.availability-check a.day:not(.day--open):not([aria-current]):hover {
  background: var(--surface-2);
  color: var(--text-2);
}

.day-summary {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-2);
}

/*
  The chosen day as a timeline, after BusyCal's Free/Busy Availability Viewer: one bar from
  midnight to midnight, a block per run of start times in its reason family's style, an hour
  ruler under it, and the hours outside the page's open hours shaded across both. The
  meanings the two share take the Mac's system colors in each appearance (style.css and
  dark.css hold them). Offered is the viewer's free style, a calm tint of the system green
  inside a dashed line of it; in light appearance the line is the darker green, 3.9:1 on its
  tint, where the system green itself would be 1.9:1. Busy times are the system gray, and the
  time too close to them a lighter tint of it. Time outside the hours or the bookable dates
  has the viewer's away stripes, the same gray at low alpha, quiet because they fill most of
  a day. Orange means tentative on the Mac and Bookings has none, so minimum notice and
  booking limits are drawn as horizontal gray lines; a paused page has a gray crosshatch and
  missing busy times gray dots. BusyCal's blue stays for a chosen time, which this drawing
  never marks. Blocks touch, so a run as short as one start time stays visible on a phone; a
  one-pixel seam in the card's color separates them, and the dashed line sits inside its
  block so it never covers a neighbor.
*/
.timeline {
  --tl-offered: color-mix(in srgb, var(--system-green) 14%, var(--surface));
  --tl-offered-line: var(--system-green-line);
  --tl-busy: var(--system-gray);
  --tl-buffer: color-mix(in srgb, var(--system-gray) 42%, var(--surface));
  --tl-outside-base: color-mix(in srgb, var(--system-gray) 7%, var(--surface));
  --tl-outside-line: color-mix(in srgb, var(--system-gray) 24%, transparent);
  --tl-limits-base: color-mix(in srgb, var(--system-gray) 7%, var(--surface));
  --tl-limits-line: color-mix(in srgb, var(--system-gray) 46%, transparent);
  --tl-paused-base: var(--surface-2);
  --tl-paused-line: color-mix(in oklab, var(--line-strong) 60%, var(--surface));
  --tl-unknown-base: var(--surface-2);
  --tl-unknown-dot: var(--line-strong);
  --tl-off: color-mix(in srgb, var(--text) 5%, transparent);
  margin-top: var(--space-4);
}

.tl-chart {
  width: 100%;
  height: 70px;
  overflow: visible;
}

/* Only the blocks answer the pointer, so a hover anywhere on one shows its title. */
.tl-off,
.tl-track,
.tl-seam,
.tl-outline,
.tl-tick,
.tl-hour {
  pointer-events: none;
}

.tl-off {
  fill: var(--tl-off);
}

.tl-track {
  fill: var(--surface-2);
}

.tl-offered {
  fill: var(--tl-offered);
}

.tl-busy {
  fill: var(--tl-busy);
}

.tl-buffer {
  fill: var(--tl-buffer);
}

.tl-outside_hours,
.tl-date_override,
.tl-outside_window {
  fill: url(#tl-outside);
}

.tl-lead_time,
.tl-limit_day,
.tl-limit_week,
.tl-limit_month {
  fill: url(#tl-limits);
}

/*
  A page that is turned off or paused takes no booking at any time, and neither does one that
  can offer none of its locations or whose calendar's account is turned off in BusyCal
  (page_unavailable). .tl-paused draws the family's legend key.
*/
.tl-paused,
.tl-page_off,
.tl-page_paused,
.tl-no_available_locations,
.tl-page_unavailable {
  fill: url(#tl-paused);
}

/*
  Gray dots: busy times that are missing or don't cover the time, and the profile, calendar
  and access gates, which the legend names together (availability_no_data).
  .tl-no_availability_data draws the family's legend key.
*/
.tl-no_availability_data,
.tl-profile_incomplete,
.tl-calendar_required,
.tl-not_entitled,
.tl-availability_unavailable,
.tl-availability_outside_horizon {
  fill: url(#tl-unknown);
}

.tl-outside-base {
  fill: var(--tl-outside-base);
}

.tl-outside-line {
  fill: var(--tl-outside-line);
}

.tl-limits-base {
  fill: var(--tl-limits-base);
}

.tl-limits-line {
  fill: var(--tl-limits-line);
}

.tl-paused-base {
  fill: var(--tl-paused-base);
}

.tl-paused-line {
  fill: var(--tl-paused-line);
}

.tl-unknown-base {
  fill: var(--tl-unknown-base);
}

.tl-unknown-dot {
  fill: var(--tl-unknown-dot);
}

.tl-seam {
  stroke: var(--surface);
  stroke-width: 1px;
}

/*
  The stroke is twice the visible width and clipped to the block, so only its inner half
  shows: the dashed line stays inside the offered run at any width.
*/
.tl-outline {
  fill: none;
  stroke: var(--tl-offered-line);
  stroke-width: 3px;
  stroke-dasharray: 5 4;
  clip-path: inset(0 round 7px);
}

.tl-tick {
  stroke: var(--line);
  stroke-width: 1px;
}

.tl-tick--major {
  stroke: var(--line-strong);
}

.tl-hour {
  fill: var(--text-2);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  text-anchor: middle;
}

.tl-hour.is-off {
  fill: var(--text-3);
}

.tl-hour--start {
  text-anchor: start;
}

.tl-hour--end {
  text-anchor: end;
}

.tl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  line-height: var(--leading-tight);
  color: var(--text-2);
}

.tl-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tl-key {
  flex: none;
  width: 16px;
  height: 10px;
}

.tl-key .tl-outline {
  clip-path: inset(0 round 3px);
}

/* ---------- 12. Settings layout ---------- */

.settings-layout {
  display: grid;
  gap: var(--space-6);
}

.subnav {
  display: none;
}

@media (min-width: 1024px) {
  .settings-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
  }

  .subnav {
    display: block;
    position: sticky;
    top: var(--space-6);
  }

  .settings-layout .crumb {
    display: none;
  }
}

.subnav ul {
  display: grid;
  gap: 2px;
  list-style: none;
  padding: 0;
}

.subnav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.subnav a:hover {
  background: var(--surface-3);
  color: var(--text);
}

.subnav a[aria-current] {
  background: var(--surface);
  color: var(--text);
  font-weight: var(--weight-semibold);
  box-shadow: 0 0 0 1px var(--line);
}

.subnav a[aria-current] .icon {
  color: var(--accent-ink);
}

.subnav .icon {
  width: 18px;
  height: 18px;
  color: var(--text-3);
}

/* The settings index: one card per area, each a link with its current state. */
.settings-index {
  display: grid;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
}

@media (min-width: 720px) {
  .settings-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.settings-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-1) var(--space-4);
  align-items: start;
  align-content: start;
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease;
}

.settings-card:hover {
  border-color: var(--accent-line);
}

.settings-card:has(.row-link:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.settings-card .row-icon {
  grid-row: 1 / span 2;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.settings-card .chev-right {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
}

.settings-card .row-title {
  font-size: var(--text-base);
}

.settings-card .row-sub {
  grid-column: 2;
}

/* Settings fields keep a readable width, as in the design; phones use the full width. */
.panel-body.form .hint {
  max-width: 68ch;
}

.field--mid {
  max-width: 420px;
}

.field--wide {
  max-width: 640px;
}

/*
  The approval-age setting at the end of Access's Busy times: its label reads into the
  menu's length and the explanation follows the menu, so both take the wide measure while
  the menu keeps the width of the other settings fields.
*/
.busy-times .select {
  max-width: 420px;
}

/*
  Remove… on a calendar under Access's Busy calendars: a disclosure with a secondary
  button's look. It opens under the button, toward the start edge, as a row's More actions
  menu does, with what removing does and Remove Busy Times; the button looks pressed while
  it is open, and the popover keeps a readable measure inside the phone's width.
*/
.busy-remove > summary.btn {
  white-space: nowrap;
}

.busy-remove[open] > summary.btn {
  background: var(--surface-2);
}

.busy-remove > .popover {
  display: grid;
  gap: var(--space-3);
  width: 320px;
  font-size: var(--text-sm);
  color: var(--text-2);
  text-wrap: pretty;
}

/* Two short fields side by side from 640 px, such as a name and an email address. */
.field-pair {
  display: grid;
  align-items: start;
  gap: var(--space-5);
  max-width: 640px;
}

@media (min-width: 640px) {
  .field-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4) var(--space-5);
  }
}

/* An option card without an icon or second line: a radio and its words. */
.option--plain {
  grid-template-columns: auto minmax(0, 1fr);
  min-height: var(--target);
}

/* A fact shown where a field would be, under its label, such as a page's one location. */
.fact-value {
  overflow-wrap: anywhere;
}

/*
  An input with fixed text before it: the start of the profile address before the
  username. The pair draws one field, so the ring and the error border go on the pair.
*/
.affix {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--field-bg);
}

.affix:hover {
  border-color: var(--text-3);
}

.affix:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
}

.affix-text {
  display: flex;
  align-items: center;
  max-width: 55%;
  padding: 0 0 0 12px;
  color: var(--text-3);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.affix .input {
  flex: 1;
  min-width: 0;
  padding-left: 2px;
  border: 0;
  background: transparent;
}

.affix .input:focus-visible {
  outline: none;
}

.field--error .affix {
  border-color: var(--danger-ink);
}

/* A photo or logo with its chooser and buttons beside it; on phones they wrap under it. */
.photo-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-5);
}

.photo-field .avatar {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line);
}

.file-form {
  display: grid;
  gap: var(--space-3);
  flex: 1 1 260px;
  min-width: 0;
}

.file-input {
  width: 100%;
  max-width: 420px;
  padding: var(--space-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: var(--text-sm);
}

.file-input::file-selector-button {
  min-height: 36px;
  margin-right: var(--space-3);
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

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

.field--error .file-input {
  border-color: var(--danger-ink);
}

/* The danger area at the end of a settings page. */
.panel--danger {
  border-color: color-mix(in oklab, var(--danger-ink) 30%, var(--line));
}

.panel--danger .panel-title {
  color: var(--danger-ink);
}

/* ---------- 13. Appearance ---------- */

/* Theme choices: the public option cards, side by side from 880 px. */
.options--grid {
  display: grid;
  gap: var(--space-2);
}

@media (min-width: 880px) {
  .options--grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

.option-sub {
  text-wrap: pretty;
}

/* Theme samples draw a tiny booking page in each appearance. */
.theme-sample {
  display: grid;
  gap: 4px;
  flex: none;
  width: 56px;
  height: 40px;
  padding: 6px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--line);
}

.theme-sample i {
  display: block;
  height: 5px;
  border-radius: 3px;
}

.theme-sample--light {
  background: #f3f4f7;
}

.theme-sample--light i {
  background: #d7dbe2;
}

.theme-sample--light i:first-child {
  background: #2b66bf;
  width: 60%;
}

.theme-sample--dark {
  background: #16191e;
}

.theme-sample--dark i {
  background: #2b3038;
}

.theme-sample--dark i:first-child {
  background: #85bfff;
  width: 60%;
}

.theme-sample--auto {
  background: linear-gradient(135deg, #f3f4f7 0 50%, #16191e 50% 100%);
}

.theme-sample--auto i {
  background: #8b919a;
}

.theme-sample--auto i:first-child {
  background: #4480db;
  width: 60%;
}

/*
  Accent swatches: radio inputs over color chips. Each preset's color has a class named
  after it, never a style attribute, because of the Content Security Policy; the values
  match the presets in crates/server/src/appearance.rs.
*/
.swatches-field .options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.swatch-option {
  display: inline-grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target);
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  background: var(--field-bg);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  overflow-wrap: anywhere;
  cursor: pointer;
}

.swatch-option:hover {
  border-color: var(--text-3);
}

.swatch-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent-fill);
  cursor: pointer;
}

.swatch-option:has(input:checked) {
  border-color: var(--accent-fill);
  box-shadow: inset 0 0 0 1px var(--accent-fill);
  background: var(--accent-soft);
}

.swatch-option:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.swatch-chip {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12);
}

.swatch-chip--blue { background: #4480db; }
.swatch-chip--green { background: #237c50; }
.swatch-chip--purple { background: #7652b7; }
.swatch-chip--red { background: #c03f45; }
.swatch-chip--orange { background: #a85b17; }
.swatch-chip--custom {
  background: conic-gradient(#c03f45, #a85b17, #e2b300, #237c50, #4480db, #7652b7, #c03f45);
}

/*
  The color Custom uses, under the swatches in the same group: its label, its hint, then the
  browser's own color picker, or a text field when a refused value comes back. It shows once
  Custom is chosen; without :has() it always shows, and its hint says what it is for.
*/
.swatches-field .custom-color {
  justify-items: start;
  margin-top: var(--space-3);
}

.swatches-field .custom-color .input {
  max-width: 240px;
  font-family: var(--font-mono);
}

@supports selector(:has(*)) {
  .swatches-field .custom-color {
    display: none;
  }

  .swatches-field:has(#accent-custom:checked) .custom-color {
    display: grid;
  }
}

.color-input {
  width: 64px;
  height: var(--target);
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--field-bg);
  cursor: pointer;
}

.color-input:hover {
  border-color: var(--text-3);
}

.color-input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.field--error .color-input {
  border-color: var(--danger-ink);
}

/* A logo on its own plate, the way the public page shows it. */
.logo-plate {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.logo-plate img {
  display: block;
  height: 28px;
  width: auto;
  max-width: 224px;
}

/*
  Backgrounds: each sample is the page background with a card standing on it, in this
  screen's own light or dark appearance, as the public pages draw them.
*/
.tone-sample {
  display: grid;
  flex: none;
  width: 56px;
  height: 40px;
  padding: 9px 10px 0;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--line);
}

.tone-sample i {
  display: block;
  border-radius: 5px 5px 0 0;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}

.tone-sample--paper {
  background: var(--appearance-paper);
}

.tone-sample--sand {
  background: var(--appearance-sand);
}

.tone-sample--mist {
  background: var(--appearance-mist);
}

/*
  The cover editor, inside [data-appearance-editor]. The dashboard keeps BusyCal's own
  colors; only the drawings, the drag frame and the preview show a host's choices.
  appearance.css, which this screen loads, supplies the cover drawings and the
  .appearance-cover frame, and the appearance script sets the cover's variables on the
  editor while a host tries choices.

  Cover choices: a small page for each cover, with its radio and name under it. The
  drawing shows the page's card with a cover across its top and the photo and a line of
  text below; without a cover the photo and text sit higher. The checked tile's drawing
  takes a ring in the accent, beside the radio's own mark.
*/
.cover-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 136px), 1fr));
  gap: var(--space-4) var(--space-3);
}

.cover-tile {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  min-width: 0;
  cursor: pointer;
}

.cover-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 8 / 5;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow 0.12s ease;
}

.cover-thumb-art {
  position: absolute;
  inset: 0 0 42% 0;
  background-color: var(--surface-3);
  background-repeat: no-repeat;
  background-size: cover;
}

.cover-thumb--dune .cover-thumb-art {
  background-image: var(--appearance-dune);
}

.cover-thumb--coast .cover-thumb-art {
  background-image: var(--appearance-coast);
}

.cover-thumb-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The photo, over the cover's lower edge. */
.cover-thumb::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 58%;
  left: 11%;
  width: 21%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface-3);
  box-shadow: 0 0 0 2px var(--surface);
  translate: 0 -55%;
}

/* A line of text on the card. */
.cover-thumb::after {
  content: "";
  position: absolute;
  right: 38%;
  bottom: 13%;
  left: 11%;
  height: 8%;
  border-radius: var(--radius-full);
  background: var(--line);
}

.cover-thumb--none::before {
  top: 40%;
}

.cover-thumb--none::after {
  bottom: 24%;
}

.cover-tile:hover .cover-thumb {
  box-shadow: 0 0 0 1px var(--text-3);
}

.cover-tile:has(input:checked) .cover-thumb {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent-fill);
}

.cover-tile:has(input:focus-visible) .cover-thumb {
  outline: 2px solid var(--focus);
  outline-offset: 6px;
}

.cover-tile-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  overflow-wrap: anywhere;
}

.cover-tile-name input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent-fill);
  cursor: pointer;
}

.cover-tile:has(input:checked) .cover-tile-name {
  font-weight: var(--weight-semibold);
}

/*
  The drag frame: the profile cover's shape, 5:2 on phones and 4:1 from 640 px, so what the
  host frames is what the profile shows. It appears only once the appearance script sets
  --appearance-cover-display, and it takes drags and pinches itself rather than scrolling or
  zooming the page. Its hint stands on a solid pill over the picture's lower edge.
*/
.cover-viewport {
  aspect-ratio: 5 / 2;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px var(--line);
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.cover-viewport:active {
  cursor: grabbing;
}

.cover-viewport-hint {
  position: absolute;
  bottom: var(--space-2);
  left: 50%;
  z-index: 1;
  max-width: calc(100% - 2 * var(--space-2));
  padding: 2px var(--space-3);
  border-radius: var(--radius-full);
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.14);
  color: var(--text-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-align: center;
  translate: -50% 0;
  pointer-events: none;
}

@media (min-width: 640px) {
  .cover-viewport {
    aspect-ratio: 4 / 1;
  }
}

/*
  Reposition: a disclosure with a secondary button's look, which looks pressed while open.
  Its three sliders take the full width on phones and share a row from 640 px; each reads
  its value at the end of its label line.
*/
.cover-position > summary {
  width: fit-content;
  list-style: none;
}

.cover-position > summary::-webkit-details-marker {
  display: none;
}

.cover-position[open] > summary {
  background: var(--surface-2);
}

.cover-position-body {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.cover-ranges {
  display: grid;
  gap: var(--space-4);
}

.cover-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  min-width: 0;
}

.cover-range-value {
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

.cover-range-input {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 32px;
  margin: 0;
  accent-color: var(--accent-fill);
  cursor: pointer;
}

@media (min-width: 640px) {
  .cover-ranges {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-5);
  }
}

/* The host's own image: a chooser under a rule, apart from the ready-made covers. */
.cover-upload {
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

/*
  The preview: the real pages in a frame, on a quiet stage. The buttons above it use the
  segmented control's look, with aria-pressed for the current one.
*/
.preview-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.preview-tools .seg button[aria-pressed="true"] {
  background: var(--seg-active);
  color: var(--text);
  font-weight: var(--weight-semibold);
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.12), 0 0 0 1px var(--line);
}

.preview-tools .seg button:disabled {
  background: none;
  color: var(--text-disabled);
  cursor: default;
}

.preview-tools .select select {
  min-height: 36px;
  padding-top: 6px;
  padding-bottom: 6px;
}

/* A long booking page title shortens the menu instead of widening the toolbar. */
.preview-page {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 320px;
}

.preview-empty {
  flex-basis: 100%;
}

/*
  The frame always lays its page out at one fixed size, so the public pages' own
  breakpoints choose the layout, as on a visitor's screen: Desktop is 1024 by 768 px, the
  narrowest desktop layout, and Phone is 390 by 768 px. The frame is then scaled to fit the
  stage's width, never enlarged and never stretched. Its negative margins give back the
  room the full size would take, so the stage is as tall as the scaled frame and nothing
  reaches past the window, from a 360 px phone up. The page inside still scrolls.
  Desktop or Phone follows the editor's data-preview-device, which the appearance script
  sets with the pressed button; without script the preview is Desktop.
*/
.preview-stage {
  container: preview / inline-size;
  display: grid;
  justify-items: center;
  overflow: hidden;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-3);
}

.preview-frame {
  --preview-width: 1024px;
  --preview-height: 768px;
  --preview-scale: var(--preview-fit-desktop, 0.21875);
  display: block;
  width: var(--preview-width);
  height: var(--preview-height);
  margin: 0 calc(var(--preview-width) * (var(--preview-scale) - 1)) calc(var(--preview-height) * (var(--preview-scale) - 1)) 0;
  border: 0;
  border-radius: calc(var(--radius-md) / var(--preview-scale));
  background: var(--bg);
  box-shadow: 0 0 0 calc(1px / var(--preview-scale)) var(--line);
  transform: scale(var(--preview-scale));
  transform-origin: 0 0;
}

[data-appearance-editor][data-preview-device="phone"] .preview-frame {
  --preview-width: 390px;
  --preview-scale: var(--preview-fit-phone, 0.57435);
  border-radius: calc(28px / var(--preview-scale));
}

/* Lengths drawn on the frame are divided by its scale, so its corners, edge and focus ring
   keep their size on screen. */
.preview-frame:focus-visible {
  outline-width: calc(2px / var(--preview-scale));
  outline-offset: calc(2px / var(--preview-scale));
}

/*
  The scale for each 32 px of stage width: the stage's width at that step divided by 1024
  for Desktop and by 390 for Phone, which keeps its full size from a 390 px stage. Not every
  browser can divide one length by another in CSS yet, so the steps are written out; each
  leaves less than 32 px beside the frame. Under 256 px, the frame's own defaults apply.
*/
@container preview (min-width: 256px) { .preview-frame { --preview-fit-desktop: 0.25; --preview-fit-phone: 0.65641; } }
@container preview (min-width: 288px) { .preview-frame { --preview-fit-desktop: 0.28125; --preview-fit-phone: 0.73846; } }
@container preview (min-width: 320px) { .preview-frame { --preview-fit-desktop: 0.3125; --preview-fit-phone: 0.82051; } }
@container preview (min-width: 352px) { .preview-frame { --preview-fit-desktop: 0.34375; --preview-fit-phone: 0.90256; } }
@container preview (min-width: 384px) { .preview-frame { --preview-fit-desktop: 0.375; --preview-fit-phone: 0.98461; } }
@container preview (min-width: 390px) { .preview-frame { --preview-fit-phone: 1; } }
@container preview (min-width: 416px) { .preview-frame { --preview-fit-desktop: 0.40625; } }
@container preview (min-width: 448px) { .preview-frame { --preview-fit-desktop: 0.4375; } }
@container preview (min-width: 480px) { .preview-frame { --preview-fit-desktop: 0.46875; } }
@container preview (min-width: 512px) { .preview-frame { --preview-fit-desktop: 0.5; } }
@container preview (min-width: 544px) { .preview-frame { --preview-fit-desktop: 0.53125; } }
@container preview (min-width: 576px) { .preview-frame { --preview-fit-desktop: 0.5625; } }
@container preview (min-width: 608px) { .preview-frame { --preview-fit-desktop: 0.59375; } }
@container preview (min-width: 640px) { .preview-frame { --preview-fit-desktop: 0.625; } }
@container preview (min-width: 672px) { .preview-frame { --preview-fit-desktop: 0.65625; } }
@container preview (min-width: 704px) { .preview-frame { --preview-fit-desktop: 0.6875; } }
@container preview (min-width: 736px) { .preview-frame { --preview-fit-desktop: 0.71875; } }
@container preview (min-width: 768px) { .preview-frame { --preview-fit-desktop: 0.75; } }
@container preview (min-width: 800px) { .preview-frame { --preview-fit-desktop: 0.78125; } }
@container preview (min-width: 832px) { .preview-frame { --preview-fit-desktop: 0.8125; } }
@container preview (min-width: 864px) { .preview-frame { --preview-fit-desktop: 0.84375; } }
@container preview (min-width: 896px) { .preview-frame { --preview-fit-desktop: 0.875; } }
@container preview (min-width: 928px) { .preview-frame { --preview-fit-desktop: 0.90625; } }
@container preview (min-width: 960px) { .preview-frame { --preview-fit-desktop: 0.9375; } }
@container preview (min-width: 992px) { .preview-frame { --preview-fit-desktop: 0.96875; } }
@container preview (min-width: 1024px) { .preview-frame { --preview-fit-desktop: 1; } }

.preview-status {
  min-height: 1.5em;
  font-size: var(--text-sm);
  color: var(--text-3);
  text-align: center;
}

/* What the appearance script finds wrong shows beside Save Appearance. The alert stays in
   place while empty, where it takes no room, so a screen reader hears each message. */
.appearance-error {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--danger-ink);
  overflow-wrap: anywhere;
}

/* Without script the preview shows the saved profile alone, and the sliders keep no readout. */
@media (scripting: none) {
  .preview-tools,
  .cover-range-value,
  .cover-reset {
    display: none;
  }
}

/* ---------- 14. Confirmation screens and errors ---------- */

/*
  A consequential step is its own screen: the public status card, with the question as the
  heading, what will happen, then the button and the way back.
*/
.confirm {
  max-width: 640px;
  margin: 0 auto;
}

.confirm .status-hero {
  justify-items: start;
  text-align: start;
  padding: var(--space-8) var(--space-8) var(--space-6);
}

.confirm .status-title {
  font-size: var(--text-lg);
  overflow-wrap: anywhere;
}

.confirm .lead {
  max-width: 60ch;
}

/*
  Which booking a confirmation acts on, between the question and what will happen: the
  public ticket, with a calendar tile where the public page has its date badge, because
  the start comes as one finished line. Long names and page titles wrap inside it.
*/
.confirm-ticket {
  justify-self: stretch;
  margin: var(--space-1) 0;
  text-align: start;
}

/* Everything a page still needs before it can be turned on, each beside its own icon, in the
   lead's size and color, so the list reads as the card's explanation. */
.needs {
  display: grid;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  color: var(--text-2);
  text-wrap: pretty;
}

.needs li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

.needs .icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--warn-ink);
}

.ticket-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
}

.ticket-icon .icon {
  width: 20px;
  height: 20px;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.confirm-icon .icon {
  width: 26px;
  height: 26px;
}

.confirm-icon--accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.confirm-icon--neutral {
  background: var(--surface-2);
  color: var(--text-2);
}

/* The photo or logo a removal is about stands where the icon would be. */
.confirm-image.avatar {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line);
}

/* A cover image, in the profile cover's wide shape. */
.cover-plate {
  display: block;
  width: min(100%, 320px);
  aspect-ratio: 4 / 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px var(--line);
}

.confirm-icon--warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.confirm-icon--success {
  background: var(--success-soft);
  color: var(--success-ink);
}

/*
  A page confirmation's middle section: the page as the public ticket, with a page tile,
  its title, link and state, and below a dashed rule the bookings that stay; then any
  notice. A changed-elsewhere warning comes first, so it is in view after the reload.
*/
.confirm-body {
  display: grid;
  gap: var(--space-4);
}

.ticket-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ticket-main .state-line {
  margin-top: var(--space-1);
}

.error-card .actions {
  justify-content: center;
  margin-top: var(--space-3);
}

/* ---------- 15. Sign-in ---------- */

.auth-brand {
  display: flex;
  justify-content: center;
  padding: var(--space-8) var(--gutter) 0;
}

/* A one-time result on the sign-in screen, such as after signing out everywhere, sits
   above the card at the card's width; the centered row would put it beside the card. */
.shell--center:has(> .result-note) {
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
}

.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.auth-head {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-8) var(--space-6);
  text-align: center;
  background: linear-gradient(180deg, var(--accent-band) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--line);
  border-radius: calc(var(--radius-xl) - 1px) calc(var(--radius-xl) - 1px) 0 0;
}

.auth-head .status-title {
  font-size: var(--text-lg);
  overflow-wrap: anywhere;
}

.auth-body {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-8) var(--space-8);
}

.auth-body > .link {
  justify-self: start;
}

.auth-foot {
  padding: var(--space-5) var(--space-8);
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--text-2);
  text-align: center;
  text-wrap: pretty;
}

/* The six-digit code: large, spaced figures. */
.code-input {
  max-width: 220px;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.auth-card .form {
  gap: var(--space-4);
}

.auth-card .actions .btn-primary {
  flex: 1 1 auto;
}

/* ---------- 16. Phones ---------- */

@media (max-width: 639px) {
  .panel-head {
    padding: var(--space-4) var(--space-4) var(--space-3);
  }

  /* Appearance: sliders a touch target high, and a narrower stage edge around the preview. */
  .cover-range-input {
    min-height: var(--target);
  }

  .preview-stage {
    padding: var(--space-2);
  }

  .panel-body {
    padding: 0 var(--space-4) var(--space-5);
  }

  .panel-body--ruled,
  .panel-body--solo {
    padding-top: var(--space-4);
  }

  .panel-foot {
    padding: var(--space-3) var(--space-4);
  }

  .booking-pick {
    padding: var(--space-4) var(--space-4) var(--space-5);
  }

  /* Create Booking takes the foot's full width under its note, as Show Times does above. */
  .panel-foot > .actions {
    flex: 1 1 100%;
  }

  /* On phones a page's lengths sit under its title, so the title keeps the band's width. */
  .availability-check .check-tools {
    grid-row: auto;
    grid-column: 1 / -1;
  }

  .row {
    padding: var(--space-3) var(--space-4);
  }

  /* Phone rows put their buttons and tags under the text instead of beside it. */
  .row--stack {
    grid-template-columns: minmax(0, 1fr);
  }

  .row--stack .row-aside {
    justify-content: flex-start;
    padding-left: calc(36px + var(--space-3));
  }

  .group {
    padding: var(--space-4) var(--space-4) var(--space-5);
  }

  /* The page's times keep lining up with the sections' narrower phone padding. */
  .stack > .page-times {
    padding-inline: var(--space-4);
  }

  .item-card {
    padding: var(--space-3) var(--space-3) var(--space-4);
  }

  .day-row,
  .date-row {
    padding: var(--space-2) var(--space-3) var(--space-3);
  }

  /*
    The editor's save bar fades in over 16 px here and keeps its buttons close to the bottom
    edge. Its buttons share its width, each taking a line of its own when a language's
    labels don't fit side by side. The note always takes a line of its own here, so it
    carries the space under it: an empty note line then adds no gap. With the note, the bar
    stays within the 104 px the form keeps clear when it scrolls a field into view.
  */
  .savebar {
    row-gap: 0;
    margin-top: calc(-1 * var(--space-2));
    padding: var(--space-4) 0 var(--space-3);
    background: linear-gradient(to bottom, transparent, var(--bg) var(--space-4));
  }

  .savebar-note {
    padding-bottom: var(--space-2);
  }

  .savebar .actions {
    width: 100%;
  }

  .savebar .actions > .btn {
    flex: 1 1 auto;
  }

  /*
    Clock fields are narrow beside each other on phones. Tapping one opens the system's own
    time picker there, so the small clock button inside the field can go.
  */
  .input--time {
    padding-left: 8px;
    padding-right: 4px;
  }

  .input--time::-webkit-calendar-picker-indicator {
    display: none;
  }

  .page-item {
    padding: var(--space-4);
  }

  .booking-hero,
  .booking-actions {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .more-results {
    padding: var(--space-4);
  }

  .page-heading {
    font-size: var(--text-lg);
  }

  /* Touch targets: every control outside running text is at least 44 px high. */
  .tabs a,
  .seg a,
  .section-nav a,
  .menu-list a,
  .menu-list button,
  .notice-actions .link,
  .kv dd .link,
  .crumb,
  .select--compact select,
  .chip span,
  .help-disclosure > summary {
    min-height: var(--target);
  }

  /* Four tabs in two even rows, so a count or a long name never leaves one tab alone. */
  .tabs ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .tabs a {
    width: 100%;
    padding: 0 var(--space-3);
  }

  .page-head .actions,
  .page-item-foot .actions {
    width: 100%;
  }

  .page-head .actions > .btn,
  .page-item-foot .actions > .btn,
  .page-head .actions > .inline-form,
  .page-head .inline-form > .btn {
    flex: 1 1 auto;
  }

  /*
    A page's controls fill their row and wrap to a new line, in their own order, when a
    language's labels don't fit, so the row never grows wider than the card. The menu
    button ends the last line at the card's end edge even when it wraps on its own, so the
    menu, which opens toward the start edge, has the card's width to open into.
  */
  .page-item-foot .actions > .inline-form,
  .page-item-foot .inline-form > .btn {
    flex: 1 1 auto;
  }

  .page-item-foot .actions > .menu.more {
    margin-inline-start: auto;
  }

  .menu.more > summary {
    width: var(--target);
    height: var(--target);
  }

  .confirm .actions > .btn {
    flex: 1 1 100%;
  }

  /*
    The picker card fills the width on phones, as on the public pages, so seven day tiles
    fit at 44 px. Only the way back and a result keep the gutters.
  */
  .shell--flush > .crumb-row {
    margin: 0;
    padding: var(--space-4) var(--gutter);
  }

  .shell--flush > .result-note {
    margin: 0 var(--gutter) var(--space-4);
  }

  .confirm .status-card {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
  }

  .confirm .status-hero {
    padding: var(--space-6) var(--space-5) var(--space-5);
    border-radius: calc(var(--radius-xl) - 1px) calc(var(--radius-xl) - 1px) 0 0;
  }

  .confirm .status-section {
    padding: var(--space-5);
  }

  .confirm-ticket {
    gap: var(--space-3);
    padding: var(--space-4);
  }

  .auth-head {
    padding: var(--space-6) var(--space-5) var(--space-5);
  }

  .auth-body {
    padding: var(--space-5) var(--space-5) var(--space-6);
  }

  .auth-foot {
    padding: var(--space-4) var(--space-5);
  }

  /* Links that stand alone in details and titles get a 44 px target without moving text.
     Links inside a description stay in its running text, and Open links keep their icon
     beside the word, taking their height from the touch-target rule above. */
  .kv dd:not(.prose) a:not(.link),
  .people a,
  .page-item-title a {
    display: inline-block;
    padding: 12px 0;
    margin: -12px 0;
  }
}

/* At the narrowest phones the day tiles give up their gap so each stays 44 px wide. */
@media (max-width: 399px) {
  .shell--app .month td {
    padding: 1px;
  }
}

/* ---------- 17. Updates in place ---------- */

/*
  assets/navigation.js updates a screen in place for the controls marked data-bookings-update
  (docs/dashboard.md). These rules give that its look: the control whose request is running,
  the message beside an action that was refused or whose result is unknown, and the short motion
  of a record taking its new state. A page without script never meets any of them.
*/

/*
  A running request keeps its control's size: the menu button's icon gives way to a small
  spinner in the same place. The script adds .is-busy only after a moment, so a quick answer
  never flashes, and with reduced motion the spinner stands still.
*/
.menu.more > summary > .icon,
.menu.more > summary.is-busy::after {
  grid-area: 1 / 1;
}

.menu.more > summary.is-busy {
  cursor: progress;
}

.menu.more > summary.is-busy > .icon {
  visibility: hidden;
}

.menu.more > summary.is-busy::after {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  animation: bookings-spin 0.7s linear infinite;
}

@keyframes bookings-spin {
  to {
    transform: rotate(1turn);
  }
}

/*
  The message beside an action: the attention notice, at the end of the card the action belongs
  to, with Reload, which reads the screen again and sends nothing. It fades in once and stays
  until the next request or the next look at the screen.
*/
.action-note {
  animation: bookings-fade-in 120ms ease-out;
}

/* In a booking row the message takes the row's full width under its text, and stays above
   the link that covers the row, so Reload can be clicked. */
.row > .action-note {
  grid-column: 1 / -1;
  position: relative;
  z-index: 1;
}

@keyframes bookings-fade-in {
  from {
    opacity: 0;
  }
}

/*
  Motion, where the browser has View Transitions. Only an update in progress (html.is-updating)
  names what takes part, so nothing is captured at any other time; a name left in place would
  also make each card a stacking context that an open menu could not rise above. The page keeps
  still, never the browser's whole-document crossfade: the card or booking row the host acted
  on crossfades into its new state, and when a notice appears at the top of the screen, the
  heading and the list below it (Pages' cards, a Bookings list, or Overview's columns) move
  down together instead of jumping, while the notice fades in.
*/
:root.is-updating {
  view-transition-name: none;
}

.is-updating #main > .result-note {
  view-transition-name: bookings-notice;
}

.is-updating #main > .page-head {
  view-transition-name: bookings-head;
}

.is-updating #main > .page-list,
.is-updating #main > .panel--list,
.is-updating #main > .columns {
  view-transition-name: bookings-list;
}

.is-updating .is-acted {
  view-transition-name: bookings-record;
}

::view-transition-group(bookings-record),
::view-transition-group(bookings-head),
::view-transition-group(bookings-list) {
  animation-duration: 160ms;
  animation-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

::view-transition-group(bookings-notice) {
  animation-duration: 120ms;
  animation-timing-function: ease-out;
}

/* A notice that wasn't there before waits until the heading has mostly moved out of its way. */
::view-transition-new(bookings-notice):only-child {
  animation-delay: 60ms;
}

/* ---------- 18. Refinements ---------- */

/*
  The dashboard's look, refined (design/2a/, "Polished"), together with the public
  refinements in style.css, which this frame links first: hairline cards without the deep
  shadow, pill tracks for the navigation and tabs, page states as soft pills, round icon
  tiles, chips for page facts, an amber note for a missing calendar, Overview's Status
  across the top, and the page editor in a narrower reading column. These rules restyle the
  sections above in place; preferences, forced colors and print still come last.
*/

/* Cards keep their hairline and lose the deep soft shadow. */
body.app { --shadow-card: 0 1px 2px rgb(16 24 40 / 0.04); }
.panel, .page-item, .settings-card { border-radius: 18px; }

/* Navigation and tabs: pill tracks, the current item marked by its surface, not a shadow. */
.appnav ul { border-radius: var(--radius-full); }
.appnav a, .tabs a { border-radius: var(--radius-full); }
.appnav a[aria-current], .tabs a[aria-current] { box-shadow: 0 0 0 1px var(--line); }
/* The tabs' track has corners concentric with the tabs inside (half a tab's height plus the
   track's 5 px inset), so one row reads as a pill and two rows as a rounded tray. On phones
   the tabs keep the two even rows of the phone section (16), so the open list's tab is in
   view on every load, with or without script. */
.tabs ul { padding: 4px; border-radius: calc(36px / 2 + 5px); }
@media (max-width: 639px) {
  .tabs ul { border-radius: calc(var(--target) / 2 + 5px); }
}

/* Headings. Header actions keep their labels on one line. */
.page-heading { letter-spacing: -0.025em; }
.page-head .actions .btn { white-space: nowrap; }
.page-lead { color: var(--text-2); }
.panel-title { letter-spacing: -0.01em; }

/* Rows: a round tile, the accent tint for bookings, amber for requests and problems, and grey
   for a booking or request that was called off. The time reads in ink right under the name;
   the page and deadline sit a step quieter. */
.row-icon { border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); }
.row-icon--warn { background: var(--warn-soft); color: var(--warn-ink); }
.row-icon--off { background: var(--surface-3); color: var(--text-2); }
.row-sub { color: var(--text); font-variant-numeric: tabular-nums; }
.row-meta { color: var(--text-3); }
.row:has(.row-link):hover { background: color-mix(in oklab, var(--accent-soft) 45%, var(--surface)); }

/* In the Overview's narrower column, Approve and Decline stay under the request, as on phones,
   so the name and time keep the full width. */
@media (min-width: 640px) and (max-width: 1179px) {
  .columns .row--answer { grid-template-columns: minmax(0, 1fr) auto; }
  .columns .row--answer .row-answer { grid-column: 1; grid-row: 2; padding-left: calc(36px + var(--space-3)); justify-content: flex-start; }
  .columns .row--answer .chev-right { grid-column: 2; grid-row: 1; }
}

/* ---------- Overview: what needs you, then what BusyCal still has to do, then what to share ----------
   Status leads across the full width as an amber tray, one tile per page. The work lists
   (Requests, Problems, Withdrawals and Waiting for BusyCal) fill the main column. Your links is
   a quiet rail beside them: no card surface,
   a small label, and it stays in view while the bookings scroll. The panels keep their
   reading order and Status spans both columns, so a screen without Status or without links
   leaves no empty row, and no gap of one, above or below the bookings. */
@media (min-width: 880px) {
  .columns--overview { grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); }
  .columns--overview.columns--single { grid-template-columns: minmax(0, 1fr); }
  .columns--overview > .panel--attention { grid-column: 1 / -1; }
  .columns--overview > .stack--aside { position: sticky; top: var(--space-6); }
}
.panel--attention { border-color: color-mix(in oklab, var(--warn-ink) 20%, var(--line)); background: var(--warn-soft); box-shadow: none; }
.panel--attention .panel-head { padding-bottom: var(--space-3); }
.panel--attention .panel-title { font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--warn-ink); }
.panel--attention .panel-body--ruled { padding: 0 var(--space-4) var(--space-4); border-top: 0; }
.panel--attention .health { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--space-3); }
.panel--attention .health li { align-content: start; padding: var(--space-4); border-radius: 12px; background: var(--surface); }
.panel--attention .health li > .icon { color: var(--warn-ink); }
.panel--attention .health-action { margin-top: var(--space-1); }
/* A page with several states has one line; each later state starts a little apart, under its
   own sentence. */
.health .health-body + .health-title { margin-top: var(--space-2); }
.stack--aside .panel { background: transparent; box-shadow: none; }
.stack--aside .panel-head { padding: var(--space-4) var(--space-5) var(--space-2); }
.stack--aside .panel-title { font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.stack--aside .row { padding: var(--space-3) var(--space-5); }
.stack--aside .rows { border-top: 1px solid var(--line); }
.stack--aside .panel-foot { padding-inline: var(--space-5); }

/* A page's state as a soft pill: green on the profile, blue for link only, amber when paused,
   grey when off. The dot stays for forced colours and grayscale. A long state, such as
   Russian link only and paused in a narrow ticket, wraps inside its place; the corners
   follow one line's height (half the line plus the 3 px padding), so one line is a pill and
   two lines a rounded box. The pill hugs its words (fit-content, which unlike max-content
   lets a grid or flex parent narrow it to its longest word). */
.state-line { align-items: center; gap: 2px 6px; width: fit-content; max-width: 100%; padding: 3px 10px 3px 8px; border-radius: calc(var(--text-xs) * 1.3 / 2 + 3px); background: var(--surface-3); color: var(--text-2); font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: 1.3; }
.state-line .dot { width: 6px; height: 6px; }
.state-line .sep { color: inherit; opacity: 0.6; }
.state-line:has(.dot--on) { background: var(--success-soft); color: var(--success-ink); }
.state-line:has(.dot--link) { background: var(--accent-soft); color: var(--accent-ink); }
.state-line:has(.dot--warn) { background: var(--warn-soft); color: var(--warn-ink); }

/* Page cards: facts as chips, as on the booking page; the URL quieter beside the title. */
.page-item { gap: var(--space-3); padding: var(--space-5) var(--space-6) var(--space-4); }
.page-item-head { align-items: flex-start; }
.page-item-head > div:first-child { gap: var(--space-2); }
.page-item-head .url { color: var(--text-3); }
.page-item .meta { gap: var(--space-2); margin-top: var(--space-1); }
.page-item .meta > li { min-height: 28px; padding: 0 var(--space-3) 0 10px; border-radius: var(--radius-full); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-2); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.page-item .meta .icon { width: 16px; height: 16px; }
.page-item--off .meta > li { background: var(--surface); }
.page-item-foot { padding-top: var(--space-3); }

/* A missing calendar reads as a short amber note across the card, not a dashed box. A calendar
   whose account is turned off in BusyCal keeps its names and takes the same amber, because
   the host has to act on it too. */
.mac-fact--missing, .mac-fact--off { max-width: none; border: 0; border-radius: 12px; background: var(--warn-soft); }
.mac-fact--missing > .icon, .mac-fact--off > .icon { color: var(--warn-ink); }
.mac-fact--missing .mac-fact-value, .mac-fact--off .mac-fact-value { color: var(--text); font-weight: var(--weight-semibold); }
.mac-fact--missing .mac-fact-note, .mac-fact--off .mac-fact-note { color: var(--text-2); }

/* Settings: hairline cards that tint on hover, with rounder icon tiles. */
.settings-card:hover { border-color: var(--line); background: color-mix(in oklab, var(--accent-soft) 45%, var(--surface)); }
.settings-card .row-icon { border-radius: 12px; }

/* A field drawn inside another control, such as a username or page link after its address, or
   the Other length, has its focus ring on that control, so the fields' halo goes there too. */
.affix .input:focus-visible, .chip-other .input:focus-visible { box-shadow: none; }
.affix:focus-within, .chip-other:focus-within { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-fill) 18%, transparent); }

/* ---------- Page editor ---------- */

/* Length chips are pills, like the times people pick from. */
.chip span { border-radius: var(--radius-full); }
.chip-other { border-radius: var(--radius-full); }

/* Choice cards: a 1 px accent edge and a tint mark the choice; the radio says it too. */
body.app .option { border-radius: 14px; }
body.app .option:has(input:checked) { box-shadow: none; }
body.app .option-icon { border-radius: 10px; }

/* From 1024 px the form keeps a reading width beside the section list. The section being
   read is the script's tinted marker (section 11), which glides between sections; the
   marker takes the links' rounder corners, and the current link reads a step bolder. */
@media (min-width: 1024px) {
  .editor { grid-template-columns: 200px minmax(0, 800px); gap: var(--space-8); }
  .section-nav a { gap: 10px; padding: 0 var(--space-3); border-radius: 10px; }
  .section-nav a[aria-current="true"] { font-weight: var(--weight-semibold); }
  .section-marker { border-radius: 10px; }
}

/* ---------- 19. Preferences, forced colors and print ---------- */

/* Updates in place keep their result, focus and announcement, but nothing moves. */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

@media (prefers-color-scheme: dark) {
  .theme-sample,
  .tone-sample,
  .swatch-chip,
  .cover-thumb,
  .cover-viewport {
    box-shadow: 0 0 0 1px var(--line-strong);
  }

  /* Logos sit on the light plate the public pages give them, so dark logos stay visible. */
  .logo-plate {
    background: #f3f4f7;
  }

  /* A muted badge's strip is light in dark appearance, so its month takes dark text. */
  .datebadge--muted .datebadge-month {
    color: var(--bg);
  }
}

@media (forced-colors: active) {
  .appnav a[aria-current],
  .tabs a[aria-current],
  .seg a[aria-current],
  .subnav a[aria-current],
  .page-item,
  .settings-card,
  .mac-fact,
  .count,
  .chip span,
  .preview-tools .seg button[aria-pressed="true"] {
    border: 1px solid CanvasText;
  }

  /* Cover drawings, the drag frame and the preview keep an edge where shadows drop out. */
  .cover-thumb,
  .cover-viewport,
  .cover-plate,
  .tone-sample {
    outline: 1px solid CanvasText;
  }

  /* The scaled preview's edge is divided by its scale, as its ring is. */
  .preview-frame {
    outline: calc(1px / var(--preview-scale)) solid CanvasText;
  }

  /* Forced colors drop the save bar's fade, which would leave fields showing through its
     buttons, so the bar takes the system canvas instead. */
  .savebar {
    background: Canvas;
  }

  /* A chosen length keeps the system highlight, as well as its check mark. */
  .chip input:checked + span {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }

  .dot {
    forced-color-adjust: none;
    border: 1px solid CanvasText;
  }

  /* The spinner keeps a visible turning arc in system colors. */
  .menu.more > summary.is-busy::after {
    forced-color-adjust: none;
    border-color: GrayText;
    border-top-color: CanvasText;
  }

  /* A timeline's fills and patterns are its meaning, so they stay, each line keeping its
     contrast against its own fill. The ruler takes the system's text color; the shading
     still marks the closed hours, because a high-contrast GrayText can be a bright green
     that would read as offered. */
  .tl-chart,
  .tl-key {
    forced-color-adjust: none;
  }

  .tl-hour,
  .tl-hour.is-off {
    fill: CanvasText;
  }

  .tl-tick {
    stroke: CanvasText;
  }
}

@media print {
  .appbar,
  .section-nav,
  .subnav,
  .savebar,
  .language-form {
    display: none;
  }

  .panel,
  .page-item {
    box-shadow: none;
  }
}

/* Japanese wraps between phrases rather than inside words, where the browser supports it. */
:root:lang(ja) {
  word-break: auto-phrase;
}

