/*
 * foyer.css — Design-system foundation for the Foyer admin UI
 * Palette: warm oat wall, paper-white framed prints, ink primary, brass accent
 * Type: Cormorant Garamond (brand/names) · Hanken Grotesk (UI) · Jost (labels)
 *
 * All colours derived from tokens — never hard-coded hex outside :root.
 * Honest to e-ink: warm paper, framed-art metaphor, no glow/neon.
 */

/* ─── Design tokens ────────────────────────────────────────────────────── */
:root {
  /* Palette */
  --wall:   #E8E1D1;   /* oat-white page background       */
  --paper:  #FBF8F1;   /* framed-print / card background  */
  --ink:    #221C15;   /* primary text + filled buttons   */
  --muted:  #6B6152;   /* secondary text — 5.7:1 on paper, 4.7:1 on wall */
  --brass:  #AE7C2C;   /* accent marks only: dots, rules, diamonds, focus */
  --brass-text: #7A571B; /* brass when it is text — 6.2:1 paper, 5.0:1 wall */
  --sage:   #6E8770;   /* live-status dot                 */
  --line:   #D8CFBC;   /* hairline dividers               */
  --frame:  #C9BCA1;   /* picture-frame border            */
  --danger: #A93D3A;   /* destructive actions + alert text (4.7:1 on wall) */
  --panel-paper: #F6F4EE; /* the frame's white, as admin previews draw it
                             (= quantize.PREVIEW_PAPER, the exact previews) */

  /* Type families */
  --font-brand: "Cormorant Garamond", "Georgia", serif;
  --font-ui:    "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-label: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;  /* was Jost; labels are sentence case now */

  /* Spacing rhythm */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* Radii */
  --r-sm:  4px;
  --r-md:  8px;
  --r-pill: 999px;

  /* Tint / wash tokens — derived from palette, named for reuse */
  --brass-tint:    rgba(174, 124, 44, 0.07);   /* brass wash bg (pending-verify, chips)  */
  --ink-wash:      rgba(34, 28, 21, 0.06);      /* subtle ink hover / code bg             */
  --danger-border: rgba(176, 65, 62, 0.3);      /* danger ghost-button border              */

  /* Frame mat / shadow */
  --frame-mat: 14px;
  --frame-shadow: 0 10px 26px rgba(34, 28, 21, 0.13);
  --frame-inner: #E6E0D2;
  --frame-inner-border: 1px solid var(--frame-inner);

  /* Z-layers */
  --z-nav: 100;
}

/* ─── Reset + base ─────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--wall);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* A11y: focus ring in brass */
:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* A11y: reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Shell ────────────────────────────────────────────────────────────── */
/* Mobile-first single-column shell, max 480px centered */
.foy-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100svh;
  padding-bottom: calc(72px + env(safe-area-inset-bottom)); /* room for fixed bottom nav + home indicator */
  position: relative;
}

/* ─── Header ───────────────────────────────────────────────────────────── */
.foy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--line);
}

/* Brand / page title — Cormorant Garamond, large, ink */
.foy-brand {
  font-family: var(--font-brand);
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* The logo in the phone header */
.foy-brand-logo { line-height: 0; }
.foy-brand-logo img { height: 34px; width: auto; display: block; }

/* Property name with caret dropdown */
.foy-prop {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  user-select: none;
}

/* Account initials circle — top-right of header */
.foy-acct {
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  background: var(--paper);
  border: 1px solid var(--frame);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}

/* ─── Account menu (initials avatar → dropdown) ────────────────────────── */
.foy-acct-menu { position: relative; flex-shrink: 0; }
.foy-acct-menu > summary {
  list-style: none;
  color: var(--ink);
  font-weight: 600;
}
.foy-acct-menu > summary::-webkit-details-marker { display: none; }
.foy-acct-menu > summary:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.foy-acct-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: calc(var(--z-nav) + 1);
  min-width: 224px;
  background: var(--paper);
  border: 1px solid var(--frame);
  border-radius: 10px;
  box-shadow: var(--frame-shadow);
  overflow: hidden;
}
.foy-acct-id { padding: 13px 15px 11px; border-bottom: 1px solid var(--line); }
.foy-acct-name {
  font-family: var(--font-brand);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.1;
  color: var(--ink);
}
.foy-acct-email {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-all;
}
.foy-acct-form {
  display: flex;
  gap: 6px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
}
.foy-acct-form input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 7px 9px;
  border: 1px solid var(--frame);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
}
.foy-acct-form input:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 2px var(--brass-tint);
}
.foy-acct-form button {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--brass-text);
  background: none;
  border: 1px solid var(--frame);
  border-radius: var(--r-sm);
  padding: 0 11px;
  cursor: pointer;
}
.foy-acct-form button:hover { border-color: var(--brass); }
.foy-acct-signout {
  display: block;
  padding: 12px 15px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--danger);
  text-decoration: none;
}
.foy-acct-signout:hover { background: var(--ink-wash); }

/* ─── Superadmin site switcher (header) ────────────────────────────────── */
.foy-sites {
  position: relative;
  flex-shrink: 0;
}
.foy-sites-trigger {
  list-style: none;
  min-height: 44px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 6px 12px;
  border: 1px solid var(--frame);
  border-radius: var(--r-pill);
  background: var(--paper);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--brass-text);
}
.foy-sites-trigger::-webkit-details-marker { display: none; }
.foy-sites-caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--brass);
}
.foy-sites[open] .foy-sites-caret { transform: rotate(180deg); }
.foy-sites-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: calc(var(--z-nav) + 1);
  min-width: 180px;
  background: var(--paper);
  border: 1px solid var(--frame);
  border-radius: 8px;
  box-shadow: var(--frame-shadow);
  overflow: hidden;
}
.foy-sites-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--line);
}
.foy-sites-name {
  flex: 1;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
}
.foy-sites-current {
  font-size: 12px;
  color: var(--brass-text);
}
.foy-sites-use {
  background: none;
  border: 1px solid var(--frame);
  border-radius: var(--r-pill);
  cursor: pointer;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ink);
  padding: 3px 9px;
}
.foy-sites-use:hover { border-color: var(--brass); color: var(--brass-text); }
.foy-sites-manage {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  text-decoration: none;
}
.foy-sites-manage:hover { color: var(--brass-text); }

/* ─── Bottom nav ───────────────────────────────────────────────────────── */
.foy-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--wall);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 64px;
  /* Clear the iOS home indicator so the nav is never hidden/un-tappable on a phone */
  padding-bottom: env(safe-area-inset-bottom);
  z-index: var(--z-nav);
}

.foy-nav > a,
.foy-nav > span[aria-disabled] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  min-height: 44px;
  padding: var(--sp-2) var(--sp-4);
  transition: color 0.15s ease;
}

.foy-nav a:hover,
.foy-nav a.active {
  color: var(--brass-text);
}

.foy-nav a svg,
.foy-nav span[aria-disabled] svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

/* ─── Framed screen cards ──────────────────────────────────────────────── */
/* Gallery-style "picture frame" wrapper for screen preview images */
.foy-frame {
  background: var(--paper);
  border: 1px solid var(--frame);
  padding: var(--frame-mat);
  box-shadow: var(--frame-shadow);
  margin: var(--sp-4) 0;
  position: relative;
}

.foy-frame img {
  display: block;
  width: 100%;
  height: auto;
  border: var(--frame-inner-border);
}

/* Status line: dot + text */
.foy-status {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  margin-top: var(--sp-1);
}

/* Live indicator dot */
.foy-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  display: inline-block;
  flex-shrink: 0;
}
/* Health tones: online / needs-attention / offline */
.foy-dot--ok   { background: var(--sage); }
.foy-dot--warn { background: var(--brass); }
.foy-dot--bad  { background: var(--danger); }
/* Emphasise a low-battery reading in the status line */
.foy-status-warn { color: var(--brass-text); font-weight: 600; }

/* Small uppercase label above a block */
.foy-eyebrow {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  margin-bottom: var(--sp-2);
}

/* ─── Section labels ───────────────────────────────────────────────────── */
.foy-sec {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  padding: var(--sp-5) var(--sp-4) var(--sp-2);
}

/* ─── Page header (eyebrow + Cormorant title, optional action) ─────────── */
/* Shared by Screens / Bookings / More so every page opens the same way.     */
.foy-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-4) var(--sp-2);
}
.foy-title {
  font-family: var(--font-brand);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.1;
  color: var(--ink);
  margin-top: var(--sp-1);
}

/* ─── Tabs ─────────────────────────────────────────────────────────────── */
.foy-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  padding: 0 var(--sp-4);
  gap: var(--sp-5);
}

.foy-tab {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  padding: var(--sp-3) 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  transition: color 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
}

.foy-tab:hover {
  color: var(--ink);
}

.foy-tab.active,
.foy-tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--brass);
}

/* ─── Block editor (message / artwork rows) ────────────────────────────── */
.foy-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--line);
}

/* Dropdown for line size label (DISPLAY, BODY, etc.) */
.foy-size {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  background: var(--wall);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: var(--sp-1) var(--sp-2);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  min-width: 80px;
  text-align: center;
}

/* Text input field */
.foy-field {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  line-height: 1.4;
  transition: border-color 0.12s ease;
}

.foy-field::placeholder {
  color: var(--muted);
}

.foy-field:focus {
  border-color: var(--brass);
}
/* keep the brass focus-visible ring for keyboard users; drop it only for mouse focus */
.foy-field:focus:not(:focus-visible) {
  outline: none;
}

/* Remove / delete row button */
.foy-rm {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 16px;
  cursor: pointer;
  padding: var(--sp-1);
  line-height: 1;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.foy-rm:hover {
  background: rgba(176, 65, 62, 0.1);
}

/* Add line button */
.foy-addline {
  display: block;
  width: calc(100% - var(--sp-8));
  margin: var(--sp-3) var(--sp-4);
  background: none;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-4);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.12s ease, color 0.12s ease;
}

.foy-addline:hover {
  border-color: var(--brass);
  color: var(--brass-text);
}

/* ─── Buttons ──────────────────────────────────────────────────────────── */
/* Primary filled button */
.foy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  border: none;
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-5);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.12s ease;
  min-height: 44px; /* a11y tap target */
}

.foy-btn:hover {
  opacity: 0.88;
}

.foy-btn:active {
  opacity: 0.76;
}

/* Full-width variant */
.foy-btn.foy-btn--full {
  width: 100%;
}

/* Ghost / outline button */
.foy-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: none;
  color: var(--ink);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-5);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.12s ease, color 0.12s ease;
  min-height: 44px;
}

/* Sentence case: buttons (see the label block at the end of the file). It sits
   right after the base button rules and sets no line-height, so any later
   size variant (the proof, skip and keep buttons) still wins. */
:where(.foy-sentence main) .foy-btn,
:where(.foy-sentence main) .foy-btn-ghost {
  text-transform: none; letter-spacing: 0.01em;
  font-family: var(--font-ui); font-weight: 600; font-size: 15px;
}
/* end sentence case */

.foy-btn-ghost:hover {
  border-color: var(--brass);
  color: var(--brass-text);
}

/* Native file inputs, branded. The ::file-selector-button pseudo-element is
   styled to read as a ghost button so every upload control matches. */
input[type="file"] {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--muted);
}
input[type="file"]::file-selector-button {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: var(--sp-2) var(--sp-3);
  margin-right: 10px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover {
  border-color: var(--brass);
  color: var(--brass-text);
}

/* Segmented two-way toggle (radio-like). Markup: a .foy-seg wrapper with
   <button type="button" class="foy-seg-opt [active]"> children. */
.foy-seg { display: inline-flex; border: 1px solid var(--line); background: var(--paper); }
.foy-seg-opt {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
}
.foy-seg-opt.active { background: var(--ink); color: var(--paper); }

/* ─── List rows (bookings, reservations) ───────────────────────────────── */
.foy-list-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background 0.1s ease;
}

.foy-list-row:first-child {
  border-top: 1px solid var(--line);
}

a.foy-list-row {
  text-decoration: none;
  color: var(--ink);
}

.foy-list-row--danger,
.foy-list-row--danger .foy-list-row-text {
  color: var(--danger);
}

.foy-list-row:hover {
  background: rgba(34, 28, 21, 0.03);
}

.foy-list-row-text {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.4;
}

.foy-list-row-meta {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
}

/* ─── Chips / badges ───────────────────────────────────────────────────── */
.foy-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--brass-text);
  background: rgba(174, 124, 44, 0.1);
  border: 1px solid rgba(174, 124, 44, 0.3);
  border-radius: var(--r-pill);
  padding: 2px 10px;
  white-space: nowrap;
}

.foy-chip--muted {
  color: var(--muted);
  background: rgba(138, 127, 110, 0.08);
  border-color: var(--line);
}

.foy-chip--danger {
  color: var(--danger);
  background: rgba(176, 65, 62, 0.08);
  border-color: rgba(176, 65, 62, 0.25);
}

/* Sibling chip within a flow line gets a small left margin */
.foy-list-row-text .foy-chip {
  margin-left: var(--sp-2);
}

/* ─── Empty-state invitation ───────────────────────────────────────────── */
.foy-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
}

.foy-empty-icon {
  width: 56px;
  height: 56px;
  border: 1px solid var(--frame);
  border-radius: var(--r-md);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.foy-empty-title {
  font-family: var(--font-brand);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
}

.foy-empty-body {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 280px;
}

/* ─── Page padding helper ──────────────────────────────────────────────── */
.foy-body {
  padding: 0 var(--sp-4);
}

/* ─── Utility ──────────────────────────────────────────────────────────── */
.foy-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: var(--sp-4) 0;
}

/* small muted chevron/affordance icon */
.foy-chev {
  color: var(--muted);
  flex-shrink: 0;
}

/* ─── Login page ───────────────────────────────────────────────────────── */
/* Centred column on the oat wall; no header or nav (logged-out state)      */
.foy-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: var(--sp-8) var(--sp-6);
}

/* The logo at login / signup (ops/brand/build_logo.py) */
.foy-login-wordmark {
  line-height: 0;
  text-align: center;
}
.foy-login-wordmark img { height: 58px; width: auto; display: inline-block; }

/* Warm sub-line beneath the wordmark */
.foy-login-tagline {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  text-align: center;
  margin-top: var(--sp-2);
}

/* Framed welcome print on the login page */
.foy-login-hero {
  width: 100%;
  max-width: 340px;
  margin: var(--sp-8) 0;
}

/* The paper inside the frame — inline composed welcome treatment */
.foy-login-welcome {
  background: var(--paper);
  border: var(--frame-inner-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8) var(--sp-6);
  gap: var(--sp-3);
  min-height: 160px;
}

.foy-login-welcome-head {
  font-family: var(--font-brand);
  font-size: 36px;
  font-weight: 500;
  font-style: italic;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.foy-login-welcome-rule {
  width: 40px;
  height: 1px;
  background: var(--frame);
}

.foy-login-welcome-sub {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
}

/* Password form column */
.foy-login-form {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* Label for the password field */
.foy-login-label {
  display: block;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  margin-bottom: var(--sp-2);
}

/* Full-width password field (override flex:1 default) */
.foy-login-form .foy-field {
  flex: none;
  width: 100%;
}

/* Error message — danger colour, accessible */
.foy-login-error {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--danger);
  line-height: 1.4;
}

/* ─── Signup / claim-landing / welcome (public, login-page family) ─────── */

/* "New to Foyer? Create your account" line under a form */
.foy-login-alt {
  margin-top: var(--sp-5);
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.foy-login-alt a {
  color: var(--brass-text);
  text-decoration: none;
  font-weight: 500;
}
.foy-login-alt a:hover { text-decoration: underline; }


/* Intro paragraph on the signup/landing pages */
.foy-login-intro {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
  max-width: 340px;
  margin-bottom: var(--sp-2);
}
/* straight under the logo (sign-up pages): the space its old rule used to hold */
.foy-login-wordmark + .foy-login-intro,
.foy-login-wordmark + .foy-welcome-note { margin-top: var(--sp-6); }

/* Field wrapper: label + input, in the stacked form */
.foy-field-group { display: flex; flex-direction: column; }
.foy-field-hint {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--muted);
  margin-top: var(--sp-2);
}
/* Per-field error highlight */
.foy-field.is-error { border-color: var(--danger); }

/* Two-path button stack on the claim landing */
.foy-login-actions {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

/* Guided welcome: the "all set" card */
.foy-welcome-note {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  text-align: center;
  max-width: 360px;
  margin-bottom: var(--sp-2);
}
.foy-welcome-sub {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
  max-width: 360px;
}
.foy-code-pill {
  display: inline-block;
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.18em;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 2px 10px;
}

/* ─── Control-page sub-header ──────────────────────────────────────────── */
/* Used on device_settings.html: back-chevron + screen name + gear          */
.foy-ctrl-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--line);
}

.foy-ctrl-back {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  transition: color 0.12s ease;
}

.foy-ctrl-back:hover {
  color: var(--brass-text);
}

.foy-ctrl-back svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

.foy-ctrl-title {
  flex: 1;
  font-family: var(--font-brand);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.foy-ctrl-gear {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  flex-shrink: 0;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.foy-ctrl-gear:hover {
  color: var(--ink);
  border-color: var(--frame);
}

.foy-ctrl-gear svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

/* ─── Control-page frame area (full bleed, with padding) ───────────────── */
.foy-ctrl-frame {
  padding: var(--sp-4) var(--sp-4) 0;
}

/* Status line beneath the frame on control page */
.foy-ctrl-status {
  padding: 0 var(--sp-4) var(--sp-4);
}

/* Screen-settings disclosure row */
.foy-ctrl-settings {
  margin: var(--sp-4) 0 var(--sp-8);
}

/* Settings fields within the disclosure */
.foy-ctrl-field-row {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
}

.foy-ctrl-field-label {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  display: block;
  margin-bottom: var(--sp-1);
}

.foy-ctrl-input {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.12s ease;
}

.foy-ctrl-input:focus {
  border-color: var(--brass);
  outline: none;
}

/* Primary action zone */
.foy-ctrl-action {
  padding: var(--sp-4) var(--sp-4) var(--sp-6);
}

/* Hint text under editors */
.foy-ctrl-hint {
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  padding: var(--sp-3) var(--sp-4);
}

/* Preset panel */
.foy-ctrl-panel {
  padding: var(--sp-3) var(--sp-4);
}

/* Settings save button row */
.foy-ctrl-settings-save {
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
}

/* Collapsed "fine-tune" controls — occasional-use knobs, closed by default.
   Native <details>/<summary>; the marker is replaced with a brass chevron
   that rotates open via the [open] attribute selector (no JS needed).      */
.foy-collapse {
  border-top: 1px solid var(--line);
}

.foy-collapse > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-4) var(--sp-2);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
}

.foy-collapse > summary::-webkit-details-marker {
  display: none;
}

.foy-collapse > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--brass);
  border-bottom: 1.5px solid var(--brass);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.foy-collapse[open] > summary::after {
  transform: rotate(-135deg);
}

.foy-collapse-body {
  padding: 0 var(--sp-4) var(--sp-3) var(--sp-5);
}

/* Device page: preview + status on the left, editor stack on the right.
   Single column by default (mobile flow order is set in the template);
   from 1000px the two halves sit side by side with the preview pinned
   in view while the right column scrolls. */
@media (min-width: 1000px) {
  .foy-device-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
    gap: 28px;
    align-items: start;
  }
  .foy-device-grid > :first-child {
    position: sticky;
    top: 24px;
  }

  /* Form-heavy pages: cap the content column so text inputs stay a readable
     line length instead of stretching across the whole framed panel. No
     effect below this breakpoint — mobile flow is untouched. */
  .foy-readable {
    max-width: 820px;
  }
}

/* ─── Desktop layout ───────────────────────────────────────────────────── */
/* Mobile is a focused card. From 900px up we hang that content as a matted
   print on the oat wall: the bottom tab bar becomes a quiet sidebar sitting on
   the bare wall, and the content floats inside a picture-framed paper panel.
   This is the brand's "reflective wall art" — deliberately not a flat coloured
   admin shell with a boxed-in sidebar.                                         */

/* Wordmark in the sidebar — hidden on the mobile bottom bar. The `a.` prefix
   out-specifies the generic `.foy-nav a` rule so it isn't shown as a tab. */
.foy-nav a.foy-nav-brand { display: none; }

@media (min-width: 900px) {
  /* ── Sidebar: labels beside the framed piece, on the bare wall ─────────── */
  .foy-nav {
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    left: 0;
    top: 0;
    bottom: 0;
    transform: none;
    width: 246px;
    max-width: none;
    height: 100dvh;
    background: transparent;      /* the wall shows through; no boxed panel */
    border-top: none;
    border-right: none;           /* the floating paper panel provides separation */
    padding: 34px 22px;
    gap: 2px;
  }

  /* The logo as a centred masthead; its own broken underline is the only rule. */
  .foy-nav a.foy-nav-brand {
    display: block;
    position: relative;
    font-family: var(--font-brand);
    font-size: 31px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.01em;
    text-transform: none;
    text-align: center;
    color: var(--ink);
    background: none;
    padding: 2px 12px 18px;
    margin-bottom: 14px;
  }
  .foy-nav a.foy-nav-brand:hover { color: var(--ink); background: none; }
  .foy-nav a.foy-nav-brand img { height: 36px; width: auto; display: block; margin: 0 auto; }

  /* Nav items: quiet by default, brass when current — marked with a diamond
     rather than a filled pill (that boxed highlight is the generic-admin tell) */
  .foy-nav > a,
  .foy-nav > span[aria-disabled] {
    flex-direction: row;
    justify-content: flex-start;
    gap: 13px;
    position: relative;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--ink);
    padding: 11px 12px 11px 30px;   /* left room reserved for the diamond marker */
    border-radius: 0;
    transition: color 0.15s ease;
  }
  .foy-nav span[aria-disabled] { color: var(--muted); }
  .foy-nav a svg,
  .foy-nav span[aria-disabled] svg { width: 19px; height: 19px; }
  .foy-nav a:hover { color: var(--brass-text); background: none; }
  .foy-nav a.active { color: var(--brass-text); background: none; }
  .foy-nav a.active::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    background: var(--brass);
    transform: rotate(45deg);
  }

  /* ── Content: a matted print hung on the wall ──────────────────────────── */
  .foy-shell {
    max-width: 900px;
    margin: 28px 28px 28px max(276px, calc((100vw - 900px) / 2));
    min-height: calc(100dvh - 56px);
    background: var(--paper);
    border: 1px solid var(--frame);
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(34, 28, 21, 0.06);   /* a resting panel, not a floating one */
    padding: 0 20px 40px;
  }

  /* Header: sidebar carries the wordmark, so the panel's top strip shows the
     active site/account as context, with the site switcher opposite. */
  .foy-header {
    padding-top: 26px;
    padding-bottom: 18px;
  }
  .foy-header .foy-brand > span:first-child { display: none; }
  .foy-header .foy-prop {
    font-size: 12px;
    letter-spacing: 0.14em;
  }

  /* Empty-state invitation: centre it in the tall board so the paper reads as
     intentional matting, not an unfinished page. */
  .foy-empty {
    min-height: calc(100dvh - 260px);
    justify-content: center;
  }
}

/* Wider desktops: let the framed print grow a little. */
@media (min-width: 1280px) {
  .foy-shell {
    max-width: 940px;
    margin-left: max(276px, calc((100vw - 940px) / 2));
  }
}

/* ─── Locked (free-plan) UI ─────────────────────────────────────────────
   Visible-but-locked treatment for paid-only features. A section is
   dimmed + made inert with .foy-locked; the explanation of *why* always
   sits OUTSIDE that wrapper via .foy-lock-note (see admin/_lock.html) —
   dimming the sentence that explains the dimming would defeat the point. */
.foy-locked {
  opacity: .5;
  pointer-events: none;
  user-select: none;
}

.foy-lock-note {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  padding: var(--sp-3) var(--sp-4);
  margin: 0;
}

.foy-lock-note svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  flex-shrink: 0;
}

/* Inert nav item (free-plan Bookings): same position/shape as a real nav
   link, never active, no href. */
.foy-nav [aria-disabled="true"] {
  cursor: default;
  opacity: .5;
}
.foy-nav [aria-disabled="true"]:hover { color: var(--muted); }

/* Disabled tab (free-plan Auto tab, seg-options): dim + inert, small lock
   glyph ahead of the label. */
.foy-tab[disabled],
.foy-seg-opt[disabled] {
  opacity: .5;
  cursor: default;
  pointer-events: none;
}

.foy-tab-lock {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  vertical-align: -1px;
  margin-right: 4px;
}

/* ─── Skip link + heading reset ────────────────────────────────────────── */
.foy-skip {
  position: absolute; left: 12px; top: -200px; z-index: 1000;
  background: var(--ink); color: var(--paper);
  padding: 10px 14px; border-radius: var(--r-sm);
  font: 600 14px var(--font-ui); text-decoration: none;
}
.foy-skip:focus { top: 12px; }
h1.foy-title, h1.foy-ctrl-title { font-weight: 500; margin-bottom: 0; }
h1.foy-ctrl-title { margin-top: 0; }
main:focus { outline: none; }

/* ─── Sidebar guide + foot (desktop); hidden on the phone tab bar ─────── */
.foy-nav-guide, .foy-nav-foot { display: none; }
.foy-nav-locked { color: var(--muted); position: relative; }
/* Phone: the "Paid" pill rides the locked tab's top-right corner so the lock
   signal survives without growing the 64px bar. */
.foy-nav-paid {
  position: absolute; top: 2px; right: 0; line-height: 1.2;
  font: 600 12px var(--font-ui); letter-spacing: 0; text-transform: none;
  color: var(--brass-text); background: var(--wall);
  border: 1px solid var(--frame); border-radius: var(--r-pill); padding: 0 5px;
}

@media (min-width: 900px) {
  .foy-header { display: none; }                         /* the foot carries site + account */
  .foy-nav > a:not(.foy-nav-brand) svg,
  .foy-nav > span[aria-disabled].foy-nav-locked svg { display: none; }
  .foy-nav > a:not(.foy-nav-brand),
  .foy-nav > span[aria-disabled].foy-nav-locked {
    font: 500 21px/1.1 var(--font-brand); letter-spacing: 0; text-transform: none;
    padding: 9px 12px 9px 30px;
  }
  /* the Paid pill + guide sentence already say why it's locked; muted ink is
     enough, and the phone's 50% dim would sink both below AA here */
  .foy-nav > span[aria-disabled].foy-nav-locked { opacity: 1; color: var(--muted); }
  .foy-nav a.active { color: var(--brass-text); }
  .foy-nav-paid {
    position: static; display: inline-block; margin-left: 8px; font: 500 12px var(--font-ui);
    color: var(--brass-text); border: 1px solid var(--frame); border-radius: var(--r-pill); padding: 1px 8px;
  }
  .foy-nav-guide {
    display: flex; flex-direction: column; gap: 14px;
    margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--frame);
    /* many properties: the guide scrolls, so the foot never leaves the screen */
    flex: 0 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 4px; scrollbar-width: thin;
  }
  .foy-nav a.foy-guide-link:focus-visible { outline-offset: -2px; } /* not clipped by the scroller */
  .foy-nav a.foy-guide-link {
    display: block; padding: 0 12px 0 30px; font: inherit; letter-spacing: 0; text-transform: none;
    color: var(--ink); text-decoration: none;
  }
  .foy-guide-name { display: block; font: 500 15px/1.3 var(--font-ui); color: var(--ink); }
  .foy-guide-status { display: block; font: 400 13px/1.35 var(--font-ui); color: var(--muted); margin-top: 1px; }
  .foy-guide-status--bad { color: var(--danger); }
  .foy-nav-locknote { margin: 0 12px 0 30px; font: 400 13px/1.45 var(--font-ui); color: var(--muted); }
  .foy-nav-foot {
    display: block; margin-top: auto; padding: 20px 12px 0 30px; border-top: 1px solid var(--frame);
  }
  .foy-nav-site { display: block; font: 500 20px/1.15 var(--font-brand); color: var(--ink); }
  .foy-nav-foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin-top: 4px; }
  .foy-nav-foot-sep { font: 400 13px var(--font-ui); color: var(--muted); }
  /* plain underlined text links: undo the header's pill (sites) / avatar
     circle (account) and the tab bar's flex box (sign out) */
  .foy-nav-foot-links summary, .foy-nav a.foy-nav-signout {
    display: inline-block; width: auto; height: auto; min-height: 24px; padding: 4px 0;
    border: 0; border-radius: 0; background: none; cursor: pointer;
    font: 400 13px/16px var(--font-ui); letter-spacing: 0; text-transform: none;
    color: var(--ink); text-decoration: underline; text-decoration-color: var(--frame); text-underline-offset: 3px;
  }
  .foy-nav-foot-links summary:hover, .foy-nav a.foy-nav-signout:hover { color: var(--brass-text); }
  .foy-nav-foot .foy-sites-caret { display: none; }
  /* the foot sits at the bottom: menus open upward */
  .foy-nav-foot .foy-sites, .foy-nav-foot .foy-acct-menu { position: relative; }
  .foy-nav-foot .foy-sites-menu, .foy-nav-foot .foy-acct-panel { bottom: calc(100% + 6px); top: auto; left: 0; right: auto; }
  /* the account panel is wider than the foot column: hang it from the
     sidebar's left padding so it stays inside the 246px sidebar */
  .foy-nav-foot .foy-acct-panel { left: -30px; width: 216px; min-width: 0; }
  /* the generic sidebar hover (brass, no background) must not recolour the
     panel's danger-toned Sign out */
  .foy-nav-foot a.foy-acct-signout:hover { color: var(--danger); background: var(--ink-wash); }
}

/* --- Screens dashboard: summary, property sections, screen rows --------- */
.foy-summary { padding: 0 var(--sp-4) var(--sp-4); font: 500 15px/1.4 var(--font-ui); color: var(--ink); }
.foy-summary-sep, .foy-ready-sep { color: var(--muted); margin: 0 2px; }
.foy-summary-alert { color: var(--danger); }
.foy-propsec { border-top: 1px solid var(--line); padding: var(--sp-4) var(--sp-4) var(--sp-2); }
.foy-propsec-name { font: 500 24px/1.15 var(--font-brand); color: var(--ink); }
.foy-ready { margin-top: var(--sp-1); font: 500 15px/1.45 var(--font-ui); color: var(--ink);
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.foy-ready-quiet { color: var(--muted); font-weight: 400; }
.foy-ready .foy-dot, .foy-row .foy-dot { width: 9px; height: 9px; }

.foy-row { display: grid; grid-template-columns: 1fr; gap: var(--sp-3);
  margin: var(--sp-2) 0 var(--sp-3); padding: var(--sp-3) var(--sp-3) var(--sp-3) calc(var(--sp-3) + 3px);
  border-radius: var(--r-md); color: inherit; text-decoration: none; }
.foy-row:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.foy-row--bad { background: rgba(176, 65, 62, 0.05); box-shadow: inset 3px 0 0 var(--danger); }
.foy-row-print { background: var(--paper); border: 1px solid var(--frame); padding: 10px; box-shadow: var(--frame-shadow); }
.foy-row-shot { position: relative; background: var(--wall); }
.foy-row-shot-note { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center;
  font: 400 13px/1.4 var(--font-ui); color: var(--muted); }
.foy-row-print img { position: relative; display: block; width: 100%; height: auto; border: var(--frame-inner-border); }
.foy-row-label { order: -1; display: flex; flex-direction: column; }
.foy-row-name { font: 500 24px/1.1 var(--font-brand); color: var(--ink); }
.foy-row-status { display: flex; align-items: center; gap: var(--sp-2); margin-top: 6px;
  font: 600 15px/1.3 var(--font-label); letter-spacing: 0.02em; color: var(--ink); }
.foy-row-status--bad { color: var(--danger); }
.foy-row-status--warn { color: var(--brass-text); }
.foy-row-meta { margin-top: 3px; font: 400 14px/1.45 var(--font-ui); color: var(--muted); }
.foy-row-meta b { font-weight: 500; color: var(--ink); }
.foy-row-warn { color: var(--brass-text); font-weight: 600; }
.foy-row-action { margin-top: var(--sp-2); font: 600 14px/1.3 var(--font-ui); color: var(--danger); }

.foy-empty--first { text-align: center; align-items: center; }
.foy-empty-frame { width: 220px; aspect-ratio: 4 / 3; background: var(--paper); border: 1px solid var(--frame);
  padding: 10px; box-shadow: var(--frame-shadow); margin: 0 auto 26px; }
.foy-empty-frame span { display: flex; height: 100%; align-items: center; justify-content: center;
  border: 1px dashed var(--frame); font: italic 500 17px var(--font-brand); color: var(--muted); padding: 0 14px; }
.foy-steps { list-style: none; counter-reset: step; margin: 16px auto 24px; padding: 0; max-width: 380px; text-align: left; }
.foy-steps li { counter-increment: step; position: relative; padding-left: 34px; margin: 10px 0;
  font: 400 15px/1.45 var(--font-ui); color: var(--muted); }
.foy-steps li b { color: var(--ink); font-weight: 600; }
.foy-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 22px; height: 22px;
  border: 1px solid var(--brass); border-radius: 50%; text-align: center;
  font: 500 15px/20px var(--font-brand); color: var(--brass-text); }

@media (min-width: 900px) {
  .foy-row { grid-template-columns: minmax(0, 280px) 1fr; gap: var(--sp-6); align-items: center; }
  .foy-row-label { order: 0; }
  .foy-row-name { font-size: 26px; }
}

/* ─── Screen page (admin/device_settings.html) ─────────────────────────────
   Opens on what the frame shows now: the framed preview, one status line and
   the three ways to change it, all above the fold on a 390x844 phone. Below:
   the Automatic list (paid) or one invitation (free). From 1000px the two
   halves sit side by side. */
.foy-sp { display: grid; gap: var(--sp-8); padding: var(--sp-4) var(--sp-4) var(--sp-8); }
.foy-sp-frame { margin: 0; }
.foy-sp-frame.is-portrait { max-width: 260px; margin-inline: auto; }

.foy-sp-status { margin-top: var(--sp-3); }
.foy-sp-line { display: flex; align-items: baseline; gap: 9px;
  font: 500 15px/1.45 var(--font-ui); color: var(--ink); text-wrap: pretty; }
.foy-sp-line .foy-dot { width: 8px; height: 8px; flex: none; transform: translateY(-1px); }
.foy-sp-alert, .foy-sp-meta { padding-left: 17px; margin-top: 2px; font: 400 14px/1.5 var(--font-ui); }
.foy-sp-alert { color: var(--danger); }
.foy-sp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; color: var(--muted); }
.foy-sp-low { color: var(--brass-text); font-weight: 600; }
.foy-sp-resume { display: inline; }

/* a quiet text action (underlined, brass ink) */
.foy-textbtn { background: none; border: 0; padding: 0; min-height: 24px; cursor: pointer;
  font: 500 14px/1.45 var(--font-ui); color: var(--brass-text);
  text-decoration: underline; text-decoration-color: var(--frame); text-underline-offset: 3px; }
.foy-textbtn:hover { text-decoration-color: currentColor; }

/* the three ways to change it: a hairline-gap grid, drawn icons, Garamond names */
.foy-sp-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  margin-top: var(--sp-4); background: var(--line); border: 1px solid var(--line); }
.foy-sp-actions a { display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 7px; min-height: 86px; padding: 16px 6px 12px; text-wrap: balance; background: var(--wall); color: var(--ink);
  text-align: center; text-decoration: none; font: 500 18px/1.1 var(--font-brand);
  transition: background-color 0.12s ease, color 0.12s ease; }
.foy-sp-actions a:hover { background: var(--paper); color: var(--brass-text); }
.foy-sp-actions a:focus-visible { outline-offset: -3px; border-radius: 0; }
.foy-sp-actions svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; }

/* small framed messages (Automatic rows, presets, the invitation) */
.foy-mini-mount { display: block; background: var(--paper); border: 1px solid var(--frame); padding: 4px;
  box-shadow: 0 4px 12px rgba(34, 28, 21, 0.10); }
.foy-mini-mount.is-muted { opacity: 0.55; }
.foy-mini { width: 100%; }
.foy-mini-img { display: block; width: 100%; object-fit: cover; }
.foy-mini-blank { display: block; aspect-ratio: 4 / 3; background: var(--panel-paper); }
/* The live HTML previews (editor, minis) draw the frame's white as the same
   paper white as the exact PNG previews, so the two match. message.css keeps
   #fff for the panel render itself; this only applies inside the admin. */
.foy-shell .msg-panel, .foy-shell .msg-panel .msg { background: var(--panel-paper); }

/* Automatic */
.foy-auto-title, .foy-invite-title { font: 500 26px/1.1 var(--font-brand); color: var(--ink); text-wrap: balance; }
.foy-auto-lede { margin-top: 6px; max-width: 46ch; font: 400 15px/1.5 var(--font-ui); color: var(--muted); }
.foy-auto-list { list-style: none; margin-top: var(--sp-4); border-top: 1px solid var(--line); }
.foy-auto-row { position: relative; display: grid; grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.foy-auto-text { display: block; min-width: 0; }
.foy-auto-name { display: block; font: 500 20px/1.15 var(--font-brand); color: var(--ink); }
.foy-auto-sum { display: block; margin-top: 2px; font: 400 14px/1.4 var(--font-ui); color: var(--muted); }
.foy-auto-sum b { font-weight: 600; color: var(--brass-text); }
/* the moment on the frame now carries the brand's diamond */
.foy-auto-row.is-now .foy-auto-name::before { content: ""; display: inline-block; width: 7px; height: 7px;
  margin: 0 9px 0 1px; vertical-align: 0.18em; background: var(--brass); transform: rotate(45deg); }
.foy-auto-edit { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px;
  font: 500 15px/1 var(--font-ui); color: var(--brass-text);
  text-decoration: underline; text-decoration-color: var(--frame); text-underline-offset: 3px; }
.foy-auto-edit::after { content: ""; position: absolute; inset: 0; }   /* the whole row opens it */
.foy-auto-row:hover .foy-auto-name { color: var(--brass-text); }
.foy-auto-edit:focus-visible { outline: none; }
.foy-auto-edit:focus-visible::after { outline: 2px solid var(--brass); outline-offset: 2px; }
.foy-auto-sched { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.foy-auto-sched:hover .foy-auto-name { color: var(--brass-text); }
.foy-auto-sched svg, .foy-gear-help svg { width: 16px; height: 16px; flex: none; fill: none;
  stroke: var(--muted); stroke-width: 1.75; }

/* the free plan's one invitation */
.foy-invite { border: 1px solid var(--frame); padding: 22px 18px 20px; }
.foy-invite-body { margin-top: 8px; max-width: 46ch; font: 400 15px/1.55 var(--font-ui); color: var(--ink); }
.foy-invite-strip { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin: 18px 0; }
.foy-invite-strip li { display: flex; flex-direction: column; gap: 7px; text-align: center;
  font: 400 12px/1.3 var(--font-ui); color: var(--muted); }
.foy-invite-how { font: 400 15px/1.5 var(--font-ui); color: var(--ink); }
.foy-paid-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); margin-top: var(--sp-5); }
.foy-paid-back { font: 500 15px/1.4 var(--font-ui); color: var(--ink); text-decoration: underline;
  text-decoration-color: var(--frame); text-underline-offset: 3px; }
.foy-invite-how a, .foy-pic-note a, .foy-pic-empty a { color: var(--brass-text); text-decoration-color: var(--frame);
  text-underline-offset: 3px; }

@media (min-width: 1000px) {
  .foy-sp { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: 32px; align-items: start;
    padding-top: var(--sp-6); }
  .foy-sp-now { position: sticky; top: 24px; }
  .foy-sp-actions a { background: var(--paper); }
  .foy-sp-actions a:hover { background: var(--ink-wash); }
}

/* ─── The gear: a slide-in panel (a bottom sheet on a phone) ─────────────── */
.foy-gear { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; border: 0;
  width: min(420px, 100vw); height: 100dvh; max-width: none; max-height: none;
  background: var(--paper); color: var(--ink); border-left: 1px solid var(--frame);
  box-shadow: -10px 0 26px rgba(34, 28, 21, 0.13); overscroll-behavior: contain; }
.foy-gear[open] { animation: foy-gear-in 0.22s ease-out; }
.foy-gear::backdrop { background: rgba(34, 28, 21, 0.30); }
@keyframes foy-gear-in { from { transform: translateX(28px); opacity: 0; } }
.foy-gear-inner { display: flex; flex-direction: column; gap: 22px; min-height: 100%;
  padding: 18px 24px calc(24px + env(safe-area-inset-bottom)); }
.foy-gear-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.foy-gear-head h2 { font: 500 26px/1.1 var(--font-brand); }
.foy-gear-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  margin-right: -10px; background: none; border: 0; border-radius: var(--r-pill); color: var(--muted); cursor: pointer; }
.foy-gear-close:hover { color: var(--ink); background: var(--ink-wash); }
.foy-gear-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.foy-gear-form { display: flex; flex-direction: column; gap: 22px; }
.foy-sp-field { display: flex; flex-direction: column; gap: 6px; }
.foy-sp-field > span, .foy-orient legend { font: 600 14px/1.3 var(--font-ui); color: var(--ink); }
.foy-gear .foy-ctrl-input { min-height: 44px; font-size: 16px; }   /* 16px: no iOS focus zoom */
.foy-orient { border: 0; }
.foy-gear-hint { margin: 2px 0 4px; font: 400 14px/1.4 var(--font-ui); color: var(--muted); }
.foy-orient-opt { display: flex; align-items: center; gap: 12px; min-height: 54px; margin-top: 8px;
  padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer;
  font: 400 15px/1.3 var(--font-ui); }
.foy-orient-opt:hover { border-color: var(--frame); }
.foy-orient-opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.foy-orient-opt:has(input:focus-visible) { outline: 2px solid var(--brass); outline-offset: 2px; }
.foy-orient-opt input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); flex: none; }
.foy-orient-opt svg { width: 32px; height: 32px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; }
.foy-gear-help { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none; }
.foy-gear-help b { display: block; font: 500 19px/1.2 var(--font-brand); }
.foy-gear-help small { display: block; margin-top: 2px; font: 400 13px/1.4 var(--font-ui); color: var(--muted); }
.foy-gear-help:hover b { color: var(--brass-text); }
.foy-gear-model { margin-top: auto; font: 400 13px/1.4 var(--font-ui); color: var(--muted); }

@media (max-width: 619px) {
  .foy-gear { inset: auto 0 0 0; width: 100%; height: auto; max-height: 92dvh;
    border-left: 0; border-top: 1px solid var(--frame); border-radius: 12px 12px 0 0;
    box-shadow: 0 -10px 26px rgba(34, 28, 21, 0.13); }
  .foy-gear[open] { animation-name: foy-gear-up; }
  .foy-gear-inner { min-height: 0; }
  .foy-gear-model { margin-top: 0; }
}
@keyframes foy-gear-up { from { transform: translateY(32px); opacity: 0; } }

/* ─── The editing sheet (?edit=…): the whole screen, Send / Cancel on top ── */
body:has(.foy-sheet) .foy-nav,
body:has(.foy-sheet) .foy-header { display: none; }
body:has(.foy-sheet) .foy-shell { padding-bottom: var(--sp-6); }
.foy-sheet { --sheet-bar: 64px; padding: 0 var(--sp-4) var(--sp-8); }
.foy-sheet-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; height: var(--sheet-bar);
  margin: 0 calc(-1 * var(--sp-4)); padding: 0 var(--sp-4);
  background: var(--wall); border-bottom: 1px solid var(--line); }
.foy-sheet-cancel { display: inline-flex; align-items: center; min-height: 44px; padding-right: 8px;
  font: 500 15px/1 var(--font-ui); color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--frame); text-underline-offset: 3px; }
.foy-sheet-cancel:hover { color: var(--brass-text); }
.foy-sheet-bar .foy-btn:disabled { opacity: 0.4; cursor: default; }
.foy-sheet-head { padding: 20px 0 18px; }
.foy-sheet-title { font: 500 30px/1.1 var(--font-brand); color: var(--ink); }
.foy-sheet-sub { margin-top: 4px; max-width: 52ch; font: 400 15px/1.5 var(--font-ui); color: var(--muted); }
.foy-sheet-duration { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 14px;
  font: 600 14px/1.3 var(--font-ui); color: var(--ink); }
.foy-sheet-duration select { width: auto; min-height: 44px; font-size: 16px; }
.foy-sheet-empty { font: 400 15px/1.5 var(--font-ui); color: var(--ink); max-width: 46ch; }
@media (min-width: 600px) { .foy-sheet .fe-bar { top: var(--sheet-bar); } }
@media (min-width: 900px) {
  body:has(.foy-sheet) .foy-shell { margin-left: auto; margin-right: auto; max-width: 980px; }
  .foy-sheet-bar { background: var(--paper); margin: 0 -20px; padding: 0 24px; }
}

/* picture sheet: three tabs named in Garamond on a hairline, the shared
   upload below them, and mounted pictures with a small wall label */
.foy-pic-kind { margin-bottom: var(--sp-5); }
.foy-pic-kind .foy-seg-opt { min-height: 44px; padding: 0 var(--sp-4); }
.foy-pic-tabs { display: flex; gap: 26px; margin-bottom: var(--sp-4); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none; }
.foy-pic-tabs::-webkit-scrollbar { display: none; }
.foy-pic-tab { flex: none; min-height: 44px; margin-bottom: -1px; padding: 8px 0 9px; background: none; border: 0;
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
  font: 500 20px/1.1 var(--font-brand); color: var(--muted); transition: color 0.12s ease; }
.foy-pic-tab:hover { color: var(--brass-text); }
.foy-pic-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.foy-pic-tab:focus-visible { outline-offset: -2px; }
@media (max-width: 420px) {
  .foy-pic-tabs { gap: 18px; }
  .foy-pic-tab { font-size: 18px; }
}
.foy-pic-filter { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 4px 12px; margin-bottom: var(--sp-3); }
.foy-pic-h { font: 500 20px/1.2 var(--font-brand); color: var(--ink); }
.foy-pic-note { margin: var(--sp-2) 0 var(--sp-3); font: 400 14px/1.5 var(--font-ui); color: var(--muted); }
.foy-pic-empty { max-width: 46ch; padding: var(--sp-2) 0; font: 400 15px/1.5 var(--font-ui); color: var(--ink); }
.foy-pic-empty .foy-textbtn { font-size: 15px; }
.foy-pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-3); }
.foy-pic { display: flex; align-items: center; justify-content: center; width: 100%; height: 112px; padding: 6px;
  background: var(--paper); border: 1px solid var(--frame); cursor: pointer; }
.foy-pic img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.foy-pic:hover { border-color: var(--brass); }
.foy-pic[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }

/* Foyer collection: kind-of-place chips, then each picture with its wall label */
.foy-pic-cats { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.foy-pic-cat { min-height: 44px; padding: 0 16px; background: transparent; border: 1px solid var(--line);
  border-radius: var(--r-pill); cursor: pointer; white-space: nowrap;
  font: 600 12px/1 var(--font-label); letter-spacing: 0.01em; text-transform: none; color: var(--muted); }
.foy-pic-cat:hover { border-color: var(--brass); color: var(--brass-text); }
.foy-pic-cat[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (max-width: 599px) {   /* one row that scrolls sideways, inside the gutter */
  .foy-pic-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin: 0 calc(-1 * var(--sp-4)) var(--sp-4); padding: 0 var(--sp-4); }
  .foy-pic-cats::-webkit-scrollbar { display: none; }
  .foy-pic-cat { flex: none; }
}
.foy-pic-group { display: contents; }   /* the radios' group; its tiles sit in the parent grid */
.foy-pic-cell { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.foy-pic-label { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.foy-pic-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 500 16px/1.2 var(--font-brand); color: var(--ink); }
.foy-pic-credit { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 400 12px/1.4 var(--font-ui); color: var(--muted); text-decoration: none; }
.foy-pic-credit:hover { color: var(--brass-text); text-decoration: underline; text-underline-offset: 2px; }
/* "n more ... on the paid plan": an empty mount on the wall, not a lock */
.foy-pic.foy-pic-more { padding: 12px 16px; background: transparent; border-color: var(--line); text-align: center;
  text-wrap: balance; font: italic 500 16px/1.25 var(--font-brand); color: var(--muted); }
.foy-pic.foy-pic-more:hover, .foy-pic.foy-pic-more[aria-expanded="true"] { border-color: var(--frame); color: var(--brass-text); }
.foy-pic-plan { max-width: 54ch; margin: var(--sp-3) 0 0; font: 400 14px/1.5 var(--font-ui); color: var(--muted); }
.foy-pic-plan a { color: var(--brass-text); text-decoration-color: var(--frame); text-underline-offset: 3px; }

.foy-pic-upload { margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
.foy-pic-upload .foy-pic-h { margin-bottom: var(--sp-3); }
.foy-pic-upload input[type="file"] { width: 100%; min-height: 44px; font-size: 15px; }
.foy-pic-cycle { display: flex; flex-direction: column; gap: var(--sp-4); max-width: 360px; }
.foy-pic-kind + .foy-pic-cycle { margin-bottom: var(--sp-5); }
/* free: "Change automatically" is there to open, but quieter than an option
   that's yours: lighter weight, and when chosen an ink outline, not a fill */
.foy-pic-kind.is-quiet .foy-seg-opt + .foy-seg-opt { font-weight: 500; color: var(--muted); }
.foy-pic-kind.is-quiet .foy-seg-opt + .foy-seg-opt:hover { color: var(--brass-text); }
.foy-pic-kind.is-quiet .foy-seg-opt + .foy-seg-opt.active { background: var(--paper); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink); }
.foy-pic-cycle .foy-pic-note, .foy-pic-cycle .foy-pic-plan { margin: 0; }

/* multi-select (the screen's set): ticked pictures carry their place as a
   small ink numeral; "Show first" sits on the mount's lower edge */
.foy-pic-slot { position: relative; }
.foy-pic[role="checkbox"] { position: relative; }
.foy-pic-badge { position: absolute; top: 5px; left: 5px; min-width: 26px; height: 26px; padding: 0 7px;
  background: var(--ink); color: var(--paper); border-radius: 2px; text-align: center;
  font: 500 18px/26px var(--font-brand); font-feature-settings: "lnum" 1; pointer-events: none; }
.foy-pic[aria-disabled="true"] { cursor: default; opacity: .45; }
.foy-pic[aria-disabled="true"]:hover { border-color: var(--frame); }
.foy-pic-first { position: absolute; right: 6px; bottom: 6px; min-height: 28px; padding: 0 10px;
  background: var(--paper); border: 1px solid var(--frame); border-radius: var(--r-sm); cursor: pointer;
  font: 600 12px/1 var(--font-label); letter-spacing: 0.01em; text-transform: none; color: var(--ink); }
.foy-pic-first::before { content: ""; position: absolute; inset: -8px -6px; }   /* a 44px tap target */
.foy-pic-first:hover { border-color: var(--brass); color: var(--brass-text); }
@media (hover: hover) {   /* with a pointer, it waits for the tile to be pointed at or focused */
  .foy-pic-slot:not(:hover):not(:focus-within) .foy-pic-first { opacity: 0; }
}
.foy-pic-set { margin-top: var(--sp-4); }
.foy-pic-hint { margin: 0; font: 400 14px/1.5 var(--font-ui); color: var(--muted); }
.foy-pic-cap { display: flex; align-items: baseline; gap: 10px; margin: var(--sp-2) 0 0;
  font: 500 14px/1.5 var(--font-ui); color: var(--ink); }
.foy-pic-cap::before { content: ""; flex: none; width: 7px; height: 7px; background: var(--brass);
  transform: translateY(-1px) rotate(45deg); }

/* screen page: the set under the preview */
.foy-sp-set { padding-left: 17px; margin-top: 2px; font: 400 14px/1.5 var(--font-ui); }
.foy-sp-set a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line);
  text-underline-offset: 3px; }
.foy-sp-set a:hover { color: var(--brass-text); text-decoration-color: currentColor; }
/* the library page: where a copied picture came from */
.foy-lib-credit { margin-bottom: var(--sp-2); font: 400 12px/1.4 var(--font-ui); color: var(--muted); }
.foy-lib-credit a { color: var(--muted); text-decoration-color: var(--line); text-underline-offset: 2px; }
.foy-lib-credit a:hover { color: var(--brass-text); }

/* preset sheet */
.foy-presets { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-5) var(--sp-4); }
.foy-preset { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; }
.foy-preset-name { font: 500 19px/1.2 var(--font-brand); color: var(--ink); }
.foy-preset:hover .foy-preset-name { color: var(--brass-text); }
.foy-preset:hover .foy-mini-mount { border-color: var(--brass); }
.foy-presets-manage { margin-top: var(--sp-6); }

/* "Keep as a preset", under the message sheet's editor */
.foy-keep { max-width: 640px; margin-top: var(--sp-5); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.foy-keep summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer;
  font: 500 15px/1.3 var(--font-ui); color: var(--brass-text);
  text-decoration: underline; text-decoration-color: var(--frame); text-underline-offset: 3px; }
.foy-keep summary:hover { text-decoration-color: currentColor; }
.foy-keep-hint { margin: 2px 0 12px; font: 400 14px/1.5 var(--font-ui); color: var(--muted); }
.foy-keep-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.foy-keep-row .foy-sp-field { flex: 1 1 220px; }
.foy-keep .foy-ctrl-input, .foy-pe-name .foy-ctrl-input { min-height: 44px; font-size: 16px; }
.foy-keep-btn, .foy-pl .foy-btn { text-transform: none; letter-spacing: 0.01em; font: 600 15px/1.2 var(--font-ui); }
.foy-keep-btn:disabled { opacity: 0.4; cursor: default; }

/* the preset editor's name field */
.foy-pe-name { max-width: 360px; margin-top: 16px; }

/* the Presets page: the same framed cards, each with Edit / Delete */
.foy-pl { padding: var(--sp-4) var(--sp-4) var(--sp-8); }
.foy-pl-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-3) var(--sp-5); margin-bottom: var(--sp-6); }
.foy-pl-lede { max-width: 52ch; font: 400 15px/1.5 var(--font-ui); color: var(--muted); }
.foy-pl-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--sp-6) var(--sp-5); }
.foy-pl-card { display: flex; flex-direction: column; gap: 6px; }
.foy-pl-actions { display: flex; align-items: center; gap: 18px; }
.foy-pl-actions form { display: inline; }
.foy-pl-actions .foy-textbtn { min-height: 44px; display: inline-flex; align-items: center; }
.foy-pl-actions .foy-pl-delete { color: var(--danger); text-decoration-color: var(--danger-border); }
@media (max-width: 420px) { .foy-pl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5) var(--sp-3); } }

/* ─── Editing an Automatic moment (a sheet, like the screen page's editors) ── */
.foy-am-note { margin-top: 10px; max-width: 52ch; padding-left: 12px; border-left: 2px solid var(--brass);
  font: 400 14px/1.5 var(--font-ui); color: var(--ink); }
.foy-am-choices { border: 0; margin: 0 0 var(--sp-5); max-width: 640px; }
.foy-am-legend { margin-bottom: 2px; font: 600 14px/1.3 var(--font-ui); color: var(--ink); }
.foy-am-choice, .foy-am-check { max-width: 640px; display: flex; align-items: flex-start; gap: 12px; min-height: 54px;
  margin-top: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer; background: var(--paper); }
.foy-am-choice:hover, .foy-am-check:hover { border-color: var(--frame); }
.foy-am-choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.foy-am-choice:has(input:focus-visible), .foy-am-check:has(input:focus-visible) {
  outline: 2px solid var(--brass); outline-offset: 2px; }
.foy-am-choice input, .foy-am-check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none;
  accent-color: var(--ink); }
.foy-am-choice b, .foy-am-check b { display: block; font: 500 19px/1.2 var(--font-brand); color: var(--ink); }
.foy-am-choice small, .foy-am-check small { display: block; margin-top: 2px;
  font: 400 14px/1.4 var(--font-ui); color: var(--muted); }
.foy-am-part { margin-top: var(--sp-4); }
.foy-am-h { margin: 0 0 var(--sp-3); font: 500 22px/1.2 var(--font-brand); color: var(--ink); }
.foy-am-from { margin-bottom: var(--sp-3); font: 400 14px/1.5 var(--font-ui); color: var(--muted); }
.foy-am-start { margin-bottom: var(--sp-3); font: 400 15px/1.5 var(--font-ui); }
.foy-am-start summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer;
  color: var(--brass-text); text-decoration: underline; text-decoration-color: var(--frame);
  text-underline-offset: 3px; }
.foy-am-start ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.foy-am-start a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--paper);
  color: var(--ink); text-decoration: none; }
.foy-am-start a:hover { border-color: var(--brass); color: var(--brass-text); }
.foy-am-returning { margin-top: var(--sp-6); max-width: none; padding-top: var(--sp-5); border-top: 1px solid var(--line); }
.foy-am-returning .foy-am-part { margin-top: var(--sp-5); }
.foy-am-keeps { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 18px;
  align-items: center; max-width: 640px; }
.foy-am-keeps p { font: 400 15px/1.55 var(--font-ui); color: var(--ink); }
.foy-am-keeps a { color: var(--brass-text); text-decoration-color: var(--frame); text-underline-offset: 3px; }
@media (max-width: 520px) { .foy-am-keeps { grid-template-columns: 1fr; } .foy-am-keeps .foy-mini-mount { max-width: 260px; } }
.foy-am-earlier { margin: 0 0 var(--sp-5); }

/* ─── The Property page: a few plain settings, sentence-case, phone first ── */
.foy-pp { padding: 0 var(--sp-4) var(--sp-8); }
.foy-pp-prop + .foy-pp-prop { margin-top: var(--sp-8); padding-top: var(--sp-6); border-top: 1px solid var(--frame); }
.foy-pp-name { margin-top: var(--sp-5); font: 500 30px/1.1 var(--font-brand); color: var(--ink); }
.foy-pp-form { display: flex; flex-direction: column; }
.foy-pp-group { display: flex; flex-direction: column; gap: 18px; max-width: 640px; min-width: 0;
  margin: 0; padding: var(--sp-5) 0 var(--sp-6); border: 0; border-bottom: 1px solid var(--line); }
.foy-pp-h { padding: 0; font: 500 24px/1.15 var(--font-brand); color: var(--ink); }
fieldset.foy-pp-group > legend.foy-pp-h { float: left; width: 100%; margin-bottom: 0; }
fieldset.foy-pp-group > legend.foy-pp-h + * { clear: both; }
.foy-pp-hint { display: block; max-width: 56ch; font: 400 14px/1.5 var(--font-ui); color: var(--muted); }
.foy-pp-hint a { color: var(--brass-text); text-decoration-color: var(--frame); text-underline-offset: 3px; }
.foy-pp-note { margin-top: -6px; }
.foy-pp .foy-ctrl-input { min-height: 44px; font-size: 16px; }   /* 16px: no iOS focus zoom */
.foy-pp-time { max-width: 240px; }
.foy-pp-share { gap: 0; }
.foy-pp-share > .foy-pp-hint { margin: 4px 0 4px; }
.foy-pp-save { padding: var(--sp-5) 0 var(--sp-2); }
.foy-pp-save .foy-btn { min-height: 48px; padding: 0 var(--sp-6); }
.foy-pp-logo-mount { display: inline-flex; align-self: flex-start; align-items: center; justify-content: center;
  min-width: 160px; max-width: 100%; padding: 14px 18px; background: var(--panel-paper); border: 1px solid var(--frame);
  box-shadow: 0 4px 12px rgba(34, 28, 21, 0.10); }
.foy-pp-logo-mount img { display: block; max-width: 100%; max-height: 80px; width: auto; }
.foy-pp-upload { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.foy-pp-upload .foy-sp-field { flex: 1 1 240px; min-width: 0; }
.foy-pp-upload input[type="file"] { width: 100%; min-height: 44px; font: 400 15px/1.4 var(--font-ui); }
.foy-pp-upload .foy-btn { min-height: 44px; }
.foy-pp-remove { min-height: 44px; color: var(--danger); }
.foy-pp-copyrow { display: flex; gap: 8px; min-width: 0; }
.foy-pp-copyrow .foy-ctrl-input { flex: 1; min-width: 0; font-family: var(--font-ui); text-overflow: ellipsis; }
.foy-pp-copy { flex: none; min-height: 44px; min-width: 76px; padding: 0 16px; cursor: pointer;
  background: var(--paper); border: 1px solid var(--frame); border-radius: var(--r-sm);
  font: 500 15px/1 var(--font-ui); color: var(--ink); }
.foy-pp-copy:hover { border-color: var(--ink); }
.foy-am-everyone { margin-top: var(--sp-5); }

/* ─── Help & troubleshooting (per screen) ────────────────────────────────── */
.foy-help { max-width: 620px; padding: var(--sp-5) var(--sp-4) var(--sp-6); }
.foy-help-for { font: 400 15px/1.5 var(--font-ui); color: var(--muted); margin-bottom: var(--sp-4); }
.foy-help-item { padding: var(--sp-5) 0; border-top: 1px solid var(--line); }
.foy-help-item h2 { font: 500 24px/1.15 var(--font-brand); }
.foy-help-item p { margin: 8px 0 18px; max-width: 52ch; font: 400 15px/1.55 var(--font-ui); color: var(--ink); }
.foy-help .foy-btn-ghost { text-transform: none; letter-spacing: 0.01em; font: 600 15px/1.2 var(--font-ui); }
.foy-btn-ghost.foy-btn-ghost--danger { color: var(--danger); border-color: var(--danger-border); }
.foy-btn-ghost.foy-btn-ghost--danger:hover { border-color: var(--danger); color: var(--danger); }

/* ─── Schedules (a screen's list, and the schedule sheet) ───────────────── */
.foy-sch-list { padding-top: var(--sp-2); padding-bottom: var(--sp-8); max-width: 720px; }
.foy-sch-row { row-gap: 0; }
.foy-sch-row .foy-mini-mount, .foy-sch-row .foy-auto-edit { grid-row: span 2; }
.foy-sch-row.is-off .foy-auto-name { color: var(--muted); }
.foy-sch-toggle { position: relative; z-index: 1; grid-column: 2; justify-self: start; }
.foy-sch-toggle .foy-textbtn { min-height: 40px; font: 500 14px/1 var(--font-ui); color: var(--muted); }
.foy-sch-toggle .foy-textbtn:hover { color: var(--brass-text); }
.foy-sch-add { margin-top: var(--sp-5); }
.foy-sch-empty { margin-top: var(--sp-5); padding: var(--sp-6) 0; border-top: 1px solid var(--line); }
.foy-sch-empty p { margin-bottom: var(--sp-4); font: 400 15px/1.5 var(--font-ui); color: var(--ink); }
.foy-sch-error { max-width: 640px; margin: 0 0 var(--sp-4); padding: 10px 14px; border-left: 2px solid var(--danger);
  background: var(--paper); font: 500 15px/1.45 var(--font-ui); color: var(--danger); }
.foy-sch-label { max-width: 640px; margin-bottom: var(--sp-5); }
.foy-sp-field > span small { font-weight: 400; color: var(--muted); }
.foy-sch-when { max-width: 640px; margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
.foy-sch-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.foy-sch-pair .foy-ctrl-input, .foy-sch-order .foy-ctrl-input { min-height: 44px; font-size: 16px; }
.foy-sch-order { margin-top: var(--sp-4); max-width: 140px; }
.foy-sch-hint { margin: 0 0 4px; font: 400 14px/1.45 var(--font-ui); color: var(--muted); }
.foy-sch-when .foy-am-check { margin-top: 12px; }
.foy-sch-delete { max-width: 640px; margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.foy-sch-delete .foy-textbtn { min-height: 44px; font: 500 15px/1 var(--font-ui); color: var(--danger);
  text-decoration-color: var(--danger-border); }

/* Name-the-screen prompt (welcome + claim success) */
.foy-name-prompt { margin-top: var(--sp-6); }
.foy-name-skip { align-self: center; text-transform: none; letter-spacing: 0.01em; font: 600 14px/1.2 var(--font-ui); }
.foy-name-prompt .foy-login-label { text-transform: none; letter-spacing: 0.01em; font: 600 16px/1.3 var(--font-ui); color: var(--ink); }


/* Sentence case: the redesigned screen pages (body.foy-sentence, set by the
   templates of Tasks 7 to 14) use sentence-case labels and buttons, set in the
   UI face, instead of the uppercase Jost label style DESIGN.md gives the rest
   of the admin. Scoped to <main>, so the nav and header keep their look, and
   wrapped in :where() so it only replaces the base rules: a page's own
   contextual rule (e.g. .foy-name-prompt .foy-login-label) still wins.
   Buttons are in a second block straight after the base .foy-btn rules. */
:where(.foy-sentence main) .foy-seg-opt {
  text-transform: none; letter-spacing: 0.01em; font: 600 14px/1.2 var(--font-ui);
}
:where(.foy-sentence main) .foy-ctrl-field-label,
:where(.foy-sentence main) .foy-eyebrow,
:where(.foy-sentence main) .foy-sec,
:where(.foy-sentence main) .foy-login-label {
  text-transform: none; letter-spacing: 0; font: 600 14px/1.3 var(--font-ui);
}
:where(.foy-sentence main) .foy-lock-note {
  text-transform: none; letter-spacing: 0; font: 500 14px/1.45 var(--font-ui);
}
:where(.foy-sentence main) input[type="file"]::file-selector-button {
  text-transform: none; letter-spacing: 0.01em; font: 600 14px/1.2 var(--font-ui);
}
/* end sentence case */

/* ─── Image library (2026-11): add by the heading, pictures shown whole, a small menu ── */
.foy-lib { padding-top: var(--sp-4); padding-bottom: var(--sp-8); }
.foy-lib-add { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-5); }
.foy-lib-add-btn { position: relative; cursor: pointer; }
.foy-lib-add-btn:focus-within { outline: 2px solid var(--brass); outline-offset: 2px; }
.foy-lib-file { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.foy-lib-add.is-auto .foy-lib-send { display: none; }
.foy-lib-add.is-sending .foy-lib-add-btn { opacity: .6; pointer-events: none; }
.foy-lib-hint { flex-basis: 100%; margin: 0; font: 400 14px/1.45 var(--font-ui); color: var(--muted); }
.foy-lib-err, .foy-lib-alert { flex-basis: 100%; margin: 0; font: 500 14px/1.45 var(--font-ui); color: var(--danger); overflow-wrap: anywhere; }
.foy-lib-alert { margin-bottom: var(--sp-4); }
.foy-lib-grid { list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--sp-5) var(--sp-4); align-items: start; }
.foy-lib-item img { display: block; width: 100%; height: auto; background: var(--wall); }
.foy-lib-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); margin-top: var(--sp-2); }
.foy-lib-name { margin: 0; font: 500 15px/1.35 var(--font-ui); color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
.foy-lib-item .foy-lib-credit { margin: 2px 0 0; }
.foy-lib-menu { position: relative; flex: none; }
.foy-lib-menu > summary { list-style: none; display: grid; place-items: center; width: 36px; height: 36px; margin: -6px -8px 0 0;
  border-radius: 50%; cursor: pointer; color: var(--muted); }
.foy-lib-menu > summary::-webkit-details-marker { display: none; }
.foy-lib-menu > summary:hover, .foy-lib-menu[open] > summary { background: var(--wall); color: var(--ink); }
.foy-lib-menu > summary:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
.foy-lib-menu svg { width: 20px; height: 20px; fill: currentColor; }
.foy-lib-pop { position: absolute; right: -8px; top: 34px; z-index: 5; width: min(260px, 80vw); padding: var(--sp-3);
  background: var(--paper); border: 1px solid var(--frame); border-radius: 8px; box-shadow: var(--frame-shadow);
  display: grid; gap: var(--sp-3); }
.foy-lib-rename { display: grid; grid-template-columns: 1fr auto; gap: 6px var(--sp-2); align-items: center; }
.foy-lib-rename label { grid-column: 1 / -1; font: 600 14px/1.3 var(--font-ui); color: var(--ink); }
.foy-lib-rename .foy-field { min-width: 0; }
.foy-lib-delete { background: none; border: 0; padding: 6px 0; cursor: pointer; font: 600 14px/1.3 var(--font-ui); color: var(--danger); }
@media (max-width: 520px) { .foy-lib-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-4) var(--sp-3); } }
.foy-more-note { margin: -4px 0 var(--sp-2); padding: 0 var(--sp-4); font: 400 14px/1.45 var(--font-ui); color: var(--muted); }
.foy-lib .foy-sec { padding-left: 0; padding-right: 0; margin: 0; }
@media (max-width: 520px) {
  /* phone: the picture menu opens as a sheet above the bottom bar, so it never runs off-screen */
  .foy-lib-pop { position: fixed; left: 16px; right: 16px; top: auto; width: auto;
    bottom: calc(64px + env(safe-area-inset-bottom) + 12px); z-index: 60; }
}
