/* Book Conmigo — "Sunset" palette */
:root {
  --terracotta: #E0603A;
  --terracotta-dark: #C04B28;
  --plum: #2B1B3D;
  --plum-soft: #4A3A5C;
  --marigold: #F4B23E;
  --cream: #FFF6EC;
  --white: #FFFFFF;
  --line: #EADBCB;
  --muted: #6E5F7A;
  --danger-bg: #FDE8E1;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Roles — every screen uses these, so dark mode only swaps them. */
  color-scheme: light;
  --bg: var(--cream);
  --surface: var(--white);
  --surface-2: var(--cream);
  --text: var(--plum);
  --text-soft: var(--plum-soft);
  --link: var(--terracotta-dark);
  --accent: var(--terracotta);
  --accent-hover: var(--terracotta-dark);
  --on-accent: var(--white);
  --inverse-bg: var(--plum);
  --inverse-text: var(--white);
  --danger-text: #B3261E;
  --success: #2E9E6B;
  --success-bg: #E7F6EE;
  --shadow: rgba(43, 27, 61, 0.12);
  --focus: rgba(224, 96, 58, 0.18);
}

/* Dark mode: follows the device unless the person picked light or dark (bc_theme cookie).
   Customer booking pages (.biz-html) use each business's own colors instead. */
html[data-theme="dark"]:not(.biz-html) {
  color-scheme: dark;
  --bg: #1A1124;
  --surface: #241932;
  --surface-2: #2E2240;
  --text: #FFF6EC;
  --text-soft: #DCCFE3;
  --muted: #A897B5;
  --line: #3E3052;
  --link: #F4906A;
  --accent: #E0603A;
  --accent-hover: #EC7550;
  --inverse-bg: #FFF6EC;
  --inverse-text: #2B1B3D;
  --danger-bg: #3D2026;
  --danger-text: #FF8A80;
  --success: #4CC38A;
  --success-bg: #173329;
  --shadow: rgba(0, 0, 0, 0.45);
  --focus: rgba(244, 144, 106, 0.3);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not(.biz-html) {
    color-scheme: dark;
    --bg: #1A1124;
    --surface: #241932;
    --surface-2: #2E2240;
    --text: #FFF6EC;
    --text-soft: #DCCFE3;
    --muted: #A897B5;
    --line: #3E3052;
    --link: #F4906A;
    --accent: #E0603A;
    --accent-hover: #EC7550;
    --inverse-bg: #FFF6EC;
    --inverse-text: #2B1B3D;
    --danger-bg: #3D2026;
    --danger-text: #FF8A80;
    --success: #4CC38A;
    --success-bg: #173329;
    --shadow: rgba(0, 0, 0, 0.45);
    --focus: rgba(244, 144, 106, 0.3);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px 20px 64px; }
a { color: var(--link); }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.25rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.brand span { color: var(--terracotta); }
.top nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.top nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.top nav a.lang { color: var(--muted); font-size: 0.9rem; }
.inline { display: inline; margin: 0; }

/* Buttons */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none; text-align: center;
  background: var(--accent); color: var(--on-accent) !important; font: 600 1rem var(--font);
  padding: 14px 24px; border-radius: 999px; transition: background 0.15s ease;
}
.btn:hover { background: var(--accent-hover); }
.btn-small { padding: 8px 16px; font-size: 0.9rem; }
.btn-ghost { background: transparent; color: var(--text) !important; border: 2px solid var(--text); }
.btn-ghost:hover { background: var(--inverse-bg); color: var(--inverse-text) !important; }
.link { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; text-decoration: underline; }

/* Home */
.hero { text-align: center; padding: 56px 0 40px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.1; margin: 0 0 12px; letter-spacing: -0.02em; }
.hero .hook { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 700; color: var(--terracotta); margin: 0 0 16px; }
.hero .sub { max-width: 560px; margin: 0 auto 28px; color: var(--text-soft); font-size: 1.1rem; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin: 0 0 6px; }
.card p { margin: 0; color: var(--text-soft); }
.for { text-align: center; margin-top: 40px; }
.for p { color: var(--text-soft); max-width: 720px; margin: 0 auto; }

/* Panels & forms */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; max-width: 560px; margin: 24px auto; }
.panel.narrow { max-width: 420px; }
.panel.center { text-align: center; }
.panel h1 { margin-top: 0; font-size: 1.6rem; }
.form { display: grid; gap: 18px; }
.form label { display: grid; gap: 6px; font-weight: 600; }
.form small { font-weight: 400; color: var(--muted); }
input, select {
  font: 1rem var(--font); padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--terracotta); box-shadow: 0 0 0 3px var(--focus); }
.slug-field { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.slug-field .prefix { padding: 0 4px 0 12px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.slug-field input { border: 0; border-radius: 0; }
.form > label[for] { margin-bottom: -12px; }
.typeahead { position: relative; display: grid; gap: 6px; }
.suggestions {
  position: absolute; top: 50px; left: 0; right: 0; z-index: 10; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 28px var(--shadow);
}
.suggestions li { padding: 10px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.suggestions li.active, .suggestions li:hover { background: var(--surface-2); }
.suggestions li.keep { color: var(--muted); border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; font-style: italic; }
.code-input { font-size: 1.5rem; letter-spacing: 0.4em; text-align: center; }
.or { text-align: center; color: var(--muted); margin: -4px 0; }
.muted { color: var(--muted); }
.alert { background: var(--danger-bg); border-left: 4px solid var(--terracotta); padding: 12px 14px; border-radius: 8px; margin: 0 0 16px; }

/* Dashboard */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0 0 24px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.steps { padding-left: 20px; }
.steps li { margin: 8px 0; }
.badge { display: inline-block; background: var(--marigold); color: var(--plum); font-size: 0.75rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; margin-left: 6px; }

.foot { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 24px; }
.foot-links { display: flex; justify-content: center; gap: 16px; margin-bottom: 6px; }
.foot-links a { color: var(--muted); }
.legal { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; line-height: 1.65; }
.legal h1 { margin-bottom: 4px; }
.legal h2 { font-size: 1.1rem; margin: 28px 0 8px; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: 6px; }
.legal-updated, .legal-note { color: var(--muted); font-size: 0.9rem; }

.brand { white-space: nowrap; }
.top nav .link { color: var(--text); text-decoration: none; font-weight: 500; }

@media (max-width: 560px) {
  .top { padding: 12px 14px; gap: 8px; }
  .brand { font-size: 1.1rem; }
  .top nav { gap: 10px; flex-wrap: nowrap; font-size: 0.9rem; }
  .top nav a { white-space: nowrap; }
  .top nav .btn-small { padding: 7px 12px; font-size: 0.85rem; }
  .panel { padding: 22px; margin: 12px auto; }
  .top nav .btn-small { display: none; } /* the page itself has the main sign-up button */
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
}

/* ── Dashboard ───────────────────────────────────────────── */
.dash { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
.dash-tabs { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 16px; }
.dash-tabs a { padding: 10px 14px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.dash-tabs a:hover { background: var(--surface); }
.dash-tabs a.on { background: var(--inverse-bg); color: var(--inverse-text); }
.dash-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; min-width: 0; }
.dash-body h1 { margin-top: 0; font-size: 1.5rem; }
.dash-body h2 { font-size: 1.15rem; margin: 24px 0 8px; }
.dash-body .card { background: var(--surface-2); border-color: var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.head-row h1 { margin: 0; }
.row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.notice { background: var(--success-bg); border-left: 4px solid var(--success); padding: 10px 14px; border-radius: 8px; margin: 0 0 16px; }
.empty { color: var(--muted); background: var(--surface-2); padding: 18px; border-radius: 10px; text-align: center; }
.items { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.item.off { opacity: 0.6; }
.item .meta { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.item .price { font-weight: 700; white-space: nowrap; }
.warn { color: var(--link); font-weight: 600; }
.muted-badge { background: var(--line); color: var(--text); }
.checklist { list-style: none; padding: 0; margin: 8px 0 16px; display: grid; gap: 8px; }
.checklist li { display: flex; align-items: center; gap: 10px; }
.checklist .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: inline-grid; place-items: center; font-size: 0.8rem; color: var(--white); flex: none; }
.checklist li.done .tick { background: var(--success); border-color: var(--success); }
.checklist li.done { color: var(--muted); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
fieldset.pair > small { grid-column: 1 / -1; margin-top: -8px; }
fieldset.trio { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
fieldset.checks { display: grid; gap: 8px; }
fieldset.checks legend { font-weight: 600; margin-bottom: 6px; }
.form label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.form label.check input { width: auto; }
textarea { font: 1rem var(--font); padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; width: 100%; resize: vertical; background: var(--surface); color: var(--text); }
textarea:focus { outline: none; border-color: var(--terracotta); box-shadow: 0 0 0 3px var(--focus); }
.danger-zone { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.link.danger { color: var(--danger-text); }
.price-amount.is-hidden { visibility: hidden; }
/* Hours */
.hours .day { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hours .day-name { font-weight: 700; padding-top: 10px; }
.hours .day-ranges { display: grid; gap: 8px; }
.hours .range { display: flex; align-items: center; gap: 8px; }
.hours .range input { max-width: 150px; }
.hours .range.extra { display: none; }
.closed-tag { color: var(--muted); font-size: 0.85rem; }
.staff-pick label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.staff-pick select { width: auto; }
.public-services { text-align: left; margin: 20px 0; }

@media (max-width: 760px) {
  .dash { grid-template-columns: 1fr; }
  .dash-tabs { flex-direction: row; overflow-x: auto; position: static; padding-bottom: 4px; }
  .dash-tabs a { white-space: nowrap; }
  .dash-body { padding: 18px; }
  fieldset.pair, fieldset.trio { grid-template-columns: 1fr; }
  .hours .day { grid-template-columns: 1fr; gap: 4px; }
  .hours .day-name { padding-top: 0; }
}

/* ── Design tab ──────────────────────────────────────────── */
.design-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; align-items: start; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.theme-card { display: grid !important; gap: 6px; justify-items: center; padding: 10px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 600; font-size: 0.85rem; text-align: center; }
.theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.theme-card:has(input:checked) { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(224, 96, 58, 0.15); }
.swatch { width: 100%; height: 44px; border-radius: 8px; border: 1px solid var(--line); display: flex; align-items: flex-end; gap: 6px; padding: 6px; }
.swatch i { display: block; width: 40%; height: 8px; border-radius: 4px; }
.swatch b { display: block; width: 30%; height: 14px; border-radius: 999px; margin-left: auto; }
.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.colors input[type="color"] { height: 46px; padding: 4px; cursor: pointer; }
.upload { display: grid; gap: 6px; }
.upload-label { font-weight: 600; }
.upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.upload-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.upload-thumb.is-empty { visibility: hidden; width: 0; border: 0; }
.file-btn { cursor: pointer; }
.preview-wrap { position: sticky; top: 16px; display: grid; gap: 10px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 6px 12px; font: 600 0.82rem var(--font); cursor: pointer; color: var(--text); }
.seg button.on { background: var(--inverse-bg); color: var(--inverse-text); }
.mock-viewport { border: 1px solid var(--line); border-radius: 22px; overflow: hidden; position: relative; box-shadow: 0 10px 30px var(--shadow); }
.mock-viewport.phone { max-height: 720px; overflow-y: auto; }
.mock-viewport.desktop .mock { width: 1000px; transform-origin: top left; }
.mock { position: relative; isolation: isolate; background: var(--b-bg); color: var(--b-text); overflow: hidden; min-height: 560px; cursor: grab; user-select: none; }
.mock.dragging, .mock-cover-wrap.dragging { cursor: grabbing; }
.mock a, .mock .biz-top span { color: var(--b-muted); }
.mock-bg, .mock-overlay { position: absolute; inset: 0; pointer-events: none; }
.mock-bg { z-index: -2; }
.mock-overlay { z-index: -1; }
.mock-content { position: relative; pointer-events: none; }
.mock .biz-main { padding-bottom: 8px; }
.mock .biz-head h1 { font-size: 1.8rem; }
.mock .biz-head.no-cover .biz-id { padding-top: 4px; }
.mock-cover-wrap { pointer-events: auto; cursor: grab; }
.mock .biz-logo[hidden], .mock [hidden] { display: none !important; }
.mock .biz-foot b { color: var(--b-text); }
.mock .biz-foot b span { color: #E0603A; }
.img-controls { display: none; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); margin-top: 4px; }
.upload.has-image .img-controls { display: grid; }
.range-field { display: grid !important; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; font-weight: 600; font-size: 0.9rem; }
.range-field output { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.range-field input[type="range"] { grid-column: 1 / -1; padding: 0; border: 0; accent-color: var(--terracotta); }
.save-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 12px 0; background: linear-gradient(transparent, var(--surface) 30%); }
.design-grid { grid-template-columns: minmax(0, 1fr) 400px !important; }

/* ── Business (customer-facing) pages ───────────────────── */
body.biz { background: var(--b-bg); color: var(--b-text); }
body.biz a { color: var(--b-primary); }
.biz-top { display: flex; justify-content: flex-end; padding: 12px 20px; font-size: 0.9rem; }
.biz-top a { color: var(--b-muted) !important; text-decoration: none; }
.biz-main { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px 48px; flex: 1; }
.biz-head { margin-bottom: 20px; }
.biz-cover-wrap { overflow: hidden; border-radius: 18px; height: 200px; margin-bottom: 10px; }
.biz-cover-wrap + .biz-id .biz-logo { margin-top: -52px; }  /* only the logo overlaps the cover */
.biz-cover-wrap[hidden] + .biz-id .biz-logo { margin-top: 0; }
.biz-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.biz-id { display: flex; align-items: flex-end; gap: 14px; padding: 0 6px; }
.biz-logo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 4px solid var(--b-bg); background: var(--b-bg); position: relative; }
.biz-head h1 { font-family: var(--b-heading); font-size: clamp(1.8rem, 6vw, 2.4rem); margin: 0; line-height: 1.1; }
.biz-head h1 a { color: var(--b-text) !important; text-decoration: none; }
.biz-head.compact { margin-bottom: 14px; }
.biz-head.compact .biz-logo { width: 48px; height: 48px; border-width: 0; }
.biz-head.compact h1 { font-size: 1.4rem; }
.biz-muted { color: var(--b-muted); margin: 2px 0 0; font-size: 0.95rem; }
.biz-bio { margin: 14px 6px 0; }
.biz-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 6px 0; }
.biz-links a { padding: 6px 14px; border: 1.5px solid var(--b-line); border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 0.9rem; color: var(--b-text) !important; }
.biz-h2 { font-family: var(--b-heading); font-size: 1.2rem; margin: 24px 0 10px; }
.biz-services { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.biz-card { background: var(--b-card); border: 1px solid var(--b-line); border-radius: 16px; padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.biz-card.center { justify-content: center; text-align: center; }
.biz-desc { margin: 6px 0 0; color: var(--b-muted); font-size: 0.92rem; }
.biz-btn { display: inline-block; background: var(--b-primary); color: var(--b-on-primary) !important; padding: 10px 18px; border-radius: 999px; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; font-size: 0.95rem; white-space: nowrap; }
.biz-btn.big { padding: 14px 26px; font-size: 1.05rem; }
.biz-btn:hover { filter: brightness(0.93); }
.summary { margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--b-line); text-decoration: none; color: var(--b-text) !important; font-weight: 600; background: var(--b-card); }
.chip.on { background: var(--b-primary); border-color: var(--b-primary); color: var(--b-on-primary) !important; }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.day-chip { flex: none; scroll-snap-align: start; display: grid; justify-items: center; width: 64px; padding: 8px 0; border-radius: 14px; border: 1.5px solid var(--b-line); background: var(--b-card); text-decoration: none; color: var(--b-text) !important; font-size: 0.78rem; }
.day-chip b { font-size: 1.3rem; }
.day-chip.on { background: var(--b-primary); border-color: var(--b-primary); color: var(--b-on-primary) !important; }
.day-chip.off { opacity: 0.35; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.time-chip { display: grid; justify-items: center; padding: 12px 6px; border-radius: 12px; border: 1.5px solid var(--b-primary); color: var(--b-primary) !important; text-decoration: none; font-weight: 700; background: var(--b-card); }
.time-chip small { font-weight: 500; font-size: 0.72rem; color: var(--b-muted); }
.time-chip:hover { background: var(--b-primary); color: var(--b-on-primary) !important; }
.biz-form input, .biz-form textarea, .biz-form select { background: var(--b-card); color: var(--b-text); border-color: var(--b-line); }
.biz-form input:focus, .biz-form textarea:focus { border-color: var(--b-primary); box-shadow: none; }
.biz-form small, .small { font-size: 0.85rem; }
.biz-form .is-hidden { display: none; }
.cutoff-custom.is-hidden { display: none; }
.cutoff-field { margin-bottom: 4px; }
.confirm { flex-direction: column; text-align: center; padding: 28px 20px; }
.confirm h2 { font-family: var(--b-heading); margin: 6px 0; }
.confirm .facts { text-align: left; margin: 12px auto; }
.confirm .facts dt { color: var(--b-muted); }
.big-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--b-primary); color: var(--b-on-primary); font-size: 1.6rem; font-weight: 800; }
.confirm.inactive .big-icon { background: var(--b-line); color: var(--b-text); }
.row.center { justify-content: center; }
.biz-foot { text-align: center; padding: 24px; font-size: 0.85rem; color: var(--b-muted); }
.biz-legal { display: block; margin-top: 6px; font-size: 0.8rem; }
.biz-foot .biz-legal a { color: var(--b-muted) !important; font-weight: 400; text-decoration: underline; }
.biz-foot a { color: var(--b-text) !important; font-weight: 800; text-decoration: none; }
.biz-foot a span { color: #E0603A; }
.preview-banner { background: var(--marigold); color: var(--plum); text-align: center; padding: 8px; font-weight: 600; font-size: 0.9rem; }
.preview-banner a { color: var(--plum) !important; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.actions form { margin: 0; }

@media (max-width: 1100px) {
  .design-grid { grid-template-columns: 1fr !important; }
  .preview-wrap { position: static; }
}
@media (max-width: 560px) {
  .colors { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .biz-cover-wrap { height: 150px; }
  .biz-card { flex-wrap: wrap; }
}

/* ── Packages, memberships & payments ── */
.warn-badge { background: var(--terracotta); color: #fff; }
.pay-provider .actions { align-items: center; }
.embed-box { min-height: 420px; margin-top: 16px; }
#pay-area { margin-top: 8px; }
#stripe-element, #square-card, #paypal-buttons, #paypal-card { margin: 12px 0; }
#paypal-card .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.danger-zone { margin-top: 28px; }
.small { font-size: 0.85rem; }
.center { text-align: center; }
/* Anything marked hidden stays hidden, even if a layout class (e.g. .row) sets display. */
[hidden] { display: none !important; }

/* ── Loading feedback ── */
.load-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 9999; pointer-events: none;
  background: var(--b-primary, var(--terracotta)); box-shadow: 0 0 8px var(--b-primary, var(--terracotta));
  opacity: 0; transition: opacity 0.3s;
}
.load-bar.on { opacity: 1; animation: load-trickle 12s cubic-bezier(0.1, 0.7, 0.2, 1) forwards; }
.load-bar.done { opacity: 0; width: 100%; }
@keyframes load-trickle { 0% { width: 0; } 15% { width: 45%; } 50% { width: 75%; } 100% { width: 92%; } }

.is-busy { cursor: progress !important; opacity: 0.85; pointer-events: none; }
.is-busy::before {
  content: ''; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.5em; vertical-align: -0.12em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.load-note { margin: 8px 0 0; font-size: 0.85rem; color: var(--b-muted, var(--muted, #6b6b6b)); }
.load-note.load-failed { color: var(--terracotta-dark); font-weight: 600; }

/* Placeholder while a payment / Stripe form is loading. */
.skeleton {
  min-height: 160px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(0,0,0,0.05) 25%, rgba(0,0,0,0.1) 37%, rgba(0,0,0,0.05) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (prefers-reduced-motion: reduce) {
  .load-bar.on { animation: none; width: 70%; }
  .is-busy::before, .skeleton { animation: none; }
}

/* ── Photos & policies ── */
.photo-field { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.photo-field legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.photo-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.photo-list:empty { display: none; }
.photo-item { position: relative; width: 120px; display: grid; gap: 4px; }
.photo-item img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--cream); }
.photo-field[data-kind="policy"] .photo-item img { object-fit: contain; background: #fff; }
.photo-badge { position: absolute; top: 6px; left: 6px; background: var(--plum, #2B1B3D); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.85rem; }
.photo-add { justify-self: start; }

.biz-card.has-photo { justify-content: flex-start; }
.biz-card.has-photo .biz-card-body { flex: 1; min-width: 0; }
.biz-thumb { position: relative; flex: none; width: 76px; height: 76px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--b-line); }
.biz-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.biz-thumb-count { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 0.75rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
dialog.gallery { padding: 0; border: 0; background: transparent; max-width: min(960px, 100vw); width: 100%; }
dialog.gallery::backdrop { background: rgba(0,0,0,.85); }
.gallery-strip { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 12px; }
.gallery-strip img { flex: 0 0 100%; max-height: 82vh; object-fit: contain; scroll-snap-align: center; border-radius: 12px; }
.gallery-close { position: fixed; top: 12px; right: 16px; z-index: 1; width: 44px; height: 44px; border: 0; border-radius: 999px; background: rgba(255,255,255,.9); font-size: 1.6rem; line-height: 1; cursor: pointer; }

.policy-text { display: block; white-space: pre-line; line-height: 1.55; }
.policy-images { display: grid; gap: 12px; margin-top: 12px; }
.policy-images img { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--b-line); background: #fff; }
@media (max-width: 560px) {
  .biz-card.has-photo { flex-wrap: nowrap; display: grid; grid-template-columns: 64px 1fr; }
  .biz-card.has-photo .biz-btn { grid-column: 1 / -1; justify-self: start; }
  .biz-thumb { width: 64px; height: 64px; }
}
.photo-add[hidden] { display: none; }

/* ── Light / dark toggle (header) ───────────────────────── */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface-2);
  color: var(--text); cursor: pointer; display: inline-grid; place-items: center; padding: 0; flex: none;
  font: 1.05rem/1 var(--font);
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle::before { content: "◐"; font-size: 1.25em; }  /* automatic — matches the device */
html[data-theme] .theme-toggle::before { font-size: 1em; }
html[data-theme="light"] .theme-toggle::before { content: "☀"; }
html[data-theme="dark"] .theme-toggle::before { content: "☾"; }
.dash-tabs a, .dash-body, .panel, .card, .top, input, select, textarea { transition: background-color 0.2s ease, border-color 0.2s ease; }
@media (max-width: 560px) { .theme-toggle { width: 32px; height: 32px; font-size: 0.95rem; } }

/* ── Chat assistant ───────────────────────────────────────── */
.bcc { position: fixed; right: 16px; bottom: 16px; z-index: 50; font-size: 0.95rem; }
.bcc-bubble { display: flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 18px;
  background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 6px 20px var(--shadow); }
.bcc-bubble:hover { background: var(--accent-hover); }
.bcc-bubble[hidden], .bcc-panel[hidden], .bcc-lead[hidden], .bcc-form[hidden], .bcc-link[hidden] { display: none; }
.bcc-panel { width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 32px)); display: flex; flex-direction: column;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 40px var(--shadow); overflow: hidden; }
.bcc-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--inverse-bg); color: var(--inverse-text); }
.bcc-head-btns { display: flex; align-items: center; gap: 10px; }
.bcc-head .bcc-link { color: var(--inverse-text); opacity: 0.85; }
.bcc-x { background: none; border: 0; color: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.bcc-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.bcc-msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.bcc-assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); }
.bcc-user { align-self: flex-end; background: var(--accent); color: var(--on-accent); }
.bcc-wait { opacity: 0.7; font-style: italic; }
.bcc-note { background: transparent; border-style: dashed; }
.bcc-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.bcc-form textarea { flex: 1; resize: none; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.bcc-link { background: none; border: 0; padding: 0; font: inherit; font-size: 0.85rem; color: var(--link); text-decoration: underline; cursor: pointer; }
.bcc-contact-link { margin: 0 12px 10px; align-self: flex-start; }
.bcc-lead { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.bcc-lead label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.bcc-lead input, .bcc-lead textarea { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.bcc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.bcc-err { color: var(--danger-text); font-size: 0.85rem; margin: 0; }
@media (max-width: 480px) { .bcc-bubble-text { display: none; } .bcc-bubble { padding: 14px; } }
@media print { .bcc { display: none; } }

/* ── Extras tab ──────────────────────────────────────────── */
.extras-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 16px 0; }
.extra h2 { font-size: 1.05rem; margin: 0 0 6px; }
.extra p { margin: 0 0 12px; }
.extra-sent { color: var(--success); font-weight: 700; }

/* Time dropdowns (Hours, Time off) */
.hours .range select.time-select { max-width: 150px; }
.dt-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.dt-inputs { display: flex; gap: 8px; flex-wrap: wrap; }
.dt-inputs input[type="date"], .dt-inputs select { flex: 1 1 140px; min-width: 0; }

/* ── Add-ons tab ─────────────────────────────────────────── */
.addon h2 { font-size: 1.1rem; margin: 0 0 4px; }
.addon-price { margin: 0 0 10px; }
.addon-price strong { font-size: 1.6rem; }
.addon-list { margin: 0 0 14px; padding-left: 18px; }
.addon-list li { margin: 3px 0; }
.addon-current { outline: 2px solid var(--terracotta); }
.addon-on { color: var(--success); font-weight: 700; margin: 0; }
.sms-opt-in { align-items: flex-start; }
.sms-opt-in small { font-weight: 400; }

/* ── Run Conmigo CRM ─────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 12px 0 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-soft); }
.crm-notes { list-style: none; padding: 0; }
.crm-notes li { padding: 10px 0; border-bottom: 1px solid var(--line); white-space: pre-wrap; }
