:root {
  --bg: #f3f6f6; --card: #fff; --ink: #14212b; --muted: #64748b; --line: #dfe6e9;
  --brand: #0f766e; --brand-dark: #0b5a54; --brand-soft: #e0f2f0;
  --danger: #b42318; --danger-soft: #fdecea; --warn-soft: #fff4d6; --warn: #8a5a00;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Sans", Arial, sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0; line-height: 1.3; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
.muted { color: var(--muted); }
small { font-size: .82rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Top bar */
.top { background: var(--brand); color: #fff; }
.top-in { max-width: 1040px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.15rem; color: inherit; display: inline-flex; align-items: center; gap: .45rem; }
.brand:hover { text-decoration: none; }
.logo { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 8px; background: #fff; color: var(--brand); font-weight: 900; }
.menu { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.menu a { color: #e6fffb; padding: .35rem .7rem; border-radius: 8px; }
.menu a:hover, .menu a.on { background: rgba(255,255,255,.18); color: #fff; text-decoration: none; }
.logout { margin: 0; }
.top .btn.ghost { color: #fff; border-color: rgba(255,255,255,.5); background: transparent; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 1.2rem 1rem 2rem; }
.foot { text-align: center; padding: 0 1rem 2rem; }

/* Blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1rem; }
.head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card > .head { margin-bottom: .6rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row.tight { gap: .3rem; }
.row form, header form { margin: 0; }
.mt { margin-top: .6rem; }
.grow { flex: 1; }
.narrow { max-width: 520px; }
.empty { text-align: center; padding: 2rem 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; color: inherit; display: block; }
.tile:hover { text-decoration: none; }
.tile b { display: block; font-size: 1.7rem; line-height: 1.2; color: var(--brand-dark); }
.tile span { color: var(--muted); font-size: .9rem; }

/* Buttons */
.btn {
  display: inline-block; cursor: pointer; font: inherit; font-weight: 600; line-height: 1.3;
  padding: .55rem 1rem; border-radius: 9px; border: 1px solid var(--brand); background: var(--brand); color: #fff;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { background: #fff; color: var(--danger); border-color: #e7b4ae; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { padding: .28rem .6rem; font-size: .85rem; }
.btn.block { width: 100%; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

/* Forms */
.stack { display: grid; gap: .8rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.field { display: grid; gap: .25rem; }
.field > span { font-size: .9rem; font-weight: 600; }
input, select, textarea {
  font: inherit; color: inherit; width: 100%; padding: .55rem .7rem; background: #fff;
  border: 1px solid #c5d0d4; border-radius: 9px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid #5eead4; outline-offset: 1px; }
input[disabled] { background: #f1f5f5; color: var(--muted); }
input[dir="ltr"] { text-align: start; }
[dir="rtl"] input[dir="ltr"] { text-align: right; }
.has-error input, .has-error textarea { border-color: var(--danger); }
.err { color: var(--danger); }
.search { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search input { flex: 1; }
.row.tight input[type="date"] { width: auto; padding: .25rem .4rem; font-size: .85rem; }

/* Messages */
.flash { padding: .7rem 1rem; border-radius: 9px; margin-bottom: 1rem; background: var(--brand-soft); color: var(--brand-dark); }
.flash.error { background: var(--danger-soft); color: var(--danger); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: .08rem .5rem; border-radius: 99px; background: var(--brand-soft); color: var(--brand-dark); }
.tag.expired { background: var(--warn-soft); color: var(--warn); }
.tag.suspended { background: var(--danger-soft); color: var(--danger); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tr.today td { background: #f0fdfa; }
[dir="rtl"] td[dir="ltr"], [dir="rtl"] dd[dir="ltr"] { text-align: right; }

/* Patient file */
.info { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .9rem 1.2rem; margin: 0; }
.info .wide { grid-column: 1 / -1; }
.info dt { font-size: .82rem; color: var(--muted); }
.info dd { margin: 0; }
.info .alert dd { color: var(--danger); font-weight: 600; }
.visit { border-top: 1px solid var(--line); padding: .8rem 0; }
.visit header { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.visit p { margin: .4rem 0 0; }
.visit footer { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .88rem; margin-top: .4rem; }
.pager { display: flex; gap: .8rem; justify-content: center; align-items: center; }

/* Login / register */
.guest-wrap { max-width: 460px; margin: 0 auto; padding: 2.5rem 1rem; }
.guest .brand { color: var(--brand-dark); font-size: 1.5rem; justify-content: center; display: flex; }
.guest .logo { background: var(--brand); color: #fff; }
.tagline { text-align: center; color: var(--muted); margin: .3rem 0 1.2rem; }
.guest h1 { margin-bottom: .8rem; }
.alt { text-align: center; margin: 1rem 0 0; }
.langs { display: flex; gap: .3rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.langs a { padding: .2rem .65rem; border-radius: 99px; color: var(--muted); font-size: .9rem; }
.langs a.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }

@media (max-width: 560px) {
  .menu { order: 3; flex-basis: 100%; }
  .top-in { justify-content: space-between; }
  h1 { font-size: 1.3rem; }
}
@media print {
  .top, .foot, .btn, details, .search { display: none !important; }
  body { background: #fff; }
  .card { border: 0; padding: 0; }
}

td[dir="ltr"] { white-space: nowrap; }

/* Booking and appointments */
.public-wrap { max-width: 640px; margin: 0 auto; padding: 1.5rem 1rem 2.5rem; }
.center-head { text-align: center; margin-bottom: 1rem; }
.center-head .logo { background: var(--brand); color: #fff; width: 2.6rem; height: 2.6rem; font-size: 1.4rem; border-radius: 12px; margin-bottom: .4rem; }
.center-head p { margin: .2rem 0 0; }
.powered { text-align: center; color: var(--muted); font-size: .85rem; margin-top: .8rem; }
.step { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: .9rem; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.pick { display: block; text-align: center; padding: 1.1rem .5rem; border: 2px solid var(--line); border-radius: var(--radius); font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.pick:hover, .pick.on { border-color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.days.strip { display: flex; overflow-x: auto; padding-bottom: .5rem; margin-bottom: .8rem; }
.days.strip .day { flex: 0 0 104px; background: #fff; }
.day { display: grid; gap: .1rem; text-align: center; padding: .5rem .3rem; border: 2px solid var(--line); border-radius: 10px; color: var(--ink); line-height: 1.35; }
.day b { font-size: 1.05rem; }
.day small { color: var(--muted); font-size: .76rem; }
.day em { font-style: normal; font-size: .72rem; font-weight: 700; color: var(--muted); }
a.day:hover { border-color: var(--brand); text-decoration: none; }
.day.sunnah { border-color: #d9b44a; background: #fffaeb; }
.day.sunnah em { color: #8a6500; }
.day.on, .days.strip .day.on { border-color: var(--brand); background: var(--brand-soft); }
.day.off { opacity: .45; background: #f1f5f5; }
.tag.sunnah { background: #fdf0c4; color: #8a6500; }
.tag.online { background: #e8eefc; color: #2848a8; }
.tag.done { background: var(--brand-soft); color: var(--brand-dark); }
.tag.noshow { background: var(--warn-soft); color: var(--warn); }
.tag.cancelled { background: var(--danger-soft); color: var(--danger); }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; }
.time { position: relative; }
.time input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.time span { display: block; text-align: center; padding: .6rem 0; border: 2px solid var(--line); border-radius: 10px; font-weight: 700; }
.time input:checked + span { border-color: var(--brand); background: var(--brand); color: #fff; }
.time input:focus-visible + span { outline: 3px solid #5eead4; }
.time.full span { opacity: .4; text-decoration: line-through; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ok-card { text-align: center; }
.ok-card .check { width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: 1.8rem; display: grid; place-items: center; margin: 0 auto .6rem; }
.ok-card .big { font-size: 1.25rem; font-weight: 700; }
.appt { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding: .7rem 0; }
.appt .when { font-size: 1.2rem; font-weight: 700; color: var(--brand-dark); min-width: 3.6rem; }
.appt .who { flex: 1; min-width: 180px; }
.appt.st-cancelled .who strong, .appt.st-noshow .who strong { text-decoration: line-through; color: var(--muted); }
.btn.wa { background: #1f9d55; border-color: #1f9d55; }
.btn.wa:hover { background: #187a42; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.checks label, .check-line { display: inline-flex; align-items: center; gap: .4rem; }
.checks input, .check-line input { width: auto; }

/* Body map */
.bodymap { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.bodymap figure { margin: 0; text-align: center; }
.bodymap figcaption { font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.pts-list { min-height: 1.5rem; font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.warn-box { background: var(--danger-soft); color: var(--danger); border: 1px solid #e7b4ae; border-radius: 9px; padding: .6rem .9rem; margin-bottom: 1rem; font-weight: 600; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--brand-dark); } .neg { color: var(--danger); }
textarea[readonly] { background: #f7faf9; }
.inline-form { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.inline-form input { width: auto; flex: 1; min-width: 90px; padding: .35rem .5rem; }
.inline-form input.narrow { flex: 0 0 90px; }

/* Centre colour themes and logo */
.theme-teal   { --brand: #0f766e; --brand-dark: #0b5a54; --brand-soft: #e0f2f0; }
.theme-green  { --brand: #15803d; --brand-dark: #116631; --brand-soft: #e3f4e8; }
.theme-blue   { --brand: #1d4ed8; --brand-dark: #1a3fa8; --brand-soft: #e4ebfc; }
.theme-purple { --brand: #7e22ce; --brand-dark: #651ba5; --brand-soft: #f1e6fb; }
.theme-rose   { --brand: #be123c; --brand-dark: #9a0f31; --brand-soft: #fce7ec; }
.theme-brown  { --brand: #92400e; --brand-dark: #74330b; --brand-soft: #f8ece0; }
.top .menu a { color: rgba(255,255,255,.88); }
.logo-img { width: 4.5rem; height: 4.5rem; object-fit: contain; border-radius: 14px; background: #fff; border: 1px solid var(--line); display: block; margin: 0 auto .4rem; }
.logo-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.logo-row .logo-img { margin: 0; }
.logo.big { width: 4.5rem; height: 4.5rem; font-size: 2rem; border-radius: 14px; background: var(--brand); color: #fff; }
input[type="file"] { padding: .4rem; }
.swatches { display: flex; gap: .6rem; flex-wrap: wrap; }
.swatch { position: relative; width: 2.4rem; height: 2.4rem; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--ink); }
.swatch input:focus-visible + span { outline: 3px solid #5eead4; outline-offset: 2px; }

/* Client pages */
.pub-top { background: var(--brand); color: #fff; padding: .7rem 1rem; }
.pub-brand { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: .7rem; color: #fff; }
.pub-brand:hover { text-decoration: none; }
.pub-brand img { width: 2.8rem; height: 2.8rem; border-radius: 10px; background: #fff; object-fit: contain; }
.pub-brand .logo { background: #fff; color: var(--brand); width: 2.8rem; height: 2.8rem; font-size: 1.4rem; border-radius: 10px; }
.pub-brand strong { display: block; font-size: 1.1rem; line-height: 1.3; }
.pub-brand small { display: block; opacity: .85; }
.public-wrap { padding-bottom: 5.5rem; }
.pub-nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; gap: .3rem; background: #fff; border-top: 1px solid var(--line); padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom)); z-index: 10; }
.pub-nav a { flex: 0 1 140px; text-align: center; color: var(--muted); font-size: .82rem; padding: .3rem; border-radius: 10px; }
.pub-nav a span { display: block; font-size: 1.25rem; line-height: 1.2; }
.pub-nav a.on { color: var(--brand-dark); background: var(--brand-soft); font-weight: 700; }
.pub-nav a:hover { text-decoration: none; }
.hero { background: var(--brand); color: #fff; border-radius: 16px; padding: 1.3rem 1.1rem; margin-bottom: 1rem; text-align: center; }
.hero h1 { font-size: 1.4rem; }
.hero .hello { margin: 0 0 .2rem; opacity: .85; }
.hero .big-btn { background: #fff; color: var(--brand-dark); border-color: #fff; font-size: 1.1rem; padding: .8rem; margin-top: .6rem; }
.hero .big-btn:hover { background: var(--brand-soft); }
.hero-link { display: inline-block; color: #fff; margin-top: .7rem; text-decoration: underline; }
.days.three { grid-template-columns: repeat(3, 1fr); }
.big-num { font-size: 1.7rem !important; color: #8a6500; }
.mini-btn { display: inline-block; margin: .2rem auto 0; font-size: .75rem; font-weight: 700; background: #8a6500; color: #fff; border-radius: 99px; padding: .05rem .7rem; }
.tip { border-inline-start: 4px solid #d9b44a; }
.tip p { margin: .2rem 0; }
.contact-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.new-box { border: 2px solid var(--brand); background: var(--brand-soft); }
.new-flash { display: block; font-weight: 700; }
.new-flash:hover { text-decoration: none; filter: brightness(.97); }
.badge { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 .3rem; border-radius: 99px; background: #e11d48; color: #fff; font-size: .75rem; font-weight: 700; }
.centre { display: flex; align-items: center; gap: .8rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: .6rem; color: var(--ink); }
.centre:hover { border-color: var(--brand); text-decoration: none; }
.centre img, .centre .logo { width: 3rem; height: 3rem; border-radius: 10px; object-fit: contain; flex: none; }
.centre .logo { background: var(--brand); color: #fff; font-size: 1.4rem; }
.centre strong { display: block; }
.centre small { color: var(--muted); }
.centre .go { margin-inline-start: auto; color: var(--brand); font-weight: 700; white-space: nowrap; }
@media print { .pub-nav, .pub-top { display: none !important; } }

/* Client calendar */
.center-title { text-align: center; margin: 0; }
.center-title small { display: block; font-weight: 400; font-size: .8rem; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; }
.cal-h { text-align: center; font-size: .78rem; color: var(--muted); font-weight: 700; padding: .2rem 0; }
.cal-d { position: relative; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 9px; min-height: 3.1rem; padding: .25rem .1rem; display: grid; place-items: center; align-content: center; gap: 0; line-height: 1.15; }
button.cal-d { cursor: pointer; }
.cal-d b { font-size: 1rem; }
.cal-d small { font-size: .68rem; color: var(--muted); }
.cal-d.empty { border: 0; background: transparent; }
.cal-d.past { opacity: .75; }
.cal-d.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.cal-d.k-monthu { background: #eef6ff; }
.cal-d.k-white { background: #f2ecff; }
.cal-d.k-shawwal { background: #eaf7ef; }
.cal-d.k-arafah, .cal-d.k-ashura { background: #ffe9d6; }
.cal-d.k-ramadan { background: #e3f4e8; }
.cal-d.k-eid { background: #fde8ec; }
.cal-d.k-sunnah { border: 2px solid #d9b44a; }
.dot-s { position: absolute; top: 4px; inset-inline-end: 4px; width: 7px; height: 7px; border-radius: 50%; background: #c9971b; }
.cal-d.fasted::after { content: '✓'; position: absolute; bottom: 1px; inset-inline-start: 4px; color: var(--brand-dark); font-weight: 900; font-size: .85rem; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin-top: .8rem; font-size: .82rem; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); flex: none; }
.lg.k-sunnah { background: #fff; border: 2px solid #d9b44a; }
.lg.k-monthu { background: #eef6ff; } .lg.k-white { background: #f2ecff; } .lg.k-shawwal { background: #eaf7ef; }
.lg.k-arafah, .lg.k-ashura { background: #ffe9d6; } .lg.k-ramadan { background: #e3f4e8; } .lg.k-eid { background: #fde8ec; }
.small-note { font-size: .82rem; }
.fast-count { margin: .4rem 0 0; font-weight: 600; }
.ev-row { display: flex; align-items: center; gap: .7rem; border-top: 1px solid var(--line); padding: .6rem 0; }
.ev-row .lg { width: 18px; height: 18px; }
.install { border: 2px dashed var(--brand); }
.pub-nav a { flex-basis: 110px; }
.inline-form .field { min-width: 160px; }

/* Body map editor and view (SVG) */
.fig-edit { width: 230px; height: 460px; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.fig-edit .body { cursor: crosshair; }
.fig-edit circle.pt { fill: rgba(255,255,255,.9); stroke: var(--brand); stroke-width: 1; cursor: pointer; }
.fig-edit circle.pt.on { fill: #b42318; stroke: #7a1810; stroke-width: 1.2; cursor: grab; }
.fig-edit circle.pt.dragging { cursor: grabbing; r: 4.6; }
.fig-edit circle.pt:focus-visible { outline: none; stroke: #5eead4; stroke-width: 2; }
.bodyview { display: flex; gap: .6rem; flex-wrap: wrap; }
.bodyview figure { margin: 0; text-align: center; }
.bodyview figcaption { font-size: .75rem; color: var(--muted); }
.bodyview svg { display: block; width: 90px; height: 180px; }
.bodyview.big svg { width: 160px; height: 320px; }
.bodyview circle.cup { fill: #b42318; stroke: #7a1810; stroke-width: 1; }
.cups-block { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; margin-top: .4rem; }
.cups-block p { flex: 1; min-width: 180px; margin: .3rem 0 0; }

/* Client file */
.client-card .quick { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .9rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; margin-bottom: .9rem; }
.stats div { background: var(--bg); border-radius: 10px; padding: .55rem .7rem; }
.stats b { display: block; font-size: 1.05rem; }
.stats span { color: var(--muted); font-size: .8rem; }

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; }
.next-box { border: 1px dashed var(--brand); border-radius: 10px; padding: .6rem .9rem .8rem; margin: 0; }
.next-box legend { font-weight: 700; padding: 0 .3rem; }
@media (max-width: 560px) {
  .bodymap { flex-wrap: nowrap; gap: .4rem; }
  .fig-edit { width: 44vw; height: 88vw; }
}

/* Accounts and password resets */
.sub-row td { background: #fafcfc; padding-top: .2rem; }
.acct { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding: .5rem 0; }
.acct > span { flex: 1; min-width: 180px; }
.acct form { margin: 0; }
.reset-box { border: 2px solid #d9b44a; background: #fffaeb; }
.temp-pw { font: 700 1.6rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; margin: .3rem 0; user-select: all; }

/* Month calendars (booking + appointments) */
.steps { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: st; }
.steps li { flex: 1; text-align: center; font-size: .85rem; color: var(--muted); padding: .45rem .3rem; border-radius: 99px; background: #fff; border: 1px solid var(--line); counter-increment: st; }
.steps li::before { content: counter(st) ' · '; font-weight: 700; }
.steps li.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.steps li.done { background: var(--brand-soft); color: var(--brand-dark); }
.steps li.done::before { content: '✓ '; }
.card.compact { padding: .6rem; }
.card.compact .pick { padding: .55rem; font-size: 1rem; }
.month-head h2 { text-align: center; margin: 0; flex: 1; }
.month-head h2 small { display: block; font-weight: 400; font-size: .78rem; }
.nav-gap { width: 2.2rem; }
.mcal { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; padding-top: 4px; }
.mcal-h { text-align: center; font-size: .78rem; font-weight: 700; color: var(--muted); padding: .15rem 0; }
.mcal-d { position: relative; display: grid; place-items: center; align-content: center; min-height: 3.2rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); line-height: 1.15; padding: .2rem 0; }
a.mcal-d:hover { border-color: var(--brand); text-decoration: none; }
.mcal-d b { font-size: 1.05rem; }
.mcal-d small { font-size: .66rem; color: var(--muted); }
.mcal-d em { font-style: normal; font-size: .62rem; font-weight: 700; }
.mcal-d.empty { border: 0; background: transparent; }
.mcal-d.off { background: #f1f4f4; color: #aab4b8; border-color: transparent; }
.mcal-d.full { background: #fbeeee; color: #b97a74; }
.mcal-d.full em { color: var(--danger); }
.mcal-d.open { border-color: var(--brand); border-width: 1.5px; }
.mcal-d.sunnah { border-color: #d9b44a; border-width: 2px; background: #fffaeb; }
.mcal-d.sunnah em { color: #8a6500; }
.mcal-d.off.sunnah { background: #f6f2e6; border-color: #eadfb8; }
.mcal-d.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.mcal-d.on small, .mcal-d.on em { color: #fff; }
.mcal-d.today { box-shadow: inset 0 0 0 2px var(--ink); }
.mcal.pro .mcal-d.past { opacity: .6; }
.mcal.pro .mcal-d.closed { background: #f6f8f8; }
.mcal-d .cnt, .legend .cnt { position: absolute; top: -6px; inset-inline-end: -5px; box-shadow: 0 0 0 2px #fff; min-width: 1.15rem; height: 1.15rem; padding: 0 .25rem; border-radius: 99px; background: var(--brand); color: #fff; font-size: .68rem; display: grid; place-items: center; }
.legend .cnt { position: static; display: inline-grid; }
.mcal-d.on .cnt { background: #fff; color: var(--brand-dark); }
.lg.lg-open { background: #fff; border: 1.5px solid var(--brand); }
.lg.lg-full { background: #fbeeee; }
.legend.inline { margin: 0 .4rem; }
.time-group h3 { font-size: .85rem; color: var(--muted); margin: .2rem 0 .4rem; }
.time span small { display: block; font-size: .65rem; font-weight: 400; opacity: .8; }
.welcome-back { margin: 0; font-weight: 600; color: var(--brand-dark); }
.big-btn-main { font-size: 1.1rem; padding: .8rem; }
.new-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .45rem 0; border-top: 1px solid rgba(0,0,0,.06); color: var(--ink); }
.new-row:hover { text-decoration: none; background: rgba(255,255,255,.5); }
@media (min-width: 900px) {
  .appt-layout { display: grid; grid-template-columns: minmax(330px, 400px) 1fr; gap: 1rem; align-items: start; }
  .appt-layout > .card { margin-bottom: 0; }
}
.appt-layout { margin-bottom: 1rem; }

.mcal.pro .mcal-d.shut { background: repeating-linear-gradient(135deg, #fbeeee, #fbeeee 6px, #fff 6px, #fff 12px); border-color: #e7b4ae; }
.chip-form { display: inline-flex; align-items: center; gap: .2rem; margin: 0; }
.flash.warn a { color: inherit; }

/* Public homepage */
.site { background: #fff; }
.site-in { max-width: 1080px; margin: 0 auto; padding: 0 1rem; }
.site-top { position: sticky; top: 0; z-index: 20; background: var(--brand); color: #fff; }
.site-top .site-in { display: flex; align-items: center; gap: 1rem; padding-top: .6rem; padding-bottom: .6rem; flex-wrap: wrap; }
.site-top .brand { color: #fff; }
.site-nav { display: flex; gap: .2rem; flex: 1; }
.site-nav a { color: #e6fffb; padding: .3rem .6rem; border-radius: 8px; }
.site-nav a:hover { background: rgba(255,255,255,.15); text-decoration: none; }
.site-top .btn.ghost { color: #fff; border-color: rgba(255,255,255,.6); background: transparent; }
.btn.light { background: #fff; color: var(--brand-dark); border-color: #fff; }
.btn.light:hover { background: var(--brand-soft); }
.btn.big { font-size: 1.1rem; padding: .8rem 1.4rem; border-radius: 12px; }
.btn.ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn.ghost-light:hover { background: rgba(255,255,255,.12); }
.site-hero { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%); color: #fff; padding: 3.5rem 0 3rem; }
.site-hero h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); max-width: 760px; margin: .2rem 0 .8rem; }
.site-hero .lead { font-size: 1.15rem; max-width: 680px; opacity: .95; margin-bottom: 1.4rem; }
.kicker { display: inline-block; background: rgba(255,255,255,.16); padding: .2rem .8rem; border-radius: 99px; margin: 0; font-weight: 600; }
.hero-note { margin-top: 1.2rem; opacity: .9; font-size: .95rem; }
.steps3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin: -1.6rem 0 2.5rem; }
.steps3 > div { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem; box-shadow: 0 8px 24px rgba(16,40,40,.08); }
.steps3 b { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand); color: #fff; }
.steps3 h3 { margin: .5rem 0 .2rem; }
.steps3 p { margin: 0; color: var(--muted); }
.sec-title { text-align: center; font-size: 1.6rem; margin: 2.5rem 0 .4rem; }
.sec-sub { text-align: center; color: var(--muted); margin: 0 0 1.2rem; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .9rem; margin-top: 1.2rem; }
.feat { border: 1px solid var(--line); border-radius: 14px; padding: 1rem; background: #fbfdfd; }
.feat .ico { font-size: 1.6rem; }
.feat h3 { margin: .3rem 0 .2rem; font-size: 1.05rem; }
.feat p { margin: 0; color: var(--muted); font-size: .95rem; }
.why { margin-top: 2.5rem; background: var(--brand-soft); border-color: transparent; }
.checks-list { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .45rem; }
.checks-list li::before { content: '✓'; color: var(--brand); font-weight: 900; margin-inline-end: .5rem; }
.checks-list.small { font-size: .95rem; margin: .8rem 0 1rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 340px)); gap: 1rem; justify-content: center; }
.plan { position: relative; border: 1px solid var(--line); border-radius: 16px; padding: 1.3rem; background: #fff; }
.plan.best { border: 2px solid var(--brand); box-shadow: 0 10px 28px rgba(15,118,110,.15); }
.plan .price { font-size: 2rem; font-weight: 800; margin: .2rem 0; color: var(--brand-dark); }
.plan .price small { font-size: .9rem; font-weight: 400; color: var(--muted); }
.ribbon { position: absolute; top: -12px; inset-inline-end: 14px; background: #d9b44a; color: #3d2a00; font-weight: 700; font-size: .8rem; padding: .15rem .7rem; border-radius: 99px; }
.center-text { text-align: center; }
.faq details { margin-bottom: .6rem; }
.faq summary { cursor: pointer; }
.cta { text-align: center; margin: 2.5rem 0; background: linear-gradient(160deg, var(--brand-soft), #fff); }
.site-foot { text-align: center; padding: 1.5rem 1rem 2rem; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .site-nav { display: none; } .site-hero { padding-top: 2.2rem; } }

/* Report, import, broadcast */
table.kv td { padding: .45rem .3rem; }
table.kv td.num { text-align: end; }
table.kv tr.total td { font-weight: 800; border-top: 2px solid var(--ink); }
.report-grid { gap: 1rem; }
.report-grid .card { margin-bottom: 0; }
.report-head h2 { margin: 0; }
.hbars { display: grid; gap: .35rem; }
.hbar { display: grid; grid-template-columns: 5.5rem 1fr 2rem; align-items: center; gap: .5rem; }
.hbar svg { width: 100%; height: 14px; background: var(--bg); border-radius: 4px; }
.hbar rect { fill: var(--brand); }
.trend { width: 100%; max-width: 720px; height: auto; display: block; margin: 0 auto; }
.trend .bar { fill: #9fd5cf; } .trend .bar.cur { fill: var(--brand); }
.trend .axis { stroke: var(--line); }
.trend text { font-size: 9px; text-anchor: middle; fill: var(--muted); font-family: inherit; }
.trend text.val { fill: var(--ink); font-weight: 700; }
table.sample td, table.sample th { border: 1px solid var(--line); }
.placeholders { background: var(--bg); border-radius: 8px; padding: .3rem .6rem; font-family: ui-monospace, Menlo, monospace; display: inline-block; }
.choice.four { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.pick.small { padding: .55rem .3rem; font-size: .95rem; position: relative; cursor: pointer; }
.pick.small input { position: absolute; opacity: 0; }
.pick.small:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.bc-row { display: flex; align-items: center; gap: .6rem; border-top: 1px solid var(--line); padding: .5rem 0; }
.bc-send:visited { background: #9aa9ad; border-color: #9aa9ad; }
.confirm-wa { margin: .2rem 0 .4rem; }
@media print {
  .no-print, .site-top, .top, .foot, .pub-nav { display: none !important; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .report-grid { display: grid; grid-template-columns: 1fr 1fr; }
}
.plan .price .cur { font-size: 1.1rem; }
.plan .eq { margin: 0 0 .2rem; font-size: .9rem; }

/* Yearly plan */
.yearly-box { border: 2px solid #d9b44a; background: #fffaeb; border-radius: var(--radius); padding: 1rem 1.1rem; margin: 1rem 0; }
.yearly-box h2 { margin-top: 0; }
.gifts-title { font-weight: 800; margin: .2rem 0 .3rem; color: #8a6500; }
.gifts { list-style: none; padding: .6rem .8rem; margin: 0 0 1rem; background: #fffaeb; border: 1px dashed #d9b44a; border-radius: 10px; display: grid; gap: .35rem; font-size: .93rem; }
.centre.featured { border: 2px solid #d9b44a; background: #fffcf2; }

/* Printable poster (A4) */
.print-page { background: #e9eeee; }
.print-bar { display: flex; gap: .6rem; align-items: center; justify-content: center; padding: .7rem; flex-wrap: wrap; }
.poster { width: 210mm; min-height: 297mm; margin: 0 auto 2rem; background: #fff; box-sizing: border-box; padding: 16mm 16mm 12mm; text-align: center; display: flex; flex-direction: column; align-items: center; border-top: 10mm solid var(--brand); }
.poster header img, .poster header .logo { width: 30mm; height: 30mm; object-fit: contain; border-radius: 6mm; }
.poster header .logo { display: inline-grid; place-items: center; background: var(--brand); color: #fff; font-size: 16mm; }
.poster h1 { font-size: 26pt; margin: 4mm 0 1mm; }
.poster header p { margin: 0; color: var(--muted); font-size: 13pt; }
.poster h2 { font-size: 30pt; margin: 9mm 0 2mm; color: var(--brand-dark); }
.poster .sub { font-size: 14pt; margin: 0 0 6mm; color: var(--muted); }
.poster .qr-box { width: 95mm; padding: 4mm; border: 2mm solid var(--brand); border-radius: 8mm; }
.poster .qr { width: 100%; height: auto; display: block; }
.poster .scan { font-size: 16pt; font-weight: 700; margin: 5mm 0 1mm; }
.poster .url { font-size: 12pt; color: var(--muted); margin: 0 0 6mm; }
.poster .perks { list-style: none; padding: 0; margin: 0 0 4mm; font-size: 13pt; display: grid; gap: 2mm; }
.poster .phone { font-size: 16pt; font-weight: 700; margin: 2mm 0; }
.poster .poster-ad { margin: 3mm 0 0; padding: 2.5mm 5mm; border: 0.6mm dashed var(--brand); border-radius: 4mm; font-size: 11pt; color: var(--brand-dark); }
.poster footer { margin-top: auto; color: var(--muted); font-size: 10pt; }
@media print {
  @page { size: A4; margin: 0; }
  .print-page { background: #fff; }
  .poster { margin: 0; width: 210mm; height: 297mm; min-height: 0; }
  .poster, .poster * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Legal pages */
.legal { max-width: 760px; padding-top: 1.5rem; padding-bottom: 2rem; line-height: 1.8; }
.legal h1 { font-size: 1.8rem; }
.legal h2 { font-size: 1.15rem; margin-top: 1.6rem; }
.legal ul { padding-inline-start: 1.2rem; }
.check-line span a { text-decoration: underline; }
