/* Palette drawn from Lake Malawi: deep lake, mist, sand, sunrise amber */
:root {
  --lake: #0A3D4A;
  --lake-2: #0F5668;
  --mist: #EAF2F2;
  --paper: #FBFDFD;
  --ink: #12262B;
  --muted: #5A6F74;
  --line: #D5E2E3;
  --amber: #F2B544;
  --wa: #1FA855;
  --danger: #B3261E;
  --r: 14px;
  --shadow: 0 8px 28px rgba(10, 61, 74, .12);
  --head: 'Syne', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1rem/1.55 var(--body); color: var(--ink); background: var(--mist); }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 .5rem; color: var(--lake); }
h1 { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.25rem; margin-top: 1.6rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .6rem; }
a { color: var(--lake-2); }
img { max-width: 100%; display: block; }
main:focus { outline: none; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: .5rem 1rem; z-index: 99; }
.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(640px, 100% - 2rem); }
.muted { color: var(--muted); }
.center { display: grid; place-items: center; min-height: 40vh; }
.center-text { text-align: center; }
.small-text { font-size: .85rem; }
.row { display: flex; align-items: center; gap: 1rem; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.pad { padding: 1rem; }

/* header */
#site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .5rem; font: 800 1.2rem var(--head); color: var(--lake); text-decoration: none; }
nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
nav a:not(.btn), .linklike { color: var(--ink); text-decoration: none; font-weight: 500; }
nav a.active { color: var(--lake-2); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; cursor: pointer; }
.linklike.red { color: var(--danger); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .75rem 1.25rem; border-radius: 999px; border: 2px solid var(--lake); background: var(--lake); color: #fff; font: 700 .95rem var(--body); text-decoration: none; cursor: pointer; min-height: 44px; transition: background .15s, transform .1s; }
.btn:hover { background: var(--lake-2); border-color: var(--lake-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.small { padding: .4rem .9rem; min-height: 36px; font-size: .85rem; }
.btn.ghost { background: transparent; color: var(--lake); } .btn.ghost:hover { background: var(--mist); }
.btn.wa { background: var(--wa); border-color: var(--wa); } .btn.wa:hover { background: #178a46; border-color: #178a46; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); } .btn.danger:hover { background: #fdecea; }
.btn.block { width: 100%; margin-top: .6rem; }

/* hero */
.hero { background: var(--lake); color: #fff; padding: clamp(2rem, 7vw, 4.5rem) 0 2.2rem; border-bottom: 6px solid var(--amber); }
.hero h1 { color: #fff; max-width: 14ch; }
.hero p { max-width: 46ch; color: #CFE3E6; font-size: 1.05rem; }
.filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: .6rem; margin-top: 1.4rem; }
.filters input, .filters select, .form input, .form select, .form textarea, .book input {
  width: 100%; padding: .75rem .9rem; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--ink); min-height: 46px; }

/* grid + cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.4rem; padding-bottom: 3rem; }
.card { background: var(--paper); border-radius: var(--r); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card:hover .card-img img { transform: scale(1.03); }
.card-img { position: relative; aspect-ratio: 4/3; background: var(--line); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.noimg { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .9rem; }
.badge { position: absolute; left: .7rem; top: .7rem; background: var(--paper); color: var(--lake); font-weight: 700; font-size: .78rem; padding: .25rem .65rem; border-radius: 999px; }
.card-body { padding: 1rem 1.1rem 1.2rem; }
.spec { color: var(--muted); font-size: .92rem; }
.spec.big { font-size: 1.02rem; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .35rem; margin: .5rem 0 0; }
.price .usd { font: 800 1.45rem var(--head); color: var(--lake); }
.price .per { color: var(--muted); font-size: .9rem; }
.price .mwk { flex-basis: 100%; font-weight: 700; color: var(--lake-2); }

/* detail */
.detail { padding: 1.2rem 0 3rem; }
.back { display: inline-block; margin-bottom: .8rem; }
.gallery .main-img { border-radius: var(--r); overflow: hidden; aspect-ratio: 16/10; background: var(--line); }
.main-img img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: .5rem; margin-top: .6rem; overflow-x: auto; padding-bottom: .3rem; }
.thumb { flex: 0 0 84px; height: 62px; border: 3px solid transparent; border-radius: 10px; padding: 0; overflow: hidden; cursor: pointer; background: none; }
.thumb.on { border-color: var(--amber); } .thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; margin-top: 1.4rem; align-items: start; }
.prose { white-space: pre-line; max-width: 68ch; }
.features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; }
.features li { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .8rem; }
.book { background: var(--paper); border-radius: var(--r); padding: 1.3rem; box-shadow: var(--shadow); position: sticky; top: 5rem; }
.book label, .form label { display: block; font-weight: 500; font-size: .92rem; margin-bottom: .8rem; }
.book input, .form input, .form select, .form textarea { margin-top: .3rem; }
.dates { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.total { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; background: var(--mist); border-radius: 10px; padding: .7rem .9rem; margin-bottom: .4rem; }

/* forms */
.form { display: block; }
.auth { padding: 2.5rem 0 3rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
fieldset { border: 1.5px solid var(--line); border-radius: var(--r); padding: 1rem; margin: 0 0 1rem; background: var(--paper); }
legend { font: 700 1rem var(--head); color: var(--lake); padding: 0 .4rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .2rem .8rem; margin-bottom: .6rem; }
.check { display: flex !important; align-items: center; gap: .5rem; }
.check input { width: 20px; height: 20px; min-height: 0; margin: 0; }
.error { color: var(--danger); min-height: 1.2em; font-weight: 500; }

/* admin */
.tabs { display: flex; gap: 1.4rem; border-bottom: 1px solid var(--line); margin: .6rem 0 1.2rem; }
.tabs a { padding: .6rem 0; text-decoration: none; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--lake); border-color: var(--amber); }
.admin-list { list-style: none; padding: 0; margin: 0 0 3rem; display: grid; gap: .8rem; }
.admin-row { display: flex; gap: 1rem; align-items: center; background: var(--paper); border-radius: var(--r); padding: .8rem; box-shadow: var(--shadow); flex-wrap: wrap; }
.admin-row .grow { display: grid; gap: .15rem; }
.thumb-sm { width: 84px; height: 62px; border-radius: 10px; overflow: hidden; background: var(--line); flex: none; }
.thumb-sm img { width: 100%; height: 100%; object-fit: cover; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill { display: inline-block; justify-self: start; font-size: .75rem; font-weight: 700; padding: .15rem .6rem; border-radius: 999px; background: var(--line); color: var(--muted); }
.pill.ok { background: #D9F2E3; color: #14683A; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .7rem; margin-bottom: .8rem; }
.photos figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.photos img { aspect-ratio: 4/3; width: 100%; object-fit: cover; }
.photos figcaption { display: flex; flex-direction: column; gap: .2rem; padding: .4rem .5rem; font-size: .82rem; align-items: flex-start; }
.upload { cursor: pointer; }

/* chat */
.chat { padding: 1.5rem 0 3rem; }
.msgs { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); height: min(52vh, 460px); overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.bubble { max-width: 80%; padding: .55rem .85rem; border-radius: 16px; background: var(--mist); }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble time { font-size: .72rem; color: var(--muted); }
.bubble.me { align-self: flex-end; background: var(--lake); color: #fff; border-bottom-right-radius: 4px; }
.bubble.me time { color: #A9C9CE; }
.bubble.them { border-bottom-left-radius: 4px; }
.composer { display: flex; gap: .5rem; margin-top: .7rem; } .composer[hidden] { display: none; }
.composer input { flex: 1; padding: .75rem .9rem; border: 1.5px solid var(--line); border-radius: 999px; font: inherit; min-height: 46px; }
.inbox { display: grid; grid-template-columns: 280px 1fr; gap: 1rem; padding-bottom: 3rem; }
.convs { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); max-height: 560px; overflow-y: auto; }
.conv { width: 100%; text-align: left; display: grid; gap: .1rem; padding: .8rem 1rem; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; cursor: pointer; }
.conv span { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.on { background: var(--mist); box-shadow: inset 4px 0 0 var(--amber); }
.thread-head { padding: 0 0 .5rem; }

/* misc */
.empty { text-align: center; padding: 3rem 1rem; } .empty p { color: var(--muted); }
.spinner { width: 38px; height: 38px; border: 4px solid var(--line); border-top-color: var(--lake); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); display: grid; gap: .5rem; z-index: 50; width: min(420px, 92vw); }
.toast { background: var(--ink); color: #fff; padding: .75rem 1rem; border-radius: 10px; box-shadow: var(--shadow); }
.toast.ok { background: #14683A; } .toast.err { background: var(--danger); }
#site-footer { background: var(--lake); color: #CFE3E6; margin-top: 2rem; padding: 1.6rem 0; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.foot p { margin: 0; max-width: 50ch; } .foot strong { color: #fff; }

@media (max-width: 860px) {
  .filters { grid-template-columns: 1fr 1fr; } .filters input { grid-column: 1 / -1; }
  .detail-grid { grid-template-columns: 1fr; } .book { position: static; }
  .inbox { grid-template-columns: 1fr; } .convs { max-height: 200px; }
  .three { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 480px) { .two { grid-template-columns: 1fr; } .bar { justify-content: center; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
