/* Casolena Housekeeping. Mobile-first. */
:root {
  --green: #1f3d2e;
  --green-soft: #2e5a44;
  --cream: #f6f4ef;
  --card: #ffffff;
  --ink: #22281f;
  --muted: #6b7263;
  --line: #e4e0d5;
  --accent: #b98a3e;
  --danger: #a33d2f;
  --ok: #2e7d4f;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 96px;
}
.is-admin .page { max-width: 1160px; padding-bottom: 40px; }

/* top bar */
.topbar {
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
}
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.logout-form { display: flex; align-items: center; gap: 10px; margin: 0; }
.whoami { opacity: .85; font-size: 14px; }
.linklike { background: none; border: none; color: #fff; text-decoration: underline; font-size: 14px; cursor: pointer; padding: 4px; }

/* admin nav */
.adminnav {
  background: var(--green-soft);
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 0 8px;
  -webkit-overflow-scrolling: touch;
}
.adminnav a {
  color: #dfe8e0; text-decoration: none; padding: 10px 12px; font-size: 14px; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.adminnav a.on { color: #fff; border-bottom-color: var(--accent); font-weight: 600; }

/* bottom tab bar (housekeepers) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: #fff; border-top: 1px solid var(--line);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}
.tabbar a {
  flex: 1; text-align: center; padding: 8px 0 6px; text-decoration: none;
  color: var(--muted); font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tabbar a svg { width: 24px; height: 24px; fill: currentColor; }
.tabbar a.on { color: var(--green); font-weight: 600; }

/* typography and layout */
h1.pagetitle { font-size: 22px; margin: 14px 0 12px; }
h2 { font-size: 16px; margin: 4px 0 10px; }
h3 { font-size: 14px; margin: 12px 0 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
a { color: var(--green-soft); }
.backlink { display: inline-block; margin-top: 10px; text-decoration: none; font-size: 14px; }
.toprow { display: flex; justify-content: space-between; align-items: center; }
.toprow form { margin: 0; }
.undo-link {
  background: none; border: none; cursor: pointer; padding: 4px 0; margin-top: 10px;
  color: var(--green-soft); text-decoration: underline; font: inherit; font-size: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
  display: block;
}
a.card { text-decoration: none; color: inherit; }
.card.highlight { border-left: 4px solid var(--accent); }
.card.empty { text-align: center; padding: 28px 16px; }
.inactive-card { opacity: .6; }
.done-note { background: #eef6ef; border-color: #cfe4d4; }

.list { margin: 8px 0; }
.listrow {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  padding: 12px 14px; margin: 6px 0; border-radius: 10px;
  text-decoration: none; color: inherit;
}
.chev { color: var(--muted); font-size: 20px; }

/* forms */
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack form { margin: 0; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=tel],
input[type=number], select, textarea {
  font: inherit; font-weight: 400;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); width: 100%;
}
textarea { resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.party-inputs { display: flex; gap: 8px; }
.party-inputs label { flex: 1; }
.nextguest-note { color: var(--accent); font-weight: 600; }

/* session header: status badge sits beside the date instead of on its own line */
.session-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.session-head .pagetitle { margin: 10px 0 6px; }
.session-head .badge { margin-top: 5px; }

/* departing and arriving guests, one line each */
.guestline { margin: 2px 0; font-size: 14px; }
.guestline.small { font-size: 13px; }
.guestrole { font-weight: 700; }
.tag-sameday {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  background: #fdf1dc; color: #8a6420; border-radius: 999px; padding: 2px 7px;
  vertical-align: 1px; white-space: nowrap;
}

/* Coming up: total in the heading, tail of the list behind "Show all" */
.count-note { font-size: 13px; color: var(--muted); font-weight: 400; }
.btn-more { margin-top: 6px; }
.list-month { margin-top: 18px; }

/* photo progress: a slim bar that unfolds the grid when tapped */
.card-chev { transition: transform .15s; }
.photo-progress {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; margin: 6px 0; cursor: pointer; font: inherit; text-align: left;
}
.photo-progress .progress { flex: 1; display: block; margin: 0; }
.photo-progress .progress-fill { display: block; }
.photo-progress [data-photo-label] { flex: none; white-space: nowrap; }
.photo-progress[aria-expanded="true"] .card-chev { transform: rotate(90deg); }

/* stars plus the Exceptional chip (appears once all five are lit); everything
   stays on one line, so the stars shrink a little on narrow phones */
.stars-row { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.exc-chip { position: relative; display: inline-flex; align-items: center; font-weight: 400; flex: none; }
.exc-chip[hidden] { display: none; }
.exc-chip input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.exc-chip > span {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); font-size: 12px; font-weight: 600;
  line-height: 1.2; white-space: nowrap; cursor: pointer; -webkit-user-select: none; user-select: none;
}
@media (max-width: 420px) {
  .stars { gap: 4px; }
  .star span svg { width: 27px; height: 27px; }
}
.exc-chip input:checked + span { background: #fdf1dc; border-color: var(--accent); color: #8a6420; }
.exc-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.stars.exc .star.lit span { color: #d4a017; }
.stars.exc .star.lit span svg { filter: drop-shadow(0 0 4px rgba(185, 138, 62, .55)); }

/* in-place saves: the "Saved" flash sits in the section heading */
h2 .save-note, h3 .save-note { font-weight: 600; margin-left: 4px; }
/* info icons + help popups */
.info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--green-soft); background: none; color: var(--green-soft);
  font-family: Georgia, serif; font-style: italic; font-weight: 700; font-size: 12px;
  line-height: 1; cursor: pointer; vertical-align: 2px; margin-left: 2px; padding: 0;
}
.help-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(25, 30, 22, .55);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.help-overlay[hidden] { display: none; }
.help-box {
  background: #fff; border-radius: 14px; padding: 16px;
  width: 100%; max-width: 460px; max-height: 82vh; overflow-y: auto;
}
.help-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.help-head h2 { margin: 0; }
.help-close { background: none; border: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; }

/* in-app confirm dialog (replaces window.confirm) */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(25, 30, 22, .55);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.confirm-box {
  background: #fff; border-radius: 14px; padding: 18px;
  width: 100%; max-width: 340px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}
.confirm-box h2 { margin: 0 0 8px; }
.confirm-box p { margin: 0 0 8px; font-size: 14px; }
.confirm-box ul { margin: 0 0 8px; padding-left: 20px; font-size: 14px; }
.confirm-box li { margin: 2px 0; }
.confirm-actions { display: flex; gap: 10px; margin-top: 14px; }
.confirm-actions .btn { flex: 1; }
/* three-choice dialogs (e.g. Save and leave / Leave / Stay) stack full width */
.confirm-actions-stack { flex-direction: column; }
.confirm-actions-stack .btn { flex: none; width: 100%; }

/* photos open in the in-page lightbox */
[data-view-full] { cursor: pointer; display: block; }

.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--green-soft); color: #fff; font-size: 13px; font-weight: 700;
  margin-right: 6px; vertical-align: -3px;
}
.card h3 { margin-top: 14px; }
.card h3:first-of-type { margin-top: 10px; }

/* compact admin forms (session detail and new session) */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; }
.form-grid label { font-size: 13px; gap: 4px; }
.form-grid input, .form-grid select, .form-grid textarea { padding: 8px 10px; font-size: 14px; }
.span2 { grid-column: span 2; }
.span4 { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 12px; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.party-mini { display: flex; gap: 6px; }
.party-mini input { text-align: center; padding: 8px 4px; }
.meta-strip { padding: 12px 16px; }
.meta-strip p { margin: 4px 0; }
.meta-strip .progress { margin: 2px 0 6px; }
.photo-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.photo-cols h3 { margin: 0 0 6px; font-size: 14px; }
@media (max-width: 600px) { .photo-cols { grid-template-columns: 1fr; } }
.delete-row { margin: 16px 0; }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-block; text-align: center; cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 600; font-size: 15px;
  background: #fff; color: var(--green);
  border: 1px solid var(--green-soft); border-radius: 10px;
  padding: 11px 16px;
}
.btn-primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn:disabled, .btn[disabled] { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-block { display: block; width: 100%; margin-top: 8px; }
.btn-small { padding: 7px 12px; font-size: 13px; }
.quickactions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.btnrow { display: flex; gap: 8px; margin-top: 8px; }
.btnrow .btn { flex: 1; }
.btn-ico {
  display: inline-flex; flex-direction: row; align-items: center; justify-content: center;
  gap: 6px; white-space: nowrap; font-size: 14px; padding-left: 8px; padding-right: 8px;
}
.btn-ico svg { width: 18px; height: 18px; fill: currentColor; flex: none; }

.flash { padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.flash-err { background: #f7e5e2; color: var(--danger); }
.flash-ok { background: #e6f2e9; color: var(--ok); }

.badge {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 3px 8px; border-radius: 999px; background: #eceade; color: var(--muted);
}
.badge-scheduled { background: #e8eef8; color: #33538a; }
.badge-in_progress { background: #fdf1dc; color: #8a6420; }
.badge-done { background: #e6f2e9; color: var(--ok); }
.badge-cancelled { background: #f0f0f0; color: #888; text-decoration: line-through; }
.badge-locked { background: #f7e5e2; color: var(--danger); }

/* progress */
.progress { height: 8px; background: #ece9df; border-radius: 999px; overflow: hidden; margin: 8px 0; }
/* amber while under way, green once complete (.full) */
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .25s, background-color .25s; }
.progress-fill.full { background: var(--ok); }

/* checklist */
.check-section { color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-size: 12px; margin: 8px 0 2px; }
.check-item {
  display: flex; flex-direction: row; align-items: flex-start; gap: 12px;
  font-weight: 400; font-size: 16px; padding: 6px 2px;
  border-bottom: 1px solid var(--line);
}
.check-item:last-child { border-bottom: none; }
.check-item input[type=checkbox] { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--green); flex: none; }
.check-item input:checked + span { color: var(--muted); text-decoration: line-through; }

/* layout rows: the admin arranges name, checkboxes, option pills and toggle
   flags in any order; the row wraps on narrow phones with the name growing */
.check-item.litem { flex-wrap: wrap; align-items: center; gap: 4px 10px; }
/* the name shares the row with the controls whenever it keeps at least
   min-width for its text; a wider control set wraps below as one unit */
.litem-name { flex: 1 1 0; min-width: 96px; }
.litem-ctls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.litem[data-done="1"] .litem-name { color: var(--muted); }
.litem-opts { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.opt-btn, .flag-btn {
  border: 1px solid var(--line); background: none; border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer;
}
.opt-btn[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
/* segmented button: one pill, a part per value, only one part active */
.litem-segs { display: inline-flex; }
.seg-btn {
  border: 1px solid var(--line); background: none; margin-left: -1px;
  padding: 7px 14px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer;
}
.seg-btn:first-child { border-radius: 999px 0 0 999px; margin-left: 0; }
.seg-btn:last-child { border-radius: 0 999px 999px 0; }
.seg-btn[aria-pressed="true"] {
  background: var(--ok); border-color: var(--ok); color: #fff; position: relative; z-index: 1;
}
/* narrow phones: slimmer control pills and a narrower name column, so most
   rows fit on a single line and the list stays short */
@media (max-width: 420px) {
  .opt-btn, .seg-btn, .flag-btn { padding: 5px 9px; font-size: 13px; }
  .litem-opts, .litem-ctls { gap: 5px; }
  .check-item.litem { gap: 4px 8px; }
  .litem-name { min-width: 84px; font-size: 15px; }
}
.flag-btn { color: var(--muted); }
.flag-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag-chip {
  display: inline-block; vertical-align: 1px; margin-left: 2px;
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
  font-size: 11px; color: var(--muted); white-space: nowrap;
}
.flagged-line { color: var(--accent); }

/* checklist multi-pick on the session forms */
.fieldlike { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; }
.pick-lists { display: flex; flex-wrap: wrap; gap: 6px; font-weight: 400; align-items: center; min-height: 42px; }
/* "every cleaning" checklists show as locked-on pills */
.flag-pill input:disabled + span { cursor: default; }

/* checklist list (admin): draggable rows, the whole rest of the row still a link */
.cl-row { justify-content: flex-start; gap: 8px; padding: 8px 14px 8px 8px; }
.cl-link {
  flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  text-decoration: none; color: inherit; min-width: 0;
}
.cl-link .badge { margin-left: 4px; }

/* placement + every-cleaning settings on the checklist form */
.cl-settings { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.cl-settings select { width: auto; }
.cl-settings .flag-pill { margin-bottom: 8px; }

/* checklists folded into the arrive / done steps of the cleaning page */
.embed-check { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.embed-check h3 { margin: 0; }

/* info topics: short-name chip on the guides page, stacked blocks in item popups */
.topic-key { background: #f3efe4; border-radius: 5px; padding: 1px 5px; font-size: 12px; font-weight: 600; }
/* topic form first row: short name + keywords + the auto-attach toggle, aligned */
.topic-row1 { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.topic-row1 > label:not(.flag-pill) { flex: 1 1 220px; }
.topic-row1 .flag-pill { margin-bottom: 7px; }
/* topic form: title + Delete on one row, Add photos + Save on one row */
.topic-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topic-head .pagetitle { margin-right: auto; }
.topic-head form { margin: 0; }
.topic-photos h3 { margin: 0 0 6px; }
.topic-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topic-block { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 8px; }
.help-head + .topic-block { border-top: none; margin-top: 0; padding-top: 0; }
.topic-title { margin: 0 0 4px; }

/* checklist row-layout builder (admin): every control in a row shares one
   38px height, so the line reads as a single unit */
.lb-block { display: flex; flex-direction: column; gap: 8px; }
.lb-title { font-size: 14px; font-weight: 600; }
.lb-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lb-row select { width: auto; flex: none; }
.lb-row select, .lb-row input[type=text] { height: 38px; padding: 8px 10px; font-size: 14px; }
.lb-values { flex: 1 1 240px; }
.lb-label { flex: 1 1 140px; }
.lb-multi { flex-direction: row; align-items: center; gap: 5px; font-weight: 400; font-size: 13px; white-space: nowrap; }
.lb-multi input { width: 16px; height: 16px; accent-color: var(--green); }
.lb-row [hidden] { display: none !important; }
.lb-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  width: 34px; height: 38px; cursor: pointer; font-size: 15px; color: var(--muted); flex: none;
}
.lb-drag { height: 38px; padding: 8px 6px; margin-left: 0; }
.lb-row.dragging, .cl-row.dragging { opacity: .7; background: #f3efe4; border-radius: 10px; cursor: grabbing; }
.lb-block .btn { align-self: flex-start; }
.lb-preview { display: flex; flex-direction: column; gap: 4px; }
.lb-preview .litem { pointer-events: none; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }

/* stars: SVG glyphs, not font glyphs - font stars sit low in their line box by
   an amount that differs per device font, so they never centre against the
   Exceptional chip; an SVG's ink is its box and flex centring is exact */
.stars { display: flex; align-items: center; gap: 6px; }
.star input { position: absolute; opacity: 0; width: 0; }
.star span { display: block; color: #d8d4c6; cursor: pointer; }
.star span svg { display: block; width: 32px; height: 32px; fill: currentColor; }
.star.lit span { color: var(--accent); }

/* photos */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.thumb { position: relative; margin: 0; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.thumb-x {
  position: absolute; top: 4px; right: 4px;
  width: 26px; height: 26px; border-radius: 50%; border: none; padding: 0;
  background: rgba(0,0,0,.55); cursor: pointer;
}
/* the cross is drawn, not typed: two centred bars, so it cannot sit off-centre */
.thumb-x::before, .thumb-x::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 12px; height: 1.7px; border-radius: 1px; background: #fff;
}
.thumb-x::before { transform: translate(-50%, -50%) rotate(45deg); }
.thumb-x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.thumb.uploading { opacity: .5; }

/* calendar */
.cal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.cal-header .pagetitle { margin: 0; }
.cal-multi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .cal-multi { grid-template-columns: 1fr; } }
.cal-month-title {
  text-align: center; margin: 0 0 8px; font-size: 14px; font-weight: 700;
  color: #2e3942; letter-spacing: .3px;
}
.cal-multi .calgrid { margin: 0; box-shadow: 0 1px 3px rgba(34, 40, 31, .06); }
.cal-multi .cal-day { height: 42px; }
.cal-multi .cal-dot { line-height: 0; vertical-align: top; }
.cal-multi .cal-num { line-height: 1.2; padding-bottom: 4px; }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 14px; }
.cal-wd {
  text-align: center; font-size: 10px; color: #98a1aa; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px; padding: 2px 0 6px;
}
/* Cool neutral theme: unbooked days near-white gray, booked nights a quiet
   blue-gray, today a single vivid green. */
.cal-day {
  min-height: 52px; padding: 3px; text-align: center;
  display: block; color: inherit; text-decoration: none;
  background: #f5f6f7; position: relative;
  transition: background .15s ease;
}
a.cal-day:hover { background: #eaedf0; }
.cal-day.cal-today { background: #18a05a; }
a.cal-day.cal-today:hover { background: #12854a; }
.cal-day.cal-today .cal-num { font-weight: 700; color: #fff; }
.cal-out { background: transparent; }
.cal-num { font-size: 13px; color: #4a545e; text-decoration: none; display: block; padding: 2px; font-variant-numeric: tabular-nums; }
/* Booked stays: one continuous bar per stay, drawn as spans inside the day
   tiles. The bar starts 2/3 into the check-in day (4pm check-in), bridges the
   grid gaps between days, and ends 1/3 into the check-out day, leaving the
   middle of the check-out tile clear for the cleaning dot. */
.cal-bar {
  position: absolute;
  top: 0; bottom: 0; left: -8px; right: 0;
  /* The first 8px bridges the grid gap in a lighter shade, so days inside a
     block stay visibly separate while the block still reads as one bar. */
  background: linear-gradient(to right, #d7e5f4 8px, #cfe0f2 8px);
  pointer-events: none;
}
/* Hover darkens only the box portion of the bar; the gap bridge keeps its
   resting shade. */
a.cal-day:hover .cal-bar { background: linear-gradient(to right, #d7e5f4 8px, #b9d2ea 8px); }
.cal-bar-flush { left: 0; background: #cfe0f2; }
a.cal-day:hover .cal-bar-flush { background: #b9d2ea; }
.cal-bar-start {
  left: 66.667%;
  background: #cfe0f2;
  border-top-left-radius: 14px; border-bottom-left-radius: 14px;
}
a.cal-day:hover .cal-bar-start { background: #b9d2ea; }
.cal-bar-end {
  right: 66.667%;
  border-top-right-radius: 14px; border-bottom-right-radius: 14px;
}
/* Today's tile stays solid green; day number and dots sit above the bars. */
.cal-today .cal-bar { display: none; }
.cal-num, .cal-dot { position: relative; z-index: 1; }

/* instant tooltips: one floating box, filled and placed by app.js for any
   element carrying data-tip (shows with no delay, unlike native title) */
.tip-pop {
  position: fixed; z-index: 130;
  background: #26313b; color: #fff;
  font-size: 12px; line-height: 1.45; font-weight: 400; text-align: left;
  padding: 8px 11px; border-radius: 8px;
  white-space: pre-line; width: max-content; max-width: 260px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
  pointer-events: none;
}
.tip-pop[hidden] { display: none; }
.cal-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 1px 2px;
  background: var(--muted);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
}
.dot-scheduled { background: #33538a; }
.dot-in_progress { background: #c99a35; }
.dot-done { background: var(--ok); }
.dot-cancelled { background: #bbb; }

/* login */
.login-wrap { display: flex; justify-content: center; padding-top: 8vh; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }

.pw-form { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 10px; }

/* cleaner colours */
.cleaner-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.fieldlabel { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.color-select { display: inline-flex; align-items: center; position: relative; }
.color-btn {
  width: 64px; height: 32px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer;
}
.color-menu {
  position: absolute; top: calc(100% + 5px); left: 0; z-index: 40;
  display: flex; gap: 8px; padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
}
.color-menu[hidden] { display: none; }
.color-opt {
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(0, 0, 0, .12);
}
.color-opt:hover { outline: 2px solid var(--green-soft); outline-offset: 1px; }
.color-opt-text { width: auto; padding: 0 10px; background: #fff; font: inherit; font-size: 12px; color: var(--muted); }

/* compact team rows */
.member { padding: 10px 14px; }
.member-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.member-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.member-form { display: flex; align-items: center; gap: 6px; margin: 0; }
.member-form input { width: 170px; padding: 7px 9px; font-size: 13px; }
.member-form select { width: auto; padding: 7px 9px; font-size: 13px; }
.member-form-wrap { flex-wrap: wrap; }
.member-form-wrap input[name=password] { width: 200px; }

/* sessions table (admin, desktop) */
.table-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.tablewrap { padding: 0; overflow-x: auto; }
.stable { width: 100%; min-width: 940px; border-collapse: collapse; font-size: 14px; }
.stable th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--line);
  background: #faf9f5; position: sticky; top: 0;
}
.stable td { padding: 2px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.stable tr:last-child td { border-bottom: none; }
/* Spreadsheet feel: controls read as plain text until you hover or edit them */
.stable .quick-field {
  border: 1px solid transparent; background: transparent; border-radius: 6px;
  font-size: 13px; padding: 3px 6px;
}
.stable tr:hover .quick-field { border-color: var(--line); background: #fff; }
.stable .quick-field:focus { border-color: var(--green-soft); background: #fff; outline: none; }
.stable select.quick-field { width: auto; }
.datelink { color: inherit; text-decoration: none; }
.datelink:hover strong { text-decoration: underline; color: var(--green-soft); }
.time-field { width: 56px; text-align: center; }
.time-field:invalid { border-color: var(--danger) !important; }
.nextguest-field { width: 86px; }
.th-req { width: 30%; }
.th-notes { width: 16%; }
.td-notes { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.td-req textarea {
  display: block; width: 100%; min-width: 280px; box-sizing: border-box;
  height: 26px; line-height: 18px; resize: none; overflow: hidden; white-space: nowrap;
}
.stable td.save-cell { padding: 0 4px 0 0; }
.nowrap { white-space: nowrap; }
.row-cancelled { opacity: .55; }
.save-note { display: inline-block; min-width: 44px; font-size: 11px; color: var(--ok); }

.privacy-link { margin-top: 20px; text-align: center; }

/* cleaner activity (admin) */
.activity-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.activity-filters input[type="date"], .activity-filters select { width: auto; }
.activity-table { min-width: 720px; }
.activity-table td { padding: 6px 12px; }
.activity-table td.activity-detail { white-space: normal; max-width: 340px; }
.activity-delete { margin-top: 16px; }
.activity-delete summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.activity-delete[open] summary { margin-bottom: 12px; }
.activity-delete-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.activity-delete-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.activity-delete-form input, .activity-delete-form select { width: auto; }
.activity-delete-form input[name="ip"] { width: 150px; }

/* page section headers: a title with an action button pushed to the right */
.section-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.section-head h2 { margin: 0; margin-right: auto; }
.section-gap { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 18px; }

/* request rules (admin) */
.rule-add-panel[hidden] { display: none; }
.rule-add-panel h3 { margin-top: 0; }
.rule-form { display: flex; flex-direction: column; gap: 10px; }
.cond-list { display: flex; flex-direction: column; gap: 6px; }
.cond-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cond-row select, .cond-row input { width: auto; padding: 8px 10px; font-size: 14px; }
.cond-row input[data-cond-value] { width: 80px; }
.cond-when { min-width: 42px; text-align: right; font-size: 13px; font-weight: 600; color: var(--muted); }
.cond-when::after { content: "when"; }
.cond-row + .cond-row .cond-when::after { content: "and"; }
.cond-x { border: none; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.cond-x:hover { color: var(--danger); }
.rule-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* compact rule rows; Edit unfolds the form panel underneath */
.rule-card { padding: 10px 14px; }
.rule-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rule-summary {
  flex: 1; min-width: 240px; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inactive-card .rule-summary { text-decoration: none; }
.rule-panel { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 12px; }
.rule-panel[hidden] { display: none; }
/* gold "+N" marker in the sessions table: items a rule adds to that clean */
.req-cell { display: flex; align-items: center; gap: 6px; }
.req-cell textarea { flex: 1; }
.rules-chip {
  flex: none; font-size: 11px; font-weight: 700; line-height: 1;
  color: #8a6420; background: #fdf1dc; border-radius: 999px;
  padding: 4px 7px; cursor: default;
}
/* rule-item pills on the admin session page (tick = used, blank = skipped) */
.rule-items-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
/* the variables cheat-sheet under the add-rule form */
.var-help summary { font-size: 13px; font-weight: 600; color: var(--green-soft); cursor: pointer; }
.var-list { margin: 6px 0 0; padding-left: 18px; columns: 2; }
.var-list li { margin: 2px 0; break-inside: avoid; }
.var-list code { background: #f3efe4; border-radius: 5px; padding: 1px 5px; font-size: 12px; }
@media (max-width: 720px) { .var-list { columns: 1; } }

/* in-app camera overlay */
.cam-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: #000; display: flex; flex-direction: column;
}
.cam-overlay video { flex: 1; min-height: 0; width: 100%; object-fit: cover; }
.cam-flash {
  position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none;
  transition: opacity .1s;
}
.cam-flash.on { opacity: .7; }
.cam-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
  background: #000;
}
.cam-shutter {
  width: 68px; height: 68px; border-radius: 50%; cursor: pointer;
  background: #fff; border: 5px solid #8a8a8a;
}
.cam-shutter:active { background: #ddd; transform: scale(.95); }
.cam-done {
  background: none; border: 1px solid #888; color: #fff;
  font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 10px; cursor: pointer;
}
.cam-count { color: #fff; font-size: 13px; min-width: 64px; text-align: right; }

/* photo matching: label chip on thumbs, required-shot coverage, admin page */
.match-chip {
  position: absolute; left: 4px; right: 4px; bottom: 4px;
  width: calc(100% - 8px);
  font-size: 11px; font-family: inherit; color: #fff;
  background: rgba(34, 40, 31, .68); border: none; border-radius: 8px;
  padding: 4px 6px; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.match-chip.on { background: rgba(46, 125, 79, .82); }
.match-chip:focus { outline: 2px solid var(--accent); }

.ref-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ref-add input[type=text] { flex: 1; min-width: 180px; }
.ref-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.ref-row.ref-off { opacity: .55; }
input[type=text].ref-name { width: 190px; flex: 0 1 auto; padding: 8px 10px; font-size: 14px; }

/* flag pills: checkboxes dressed up as toggle chips */
.flag-pill { position: relative; display: inline-flex; font-weight: 400; }
.flag-pill input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.flag-pill span {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 12px; font-weight: 600; line-height: 1.2; cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.flag-pill span::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid currentColor; margin-right: 6px; vertical-align: 1px;
}
.flag-pill input:checked + span { background: #e6f2e9; border-color: #9fc7ab; color: var(--ok); }
.flag-pill input:checked + span::before { background: currentColor; }
.flag-pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* the Enabled/Disabled switch: same checkbox underneath, clearer on-off look */
.flag-toggle { display: inline-flex; align-items: center; cursor: pointer; position: relative; }
.flag-toggle input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.tog-track {
  flex: none; width: 34px; height: 20px; border-radius: 999px;
  background: #cbc5b4; position: relative; transition: background .15s ease;
}
.tog-knob {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: left .15s ease;
}
.flag-toggle input:checked + .tog-track { background: var(--ok); }
.flag-toggle input:checked + .tog-track .tog-knob { left: 16px; }
.flag-toggle input:focus-visible + .tog-track { outline: 2px solid var(--accent); outline-offset: 1px; }
.ref-del { margin-left: auto; }
.ref-views { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ref-angle { position: relative; }
.ref-angle img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; display: block; }
.ref-view-open { cursor: pointer; display: block; }
.ref-nofp {
  position: absolute; top: 1px; left: 1px; width: 15px; height: 15px;
  font-style: normal; font-size: 10px; font-weight: 700; text-align: center; line-height: 15px;
  color: #fff; background: var(--danger); border-radius: 50%;
}
.angle-x {
  position: absolute; top: -5px; right: -5px;
  width: 17px; height: 17px; border-radius: 50%; border: none; padding: 0;
  background: rgba(0,0,0,.6); cursor: pointer;
}
.angle-x::before, .angle-x::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 8px; height: 1.5px; border-radius: 1px; background: #fff;
}
.angle-x::before { transform: translate(-50%, -50%) rotate(45deg); }
.angle-x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.ref-addangle { align-self: center; padding: 5px 10px; }
.ref-save-row { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.drag-handle {
  border: none; background: none; padding: 8px 5px; margin-left: -5px;
  color: #b8b2a2; cursor: grab; touch-action: none;
  display: flex; align-items: center;
}
.drag-handle svg { fill: currentColor; display: block; }
.drag-handle:hover { color: var(--green-soft); }
.ref-row.dragging { opacity: .7; background: #f3efe4; border-radius: 10px; cursor: grabbing; }
.ref-row.dragging .drag-handle { cursor: grabbing; }

.thr-form { margin: 0 0 6px; }
.thr-row { display: flex; align-items: center; gap: 10px; }
.thr-row input[type=range] { flex: 1; }
.prev-list { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; }
.prev-row {
  display: flex; align-items: center; gap: 10px; padding: 5px 0;
  border-top: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.prev-list .prev-row:first-child { border-top: none; }
.prev-row img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; display: block; }
.prev-what { min-width: 130px; }
.prev-name { flex: 1; }
.prev-score { font-variant-numeric: tabular-nums; }
.prev-mark::after { content: "no match"; font-size: 11px; color: var(--danger); font-weight: 600; }
.prev-row.matched { color: var(--ink); }
.prev-row.matched .prev-mark::after { content: "match"; color: var(--ok); }

/* faded sample slots in the housekeeper photo grid */
.sample-slot { position: relative; margin: 0; cursor: pointer; }
.sample-slot img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px;
  opacity: .3; display: block;
}
.sample-slot::after {
  content: ""; position: absolute; inset: 0;
  border: 1.5px dashed #c9c3b2; border-radius: 10px; pointer-events: none;
}
.sample-slot[hidden] { display: none; }

/* tap a sample: full view with the room name */
.sample-overlay {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(20, 24, 18, .82);
  display: flex; align-items: center; justify-content: center; padding: 22px;
}
.sample-overlay figure { margin: 0; max-width: min(92vw, 560px); text-align: center; }
.sample-overlay img {
  max-width: 100%; max-height: 68vh; border-radius: 12px; display: block; margin: 0 auto;
  box-shadow: 0 10px 40px rgba(0,0,0,.4);
}
.sample-overlay figcaption { color: #fff; font-weight: 700; font-size: 18px; margin-top: 12px; }
.sample-hint { color: #d8d4c6; font-size: 13px; margin: 4px 0 0; }
.overlay-close-hint {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 0; right: 0;
  margin: 0; text-align: center;
  color: #b9b5a9; font-size: 13px;
}
.overlay-imgwrap { position: relative; display: inline-block; }
.overlay-tag {
  position: absolute; top: 10px; left: 10px;
  background: rgba(253, 241, 220, .92); color: #8a6420;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: 4px 12px; border-radius: 999px;
  pointer-events: none;
}
