:root {
  --mbs-primary: #8B6914;
  --mbs-secondary: #D4A853;
  --mbs-dark: #1a1a1a;
  --mbs-light: #f8f5f0;
  --mbs-text: #333333;
  --mbs-muted: #8a8275;
  --mbs-white: #ffffff;
  --mbs-border: #e7e0d3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  color: var(--mbs-text);
  background: var(--mbs-light);
  line-height: 1.55;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--mbs-dark);
}
.topbar .brand {
  color: var(--mbs-secondary);
  font-weight: 600;
  letter-spacing: .04em;
  text-decoration: none;
  font-size: 1.05rem;
}
.topbar-links { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .5rem 1.25rem; }
.topbar .logout { color: #cfc6b4; text-decoration: none; font-size: .9rem; }
.topbar .logout:hover { color: #fff; }

.container { max-width: 760px; margin: 0 auto; padding: 28px 20px 64px; }

h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 6px; color: var(--mbs-dark); }
h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 14px; color: var(--mbs-primary); }

.muted { color: var(--mbs-muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
a { color: var(--mbs-primary); }

.card {
  background: var(--mbs-white);
  border: 1px solid var(--mbs-border);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 18px;
}
.card--narrow { max-width: 420px; margin: 48px auto; }
.emoji { font-size: 2.4rem; margin-bottom: 8px; }

.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.stack label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 5px; }
.stack input {
  display: block;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--mbs-border);
  border-radius: 9px;
  font-size: 1rem;
  font-family: inherit;
}
.stack input:focus { outline: 2px solid var(--mbs-secondary); border-color: var(--mbs-secondary); }
.input--readonly { background: var(--mbs-light); color: var(--mbs-muted); cursor: default; }

/* SMS opt-in consent — required for Twilio A2P 10DLC campaign approval */
.stack label.consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-weight: 400;
  font-size: .78rem;
  line-height: 1.5;
  color: var(--mbs-muted);
  margin: 2px 0 4px;
}
.stack label.consent input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 0;
  accent-color: var(--mbs-primary);
}
.stack label.consent a { color: var(--mbs-primary); }

.btn {
  display: inline-block;
  border: none;
  border-radius: 9px;
  padding: 13px 22px;
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn--primary { background: var(--mbs-primary); color: #fff; }
.btn--primary:hover { background: #745710; }
.btn--ghost { background: transparent; color: var(--mbs-primary); border: 1px solid var(--mbs-primary); }
.btn--ghost:hover { background: var(--mbs-light); }

.greeting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.greeting .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.membership-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }

.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.badge--active { background: #e3f2e3; color: #2e7d32; }
.badge--canceled, .badge--cancelled { background: #f3e3e3; color: #b3261e; }
.badge--warn { background: #fbecd2; color: #8a5a00; }
.badge--credit { background: #f3edda; color: var(--mbs-primary); }
.badge--completed { background: #e3f2e3; color: #2e7d32; }
.badge--missed { background: #f3e3e3; color: #b3261e; }
.badge--rescheduled { background: #e6ecfa; color: #35508c; }

.credit-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.credit-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 92px;
  padding: 14px 16px;
  background: var(--mbs-light);
  border: 1px solid var(--mbs-border);
  border-radius: 12px;
}
.credit-count { font-size: 1.5rem; font-weight: 700; color: var(--mbs-primary); }
.credit-name { font-size: .78rem; color: var(--mbs-muted); text-align: center; }

.booking-list { list-style: none; margin: 0; padding: 0; }
.booking-list li { padding: 10px 0; border-bottom: 1px solid var(--mbs-border); }
.booking-list li:last-child { border-bottom: none; }
.booking-when { font-weight: 600; font-size: .92rem; }
.booking-what { color: var(--mbs-muted); font-size: .9rem; }
.booking-list--past .booking-when { font-weight: 500; color: var(--mbs-text); }
.booking-deposit { font-size: .85rem; color: var(--mbs-muted); margin-top: 5px; }
.link { font-weight: 600; text-decoration: none; }

.divider { display: flex; align-items: center; text-align: center; color: var(--mbs-muted); margin: 22px 0 4px; font-size: .85rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-bottom: 1px solid var(--mbs-border); }
.divider span { padding: 0 12px; }

.flash { padding: 12px 16px; border-radius: 9px; margin-bottom: 16px; font-size: .92rem; }
.flash-error { background: #f9e4e2; color: #b3261e; }
.flash-success { background: #e3f2e3; color: #2e7d32; }
.flash-notice { background: var(--mbs-light); color: var(--mbs-text); border: 1px solid var(--mbs-border); }

/* Cancellation — deliberately quiet. Not a button anyone should hit by accident. */
.cancel-block { margin-top: 1rem; }
.cancel-block summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: #888;
}
.cancel-block summary:hover { color: #555; }
.btn--danger { border-color: #c0392b; color: #c0392b; }
.btn--danger:hover { background: #c0392b; color: #fff; }

.membership-picker { margin-top: 1rem; }
.membership-picker form, .upgrade-block form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.membership-picker select, .upgrade-block select {
    padding: 8px 10px;
    border: 1px solid var(--mbs-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: .92rem;
    min-width: 260px;
}
.upgrade-block { margin-top: 1rem; }
.upgrade-block summary { cursor: pointer; font-size: .9rem; color: var(--mbs-primary); font-weight: 600; }

/* Client notes box */
textarea {
    width: 100%;
    padding: 12px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    background: #fff;
    color: inherit;
}
textarea:focus { outline: 2px solid #D4A853; outline-offset: 1px; border-color: #8B6914; }

/* Outstanding balance */
.balance-blocked { border-left: 4px solid #c0392b; }

/* Booking hold countdown (pay.html) */
.mbs-countdown {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--mbs-light);
  border: 1px solid var(--mbs-border);
  font-size: .92rem;
  color: var(--mbs-text);
}
.mbs-countdown__time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.1rem; color: var(--mbs-primary); }
.mbs-countdown--warm { background: #fdf1de; border-color: #eecf9a; }
.mbs-countdown--warm .mbs-countdown__time { color: #a86616; }
.mbs-countdown--urgent { background: #fbe9e7; border-color: #e6b3ac; }
.mbs-countdown--urgent .mbs-countdown__time { color: #c0392b; }

/* Help page (#227) */
.help-head { margin-bottom: 18px; }
.help-head h1 { margin: 0 0 4px; }
.help-faq h2, .help-form h2 { font-size: 1rem; color: var(--mbs-primary); margin: 0 0 8px; }
.help-faq details { border-top: 1px solid var(--mbs-border); padding: 12px 0; }
.help-faq details:first-of-type { border-top: 0; }
.help-faq summary { cursor: pointer; font-weight: 600; color: var(--mbs-dark); }
.help-faq details p { margin: 8px 0 0; }
.help-form { margin-top: 18px; }
.help-form textarea { width: 100%; min-height: 120px; resize: vertical; font: inherit; padding: 10px 12px; border: 1px solid var(--mbs-border); border-radius: 9px; }
.help-form textarea[aria-invalid="true"], .help-form input[aria-invalid="true"] { border-color: #b3261e; }
.help-who { font-size: .9rem; background: var(--mbs-light); border-radius: 8px; padding: 9px 12px; margin: 0; }
.help-err { color: #b3261e; font-size: .85rem; margin: -4px 0 0; }
.help-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.help-done { display: flex; flex-direction: column; gap: 6px; }
.help-done p { margin: 0; }
.help-tick { width: 36px; height: 36px; border-radius: 50%; background: #e3f2e3; color: #2e7d32; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.flash-help { color: inherit; font-weight: 600; margin-left: 4px; }

/* Members-only services (docs/superpowers/specs/2026-10-02-members-only-gate-design.md) */
.btn--block { display: block; width: 100%; }
.badge--members { background: var(--mbs-dark); color: var(--mbs-secondary); }
.pill-dark {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  background: var(--mbs-dark);
  color: var(--mbs-secondary);
  font-size: .75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
}
/* Bookable services: one card each, one column on a phone. */
.service-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.service-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--mbs-white);
  border: 1px solid var(--mbs-border);
  border-top: 3px solid var(--mbs-secondary);
  border-radius: 12px;
  padding: 16px;
}
.service-card--members { border-top-color: var(--mbs-dark); }
.service-card__name { margin: 0; font-size: 1.05rem; font-weight: 600; line-height: 1.3; color: var(--mbs-dark); }
.service-card .badge { margin-left: 0; align-self: flex-start; }
.service-card__meta { display: flex; align-items: center; gap: 5px; font-size: .82rem; color: #6b6457; }
.service-card__desc {
  margin: 0;
  font-size: .88rem;
  color: #5f584c;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.service-card__foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--mbs-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.service-card__terms { font-size: .88rem; font-weight: 500; color: var(--mbs-dark); }
.service-card .btn { padding: 10px 16px; }
.btn:focus-visible { outline: 3px solid var(--mbs-secondary); outline-offset: 2px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* "Yours as a member": the service a member can book with a point, first. */
.member-feature {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 2px solid var(--mbs-primary);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}
.member-feature__name { font-size: 1.1rem; color: var(--mbs-dark); }
.member-feature .btn { margin-top: 4px; }
.member-prompt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fbf8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 14px;
}
.member-prompt strong { color: var(--mbs-dark); }

/* The gate pages: /book/<slug> */
.gate { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.gate .card { margin-bottom: 0; }
.gate-back { font-size: .9rem; font-weight: 500; text-decoration: none; align-self: flex-start; }
.gate-head { display: flex; flex-direction: column; gap: 10px; }
.gate-head h1 { margin: 0; line-height: 1.2; }
.gate-head p { margin: 0; color: #5f584c; }
.gate-lock {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--mbs-dark);
  color: var(--mbs-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gate-actions { display: flex; flex-direction: column; gap: 10px; }
.gate-aside { display: flex; flex-direction: column; gap: 4px; padding: 0 4px; }
.gate-aside strong { color: var(--mbs-dark); }
.gate-aside .link { align-self: flex-start; padding: 6px 0; }
.gate-aside summary { cursor: pointer; font-weight: 600; color: var(--mbs-primary); padding: 6px 0; }
.gate-aside .tier-list { margin-top: 8px; }
.gate-option { display: flex; flex-direction: column; gap: 12px; }
.gate-option__text { display: flex; flex-direction: column; gap: 4px; }
.gate-option__text strong { color: var(--mbs-dark); }

.tier-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; border: 0; }
.tier-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--mbs-white);
  border: 1px solid var(--mbs-border);
  border-radius: 14px;
  padding: 14px 16px;
}
label.tier-row { cursor: pointer; }
label.tier-row:has(input:checked) { border: 2px solid var(--mbs-primary); padding: 13px 15px; }
.tier-row input[type="radio"] { accent-color: var(--mbs-primary); flex: 0 0 auto; }
.tier-row__name { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.tier-row__name strong { color: var(--mbs-dark); }
.tier-row__price { font-weight: 600; color: var(--mbs-dark); white-space: nowrap; }
.tier-row__price small { font-weight: 400; color: #5f584c; }

/* Point-paid booking confirmation (pay.html, state booked_with_point) */
.booked { display: flex; flex-direction: column; gap: 14px; }
.booked h1, .booked p { margin: 0; }
.booked__tick {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #2e6b3a;
  display: flex;
  align-items: center;
  justify-content: center;
}
.booked__what strong { font-size: 1.1rem; color: var(--mbs-dark); }
.booked__paid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #f3edda;
  color: #4f3b0a;
  border-radius: 10px;
  padding: 12px;
  font-size: .9rem;
}

/* "Working on it" overlay (dashboard.html): up from the moment an appointment
   cancel or reschedule is submitted until the next page loads. */
.busy-overlay {
    --busy-accent: var(--mbs-primary);
    --busy-line: var(--mbs-border);
    --busy-muted: var(--mbs-muted);
    --busy-text: var(--mbs-text);
    --busy-radius: 9px;
}
/* busy-overlay:start
   The same text in crm/static/style.css and portal/static/style.css, over each
   app's own colours through the --busy-* names set just above;
   crm/tests/test_busy_overlay_parity.py holds them equal. */
.busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(26, 26, 26, 0.55);
}
.busy-overlay[hidden] { display: none; }
.busy-box {
    max-width: 26rem;
    padding: 1.5rem;
    background: #fff;
    color: var(--busy-text);
    border: 1px solid var(--busy-line);
    border-top: 4px solid var(--busy-accent);
    border-radius: var(--busy-radius);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.busy-title { margin: 0.75rem 0 0.4rem; font-weight: 600; font-size: 1.05rem; }
.busy-detail { margin: 0; color: var(--busy-muted); font-size: 0.9rem; }
.busy-stuck { margin: 1rem 0 0; font-size: 0.9rem; }
.busy-stuck[hidden] { display: none; }
.busy-reload,
.busy-reload:hover {
    display: inline;
    padding: 0;
    border: 0;
    background: none;
    color: var(--busy-accent);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}
.busy-spinner {
    display: inline-block;
    width: 1.75rem;
    height: 1.75rem;
    border: 3px solid var(--busy-line);
    border-top-color: var(--busy-accent);
    border-radius: 50%;
    animation: busy-spin 0.9s linear infinite;
}
@keyframes busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy-spinner { animation: none; } }
form[data-busy-submitted] button[type="submit"] { opacity: 0.6; cursor: default; }
/* busy-overlay:end */
