:root {
  --cream: #f5efe6;
  --cream-dark: #eadcc8;
  --cream-deep: #eee1d0;
  --gold: #c9a961;
  --charcoal: #1a1a1a;
  --gray: #756b61;
  --rose: #e8c5c0;
  --white: #fffaf2;
  --green: #617a54;
  --border: rgba(201, 169, 97, 0.2);
  --border-strong: rgba(201, 169, 97, 0.34);
  --shadow: 0 24px 80px rgba(26, 26, 26, 0.12);
  --shadow-soft: 0 12px 30px rgba(26, 26, 26, 0.08);
  --focus-ring: 0 0 0 3px rgba(201, 169, 97, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Demo-only chrome ("Live demo", "Reset demo data", "Demo tenant") is hidden
   in the real, logged-in product. It stays visible in the public /app/ demo. */
html.is-live .demo-only {
  display: none !important;
}

body {
  background: var(--cream);
  color: var(--charcoal);
  font-family: Inter, Heebo, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  margin: 0;
}

html[dir="rtl"] body {
  direction: rtl;
  font-family: Heebo, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[dir="rtl"] .brand {
  font-family: Georgia, "Times New Roman", serif;
}

html[dir="rtl"] h1 {
  font-family: Heebo, sans-serif;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

html[dir="rtl"] input,
html[dir="rtl"] select {
  direction: rtl;
}

html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="time"],
html[dir="rtl"] input[type="date"],
html[dir="rtl"] input[type="color"],
html[dir="rtl"] input[name="phone"],
html[dir="rtl"] input[name="instagram"],
html[dir="rtl"] input[name="slug"] {
  direction: ltr;
  text-align: start;
}

button,
input,
select,
a {
  font: inherit;
}

.topbar {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(245, 239, 230, 0.86);
  border-bottom: 1px solid rgba(201, 169, 97, 0.22);
  column-gap: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 16px clamp(18px, 4vw, 48px);
  position: sticky;
  row-gap: 12px;
  top: 0;
  z-index: 10;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 14px;
}

.topbar-user {
  align-items: center;
  background: rgba(255, 250, 242, 0.85);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(26, 26, 26, 0.05);
  display: flex;
  gap: 10px;
  padding: 5px 6px 5px 5px;
}

.topbar-user[hidden] {
  display: none;
}

.topbar-avatar {
  align-items: center;
  background: linear-gradient(135deg, var(--gold), #b8924a);
  border-radius: 50%;
  color: #fff;
  display: flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  width: 34px;
}

.topbar-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  max-width: 200px;
}

.topbar-user-name {
  color: var(--charcoal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user-role {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar-user-role.is-worker {
  color: var(--gray);
}

.topbar-signout {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--gray);
  cursor: pointer;
  display: flex;
  height: 34px;
  justify-content: center;
  padding: 0;
  transition: background 160ms ease, color 160ms ease;
  width: 34px;
}

.topbar-signout svg {
  height: 17px;
  width: 17px;
}

.topbar-signout:hover {
  background: rgba(201, 169, 97, 0.16);
  color: var(--charcoal);
}

.language-switch {
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.language-button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--gray);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 11px;
  transition: background 160ms ease, color 160ms ease;
}

.language-button:hover:not(.active) {
  color: var(--charcoal);
}

.language-button.active {
  background: var(--charcoal);
  color: var(--white);
}

.view-switch {
  align-items: center;
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.view-switch[hidden] {
  display: none;
}

.view-switch-btn {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--gray);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 12px;
  transition: background 160ms ease, color 160ms ease;
  white-space: nowrap;
}

.view-switch-btn:hover:not(.active) {
  color: var(--charcoal);
}

.view-switch-btn.active {
  background: var(--gold);
  color: var(--white);
}

.view-switch-select {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--charcoal);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.brand {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  letter-spacing: -0.05em;
  text-decoration: none;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab,
.button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  padding: 11px 18px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease,
    color 160ms ease, border-color 160ms ease;
}

.button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}

.button:hover {
  transform: translateY(-1px);
}

.tab {
  background: rgba(255, 250, 242, 0.72);
  color: var(--gray);
}

.tab:hover {
  background: rgba(201, 169, 97, 0.16);
  color: var(--charcoal);
}

.tab.active,
.button.primary {
  background: var(--charcoal);
  color: var(--white);
}

.tab.active:hover {
  background: var(--charcoal);
  color: var(--white);
}

.button.primary {
  box-shadow: 0 12px 30px rgba(26, 26, 26, 0.16);
}

.button.secondary {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--charcoal);
}

.button.accent {
  background: var(--gold);
  box-shadow: 0 12px 30px rgba(201, 169, 97, 0.28);
  color: var(--charcoal);
}

.button.danger {
  background: #6f1d1b;
  box-shadow: 0 12px 30px rgba(111, 29, 27, 0.22);
}

.link-button {
  color: var(--charcoal);
  display: inline-flex;
  text-decoration: none;
}

.link-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.65;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 28px 18px;
}

html[dir="rtl"] .sidebar {
  border-left: 1px solid var(--border);
  border-right: 0;
}

.sidebar-kicker {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-nav .tab {
  justify-content: flex-start;
  text-align: start;
  width: 100%;
}

.app-main {
  padding: clamp(18px, 4vw, 48px);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.business-hero,
.dashboard-header {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 28px;
}

.dashboard-controls {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.access-switch {
  align-items: center;
  display: flex;
  gap: 8px;
}

.access-switch span,
.worker-context span {
  white-space: nowrap;
}

.worker-context {
  align-items: center;
  display: flex;
  gap: 8px;
}

.access-buttons {
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.access-button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--gray);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
}

.access-button.active {
  background: var(--charcoal);
  color: var(--white);
}

.access-note {
  background: rgba(201, 169, 97, 0.14);
  border: 1px solid rgba(201, 169, 97, 0.24);
  border-radius: 999px;
  color: var(--gray);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 18px;
  margin-top: -6px;
  padding: 8px 12px;
}

.business-hero {
  align-items: start;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 34px;
  box-shadow: var(--shadow);
  flex-direction: column;
  padding: clamp(28px, 5vw, 56px);
}

.eyebrow {
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 74px);
  letter-spacing: -0.065em;
  line-height: 1.08;
  margin-bottom: 16px;
}

h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}

.layout,
.dashboard-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.view > .panel,
.view > .dashboard-grid {
  margin-bottom: 22px;
}

.view > :last-child {
  margin-bottom: 0;
}

.panel,
.metric {
  background: rgba(255, 250, 242, 0.78);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 24px;
}

.panel.muted {
  background: rgba(234, 220, 200, 0.54);
}

.full-width {
  grid-column: 1 / -1;
}

form {
  display: grid;
  gap: 16px;
}

.compact-form {
  margin-bottom: 18px;
}

label {
  color: var(--gray);
  display: grid;
  font-size: 14px;
  font-weight: 800;
  gap: 7px;
}

input,
select,
textarea {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--charcoal);
  padding: 13px 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: var(--focus-ring);
  outline: none;
}

.field-group {
  display: grid;
  gap: 8px;
}

input[type="tel"],
input[type="email"],
input[type="url"],
input[type="time"],
input[type="date"],
input[type="color"],
input[name="phone"],
input[name="instagram"],
input[name="slug"] {
  direction: ltr;
  text-align: start;
}

.field-label,
legend {
  color: var(--gray);
  font-size: 14px;
  font-weight: 800;
}

.field-help {
  color: var(--gray);
  font-size: 13px;
  margin: 0;
}

.slot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 45px;
}

.slot-button {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--charcoal);
  cursor: pointer;
  font-weight: 800;
  padding: 10px 13px;
}

.slot-button.selected {
  background: var(--charcoal);
  color: var(--white);
}

.slot-button.is-busy {
  background: transparent;
  border-style: dashed;
  border-color: rgba(54, 51, 47, 0.18);
  color: rgba(54, 51, 47, 0.42);
  cursor: not-allowed;
  font-weight: 600;
  position: relative;
  text-decoration: line-through;
  text-decoration-color: rgba(54, 51, 47, 0.35);
}

.slot-button.is-busy:hover {
  background: transparent;
}

.slot-grid-note {
  flex-basis: 100%;
  margin: 8px 0 0;
}

.checkbox {
  align-items: start;
  display: flex;
  font-weight: 600;
  line-height: 1.4;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 20px;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 16px;
}

.checkbox-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.staff-service-card {
  background: rgba(255, 250, 242, 0.64);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.form-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.action-center {
  margin-bottom: 18px;
}

.section-heading {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.assistant-grid,
.insight-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.assistant-grid {
  margin-top: 10px;
}

.insight-grid {
  margin-bottom: 18px;
}

.insight-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
}

.insight-card strong {
  display: block;
  margin-bottom: 6px;
}

.insight-card .item-actions {
  margin-top: 12px;
}

/* ── Today's schedule ─────────────────────────────────────────────────────── */
.today-schedule {
  margin-bottom: 18px;
}

.schedule-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.schedule-row {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  gap: 14px;
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.schedule-row:hover,
.schedule-row:focus-visible {
  border-color: var(--border-strong);
  box-shadow: 0 6px 18px rgba(26, 26, 26, 0.06);
  outline: none;
}

.schedule-time {
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 2px;
  min-width: 60px;
  padding-inline-end: 14px;
  text-align: center;
}

.schedule-time strong {
  color: var(--charcoal);
  font-size: 17px;
  line-height: 1.1;
}

.schedule-time span {
  color: var(--gray);
  font-size: 12px;
}

.schedule-info {
  flex: 1;
  min-width: 0;
}

.schedule-info-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2px;
}

.schedule-info-head strong {
  color: var(--charcoal);
}

.schedule-info p {
  color: var(--gray);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-actions {
  flex-shrink: 0;
}

.pill-next {
  background: var(--gold);
  color: var(--white);
}

.schedule-row.is-next {
  background: rgba(201, 169, 97, 0.08);
  border-color: var(--gold);
}

.schedule-row.is-past {
  opacity: 0.55;
}

.schedule-empty {
  background: rgba(255, 250, 242, 0.6);
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 18px;
  text-align: center;
}

.schedule-empty .empty {
  color: var(--charcoal);
  font-weight: 700;
}

/* ── Win-back send modal ──────────────────────────────────────────────────── */
.winback-list {
  display: grid;
  gap: 8px;
  margin: 6px 0;
  max-height: 50vh;
  overflow: auto;
}

.winback-row {
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  padding: 12px;
}

.winback-row input {
  flex-shrink: 0;
  margin-top: 3px;
}

.winback-row-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.winback-row-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.winback-row-head strong {
  color: var(--charcoal);
}

.winback-meta {
  color: var(--gray);
  font-size: 12px;
}

.winback-row-msg {
  color: var(--gray);
  font-size: 13px;
}

.winback-row.is-sent {
  opacity: 0.5;
}

@media (max-width: 600px) {
  .schedule-row {
    flex-wrap: wrap;
  }

  .schedule-actions {
    flex-basis: 100%;
  }

  .schedule-actions .mini-button {
    display: block;
    text-align: center;
    width: 100%;
  }
}

.assistant-question {
  color: var(--charcoal);
  font-weight: 900;
}

.metric span {
  color: var(--gold);
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  line-height: 1;
}

.metric p,
.business-hero p,
.panel p,
.empty {
  color: var(--gray);
}

.stack {
  display: grid;
  gap: 12px;
}

.dashboard-grid .stack {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.spaced {
  margin-top: 18px;
}

.item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
}

.item-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pill {
  background: rgba(201, 169, 97, 0.16);
  border-radius: 999px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  padding: 5px 9px;
}

.item p {
  color: var(--gray);
  margin-bottom: 0;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.settings-tab {
  align-items: center;
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--gray);
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.settings-tab:hover {
  background: rgba(201, 169, 97, 0.16);
  border-color: var(--border-strong);
  color: var(--charcoal);
}

.settings-tab:active {
  background: rgba(201, 169, 97, 0.28);
}

.settings-tab.active {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--white);
}

.settings-tab[hidden] {
  display: none;
}

.settings-panels {
  display: block;
}

.settings-section {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr);
}

.settings-section[hidden] {
  display: none;
}

.staff-access {
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 12px;
}

.staff-access-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray);
  margin: 0 0 8px;
}

.staff-access-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.staff-access-email-input,
.staff-access-level {
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  padding: 7px 9px;
}

.staff-access-email-input {
  flex: 1 1 160px;
  min-width: 0;
}

.staff-access-status {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.staff-access-email {
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal);
}

.staff-access-feedback {
  margin-top: 6px;
  min-height: 1em;
}

.break-skip-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.break-skip-row label {
  align-items: center;
  display: flex;
  gap: 6px;
  font-size: 13px;
  margin: 0;
}

.break-skip-row input[type="date"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  padding: 5px 8px;
}

.mini-button {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  padding: 8px 11px;
}

.confirm-overlay {
  align-items: center;
  background: rgba(26, 26, 26, 0.42);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 20px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 100;
}

.confirm-overlay[hidden] {
  display: none;
}

.confirm-dialog {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  max-width: 520px;
  padding: 28px;
  width: 100%;
}

.config-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.config-list div {
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.config-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

dt {
  color: var(--gray);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

dd {
  margin: 5px 0 0;
}

.cal-mode-switch {
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.cal-mode-button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--gray);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 12px;
}

.cal-mode-button.active {
  background: var(--charcoal);
  color: var(--white);
}

.cal-nav {
  align-items: center;
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: flex;
  gap: 2px;
  padding: 4px;
}

.cal-nav-button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--charcoal);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  min-width: 32px;
  padding: 7px 10px;
}

.cal-nav-button:hover {
  background: rgba(201, 169, 97, 0.18);
}

.cal-nav-button.cal-nav-today {
  font-size: 12px;
}

.cal-current-label {
  color: var(--charcoal);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.cal-hint {
  background: rgba(201, 169, 97, 0.14);
  border: 1px solid rgba(201, 169, 97, 0.24);
  border-radius: 999px;
  color: var(--gray);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 14px;
  padding: 8px 12px;
}

.cal-hint[hidden] {
  display: none;
}

.cal-toolbar-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

.customers-summary {
  color: var(--gray);
  font-size: 13px;
  font-weight: 700;
  margin: 4px 0 0;
}

.customer-toolbar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.customer-search-field {
  flex: 1 1 280px;
}

.customer-search-field input {
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23746a60' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 14px center;
  background-size: 16px 16px;
  padding-inline-start: 38px;
  width: 100%;
}

html[dir="rtl"] .customer-search-field input {
  background-position: right 14px center;
}

.customer-sort-field {
  min-width: 200px;
}

.segment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.segment-chip {
  align-items: center;
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--gray);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
  padding: 8px 14px;
}

.segment-chip:hover {
  background: rgba(201, 169, 97, 0.16);
}

.segment-chip.active {
  background: var(--charcoal);
  color: var(--white);
}

.segment-chip-count {
  background: rgba(26, 26, 26, 0.12);
  border-radius: 999px;
  color: var(--charcoal);
  font-size: 11px;
  font-weight: 900;
  min-width: 22px;
  padding: 2px 8px;
  text-align: center;
}

.segment-chip.active .segment-chip-count {
  background: rgba(255, 250, 242, 0.22);
  color: var(--white);
}

.customer-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
}

.customer-list-panel {
  padding: 14px;
}

.customer-cards {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 320px);
  min-height: 320px;
  overflow-y: auto;
  padding-inline-end: 4px;
}

.customer-card {
  align-items: stretch;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  text-align: start;
  transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
  width: 100%;
}

.customer-card:hover,
.customer-card:focus-visible {
  border-color: rgba(201, 169, 97, 0.5);
  box-shadow: 0 8px 22px rgba(26, 26, 26, 0.06);
  outline: none;
  transform: translateY(-1px);
}

.customer-card.is-active {
  border-color: var(--charcoal);
  box-shadow: 0 0 0 1px var(--charcoal);
}

.customer-card-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.customer-card-header strong {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.customer-card-sub {
  color: var(--gray);
  font-size: 13px;
  font-weight: 700;
}

.customer-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.customer-tag {
  background: rgba(201, 169, 97, 0.16);
  border-radius: 999px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
}

.customer-tag.is-vip {
  background: rgba(201, 169, 97, 0.32);
  color: var(--charcoal);
}

.customer-tag.is-blocked {
  background: rgba(111, 29, 27, 0.18);
  color: #6f1d1b;
}

.customer-card-foot {
  align-items: center;
  display: flex;
  font-size: 12px;
  gap: 10px;
  justify-content: space-between;
}

.customer-card-foot .pill {
  font-size: 11px;
  padding: 3px 8px;
}

.customer-empty {
  align-items: center;
  color: var(--gray);
  display: flex;
  font-weight: 800;
  justify-content: center;
  min-height: 200px;
  padding: 24px;
  text-align: center;
}

.customer-side-stack {
  display: grid;
  gap: 18px;
}

.priority-customer {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 6px;
  padding: 14px 16px;
  text-align: start;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  width: 100%;
}

.priority-customer:hover,
.priority-customer:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 6px 18px rgba(201, 169, 97, 0.18);
  outline: none;
  transform: translateY(-1px);
}

.priority-customer-top {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.priority-customer-top strong {
  color: var(--charcoal);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.priority-customer-line {
  color: var(--gray);
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.customer-drawer {
  background: var(--white);
  border-inline-start: 1px solid var(--border);
  box-shadow: -24px 0 60px rgba(26, 26, 26, 0.18);
  display: flex;
  flex-direction: column;
  height: 100vh;
  inset-block-start: 0;
  inset-inline-end: 0;
  max-width: 100vw;
  overflow-y: auto;
  padding: 28px 28px 32px;
  position: fixed;
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
  width: min(480px, 100vw);
  z-index: 80;
}

.customer-drawer[hidden] {
  display: none;
}

.customer-drawer.is-open {
  transform: translateX(0);
}

html[dir="rtl"] .customer-drawer {
  border-inline-end: 1px solid var(--border);
  border-inline-start: 0;
  box-shadow: 24px 0 60px rgba(26, 26, 26, 0.18);
  transform: translateX(-100%);
}

html[dir="rtl"] .customer-drawer.is-open {
  transform: translateX(0);
}

.drawer-backdrop {
  background: rgba(26, 26, 26, 0.42);
  inset: 0;
  position: fixed;
  z-index: 70;
}

.drawer-backdrop[hidden] {
  display: none;
}

.drawer-header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.drawer-close {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 18px;
  height: 34px;
  width: 34px;
}

.drawer-section {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 18px;
}

.drawer-section h3 {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.drawer-meta {
  display: grid;
  gap: 10px;
  margin: 0;
}

.drawer-meta dt {
  color: var(--gray);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.drawer-meta dd {
  color: var(--charcoal);
  font-size: 14px;
  font-weight: 700;
  margin: 2px 0 0;
}

.drawer-meta dd.muted {
  color: var(--gray);
  font-weight: 600;
}

.drawer-notes textarea {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--charcoal);
  font-family: inherit;
  font-size: 14px;
  min-height: 90px;
  padding: 12px 14px;
  resize: vertical;
  width: 100%;
}

.drawer-history-list {
  display: grid;
  gap: 8px;
}

.drawer-history-item {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: grid;
  gap: 2px;
  padding: 10px 14px;
}

.drawer-history-item .drawer-history-line {
  color: var(--gray);
  font-size: 12px;
  font-weight: 700;
}

.drawer-history-item strong {
  font-size: 13px;
  font-weight: 900;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.modal-overlay {
  align-items: center;
  background: rgba(26, 26, 26, 0.42);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 20px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 90;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-dialog {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 40px);
  max-width: 560px;
  overflow-y: auto;
  padding: 28px;
  width: 100%;
}

.modal-dialog form {
  gap: 14px;
}

.modal-dialog .form-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.message-filter-row {
  display: grid;
  gap: 18px;
  margin-bottom: 14px;
}

.message-filter-group {
  display: grid;
  gap: 8px;
}

.filter-group-label {
  color: var(--charcoal);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message-filter-row .segment-chips {
  margin-bottom: 0;
}

.message-list-panel {
  padding: 14px;
}

.message-cards {
  display: grid;
  gap: 12px;
}

.message-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.message-card:hover {
  border-color: rgba(201, 169, 97, 0.5);
  box-shadow: 0 8px 22px rgba(26, 26, 26, 0.06);
}

.message-card.is-sent {
  opacity: 0.7;
}

.message-card-top {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.message-card-identity {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-type-badge {
  align-items: center;
  background: rgba(201, 169, 97, 0.16);
  border-radius: 999px;
  color: var(--charcoal);
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  gap: 4px;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  text-transform: uppercase;
}

.message-type-badge.is-reminder {
  background: rgba(154, 169, 195, 0.28);
  color: #44557a;
}

.message-type-badge.is-winback {
  background: rgba(199, 153, 160, 0.32);
  color: #7a3946;
}

.message-customer-link {
  background: transparent;
  border: 0;
  color: var(--charcoal);
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: rgba(201, 169, 97, 0.4);
  text-underline-offset: 3px;
}

.message-customer-link:hover,
.message-customer-link:focus-visible {
  outline: none;
  text-decoration-color: var(--gold);
}

.message-context {
  color: var(--gray);
  font-size: 13px;
  font-weight: 700;
}

.message-textarea {
  background: rgba(255, 250, 242, 0.7);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--charcoal);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  min-height: 64px;
  padding: 12px 14px;
  resize: vertical;
  width: 100%;
}

.message-card.is-sent .message-textarea {
  background: rgba(116, 106, 96, 0.06);
}

.message-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.message-actions-left,
.message-actions-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-saved-hint {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.message-saved-hint.is-visible {
  opacity: 1;
}

.message-empty {
  align-items: center;
  color: var(--gray);
  display: grid;
  font-weight: 800;
  gap: 6px;
  justify-items: center;
  min-height: 220px;
  padding: 32px;
  text-align: center;
}

.message-empty p {
  margin: 0;
}

.campaign-templates {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 12px;
}

.campaign-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 22px;
  display: grid;
  gap: 10px;
  padding: 20px 22px;
  position: relative;
}

.campaign-card-top {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.campaign-card-top strong {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.campaign-card-target-count {
  background: rgba(201, 169, 97, 0.16);
  border-radius: 999px;
  color: var(--charcoal);
  font-size: 11px;
  font-weight: 900;
  padding: 4px 10px;
}

.campaign-card-target-count.is-zero {
  background: rgba(116, 106, 96, 0.12);
  color: var(--gray);
}

.campaign-card p {
  color: var(--gray);
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.campaign-card .campaign-card-sample {
  font-size: 12px;
}

.campaign-card .campaign-card-actions {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.recent-campaign-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
}

.recent-campaign-item strong {
  font-size: 14px;
  font-weight: 900;
}

.recent-campaign-item p {
  color: var(--gray);
  font-size: 12px;
  font-weight: 700;
  margin: 0;
}

.recent-campaign-item .item-actions {
  margin-top: 6px;
}

.settings-form {
  gap: 14px;
}

#settings-view .layout {
  grid-template-columns: minmax(0, 1fr);
}

#settings-view .form-row,
#settings-view .compact-form .form-row,
#availability-form .form-row,
#break-form .form-row {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.settings-form input[type="color"] {
  height: 44px;
  padding: 4px;
}

.weekly-hours {
  display: grid;
  gap: 8px;
}

.weekly-hour-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  justify-content: space-between;
}

.weekly-hour-toggle {
  align-items: center;
  color: var(--charcoal);
  display: flex;
  flex-direction: row;
  font-size: 14px;
  font-weight: 800;
  gap: 8px;
  min-width: 96px;
}

.weekly-hour-times {
  align-items: center;
  display: flex;
  gap: 8px;
}

.weekly-hour-times input[type="time"] {
  padding: 9px 10px;
}

.weekly-hour-row.is-off .weekly-hour-times {
  opacity: 0.4;
}

.weekly-hour-sep {
  color: var(--gray);
  font-weight: 800;
}

.cal-closed {
  background: rgba(116, 106, 96, 0.07);
  inset-inline: 0;
  pointer-events: none;
  position: absolute;
}

.customer-preview-banner {
  background: rgba(201, 169, 97, 0.14);
  border: 1px solid rgba(201, 169, 97, 0.24);
  border-radius: 999px;
  color: var(--gray);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 12px;
  padding: 7px 14px;
}

.customer-hero-meta {
  color: var(--gray);
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

.hero-meta-link {
  color: var(--gold);
  text-decoration: none;
}

.hero-meta-link:hover {
  text-decoration: underline;
}

.customer-confirmation {
  background: rgba(201, 169, 97, 0.16);
  border: 1px solid rgba(201, 169, 97, 0.34);
}

.customer-confirmation[hidden] {
  display: none;
}

.customer-confirmation h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}

.customer-confirmation .confirmation-detail {
  color: var(--charcoal);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.customer-footer {
  color: var(--gray);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-top: 24px;
  text-align: center;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .message-filter-row {
    flex-direction: column;
    gap: 10px;
  }

  .message-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .message-actions-left,
  .message-actions-right {
    justify-content: space-between;
  }
}

@media (max-width: 900px) {
  .customer-layout {
    grid-template-columns: 1fr;
  }

  .customer-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  /* In the column layout, the row-oriented `flex: 1 1 280px` made the search
     field 280px TALL. Reset it so it's just the height of the input. */
  .customer-search-field,
  .customer-sort-field {
    flex: 0 0 auto;
    min-width: 0;
  }

  /* On mobile let the page scroll as one surface instead of a nested,
     fixed-height list that pushes results below the fold. */
  .customer-cards {
    max-height: none;
    min-height: 0;
  }

  .customer-drawer {
    width: 100vw;
  }

  .modal-dialog .form-row {
    grid-template-columns: 1fr;
  }
}

.cal-shell {
  position: relative;
}

.cal-grid-wrapper {
  background: rgba(255, 250, 242, 0.78);
  border: 1px solid var(--border);
  border-radius: 28px;
  max-height: calc(100vh - 280px);
  min-height: 480px;
  overflow: auto;
  padding: 0;
  position: relative;
}

.cal-grid-wrapper.is-week-view {
  overflow-x: auto;
}

.cal-grid-wrapper.is-week-view .cal-grid {
  min-width: 100%;
  width: max-content;
}

.cal-grid {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 100%;
  position: relative;
}

.cal-header-row,
.cal-body-row {
  display: grid;
  grid-template-columns: 64px repeat(var(--cal-cols, 1), minmax(var(--cal-col-min, 160px), 1fr));
}

.cal-header-row {
  background: rgba(255, 250, 242, 0.98);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 3;
}

.cal-header-cell {
  border-inline-start: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
}

.cal-header-cell.cal-time-corner {
  border-inline-start: 0;
}

.cal-header-cell .cal-header-name {
  color: var(--charcoal);
  font-size: 14px;
  font-weight: 900;
}

.cal-header-cell .cal-header-sub {
  color: var(--gray);
  font-size: 12px;
  font-weight: 700;
}

.cal-header-cell .cal-staff-dot {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.cal-staff-dot::before {
  background: var(--cal-color, var(--gold));
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 8px;
  width: 8px;
}

.cal-body-row {
  position: relative;
}

.cal-time-axis {
  border-inline-end: 1px solid var(--border);
  position: relative;
}

.cal-time-label {
  color: var(--gray);
  font-size: 11px;
  font-weight: 800;
  height: var(--cal-hour-height, 60px);
  padding: 6px 8px 0;
  position: relative;
  text-align: end;
}

.cal-time-label:not(:first-child)::before {
  background: var(--border);
  content: "";
  height: 1px;
  inset-inline-end: 0;
  inset-inline-start: auto;
  position: absolute;
  top: 0;
  width: 12px;
}

.cal-column {
  border-inline-start: 1px solid var(--border);
  position: relative;
  touch-action: manipulation;
}

.cal-press-marker {
  align-items: center;
  background: rgba(201, 169, 97, 0.22);
  border: 1.5px dashed var(--gold);
  border-radius: 8px;
  color: var(--charcoal);
  display: flex;
  font-size: 11px;
  font-weight: 600;
  inset-inline-end: 10px;
  inset-inline-start: 10px;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  z-index: 4;
}

.cal-hour-line {
  border-top: 1px solid var(--border);
  height: var(--cal-hour-height, 60px);
}

.cal-hour-line:first-child {
  border-top: 0;
}

.cal-half-line {
  border-top: 1px dashed rgba(201, 169, 97, 0.18);
  height: calc(var(--cal-hour-height, 60px) / 2);
}

.cal-block {
  border-radius: 14px;
  font-size: 13px;
  inset-inline-end: 6px;
  inset-inline-start: 6px;
  overflow: hidden;
  padding: 8px 10px;
  position: absolute;
}

.cal-booking {
  background: var(--cal-color, var(--gold));
  border: 1px solid rgba(26, 26, 26, 0.18);
  color: var(--charcoal);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.cal-booking:hover,
.cal-booking:focus-visible {
  box-shadow: 0 10px 24px rgba(26, 26, 26, 0.18);
  outline: none;
  transform: translateY(-1px);
}

.cal-booking.is-active {
  box-shadow: 0 0 0 2px var(--charcoal);
}

.cal-booking strong {
  display: block;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-booking .cal-booking-sub {
  color: rgba(26, 26, 26, 0.74);
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-booking.is-cancelled {
  opacity: 0.45;
  text-decoration: line-through;
}

.cal-break {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(116, 106, 96, 0.22) 0,
      rgba(116, 106, 96, 0.22) 6px,
      rgba(116, 106, 96, 0.06) 6px,
      rgba(116, 106, 96, 0.06) 12px
    );
  border: 1px dashed rgba(116, 106, 96, 0.4);
  color: var(--gray);
  font-weight: 800;
  font-size: 12px;
}

.cal-off {
  align-items: center;
  background: rgba(116, 106, 96, 0.06);
  color: var(--gray);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  inset: 0;
  justify-content: center;
  position: absolute;
  text-align: center;
}

.cal-now-line {
  background: var(--gold);
  height: 2px;
  inset-inline: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.cal-now-line::before {
  background: var(--gold);
  border-radius: 999px;
  content: "";
  height: 8px;
  inset-inline-start: -4px;
  position: absolute;
  top: -3px;
  width: 8px;
}

.cal-empty-state {
  align-items: center;
  color: var(--gray);
  display: flex;
  font-weight: 800;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: absolute;
  text-align: center;
}

.cal-popover {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  display: block;
  inset-block-start: 12px;
  inset-inline-end: 12px;
  max-width: min(360px, calc(100% - 24px));
  padding: 18px 20px;
  position: absolute;
  width: 320px;
  z-index: 12;
}

.cal-popover[hidden] {
  display: none;
}

.cal-popover .cal-popover-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cal-popover h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

.cal-popover .cal-popover-close {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  height: 28px;
  width: 28px;
}

.cal-popover .cal-popover-meta {
  color: var(--gray);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 4px;
  margin-bottom: 14px;
}

.cal-popover .cal-popover-meta strong {
  color: var(--charcoal);
}

.cal-popover .item-actions {
  margin-top: 0;
}

/* ── Mobile app shell: fixed bottom tab bar + "More" sheet ────────────────────
   These components are hidden on desktop and switched on at ≤900px, where the
   desktop sidebar is replaced by a native-app-style bottom navigation. */
.bottom-nav {
  display: none;
}

.bottom-tab {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--gray);
  cursor: pointer;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  gap: 3px;
  letter-spacing: -0.01em;
  padding: 8px 2px;
  -webkit-tap-highlight-color: transparent;
}

.bottom-tab svg {
  height: 24px;
  width: 24px;
  transition: color 160ms ease, transform 160ms ease;
}

.bottom-tab.active {
  color: var(--charcoal);
}

.bottom-tab.active svg {
  color: var(--gold);
  transform: translateY(-1px);
}

.more-sheet-backdrop {
  background: rgba(26, 26, 26, 0.42);
  inset: 0;
  position: fixed;
  z-index: 85;
}

.more-sheet-backdrop[hidden] {
  display: none;
}

.more-sheet {
  background: var(--white);
  border-radius: 26px 26px 0 0;
  bottom: 0;
  box-shadow: 0 -20px 60px rgba(26, 26, 26, 0.18);
  display: grid;
  gap: 4px;
  inset-inline: 0;
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  position: fixed;
  transform: translateY(100%);
  transition: transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 86;
}

.more-sheet[hidden] {
  display: none;
}

.more-sheet.is-open {
  transform: translateY(0);
}

.more-sheet-handle {
  background: var(--border-strong);
  border-radius: 999px;
  height: 4px;
  justify-self: center;
  margin-bottom: 8px;
  width: 42px;
}

.more-sheet-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 16px;
  color: var(--charcoal);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  gap: 14px;
  padding: 15px 12px;
  text-align: start;
  width: 100%;
}

.more-sheet-item svg {
  color: var(--gray);
  height: 22px;
  width: 22px;
}

.more-sheet-item.active {
  background: rgba(201, 169, 97, 0.14);
}

.more-sheet-item.active svg {
  color: var(--gold);
}

@media (max-width: 900px) {
  /* minmax(0, 1fr) — not plain 1fr — so the main column can shrink below its
     content's intrinsic width. Without this, a wide week calendar stretches the
     whole page sideways instead of scrolling inside its own container. */
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-main {
    min-width: 0;
  }

  /* Keep the calendar within the viewport and let it scroll horizontally. */
  .cal-shell,
  .cal-grid-wrapper {
    max-width: 100%;
  }

  /* Sidebar is replaced by the bottom tab bar on mobile. */
  .sidebar {
    display: none;
  }

  .bottom-nav {
    align-items: stretch;
    background: rgba(255, 250, 242, 0.94);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
    bottom: 0;
    display: flex;
    inset-inline: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    position: fixed;
    z-index: 40;
  }

  /* Leave room so content never hides behind the fixed bar. */
  .app-main {
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }

  .business-hero,
  .dashboard-header {
    align-items: start;
    flex-direction: column;
  }

  .topbar {
    position: sticky;
  }

  .layout,
  .dashboard-grid,
  .assistant-grid,
  .insight-grid,
  .form-row,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cal-grid-wrapper {
    max-height: none;
  }

  .cal-header-row,
  .cal-body-row {
    grid-template-columns: 48px repeat(var(--cal-cols, 1), minmax(120px, 1fr));
  }

  .cal-popover {
    inset-inline-end: 12px;
    inset-inline-start: 12px;
    max-width: none;
    position: fixed;
    top: auto;
    bottom: 12px;
    width: auto;
  }
}

/* ── Phone tuning (≤600px) — desktop layout is unaffected ─────────────────── */
@media (max-width: 600px) {
  /* Reorganize the top bar into two tidy rows instead of a ragged jumble:
       Row 1 — logo (start)  ·  account name + sign out (end)
       Row 2 — language toggle  ·  access-mode switch
     The verbose "Access mode" / "Acting as" labels and the long email are
     hidden on phones to cut clutter. */
  .topbar {
    align-items: center;
    column-gap: 10px;
    padding: 12px 16px;
    row-gap: 12px;
  }

  .brand {
    font-size: 26px;
    order: 1;
  }

  .topbar-actions {
    gap: 10px;
    margin-inline-start: auto;
    order: 2;
  }

  /* Keep the user's name readable but compact on a phone. */
  .topbar-user-info {
    max-width: 120px;
  }

  .language-button {
    padding: 6px 9px;
  }

  /* Tame the oversized display type for small screens. */
  h1 {
    font-size: 30px;
    letter-spacing: -0.03em;
    line-height: 1.15;
  }

  .business-hero h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 20px;
  }

  .metric {
    padding: 18px;
  }

  .metric span {
    font-size: 32px;
  }

  /* Roomier touch targets; keep room for the fixed bottom nav. */
  .app-main {
    padding: 20px 16px calc(86px + env(safe-area-inset-bottom, 0px));
  }

  .panel {
    border-radius: 22px;
    padding: 18px;
  }

  .section-heading {
    flex-direction: column;
    gap: 10px;
  }

  .dashboard-controls {
    width: 100%;
  }

  .cal-toolbar-group {
    width: 100%;
  }

  /* iOS Safari auto-zooms when a focused field's text is under 16px.
     Force 16px on phones to stop the jarring zoom-in on tap. */
  input,
  select,
  textarea,
  .message-textarea,
  .drawer-notes textarea {
    font-size: 16px;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   Public customer booking mode (/book/<tenant>) — hides manager chrome and
   shows only the customer booking view + customer account UI.
   ════════════════════════════════════════════════════════════════════════════ */

html.is-booking .sidebar,
html.is-booking .bottom-nav,
html.is-booking .more-sheet,
html.is-booking .more-sheet-backdrop,
html.is-booking .customer-preview-banner,
html.is-booking #account-control {
  display: none !important;
}

/* Single-column layout (no sidebar). */
html.is-booking .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

/* Only the customer view is shown; never reveal manager views. */
html.is-booking .app-main > .view:not(#customer-view) {
  display: none !important;
}

/* The "What customers get" panel is owner-facing marketing — hide it for real
   customers and let the booking form span the full width. */
html.is-booking #customer-booking-layout {
  grid-template-columns: minmax(0, 1fr);
  max-width: 100%;
}

html.is-booking #customer-booking-layout .panel.muted {
  display: none;
}

html.is-booking .app-main {
  padding-bottom: 0;
}

/* Center the booking view as one clean, focused column. */
html.is-booking #customer-view {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  padding: 24px clamp(16px, 4vw, 28px) 48px;
}

/* Hero proportioned to the focused column (the global h1 is up to 74px). */
html.is-booking .business-hero {
  padding: clamp(24px, 4vw, 36px);
  border-radius: 24px;
  margin-bottom: 18px;
}

html.is-booking #customer-title {
  font-size: clamp(32px, 7vw, 46px);
  margin-bottom: 12px;
}

/* Auth bar in the hero. */
.booking-authbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.booking-authbar-hi {
  font-weight: 700;
  color: var(--charcoal);
  font-size: 14px;
}

.booking-authbar-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.booking-link {
  background: none;
  border: none;
  color: var(--gold);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 2px;
  font-family: inherit;
}

.booking-link:hover {
  color: var(--charcoal);
  text-decoration: underline;
}

/* Modal overlay + card. */
.booking-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(26, 26, 26, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.booking-auth-overlay[hidden] {
  display: none;
}

.booking-auth-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 380px;
  padding: 32px 28px 28px;
  max-height: 90vh;
  overflow-y: auto;
}

.booking-auth-close {
  position: absolute;
  inset-inline-end: 14px;
  inset-block-start: 12px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--gray);
  cursor: pointer;
}

.booking-auth-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: var(--charcoal);
}

.booking-auth-sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--gray);
  line-height: 1.5;
}

.booking-auth-field {
  display: block;
  margin-bottom: 14px;
}

.booking-auth-field > span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray);
  margin-bottom: 6px;
}

.booking-auth-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  background: var(--cream);
}

.booking-auth-field input:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

.booking-auth-submit {
  width: 100%;
  margin-top: 4px;
}

.booking-auth-alt {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 12px;
}

.booking-auth-error {
  color: #b94a48;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px;
}

.booking-turnstile {
  margin-bottom: 14px;
}

/* Inline booking message (slot taken / errors) above the form. */
.booking-inline-msg {
  background: rgba(201, 169, 97, 0.12);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal);
  margin: 0 0 14px;
}

.booking-inline-msg.is-error {
  background: rgba(185, 74, 72, 0.1);
  border-color: rgba(185, 74, 72, 0.4);
  color: #b94a48;
}

/* "Booking as <name>" line shown to signed-in customers instead of name/phone. */
.booking-as-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(201, 169, 97, 0.1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0 0 6px;
}

.booking-as-who {
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
}

.booking-as-note .booking-link {
  flex: none;
}

/* Post-booking perks prompt on the confirmation panel. */
.booking-post-extras {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.booking-post-hint {
  font-size: 13px;
  color: var(--gray);
  margin: 0 0 10px;
}

/* My appointments list. */
.booking-appt-list {
  display: grid;
  gap: 12px;
}

.booking-appt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.booking-appt-main {
  display: grid;
  gap: 2px;
  font-size: 13px;
  color: var(--gray);
}

.booking-appt-main strong {
  color: var(--charcoal);
  font-size: 14px;
}

.booking-appt-biz {
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
}

.booking-appt-actions {
  flex-shrink: 0;
}

body.booking-modal-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .booking-auth-card {
    max-width: 100%;
  }
}
