/* Villa Corcovado guest guide – designed for 360 px phones and bright sunlight */
:root {
  --paper: #f6f1e8;      /* warm Dalmatian stone */
  --card: #ffffff;
  --ink: #15181b;        /* logo black */
  --ink-2: #3d454c;
  --muted: #5d666d;
  --line: #e3dccf;
  --sea: #0b3d5c;        /* deep Adriatic */
  --sea-2: #145b84;
  --pool: #0e8a9c;
  --sand: #e9d9b8;
  --red: #b3261e;
  --ok: #1e6b3a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 18px;
  --tabbar-h: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.55 var(--sans);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
img { max-width: 100%; display: block; }
a { color: var(--sea-2); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pool); outline-offset: 2px; }
.loading { text-align: center; font-family: var(--serif); font-size: 24px; padding: 30vh 0; color: var(--muted); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; background: rgba(246,241,232,.94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  min-height: 60px;
}
.topbar .title { flex: 1; min-width: 0; font-family: var(--serif); font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: var(--ink); }
.topbar .brand img { width: 44px; height: 44px; mix-blend-mode: multiply; }
.topbar .brand b { font-family: var(--serif); font-weight: 400; font-size: 20px; line-height: 1.1; }
.topbar .brand small { display: block; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.iconbtn {
  min-width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 10px; cursor: pointer; text-decoration: none; color: var(--ink);
}
.iconbtn svg { width: 22px; height: 22px; }
.sos { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; font-size: 15px; }
.lang { font-size: 15px; font-weight: 600; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--sea); }
.tabbar a[aria-current="page"] svg { stroke-width: 2.2; }

/* ---------- layout ---------- */
#view { display: block; max-width: 640px; margin: 0 auto; padding: 14px 16px 28px; outline: none; }
.stack > * + * { margin-top: 14px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 24px; margin-top: 26px !important; }
h3 { font-size: 20px; }
p { margin: 0; }
.muted { color: var(--muted); }

/* ---------- home ---------- */
.banner { position: relative; border-radius: var(--r); overflow: hidden; height: 118px; background: var(--sea); }
.banner img { width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }
.banner span { position: absolute; left: 14px; bottom: 10px; color: #fff; font-family: var(--serif); font-size: 22px; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action {
  min-height: 96px; border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; justify-content: space-between;
  text-decoration: none; color: #fff; background: var(--sea); font-weight: 700; font-size: 17px; line-height: 1.25; border: 0; text-align: left; cursor: pointer;
}
.action svg { width: 28px; height: 28px; }
.action.wifi { background: var(--sea-2); }
.action.contact { background: var(--pool); }
.action.emergency { background: var(--red); }
.action small { display: block; font-weight: 500; font-size: 14px; opacity: .92; }
.times { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.times div { padding: 12px 14px; }
.times div + div { border-left: 1px solid var(--line); }
.times small { display: block; color: var(--muted); font-size: 14px; }
.times b { font-size: 24px; font-family: var(--serif); font-weight: 400; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border-radius: 22px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px;
}
.chip svg { width: 20px; height: 20px; color: var(--sea); }
.welcome-card { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; text-decoration: none; color: var(--ink); min-height: 72px; }
.welcome-card img { width: 72px; height: 56px; object-fit: cover; border-radius: 12px; }
.welcome-card b { font-family: var(--serif); font-weight: 400; font-size: 19px; display: block; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.status.ok { color: var(--ok); font-weight: 600; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.linkbtn { background: none; border: 0; color: var(--sea-2); text-decoration: underline; padding: 10px 0; min-height: 44px; cursor: pointer; font-size: 15px; }

/* ---------- lists of sections ---------- */
.rows { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px; text-decoration: none; color: var(--ink); }
.row + .row { border-top: 1px solid var(--line); }
.row .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--paper); display: flex; align-items: center; justify-content: center; color: var(--sea); flex: none; }
.row .ic svg { width: 24px; height: 24px; }
.row span { flex: 1; font-weight: 600; }
.row small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
.row .chev { color: var(--muted); width: 20px; height: 20px; flex: none; }

/* ---------- content blocks ---------- */
.photo { border-radius: var(--r); overflow: hidden; background: var(--sand); }
.photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.facts div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.facts small { display: block; color: var(--muted); font-size: 14px; }
.facts b { font-size: 17px; }
ul.list, ol.steps { margin: 0; padding: 0; list-style: none; }
ul.list li, ol.steps li { position: relative; padding-left: 28px; }
ul.list li + li, ol.steps li + li { margin-top: 8px; }
ul.list li::before { content: ""; position: absolute; left: 8px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--pool); }
ol.steps { counter-reset: s; }
ol.steps li { counter-increment: s; padding-left: 38px; min-height: 28px; }
ol.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--sea); color: #fff; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.callout { background: #fdeceb; border-left: 5px solid var(--red); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.copybox { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 10px 14px; }
.copybox div { flex: 1; min-width: 0; }
.copybox small { display: block; color: var(--muted); font-size: 14px; }
.copybox b { font-size: 18px; overflow-wrap: anywhere; }
.btn {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 22px;
  border: 0; background: var(--sea); color: #fff; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
}
.btn.light { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.btn.green { background: #1d7a46; }
.btn.red { background: var(--red); }
.btn svg { width: 20px; height: 20px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btns small { width: 100%; color: var(--muted); font-size: 14px; }
details.more { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
details.more summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; cursor: pointer; font-weight: 700; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; font-size: 24px; color: var(--sea); }
details.more[open] summary::after { content: "–"; }
details.more > .stack { padding: 0 16px 16px; }
.checklist { margin: 0; padding: 0; list-style: none; }
.checklist label { display: flex; gap: 12px; align-items: center; min-height: 48px; padding: 6px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.checklist input { width: 24px; height: 24px; accent-color: var(--sea); flex: none; }

/* apartment picker */
.apts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.apts button { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 700; cursor: pointer; }
.apts button[aria-pressed="true"] { background: var(--sea); color: #fff; border-color: var(--sea); }
.apt-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.apt-card .stack { padding: 12px 14px 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { background: var(--paper); border-radius: 8px; padding: 4px 8px; font-size: 15px; }

/* explore */
.places { display: grid; gap: 10px; }
.place { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.place div { flex: 1 1 150px; min-width: 0; }
.place.long div { flex-basis: 100%; }
.place b { display: block; }
.place p { font-size: 16px; color: var(--ink-2); margin-top: 2px; }

/* help */
.contact { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.contact b { font-family: var(--serif); font-weight: 400; font-size: 22px; }
.contact .num { color: var(--muted); }
.sosbig { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--red); color: #fff; border-radius: var(--r); padding: 16px; text-decoration: none; }
.sosbig b { font-size: 40px; line-height: 1; }
.sosbig span { font-weight: 700; }
.numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.numbers a { min-height: 60px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; text-decoration: none; color: var(--ink); }
.numbers b { font-size: 22px; display: block; color: var(--red); }
.numbers span { font-size: 14px; }

/* search */
.searchbox { display: flex; gap: 8px; }
.searchbox input { flex: 1; min-width: 0; min-height: 48px; border-radius: 24px; border: 1px solid var(--line); background: var(--card); padding: 0 18px; font: inherit; }
.result { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.result small { color: var(--muted); display: block; font-size: 14px; }
.result mark { background: var(--sand); color: inherit; }

.error { background: #fff; border: 2px solid var(--red); border-radius: 14px; padding: 16px; }
.error pre { white-space: pre-wrap; font-size: 14px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 140%); opacity: 0; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 22px; z-index: 30; transition: .25s; font-weight: 600; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
