:root {
  --navy: #0f3b5f;
  --teal: #2a9d97;
  --teal-soft: #e3f4f3;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #64707d;
  --border: #e2e6ea;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --ok: #1e8e5a;
  --warn: #b7791f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 16px rgba(16, 24, 40, 0.05);
  --c-direct: #2a9d97;
  --c-airbnb: #ff5a5f;
  --c-booking: #1f5fbf;
  --c-vrbo: #7b4fd6;
  --c-manual: #8a94a0;
  --c-other: #b7791f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --navy: #8ec5ec;
    --teal: #4fc3bc;
    --teal-soft: #173533;
    --bg: #0f141a;
    --surface: #171e26;
    --text: #e6ebf0;
    --muted: #97a3af;
    --border: #2a333d;
    --danger: #ef6b5e;
    --danger-soft: #3a1d1a;
    --ok: #4cc38a;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --navy: #8ec5ec;
  --teal: #4fc3bc;
  --teal-soft: #173533;
  --bg: #0f141a;
  --surface: #171e26;
  --text: #e6ebf0;
  --muted: #97a3af;
  --border: #2a333d;
  --danger: #ef6b5e;
  --danger-soft: #3a1d1a;
  --ok: #4cc38a;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.55 Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}
img, video { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; margin: 0 0 0.75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 0.5rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; }
pre { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; white-space: pre; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.pre { white-space: pre-wrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.error-text { color: var(--danger); }
.ok-text { color: var(--ok); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.narrow { max-width: 440px; margin: 2rem auto; }
.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }

/* ---------- forms ---------- */
label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: 0.9rem; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  width: 100%;
  min-width: 0;
}
input[type='checkbox'], input[type='radio'] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 0; display: flex; flex-direction: column; gap: 12px; background: var(--surface); }
legend { font-weight: 600; padding: 0 6px; }
.form-grid { display: flex; flex-direction: column; gap: 18px; max-width: 820px; }
.form-grid.compact { gap: 12px; }
.row2, .row3 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin: 0; }
.inline-form > input, .inline-form > select { flex: 1 1 180px; width: auto; }
.inline-form.wrap label { flex: 1 1 140px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
}
.btn.primary { background: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .btn.primary { color: #0f141a; } }
:root[data-theme='dark'] .btn.primary { color: #0f141a; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--bg); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 0.85rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: default; }
button.link { background: none; border: 0; padding: 0; color: var(--teal); font: inherit; cursor: pointer; }
.icon-btn { background: rgba(0, 0, 0, 0.55); color: #fff; border: 0; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; }

.flash { background: var(--teal-soft); border: 1px solid var(--teal); border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; }
.flash.error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.callout { background: var(--teal-soft); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; }
.callout.warn { background: var(--danger-soft); }
.empty { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 16px; box-shadow: var(--shadow); }

.pill { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.pill-confirmed, .pill-completed { background: #e3f6ec; color: #1e7a4c; border-color: #bfe6d0; }
.pill-requested, .pill-pending_payment { background: #fff4de; color: #8a5a0b; border-color: #f2dcac; }
.pill-cancelled, .pill-declined { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge { display: inline-block; background: var(--teal); color: #fff; font-size: 0.7rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.stars { color: #e0a100; letter-spacing: 1px; }
.stars .dim { color: var(--border); }

/* ---------- public site ---------- */
.site-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; }
.site-header nav { display: flex; gap: 18px; }
.site-header nav a { color: var(--text); font-weight: 500; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; color: var(--navy) !important; text-decoration: none !important; }
.site-main { max-width: 1160px; margin: 0 auto; padding: 24px 16px 48px; }
.site-footer { display: flex; justify-content: space-between; max-width: 1160px; margin: 0 auto; padding: 24px 16px; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--border); }
.hero { padding: 28px 0 24px; }
.hero h1 { font-size: 2.1rem; max-width: 640px; }
.hero p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.card-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.home-card { color: inherit; text-decoration: none !important; display: flex; flex-direction: column; gap: 10px; }
.home-card-img { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--border); display: grid; place-items: center; color: var(--muted); }
.home-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.home-card:hover img { transform: scale(1.03); }
.home-card-body { display: flex; flex-direction: column; gap: 2px; }

.property-head { margin-bottom: 14px; }
.gallery-grid { display: grid; gap: 8px; border-radius: var(--radius); overflow: hidden; height: 440px; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.gallery-grid a { position: relative; display: block; overflow: hidden; background: var(--border); }
.gallery-grid img, .gallery-grid video { width: 100%; height: 100%; object-fit: cover; }
.gallery-grid .g-main { grid-row: span 2; }
.gallery-grid.n1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.gallery-grid.n2 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr; }
.gallery-grid.n2 .g-main { grid-row: auto; }
.gallery-grid.n3 { grid-template-columns: 2fr 1fr; }
.gallery-grid.n4 a:last-child { grid-column: span 2; }
.gallery-grid .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 2rem; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.gallery-empty { height: 240px; border-radius: var(--radius); background: var(--border); display: grid; place-items: center; color: var(--muted); }
.all-media { margin-top: 10px; }
.all-media summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.media-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin-top: 10px; }
.media-list figure { margin: 0; }
.media-list img, .media-list video { width: 100%; border-radius: 8px; }
.media-list figcaption { font-size: 0.85rem; color: var(--muted); padding-top: 4px; }

.property-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 48px; margin-top: 28px; align-items: start; }
.property-body section { padding: 0 0 26px; margin-bottom: 26px; border-bottom: 1px solid var(--border); }
.property-body section:last-child { border-bottom: 0; }
.prose p { margin: 0 0 0.8em; }
.amenities { columns: 2; padding-left: 18px; margin: 0; }
.amenities li { margin-bottom: 6px; break-inside: avoid; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.facts.two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.facts > div { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.map { height: 320px; border-radius: var(--radius); border: 1px solid var(--border); margin: 10px 0; z-index: 0; }
.map-emoji { font-size: 20px; line-height: 26px; text-align: center; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4)); }

.booking-card { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: 0 6px 24px rgba(16, 24, 40, 0.1); display: flex; flex-direction: column; gap: 12px; }
.booking-card form { display: flex; flex-direction: column; gap: 12px; }
.price-line { font-size: 1.3rem; margin: 0; }
.date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.guest-fields { display: none; flex-direction: column; gap: 10px; }
.guest-fields.show { display: flex; }
.breakdown { width: 100%; border-collapse: collapse; }
.breakdown td { padding: 4px 0; }
.breakdown td:last-child { text-align: right; }
.breakdown .total td { border-top: 1px solid var(--border); padding-top: 8px; font-weight: 700; }

.calendar-picker { user-select: none; }
.cp-nav { display: flex; justify-content: space-between; align-items: center; }
.cp-nav button { background: none; border: 1px solid var(--border); border-radius: 50%; width: 30px; height: 30px; cursor: pointer; color: var(--text); font-size: 1.1rem; }
.cp-nav button:disabled { opacity: 0.3; }
.cp-months { display: grid; gap: 16px; grid-auto-flow: column; grid-auto-columns: 1fr; }
.cp-title { text-align: center; font-weight: 600; margin: -26px 0 8px; pointer-events: none; }
.cp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cp-dow { text-align: center; font-size: 0.72rem; color: var(--muted); padding: 2px 0; }
.cp-day { border: 0; background: none; padding: 4px 0; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; color: var(--text); font: inherit; font-size: 0.85rem; min-height: 40px; }
.cp-day small { font-size: 0.62rem; color: var(--muted); }
.cp-day:hover:not(:disabled) { background: var(--teal-soft); }
.cp-day:disabled { color: var(--border); cursor: default; }
.cp-day.booked span { text-decoration: line-through; }
.cp-day.sel { background: var(--navy) !important; color: #fff; }
.cp-day.sel small { color: #fff; }
.cp-day.in { background: var(--teal-soft); border-radius: 0; }

.review-headline { font-size: 1.1rem; }
.rating-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 28px; margin: 12px 0 20px; }
.rating-bar { display: grid; grid-template-columns: 110px 1fr 30px; align-items: center; gap: 10px; font-size: 0.88rem; }
.rating-bar .bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.rating-bar .bar span { display: block; height: 100%; background: var(--text); }
.reviews { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.review header { display: flex; gap: 8px; align-items: baseline; }
.review p { margin: 6px 0; }
.host-reply { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--teal); background: var(--bg); border-radius: 0 8px 8px 0; }
.host-reply p { margin: 4px 0 0; }

.guide-group { margin: 26px 0; }
.guide-group ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.guide-group li { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.guide-group li p { margin: 4px 0 0; }
.guide-item-head { display: flex; justify-content: space-between; gap: 8px; }

/* ---------- guest portal / chat ---------- */
.portal { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; align-items: start; }
.portal-side { position: sticky; top: 84px; }
.dash .portal-side { top: 20px; }
.chat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; height: min(640px, calc(100vh - 140px)); }
.chat-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 85%; display: flex; flex-direction: column; gap: 2px; }
.bubble-body { padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.bubble.mine { align-self: flex-end; align-items: flex-end; }
.bubble.mine .bubble-body { background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .bubble.mine .bubble-body { color: #0f141a; } }
.bubble.theirs .bubble-body { background: var(--bg); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble.system { align-self: center; max-width: 95%; align-items: center; }
.bubble.system .bubble-body { background: var(--teal-soft); font-size: 0.9rem; border-radius: 10px; }
.chat-typing { padding: 0 14px; margin: 0; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-form textarea { flex: 1; }

.rating-input { border: 0; padding: 0; background: none; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.rating-input legend { float: left; width: 100%; padding: 0; font-weight: 500; font-size: 0.9rem; }
.rating-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating-input label { font-size: 1.6rem; color: var(--border); cursor: pointer; font-weight: 400; }
.rating-input label:hover, .rating-input label:hover ~ label, .rating-input input:checked ~ label { color: #e0a100; }
.rating-input input:focus-visible + label { outline: 2px solid var(--teal); border-radius: 4px; }
.rating-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }

/* ---------- dashboard ---------- */
body.dash { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.dash-nav { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.dash-nav nav { display: flex; flex-direction: column; gap: 2px; }
.dash-nav nav a { color: var(--text); padding: 8px 12px; border-radius: 8px; font-weight: 500; text-decoration: none; }
.dash-nav nav a:hover { background: var(--bg); }
.dash-nav nav a.active { background: var(--teal-soft); color: var(--teal); }
.dash-user { margin-top: auto; display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; }
.dash-user form { margin: 0; }
.dash-main { padding: 28px 32px 60px; max-width: 1240px; width: 100%; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist .done { color: var(--muted); text-decoration: line-through; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; color: var(--text); text-decoration: none !important; }
.stat-n { font-size: 1.7rem; font-weight: 700; color: var(--navy); }
.stat-n.warn { color: var(--danger); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
td.actions, .actions { display: flex; gap: 8px; flex-wrap: wrap; }
td.actions form, .actions form { margin: 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs a { padding: 8px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.tabs a.active { color: var(--teal); border-color: var(--teal); }
.prop-list { display: flex; flex-direction: column; gap: 12px; }
.prop-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: center; }
.prop-row .tabs { grid-column: 1 / -1; margin: 0; border: 0; }
.prop-thumb { width: 120px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--bg); display: grid; place-items: center; font-size: 0.8rem; color: var(--muted); }
.prop-thumb img { width: 100%; height: 100%; object-fit: cover; }
.prop-info { display: flex; flex-direction: column; gap: 2px; }
.danger-zone { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border); }

.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px; text-align: center; background: var(--surface); margin-bottom: 12px; transition: background 0.15s; }
.dropzone.over { background: var(--teal-soft); border-color: var(--teal); }
.dropzone label.link { display: inline; color: var(--teal); cursor: pointer; font-weight: 600; }
.upload-progress { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; text-align: left; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 70px; gap: 10px; align-items: center; font-size: 0.85rem; }
.upload-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row progress { width: 100%; }
.upload-row.failed { color: var(--danger); }
.media-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.media-grid li { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: grab; }
.media-grid li:first-child { outline: 2px solid var(--teal); }
.media-grid li:first-child::before { content: 'Cover'; position: absolute; top: 8px; left: 8px; background: var(--teal); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; z-index: 1; }
.media-grid li.dragging { opacity: 0.4; }
.media-grid img, .media-grid video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.media-grid .badge { position: absolute; top: 8px; right: 40px; }
.media-grid .caption-form { margin: 0; }
.media-grid .caption-form input { border: 0; border-top: 1px solid var(--border); border-radius: 0; font-size: 0.85rem; }
.media-grid form:last-child { position: absolute; top: 6px; right: 6px; margin: 0; }

.copy-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 8px 0; }
.copy-row input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8rem; }
.help { margin: 0 0 12px; }
.help summary { cursor: pointer; color: var(--teal); font-weight: 500; }
details.inline { display: inline; }
details.inline summary { display: inline; cursor: pointer; color: var(--teal); }

.months { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; margin: 12px 0; }
.month h3 { margin: 0 0 8px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.month-grid .dow { font-size: 0.72rem; color: var(--muted); text-align: center; }
.day { min-height: 62px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 4px 5px; display: flex; flex-direction: column; font-size: 0.75rem; color: var(--text); text-decoration: none !important; overflow: hidden; }
.day .d { font-weight: 600; }
.day .p { color: var(--muted); }
.day .s { font-size: 0.66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day.past { opacity: 0.45; }
.day.busy { color: #fff; border-color: transparent; }
.day.busy .p { color: rgba(255, 255, 255, 0.85); }
.src-direct, .sw.src-direct { background: var(--c-direct); }
.src-airbnb, .sw.src-airbnb { background: var(--c-airbnb); }
.src-booking, .sw.src-booking { background: var(--c-booking); }
.src-vrbo, .sw.src-vrbo { background: var(--c-vrbo); }
.src-manual, .sw.src-manual, .day.closed { background: var(--c-manual); color: #fff; }
.src-other { background: var(--c-other); }
.day.override:not(.busy) { box-shadow: inset 0 0 0 2px var(--teal); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: -8px; vertical-align: middle; }
.sw.override { box-shadow: inset 0 0 0 2px var(--teal); background: var(--surface); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.85rem; text-decoration: none !important; }
.chip.active { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.chip .pill { border: 0; background: none; padding: 0; color: inherit; }
.suggestions, .guide-admin { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; }
.suggestions li, .guide-admin li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.suggestions form { margin: 0; }
.guide-admin li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; }
.guide-admin .icon-btn { background: var(--danger-soft); color: var(--danger); }

.inbox { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.inbox li { border-bottom: 1px solid var(--border); }
.inbox li:last-child { border-bottom: 0; }
.inbox a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; color: var(--text); text-decoration: none; }
.inbox a:hover { background: var(--bg); }
.inbox li.unread { background: var(--teal-soft); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .property-layout, .portal { grid-template-columns: 1fr; gap: 24px; }
  .booking-card, .portal-side { position: static; }
  .gallery-grid { height: 300px; grid-template-columns: 1fr 1fr; }
  .gallery-grid a:nth-child(n + 4) { display: none; }
  .gallery-grid .g-main { grid-row: span 2; }
}
@media (max-width: 760px) {
  body.dash { display: block; }
  .dash-nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px; gap: 8px; }
  .dash-nav nav { flex-direction: row; overflow-x: auto; width: 100%; order: 3; }
  .dash-nav nav a { white-space: nowrap; padding: 6px 10px; }
  .dash-user { margin: 0 0 0 auto; flex-direction: row; gap: 12px; align-items: center; }
  .dash-user span { display: none; }
  .dash-main { padding: 18px 16px 48px; }
  .site-header { padding: 12px 16px; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .copy-row { grid-template-columns: 1fr auto; }
  .copy-row span { grid-column: 1 / -1; font-weight: 600; }
  .gallery-grid { height: 240px; grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .gallery-grid a:not(.g-main) { display: none; }
  .amenities { columns: 1; }
  .guide-admin li { grid-template-columns: 1fr auto; }
  .guide-admin li form.inline-form { grid-column: 1 / -1; grid-row: 2; }
  .months { grid-template-columns: 1fr; }
  .day { min-height: 50px; }
  .hero h1 { font-size: 1.6rem; }
  .upload-row { grid-template-columns: minmax(0, 1fr) 90px 50px; }
}

/* ---------- documents: agreements & receipts ---------- */
.doc { max-width: 820px; margin: 0 auto; padding: 24px 16px 48px; }
body.doc-page { background: var(--bg); }
.agreement { white-space: pre-wrap; font-family: Georgia, 'Times New Roman', serif; font-size: 0.98rem; line-height: 1.6; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 32px; }
.signature { border-top: 1px solid var(--border); padding-top: 12px; font-size: 0.9rem; }
.receipt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 32px; display: flex; flex-direction: column; gap: 16px; }
.receipt header { align-items: flex-start; }
.receipt header h1 { font-size: 1.4rem; color: var(--navy); }
.receipt header p { margin: 0; }
.receipt .right { text-align: right; }
.receipt h2 { text-transform: uppercase; letter-spacing: 0.08em; color: var(--navy); }
.receipt h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 8px 0 4px; }
.receipt-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.doc-links { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 12px; }
.cancel-box summary { cursor: pointer; color: var(--danger); font-weight: 600; }
.cancel-box[open] summary { margin-bottom: 10px; }
.agree { align-items: flex-start !important; font-size: 0.85rem; }
.agree input { margin-top: 3px; }
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.82rem; }
@media (max-width: 640px) {
  .receipt, .agreement { padding: 18px 16px; }
  .receipt-parties { grid-template-columns: 1fr; }
  .receipt header { flex-direction: column; }
  .receipt .right { text-align: left; }
}
@media print {
  .no-print, .site-header, .site-footer { display: none !important; }
  body, body.doc-page { background: #fff; color: #000; }
  .receipt, .agreement { border: 0; padding: 0; }
  .doc { padding: 0; max-width: none; }
}
.receipt-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.receipt-card h2 { margin-bottom: 2px; }
.receipt-card p { margin: 0; }
