.app-booking-wrap {
	--app-color-calendar: #e07a5f;
	--app-color-button: #3d405b;
	--app-color-form: #f4f1de;
	--app-line: #e3e3e3;
	--app-empty: #f4f4f2;
	--app-muted: #8a8a86;
	max-width: 1200px;
	margin: 0 auto;
	font-family: inherit;
	position: relative;
}
.app-booking-wrap *, .app-booking-wrap *::before, .app-booking-wrap *::after { box-sizing: border-box; }

.app-alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; }
.app-alert-success { background: #e7f6ec; color: #1e7e34; border: 1px solid #b7e4c7; }
.app-alert-error { background: #fdecea; color: #c0392b; border: 1px solid #f5c6cb; }

/* ---------- Header: arrows + title, and the optional Week / Month switch ---------- */
.app-calendar-header {
	display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 20px;
}
.app-calendar-nav { grid-column: 2; display: flex; align-items: center; justify-content: center; gap: 24px; }
.app-calendar-header .app-calendar-nav button {
	background: none; color: #333; border: none; cursor: pointer; font-size: 20px; line-height: 1;
	padding: 4px 8px; min-width: 40px; min-height: 40px;
}
.app-calendar-header .app-calendar-nav button:hover { color: var(--app-color-button); }
.app-calendar-header .app-calendar-nav button:disabled { opacity: 0.25; cursor: default; }
.app-calendar-title { margin: 0; font-size: 22px; font-weight: 700; min-width: 220px; text-align: center; }

.app-view-toggle {
	justify-self: end; display: inline-flex; background: #f1f1ef; border-radius: 999px; padding: 3px;
}
.app-view-toggle button {
	border: 0; background: none; color: #555; padding: 8px 18px; border-radius: 999px;
	font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 38px; line-height: 1.2;
}
.app-view-toggle button[aria-pressed="true"] { background: var(--app-color-button); color: #fff; }

/* ---------- Status labels ---------- */
.app-slot-card-status {
	display: inline-block; font-size: 11px; font-weight: 600; margin-bottom: 10px;
	padding: 3px 9px; border-radius: 20px; letter-spacing: 0.2px; line-height: 1.4;
}
.app-status-open { color: #2e7d32; background: #e7f6ec; }
.app-status-low { color: #b4580a; background: #fff1e0; }
.app-status-full { color: #c0392b; background: #fdecea; }
.app-status-closed { color: #8a8a86; background: #f0f0ee; font-style: normal; }

/* ---------- Week view ---------- */
.app-week-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	border-top: 1px solid var(--app-line);
	border-left: 1px solid var(--app-line);
	border-bottom: 1px solid var(--app-line);
}
.app-day-col { border-right: 1px solid var(--app-line); background: #fff; min-height: 120px; min-width: 0; }
.app-day-col-empty { background: var(--app-empty); }
.app-day-col-header { text-align: center; padding: 14px 6px 10px; border-bottom: 1px solid var(--app-line); }
.app-day-col-weekday { display: block; font-size: 13px; color: var(--app-muted); font-weight: 600; text-transform: capitalize; }
.app-day-col-date {
	display: block; font-size: 20px; font-weight: 700; color: #1a1a1a; margin: 2px auto 0;
	width: 34px; height: 34px; line-height: 34px;
}
.app-day-col-today .app-day-col-date { border-radius: 50%; background: var(--app-color-button); color: #fff; }
.app-day-col-body { padding: 8px; display: flex; flex-direction: column; gap: 0; }
.app-no-classes { color: #9a9a95; font-size: 14px; text-align: center; padding: 40px 8px; }

.app-slot-card {
	padding: 14px 8px 14px 14px;
	border-bottom: 1px solid #ececec;
	border-left: 4px solid #e07a5f;
	border-radius: 4px;
	margin-bottom: 4px;
}
.app-slot-card:last-child { border-bottom: none; margin-bottom: 0; }
.app-slot-card-time { font-weight: 700; font-size: 15px; color: #1a1a1a; margin-bottom: 2px; }
.app-slot-card-title { font-weight: 600; font-size: 14px; color: #1a1a1a; margin-bottom: 10px; line-height: 1.45; }
.app-slot-card-duration { font-size: 12px; color: #9a9a95; margin-bottom: 4px; }

/* ---------- Month view ---------- */
.app-month { border-top: 1px solid var(--app-line); border-left: 1px solid var(--app-line); }
.app-month-head, .app-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.app-month-head div {
	text-align: center; font-size: 13px; font-weight: 600; color: var(--app-muted); padding: 14px 0;
	border-right: 1px solid var(--app-line); border-bottom: 1px solid var(--app-line);
}
.app-month-cell {
	border-right: 1px solid var(--app-line); border-bottom: 1px solid var(--app-line); background: #fff;
	min-height: 110px; padding: 10px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0;
}
.app-month-cell-empty { background: var(--app-empty); }
.app-month-cell-other { background: #fafaf9; color: #cfcfca; }
.app-month-num {
	font-size: 17px; font-weight: 700; width: 34px; height: 34px; line-height: 34px; text-align: center;
	border-radius: 50%; color: #1a1a1a; flex: none;
}
.app-month-cell-other .app-month-num { color: #cfcfca; }
.app-month-cell-past .app-month-num, .app-month-cell-past .app-month-slot { opacity: 0.45; }
.app-month-cell-today .app-month-num { background: var(--app-color-button); color: #fff; opacity: 1; }
.app-month-slots { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.app-month-slot {
	display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-width: 0;
	border-left: 3px solid var(--app-class-color, #e07a5f); border-radius: 3px; padding: 2px 4px 2px 8px;
}
.app-month-slot-time { font-size: 13px; font-weight: 700; line-height: 1.3; color: #1a1a1a; }
.app-month-slot-title { font-size: 12px; font-weight: 600; line-height: 1.35; color: #333; overflow-wrap: anywhere; }
.app-month-slot .app-slot-card-status { font-size: 10.5px; margin: 6px 0 0; padding: 2px 8px; }
.app-month-slot.app-slot-full, .app-month-slot.app-slot-closed { opacity: 0.55; }
.app-month-book.app-btn { margin-top: 8px; padding: 7px 10px; font-size: 12px; }
.app-month-dot { display: none; width: 8px; height: 8px; border-radius: 50%; background: var(--app-class-color, #111); flex: none; }

.app-month-legend { display: none; }
.app-day-panel { display: none; }

/* ---------- Buttons ---------- */
.app-btn, .app-btn-submit {
	background: var(--app-color-button); color: #fff; border: none; border-radius: 6px;
	padding: 10px 16px; cursor: pointer; font-size: 13px; font-weight: 600; width: 100%; font-family: inherit;
}
.app-btn:hover, .app-btn-submit:hover { opacity: 0.88; }
.app-btn:disabled { opacity: 0.6; cursor: default; }

/* ---------- Booking form ---------- */
.app-modal-overlay {
	position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex;
	align-items: center; justify-content: center; z-index: 99999; padding: 16px;
}
.app-modal {
	background: var(--app-color-form); border-radius: 14px; padding: 0; max-width: 460px; width: 100%;
	max-height: 92vh; overflow-y: auto; position: relative; box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.app-modal-close {
	position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border: none; border-radius: 50%;
	background: rgba(0,0,0,0.06); font-size: 20px; cursor: pointer; color: #555; line-height: 1; z-index: 2;
}
.app-modal-close:hover { color: #111; background: rgba(0,0,0,0.1); }
.app-modal-top { padding: 22px 22px 16px; border-bottom: 1px solid rgba(0,0,0,0.08); }
.app-modal-top h4 { margin: 0; font-size: 19px; padding-right: 40px; line-height: 1.3; }
.app-modal-when { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; }
.app-modal-when span { background: rgba(0,0,0,0.05); border-radius: 6px; padding: 4px 10px; font-weight: 600; white-space: nowrap; }

.app-booking-form { display: flex; flex-direction: column; gap: 18px; padding: 18px 22px 22px; }
.app-fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.app-fieldset legend { font-weight: 700; font-size: 14px; margin-bottom: 8px; padding: 0; }
.app-field { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; gap: 5px; color: #333; }
.app-field-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; }
.app-booking-form input[type=text],
.app-booking-form input[type=email],
.app-booking-form input[type=tel],
.app-textarea {
	width: 100%; padding: 10px 12px; border: 1px solid #d8d8d3; border-radius: 8px; font-weight: normal; font-size: 16px;
	background: #fff; transition: border-color 0.15s, box-shadow 0.15s; font-family: inherit; resize: vertical; color: #222;
}
.app-booking-form input[type=text]:focus,
.app-booking-form input[type=email]:focus,
.app-booking-form input[type=tel]:focus,
.app-textarea:focus {
	outline: none; border-color: var(--app-color-button);
	box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.app-price-options { display: flex; flex-direction: column; gap: 8px; }
.app-price-option, .app-pay-option {
	display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 12px 14px;
	border: 1.5px solid #e1e1dc; border-radius: 10px; background: #fff; cursor: pointer; transition: border-color 0.15s;
	font-weight: normal;
}
.app-price-option:has(input:checked), .app-pay-option:has(input:checked) { border-color: var(--app-color-button); }
.app-price-option input, .app-pay-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--app-color-button); flex: none; }
.app-opt-label { flex: 1; font-weight: 600; }
.app-opt-label small { display: block; font-weight: 400; font-size: 12px; color: var(--app-muted); margin-top: 1px; }
.app-opt-price { font-weight: 700; white-space: nowrap; }

.app-coupon-toggle {
	background: none; border: 0; padding: 4px 0; font: inherit; font-size: 13px; font-weight: 600;
	text-decoration: underline; cursor: pointer; color: inherit;
}
.app-coupon-row { display: none; gap: 8px; margin-top: 6px; }
.app-coupon-row.app-open { display: flex; }
.app-coupon-row input {
	flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #d8d8d3; border-radius: 8px;
	font-weight: normal; font-size: 16px; background: #fff; text-transform: uppercase;
}
.app-btn-secondary {
	background: #fff; color: var(--app-color-button); border: 1px solid var(--app-color-button) !important;
	width: auto; white-space: nowrap; padding: 10px 16px;
}
.app-btn-secondary:hover { background: var(--app-color-button); color: #fff; }
.app-coupon-message { font-size: 12px; margin-top: 4px; }
.app-coupon-message:empty { display: none; }
.app-coupon-message.app-error { color: #c62828; }
.app-coupon-message.app-success { color: #2e7d32; font-weight: 600; }

.app-summary {
	background: rgba(0,0,0,0.035); border-radius: 10px; padding: 12px 14px; font-size: 14px;
	display: flex; flex-direction: column; gap: 4px;
}
.app-summary > div { display: flex; justify-content: space-between; gap: 10px; }
.app-summary-discount { color: #2e7d32; }
.app-summary-total { font-weight: 700; font-size: 17px; border-top: 1px dashed #d6d6d1; padding-top: 6px; margin-top: 2px; }
.app-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.app-remember input { width: 18px; height: 18px; margin: 0; accent-color: var(--app-color-button); }
.app-btn-submit { padding: 14px 16px; font-size: 15px; font-weight: 700; border-radius: 8px; }

.app-form-msg { font-size: 13px; }
.app-form-msg:empty { display: none; }
.app-form-msg.app-error { color: #c62828; }
.app-form-msg.app-success { color: #2e7d32; }

.app-loading { position: absolute; inset: 0; background: rgba(255,255,255,0.6); display: flex; align-items: center; justify-content: center; }
.app-spinner {
	width: 28px; height: 28px; border: 3px solid #ddd; border-top-color: var(--app-color-button);
	border-radius: 50%; animation: app-spin 0.8s linear infinite;
}
@keyframes app-spin { to { transform: rotate(360deg); } }

/* ---------- Tablet ---------- */
@media (max-width: 900px) and (min-width: 601px) {
	.app-week-grid {
		grid-template-columns: none;
		display: flex;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x mandatory;
	}
	.app-day-col { flex: 0 0 150px; scroll-snap-align: start; }
	.app-month-cell { padding: 8px 5px 10px; }
}

/* ---------- Phone ---------- */
@media (max-width: 600px) {
	.app-booking-wrap { padding: 0 2px; }

	.app-calendar-header { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 18px; }
	.app-calendar-nav { grid-column: 1; gap: 4px; }
	.app-calendar-header .app-calendar-nav button {
		width: 36px; height: 36px; min-width: 36px; min-height: 36px; font-size: 18px; padding: 0;
		border-radius: 50%; background: #f4f4f2; flex-shrink: 0;
	}
	.app-calendar-title { font-size: 17px; min-width: 0; flex: 1; }
	.app-view-toggle { justify-self: stretch; }
	.app-view-toggle button { flex: 1; }

	/* Week: one full-width card per day */
	.app-week-grid { grid-template-columns: none; display: flex; flex-direction: column; gap: 10px; border: none; }
	.app-day-col {
		border: 1px solid #ececea; border-radius: 12px; overflow: hidden;
		box-shadow: 0 1px 3px rgba(0,0,0,0.04); min-height: 0;
	}
	.app-day-col-empty { background: #fff; }
	.app-day-col-header {
		display: flex; align-items: center; gap: 8px; text-align: left; padding: 10px 14px;
		background: #faf9f7; border-bottom: 1px solid #ececea;
	}
	.app-day-col-weekday { font-size: 12px; }
	.app-day-col-date { margin: 0; font-size: 16px; width: auto; height: auto; line-height: 1.2; }
	.app-day-col-today .app-day-col-date { width: 28px; height: 28px; line-height: 28px; text-align: center; }
	.app-day-col-empty .app-day-col-body { display: none; }
	.app-day-col-empty .app-day-col-header { border-bottom: 0; }
	.app-day-col-empty .app-day-col-header::after {
		content: 'No classes'; margin-left: auto; font-size: 12px; color: #9a9a95; font-weight: 500;
	}
	.app-day-col-body { padding: 6px 10px; }
	.app-slot-card { padding: 12px 10px 12px 14px; border-bottom: 1px solid #f2f2f0; margin-bottom: 2px; }

	/* Month: dates + coloured dots; tap a day to list it below */
	.app-month-head div { font-size: 11px; padding: 10px 0; }
	.app-month-cell { min-height: 60px; padding: 6px 2px; gap: 4px; }
	.app-month-cell.app-has-classes { cursor: pointer; }
	.app-month-cell-selected { box-shadow: inset 0 0 0 2px var(--app-color-button); position: relative; z-index: 1; }
	.app-month-num { font-size: 14px; width: 28px; height: 28px; line-height: 28px; }
	.app-month-slots { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px; }
	.app-month-slot { border: 0; padding: 0; width: auto; opacity: 1 !important; }
	.app-month-slot > :not(.app-month-dot) { display: none !important; }
	.app-month-dot { display: block; }
	.app-month-slot.app-slot-full .app-month-dot,
	.app-month-slot.app-slot-closed .app-month-dot { background: none; box-shadow: inset 0 0 0 1.5px #c4c4bf; }
	.app-month-slot.app-slot-low .app-month-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #e8892b; }

	.app-month-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--app-muted); margin-top: 10px; }
	.app-month-legend span { display: inline-flex; align-items: center; gap: 6px; }
	.app-month-legend .app-month-dot { display: inline-block; }
	.app-legend-open { background: #111; }
	.app-legend-low { background: #111; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #e8892b; }
	.app-legend-off { background: none; box-shadow: inset 0 0 0 1.5px #c4c4bf; }

	.app-day-panel { display: block; margin-top: 22px; scroll-margin-top: 80px; }
	.app-day-panel-title { margin: 0 0 12px; font-size: 17px; }
	.app-day-panel-sub { margin: 0; color: var(--app-muted); font-size: 14px; }
	.app-day-panel-cards { display: flex; flex-direction: column; gap: 10px; }
	.app-day-panel-cards .app-slot-card { border: 1px solid #ececea; border-left-width: 4px; border-radius: 10px; padding: 14px 14px 14px 16px; margin: 0; }

	.app-btn { padding: 11px 16px; }
	.app-btn:active { opacity: 0.75; }

	.app-modal-overlay { align-items: flex-end; padding: 10px; }
	.app-modal-top { padding: 18px 16px 14px; }
	.app-booking-form { padding: 16px; }
	.app-field-row { grid-template-columns: minmax(0, 1fr); }
}

/* DuitNow QR payment */
.app-duitnow-hint { font-size: 13px; line-height: 1.5; background: rgba(0,0,0,0.035); border-radius: 8px; padding: 10px 12px; margin: 0; }
.app-duitnow-result { text-align: center; padding: 28px 22px 22px; }
.app-duitnow-result h4 { margin: 0 0 10px; }
.app-duitnow-ref, .app-duitnow-amount, .app-duitnow-payto { margin: 4px 0; }
.app-duitnow-qr { display: block; margin: 14px auto; width: 100%; max-width: 260px; height: auto; background: #fff; border: 1px solid #e5e5df; border-radius: 10px; padding: 8px; box-sizing: border-box; }
.app-duitnow-instructions { text-align: left; font-size: 14px; line-height: 1.6; margin: 14px 0; }
.app-duitnow-instructions p { margin: 0 0 10px; }
.app-duitnow-whatsapp { display: inline-block; text-decoration: none; }
.app-duitnow-small { font-size: 12px; opacity: .7; margin: 10px 0; }
