:root {
  /* v2.3: per-facility branding. --brand-primary / --brand-accent are the
     themeable inputs (a facility's saved colors override them via a
     server-injected <style>); the contrast vars are derived server-side
     from the brand colors so text on colored surfaces stays readable.
     Defaults below reproduce the original palette exactly. */
  --brand-primary: #1a5d3a;
  --brand-accent: #e8a020;
  --brand-primary-contrast: #ffffff;
  --brand-accent-contrast: #3a2703;
  --brand: var(--brand-primary);
  --brand-dark: #12422a;
  --accent: var(--brand-accent);
  --accent-dark: #c88412;
  --ink: #222;
  --muted: #5c6b62;
  --bg: #f5f7f4;
  --card: #ffffff;
  --line: #dfe5de;
  --danger: #b3261e;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: var(--brand); }
header.site { background: var(--brand-dark); color: #fff; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; max-width: 1100px; margin: 0 auto; }
.brand { font-weight: 800; font-size: 1.35rem; letter-spacing: .5px; color: #fff; text-decoration: none; }
.brand small { display: block; font-weight: 400; font-size: .8rem; color: #cfe3d5; }
nav.main { display: flex; gap: 4px; flex-wrap: wrap; }
nav.main a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; }
nav.main a:hover, nav.main a.active { background: rgba(255,255,255,.14); }
.hero { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff; padding: 52px 20px; }
.hero-inner { max-width: 1100px; margin: 0 auto; }
.hero h1 { margin: 0 0 8px; font-size: 2.2rem; }
.hero p { margin: 0 0 18px; max-width: 640px; color: #e4efe7; }
.btn { display: inline-block; border: 0; cursor: pointer; background: var(--accent); color: var(--brand-accent-contrast); font-weight: 700; padding: 12px 20px; border-radius: 10px; text-decoration: none; font-size: 1rem; }
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: #fff; color: var(--brand-dark); border: 2px solid var(--brand); }
.btn.small { padding: 7px 12px; font-size: .88rem; border-radius: 8px; }
.btn.danger { background: var(--danger); color: #fff; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 20px; }
.grid { display: grid; gap: 16px; }
.grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) { .grid.cols3, .grid.cols2 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin-top: 0; }
.price { font-size: 1.7rem; font-weight: 800; color: var(--brand); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #e8f2ea; color: var(--brand-dark); }
.badge.warn { background: #fdeecd; color: #7a5200; }
.badge.bad { background: #fbe3e1; color: var(--danger); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #eef3ed; font-weight: 700; }
tr:hover td { background: #f7faf7; }
form label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #c6cfc5; border-radius: 8px; font-size: 1rem; font-family: inherit; background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
.hint { color: var(--muted); font-size: .88rem; }
.error { background: #fbe3e1; color: var(--danger); padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-weight: 600; }
.success { background: #e3f4e6; color: var(--brand-dark); padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-weight: 600; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.tabs button { border: 1px solid var(--line); background: #fff; padding: 9px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--ink); }
.tabs button.active { background: var(--brand); color: var(--brand-primary-contrast); border-color: var(--brand); }
footer.site { background: var(--brand-dark); color: #d7e5db; margin-top: 40px; }
footer.site .wrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
footer.site a { color: #fff; }
@media (max-width: 760px) { footer.site .wrap { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; }
.kv dt { font-weight: 700; color: var(--muted); }
.kv dd { margin: 0; }
.right { text-align: right; }
.mt { margin-top: 16px; }

/* ---- v2 additions ---- */
.promo-banner { background: #fdf3d7; border: 1px solid #ecd28a; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; }
.promo-banner strong { color: #7a5200; }
.map-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.map-unit { width: 86px; padding: 8px 6px; border-radius: 8px; border: 2px solid var(--line); text-align: center; font-size: .8rem; font-weight: 700; background: #fff; }
.map-unit small { display: block; font-weight: 400; color: var(--muted); font-size: .68rem; }
.map-unit.available { border-color: #2e7d4f; background: #e7f5ec; cursor: pointer; }
.map-unit.available:hover { background: #d3eedd; }
.map-unit.taken, .map-unit.occupied { border-color: #b9c2b9; background: #ecefec; color: #666; }
.map-unit.reserved { border-color: #e8a020; background: #fdf3d7; }
.map-unit.past-due { border-color: #d97706; background: #fdeeda; cursor: pointer; }
.map-unit.overlocked { border-color: var(--danger); background: #fbe3e1; cursor: pointer; }
.map-unit.unrentable, .map-unit.maintenance { border-color: #888; background: repeating-linear-gradient(45deg,#eee,#eee 6px,#e2e2e2 6px,#e2e2e2 12px); cursor: pointer; }
.map-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: 8px 0 14px; }
.map-legend span::before { content: '■ '; }
.size-fig { font-weight: 800; color: var(--brand); font-size: 1.05rem; margin: 2px 0 6px; }

/* ---- v2.3: unit photos ---- */
.type-photo { margin-bottom: 12px; }
.type-photo img.main-photo { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; display: block; background: #eef1ee; }
.photo-thumbs { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.photo-thumbs img { width: 52px; height: 38px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; display: block; }
.photo-thumbs img.on { border-color: var(--brand); }
.type-thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 8px; background: #eef1ee; }
.rent-photo { margin: 4px 0 10px; }
.rent-photo img { width: 100%; max-height: 230px; object-fit: cover; border-radius: 10px; display: block; background: #eef1ee; }
.rent-photo .photo-nav { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.photo-grid { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.photo-item { width: 128px; text-align: center; }
.photo-item img { width: 128px; height: 92px; object-fit: cover; border-radius: 8px; display: block; background: #eef1ee; }
.photo-item .cover-badge { display: inline-block; margin-top: 4px; }
.photo-item .photo-actions { display: flex; gap: 4px; justify-content: center; margin-top: 4px; flex-wrap: wrap; }
.swatch { display: inline-block; width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.25); vertical-align: middle; }
.preset-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.preset-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px 6px 7px; cursor: pointer; font-weight: 600; }
.preset-btn:hover { border-color: var(--brand); }
.theme-preview { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; max-width: 420px; margin-top: 10px; }
.theme-preview .tp-head { padding: 10px 14px; color: #fff; font-weight: 800; }
.theme-preview .tp-body { padding: 12px 14px; background: #fff; }
.theme-preview .tp-btn { display: inline-block; border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 700; }

/* ---- v2.2: saved map layout board ---- */
.map-board { display: grid; gap: 6px; }
.map-board .map-unit { width: auto; min-height: 58px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.map-unit .rotwrap { display: block; }
.map-cell { min-height: 58px; border: 1.5px dashed #d4dbd4; border-radius: 8px; background: #fafbfa; }
.map-anno { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 58px; padding: 6px; border-radius: 8px; background: #eef3fb; border: 2px solid #b9cdf0; color: #274b8f; font-weight: 700; font-size: .8rem; overflow: hidden; }
.map-marker { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 58px; padding: 6px; border-radius: 8px; background: #f4f4f4; border: 2px solid #c9c9c9; color: #555; font-weight: 700; font-size: .72rem; text-align: center; overflow: hidden; }
.map-marker .mk-icon { font-size: 1.15rem; line-height: 1; }
.map-marker.mk-driveway { background: #e8e8e8; border-style: dashed; }
.map-marker.mk-empty { background: transparent; border: 1.5px dashed #ddd; color: #bbb; }
.map-unplaced { margin-top: 14px; border: 1.5px dashed #e8a020; background: #fffaf0; border-radius: 8px; padding: 10px 12px; }
.map-unplaced h4 { margin: 0 0 8px; color: #7a5200; }
.map-unplaced .map-grid .map-unit { cursor: pointer; }

/* ---- v2.2: layout editor ---- */
.map-editor-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 14px; }
.map-editor-toolbar .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }
.map-board.editing .map-cell { cursor: pointer; }
.map-board.editing .map-cell.dragover { border-color: var(--brand); background: #e7f0fd; }
.map-board .map-unit[draggable="true"], .map-tray .map-unit { cursor: grab; }
.map-tile-sel { outline: 3px solid #ffb400; outline-offset: 1px; }
.map-tray { display: flex; flex-wrap: wrap; gap: 6px; min-height: 66px; border: 1.5px dashed #bbb; border-radius: 8px; padding: 8px; background: #fbfbf8; }
.map-tray.dragover { border-color: var(--brand); background: #e7f0fd; }
.map-tray .map-unit { width: 86px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filters label { margin: 0; }
.filters select, .filters input { width: auto; }
details.faq { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; margin-bottom: 10px; }
details.faq summary { font-weight: 700; cursor: pointer; }
.sigbox { font-family: "Segoe Script", "Comic Sans MS", cursive; font-size: 1.5rem; border-bottom: 2px solid var(--ink); padding: 4px 8px; min-height: 44px; }
.step { display: none; } .step.on { display: block; }
.alert { padding: 10px 14px; border-radius: 8px; margin: 8px 0; font-weight: 600; }
.alert.warn { background: #fdeecd; color: #7a5200; }
.alert.bad { background: #fbe3e1; color: var(--danger); }
.kpi { font-size: 1.9rem; font-weight: 800; color: var(--brand); }
.grid.cols4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols4 { grid-template-columns: repeat(2, 1fr); } }
@media print {
  header.site, footer.site, .tabs, .btn, nav.main { display: none !important; }
  body { background: #fff; }
  .card { border: none; padding: 0; }
}
