:root {
  --bg: #f7f5f0;
  --text: #1f2a2e;
  --muted: #5b676b;
  --accent: #1d6b5c;
  --accent-soft: #e3f0ec;
  --card: #ffffff;
  --border: #e2ded4;
  --warn: #8a5a00;
  --warn-soft: #fdf3dc;
  --bad: #a3322a;
  --bad-soft: #fbe9e7;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151b1d;
    --text: #e9ece9;
    --muted: #a2adaa;
    --accent: #6cc4ad;
    --accent-soft: #1c3530;
    --card: #1e2629;
    --border: #2e383b;
    --warn: #f0c063;
    --warn-soft: #3a2f17;
    --bad: #f0928a;
    --bad-soft: #3d201d;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
}

a { color: var(--accent); }

.wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header and footer */

.site-header { padding: 28px 0 8px; }
.header-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; }
.site-nav { display: flex; gap: 18px; }
.site-nav a { font-weight: 600; text-decoration: none; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.brand {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.tagline { margin: 0; color: var(--muted); }

.site-footer {
  margin-top: 32px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer p { margin: 0 0 6px; }

/* Development mode */

.dev-panel { border: 2px dashed var(--warn); background: var(--warn-soft); }
.dev-details summary { cursor: pointer; color: var(--warn); font-size: 1.05rem; }
.dev-details[open] summary { margin-bottom: 8px; }
.dev-files { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.dev-file {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.dev-file > div:first-child { flex: 1 1 20rem; }
.dev-file p { margin: 4px 0 0; font-size: 0.9rem; color: var(--muted); }
.dev-actions { display: flex; gap: 12px; align-items: center; }

/* Offline */

.offline-proof { display: block; margin-top: 4px; font-size: 0.9rem; }
.offline-status { display: block; margin-top: 6px; font-weight: 700; }

/* Help and about pages */

.prose h1 { margin: 16px 0 8px; }
.prose .card h2 { display: block; }
.prose h3 { margin: 20px 0 6px; font-size: 1.05rem; }
.prose li { margin-bottom: 4px; }
.toc ul { padding-left: 20px; margin: 0; }
.checked, .source { color: var(--muted); font-size: 0.9rem; }

/* Cards */

.privacy-banner {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.card {
  margin: 16px 0;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.step {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--card);
  font-size: 0.95rem;
}

.note, .tip, .empty { color: var(--muted); }
.tip { font-size: 0.9rem; margin-bottom: 0; }

/* Forms */

label { display: grid; gap: 4px; font-weight: 600; }
input[type="text"], select {
  font: inherit;
  font-weight: 400;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  width: 100%;
}

/* Accommodation */

.rate-help { margin: 0 0 16px; font-size: 0.95rem; }
.rate-help summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.rate-help dl { margin: 8px 0 0; }
.rate-help dt { font-weight: 600; }
.rate-help dd { margin: 0 0 8px; color: var(--muted); }

.property {
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.property-fields { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .property-fields { grid-template-columns: 1fr; } }
.property .note { margin: 8px 0 0; font-size: 0.9rem; }
.property-remove { margin: 10px 0 0; text-align: right; }

.listings { list-style: none; margin: 12px 0 0; padding: 0; }
.listing {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.listing-name { overflow-wrap: anywhere; }
.listing-name .badge { margin-left: 8px; }
.listing-options { display: flex; flex-wrap: wrap; gap: 8px; }
.listing-options select { width: auto; max-width: 100%; }

.confirm-all { margin: 0 0 12px; }
.add-property { margin-top: 4px; }
.add-property .note { font-size: 0.9rem; margin: 8px 0 0; }

/* File drop */

.drop-zone {
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 28px 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  font-weight: 400;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-main { font-weight: 700; color: var(--accent); font-size: 1.1rem; }
.drop-sub { color: var(--muted); font-size: 0.9rem; }

.file-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.file {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.file-top { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.file-name { font-weight: 700; overflow-wrap: anywhere; }
.file-meta { color: var(--muted); font-size: 0.9rem; }
.file-remove { margin-left: auto; }
.file-options { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; font-size: 0.9rem; }
.file-options label { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.file-options select { width: auto; padding: 4px 6px; }

.notice {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
}
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice ul { margin: 4px 0 0; padding-left: 20px; }

.column-form { margin-top: 10px; }
.column-form > p:first-child { margin-top: 0; }
.column-row {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) 2fr;
  gap: 4px 12px;
  align-items: center;
  font-weight: 400;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}
@media (max-width: 600px) { .column-row { grid-template-columns: 1fr; } }
.column-row .required { color: var(--warn); font-size: 0.85rem; }
.column-check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 0.9rem; padding: 0 0 8px; color: var(--muted); }
.column-check input { margin-top: 4px; flex: none; }
.column-actions { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-top: 10px; }
.small-link { font-size: 0.9rem; }
.note.small { font-size: 0.85rem; margin: 6px 0 0; }
.button.primary { background: var(--accent); color: var(--card); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }

.link-button {
  font: inherit;
  font-size: 0.9rem;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
.clear-row { text-align: right; }

.button {
  font: inherit;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--card);
  color: var(--accent);
  cursor: pointer;
}

/* Duplicates */

.duplicates { margin: 0 0 20px; }
.duplicates h3 { margin: 0 0 4px; font-size: 1.05rem; }
.duplicates > p { margin: 0 0 10px; }
.dup-group {
  margin: 0 0 10px;
  padding: 10px 14px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.dup-group.open { border-color: var(--warn); background: var(--warn-soft); }
.dup-group.open .dup-why { color: var(--text); }
.dup-group legend { padding: 0 4px; margin-left: -4px; }
.dup-why { margin: 0 0 8px; font-size: 0.9rem; color: var(--muted); }
.dup-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400;
  padding: 6px 0;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.dup-option input { margin-top: 5px; flex: none; }
.auto-duplicates { font-size: 0.9rem; color: var(--muted); }
.auto-duplicates summary { cursor: pointer; }
.auto-duplicates ul { padding-left: 20px; }

/* Results */

.results-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: end;
  margin-bottom: 16px;
}
.results-top label { font-weight: 600; }
.results-top select { width: auto; }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); margin-bottom: 16px; }
@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat.main { grid-column: 1 / -1; }
}
.stat {
  padding: 14px;
  border-radius: 8px;
  background: var(--bg);
}
.stat-label { color: var(--muted); font-size: 0.85rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; }
.stat.main .stat-value { color: var(--accent); font-size: 2rem; }

.breakdown { color: var(--muted); font-size: 0.9rem; margin: 0 0 16px; }
.breakdown p { margin: 0 0 4px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.date { white-space: nowrap; }
td.status { min-width: 12rem; }
table.bookings td:first-child { min-width: 10rem; }
table.bookings td:nth-child(3) { min-width: 6.5rem; }
.sub { display: block; color: var(--muted); font-size: 0.85rem; }

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge.included { background: var(--accent-soft); color: var(--accent); }
.badge.excluded { background: var(--bad-soft); color: var(--bad); }
.badge.check { background: var(--warn-soft); color: var(--warn); }
.reason { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 2px; }

/* On phones, show each booking as a small card instead of a table row. */
@media (max-width: 600px) {
  .table-wrap { border: 0; overflow: visible; }
  table.bookings thead { display: none; }
  table.bookings, table.bookings tbody, table.bookings tr, table.bookings td { display: block; }
  table.bookings tr {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    margin-bottom: 10px;
  }
  table.bookings td {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 8px;
    padding: 4px 0;
    border: 0;
    text-align: left;
    white-space: normal;
    min-width: 0;
  }
  table.bookings td::before { content: attr(data-label); color: var(--muted); font-size: 0.85rem; }
  table.bookings td > * { grid-column: 2; }
  table.bookings td > .badge { justify-self: start; }
}

.results-actions { margin-top: 16px; display: flex; gap: 12px; flex-wrap: wrap; }
