/* ==========================================================================
   Rome's Joy back office: styles
   Same family palette as the sites (cream, espresso, orange) but laid out as a
   tool: one column of forms, big touch targets, calm surfaces. Text pairs
   checked for WCAG AA: espresso on cream 15.9:1 · ink-soft on cream 5.6:1 ·
   orange-ink on cream 5.3:1 · espresso on orange 5.8:1 · danger on paper 6.6:1
   ========================================================================== */

:root {
  --cream: #FFF4E8;
  --cream-2: #FBE6D1;
  --paper: #FFFAF4;
  --peach: #F9AE7F;
  --peach-soft: #FDDCC5;
  --orange: #E8742A;
  --orange-ink: #A84A16;
  --espresso: #2A160C;
  --espresso-2: #3A2015;
  --butter: #FCD36A;
  --butter-soft: #FEEDBE;
  --ink-soft: #6E5444;
  --line: rgba(42, 22, 12, 0.16);
  --line-strong: rgba(42, 22, 12, 0.32);
  --danger: #A3261A;           /* red ink for delete / errors (6.6:1 on paper) */
  --danger-soft: #FBE1DC;
  --ok: #2E6B3A;               /* green ink for "open now" / saved (6.4:1 on paper) */
  --ok-soft: #DDEFDF;

  --f-sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
  --radius-sm: 9px;
  --gutter: 16px;
  --header-h: 60px;
  --sidenav-w: 236px;
  --bottomnav-h: 64px;
  --tap: 44px;                 /* minimum touch target */
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --shadow: 0 10px 30px -22px rgba(42, 22, 12, .55);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--espresso);
  font-family: var(--f-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
a { color: var(--orange-ink); }
address { font-style: normal; }
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 3px solid var(--orange-ink);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 12px; top: -100px;
  z-index: 1000;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--espresso);
  color: var(--cream);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.noscript {
  margin: 24px var(--gutter);
  padding: 16px;
  border-radius: var(--radius);
  background: var(--butter-soft);
}

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

/* ==========================================================================
   1. App frame: header, side nav (desktop), bottom nav (phone), main
   ========================================================================== */
.app {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}
.app.has-nav { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px)); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--header-h);
  padding: 8px var(--gutter);
  background: var(--espresso);
  color: var(--cream);
}
.topbar :focus-visible { outline-color: var(--butter); }
.brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
  text-decoration: none;
  color: inherit;
}
.brand__name { font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; }
.brand__sub { font-size: 0.78rem; color: var(--peach); white-space: nowrap; }

.switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}
.switcher__label { font-size: 0.82rem; color: var(--peach); white-space: nowrap; }
.switcher select {
  min-height: var(--tap);
  max-width: min(52vw, 320px);
  padding: 0 36px 0 12px;
  border: 1.5px solid rgba(255, 244, 232, .35);
  border-radius: var(--radius-sm);
  background: var(--espresso-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FFF4E8'%3E%3Cpath d='m12 15-5-5 1.4-1.4L12 12.2l3.6-3.6L17 10z'/%3E%3C/svg%3E") no-repeat right 8px center / 22px;
  color: var(--cream);
  font-weight: 700;
  text-overflow: ellipsis;
  appearance: none;
  -webkit-appearance: none;
}
.topbar__user {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--cream);
  text-decoration: none;
  font-size: 0.92rem;
  cursor: pointer;
}
.topbar__user:hover { background: var(--espresso-2); }

.frame { display: grid; grid-template-columns: 1fr; }

/* Side nav: desktop only */
.sidenav {
  display: none;
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
}
.sidenav__list { display: grid; gap: 2px; }
.sidenav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  color: var(--espresso);
  font-weight: 600;
  text-decoration: none;
}
.sidenav__link:hover { background: var(--cream-2); }
.sidenav__link.is-active { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.sidenav__link.is-active::before {
  content: '';
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 4px;
  border-radius: 4px;
  background: var(--orange);
}
.sidenav__link .icon { color: var(--orange-ink); }
.sidenav__group {
  margin: 18px 14px 6px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.count {
  margin-left: auto;
  min-width: 1.6em;
  padding: 0 0.45em;
  border-radius: 999px;
  background: var(--orange);
  color: var(--espresso);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.6em;
  text-align: center;
}

/* Bottom nav: phone only */
.bottomnav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: var(--bottomnav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--paper);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -20px rgba(42, 22, 12, .6);
}
.bottomnav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--bottomnav-h);
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.bottomnav__item .icon { width: 24px; height: 24px; }
.bottomnav__item { position: relative; }
.bottomnav__item .count { position: absolute; top: 6px; left: calc(50% + 4px); margin: 0; }
.bottomnav__item.is-active { color: var(--orange-ink); }
.bottomnav__item:focus-visible { outline-offset: -3px; }

/* The "More" sheet on phones lists every screen */
.sheet {
  width: min(100vw, 480px);
  max-width: 100vw;
  max-height: 85vh;
  margin: auto 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 18px 18px 0 0;
  background: var(--paper);
  color: var(--espresso);
}
@media (min-width: 480px) { .sheet { margin: auto; border-radius: 18px; } }
.sheet::backdrop { background: rgba(42, 22, 12, .45); }
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 6px 20px;
}
.sheet__title { font-size: 1.05rem; font-weight: 700; }
.sheet .sidenav__list { padding: 6px 10px 16px; }
.sheet .sidenav__link { min-height: 50px; }

/* Main area */
.main {
  width: 100%;
  max-width: 940px;
  padding: 20px var(--gutter) 48px;
  margin-inline: auto;
}
.main:focus, .page-head h1:focus { outline: none; }
.loading { color: var(--ink-soft); }

@media (min-width: 900px) {
  :root { --gutter: 32px; }
  .app.has-nav { padding-bottom: 0; }
  .app.has-nav .frame { grid-template-columns: var(--sidenav-w) 1fr; }
  .app.has-nav .sidenav { display: block; }
  .bottomnav { display: none; }
  .topbar__user { display: inline-flex; }
  .switcher { margin-left: 24px; }
  .switcher select { max-width: 320px; }
  .main { padding-top: 28px; }
}

/* ==========================================================================
   2. Page scaffolding: headings, cards, lists, chips, empty states, banners
   ========================================================================== */
.page-head { margin-bottom: 20px; }
.page-head__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
}
.page-head h1 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.01em; }
.page-head__lead { max-width: 60ch; margin-top: 6px; color: var(--ink-soft); }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
h2.section-title { margin: 28px 0 10px; font-size: 1.2rem; }
h2.section-title:first-child { margin-top: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.88rem; }

.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.card + .card { margin-top: 14px; }
.card__title { font-size: 1.05rem; margin-bottom: 10px; }
.card__meta { color: var(--ink-soft); font-size: 0.9rem; }

.stats { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 108px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.stat__label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.stat__value { font-size: 1.35rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.stat__value--big { font-size: 2.2rem; }
.stat__note { color: var(--ink-soft); font-size: 0.9rem; }
.stat__link { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 8px; font-weight: 700; align-self: flex-start; }
.stat--open .stat__value { color: var(--ok); }
.stat--closed .stat__value { color: var(--ink-soft); }
.stat--wide { grid-column: 1 / -1; }

.list { display: grid; gap: 10px; }
.list__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.list__row.is-unread { border-color: var(--orange); box-shadow: inset 4px 0 0 var(--orange); }
.list__main { flex: 1 1 240px; min-width: 0; }
.list__title { font-weight: 700; overflow-wrap: anywhere; }
.list__meta { color: var(--ink-soft); font-size: 0.9rem; overflow-wrap: anywhere; }
.list__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.list__row > button.list__open {
  flex: 1 1 240px;
  min-width: 0;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  min-height: 24px;
  padding: 0 0.7em;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip--current { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.chip--upcoming { background: var(--butter-soft); border-color: var(--butter); }
.chip--past { background: var(--cream-2); color: var(--ink-soft); }
.chip--draft { background: transparent; color: var(--ink-soft); border-style: dashed; }
.chip--new { background: var(--orange); border-color: var(--orange); }
.chip--tv { background: var(--peach-soft); border-color: var(--peach); }
.chip--family { background: var(--cream-2); }
.chip--tag {
  min-height: 26px;
  padding: 0 0.6em;
  border-color: var(--espresso);
  background: var(--paper);
  font-size: 0.72rem;
  text-transform: none;
}
.chip--off { background: var(--cream-2); color: var(--ink-soft); border-style: dashed; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.star {
  display: inline-flex;
  color: var(--orange-ink);
  vertical-align: middle;
}
.star .icon { width: 1.1em; height: 1.1em; }

.empty {
  padding: 28px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--ink-soft);
}
.empty__title { font-weight: 700; color: var(--espresso); margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--butter-soft);
  border: 1px solid var(--butter);
}
.banner--error { background: var(--danger-soft); border-color: var(--danger); }
.banner--info { background: var(--cream-2); border-color: var(--line); }
.banner p + p { margin-top: 4px; }
.banner .btn { margin-left: auto; }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 999px;
  background: var(--cream-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab {
  flex: 1 0 auto;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}
.tab[aria-selected="true"] { background: var(--paper); color: var(--espresso); box-shadow: 0 1px 2px rgba(42, 22, 12, .12); }
.tab:focus-visible { outline-offset: -3px; }
.tab__count { margin-left: 0.4em; font-weight: 500; color: var(--ink-soft); }

/* ==========================================================================
   3. Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: var(--tap);
  padding: 0.55em 1.2em;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--espresso);
  color: var(--cream);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, opacity .2s;
  white-space: nowrap;
}
.btn:hover { background: var(--espresso-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn.is-loading:disabled { opacity: 1; }
.btn--primary { background: var(--orange); border-color: var(--orange); color: var(--espresso); }
.btn--primary:hover { background: var(--espresso); border-color: var(--espresso); color: var(--cream); }
.btn--secondary { background: transparent; border-color: var(--espresso); color: var(--espresso); }
.btn--secondary:hover { background: var(--cream-2); }
.btn--danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--quiet {
  background: transparent;
  color: var(--orange-ink);
  border-color: transparent;
  padding-inline: 0.7em;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn--quiet:hover { background: var(--cream-2); }
.btn--sm { min-height: 38px; padding: 0.4em 0.9em; font-size: 0.9rem; }
.btn--icon { padding: 0; width: var(--tap); }
.btn--icon.btn--sm { width: 38px; }
.btn--icon .icon { width: 22px; height: 22px; }
.btn--block { width: 100%; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2.5px solid currentColor;
  border-color: var(--cream) var(--cream) transparent transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn--primary.is-loading::after,
.btn--secondary.is-loading::after,
.btn--danger.is-loading::after,
.btn--quiet.is-loading::after { border-color: var(--espresso) var(--espresso) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-saved { background: var(--ok); border-color: var(--ok); color: #fff; }
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.actions--sticky {
  position: sticky;
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  margin: 18px calc(-1 * var(--gutter)) 0;
  padding: 12px var(--gutter);
  background: rgba(255, 244, 232, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) { .actions--sticky { bottom: 0; margin-inline: 0; padding-inline: 0; } }
.actions__spacer { flex: 1; }

/* ==========================================================================
   4. Forms
   ========================================================================== */
.form { display: grid; gap: 16px; }
.form__row { display: grid; gap: 16px; }
@media (min-width: 600px) {
  .form__row--2 { grid-template-columns: 1fr 1fr; }
  .form__row--3 { grid-template-columns: 1fr 1fr 1fr; }
}
.field { display: grid; gap: 6px; min-width: 0; align-content: start; } /* side by side with a taller field, stay at the top */
.field__label { font-weight: 700; }
.field__label .req { color: var(--orange-ink); font-weight: 400; margin-left: 0.3em; }
.field__hint { color: var(--ink-soft); font-size: 0.88rem; }
.field__error { color: var(--danger); font-size: 0.9rem; font-weight: 700; }
.field__error:empty { display: none; }
.input, .select, .textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--espresso);
  font-size: 1rem;           /* 16px+ so iOS does not zoom */
}
.textarea { min-height: 110px; line-height: 1.5; resize: vertical; }
.select {
  padding-right: 40px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232A160C'%3E%3Cpath d='m12 15-5-5 1.4-1.4L12 12.2l3.6-3.6L17 10z'/%3E%3C/svg%3E") no-repeat right 10px center / 22px;
  appearance: none;
  -webkit-appearance: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--orange-ink); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled, .select:disabled { background: var(--cream-2); color: var(--ink-soft); }
input[type="time"].input, input[type="date"].input { min-width: 0; }
.input--inline { width: auto; }

/* Checkbox / toggle rows (44px tall, whole row is the label) */
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  cursor: pointer;
  font-weight: 600;
}
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--orange-ink); cursor: pointer; }
.check__hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.88rem; }
.check-grid { display: grid; gap: 4px 20px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  cursor: pointer;
  font-weight: 600;
}
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  position: relative;
  flex: none;
  width: 48px; height: 28px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background-color .2s;
}
.switch__track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .2s var(--ease-out);
}
.switch input:checked + .switch__track { background: var(--orange-ink); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--orange-ink); outline-offset: 2px; }

.form-error { color: var(--danger); font-weight: 700; }
.form-error:empty { display: none; }

/* Sign-in / bootstrap */
.auth {
  max-width: 440px;
  margin: 6vh auto 0;
}
.auth__brand { margin-bottom: 20px; }
.auth__brand h1 { font-size: 1.7rem; letter-spacing: -0.01em; }
.auth__brand p { color: var(--ink-soft); margin-top: 4px; }
.auth .card { padding: 24px; }

/* ==========================================================================
   5. Screen-specific pieces
   ========================================================================== */
/* Hours: one row per weekday */
.hours { display: grid; gap: 8px; }
.hours__row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: 'day switch' 'times times';
  gap: 8px 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.hours__row.is-today { border-color: var(--orange); }
.hours__day { grid-area: day; font-weight: 700; }
.hours__day small { display: block; font-weight: 400; color: var(--orange-ink); font-size: 0.8rem; }
.hours__switch { grid-area: switch; justify-self: end; }
.hours__times { grid-area: times; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.hours__times.is-closed { display: none; }
.hours__dash { color: var(--ink-soft); }
.hours__closed-text { grid-area: times; color: var(--ink-soft); }
@media (min-width: 640px) {
  .hours__row { grid-template-columns: 130px auto 1fr; grid-template-areas: 'day switch times'; }
  .hours__switch { justify-self: start; }
  .hours__times { max-width: 360px; }
}

/* Notice preview: how the banner looks on the site */
.notice-preview {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--espresso);
  color: var(--cream);
  font-size: 0.92rem;
}
.notice-preview .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--butter); flex: none; }
.notice-preview.is-empty { background: var(--cream-2); color: var(--ink-soft); }

/* Events */
.event-card { display: grid; gap: 6px; }
.event-card__top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.event-card__title { font-size: 1.05rem; font-weight: 700; }
.event-card__meta { color: var(--ink-soft); font-size: 0.92rem; }

/* Menu */
.menu-section {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.menu-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 6px 10px 6px 0;
}
.menu-section__toggle {
  display: flex;
  flex: 1 1 200px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 10px 8px 16px;
  border: 0;
  background: none;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius);
}
.menu-section__toggle::before {
  content: '';
  flex: none;
  width: 10px; height: 10px;
  margin-right: 2px;
  border-right: 2.5px solid var(--orange-ink);
  border-bottom: 2.5px solid var(--orange-ink);
  transform: rotate(-45deg) translateY(-1px);
  transition: transform .2s var(--ease-out);
}
.menu-section__toggle[aria-expanded="true"]::before { transform: rotate(45deg) translateY(-3px); }
.menu-section__toggle:focus-visible { outline-offset: -3px; }
.menu-section__title { overflow-wrap: anywhere; }
.menu-section__count { color: var(--ink-soft); font-weight: 400; font-size: 0.9rem; }
.menu-section__tools { display: flex; gap: 4px; margin-left: auto; padding-left: 10px; }
.menu-section__body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.menu-section__edit { padding: 14px 0; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.menu-item {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.menu-item:last-of-type { border-bottom: 0; }
.menu-item__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.menu-item__name { font-weight: 700; }
.menu-item__price { margin-left: auto; font-weight: 700; white-space: nowrap; }
.menu-item__desc { color: var(--ink-soft); font-size: 0.92rem; }
.menu-item__tools { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.menu-item.is-unavailable .menu-item__name,
.menu-item.is-unavailable .menu-item__price { color: var(--ink-soft); text-decoration: line-through; }
.menu-item__form { padding: 12px 0 4px; }
.sizes { display: grid; gap: 8px; }
.sizes__row { display: grid; grid-template-columns: 1fr 110px auto; gap: 8px; align-items: center; }
.price-mode { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* Inquiries */
.inquiry { display: grid; gap: 14px; }
.inquiry__fields { display: grid; gap: 10px; }
.inquiry__fields > div { display: grid; gap: 2px; }
.inquiry__fields dt { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.inquiry__fields dd { overflow-wrap: anywhere; white-space: pre-wrap; }
@media (min-width: 600px) { .inquiry__fields { grid-template-columns: 1fr 1fr; } .inquiry__fields > .is-wide { grid-column: 1 / -1; } }

/* History */
.history__row { align-items: flex-start; }
.history__who { font-size: 0.88rem; color: var(--ink-soft); }
.history__action { font-weight: 700; }

/* Users */
.role-list { display: grid; gap: 4px; margin: 0 0 16px; padding-left: 1.2em; color: var(--ink-soft); font-size: 0.92rem; }
.role-list strong { color: var(--espresso); }

/* Overview hours table */
.today-hours { display: grid; gap: 2px; font-size: 0.95rem; }
.today-hours div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.today-hours .is-today { font-weight: 700; color: var(--orange-ink); }

/* ==========================================================================
   6. Toasts and dialogs
   ========================================================================== */
.toasts {
  position: fixed;
  left: 50%;
  top: calc(var(--header-h) + 10px);
  z-index: 100;
  display: grid;
  gap: 8px;
  width: min(92vw, 420px);
  transform: translateX(-50%);
  pointer-events: none;
}
@media (min-width: 900px) { .toasts { left: auto; right: 20px; transform: none; } }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--espresso);
  color: var(--cream);
  font-weight: 600;
  box-shadow: 0 14px 30px -14px rgba(42, 22, 12, .7);
  animation: toast-in .25s var(--ease-out);
}
.toast--error { background: var(--danger); color: #fff; }
.toast .icon { color: var(--butter); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.dialog {
  width: min(92vw, 440px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--espresso);
  box-shadow: 0 30px 60px -30px rgba(42, 22, 12, .7);
}
.dialog::backdrop { background: rgba(42, 22, 12, .45); }
.dialog__body { padding: 22px 22px 6px; }
.dialog__title { font-size: 1.15rem; margin-bottom: 8px; }
.dialog__text { color: var(--ink-soft); }
.dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 22px 22px; }

/* ==========================================================================
   7. Artworks (Blanc's catalog) and photo uploads
   Status colours: text and borders reuse the checked pairs above (ok, danger,
   ink-soft, espresso on butter); the dots repeat the words, so they are extra.
   ========================================================================== */
.btn--compact { padding-inline: 0.85em; font-size: 0.94rem; }   /* still 44px tall */

/* A toast with an Undo button can be clicked (plain toasts let taps through) */
.toast--action { pointer-events: auto; padding-block: 6px; padding-right: 8px; }
.toast__action {
  flex: none;
  min-height: var(--tap);
  margin-left: auto;
  padding: 0 16px;
  border: 2px solid var(--butter);
  border-radius: 999px;
  background: transparent;
  color: var(--butter);
  font-weight: 700;
  cursor: pointer;
}
.toast__action:hover { background: var(--butter); color: var(--espresso); }
.toast__action:focus-visible { outline-color: var(--butter); }

/* File picker: a real (visually hidden) file input behind a button-shaped label, so phones offer camera and library */
.file-pick { position: relative; display: inline-flex; }
.file-pick__input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.file-pick__input:focus-visible + .file-pick__btn { outline: 3px solid var(--orange-ink); outline-offset: 2px; }
.file-pick__input:disabled + .file-pick__btn { opacity: .55; cursor: not-allowed; pointer-events: none; }
.file-pick__btn { cursor: pointer; }

/* Single photo fields (events, announcements) */
.photo-preview {
  width: 160px;
  max-height: 160px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream-2);
}
.field__hint.is-error { color: var(--danger); font-weight: 700; }

/* List: filters, summary, cards */
.art-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 12px;
  margin-bottom: 12px;
}
.art-filters__search { grid-column: 1 / -1; }
.art-filters .field__label { font-size: 0.9rem; }
@media (min-width: 760px) {
  .art-filters { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, 1fr); }
  .art-filters__search { grid-column: auto; }
}
.art-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 12px; color: var(--ink-soft); font-weight: 600; }
.art-summary:focus { outline: none; }

.art-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
.art-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  grid-template-areas: 'thumb body' 'tools tools';
  gap: 12px;
  height: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.art-card.is-draft { border-style: dashed; border-color: var(--line-strong); }
.art-card__thumb {
  grid-area: thumb;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--cream-2);
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}
.art-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.art-card__nophoto { display: grid; justify-items: center; gap: 4px; padding: 6px; }
.art-card__nophoto .icon { width: 26px; height: 26px; }
.art-card__body { grid-area: body; display: grid; gap: 5px; align-content: start; min-width: 0; }
.art-card__title { display: flex; align-items: flex-start; gap: 6px; font-size: 1.04rem; line-height: 1.3; }
.art-card__title a { color: var(--espresso); text-decoration: none; overflow-wrap: anywhere; }
.art-card__title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.art-card__title .star { margin-top: 2px; }
.art-card__artist { font-size: 0.94rem; overflow-wrap: anywhere; }
.art-card__price { font-weight: 700; font-size: 0.94rem; }
.art-card__meta { color: var(--ink-soft); font-size: 0.88rem; overflow-wrap: anywhere; }
.art-card__tools {
  grid-area: tools;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.art-card__move { display: flex; gap: 6px; margin-left: auto; }
@media (min-width: 640px) {
  .art-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .art-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas: 'thumb' 'body' 'tools';
  }
  .art-card__thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; }
  .art-card__thumb img { object-fit: contain; }
}

.art-status__dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.art-status--available { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.art-status--reserved { background: var(--butter-soft); border-color: #A66A00; color: var(--espresso); }
.art-status--reserved .art-status__dot { background: #A66A00; }
.art-status--sold { background: var(--paper); border-color: var(--danger); color: var(--danger); }
.art-status--sold .art-status__dot { background: #D42A1E; }  /* the gallery's red dot */
.art-status--not_for_sale { background: var(--cream-2); color: var(--ink-soft); }
.art-status--not_for_sale .art-status__dot { background: #9C8778; }

/* Form: photo manager */
.photos-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.photos-head .card__title { margin-bottom: 0; }
.photos-count { color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; }
.photos-body { display: grid; gap: 12px; }
.photos { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
/* Phone: picture and its buttons on top, the description full width below. */
.photo-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  grid-template-areas: 'img tools' 'alt alt';
  gap: 10px 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}
.photo-row:first-child { border-color: var(--orange); }
.photo-row__img { grid-area: img; width: 88px; height: 88px; object-fit: cover; border-radius: 6px; background: var(--cream-2); }
.photo-row__alt { grid-area: alt; align-content: start; }
.photo-row__alt .field__label { font-size: 0.92rem; }
.photo-row__tools {
  grid-area: tools;
  display: grid;
  grid-template-columns: var(--tap) var(--tap) minmax(0, 1fr);
  align-content: start;
  align-items: center;
  gap: 8px 6px;
}
.photo-row__tools > :first-child { grid-column: 1 / -1; justify-self: start; }
.photo-row__tools .btn--danger { justify-self: end; }
.photo-row__main { display: inline-flex; align-items: center; min-height: var(--tap); }
@media (min-width: 760px) {
  .photo-row { grid-template-columns: 120px minmax(0, 1fr); grid-template-areas: 'img tools' 'img alt'; }
  .photo-row__img { width: 120px; height: 120px; }
  .photo-row__tools { display: flex; flex-wrap: wrap; gap: 8px; }
  .photo-row__tools .btn--danger { margin-left: auto; }
}
.upload-progress { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.upload-progress:empty { display: none; }
.upload-progress__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--cream-2);
  font-size: 0.92rem;
}
.upload-progress__name { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-progress__step { flex: none; font-weight: 700; color: var(--ink-soft); }
.upload-progress__row.is-done .upload-progress__step { color: var(--ok); }
.upload-progress__row.is-error { background: var(--danger-soft); }
.upload-progress__row.is-error .upload-progress__step { flex: 1 1 100%; color: var(--danger); }
.upload-progress__retry { padding-top: 2px; }
/* A sentence-long chip ("Hidden: its exhibition is a draft") wraps inside a narrow card instead of running out of it. */
.chip--long { white-space: normal; max-width: 100%; padding-block: 2px; border-radius: 12px; }
.art-show-note { margin: 0; font-size: 0.92rem; color: var(--ink-soft); line-height: 1.6; }
.art-show-note .chip { margin-right: 6px; }
.fieldset { margin: 0; padding: 0; border: 0; }

/* ==========================================================================
   8. Assistant panel, photo library, TV screens (docs/assistant-api.md §7)
   Check colours reuse the checked pairs above: ok on ok-soft 5.2:1, danger on
   danger-soft 6.8:1, espresso on butter-soft; cream on espresso for the selection bar.
   ========================================================================== */
:root { --assist-w: 420px; }

/* Top bar: the Assistant button on every screen */
.topbar__assist {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: var(--espresso);
  font-weight: 700;
  cursor: pointer;
}
.topbar__assist:hover { background: var(--peach); }
.topbar__assist[aria-expanded="true"] { background: var(--butter); }
@media (max-width: 479px) {
  .topbar__assist { width: var(--tap); padding: 0; }
  /* Labels stay for screen readers; on a narrow phone the business name needs the room. */
  .topbar__assist-label, .switcher__label, .assist__btn-label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .assist__head-tools .btn--compact { width: var(--tap); padding: 0; }
}
@media (min-width: 900px) { .topbar__assist { margin-left: auto; } }

/* Side nav: the Assistant item is a button that opens the panel */
.sidenav__assist { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.sidenav__assist .icon { color: var(--orange-ink); }
.app.assist-open .sidenav__assist { background: var(--butter-soft); }

/* The panel: a full-screen sheet on phones, a column on the right on computers */
.assist {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--espresso);
}
@media (min-width: 900px) {
  .assist {
    top: var(--header-h);
    left: auto;
    z-index: 35;
    width: var(--assist-w);
    border-left: 1px solid var(--line);
    box-shadow: -18px 0 40px -30px rgba(42, 22, 12, .6);
  }
}
/* Messages appear beside the panel (on a phone: above its message box), not over its buttons. */
.app.assist-open ~ .toasts { top: auto; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) { .app.assist-open ~ .toasts { top: calc(var(--header-h) + 10px); bottom: auto; right: calc(var(--assist-w) + 20px); } }
/* Wide screens keep the page beside the panel instead of under it. */
@media (min-width: 1200px) { .app.assist-open .frame { margin-right: var(--assist-w); } }
.assist__head {
  display: grid;
  gap: 4px;
  padding: 8px 12px 8px 16px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.assist__bar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.assist__bar .assist__title, .assist__bar .assist__subtitle { flex: 1; min-width: 0; }
.assist__title { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.assist__title .icon { color: var(--orange-ink); }
.assist__title:focus { outline: none; }
.assist__title:focus-visible { outline: 3px solid var(--orange-ink); }
.assist__subtitle { font-size: 0.85rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assist__head-tools { display: flex; gap: 6px; margin-left: auto; }
.assist__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.assist__log, .assist__chats { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px; }
.assist__log { display: flex; flex-direction: column; gap: 14px; }
.assist__log:focus { outline: none; }
.assist__loading { color: var(--ink-soft); }
.assist__intro { display: grid; gap: 10px; }
.assist__intro h3 { font-size: 1.2rem; }
.assist__try { font-weight: 700; margin-top: 4px; }
.assist__suggestions { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.assist__suggestion {
  width: 100%;
  min-height: var(--tap);
  padding: 8px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}
.assist__suggestion:hover { border-color: var(--orange-ink); }

/* Composer */
.assist__composer {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.assist__input { min-height: 52px; max-height: 168px; resize: none; }
.assist__tools { display: flex; align-items: center; gap: 8px; }
.assist__status { flex: 1; min-width: 0; font-size: 0.85rem; color: var(--ink-soft); }
.assist__send { flex: none; margin-left: auto; }
.assist__mic.is-listening { background: var(--danger); border-color: var(--danger); color: #fff; animation: listening 1.4s ease-in-out infinite; }
@keyframes listening { 50% { box-shadow: 0 0 0 6px var(--danger-soft); } }
.assist__attachments { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; padding: 6px 0 0; list-style: none; }
.assist__attachment { position: relative; }
.assist__attachment img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.assist__attachment-remove {
  position: absolute;
  top: -14px; right: -14px;
  display: flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap);
  padding: 0; border: 0; background: transparent; cursor: pointer;
}
.assist__attachment-remove .icon { width: 26px; height: 26px; padding: 4px; border-radius: 50%; background: var(--espresso); color: var(--cream); }

/* Chats list */
.assist__chats-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.assist__chats-head h3 { font-size: 1.1rem; }
.assist__chat-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.assist__chat {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.assist__chat:hover { border-color: var(--orange-ink); }
.assist__chat[aria-current="true"] { border-color: var(--orange); box-shadow: inset 4px 0 0 var(--orange); }
.assist__chat-title { font-weight: 700; overflow-wrap: anywhere; }
.assist__chat-when { font-size: 0.85rem; color: var(--ink-soft); }

/* Messages */
.msg { max-width: 100%; }
.msg__text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg--user {
  align-self: flex-end;
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  background: var(--espresso);
  color: var(--cream);
}
.msg--user a { color: var(--butter); }
.msg__meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 0.85rem; color: var(--peach); }
.msg__meta .icon { width: 16px; height: 16px; }
.msg--assistant { align-self: stretch; display: grid; gap: 8px; }
.msg--assistant .msg__text {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 4px;
  background: #fff;
}
.msg__tools { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 0.88rem; color: var(--ink-soft); }
.msg__tools:empty, .msg__drafts:empty { display: none; }
.msg__tool { display: flex; align-items: center; gap: 8px; }
.msg__tool .icon { width: 16px; height: 16px; color: var(--ok); }
/* The first line of a reply while Claude thinks (or after a dropped connection), so a quiet wait does not look stuck. */
.msg__tool--thinking {
  padding: 10px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px 16px 16px 4px;
  background: #fff;
  font-size: 0.95rem;
  color: var(--espresso);
}
.msg__spinner {
  flex: none;
  width: 14px; height: 14px;
  border: 2px solid var(--orange-ink);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.msg__error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
}
.msg__error > .icon { color: var(--danger); }
.msg__error p { flex: 1 1 180px; font-weight: 600; }

/* Draft card: what will change, the checks, previews, Publish */
.draft {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--orange);
  border-radius: var(--radius);
  background: #fff;
}
.draft + .draft { margin-top: 10px; }
.draft-page { max-width: 720px; } /* #/draft/<id>: the same card on a page of its own */
.draft--published { border-color: var(--ok); }
.draft--undone, .draft--discarded, .draft--expired, .draft--failed, .draft--loading { border: 1.5px dashed var(--line-strong); }
.draft__head { display: grid; gap: 2px; }
.draft__status { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange-ink); }
.draft__status--published { color: var(--ok); }
.draft__status--undone, .draft__status--discarded, .draft__status--expired, .draft__status--failed { color: var(--ink-soft); }
.draft__title { font-size: 1.08rem; line-height: 1.3; overflow-wrap: anywhere; }
.draft__title:focus { outline: none; }
.draft__title:focus-visible { outline: 3px solid var(--orange-ink); }
.draft__count { font-size: 0.88rem; color: var(--ink-soft); }
.draft__summary { display: grid; gap: 12px; }
.draft__biz { margin-bottom: 6px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.draft__lines { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.draft__line { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--cream); }
.draft__what { font-weight: 600; overflow-wrap: anywhere; }
.draft__change { font-size: 0.95rem; overflow-wrap: anywhere; }
.draft__before s { color: var(--ink-soft); text-decoration-thickness: 1.5px; }
.draft__after { font-weight: 700; }
.draft__before.is-none, .draft__after.is-none { color: var(--ink-soft); font-style: italic; font-weight: 600; }
.draft__arrow { color: var(--orange-ink); font-weight: 700; }
.draft__checks { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.draft-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}
.draft-check > .icon { width: 18px; height: 18px; margin-top: 2px; }
.draft-check--ok { background: var(--ok-soft); border-color: var(--ok); }
.draft-check--ok > .icon, .draft-check--ok strong { color: var(--ok); }
.draft-check--warn { background: var(--butter-soft); border-color: #A66A00; }
.draft-check--warn > .icon { color: #7A4E00; }
.draft-check--block { background: var(--danger-soft); border-color: var(--danger); }
.draft-check--block > .icon, .draft-check--block strong { color: var(--danger); }
.draft-check__detail { color: var(--ink-soft); }
.draft__previews { display: grid; gap: 8px; }
.draft__label { font-weight: 700; font-size: 0.92rem; }
.draft__preview-links, .draft__share, .draft__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.draft__preview-links .btn { white-space: normal; text-align: left; }
.draft__note { font-size: 0.88rem; color: var(--ink-soft); }
.draft__blocked, .draft__error { font-size: 0.92rem; font-weight: 700; color: var(--danger); }

/* Photo library */
.photo-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.upload-card { margin-bottom: 18px; }
.upload-card__btn { min-height: 52px; padding-inline: 1.5em; font-size: 1.05rem; }
.photo-filters { display: grid; gap: 10px; margin-bottom: 12px; }
.album-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.album-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  font-weight: 700;
  cursor: pointer;
}
.album-chip:hover { border-color: var(--espresso); }
.album-chip[aria-pressed="true"] { border-color: var(--espresso); background: var(--espresso); color: var(--cream); }
.album-chip__count { font-weight: 500; color: var(--ink-soft); }
.album-chip[aria-pressed="true"] .album-chip__count { color: var(--peach); }
.album-chip--add { border-style: dashed; color: var(--orange-ink); }
.album-chip--add .icon { width: 18px; height: 18px; }
.album-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.album-tools__delete { color: var(--danger); }
.photo-summary { margin-bottom: 10px; font-weight: 600; color: var(--ink-soft); }
.photo-summary:focus, .screen-summary:focus { outline: none; }
.photo-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
@media (min-width: 600px) { .photo-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
.photo-grid__wide { grid-column: 1 / -1; }
.photo-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.photo-tile.is-selected { border-color: var(--orange-ink); box-shadow: 0 0 0 2px var(--orange-ink); }
.photo-tile__img { display: block; width: 100%; padding: 0; border: 0; background: var(--cream-2); cursor: pointer; }
.photo-tile__img img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-tile__select {
  position: absolute;
  top: 0; left: 0;
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  cursor: pointer;
}
.photo-tile__select input { width: 24px; height: 24px; margin: 0; accent-color: var(--orange-ink); cursor: pointer; box-shadow: 0 0 0 3px rgba(255, 255, 255, .92); border-radius: 4px; }
.photo-tile__body { display: grid; gap: 4px; padding: 10px 12px 12px; }
.photo-tile__note { font-weight: 700; font-size: 0.95rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.photo-tile__note.is-empty { font-weight: 500; font-style: italic; color: var(--ink-soft); }
.photo-tile__meta { font-size: 0.85rem; color: var(--ink-soft); }
.photo-tile__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.photo-tile__edit { margin-left: auto; }
.select-bar {
  position: sticky;
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px) + 8px);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--espresso);
  color: var(--cream);
  box-shadow: 0 14px 30px -14px rgba(42, 22, 12, .7);
}
@media (min-width: 900px) { .select-bar { bottom: 12px; } }
.select-bar :focus-visible { outline-color: var(--butter); }
.select-bar__count { font-weight: 700; }
.select-bar__move { display: flex; flex: 1 1 220px; align-items: center; gap: 8px; min-width: 0; }
.select-bar__label { flex: none; font-size: 0.9rem; font-weight: 700; color: var(--peach); }
.select-bar .select { flex: 1; min-width: 0; }
.select-bar__buttons { display: flex; gap: 8px; }
.select-bar .btn--secondary { border-color: var(--cream); color: var(--cream); }
.select-bar .btn--secondary:hover { background: var(--espresso-2); }
.dialog--photo { width: min(94vw, 560px); }
.dialog__photo { width: 100%; height: auto; max-height: 42vh; margin: 2px 0 8px; object-fit: contain; border-radius: var(--radius-sm); background: var(--cream-2); }
.dialog__meta { margin-bottom: 14px; }
.dialog--photo .textarea { min-height: 72px; }
/* Save and Delete stay in reach while the form scrolls inside the dialog. */
.dialog--photo .dialog__actions { position: sticky; bottom: 0; padding-top: 12px; border-top: 1px solid var(--line); background: var(--paper); }
.photo-used__list { display: grid; gap: 4px; margin: 4px 0 0; padding-left: 1.2em; }
.photo-used .field__label { display: block; }

/* "Choose from library" sheet */
.picker { width: min(100vw, 760px); max-width: 100vw; }
.picker[open] { display: flex; flex-direction: column; }
.picker__body { display: grid; gap: 12px; padding: 4px 16px 18px; overflow-y: auto; }
.picker__status { color: var(--ink-soft); }
.picker__status:empty { display: none; }
.picker__grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); margin: 0; padding: 0; list-style: none; }
.picker__photo {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.picker__photo:hover { border-color: var(--orange-ink); }
.picker__photo img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--cream-2); }
.picker__note { padding: 6px 8px; font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* TV screens */
.screen-summary-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 12px; }
.screen-summary { font-weight: 600; color: var(--ink-soft); }
.screen-summary:empty { display: none; }
.screen-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.screen-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
@media (min-width: 760px) { .screen-card { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); } }
.screen-card__preview { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-sm); background: var(--espresso); }
.screen-card__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.screen-card__body { display: grid; gap: 8px; align-content: start; min-width: 0; }
.screen-card__name { font-size: 1.1rem; overflow-wrap: anywhere; }
.screen-card__notes { font-size: 0.92rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.screen-card__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.screen-card__edit { display: flex; gap: 8px; margin-left: auto; }
.screen-status { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; font-weight: 700; }
.screen-status__dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #9C8778; }
.screen-status__seen { font-weight: 500; color: var(--ink-soft); }
.screen-status--online { color: var(--ok); }
.screen-status--online .screen-status__dot { background: #2E8540; box-shadow: 0 0 0 3px var(--ok-soft); }
.screen-status--offline { color: var(--danger); }
.screen-status--offline .screen-status__dot { background: #D42A1E; }
.screen-status--never { color: var(--ink-soft); }
.scene-seconds .input { max-width: 180px; }
.scene-grid { display: grid; gap: 2px 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.copy-field { display: flex; gap: 8px; }
.copy-field__input { flex: 1; min-width: 0; font-size: 0.92rem; }

/* Account: the Claude app connector */
.steps { display: grid; gap: 4px; margin: 10px 0 14px; padding-left: 1.3em; }
.apps__title { margin: 18px 0 8px; font-size: 1rem; }
