:root {
  --brand: #c9664a;        /* Rise coral */
  --brand-dark: #b0553b;   /* coral pressed */
  --plum: #4a2c3a;         /* Rise deep plum */
  --plum-deep: #3a2530;
  --ink: #3a2530;
  --muted: #7a6670;
  --bg: #f5f0ea;           /* warm cream */
  --card: #ffffff;
  --line: #e8ddd3;
  --sage: #7c9e87;
  --danger: #b83232;
  --radius: 16px;
  --shadow: 0 3px 14px rgba(74, 44, 58, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--plum);
  color: #fff;
}
.topbar img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 650; letter-spacing: 0.2px; }
.topbar .spacer { flex: 1; }
.topbar button {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 0;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}
.topbar button:active { background: rgba(255,255,255,0.28); }

.hero {
  text-align: center;
  padding: 40px 22px 32px;
  margin-top: 8px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  background:
    linear-gradient(rgba(233, 229, 223, 0.58), rgba(233, 229, 223, 0.84)),
    url('https://risechiro.com.au/wp-content/uploads/2026/04/Rise-Chiro-Team-Photos-15-scaled.jpg')
      center 20% / cover;
}
/* Per-location hero banner on the logged-in screen */
.page-hero {
  height: 150px;
  border-radius: 18px;
  margin: 10px 0 4px;
  background-size: cover;
  background-position: center 22%;
  background-color: var(--bg);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-hero-label {
  color: var(--plum);
  font-weight: 700;
  font-size: 27px;
  letter-spacing: 0.2px;
  text-align: center;
}

/* "Join Rise Rewards" business enquiry card */
.join-card {
  margin-top: 22px;
  text-align: center;
  background: var(--plum);
  border: 0;
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
}
.join-card h3 { color: #fff; margin: 0 0 8px; font-size: 20px; }
.join-card p { color: rgba(255, 255, 255, 0.8); margin: 0 auto 18px; max-width: 40ch; font-size: 14px; }
.join-card .primary { width: auto; margin: 0; background: var(--brand); padding: 13px 28px; }
.join-card .primary:active { background: var(--brand-dark); }
.hero .logo { width: min(240px, 70%); height: auto; }
.hero h1 { font-size: 22px; margin: 20px 0 6px; color: var(--plum); }
.hero p {
  color: var(--plum);
  margin: 0 auto;
  max-width: 34ch;
  line-height: 1.5;
  font-weight: 500;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--plum);
  margin: 14px 0 6px;
}

input[type="text"], input[type="password"], input[type="tel"], textarea, select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 16px;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(201, 102, 74, 0.16);
}
select { -webkit-appearance: none; appearance: none; }
.addrow { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.addrow input { flex: 1; }
.addrow .iconbtn { padding: 12px 16px; }
textarea { min-height: 84px; resize: vertical; }

.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

button.primary {
  width: 100%;
  margin-top: 20px;
  background: var(--brand);
  color: #fff;
  border: 0;
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
}
button.primary:active { background: var(--brand-dark); }
button.primary:disabled { opacity: 0.6; cursor: default; }

.msg {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 14px;
  display: none;
}
.msg.error { display: block; background: #fbeae7; color: var(--danger); }
.msg.ok { display: block; background: #ecf3ee; color: #3f7d57; }

.deal {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.deal-logo {
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.deal-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.deal-logo .mono {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 24px;
}
.deal-logo.sm { flex-basis: 46px; width: 46px; height: 46px; border-radius: 10px; }
.deal-logo.sm img { padding: 4px; }
.deal-logo.sm .mono { font-size: 18px; }
.deal-body { flex: 1; min-width: 0; }
.deal-body h3 { margin: 0 0 6px; font-size: 17px; color: var(--plum); }
.deal-body p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; }

/* Location selector */
.loctabs {
  display: flex;
  gap: 8px;
  margin: 0 0 4px;
  background: #ece3da;
  padding: 4px;
  border-radius: 12px;
}
.loctab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--plum);
  padding: 10px 8px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.loctab.active { background: #fff; color: var(--brand); box-shadow: var(--shadow); }

/* Tappable deal cards + detail screen */
.deal.tappable { cursor: pointer; transition: transform .05s ease; align-items: center; }
.deal.tappable:active { transform: scale(0.99); }
.chev { color: var(--brand); font-size: 26px; line-height: 1; flex: 0 0 auto; padding-left: 2px; }

.backbtn {
  background: none;
  border: 0;
  color: var(--brand);
  font-size: 15px;
  font-weight: 600;
  padding: 4px 0 12px;
  cursor: pointer;
}
.detail-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.detail-head h2 { margin: 0 0 6px; font-size: 22px; color: var(--plum); }
.deal-logo.lg { flex-basis: 76px; width: 76px; height: 76px; border-radius: 16px; }
.loc-badge {
  display: inline-block;
  background: #f0e3dd;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.detail-label {
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.detail-offer p, .detail-more p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
}
.detail-offer p { font-weight: 600; color: var(--plum); }

.section-title {
  margin: 22px 4px 12px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.center { text-align: center; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Admin */
.admin-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.admin-row:first-child { border-top: 0; }
.admin-row .grow { flex: 1; }
.admin-row .biz { font-weight: 650; color: var(--plum); }
.admin-row .off { color: var(--muted); font-size: 14px; margin-top: 3px; }
.iconbtn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}
.iconbtn.danger { color: var(--danger); border-color: #eccbc6; }
.rowbtns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Cliniko sync */
.sync-status { font-size: 14px; color: var(--ink); line-height: 1.55; }
.sync-status .warn { display: block; color: var(--danger); margin-top: 8px; }
.sync-status code {
  background: #f0e3dd; color: var(--plum);
  padding: 1px 6px; border-radius: 5px; font-size: 13px;
}
.sync-status .syncing { color: var(--brand); font-weight: 600; margin-bottom: 4px; }
.sync-list { margin: 8px 0 0; padding-left: 18px; }
.sync-list li { margin: 3px 0; }
.small2 { font-size: 12px; margin-top: 6px; }
.stat { display: flex; gap: 16px; flex-wrap: wrap; }
.stat .box {
  flex: 1;
  min-width: 120px;
  background: #faf5ef;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.stat .box b { display: block; font-size: 22px; color: var(--brand); }
.stat .box span { font-size: 12px; color: var(--muted); }

.filepick {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
}
.filepick.drag { border-color: var(--brand); background: #faf5ef; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(58, 37, 48, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  padding: 0;
}
.modal-card {
  background: var(--card);
  width: 100%;
  max-width: 560px;
  border-radius: 18px 18px 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 -6px 30px rgba(0,0,0,0.2);
}
@media (min-width: 560px) {
  .modal { align-items: center; padding: 20px; }
  .modal-card { border-radius: 18px; }
}
.modal-card h3 { margin: 0 0 8px; color: var(--plum); font-size: 20px; }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-btns .primary { width: auto; margin: 0; padding: 12px 22px; }
.modal-btns .iconbtn { padding: 12px 20px; }

/* Add-to-home-screen prompt — full-screen blocking overlay */
.a2hs-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(58, 37, 48, 0.62);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: a2hs-fade .25s ease;
}
@keyframes a2hs-fade { from { opacity: 0; } to { opacity: 1; } }
.a2hs-card {
  position: relative;
  background: #fff;
  border-radius: 22px;
  width: 100%;
  max-width: 360px;
  padding: 30px 24px 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  animation: a2hs-pop .3s ease;
}
@keyframes a2hs-pop { from { transform: translateY(16px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.a2hs-icon { width: 76px; height: 76px; border-radius: 18px; box-shadow: var(--shadow); }
.a2hs-card h2 { margin: 16px 0 8px; font-size: 20px; color: var(--plum); line-height: 1.3; }
.a2hs-card p { margin: 0 0 22px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.a2hs-card .primary { width: 100%; margin: 0; }
.a2hs-overlay .shareico {
  width: 18px; height: 18px; vertical-align: -3px; fill: var(--brand);
  display: inline-block;
}
.a2hs-x {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
}
