/* DRBO — mobile-first, one accent (deep teal #0f766e; recorded in BUILD-LOG), system font stack.
   Usable at 360 px; tap targets ≥ 44 px (SPEC §12). No framework, no build step. */
:root {
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #e6f4f1;
  --ink: #1f2933;
  --muted: #52606d;
  --line: #e4e7eb;
  --bg: #ffffff;
  --paper: #f7f9f9;
  --danger: #991b1b;
  --danger-soft: #fee2e2;
  --radius: 10px;
  --tap: 44px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 16px;
}
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: .75rem 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
h3 { font-size: 1.05rem; margin: 0 0 .25rem; }
p { margin: .5rem 0; }
img { max-width: 100%; height: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- shell ---- */
.top {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .5rem max(1rem, env(safe-area-inset-right)) .5rem max(1rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line); background: var(--bg);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 800; color: var(--accent); text-decoration: none; font-size: 1.3rem; letter-spacing: .02em; min-height: var(--tap); display: inline-flex; align-items: center; }
.top nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: .1rem; }
.top nav a, .top nav button.link { color: var(--ink); text-decoration: none; padding: .6rem .55rem; min-height: var(--tap); display: inline-flex; align-items: center; border-radius: 6px; font-size: .95rem; }
.top nav a:hover, .top nav button.link:hover { background: var(--paper); }
.inline { display: inline; }
button.link { background: none; border: 0; font: inherit; cursor: pointer; }
.wrap { max-width: 960px; margin: 0 auto; padding: .75rem 1rem 2rem; }
.foot { text-align: center; color: var(--muted); font-size: .875rem; padding: 2rem 1rem calc(2rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }

/* ---- hero + search ---- */
.hero { padding: 1rem 0 .5rem; }
.hero h1 { font-size: 1.9rem; margin: .25rem 0 .5rem; }
.hero p { color: var(--muted); max-width: 48ch; }
.search, .filters { display: grid; gap: .6rem; grid-template-columns: 1fr; align-items: end; padding: 1rem; background: var(--paper); border-radius: var(--radius); margin: 1rem 0; }
.search label, .filters label { margin: 0; }
@media (min-width: 640px) {
  .search { grid-template-columns: 2fr 1fr auto; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .amenities, .filters .btn { grid-column: 1 / -1; }
}

/* ---- cards + grids ---- */
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: .75rem 0; background: var(--bg); }
.narrow { max-width: 480px; margin: 1.5rem auto; }
.grid, .list { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .75rem; }
.grid { grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.grid .card { margin: 0; display: flex; flex-direction: column; gap: .15rem; }
.grid .card h3 a { color: var(--ink); text-decoration: none; }
.grid .card h3 a:hover { color: var(--accent); }
.card.festival { border-left: 4px solid var(--accent); }
.listing img, .listing .photo-empty { width: 100%; aspect-ratio: 3 / 2; height: auto; object-fit: cover; border-radius: 6px; margin-bottom: .4rem; }
.photo-empty { display: flex; align-items: center; justify-content: center; background: var(--paper); color: var(--muted); font-size: .9rem; border: 1px dashed var(--line); }
.listing-page .photo-empty { aspect-ratio: 3 / 1; }
.listing.nofit { opacity: .75; }
.listing.nofit h3::after { content: " · smaller than your party"; color: var(--muted); font-weight: 400; font-size: .85rem; }
.meta { color: var(--muted); font-size: .9rem; margin: .2rem 0; }
.fine { color: var(--muted); font-size: .85rem; }
.crumbs { font-size: .9rem; color: var(--muted); margin: .25rem 0 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

/* ---- badges / tags / status ---- */
.tag, .badge { display: inline-block; font-size: .75rem; padding: .15rem .55rem; border-radius: 999px; background: var(--paper); color: var(--muted); vertical-align: middle; white-space: nowrap; font-weight: 500; }
.badge { font-size: .8rem; }
.badge.paused { background: #fff3cd; color: #7a5a00; }
.badge.hidden { background: var(--danger-soft); color: var(--danger); }
.status-pending { background: #fff3cd; color: #7a5a00; }
.status-accepted { background: #d1fae5; color: #065f46; }
.status-declined, .status-withdrawn, .status-cancelled { background: var(--danger-soft); color: var(--danger); }
.empty { color: var(--muted); padding: 1.25rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
.empty a { font-weight: 600; }

/* ---- forms ---- */
label { display: block; margin: .7rem 0; font-weight: 500; }
label > input, label > select, label > textarea { font-weight: 400; margin-top: .25rem; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=url], input[type=file], select, textarea {
  width: 100%; padding: .65rem .7rem; border: 1px solid #cbd2d9; border-radius: 8px; font: inherit; color: var(--ink); background: var(--bg); min-height: var(--tap);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 0; }
input[readonly] { background: var(--paper); }
textarea { resize: vertical; }
input[type=checkbox] { width: 1.15rem; height: 1.15rem; margin: 0 .4rem 0 0; vertical-align: -.2rem; accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: .7rem 0; padding: .5rem .75rem .25rem; }
legend { font-weight: 500; padding: 0 .3rem; }
fieldset label { display: inline-flex; align-items: center; margin: .25rem 1rem .5rem 0; font-weight: 400; min-height: 36px; }
.two { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; }
.two label { margin: .4rem 0; }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: 8px; padding: .5rem .75rem; font-size: .9rem; }
.form-error[hidden] { display: none; }
.field-error { border-color: var(--danger) !important; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  padding: .6rem 1.1rem; min-height: var(--tap); border-radius: 8px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(.95); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.secondary { background: var(--bg); color: var(--accent); }
.btn.secondary:hover { background: var(--accent-soft); filter: none; }
.btn.danger { background: var(--bg); color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); filter: none; }
.btn.small { padding: .35rem .7rem; min-height: 36px; font-size: .875rem; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 0; }
.cta { margin: 1rem 0; }
.cta .btn { width: 100%; }
@media (min-width: 560px) { .cta .btn { width: auto; min-width: 14rem; } }

/* ---- listing page ---- */
.photos { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .5rem; grid-template-columns: 1fr; }
.photos img { width: 100%; height: auto; border-radius: 8px; display: block; }
.photos.gallery li:first-child img { aspect-ratio: 3 / 2; object-fit: cover; }
@media (min-width: 560px) {
  .photos.gallery { grid-template-columns: repeat(2, 1fr); }
  .photos.gallery li:first-child { grid-column: 1 / -1; }
}
.photos.manage { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.photos.manage li { border: 1px solid var(--line); border-radius: 8px; padding: .4rem; display: flex; flex-direction: column; gap: .3rem; }
.photos.manage img { aspect-ratio: 1; object-fit: cover; }
.photos.manage .row { display: flex; gap: .3rem; }
.photos.manage .row .btn { flex: 1; }
.photos.manage li.pending { opacity: .6; }
.chips { list-style: none; padding: 0; margin: .5rem 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chips li { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: .2rem .7rem; font-size: .875rem; font-weight: 500; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 1rem 0; }
.facts dt { font-weight: 600; color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; white-space: pre-line; }
@media (max-width: 400px) { .facts { grid-template-columns: 1fr; gap: 0 } .facts dd { margin-bottom: .5rem; } }
.card.host p { margin: .25rem 0; }
.share { display: flex; gap: .5rem; align-items: center; margin: 1rem 0 .5rem; }
.share input { flex: 1; min-width: 0; font-size: .9rem; }
.share .btn { flex: none; }

/* ---- dialog ---- */
.dialog { border: 0; border-radius: var(--radius); padding: 1.25rem 1rem; width: min(100vw - 2rem, 520px); max-height: calc(100dvh - 2rem); color: var(--ink); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.dialog::backdrop { background: rgba(31, 41, 51, .55); }
.dialog h2 { margin-top: 0; }
.dialog-close { position: absolute; top: .5rem; right: .5rem; margin: 0; }
.dialog .btn[type=submit] { width: 100%; margin-top: .5rem; }
.dialog[open].fallback { position: fixed; inset: auto 0 0 0; margin: 0 auto; border-radius: var(--radius) var(--radius) 0 0; }

/* ---- threads ---- */
.messages { list-style: none; padding: 0; margin: .5rem 0; display: flex; flex-direction: column; gap: .5rem; }
.messages li { padding: .6rem .8rem; border-radius: 12px; background: var(--paper); max-width: 92%; }
.messages li.mine { background: var(--accent-soft); align-self: flex-end; }
.messages .who { font-weight: 600; font-size: .9rem; }
.messages time { color: var(--muted); font-size: .78rem; margin-left: .4rem; }
.messages p { margin: .25rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.quote { white-space: pre-wrap; border-left: 3px solid var(--accent); padding-left: .75rem; color: var(--muted); overflow-wrap: anywhere; }
.contact { font-weight: 600; }

/* ---- tables (admin) ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: .85rem; }

/* ---- misc ---- */
details.past { margin: 1.5rem 0; }
details.past summary { cursor: pointer; font-weight: 600; padding: .6rem 0; min-height: var(--tap); display: flex; align-items: center; }
.toast { position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 999px; font-size: .9rem; z-index: 20; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in .2s ease-out; }
  @keyframes toast-in { from { opacity: 0; transform: translate(-50%, .5rem); } to { opacity: 1; transform: translate(-50%, 0); } }
}
