/* ============================================================
   Mirador de Calahonda — design system
   Palette drawn from the flat itself: whitewashed walls, terracotta
   tile, the pool, the awning stripes, and the golden evening light.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,500&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --whitewash: #FBF8F3;
  --whitewash-dim: #F2EDE3;
  --ink: #2B2A27;
  --ink-soft: #5C594F;
  --sea: #1F5266;
  --sea-deep: #163C4C;
  --terracotta: #C1592F;
  --terracotta-dim: #E8C9AF;
  --sun: #E3A23C;
  --sage: #6C8C6A;
  --sea-dim: #C9DEE6;
  --red: #B23A2E;
  --red-dim: #F0CFC8;
  --line: #E3DACB;
  --white: #FFFFFF;

  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius: 4px;
  --shadow: 0 12px 30px -14px rgba(31, 82, 102, 0.35);
}

* { box-sizing: border-box; }

html {
  /* Stop Android Chrome enlarging some text on its own, which pushed
     calendar names out of their squares. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* --header-h is the sticky header's real height, measured in app.js. */
  scroll-padding-top: var(--header-h, 88px);
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--whitewash);
  line-height: 1.55;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  color: var(--sea-deep);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 600; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; max-width: 62ch; }

a { color: var(--sea); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 2px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow { display: none; } /* deliberately unused — see design note */

/* ---------------- Header / nav ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 248, 243, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1120px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--sea-deep);
}
.brand .mark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--terracotta);
}
.brand .name {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
}
.brand-logo {
  display: block;
  height: 46px;
  width: auto;
  border-radius: 3px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.main-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.97rem;
}
.main-nav a:hover { color: var(--terracotta); }


.nav-account {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  padding: 11px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--terracotta);
  color: var(--white);
}
.btn-primary:hover { box-shadow: 0 6px 18px -6px rgba(193, 89, 47, 0.55); }

.btn-secondary {
  background: transparent;
  border-color: var(--sea);
  color: var(--sea);
}
.btn-secondary:hover { background: var(--sea); color: var(--white); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--sea); color: var(--sea); }

.btn-small { padding: 7px 14px; font-size: 0.85rem; }
.btn-danger { background: #9C3B2C; color: var(--white); }

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: flex;
  align-items: flex-start;
  /* The generic `section { padding: 72px 0; }` rule below would otherwise
     apply here too (.hero is a <section>), pushing .hero-inner down from
     the top of the image by 72px regardless of align-items — .hero-inner's
     own padding is what should control the text's spacing from the edges. */
  padding: 0;
  color: var(--white);
  /* Darkest near the top now, for legibility behind the text block, fading
     out toward the bottom of the image (mirrored from the old bottom-
     aligned layout, which darkened the other way). */
  background: linear-gradient(180deg, rgba(22,60,76,0.78) 0%, rgba(22,60,76,0.15) 88%), var(--sea-deep);
  background-size: cover;
  background-position: center;
}
.hero-inner {
  padding: 28px 24px 64px;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}
.hero h1 {
  color: var(--white);
  max-width: none;
  margin-bottom: 10px;
  /* Smaller, and scaled more aggressively with viewport width than the
     site-wide h1, so "Casa Moir - Our holiday home in Calahonda." fits on
     one line instead of wrapping to two. */
  font-size: clamp(1.1rem, calc((100vw - 48px) / 15.5), 3.4rem);
  white-space: nowrap;
}
.hero .lede {
  color: var(--white);
  font-size: 1.15rem;
  max-width: 46ch;
  /* A solid-ish backing so the text stays readable over busier parts of
     the photo, rather than relying on the overlay gradient alone. */
  background: rgba(22, 60, 76, 0.72);
  padding: 14px 18px;
  border-radius: var(--radius);
}
.hero-actions { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }

/* ---------------- Sections ---------------- */

section { padding: 72px 0; }
section.tight { padding: 48px 0; }
.section-head { max-width: 60ch; margin-bottom: 36px; }
.on-band { background: var(--whitewash-dim); }
.on-sea { background: var(--sea-deep); color: var(--whitewash); }
.on-sea h2, .on-sea h3 { color: var(--white); }
.on-sea p { color: #D9E4E8; }

/* ---------------- About / feature grid ---------------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: start;
}
.about-grid img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.about-copy .stat-row {
  display: flex;
  gap: 32px;
  margin: 28px 0;
  flex-wrap: wrap;
}
.stat { }
.stat .n { font-family: var(--serif); font-size: 2rem; color: var(--terracotta); display: block; }
.stat .l { font-size: 0.9rem; color: var(--ink-soft); }

.amenity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
}
.amenity-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.96rem;
}

/* ---------------- Gallery ---------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 190px;
  gap: 10px;
}
.gallery button {
  border: none;
  padding: 0;
  margin: 0;
  cursor: zoom-in;
  background: none;
  overflow: hidden;
  border-radius: var(--radius);
}
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.gallery button:hover img { transform: scale(1.06); }
.gallery .tall { grid-row: span 2; }
.gallery .wide { grid-column: span 2; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(22,28,30,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 32px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 82vh; border-radius: 4px; }
.lightbox figcaption { color: var(--whitewash-dim); text-align: center; margin-top: 12px; font-family: var(--serif); font-style: italic; }
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  cursor: pointer;
}
.lightbox-close { top: 24px; right: 24px; }
.lightbox-nav.prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { right: 24px; top: 50%; transform: translateY(-50%); }

/* ---------------- Calendar ---------------- */

.calendar-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.calendar-toolbar h3 { margin: 0; }
.calendar-nav { display: flex; gap: 6px; }
.calendar-nav button {
  border: 1px solid var(--line);
  background: var(--white);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}
.calendar-months { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}
.cal-grid .dow { font-size: 0.72rem; color: var(--ink-soft); font-weight: 600; padding-bottom: 4px; }
.cal-grid .day {
  aspect-ratio: 1;
  /* Every day the same size: tall enough for a date plus two lines of a
     guest's name, so rows with bookings aren't taller than the rest. Where
     the square is already bigger (wider screens) it stays square. */
  min-height: 3.4rem;
  /* Fixed to the column width, so the minimum height makes the box taller
     rather than (keeping it square) wider than its column. */
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 1rem;
  position: relative;
  padding: 4px 2px;
  /* Not hidden: a square that's too short for the date plus the name line
     (small phones, or a larger system text size) grows a little taller
     instead of chopping the name off. The name itself is kept to one line. */
  overflow: visible;
  min-width: 0;
}
.cal-grid .day .date-number { line-height: 1; font-size: 1rem; }
/* A booked day has to fit the date number and the guest-name note in the
   same small box — shrinking the number here gives the note more room to
   actually be legible, especially on a phone-width grid. */
.cal-grid .day.booked .date-number { font-size: 0.8rem; }
.cal-grid .day .date-note {
  margin-top: 2px;
  font-size: 0.62rem;
  line-height: 1.3;
  text-align: center;
  /* Up to two lines; anything longer ends in "…" (the full text is in the
     pop-up when tapped). The square grows to fit rather than cutting the
     text off. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: break-word;
  width: 100%;
  max-width: 100%;
}
.cal-grid .day.blank { visibility: hidden; }
.cal-grid .day.available { background: #EEF4EF; color: var(--sage); }
.cal-grid .day.booked { background: var(--terracotta-dim); color: #7A3316; }
/* Confirmed keeps the original terracotta shading; provisional gets the
   same gold used for the "provisional" status pill elsewhere in the app,
   so the two read as visually distinct at a glance. */
.cal-grid .day.booked.status-confirmed { background: var(--terracotta-dim); color: #7A3316; }
.cal-grid .day.booked.status-provisional { background: #FCEBD3; color: #8A5A18; }
/* Authorised (admin OK'd, flights not booked yet) — lilac, so it doesn't
   clash with the sea-blue "new dates" shading in the edit calendar. */
.cal-grid .day.booked.status-authorised { background: #E6E0F2; color: #4E3B7A; }
.cal-grid .day.past { color: #C9C3B4; }
/* Bookings calendar: past stays stay visible, just faded. */
.cal-grid .day.past.booked { opacity: 0.65; color: #7A3316; }
.cal-grid .day.past.booked.status-provisional { color: #8A5A18; }
.cal-grid .day.past.booked.status-authorised { color: #4E3B7A; }
.cal-grid .day.booked { cursor: pointer; }

/* List / Calendar switch on the bookings tabs */
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; margin: 4px 0 18px; background: var(--white); }
.view-toggle button { border: 0; background: transparent; font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); padding: 8px 18px; min-height: 36px; border-radius: 999px; cursor: pointer; }
.view-toggle button[aria-pressed="true"] { background: var(--sea); color: var(--white); }

/* Users tab: the person an approval email linked to */
.booking-row.highlight { box-shadow: 0 0 0 2px var(--sun); }
.status-pill.pending { background: #FCEBD3; color: #8A5A18; }
.cal-grid .day.today { box-shadow: inset 0 0 0 2px var(--sun); font-weight: 700; }
.cal-grid .day.selected-start,
.cal-grid .day.selected-end {
  background: var(--terracotta-dim);
  color: #7A3316;
  box-shadow: inset 0 0 0 2px var(--terracotta);
  font-weight: 700;
}
.cal-month-label { font-family: var(--serif); font-size: 1.15rem; margin-bottom: 10px; text-align: center; }

.calendar-legend { display: flex; gap: 22px; margin-top: 20px; flex-wrap: wrap; font-size: 0.88rem; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.swatch.available { background: #EEF4EF; border: 1px solid var(--sage); }
.swatch.booked { background: var(--terracotta-dim); border: 1px solid var(--terracotta); }
.swatch.confirmed { background: var(--terracotta-dim); border: 1px solid var(--terracotta); }
.swatch.provisional { background: #FCEBD3; border: 1px solid var(--sun); }
.swatch.authorised { background: #E6E0F2; border: 1px solid #7B65B0; }
.swatch.current-dates { background: var(--red-dim); border: 1px solid var(--red); }
.swatch.new-dates { background: var(--sea-dim); border: 1px solid var(--sea); }

/* selectable mode (booking) */
.cal-grid .day.selectable { cursor: pointer; }
.cal-grid .day.selectable:hover { box-shadow: inset 0 0 0 2px var(--sea); }
.cal-grid .day.in-range { background: var(--terracotta-dim); color: #7A3316; font-weight: 700; }

/* Edit-booking calendar only: the booking's original dates show red until
   a new range is picked, at which point the new selection shows blue. The
   availability views never pass selectionVariant, so they're unaffected. */
.cal-grid .day.selected-start.variant-existing,
.cal-grid .day.selected-end.variant-existing,
.cal-grid .day.in-range.variant-existing {
  background: var(--red-dim);
  color: var(--red);
  box-shadow: inset 0 0 0 2px var(--red);
}
.cal-grid .day.selected-start.variant-new,
.cal-grid .day.selected-end.variant-new,
.cal-grid .day.in-range.variant-new {
  background: var(--sea-dim);
  color: var(--sea-deep);
  box-shadow: inset 0 0 0 2px var(--sea);
}

/* Tap-to-view popup for a booked calendar day (mainly for touch devices,
   which have no hover state to show the PC tooltip) */
.cal-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.cal-popup-overlay.show { display: flex; }
.cal-popup {
  position: relative;
  background: var(--white, #fff);
  border-radius: 10px;
  padding: 28px 24px 24px;
  max-width: 320px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.cal-popup-body {
  white-space: pre-line;
  font-size: 0.92rem;
  line-height: 1.5;
}
.cal-popup-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 4px 8px;
}
.cal-popup-close:hover { color: var(--ink); }

/* ---------------- Costs ---------------- */

.cost-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.cost-table th, .cost-table td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.cost-table th { font-family: var(--serif); font-weight: 500; color: var(--sea-deep); background: var(--whitewash-dim); }
.cost-table tr:last-child td { border-bottom: none; }

.note-card {
  border-left: 3px solid var(--sun);
  background: var(--whitewash-dim);
  padding: 18px 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
}

/* ---------------- Footer ---------------- */

.site-footer {
  background: var(--sea-deep);
  color: #C9D6DA;
  padding: 48px 0 28px;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.site-footer a { color: #E4ECEE; }
.site-footer .foot-nav { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.footer-logo { height: 56px; margin-bottom: 12px; }
.site-footer small { display: block; margin-top: 24px; color: #7C929A; }

/* ---------------- Things To Do page ---------------- */

.todo-page-hero {
  background: var(--sea-deep);
  color: var(--white);
  padding: 26px 0 20px;
}
.todo-page-hero h1 { color: var(--white); font-size: 1.6rem; margin-bottom: 4px; }
.todo-page-hero p { margin-bottom: 0; }

/* Pinned just below the (also sticky) site header, so the jump links stay
   reachable while scrolling through a long list — a solid background is
   needed here (unlike the header's translucent blur) since it's dark text
   on a dark bar, not a blur over light page content. */
.todo-jump-bar {
  position: sticky;
  top: var(--header-h, 75px);
  z-index: 35;
  background: var(--sea-deep);
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.todo-jump { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 0; }
.todo-jump a {
  color: var(--white);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.35);
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.88rem;
}
.todo-jump a:hover { background: rgba(255,255,255,0.12); }

/* Overrides the generic `section { padding: 72px 0 }` — that plus the old
   56px margin left huge gaps between the main sections of this long list. */
.todo-section { padding: 0; margin-bottom: 28px; scroll-margin-top: calc(var(--jump-h, 67px) + 16px); } /* clear the jump bar (the header is covered by scroll-padding-top) */
.todo-group { margin-bottom: 20px; }
.todo-group h4 { color: var(--terracotta); font-family: var(--sans); font-weight: 700; font-size: 1.2rem; margin-bottom: 8px; }
.todo-items { list-style: none; margin: 0; padding: 0; }
.todo-item {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.todo-item .who { max-width: 60ch; }
.todo-item .who strong { display: block; color: var(--ink); }
.todo-item .who .note { color: var(--ink-soft); font-size: 0.9rem; }
.todo-item .links { display: flex; gap: 8px; flex-shrink: 0; align-items: flex-start; padding-top: 2px; }
.todo-item .links a {
  font-size: 0.82rem;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 13px;
  white-space: nowrap;
  color: var(--sea);
}
.todo-item .links a:hover { border-color: var(--sea); background: var(--whitewash-dim); }
.todo-item .links a.map-link { color: var(--terracotta); border-color: var(--terracotta-dim); }

.todo-section-title { border-bottom: 2px solid var(--line); padding-bottom: 10px; margin-bottom: 24px; }

/* ---------------- Modals ---------------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(22,28,30,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 440px;
  padding: 32px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.4);
  max-height: 90vh;
  overflow-y: auto;
}
.modal.modal-wide { max-width: 640px; }
.modal h3 { margin-bottom: 4px; }
.modal .sub { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 20px; }
.modal .close-x { float: right; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--ink-soft); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 0.95rem;
  background: var(--whitewash);
}
.radio-row {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 2px 0;
}
.radio-row label {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 500 !important;
  margin: 0 !important;
}
.radio-row input { width: auto; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.checkbox-row input[type="checkbox"] { width: auto; }
.modal-switch { font-size: 0.88rem; margin-top: 14px; text-align: center; }
.google-signin-btn { display: flex; justify-content: center; min-height: 40px; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  margin: 18px 0;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.form-error { background: #F6DED6; color: #7A3316; padding: 10px 14px; border-radius: 4px; font-size: 0.87rem; margin-bottom: 14px; display: none; }
.form-error.show { display: block; }
.form-ok { background: #E4EEE3; color: #33502F; padding: 10px 14px; border-radius: 4px; font-size: 0.87rem; margin-bottom: 14px; display: none; }
.form-ok.show { display: block; }

/* ---------------- Dashboard / admin ---------------- */

.dash-header { background: var(--whitewash-dim); border-bottom: 1px solid var(--line); padding: 30px 0; }
/* Phones: a slimmer header band so bookings start higher up the screen. */
@media (max-width: 560px) {
  .dash-header { padding: 14px 0 0; }
  .dash-header h1 { font-size: 1.7rem; margin: 0; }
  .dash-header #dash-sub { display: none; }
  .dash-header .dash-tabs { margin-top: 6px; border-bottom: 0; }
  body .dash-panel { padding-top: 22px; }
}
.dash-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; border-bottom: 1px solid var(--line); }
.dash-tab {
  padding: 10px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.dash-tab.active { color: var(--sea-deep); border-color: var(--terracotta); font-weight: 600; }
.dash-panel { display: none; padding: 36px 0; }
.dash-panel.active { display: block; }

.booking-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.booking-row {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
/* The badges/buttons block on a booking row. margin-left: auto (rather than
   relying on .booking-row's own justify-content: space-between) keeps it
   pinned to the right even when the row wraps onto two lines — with only
   space-between, a wrapped block sits on its own line with nothing to be
   "between", so it fell back to the left. */
.booking-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; margin-left: auto; max-width: 100%; }
/* Phones: tighter tabs so they wrap onto two tidy rows, and booking/user
   buttons that wrap below each other instead of running off the edge. */
@media (max-width: 560px) {
  .dash-tabs { gap: 0 2px; }
  .dash-tab { padding: 10px 12px; }
  .booking-actions { gap: 8px; }
}
.booking-dates { font-family: var(--serif); font-size: 1.05rem; }
.booking-meta { font-size: 0.85rem; color: var(--ink-soft); }
.status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: lowercase;
}
.status-pill.provisional { background: #FCEBD3; color: #8A5A18; }
.status-pill.authorised { background: #E6E0F2; color: #4E3B7A; }
.status-pill.confirmed { background: #DFEEE0; color: #2E5C32; }
.status-select { font: inherit; font-size: 0.85rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); min-height: 34px; }
.status-pill.cancelled { background: #EEE; color: #777; }

.admin-settings-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  max-width: 640px;
}

.empty-state { color: var(--ink-soft); padding: 30px 0; }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .amenity-list { grid-template-columns: 1fr; }
  .calendar-months { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
  .gallery .wide { grid-column: span 2; }
  .todo-item { flex-direction: column; gap: 0; padding-bottom: 18px; }
  .todo-item .links { padding-top: 0; margin-top: 4px; }

  /* Nav links stay visible on mobile: they drop onto their own row under
     the logo and account buttons instead of hiding behind a menu. */
  .site-header .inner { flex-wrap: wrap; row-gap: 8px; padding: 10px 16px; }
  .main-nav {
    order: 3;
    flex: 1 0 100%;
    justify-content: space-between;
    gap: 6px;
    border-top: 1px solid var(--line);
    padding-top: 8px;
  }
  .main-nav a { font-size: 0.85rem; white-space: nowrap; }
}

/* Small phones: shrink the logo and account buttons so they share one row,
   with the nav links on the row beneath. */
@media (max-width: 560px) {
  .brand-logo { height: 34px; }
  .nav-account { display: flex; gap: 6px; align-items: center; }
  .nav-account .btn { padding: 7px 10px; font-size: 0.82rem; }
}

/* The sticky header's height varies with the layout (logo + nav row on
   mobile), so the jump bar's sticky offset and the anchor scroll margin
   track it. */
@media (max-width: 860px) {
  .todo-jump-bar { top: var(--header-h, 105px); }
}
@media (max-width: 560px) {
  .todo-jump-bar { top: var(--header-h, 93px); }
  .todo-jump { gap: 6px; padding: 8px 0; }
  .todo-jump a { padding: 5px 11px; font-size: 0.8rem; }
}

/* Request a stay: fields left unfilled when saving are flagged. */
.field.missing > label:first-child { color: #B3261E; }
.field.missing > label:first-child::after { content: " — required"; font-weight: 400; }
.field.missing input[type="text"] { border-color: #B3261E; }

/* Action buttons sharing a row are all the same size. */
.action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.action-row .btn { flex: 1 1 0; min-width: 110px; padding: 11px 10px; white-space: nowrap; justify-content: center; text-align: center; margin: 0; }
.action-row.fixed .btn { flex: 0 0 170px; }

/* Edit-booking calendar: the original dates stay red once new ones are picked. */
.cal-grid .day.current-dates {
  background: var(--red-dim);
  color: var(--red);
  box-shadow: inset 0 0 0 2px var(--red);
  font-weight: 700;
}

.got-questions { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.got-questions h4 { margin-bottom: 10px; font-family: var(--sans); font-size: 1.05rem; }

/* Stacked variant: one full-width button per line (calendar options). */
.action-row.stack { flex-direction: column; }
.action-row.stack .btn { flex: 0 0 auto; width: 100%; }
.action-row .btn { min-height: 42px; line-height: 1.2; box-sizing: border-box; }


/* Show/Hide button inside password boxes */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 64px; }
.password-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  background: none; border: 0; padding: 6px 8px; cursor: pointer;
  font: inherit; font-size: 0.85rem; color: inherit; opacity: 0.7;
}
.password-toggle:hover, .password-toggle:focus-visible { opacity: 1; text-decoration: underline; }

/* Small ⋮ menu at the top right of the Agent Bookings page */
.page-menu { position: relative; margin-left: auto; }
.page-menu-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); cursor: pointer; }
.page-menu-btn:hover { background: var(--whitewash-dim); }
.page-menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 6px; z-index: 50; }
.page-menu-list[hidden] { display: none; }
.page-menu-list button { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; font-size: 0.95rem; color: var(--ink); padding: 12px 14px; min-height: 44px; border-radius: 6px; cursor: pointer; }
.page-menu-list button:hover, .page-menu-list button:focus-visible { background: var(--whitewash-dim); }

/* Account menu (top right when logged in) — reuses the .page-menu styles. */
.account-menu { margin-left: 0; }
.page-menu-sep { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
@media (max-width: 560px) {
  .account-menu .page-menu-btn { width: 36px; height: 36px; }
}

/* Phones: a tighter calendar card (smaller headings, flatter date squares)
   so both months fit on screen at once. */
@media (max-width: 560px) {
  .calendar-card { padding: 12px 10px; }
  .calendar-toolbar { margin-bottom: 8px; gap: 8px; }
  .calendar-toolbar h3 { font-size: 1rem; line-height: 1.25; }
  .calendar-months { gap: 10px; }
  .cal-month-label { font-size: 0.95rem; margin-bottom: 4px; }
  .cal-grid { gap: 3px; }
  .cal-grid .dow { padding-bottom: 0; }
  .cal-grid .day { aspect-ratio: 1.3; padding: 2px 1px; }
  .calendar-legend { margin-top: 8px; gap: 12px; font-size: 0.8rem; }
  .site-header .inner { padding: 6px 16px; row-gap: 4px; }
  .main-nav { padding-top: 4px; }
}

/* Jumping to The Flat / Costs / Photos: tuck most of the section's 72px top
   padding under the header, so the heading sits just below it rather than
   after a big gap (with a strip of the section above showing). */
section[id]:not(.todo-section) { scroll-margin-top: -48px; }

/* Phones: three table columns don't fit, so each charge becomes its own
   block — name, amount, then what it covers. */
@media (max-width: 560px) {
  .cost-table, .cost-table tbody, .cost-table tr, .cost-table td { display: block; width: 100%; }
  .cost-table thead { display: none; }
  .cost-table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .cost-table tr:last-child { border-bottom: none; }
  .cost-table td { padding: 0; border-bottom: none; }
  .cost-table td:nth-child(1) { font-weight: 600; color: var(--sea-deep); }
  .cost-table td:nth-child(2) { margin-top: 2px; }
  .cost-table td:nth-child(3) { margin-top: 4px; font-size: 0.85rem; color: var(--ink-soft); }
}

/* Guest guides (/opening-up, /closing-down) */
.guide-page { padding: 28px 24px 64px; max-width: 760px; }
.guide-sign { display: block; width: 100%; max-width: 360px; border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 24px; }
.guide-body h2 { font-size: 1.5rem; margin: 28px 0 10px; }
.guide-body p { line-height: 1.65; }
.guide-body ol { padding-left: 1.4em; margin: 0 0 1em; }
.guide-body li { line-height: 1.6; margin-bottom: 10px; padding-left: 4px; }
.guide-body a { color: var(--sea-deep); }
@media (max-width: 560px) {
  .guide-page { padding: 20px 16px 48px; }
  .guide-sign { max-width: 100%; margin-bottom: 18px; }
}
.account-menu .page-menu-list { min-width: 250px; }
.guide-actions { margin: 0 0 20px; }
@media print { .site-header, .site-footer, .guide-actions { display: none; } }

/* "Waking up the booking system…" — shown by app.js while the app wakes
   after a quiet spell (it sleeps on Render's free plan). */
.wake-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: min(560px, calc(100% - 24px));
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--sea);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.4;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
.wake-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--sun);
  animation: wake-pulse 1.2s ease-in-out infinite;
}
@keyframes wake-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
