:root {
  --bg: #f3eee6;
  --surface: #fbf8f2;
  --sunken: #e8dfd0;
  --ink: #12100e;
  --muted: #3d3833;
  --line: #d9d0c3;
  --lagoon: #0d5c63;
  --lagoon-fg: #f4f8f6;
  --lagoon-deep: #0a474c;
  --lagoon-soft: #d7e6e4;
  --radius: 14px;
  --shadow: 0 0 0 1px color-mix(in oklab, var(--ink) 6%, transparent),
    0 8px 24px -16px color-mix(in oklab, var(--ink) 18%, transparent);
  --sans: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --display: "Newsreader", ui-serif, Georgia, serif;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: manipulation;
}
html, body { min-height: 100dvh; }
img, video { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 {
  font-family: var(--display);
  letter-spacing: -0.03em;
  font-weight: 600;
  text-wrap: balance;
  margin: 0;
}
p { text-wrap: pretty; }
.wrap { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }

header.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in oklab, var(--line) 80%, transparent);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 10px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; flex: 1; }
.mark { width: 44px; height: 44px; border-radius: 11px; object-fit: cover; display: block; flex-shrink: 0; }
.brand-name {
  font-weight: 700; font-size: 0.95rem; color: var(--ink); letter-spacing: -0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-links { display: none; }
.nav-links a {
  text-decoration: none; padding: 8px 12px; border-radius: 8px; color: var(--ink);
  font-size: 0.9rem; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center;
}
.nav-links a.btn, .nav-links button.btn { background: var(--lagoon); color: var(--lagoon-fg); border: 0; }

.hero { position: relative; height: min(72dvh, 44rem); min-height: 28rem; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero-video { padding: 12px 0 0; }
.lead-video { width: 100%; border-radius: var(--radius); background: #000; max-height: 56dvh; }
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(28,25,23,.72), rgba(28,25,23,.18) 45%, rgba(28,25,23,.12));
}
.hero-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 0 2.5rem; color: var(--lagoon-fg); }
.kicker {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--lagoon-deep); margin: 0 0 0.75rem;
}
.hero .kicker {
  color: color-mix(in oklab, var(--lagoon-fg) 92%, white);
}
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); font-style: italic; line-height: 0.95; max-width: 16ch; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.4rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: 0 1.2rem; border-radius: 14px; text-decoration: none; font-weight: 600;
  font-size: 0.95rem; border: 0; cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--lagoon); color: var(--lagoon-fg); }
.btn-ghost { background: color-mix(in oklab, var(--surface) 90%, transparent); color: var(--ink); }

section { padding: 3.5rem 0; }
h2 { font-size: clamp(1.6rem, 3vw, 2rem); }
.lead { color: var(--muted); line-height: 1.55; max-width: 42ch; font-weight: 500; }

.mosaic { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.mosaic img, .mosaic video {
  width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius);
  outline: 1px solid color-mix(in oklab, var(--ink) 10%, transparent); outline-offset: -1px;
}
.mosaic .big { grid-row: span 2; min-height: 280px; }
.mosaic .wide { grid-column: span 2; aspect-ratio: 16/9; background: var(--ink); }

.split { display: grid; gap: 2rem; }
@media (min-width: 800px) { .split { grid-template-columns: 1.2fr 1fr; align-items: center; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 1.2rem 0 0; list-style: none; }
.chips li { background: var(--sunken); padding: 6px 12px; border-radius: 999px; font-size: 0.9rem; }

.rooms { display: grid; gap: 2.5rem; }
.room h3 { font-size: 1.4rem; }
.room p { color: var(--muted); line-height: 1.5; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 0.9rem; }
.thumbs img {
  aspect-ratio: 3/2; object-fit: cover; width: 100%; border-radius: 10px; cursor: zoom-in;
  outline: 1px solid color-mix(in oklab, var(--ink) 10%, transparent); outline-offset: -1px;
}

.ask { background: var(--lagoon); color: var(--lagoon-fg); border-radius: 22px; padding: 1.6rem 1.4rem; }
.ask h2 { font-style: italic; }
.ask p { color: color-mix(in oklab, var(--lagoon-fg) 80%, transparent); }
.ask .status { margin: 0.6rem 0 0; font-size: 0.9rem; }

footer { border-top: 1px solid var(--line); padding: 2rem 0; text-align: center; color: var(--muted); font-size: 0.9rem; }
#lightbox {
  position: fixed; inset: 0; background: rgba(28,25,23,.88);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 1.5rem;
}
#lightbox.open { display: flex; }
#lightbox img { max-height: 90dvh; max-width: 100%; border-radius: 8px; }

.admin { padding: 2rem 0 4rem; }
.admin h1 { font-size: 2rem; margin: 0.3rem 0 0.6rem; }
.card-block { background: var(--surface); border-radius: 22px; padding: 1.4rem; box-shadow: var(--shadow); max-width: 28rem; }
.login-form { display: grid; gap: 8px; margin-top: 1rem; }
.login-form input, .fields input, .fields select {
  min-height: 48px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; font: inherit; background: var(--bg); color: var(--ink);
}
.fields { display: grid; gap: 10px; margin: 1.2rem 0; }
@media (min-width: 700px) { .fields { grid-template-columns: repeat(3, 1fr); } }
.fields label, .login-form label {
  font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); display: grid; gap: 6px;
}
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-nav h2 { font-size: 1.3rem; text-transform: capitalize; }
.dow, .cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dow { margin: 1rem 0 6px; color: var(--muted); font-size: 0.75rem; text-align: center; letter-spacing: 0.08em; }
.cal button {
  min-height: 52px; border: 0; border-radius: 10px; background: var(--surface);
  font: inherit; cursor: pointer; box-shadow: var(--shadow);
}
.cal button.res { background: var(--lagoon); color: var(--lagoon-fg); }
.cal button.bloq { background: var(--sunken); color: var(--muted); text-decoration: line-through; }
.cal button.sel { outline: 2px solid var(--lagoon); background: var(--lagoon-soft); }
.cal.prices button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 0; font-size: 0.9rem; }
.cal.prices small { font-size: 0.62rem; font-weight: 600; }
.legend { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 0.85rem; flex-wrap: wrap; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend i.livre { background: var(--surface); box-shadow: var(--shadow); }
.legend i.sel { background: var(--lagoon-soft); outline: 2px solid var(--lagoon); }
.legend i.res { background: var(--lagoon); }
.legend i.bloq { background: var(--sunken); }
.err { color: #8f3d32; font-size: 0.9rem; }
.ok { color: #3d6b4f; font-size: 0.9rem; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 1.4rem; }
.tab {
  min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--sunken); color: var(--ink); font: inherit; cursor: pointer; font-weight: 600;
}
.tab.on { background: var(--lagoon); color: var(--lagoon-fg); }
.tab b {
  display: inline-flex; min-width: 1.2rem; justify-content: center; margin-left: 6px;
  background: #8f3d32; color: #fff; border-radius: 999px; font-size: 0.75rem; padding: 0 5px;
}
.sub { margin: 1.6rem 0 0.7rem; font-size: 1.2rem; }
.fields.stack { grid-template-columns: 1fr; }
.fields textarea, .room-edit textarea, .room-edit input, .fields.stack input, .fields.stack textarea {
  width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; background: var(--bg); color: var(--ink);
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}
.slot {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.slot span {
  display: block;
  margin-bottom: 6px;
}
.slot img, .preview {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: var(--sunken);
  display: block;
}
.slot input[type="file"] {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: calc(100% - 1.2rem);
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.thumbs .slot { margin: 0; }
.thumbs .slot input[type="file"] { height: 100%; inset: 0; }
.preview { max-width: 88px; margin: 8px 0; }
.room-edit { background: var(--surface); padding: 1rem; border-radius: 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.cal.airbnb button.in { background: var(--lagoon-soft); color: var(--ink); }
.cal.airbnb button:disabled { opacity: 0.45; cursor: not-allowed; }
.guest-cals { display: grid; gap: 1.2rem; margin-top: 1rem; }
@media (min-width: 900px) { .guest-cals { grid-template-columns: 1.1fr 0.9fr; align-items: start; } }
.cal.light button { background: color-mix(in oklab, var(--lagoon-fg) 14%, transparent); color: var(--lagoon-fg); box-shadow: none; }
.cal.light button.res { background: var(--lagoon-fg); color: var(--lagoon); }
.cal.light button.in { background: color-mix(in oklab, var(--lagoon-fg) 30%, transparent); }
.cal.light button.bloq { background: transparent; color: color-mix(in oklab, var(--lagoon-fg) 45%, transparent); text-decoration: line-through; }
.dow.light { color: color-mix(in oklab, var(--lagoon-fg) 70%, transparent); }
.cal-nav.light h3 { margin: 0; text-transform: capitalize; color: var(--lagoon-fg); font-size: 1.1rem; }
.book-form { display: grid; gap: 8px; }
.book-form .hint { margin: 0; font-size: 0.78rem; letter-spacing: 0; text-transform: none; opacity: 0.82; }
.book-form label { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.book-form input {
  width: 100%; min-height: 48px; border: 0; border-radius: 10px; padding: 0 12px;
  font: inherit; background: var(--lagoon-fg); color: var(--ink);
}
.pix { margin-top: 1rem; padding: 1rem; border-radius: 14px; background: color-mix(in oklab, var(--lagoon-fg) 12%, transparent); }
.pix-key, .pix-val { font-size: 1.15rem; font-weight: 700; margin: 0.3rem 0; }
.list { display: grid; gap: 10px; }
.card-row {
  display: grid; gap: 10px; background: var(--surface); padding: 1rem; border-radius: 16px; box-shadow: var(--shadow);
}
@media (min-width: 800px) { .card-row { grid-template-columns: 1fr auto; align-items: center; } }
.card-row p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.9rem; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions button, .row-actions .btn {
  min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px;
  background: var(--sunken); font: inherit; cursor: pointer;
}
.chat-layout { display: grid; gap: 12px; }
@media (min-width: 800px) { .chat-layout { grid-template-columns: 220px 1fr; min-height: 420px; } }
.thread-list { display: grid; align-content: start; gap: 6px; }
.thread {
  text-align: left; border: 0; border-radius: 12px; padding: 10px; background: var(--surface);
  box-shadow: var(--shadow); cursor: pointer; font: inherit;
}
.thread.on { outline: 2px solid var(--lagoon); }
.thread span { display: block; color: var(--muted); font-size: 0.85rem; }
.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.chat-toolbar p { margin: 0; font-weight: 700; flex: 1; }
.chat-tools { display: flex; gap: 8px; flex-shrink: 0; }
.chat-tools .btn { min-height: 40px; padding: 0 14px; }
.bubble.sys { background: transparent; box-shadow: none; text-align: center; color: var(--muted); font-size: 0.8rem; }
.bubble.sys b { display: none; }
.thread-view { display: grid; grid-template-rows: auto auto 1fr auto; background: var(--surface); border-radius: 16px; min-height: 360px; }
.msgs { overflow: auto; padding: 12px; display: grid; gap: 8px; max-height: 50dvh; }
.bubble { background: var(--bg); padding: 8px 10px; border-radius: 12px; color: var(--ink); }
.bubble.host { background: var(--lagoon-soft); }
.bubble img { max-width: 180px; border-radius: 8px; margin-top: 6px; }
.composer { display: grid; gap: 8px; padding: 10px; }
.composer input:not([type="file"]) {
  width: 100%; min-height: 44px; max-height: 44px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; font: inherit; background: var(--bg); color: var(--ink);
  box-sizing: border-box;
}
.composer textarea {
  min-height: 52px; max-height: 96px; resize: none; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  font: inherit; width: 100%; line-height: 1.45; background: var(--bg); color: var(--ink);
  box-sizing: border-box;
}
#hostChat textarea { max-height: 140px; }
.composer-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.composer-tools .btn { margin-left: auto; }
.icon-btn {
  position: relative;
  width: 44px; height: 44px; border-radius: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sunken); color: var(--ink); border: 0; padding: 0;
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.composer input[type="file"] { display: none; }
.chat-fab { display: none; }
.chat-panel {
  position: fixed; z-index: 50;
  left: 12px; right: 12px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  top: auto;
  width: auto;
  max-width: 420px;
  margin-inline: auto;
  max-height: min(72dvh, calc(100dvh - 120px));
  background: var(--surface); color: var(--ink); border-radius: 18px; box-shadow: var(--shadow);
  display: grid; grid-template-rows: auto 1fr auto auto auto;
  overflow: hidden;
}
.chat-panel header {
  display: flex; align-items: center; padding: 14px 16px 8px;
  border-bottom: 1px solid var(--line);
}
.chat-panel header strong {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-panel .msgs { min-height: 120px; }
.chat-sla {
  margin: 0 12px 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--lagoon-soft);
  color: var(--lagoon-deep);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}
.typing { margin: 0 12px 6px; font-size: 0.9rem; font-weight: 700; color: var(--lagoon); }
.typing::after { content: ""; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}
.hint { margin: 0 12px 8px; font-size: 0.82rem; color: var(--muted); }
.chat-panel header button { border: 0; background: none; font: inherit; cursor: pointer; color: var(--muted); min-height: 44px; }
#hostChat { display: grid; }
.composer input[type="file"] { max-width: 48%; font-size: 0.75rem; }

.app-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  position: fixed;
  left: 0; right: 0; bottom: 0; z-index: 45;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
}
.app-tabs a, .app-tabs button {
  border: 0; background: none; font: inherit; font-weight: 650;
  color: var(--ink); text-decoration: none; min-height: 52px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 2px; font-size: 0.62rem; letter-spacing: 0;
}
.app-tabs .ico { font-size: 1.1rem; line-height: 1; }
.app-tabs a.on, .app-tabs button.on { color: var(--lagoon); }
body:not(.shell) { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.install-hint {
  position: sticky; bottom: 0; margin: 0; padding: 10px 16px;
  background: var(--lagoon); color: var(--lagoon-fg); text-align: center; font-size: 0.85rem;
}

.guest-grid { display: grid; gap: 12px; }
@media (min-width: 800px) { .guest-grid { grid-template-columns: 1fr 1fr; } }
.card-block.wide { max-width: none; }
@media (min-width: 800px) { .card-block.wide { grid-column: 1 / -1; } }
.safe { margin-top: 0.8rem; padding: 0.8rem; border-radius: 12px; background: var(--lagoon-soft); color: var(--ink); }
pre { white-space: pre-wrap; font-family: inherit; color: var(--muted); line-height: 1.5; }

@media (max-width: 640px) {
  .mosaic { grid-template-columns: 1fr 1fr; }
  .mosaic .big { grid-row: auto; min-height: 180px; }
}

@media (max-width: 800px) {
  header.nav { padding-top: env(safe-area-inset-top); }
}
.cal button.out { opacity: 0.42; }

.guest-toggle {
  width: 100%; min-height: 48px; border: 0; border-radius: 10px;
  background: var(--lagoon-fg); color: var(--ink); font: inherit; font-weight: 650;
  text-align: left; padding: 0 12px; cursor: pointer;
}
.guest-sheet {
  background: #fff; color: var(--ink); border-radius: 16px; padding: 4px 12px 12px;
}
.guest-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.guest-row strong { display: block; font-size: 1rem; }
.guest-row span { display: block; color: var(--muted); font-size: 0.82rem; letter-spacing: 0; text-transform: none; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; font-size: 1.2rem; cursor: pointer; color: var(--ink);
}
.stepper b { min-width: 1.2rem; text-align: center; }
.child-ages { display: grid; gap: 8px; padding: 8px 0 4px; }
.child-ages label { letter-spacing: 0; text-transform: none; font-size: 0.85rem; color: var(--muted); }
.child-ages select {
  width: 100%; min-height: 44px; border-radius: 10px; border: 1px solid var(--line);
  font: inherit; padding: 0 10px; background: var(--bg);
}

.actions-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.actions-grid .btn, .actions-grid button, .actions-grid a, .actions-grid label {
  width: 100%;
  margin: 0;
  justify-content: center;
}
.steps {
  list-style: none; padding: 0; margin: 0 0 2rem;
  display: grid; gap: 12px;
}
.steps li {
  background: var(--surface); border-radius: 16px; padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow); display: grid; gap: 4px;
}
.steps b { color: var(--lagoon); font-size: 1.35rem; }
.steps strong { font-size: 1.05rem; }
.steps span { color: var(--muted); font-weight: 500; }
.quotes { display: grid; gap: 12px; margin-top: 1.2rem; }
.quotes figure {
  margin: 0; background: var(--surface); border-radius: 16px;
  padding: 1.2rem; box-shadow: var(--shadow);
}
.quotes blockquote {
  margin: 0; font-family: var(--display); font-size: 1.2rem; line-height: 1.35;
}
.quotes figcaption { margin-top: 0.8rem; color: var(--muted); font-weight: 700; font-size: 0.88rem; }
@media (min-width: 801px) {
  .steps, .quotes { grid-template-columns: 1fr 1fr 1fr; }
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 1.2rem;
}
.album-grid figure { margin: 0; }
.album-grid img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; cursor: zoom-in;
}
.album-grid figcaption {
  font-size: 0.78rem; font-weight: 600; color: var(--muted); padding: 6px 2px 0;
}
@media (min-width: 801px) {
  .album-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
}
  display: inline-block; margin-top: 6px; font-size: 0.75rem; font-style: normal;
  color: var(--lagoon); font-weight: 700;
}
.thread em, .mini-close {
  display: inline-block; margin-top: 6px; font-size: 0.75rem; font-style: normal;
  color: var(--lagoon); font-weight: 700;
}
.mini-close { cursor: pointer; }

.sair-link {
  border: 0; background: none; color: var(--muted);
  font: inherit; font-size: 0.9rem; min-height: 44px; cursor: pointer; padding: 0 4px;
}

body.shell { background: var(--bg); }
body.shell footer { display: none; }
body.shell .kicker {
  color: var(--lagoon-deep);
  letter-spacing: 0.1em;
}
body.shell .lead { color: var(--muted); }
body.shell .app-frame {
  width: 100%;
  min-height: 100dvh;
  background: var(--bg);
  overflow: visible;
}
body.shell .nav-bar,
body.shell .admin-screen {
  width: 100%;
  box-sizing: border-box;
  padding-left: max(28px, env(safe-area-inset-left));
  padding-right: max(28px, env(safe-area-inset-right));
}
body.shell .nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 8px;
}
body.shell .admin-screen {
  padding-top: 12px;
  padding-bottom: 24px;
}
body.shell .card-block { max-width: none; }
body.shell .fields input,
body.shell .fields textarea,
body.shell .fields select,
body.shell .login-form input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 800px) {
  body.shell header.nav { padding-top: env(safe-area-inset-top); }
  body.shell .admin-screen { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  body.shell .app-tabs {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; width: 100%;
    z-index: 45; background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(10px + env(safe-area-inset-bottom));
    transform: none;
  }
  body.shell .admin-tabs { grid-template-columns: repeat(5, 1fr); }
  body.shell .app-tabs a, body.shell .app-tabs button, body.shell .admin-tabs .tab {
    border: 0; background: none; font: inherit; font-weight: 650;
    color: var(--muted); text-decoration: none; min-height: 52px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 0; padding: 4px 2px; flex-direction: column; gap: 2px; font-size: 0.68rem;
  }
  body.shell .admin-tabs .tab.on { background: transparent; color: var(--lagoon); }
  body.shell .admin-tabs .tab { position: relative; }
  body.shell .tab b {
    position: absolute; margin: 0; transform: translate(10px, -16px);
    min-width: 1rem; font-size: 0.65rem;
  }
  body.shell .fields,
  body.shell .fields.stack,
  body.shell .chat-layout,
  body.shell .card-row,
  body.shell .guest-grid { grid-template-columns: 1fr !important; }
  body.shell .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  body.shell .cal.prices button { min-height: 58px; }
  .thread-view { min-height: 280px; }
  #tab-chat .msgs { max-height: 36dvh; }
}

@media (min-width: 801px) {
  body.shell .app-frame { display: flex; flex-direction: column; }
  body.shell header.nav { order: 0; }
  body.shell .admin-tabs { order: 1; }
  body.shell main { order: 2; }
  body.shell .nav-bar,
  body.shell .admin-screen,
  body.shell .app-tabs.admin-tabs {
    width: min(960px, calc(100% - 48px));
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
  }
  body.shell .card-block { max-width: 28rem; }
  body.shell #panelBox { max-width: none; }
  body.shell #panelBox .card-block,
  body.shell .card-block.wide { max-width: none; }
  body.shell .fields { grid-template-columns: repeat(3, 1fr) !important; }
  body.shell .fields.stack { grid-template-columns: 1fr !important; }
  body.shell .chat-layout { grid-template-columns: 240px 1fr !important; min-height: 480px; }
  body.shell .guest-grid { grid-template-columns: 1fr 1fr !important; }
  body.shell .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  body.shell .app-tabs.admin-tabs {
    display: flex !important;
    position: static; transform: none; left: auto; bottom: auto; width: min(960px, calc(100% - 48px));
    justify-content: flex-start; gap: 8px; flex-wrap: wrap;
    background: transparent; border: 0; padding: 12px 0 0;
    grid-template-columns: none;
  }
  body.shell .admin-tabs .tab {
    background: var(--sunken); border-radius: 999px; min-height: 44px;
    padding: 0 14px; flex-direction: row; gap: 6px; font-size: 0.9rem; color: var(--ink);
  }
  body.shell .admin-tabs .tab.on { background: var(--lagoon); color: var(--lagoon-fg); }
  body:not(.shell) .install-hint { display: none !important; }
}
@media (display-mode: standalone) {
  header.nav { padding-top: env(safe-area-inset-top); }
  .install-hint { display: none !important; }
}
