/* Shared Fixrit web styles. Tenant branding overrides the CSS variables (validated tokens only). */
:root {
  --primary: #C4F83A; --accent: #101828; --header-bg: #FFFFFF; --page-bg: #F3F5F7; --card-bg: #FFFFFF;
  --text: #101828; --text-2: #64748B; --border: #E2E8F0; --btn-bg: #C4F83A; --btn-text: #101828;
  --btn-radius: 12px; --card-radius: 16px; --font-heading: 'Lato', sans-serif; --font-body: 'Lato', sans-serif;
  --success: #15803D; --warning: #B45309; --error: #DC2626; --info: #2563EB; --neutral: #F3F5F7;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page-bg); color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .heading { font-family: var(--font-heading); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--card-radius); padding: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: var(--btn-radius);
  background: var(--btn-bg); color: var(--btn-text); border: 0; font: 700 16px var(--font-body); cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(0.95); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn.ghost { background: transparent; color: var(--text); padding: 0 8px; }
.btn.danger { background: var(--error); color: #fff; }
.btn.block { width: 100%; }
input, select, textarea { font: inherit; color: var(--text); background: #fff; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; width: 100%; min-height: 46px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--neutral); color: var(--text); }
.pill.ok { background: #DCFCE7; color: #14532D; } .pill.warn { background: #FEF3C7; color: #78350F; } .pill.err { background: #FEE2E2; color: #7F1D1D; } .pill.info { background: #DBEAFE; color: #1E3A8A; }
.demo-banner { background: #101828; color: #F3F5F7; font-size: 13px; text-align: center; padding: 6px 12px; }
.notice { border-radius: 12px; padding: 12px 14px; background: #FEF3C7; color: #78350F; margin: 12px 0; }
.notice.info { background: #DBEAFE; color: #1E3A8A; } .notice.err { background: #FEE2E2; color: #7F1D1D; } .notice.ok { background: #DCFCE7; color: #14532D; }

/* Wordmark */
/* Fixrit lockup (Brandbook v1.0 artwork). The text stays for screen readers; the logo image is shown instead. */
.wordmark { display: inline-block; height: 36px; aspect-ratio: 234.92 / 60; background: url('/logo-light.svg') left center / contain no-repeat; color: transparent; font-size: 0; overflow: hidden; vertical-align: middle; text-decoration: none; }
.wordmark::before { content: none; }
.wordmark .dot { color: transparent; }

/* Booking site */
.site-header { background: var(--header-bg); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.logo-text { font-family: var(--font-heading); font-weight: 800; font-size: 20px; letter-spacing: .02em; text-decoration: none; }
.hero { padding: 40px 0 24px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 20px; padding: 0; list-style: none; font-size: 13px; }
.steps li { padding: 6px 10px; border-radius: 999px; background: var(--neutral); color: var(--text-2); }
.steps li.active { background: var(--primary); color: var(--btn-text); font-weight: 700; }
.steps li.done { color: var(--text); }
.svc { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 16px; border: 1.5px solid var(--border); border-radius: var(--card-radius); background: var(--card-bg); cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit; }
.svc:hover, .svc[aria-pressed="true"] { border-color: var(--text); }
.price { font-weight: 800; white-space: nowrap; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { font-size: 12px; text-align: center; color: var(--text-2); font-weight: 600; }
.cal button { aspect-ratio: 1; border-radius: 12px; border: 1.5px solid var(--border); background: var(--card-bg); font: 600 15px var(--font-body); color: var(--text); cursor: pointer; }
.cal button.full { background: var(--neutral); color: var(--text-2); text-decoration: line-through; cursor: not-allowed; }
.cal button.closed { background: transparent; border-style: dashed; color: #94A3B8; cursor: not-allowed; }
.cal button.selected { background: var(--primary); border-color: var(--primary); color: var(--btn-text); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slots button { min-height: 46px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--card-bg); font: 700 15px var(--font-body); cursor: pointer; color: var(--text); }
.slots button:hover { border-color: var(--text); }
.slots button.selected { background: var(--primary); border-color: var(--primary); color: var(--btn-text); }
.plate { display: flex; align-items: stretch; border: 2.5px solid #101828; border-radius: 10px; overflow: hidden; max-width: 320px; background: #F7C600; }
.plate .nl { background: #003399; color: #fff; font: 700 13px sans-serif; display: flex; align-items: flex-end; padding: 6px 8px; }
.plate input { border: 0; border-radius: 0; background: transparent; font: 800 26px 'Lato', sans-serif; text-transform: uppercase; letter-spacing: .08em; text-align: center; color: #101828; }
.summary dt { color: var(--text-2); font-size: 14px; } .summary dd { margin: 0 0 10px; font-weight: 700; }
.summary { display: grid; grid-template-columns: 160px 1fr; gap: 0 12px; }
.site-footer { margin-top: 48px; padding: 24px 0; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-2); }
.layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 900px) { .layout { grid-template-columns: 1.6fr 1fr; } }
.is-widget .site-header, .is-widget .site-footer, .is-widget .about { display: none; }
.is-widget .hero { padding-top: 12px; }
.is-reception { font-size: 19px; } .is-reception .btn, .is-reception .slots button { min-height: 60px; font-size: 19px; }
.is-preview::before { content: 'Voorbeeld van concept — niet gepubliceerd'; display: block; background: #2563EB; color: #fff; text-align: center; padding: 6px; font-size: 13px; }

/* Templates (same booking engine, different presentation) */
.tpl-modern_sport .hero { background: var(--header-bg); color: #fff; padding: 56px 0 40px; margin-bottom: 24px; }
.tpl-modern_sport .hero .muted { color: #CBD5E1; }
.tpl-modern_sport .site-header { background: var(--header-bg); border-bottom-color: #333; }
.tpl-modern_sport .site-header, .tpl-modern_sport .site-header a { color: #fff; }
.tpl-modern_sport h1 { text-transform: uppercase; letter-spacing: .02em; }
.tpl-professional .site-header, .tpl-professional .site-header a { background: var(--header-bg); color: #fff; }
.tpl-professional .hero h1 { font-weight: 700; }
.tpl-premium h1, .tpl-premium h2 { font-weight: 600; letter-spacing: -0.01em; }
.tpl-premium .card { box-shadow: 0 10px 30px rgba(0,0,0,.06); }

/* Partner / admin app */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: #F3F5F7; }
.side { background: #101828; color: #F3F5F7; padding: 20px 12px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.side .wordmark { display: block; height: 32px; margin: 0 10px 16px; background-image: url('/logo-dark.svg'); }
.side nav a { display: block; padding: 9px 12px; border-radius: 10px; color: #E2E8F0; text-decoration: none; font-weight: 600; font-size: 15px; }
.side nav a.active, .side nav a:hover { background: #202939; color: #fff; }
.side nav a.active { box-shadow: inset 3px 0 0 #C4F83A; }
.side .soon { opacity: .45; pointer-events: none; }
.main { padding: 24px 28px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric { background: #fff; border: 1px solid #E2E8F0; border-radius: 16px; padding: 14px 16px; }
.metric .v { font-size: 28px; font-weight: 800; } .metric .l { color: #666; font-size: 13px; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #EEF2F6; vertical-align: top; }
th { background: #F8FAFC; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #666; }
.calendar { display: grid; background: #fff; border: 1px solid #E2E8F0; border-radius: 16px; overflow: auto; }
.calendar .col-h { position: sticky; top: 0; background: #F8FAFC; padding: 8px; font-weight: 700; font-size: 13px; border-bottom: 1px solid #E2E8F0; border-left: 1px solid #EEF2F6; z-index: 2; }
.calendar .hours { border-right: 1px solid #EEF2F6; }
.calendar .hour { height: 64px; font-size: 12px; color: #666; padding: 2px 6px; border-bottom: 1px dashed #EEF2F6; }
.calendar .lane { position: relative; border-left: 1px solid #EEF2F6; background-image: repeating-linear-gradient(#fff 0 63px, #EEF2F6 63px 64px); }
.appt { position: absolute; left: 4px; right: 4px; border-radius: 10px; padding: 4px 8px; font-size: 12px; overflow: hidden; cursor: pointer; border-left: 4px solid; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); text-align: left; font-family: inherit; }
.appt strong { display: block; font-size: 12.5px; }
.appt.new { animation: flash 2.5s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px #C4F83A; } 100% { box-shadow: 0 1px 3px rgba(0,0,0,.1); } }
@media (prefers-reduced-motion: reduce) { .appt.new { animation: none; outline: 3px solid #C4F83A; } }
.block-time { position: absolute; left: 2px; right: 2px; background: repeating-linear-gradient(45deg, #EEE, #EEE 6px, #F8FAFC 6px, #F8FAFC 12px); border-radius: 8px; font-size: 11px; color: #555; padding: 2px 6px; }
.drawer { position: fixed; top: 0; right: 0; width: min(460px, 100vw); height: 100vh; background: #fff; box-shadow: -10px 0 30px rgba(0,0,0,.15); padding: 24px; overflow: auto; z-index: 50; }
.toast { position: fixed; bottom: 20px; right: 20px; background: #101828; color: #fff; padding: 14px 18px; border-radius: 14px; z-index: 60; max-width: 360px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.board { display: grid; grid-template-columns: repeat(7, minmax(180px, 1fr)); gap: 10px; overflow-x: auto; }
.board .colm { background: #fff; border: 1px solid #E2E8F0; border-radius: 14px; padding: 10px; min-height: 200px; }
.board .job { border: 1px solid #E2E8F0; border-radius: 10px; padding: 8px; margin-bottom: 8px; font-size: 13px; }


/* Multi-service selection */
.svc { gap: 12px; }
.svc .check { width: 22px; height: 22px; flex: none; border-radius: 6px; border: 1.5px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: var(--btn-text); background: #fff; }
.svc.on { border-color: var(--text); border-width: 2px; }
.svc.on .check { background: var(--btn-bg); border-color: var(--btn-bg); }
.selbar { position: sticky; bottom: 12px; margin-top: 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--text); color: #fff; border-radius: var(--card-radius); padding: 16px 18px; }
.selbar .price { color: #fff; }

/* ---------- Partner agenda (Knipklok-style day grid, Fixrit brand) ---------- */
.agenda2 { --tw: 76px; --cw: 170px; grid-template-columns: var(--tw) repeat(var(--cols), minmax(var(--cw), 1fr)); display: grid; background: #fff; border: 1px solid #E2E8F0; border-radius: 16px; overflow: auto; max-height: calc(100vh - 210px); position: relative; }
.agenda2 .a-head { position: sticky; top: 0; z-index: 5; background: #101828; color: #fff; padding: 10px 10px; font-weight: 700; font-size: 14px; text-align: center; border-left: 1px solid rgba(255,255,255,.08); line-height: 1.2; }
.agenda2 .a-head small { display: block; font-weight: 400; font-size: 11px; color: #CBD5E1; }
.agenda2 .a-head.a-time { left: 0; z-index: 6; }
.agenda2 .a-times { position: sticky; left: 0; z-index: 4; background: #101828; }
.t-row { display: grid; grid-template-columns: 1fr 34px; align-items: start; border-top: 1px solid rgba(255,255,255,.06); box-sizing: border-box; }
.t-row.hr { border-top: 1px solid rgba(196,248,58,.45); }
.t-row .t-h { color: #fff; font-weight: 800; font-size: 14px; padding: 2px 0 0 10px; }
.t-row .t-m { color: #94A3B8; font-size: 11px; padding-top: 4px; text-align: center; background: rgba(255,255,255,.04); height: 100%; }
.t-row.hr .t-m { color: #C4F83A; font-weight: 700; }
.lane2 { position: relative; border-left: 1px solid #E2E8F0; cursor: copy;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--row) - 1px), #EEF2F6 calc(var(--row) - 1px), #EEF2F6 var(--row)),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--row) * 4 - 1px), #CBD5E1 calc(var(--row) * 4 - 1px), #CBD5E1 calc(var(--row) * 4)); }
.lane2 .closed { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #F1F5F9, #F1F5F9 6px, #E2E8F0 6px, #E2E8F0 7px); pointer-events: none; }
.lane2 .break { position: absolute; left: 3px; right: 3px; background: #E2E8F0; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #475569; font-weight: 700; font-size: 12px; pointer-events: none; }
.lane2 .now { position: absolute; left: 0; right: 0; height: 2px; background: #DC2626; z-index: 3; pointer-events: none; }
.lane2 .now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #DC2626; }
.appt2 { position: absolute; left: 3px; right: 3px; display: flex; flex-direction: column; overflow: hidden; border: 0; border-radius: 8px; padding: 0; cursor: pointer; text-align: left; font-family: inherit;
  background: #fff; box-shadow: 0 0 0 1px rgba(16,24,40,.12), 0 1px 2px rgba(16,24,40,.08); z-index: 2; }
.appt2:hover { box-shadow: 0 0 0 2px #101828; z-index: 3; }
.appt2:focus-visible { outline: 3px solid #2563EB; outline-offset: 1px; }
.appt2 .seg { display: block; width: 100%; background: color-mix(in srgb, var(--c) 16%, #fff); border-left: 5px solid var(--c); box-sizing: border-box; }
.appt2 .seg + .seg { border-top: 1px dashed color-mix(in srgb, var(--c) 55%, #fff); }
.appt2-body { position: absolute; inset: 0; padding: 4px 8px 4px 11px; display: flex; flex-direction: column; gap: 1px; font-size: 12px; color: #101828; line-height: 1.3; }
.appt2-body.compact { flex-direction: row; gap: 6px; align-items: center; white-space: nowrap; padding-top: 0; padding-bottom: 0; }
.appt2-name { font-weight: 800; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt2-meta { color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt2-svc { display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt2-svc i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.appt2-svc b { font-weight: 700; color: #475569; }
.appt2.pending { box-shadow: 0 0 0 2px #D97706; }
.appt2.new { animation: flash 2.5s ease-out; }
.sw-closed { width: 12px; height: 10px; border-radius: 3px; background: repeating-linear-gradient(135deg, #F1F5F9, #F1F5F9 3px, #CBD5E1 3px, #CBD5E1 4px); }
.seg-toggle { display: inline-flex; background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; padding: 3px; }
.seg-toggle button { border: 0; background: transparent; padding: 8px 12px; border-radius: 8px; font: 700 14px var(--font-body); color: #475569; cursor: pointer; }
.seg-toggle button.on { background: #101828; color: #fff; }
.fab { width: 46px; height: 46px; border-radius: 50%; border: 0; background: #C4F83A; color: #101828; font-size: 26px; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: 0 4px 12px rgba(16,24,40,.18); }
.fab:hover { filter: brightness(.95); }
.svc-pick { display: grid; gap: 6px; }
.svc-pick .pick { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid #E2E8F0; border-radius: 10px; font-weight: 600; cursor: pointer; }
.svc-pick .pick input { width: 18px; height: 18px; min-height: 0; accent-color: #101828; }
.svc-pick .pick span { flex: 1; }
.svc-pick .pick b { color: #475569; font-weight: 700; }
.svc-pick .pick.on { border-color: #101828; background: #F7FEE7; }

.agenda2.week { --cw: 130px; }
/* Date title doubles as a native date picker (tap/click the date). */
.ag-title { position: relative; display: inline-flex; align-items: center; margin: 0; font: 800 24px var(--font-heading); cursor: pointer; }
.ag-title input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; min-height: 0; padding: 0; border: 0; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn.ic { min-width: 44px; padding: 0; font-size: 22px; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.hint { margin: 0 0 10px; }
.drawer-bg { position: fixed; inset: 0; background: rgba(16,24,40,.35); z-index: 49; }
.mtop, .mtabs, .mfab, .msheet, .msheet-bg, .blist { display: none; }
button, a, .lane2, .appt2 { -webkit-tap-highlight-color: transparent; }
button, .btn, .lane2 { touch-action: manipulation; }

/* ---------- Phones & small tablets: app-style layout ---------- */
@media (max-width: 860px) {
  .app { display: block; min-height: 100dvh; padding-top: calc(56px + env(safe-area-inset-top)); padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .side { display: none; }
  .mtop { display: flex; position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0 14px; align-items: center; gap: 10px; background: #101828; color: #fff; }
  .msym { width: 30px; height: 30px; flex: none; background: url('/favicon.svg') center / contain no-repeat; }
  .mtitle { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
  .mtitle strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mtitle span { font-size: 12px; color: #CBD5E1; }
  .mbtn { width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: inherit; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
  .mtabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid #E2E8F0; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(16,24,40,.06); }
  .mtabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 64px; color: #64748B; text-decoration: none; font-size: 11px; font-weight: 700; position: relative; }
  .mtabs a.active { color: #101828; }
  .mtabs a.active::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: #C4F83A; }
  .msheet-bg { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(16,24,40,.45); }
  .msheet { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; max-height: 88dvh; overflow: auto; background: #101828; color: #fff; border-radius: 20px 20px 0 0; padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); }
  .msheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
  .msheet .wordmark { background-image: url('/logo-dark.svg'); height: 30px; }
  .msheet nav { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
  .msheet nav a { display: flex; align-items: center; min-height: 48px; padding: 8px 12px; border-radius: 12px; background: #202939; color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; }
  .msheet nav a.active { box-shadow: inset 3px 0 0 #C4F83A; }
  .msheet nav a.soon { opacity: .45; pointer-events: none; }
  .msheet .gsel { margin: 4px 0 6px; }
  .msheet label { color: #CBD5E1; }
  .msheet-f { margin-top: 14px; font-size: 13px; color: #CBD5E1; }
  .msheet-f a { color: #fff; }
  .main { padding: 14px 12px 20px; }
  .main h1 { font-size: 22px; }
  .main h2 { font-size: 19px; }
  .btn { min-height: 44px; }
  input, select, textarea { font-size: 16px; } /* prevents iOS zoom on focus */
  .topbar { margin-bottom: 12px; gap: 10px; }
  .view-overzicht .topbar > .row { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .view-overzicht .topbar > .row .btn { flex: none; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { padding: 10px 12px; border-radius: 12px; }
  .metric .v { font-size: 22px; }
  .notice { font-size: 14px; }
  /* Drawers become full-screen sheets */
  .drawer { inset: 0; width: 100%; height: 100dvh; border-radius: 0; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
  .drawer > .row:first-child { position: sticky; top: 0; z-index: 2; background: #fff; margin: 0 -16px 8px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid #E2E8F0; }
  .drawer h2 { font-size: 20px; }
  .drawer .row .btn { flex: 1 1 auto; }
  .drawer > .row:first-child .btn { flex: none; width: 44px; }
  .drawer h3 { margin-top: 18px; }
  .summary { grid-template-columns: 1fr; }
  .summary dd { margin-bottom: 12px; }
  .drawer form.row input { max-width: none !important; flex: 1 1 140px; }
  /* Appointment lists → compact cards */
  table.bookings { display: none; }
  .blist { display: grid; gap: 10px; }
  .bcard { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; font: inherit; color: inherit; background: #fff; border: 1px solid #E2E8F0; border-radius: 14px; padding: 12px 14px; cursor: pointer; }
  .bcard:active { background: #F8FAFC; }
  .bcard.new { box-shadow: 0 0 0 2px #C4F83A; }
  .bc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .bc-when { font-weight: 800; font-size: 15px; }
  .bc-name { font-weight: 700; font-size: 15px; }
  .bc-car { font-size: 14px; color: #475569; }
  .bc-svc { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
  .bc-svc span { display: flex; align-items: center; gap: 6px; }
  .bc-svc i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
  .bc-svc b { color: #64748B; font-weight: 700; }
  .bc-meta { font-size: 13px; color: #64748B; }
  /* Tables → cards */
  table.resp, table.resp tbody, table.resp tr, table.resp td { display: block; width: 100%; }
  table.resp { background: transparent; border-radius: 0; }
  table.resp thead { display: none; }
  table.resp tr { background: #fff; border: 1px solid #E2E8F0; border-radius: 14px; padding: 8px 12px; margin-bottom: 10px; }
  table.resp td { border: 0; padding: 4px 0; display: flex; gap: 12px; justify-content: space-between; text-align: right; }
  table.resp td::before { content: attr(data-label); color: #64748B; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; text-align: left; flex: none; }
  table.resp td:not([data-label]) { text-align: left; }
  table.resp td:not([data-label])::before { content: none; }
  table.resp td input, table.resp td select { max-width: 60%; }
  /* Workshop board: swipe between columns */
  .board { grid-template-columns: repeat(7, 84vw); scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .board .colm { scroll-snap-align: start; }
  /* Branding editor & other two-column layouts stack */
  .main .grid[style*="grid-template-columns"], .main .grid.two { grid-template-columns: minmax(0, 1fr) !important; }
  .main .grid > *, .main form, .main .card { min-width: 0; max-width: 100%; }
  .main input, .main select, .main textarea { max-width: 100%; }
  .main .row { min-width: 0; }
  .main pre, .main code { white-space: pre-wrap; word-break: break-all; }
  #pv { width: 100% !important; height: 560px !important; }
  .toast { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); max-width: none; }
  .mfab { display: block; position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 35; width: 56px; height: 56px; font-size: 30px; }
  .dfab { display: none; }
  /* Agenda */
  .ag-bar { flex-direction: column; align-items: stretch; }
  .ag-date { justify-content: space-between; flex-wrap: nowrap; gap: 4px; }
  .ag-title { flex: 1; justify-content: center; font-size: 19px; text-align: center; }
  .ag-tools { flex-wrap: nowrap; gap: 8px; }
  .ag-tools .seg-toggle { flex: 1; }
  .ag-tools .seg-toggle button { flex: 1; padding: 9px 6px; font-size: 13px; }
  .ag-tools .btn.sm { padding: 0 10px; font-size: 13px; white-space: nowrap; }
  .legend { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 8px; padding: 0 12px 2px; scrollbar-width: none; }
  .legend::-webkit-scrollbar { display: none; }
  .legend .pill { flex: none; }
  .hint { display: none; }
  .agenda2 { --tw: 50px; --cw: 128px; border-radius: 12px; max-height: none; height: calc(100dvh - 56px - 64px - 168px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 380px;
    scroll-snap-type: x proximity; scroll-padding-left: var(--tw); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .agenda2.week { --cw: 112px; }
  .agenda2 .a-head { padding: 8px 4px; font-size: 13px; scroll-snap-align: start; }
  .agenda2 .a-head.a-time { scroll-snap-align: none; font-size: 11px; }
  .t-row { grid-template-columns: 1fr 22px; }
  .t-row .t-h { font-size: 12px; padding-left: 6px; }
  .t-row .t-m { font-size: 10px; }
  .appt2-body { padding: 3px 6px 3px 9px; font-size: 11px; }
  .appt2-name { font-size: 12px; }
  .appt2 .seg { border-left-width: 4px; }
}
@media (max-width: 400px) { .agenda2 { --cw: 118px; } .ag-tools .btn.sm .lg { display: none; } .ag-tools .btn.sm { text-transform: capitalize; } }

.dsvc { display: flex; align-items: center; gap: 6px; }
.dsvc i { width: 9px; height: 9px; border-radius: 2px; flex: none; }

/* Setup: opening hours, mechanics, resources */
.setup-card { margin-bottom: 12px; }
.setup-card.inactive { opacity: .7; }
.hours-grid { display: grid; gap: 6px; }
.hrow { display: grid; grid-template-columns: 150px 1fr 14px 1fr; gap: 8px; align-items: center; }
.hrow.off input[type=time] { opacity: .45; }
.hrow .hday { margin: 0; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.hrow .hday input, .chip input { width: 18px; height: 18px; min-height: 0; accent-color: #101828; }
.hrow input[type=time] { min-height: 40px; padding: 6px 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border: 1px solid #E2E8F0; border-radius: 999px; font-weight: 600; font-size: 14px; cursor: pointer; }
.res-list { display: grid; gap: 8px; }
.res-row { display: grid; grid-template-columns: 1fr 200px auto auto; gap: 8px; align-items: center; }
.res-row.inactive input[data-rname] { text-decoration: line-through; color: #64748B; }
@media (max-width: 860px) {
  .hrow { grid-template-columns: 1fr 1fr 10px 1fr; gap: 6px; }
  .hrow .hday { font-size: 14px; }
  .res-row { grid-template-columns: 1fr 1fr; padding-bottom: 8px; border-bottom: 1px solid #EEF2F6; }
  .res-row input[data-rname] { grid-column: 1 / -1; }
}

.rec-row { display: grid; grid-template-columns: minmax(200px, 1fr) auto 44px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #EEF2F6; }
@media (max-width: 860px) { .rec-row { grid-template-columns: 1fr 44px; } .rec-row .row { grid-column: 1 / -1; grid-row: 2; } }
