/* =========================================================================
   Lagooners — styles
   Palette: whitewash, Aegean navy, lagoon teal, bougainvillea, lemon.
   Each cluster has its own "painted door" colour passed in as --c.
   ========================================================================= */

@font-face { font-family: "Young Serif"; src: url("../assets/fonts/young-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Young Serif"; src: url("../assets/fonts/young-serif-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Albert Sans"; src: url("../assets/fonts/albert-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Albert Sans"; src: url("../assets/fonts/albert-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Albert Sans"; src: url("../assets/fonts/albert-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Albert Sans"; src: url("../assets/fonts/albert-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #F1F6F6;
  --surface: #FFFFFF;
  --surface-2: #F6FAFA;
  --ink: #10293A;
  --ink-2: #364E5F;
  --muted: #647A88;
  --line: #D9E4E5;
  --line-2: #E8F0F0;

  --lagoon: #0E8C8C;
  --lagoon-deep: #0A6E73;
  --lagoon-tint: #DCF0EF;
  --bloom: #C21E6B;
  --bloom-tint: #FBE4EE;
  --lemon: #F4C542;
  --lemon-tint: #FFF3CC;
  --sand: #EEE5D6;
  --ok: #2F7D55;

  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Albert Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-sheet: 24px;
  --r-card: 16px;
  --r-small: 10px;
  --lift: 0 10px 30px rgba(16, 41, 58, .14);

  --topbar-h: 60px;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--lagoon); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.sm { width: 18px; height: 18px; }
.ico.xs { width: 15px; height: 15px; }
.ico.lg { width: 28px; height: 28px; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; }

.sidebar { display: none; }
.rail { display: none; }

.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 4px;
  padding: 0 12px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-spacer { flex: 1; }
.brand-mobile { margin-right: 6px; }

.scope {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px 0 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-weight: 600; font-size: 15px; max-width: 52vw;
}
.scope .door { width: 22px; height: 22px; }
.scope span.txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 12px;
  display: inline-grid; place-items: center; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--bloom); box-shadow: 0 0 0 2px #fff; }
.top-avatar { margin-left: 4px; }
.search-wide { display: none; }

.view {
  display: block; outline: none;
  padding: 16px 16px calc(var(--tabbar-h) + var(--safe-b) + 28px);
  max-width: 760px; margin: 0 auto;
}

/* Mobile tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: #fff; border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 100%; font-size: 12px; font-weight: 600; color: var(--muted);
}
.tabbar a.is-active { color: var(--lagoon-deep); }
.tabbar a.is-active .ico { stroke-width: 2.4; }
.fab {
  justify-self: center; width: 56px; height: 56px; margin-top: -26px;
  border-radius: 20px; background: var(--lagoon); color: #fff;
  display: grid; place-items: center; box-shadow: 0 8px 20px rgba(14, 140, 140, .38);
  transition: transform .15s ease;
}
.fab:active { transform: scale(.94); }
.fab .ico { width: 28px; height: 28px; stroke-width: 2.4; }

/* Tablet: icon sidebar */
@media (min-width: 768px) {
  .app { display: grid; grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: var(--topbar-h) 1fr; }
  .tabbar { display: none; }
  .brand-mobile { display: none; }
  .topbar { grid-column: 2; padding: 0 24px; }
  .view { grid-column: 2; padding: 24px 24px 64px; width: 100%; }
  .sidebar {
    display: flex; flex-direction: column; gap: 6px;
    grid-row: 1 / span 2; grid-column: 1;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 14px 12px; background: #fff; border-right: 1px solid var(--line);
  }
  .sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
  .brand-text, .side-nav .lbl, .side-clusters, .side-me .who { display: none; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav a, .side-nav button {
    display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px; border-radius: 12px;
    color: var(--ink-2); font-weight: 600; font-size: 15px; width: 100%; text-align: left;
  }
  .side-nav a:hover { background: var(--surface-2); }
  .side-nav a.is-active { background: var(--lagoon-tint); color: var(--lagoon-deep); }
  .nav-sec { height: 1px; background: var(--line-2); margin: 10px 8px; }
  .nav-sec .lbl { display: none; }
  .side-nav .create { background: var(--lagoon); color: #fff; margin: 10px 0 6px; justify-content: center; }
  .side-nav .create:hover { background: var(--lagoon-deep); }
  .side-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
  .side-me:hover { background: var(--surface-2); }
}

/* Desktop: full sidebar + right rail */
@media (min-width: 1100px) {
  .app { grid-template-columns: 264px minmax(0, 1fr) 340px; }
  .topbar { grid-column: 2 / span 2; padding: 0 28px; }
  .view { grid-column: 2; padding: 28px 28px 80px; max-width: 780px; }
  .brand-text, .side-nav .lbl, .side-me .who { display: block; }
  .side-nav .create { justify-content: flex-start; }
  .nav-sec { height: auto; background: none; margin: 14px 14px 4px; }
  .nav-sec .lbl { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
  .side-nav a, .side-nav button { height: 42px; }
  .brand-name { display: block; font-family: var(--serif); font-size: 22px; line-height: 1.1; }
  .brand-sub { display: block; font-size: 12.5px; color: var(--muted); }
  .side-clusters { display: block; padding: 18px 8px 8px; border-top: 1px solid var(--line-2); margin-top: 10px; }
  .side-clusters h3 { font: 600 13px var(--sans); color: var(--muted); margin: 0 6px 8px; }
  .side-clusters button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 6px; border-radius: 10px; font-size: 14.5px; color: var(--ink-2); text-align: left; }
  .side-clusters button:hover { background: var(--surface-2); }
  .side-clusters button.is-active { font-weight: 700; color: var(--ink); }
  .side-clusters .count { margin-left: auto; font-size: 12.5px; color: var(--muted); }
  .side-me .who b { display: block; font-size: 14.5px; }
  .side-me .who small { color: var(--muted); font-size: 12.5px; }
  .search-wide {
    display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 16px; margin-left: 16px;
    flex: 1; max-width: 420px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
    color: var(--muted); font-size: 15px;
  }
  .search-wide + .topbar-spacer + .icon-btn { display: none; }
  .rail {
    display: flex; flex-direction: column; gap: 16px;
    grid-column: 3; grid-row: 2; padding: 28px 28px 40px 0;
    position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  }
}

/* ---------- Type ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.page-head h1 { font-family: var(--serif); font-size: 30px; line-height: 1.15; letter-spacing: -.01em; }
.page-head p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-head h2 { font-family: var(--serif); font-size: 21px; line-height: 1.2; }
.section-head a, .link { color: var(--lagoon-deep); font-weight: 600; font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.serif { font-family: var(--serif); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 600; font-size: 15px; margin-bottom: 10px; padding: 6px 4px 6px 0; }

/* ---------- Building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.pad { padding: 16px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.door {
  --c: var(--lagoon);
  width: 14px; height: 18px; flex: none; border-radius: 7px 7px 2px 2px; background: var(--c);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12);
}
.door.round { width: 12px; height: 12px; border-radius: 50%; box-shadow: none; }

.avatar {
  --c: var(--lagoon); --s: 40px;
  width: var(--s); height: var(--s); flex: none;
  border-radius: 30%; background: var(--c); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: calc(var(--s) * .38); letter-spacing: .02em;
  position: relative; overflow: hidden;
}
.avatar::after { content: ""; position: absolute; inset: auto 0 0 0; height: 28%; background: rgba(255, 255, 255, .16); }
.avatar.system { background: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  background: var(--lagoon); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--lagoon-deep); }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--lagoon-deep); padding: 0 10px; }
.btn.ghost:hover { background: var(--lagoon-tint); }
.btn.bloom { background: var(--bloom); }
.btn.bloom:hover { background: #A3175A; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn[disabled] { opacity: .45; pointer-events: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 6px; margin: 0 -16px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .chips { flex-wrap: wrap; margin: 0 0 14px; padding: 0; } }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-size: 14.5px; font-weight: 600; color: var(--ink-2);
}
.chip:hover { border-color: var(--ink-2); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 7px;
  font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-2);
}
.tag.lagoon { background: var(--lagoon-tint); color: var(--lagoon-deep); border-color: transparent; }
.tag.bloom { background: var(--bloom-tint); color: var(--bloom); border-color: transparent; }
.tag.lemon { background: var(--lemon-tint); color: #7A5A00; border-color: transparent; }
.tag.ink { background: var(--ink); color: #fff; border-color: transparent; }
.tag.cl { --c: var(--lagoon); background: color-mix(in srgb, var(--c) 13%, #fff); color: color-mix(in srgb, var(--c) 80%, #000); border-color: transparent; }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); gap: 2px; }
.seg button { height: 34px; padding: 0 12px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.seg button.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 41, 58, .15); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -16px 16px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .tabs { margin: 0 0 18px; padding: 0; } }
.tabs a, .tabs button { flex: none; padding: 12px 6px 11px; margin-right: 14px; font-weight: 600; font-size: 15px; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs .is-active { color: var(--ink); border-color: var(--lagoon); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .ico { margin: 0 auto 10px; width: 34px; height: 34px; color: var(--lagoon); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

.divider { height: 1px; background: var(--line-2); margin: 14px 0; }
.lock { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13.5px; }

/* ---------- Home: postcard hero ---------- */
.postcard {
  --c: var(--lagoon);
  position: relative; overflow: hidden; border-radius: var(--r-sheet);
  background: color-mix(in srgb, var(--c) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--c) 22%, #fff);
}
.postcard .art { display: block; width: 100%; height: auto; aspect-ratio: 800 / 420; }
@media (min-width: 560px) { .postcard .art { aspect-ratio: 800 / 330; } }
.postcard .copy { position: absolute; left: 20px; top: 18px; right: 20px; }
.postcard .copy small { font-weight: 600; font-size: 14px; color: color-mix(in srgb, var(--c) 70%, #000); }
.postcard h1 { font-family: var(--serif); font-size: clamp(34px, 8vw, 48px); line-height: 1; color: var(--ink); margin-top: 2px; }
.postcard .facts { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 12px 20px 16px; background: #fff; border-top: 1px solid color-mix(in srgb, var(--c) 18%, #fff); font-size: 14px; color: var(--ink-2); }
.postcard .facts span { display: inline-flex; align-items: center; gap: 6px; }
.postcard .facts .ico { color: var(--c); }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 6px; }
.quick a, .quick button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px;
  border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); text-align: center;
}
.quick .ico { color: var(--lagoon); }
.quick a:hover, .quick button:hover { border-color: var(--lagoon); }

.strip { display: flex; gap: 12px; overflow-x: auto; padding: 2px 16px 8px; margin: 0 -16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip > * { scroll-snap-align: start; }
@media (min-width: 768px) { .strip { margin: 0; padding: 2px 0 8px; } }

.mini-event { flex: none; width: 236px; padding: 12px; display: flex; gap: 12px; align-items: flex-start; }
.mini-event .title { font-weight: 600; font-size: 15px; line-height: 1.3; }

/* ---------- Feed ---------- */
.composer { display: flex; align-items: center; gap: 12px; padding: 12px; margin: 18px 0 14px; }
.composer button.fake { flex: 1; text-align: left; height: 44px; padding: 0 16px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.feed > * + * { margin-top: 12px; }
.post { padding: 14px 16px 6px; }
.post-head { display: flex; gap: 12px; align-items: flex-start; }
.post-head .who { flex: 1; min-width: 0; }
.post-head .name { font-weight: 700; font-size: 15.5px; }
.post-head .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-top: 1px; }
.post-body { margin: 10px 0 0; font-size: 16px; line-height: 1.5; white-space: pre-line; }
.post--alert { border-color: color-mix(in srgb, var(--bloom) 35%, #fff); box-shadow: inset 4px 0 0 var(--bloom); }
.post--notice { box-shadow: inset 4px 0 0 var(--lemon); }
.post--result .post-body { font-weight: 600; }
.media { margin: 12px -16px 0; overflow: hidden; }
@media (min-width: 560px) { .media { margin: 12px 0 0; border-radius: 12px; } }
.media .scene { width: 100%; aspect-ratio: 4 / 3; }
.media.grid3 { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; aspect-ratio: 3 / 2; }
.media.grid3 > :first-child { grid-row: span 2; }
.media.grid3 .scene { aspect-ratio: auto; height: 100%; }
.scene { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-actions { display: flex; gap: 4px; margin: 8px -8px 0; padding-top: 4px; border-top: 1px solid var(--line-2); }
.post-actions button {
  display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 10px; border-radius: 10px;
  font-weight: 600; font-size: 14.5px; color: var(--ink-2);
}
.post-actions button:hover { background: var(--surface-2); }
.post-actions .liked { color: var(--bloom); }
.post-actions .liked .ico { fill: var(--bloom); }
.post-actions .push { margin-left: auto; }
.pop { animation: pop .3s ease; }
@keyframes pop { 40% { transform: scale(1.3); } }

.embed { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.embed:hover { border-color: var(--line); }
.embed .thumb { width: 64px; height: 64px; border-radius: 10px; display: grid; place-items: center; font-size: 32px; flex: none; }
.embed b { display: block; font-size: 15px; }

.comments { margin: 4px 0 8px; padding-top: 8px; }
.comment { display: flex; gap: 10px; margin-top: 10px; }
.comment .bubble { background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 8px 12px; font-size: 15px; flex: 1; min-width: 0; }
.comment .bubble b { font-size: 14px; }
.comment .when { font-size: 12.5px; color: var(--muted); margin: 3px 0 0 4px; }
.comment-form { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.input, .comment-form input, textarea.input, select.input {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 16px;
}
.comment-form input { border-radius: 999px; }
.input:focus, .comment-form input:focus { outline: none; border-color: var(--lagoon); box-shadow: 0 0 0 3px var(--lagoon-tint); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.45; }

.poll { margin-top: 12px; }
.poll button {
  position: relative; display: flex; justify-content: space-between; width: 100%; padding: 11px 14px; margin-top: 8px;
  border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 15px; overflow: hidden; text-align: left;
}
.poll button .bar { position: absolute; inset: 0 auto 0 0; background: var(--lagoon-tint); z-index: 0; transition: width .5s ease; }
.poll button > span { position: relative; z-index: 1; }
.poll button.mine { border-color: var(--lagoon); }
.poll .meta { font-size: 13.5px; color: var(--muted); margin-top: 8px; }

.metoo { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; }

/* ---------- Marketplace ---------- */
.mgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .mgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mtile { display: block; overflow: hidden; }
.mtile .ph { position: relative; aspect-ratio: 1; display: grid; place-items: center; font-size: clamp(48px, 13vw, 64px); }
.mtile .price { position: absolute; left: 8px; bottom: 8px; background: #fff; padding: 3px 9px; border-radius: 8px; font-weight: 700; font-size: 14px; box-shadow: 0 1px 4px rgba(16, 41, 58, .12); }
.mtile .price.free { background: var(--lagoon); color: #fff; }
.mtile .price.wanted { background: var(--bloom); color: #fff; }
.mtile .price.lend { background: var(--lemon); color: #4D3A00; }
.mtile .info { padding: 10px 12px 12px; }
.mtile .t { font-weight: 600; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.mtile .m { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.uniform-banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 14px; background: #EEF2FA; border-color: #D3DCEE; }
.uniform-banner .em { font-size: 30px; }
.uniform-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.detail-hero { aspect-ratio: 4 / 3; display: grid; place-items: center; font-size: 120px; border-radius: var(--r-card); }
.price-big { font-family: var(--serif); font-size: 32px; }
.facts-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
.facts-list dt { color: var(--muted); }
.facts-list dd { margin: 0; font-weight: 600; }
.sticky-cta { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); display: flex; gap: 8px; margin-top: 16px; }
@media (min-width: 768px) { .sticky-cta { bottom: 16px; } }

/* ---------- Events ---------- */
.datebox {
  --c: var(--lagoon);
  width: 54px; flex: none; text-align: center; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff;
}
.datebox .mo { background: var(--c); color: #fff; font-size: 11.5px; font-weight: 700; padding: 3px 0; }
.datebox .d { font-family: var(--serif); font-size: 24px; line-height: 1.15; padding-top: 2px; }
.datebox .wd { font-size: 11.5px; color: var(--muted); padding-bottom: 4px; font-weight: 600; }
.event-row { display: flex; gap: 14px; padding: 14px; align-items: flex-start; }
.event-row + .event-row { border-top: 1px solid var(--line-2); }
.event-row .title { font-weight: 700; font-size: 16.5px; line-height: 1.3; }
.event-row .sub { font-size: 14px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.event-row .sub span { display: inline-flex; align-items: center; gap: 5px; }
.rsvp { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.notice-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; }
.notice-row + .notice-row { border-top: 1px solid var(--line-2); }
.notice-row .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--lemon-tint); color: #7A5A00; flex: none; }
.week-label { font-weight: 700; font-size: 14px; color: var(--muted); margin: 22px 0 8px; }
.map-mock { position: relative; border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); }
.map-mock svg { width: 100%; height: auto; }

/* ---------- Sports ---------- */
.sport-hero { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 8px; }
@media (min-width: 560px) { .sport-hero { grid-template-columns: repeat(4, 1fr); } }
.sport-card { padding: 14px; display: block; }
.sport-card .em { font-size: 28px; }
.sport-card b { display: block; margin-top: 8px; font-size: 15.5px; }
.sport-card small { color: var(--muted); font-size: 13.5px; }
.sport-card:hover { border-color: var(--lagoon); }

.ladder { position: relative; padding: 6px 0; }
.ladder::before, .ladder::after { content: ""; position: absolute; top: 0; bottom: 0; width: 4px; background: var(--sand); border-radius: 2px; }
.ladder::before { left: 18px; }
.ladder::after { left: 46px; }
.rung { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 0; min-height: 64px; }
.rung::before { content: ""; position: absolute; left: 18px; width: 32px; top: 50%; height: 4px; margin-top: -2px; background: var(--sand); }
.rung .pos {
  position: relative; z-index: 1; width: 36px; height: 36px; margin-left: 16px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; border: 2px solid var(--line); font-weight: 700; font-size: 14.5px; flex: none;
}
.rung.r1 .pos { background: var(--lemon); border-color: #D9A812; }
.rung.r2 .pos { background: #E4E9EC; border-color: #B7C2C8; }
.rung.r3 .pos { background: #F0D8C0; border-color: #C9A27A; }
.rung .card-in { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.rung.in-range .card-in { background: var(--lemon-tint); border-color: #EBCB66; }
.rung.is-me .card-in { background: var(--lagoon-tint); border-color: var(--lagoon); }
.faces { display: inline-flex; align-items: center; }
.faces .avatar { box-shadow: 0 0 0 2px #fff; }
.faces .avatar + .avatar { margin-left: -7px; }
@media (max-width: 479px) {
  .ladder::before { left: 8px; } .ladder::after { left: 34px; }
  .rung { gap: 8px; padding-right: 0; }
  .rung::before { left: 8px; width: 28px; }
  .rung .pos { margin-left: 4px; width: 34px; height: 34px; font-size: 14px; }
  .rung .card-in { gap: 10px; padding: 8px; }
  .rung .card-in .avatar { --s: 34px !important; }
  .rung .btn .ico { display: none; }
  .rung .card-in b.ellipsis { white-space: normal; }
}
.rung .rec { font-size: 13px; color: var(--muted); }
.range-note { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #7A5A00; background: var(--lemon-tint); padding: 10px 12px; border-radius: 12px; margin: 10px 0; }

.challenge-card { padding: 14px; display: flex; gap: 12px; align-items: center; border-color: var(--lagoon); background: linear-gradient(0deg, #fff, var(--lagoon-tint)); }

table.league { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.league th { text-align: right; font-weight: 600; color: var(--muted); font-size: 13px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
table.league td { text-align: right; padding: 11px 6px; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
table.league th:nth-child(2), table.league td:nth-child(2) { text-align: left; }
table.league td:first-child, table.league th:first-child { text-align: center; width: 30px; color: var(--muted); }
table.league tr.mine td { background: var(--lagoon-tint); font-weight: 700; }
table.league .team { display: flex; align-items: center; gap: 8px; }
table.league .pts { font-weight: 700; }
@media (max-width: 480px) { table.league .hide-s { display: none; } }

.fixture { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 12px 14px; }
.fixture + .fixture { border-top: 1px solid var(--line-2); }
.fixture .h { text-align: right; font-weight: 600; font-size: 14.5px; }
.fixture .a { font-weight: 600; font-size: 14.5px; }
.fixture .mid { text-align: center; font-size: 13px; color: var(--muted); min-width: 64px; }
.fixture .mid b { display: block; color: var(--ink); font-size: 18px; font-family: var(--serif); }

.game-card { padding: 14px; }
.spots { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.spot { width: 30px; height: 30px; border-radius: 30%; border: 2px dashed var(--line); }
.facility { padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.facility + .facility { border-top: 1px solid var(--line-2); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.status-dot.busy { background: var(--bloom); }
.status-dot.some { background: var(--lemon); }
.status-dot.quiet { background: var(--ok); }

/* ---------- Board ---------- */
.thread-row { display: flex; gap: 12px; padding: 14px; align-items: flex-start; }
.thread-row + .thread-row { border-top: 1px solid var(--line-2); }
.thread-row .t { font-weight: 700; font-size: 16px; line-height: 1.3; }
.thread-row .s { font-size: 13.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; }
.thread-row .s span { display: inline-flex; align-items: center; gap: 4px; }
.reply { padding: 14px 0; border-top: 1px solid var(--line-2); }

/* ---------- Photos ---------- */
.albums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .albums { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.album { overflow: hidden; display: block; }
.album .cover { aspect-ratio: 1; position: relative; }
.album .cover .n { position: absolute; right: 8px; bottom: 8px; background: rgba(16, 41, 58, .75); color: #fff; font-size: 12.5px; font-weight: 700; padding: 3px 8px; border-radius: 8px; display: inline-flex; gap: 4px; align-items: center; }
.album .info { padding: 10px 12px 12px; }
.album .info b { display: block; font-size: 15px; line-height: 1.3; }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: 12px; overflow: hidden; }
.pgrid button { position: relative; aspect-ratio: 1; display: block; overflow: hidden; }
.play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.play span { width: 44px; height: 44px; border-radius: 50%; background: rgba(16, 41, 58, .6); display: grid; place-items: center; }
.play .ico { fill: #fff; stroke: none; margin-left: 3px; }
.vid-len { position: absolute; right: 6px; bottom: 6px; font-size: 11.5px; color: #fff; background: rgba(16, 41, 58, .7); padding: 1px 6px; border-radius: 6px; font-weight: 700; }

/* ---------- People ---------- */
.people { display: grid; gap: 12px; }
@media (min-width: 640px) { .people { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.person-card { padding: 14px; display: flex; gap: 12px; align-items: flex-start; }
.person-card .n { font-weight: 700; font-size: 16px; }
.person-card .f { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.person-card .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.match-banner { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--lagoon-tint); border-color: transparent; margin-bottom: 14px; }

.profile-cover { --c: var(--lagoon); height: 120px; border-radius: var(--r-sheet) var(--r-sheet) 0 0; background: var(--c); position: relative; overflow: hidden; }
.profile-cover svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.profile-main { padding: 0 18px 18px; margin-top: -44px; position: relative; }
.profile-main .avatar { border: 4px solid #fff; }
.profile-main h1 { font-family: var(--serif); font-size: 28px; margin-top: 10px; line-height: 1.15; }
.kv { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line-2); }
.kv .ico { color: var(--lagoon); margin-top: 1px; }
.kv .k { font-size: 13.5px; color: var(--muted); }
.kv .v { font-weight: 600; }
.preview-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 14px; background: var(--ink); color: #fff; border-radius: 14px; font-size: 14.5px; }
.preview-bar .seg { background: rgba(255, 255, 255, .1); border-color: transparent; }
.preview-bar .seg button { color: rgba(255, 255, 255, .8); }
.preview-bar .seg button.is-active { background: #fff; color: var(--ink); }

.privacy-row { padding: 14px 0; border-top: 1px solid var(--line-2); }
.privacy-row .lbl { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + span { background: var(--lagoon); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--lagoon); outline-offset: 2px; }

.kid-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.kid-row select, .kid-row input { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }

/* ---------- More / groups / services ---------- */
.more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .more-grid { grid-template-columns: repeat(3, 1fr); } }
.more-grid a { padding: 16px 14px; display: block; }
.more-grid a:hover { border-color: var(--lagoon); }
.more-grid .ico { color: var(--lagoon); width: 26px; height: 26px; }
.more-grid b { display: block; margin-top: 10px; font-size: 15.5px; }
.more-grid small { color: var(--muted); font-size: 13.5px; line-height: 1.35; display: block; margin-top: 2px; }
.list-row { display: flex; gap: 12px; align-items: center; padding: 14px; }
.list-row + .list-row { border-top: 1px solid var(--line-2); }
.list-row .em { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; background: var(--surface-2); flex: none; }

.cluster-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .cluster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cluster-tile { --c: var(--lagoon); overflow: hidden; text-align: left; display: block; width: 100%; }
.cluster-tile .band { height: 74px; background: var(--c); position: relative; }
.cluster-tile .band svg { position: absolute; inset: auto 0 0 0; width: 100%; height: 100%; }
.cluster-tile .info { padding: 10px 12px 12px; }
.cluster-tile b { font-family: var(--serif); font-weight: 400; font-size: 19px; display: block; }
.cluster-tile.is-mine { outline: 3px solid var(--c); outline-offset: -1px; }

/* ---------- Messages ---------- */
.convo-row { display: flex; gap: 12px; align-items: center; padding: 14px; }
.convo-row + .convo-row { border-top: 1px solid var(--line-2); }
.convo-row .last { font-size: 14.5px; color: var(--muted); }
.convo-row.unread .last { color: var(--ink); font-weight: 600; }
.chat { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 16px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 18px; font-size: 15.5px; line-height: 1.4; }
.msg.them { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; align-self: flex-start; }
.msg.me { background: var(--lagoon); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.msg small { display: block; font-size: 11.5px; opacity: .7; margin-top: 3px; }
.chat-form { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); display: flex; gap: 8px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
@media (min-width: 768px) { .chat-form { bottom: 16px; } }
.chat-form input { flex: 1; border: 0; padding: 0 12px; min-width: 0; font-size: 16px; }
.chat-form input:focus { outline: none; }
.chat-form .btn { border-radius: 999px; width: 44px; padding: 0; }

/* ---------- Right rail ---------- */
.rail .card { padding: 16px; }
.rail h3 { font-family: var(--serif); font-size: 18px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline; }
.rail h3 a { font: 600 14px var(--sans); color: var(--lagoon-deep); }
.rail .r-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.rail .r-item + .r-item { border-top: 1px solid var(--line-2); }
.rail .foot { font-size: 12.5px; color: var(--muted); padding: 0 4px; line-height: 1.5; }

/* ---------- Sheets, toast ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(16, 41, 58, .42);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s ease;
}
.sheet {
  width: 100%; max-height: 92vh; overflow-y: auto; background: #fff;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 8px 18px calc(22px + var(--safe-b));
  animation: up .28s cubic-bezier(.2, .8, .2, 1);
}
.sheet:focus { outline: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-head h2 { font-family: var(--serif); font-size: 23px; line-height: 1.2; }
.sheet.wide { padding-left: 0; padding-right: 0; }
.sheet.wide .sheet-head { padding: 0 18px; }
@media (min-width: 768px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; border-radius: var(--r-sheet); padding: 18px 22px 22px; max-height: 86vh; }
  .sheet.photo { max-width: 860px; }
  .sheet .grab { display: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }

.field { margin-bottom: 14px; }
.field label, .field .lbl { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 5px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.create-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.create-grid button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); text-align: left; background: #fff; }
.create-grid button:hover { border-color: var(--lagoon); background: var(--surface-2); }
.create-grid .em { font-size: 26px; }
.create-grid b { font-size: 15.5px; }
.create-grid small { color: var(--muted); font-size: 13px; line-height: 1.35; }

.scope-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 6px; border-radius: 12px; text-align: left; }
.scope-list button:hover { background: var(--surface-2); }
.scope-list button.is-active { background: var(--lagoon-tint); }
.scope-list .door { width: 18px; height: 24px; border-radius: 9px 9px 3px 3px; }
.scope-list .n { font-weight: 700; }
.scope-list small { display: block; color: var(--muted); font-size: 13px; }

.lightbox { position: relative; }
.lightbox .scene { border-radius: 14px; aspect-ratio: 4 / 3; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 15px;
  box-shadow: var(--lift); transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 768px) { .toast { bottom: 28px; } }

.search-results .group-title { font-weight: 700; font-size: 13.5px; color: var(--muted); margin: 16px 0 4px; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 10px 6px; border-radius: 10px; }
.search-results a:hover { background: var(--surface-2); }

.disclaimer { font-size: 12.5px; color: var(--muted); text-align: center; margin: 32px 12px 0; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =========================================================================
   Newer features
   ========================================================================= */
.em-circle { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--lagoon-tint); color: var(--lagoon-deep); }

/* Around the Lagoons strip (home) */
.around { flex: none; width: 168px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.around:hover { border-color: var(--lagoon); }
.around-em { font-size: 24px; margin-bottom: 4px; }
.around b { font-size: 14.5px; line-height: 1.3; }

/* Shout-outs */
.shout { padding: 14px 16px; }
.shout-head { display: flex; align-items: center; gap: 6px; }
.shout-head .grow { margin-left: 6px; }
.shout-arrow { color: var(--muted); }
.shout .tag { margin-top: 10px; }
.shout-text { margin-top: 8px; font-size: 16px; line-height: 1.5; }
.clap { margin-top: 10px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 14.5px; }
.clap:hover { border-color: var(--lemon); }
.clap.on { background: var(--lemon-tint); border-color: #EBCB66; }
.good-n { flex: none; width: 116px; padding: 14px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; position: relative; }
.good-n b { max-width: 100%; }
.good-badge { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--lemon); color: #4D3A00; display: grid; place-items: center; }
.shout-embed { align-items: flex-start; }
.shout-embed b, .shout-embed .small { display: block; }

/* Babysitting */
.credit-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px; background: linear-gradient(180deg, var(--lagoon-tint), #fff); border-color: color-mix(in srgb, var(--lagoon) 30%, #fff); }
.coin { width: 60px; height: 60px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--serif); font-size: 28px; color: #4D3A00; background: var(--lemon); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12), 0 0 0 4px #fff; }
.credit-card .grow { min-width: 180px; }
.credit-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 559px) { .credit-actions { width: 100%; } .credit-actions .btn { flex: 1; } }
.sitter, .skill { padding: 14px 16px; }
.ledger { font-weight: 700; font-variant-numeric: tabular-nums; }
.ledger.plus { color: var(--ok); }
.ledger.minus { color: var(--bloom); }

/* Skills */
.skills-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Villa upgrades */
.upgrade { overflow: hidden; }
.ba { --pos: 50%; position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #eee; touch-action: pan-y; }
.ba-layer { position: absolute; inset: 0; }
.ba-layer .scene { width: 100%; height: 100%; }
.ba-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .3); pointer-events: none; }
.ba-handle::after { content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: 2px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.ba-label { position: absolute; top: 10px; padding: 3px 9px; border-radius: 8px; background: rgba(16, 41, 58, .72); color: #fff; font-size: 12.5px; font-weight: 700; pointer-events: none; }
.ba-label.l { left: 10px; }
.ba-label.r { right: 10px; }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.ba-range:focus-visible + .ba-handle, .ba:focus-within .ba-handle::after { outline: 3px solid var(--lagoon); }
.up-title { font-family: var(--serif); font-size: 21px; line-height: 1.25; margin: 10px 0 6px; }
.up-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 0; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.up-facts div:last-child { grid-column: 1 / -1; }
@media (min-width: 640px) { .up-facts { grid-template-columns: auto auto 1fr; gap: 20px; } .up-facts div:last-child { grid-column: auto; } }
.up-facts dt { font-size: 12.5px; color: var(--muted); }
.up-facts dd { margin: 2px 0 0; font-weight: 600; font-size: 14.5px; }
.up-thumb { width: 72px; height: 54px; border-radius: 8px; overflow: hidden; flex: none; display: block; }
.up-thumb .scene { width: 100%; height: 100%; }
.upgrade .post-actions { margin-top: 12px; }

/* House watch */
.hw-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hw-stats .card { display: flex; gap: 10px; align-items: center; padding: 12px; }
.hw-stats b { display: block; }
@media (max-width: 420px) { .hw-stats .card { flex-direction: column; align-items: flex-start; } }
.hw { padding: 14px 16px; }
.hw-log { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.check-row { gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--lagoon); flex: none; }

/* Festivals */
.fest-hero { --c: var(--lagoon); overflow: hidden; }
.fest-hero-top { display: flex; gap: 14px; align-items: center; padding: 18px; background: color-mix(in srgb, var(--c) 14%, #fff); }
.fest-hero small { font-weight: 700; font-size: 14px; color: color-mix(in srgb, var(--c) 80%, #000); }
.fest-hero h2 { font-family: var(--serif); font-size: 28px; line-height: 1.15; }
.fest-emoji { font-size: 48px; width: 72px; height: 72px; border-radius: 22px; background: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 2px 8px rgba(16, 41, 58, .08); }
.fest-row { display: flex; gap: 14px; align-items: flex-start; width: 100%; padding: 14px; text-align: left; }
.fest-row + .fest-row { border-top: 1px solid var(--line-2); }
.fest-row:hover { background: var(--surface-2); }
.fest-row > .ico { align-self: center; color: var(--muted); }
.fest-name { font-size: 16px; }
.fest-desc { margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Staff appreciation */
.progress { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin-top: 12px; }
.progress span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--lagoon), #2FB3A9); transition: width .5s ease; }
.staff-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .staff-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.staff-card { padding: 14px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.staff-emoji { width: 52px; height: 52px; border-radius: 50%; background: var(--lemon-tint); display: grid; place-items: center; font-size: 26px; margin-bottom: 6px; }

/* Inline icons inside running text (svg is display:block globally) */
:where(p, .small, .tiny, .muted, .k, .sub, .hint) > .ico { display: inline-block; vertical-align: -0.2em; }

/* Page header stacks on phones so long titles and buttons don't squeeze */
@media (max-width: 559px) {
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-head > .btn { align-self: flex-start; }
}

/* Paint the band above the sticky header on phones with a notch */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 25; background: #fff; }
.cal-text { white-space: pre-wrap; font: 14px/1.5 var(--sans); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0; user-select: text; -webkit-user-select: text; }

/* =========================================================================
   APP FEEL — phone-first layer
   Native-style app bar, tab bar, transitions, sheets and touch feedback.
   ========================================================================= */
html { -webkit-tap-highlight-color: transparent; touch-action: manipulation; overscroll-behavior-y: none; }
.appbar, .tabbar, .bottom-bar, .chip, .btn, .shortcuts, .ab-pill { -webkit-user-select: none; user-select: none; }
.deskbar { display: none; }
.ptr { display: none; }

/* Pressed states for touch (no hover on phones) */
@media (hover: none) {
  .btn:active, .chip:active, .ab-pill:active, .shortcuts button:active .sc-ic, .shortcuts a:active .sc-ic { transform: scale(.95); }
  a.card:active, button.card:active, .list-row:is(a, button):active, .gl-row:active, .thread-row:active, .convo-row:active, .fest-row:active, .scope-list button:active, .create-grid button:active { background: var(--surface-2); }
  .ab-icon:active, .ab-back:active, .icon-btn:active { background: var(--line-2); }
  .post-actions button:active { background: var(--line-2); }
}
.btn, .chip, .ab-pill, .sc-ic { transition: transform .12s ease, background .15s ease; }

@media (max-width: 767px) {
  :root { --topbar-h: 56px; }

  /* ---- App bar ---- */
  .topbar { padding: 0 max(6px, env(safe-area-inset-right, 0px)) 0 max(6px, env(safe-area-inset-left, 0px)); gap: 0; background: rgba(255, 255, 255, .96); }
  .appbar { display: flex; align-items: center; justify-content: space-between; gap: 4px; width: 100%; height: 100%; }
  .ab-left { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
  .ab-right { display: flex; align-items: center; gap: 0; flex: none; }
  .ab-back { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--ink); }
  .ab-back .ico { width: 28px; height: 28px; stroke-width: 2.2; }
  .ab-title { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 0 4px; text-align: left; line-height: 1.2; border-radius: 10px; }
  .ab-title b { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ab-title.root { padding-left: 10px; }
  .ab-title.root b { font-family: var(--serif); font-weight: 400; font-size: 23px; letter-spacing: -.01em; }
  .ab-title small { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
  .ab-title small .door.round { width: 8px; height: 8px; }
  .ab-title.chat { flex-direction: row; align-items: center; gap: 10px; }
  .ab-title.chat > span { display: flex; flex-direction: column; min-width: 0; }
  .ab-scope { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 6px; border-radius: 12px; font-family: var(--serif); font-size: 23px; letter-spacing: -.01em; min-width: 0; }
  .ab-scope span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ab-scope .ico { color: var(--muted); }
  .ab-icon { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); }
  .ab-icon .dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--bloom); box-shadow: 0 0 0 2px #fff; }
  .ab-icon.on { color: var(--lagoon-deep); }
  .ab-icon.on .ico { fill: currentColor; }
  .ab-pill { display: inline-flex; align-items: center; gap: 4px; height: 34px; margin: 0 6px 0 4px; padding: 0 13px 0 10px; border-radius: 999px; background: var(--lagoon); color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; }
  .ab-pill .ico { stroke-width: 2.6; }

  /* ---- Content area ---- */
  .view { max-width: none; padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(var(--tabbar-h) + var(--safe-b) + 24px) max(16px, env(safe-area-inset-left, 0px)); }
  .page-head, .back { display: none; }
  .section-head { margin: 26px 0 10px; }
  .section-head h2 { font-size: 20px; }
  .input, .comment-form input, select.input { min-height: 48px; }

  /* ---- Tab bar ---- */
  .tabbar { height: calc(64px + var(--safe-b)); background: rgba(255, 255, 255, .97); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .tabbar a { gap: 2px; font-size: 11.5px; letter-spacing: .01em; }
  .tab-ic { width: 54px; height: 30px; border-radius: 15px; display: grid; place-items: center; transition: background .2s ease; }
  .tabbar a.is-active .tab-ic { background: var(--lagoon-tint); }
  .fab { width: 52px; height: 52px; margin-top: -18px; border-radius: 18px; }

  /* ---- Bottom action bar (detail screens hide the tab bar) ---- */
  .has-bottombar .tabbar { display: none; }
  .has-bottombar .view { padding-bottom: calc(84px + var(--safe-b)); }
  .has-bottombar .toast { bottom: calc(84px + var(--safe-b)); }

  /* ---- Screen transitions ---- */
  .view.nav-fwd { animation: navFwd .28s cubic-bezier(.2, .8, .2, 1); }
  .view.nav-back { animation: navBack .28s cubic-bezier(.2, .8, .2, 1); }
  .view.nav-tab { animation: navTab .2s ease; }

  /* ---- Pull to refresh ---- */
  .ptr { display: grid; place-items: center; position: fixed; left: 50%; z-index: 19; top: calc(env(safe-area-inset-top, 0px) + var(--topbar-h) - 44px); width: 40px; height: 40px; margin-left: -20px; border-radius: 50%; background: #fff; color: var(--muted); box-shadow: 0 4px 14px rgba(16, 41, 58, .18); opacity: 0; transform: translateY(var(--pull, 0px)) rotate(var(--rot, 0deg)); transition: opacity .15s ease; pointer-events: none; }
  .ptr.show { opacity: 1; }
  .ptr.ready { color: var(--lagoon); }
  .ptr.spin .ico { animation: spin .8s linear infinite; }
}
@keyframes navFwd { from { transform: translateX(26%); opacity: 0; } }
@keyframes navBack { from { transform: translateX(-16%); opacity: 0; } }
@keyframes navTab { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 768px) {
  .appbar { display: none; }
  .deskbar { display: flex; align-items: center; gap: 4px; width: 100%; height: 100%; }
}

/* Bottom action bar */
.bottom-bar { display: flex; align-items: center; gap: 10px; }
.bottom-bar .btn { height: 48px; border-radius: 14px; font-size: 16px; flex: 1; }
.bottom-bar .btn.icon-only { flex: none; width: 48px; padding: 0; }
.bottom-bar.composer { gap: 8px; }
.bottom-bar.composer input { flex: 1; min-width: 0; height: 46px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 16px; font-size: 16px; }
.bottom-bar.composer input:focus { outline: none; border-color: var(--lagoon); background: #fff; }
.bottom-bar.composer .btn { flex: none; width: 46px; height: 46px; padding: 0; border-radius: 50%; }
@media (max-width: 767px) {
  .bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + var(--safe-b)) max(16px, env(safe-area-inset-left, 0px)); background: rgba(255, 255, 255, .97); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
}
@media (min-width: 768px) {
  .bottom-bar { position: sticky; bottom: 16px; z-index: 5; margin-top: 16px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--lift); }
}

/* Sheets: fixed header, scrolling body, pinned action */
.sheet { display: flex; flex-direction: column; padding: 0; overflow: hidden; max-height: 92vh; max-height: 92dvh; transition: transform .2s ease; }
.sheet-top { flex: none; padding: 6px 18px 0; touch-action: none; }
.sheet .grab { margin: 4px auto 8px; }
.sheet-head { margin-bottom: 10px; }
.sheet-head h2 { min-width: 0; }
.sheet-head .close { flex: none; background: var(--surface-2); border-radius: 50%; width: 36px; height: 36px; }
.sheet-head .close .ico { width: 18px; height: 18px; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 18px calc(20px + var(--safe-b)); }
.sheet-foot { flex: none; padding: 12px 18px calc(12px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line-2); }
.sheet-body:has(+ .sheet-foot:not([hidden])) { padding-bottom: 16px; }
.sheet-foot .btn { width: 100%; height: 50px; border-radius: 14px; font-size: 16px; }
.sheet.wide .sheet-body { padding-left: 0; padding-right: 0; }
@media (min-width: 768px) {
  .sheet { padding: 0; max-height: 86vh; }
  .sheet-top { padding: 18px 22px 0; }
  .sheet-body { padding: 2px 22px 22px; }
  .sheet-foot { padding: 14px 22px 18px; }
}
.sheet-open { overflow: hidden; }

/* Snackbar-style toast */
.toast { display: flex; align-items: center; gap: 10px; text-align: left; border-radius: 14px; padding: 12px 16px; }
.toast .ico { color: #7FE0D6; flex: none; }

/* ---------- Screen components (all sizes, tuned for phones) ---------- */
.desk-only { display: none !important; }
@media (min-width: 768px) { .desk-only { display: inline-flex !important; } .chat-person { display: flex; } }

/* Home: shortcuts row */
.shortcuts { display: flex; gap: 2px; overflow-x: auto; margin: 16px -16px 2px; padding: 2px 10px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.shortcuts::-webkit-scrollbar { display: none; }
.shortcuts > * { flex: none; width: 78px; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 2px 0; font-size: 12.5px; font-weight: 600; line-height: 1.2; color: var(--ink-2); text-align: center; scroll-snap-align: start; }
.sc-ic { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--c); }
.sc-ic .ico { width: 24px; height: 24px; }
@media (min-width: 768px) { .shortcuts { margin: 18px 0 4px; padding: 0; justify-content: space-between; overflow: visible; } }
@media (hover: hover) { .shortcuts > *:hover .sc-ic { background: color-mix(in srgb, var(--c) 22%, #fff); } }

/* Home: compact hero on phones */
.postcard .facts a { display: inline-flex; align-items: center; gap: 6px; }
.postcard .facts .ico { color: var(--c); }
@media (max-width: 767px) {
  .postcard { border-radius: 20px; }
  .postcard .art { aspect-ratio: 800 / 330; }
  .postcard .copy { left: 16px; top: 14px; right: 16px; }
  .postcard .copy { right: auto; max-width: 52%; }
  .postcard .copy small { display: none; }
  .postcard h1 { font-size: 23px; line-height: 1.15; }
  .postcard .palm-l { display: none; }
  .postcard .facts { padding: 10px 16px 12px; gap: 6px 16px; font-size: 13.5px; }
}

/* Sticky filter rows and tabs under the app bar */
.chips.sticky { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--topbar-h)); z-index: 15; background: var(--bg); padding-top: 8px; padding-bottom: 8px; margin-bottom: 8px; }
@media (min-width: 768px) { .chips.sticky { margin-left: -4px; margin-right: -4px; padding-left: 4px; padding-right: 4px; } }
@media (max-width: 767px) {
  .tabs { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--topbar-h)); z-index: 15; background: var(--bg); margin-top: -12px; }
  .tabs a, .tabs button { padding: 14px 4px 12px; }
}
.chip.picker { gap: 6px; }
.chip.picker .ico:last-child { margin-right: -4px; }
.chip-sep { flex: none; width: 1px; align-self: stretch; margin: 6px 2px; background: var(--line); }

/* Search bar */
.searchbar { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; margin-bottom: 4px; border-radius: 14px; background: #fff; border: 1px solid var(--line); color: var(--muted); }
.searchbar input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font-size: 16px; color: var(--ink); }
.searchbar input:focus { outline: none; }
.searchbar:focus-within { border-color: var(--lagoon); box-shadow: 0 0 0 3px var(--lagoon-tint); }
.sheet.tall { min-height: 70vh; min-height: 70dvh; }

/* Feed: full-bleed posts on phones, like a native feed */
.post-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.post-actions button { justify-content: center; }
.post-actions .push { margin-left: 0; }
@media (max-width: 559px) {
  .feed { margin: 0 -16px; }
  .feed > * + * { margin-top: 8px; }
  .feed > .card { border-radius: 0; border-left: 0; border-right: 0; }
  .feed .post { padding: 14px 16px 4px; }
  .feed > .empty { margin: 0 16px; border-radius: var(--r-card); border: 1px solid var(--line); }
  .composer { margin: 0 0 10px; }
}

/* Marketplace tiles: photo first, no box */
.mtile { background: none; border: 0; border-radius: 0; overflow: visible; }
.mtile .ph { border-radius: 14px; overflow: hidden; }
.mtile .info { padding: 8px 2px 0; }
.mgrid { row-gap: 18px; }
.uniform-banner { margin-top: 12px; }
.detail-main { margin-top: 12px; }
@media (max-width: 767px) {
  .detail-hero { margin: -12px -16px 0; border-radius: 0; font-size: 104px; aspect-ratio: 4 / 3; }
  .detail-main { margin-top: -18px; position: relative; border-radius: 20px 20px var(--r-card) var(--r-card); }
}
.bb-price { flex: none; display: flex; flex-direction: column; line-height: 1.15; padding-right: 6px; }
.bb-price small { font-size: 12px; color: var(--muted); font-weight: 600; }
.bb-price b { font-family: var(--serif); font-weight: 400; font-size: 21px; }
@media (min-width: 768px) { .bb-price { display: none; } }

/* Events */
.event-hero { padding: 18px; display: flex; gap: 16px; align-items: center; }
.rsvp-tag { flex: none; }
@media (max-width: 767px) {
  .event-row { position: relative; }
  .event-row .title::after { content: ""; position: absolute; inset: 0; }
  .event-row .rsvp { display: none; }
  .event-row:active { background: var(--surface-2); }
  .chat-person { display: none; }
}

/* More: grouped list, like a settings screen */
.me-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.me-card b { font-size: 17px; }
.gl-title { font: 600 13.5px var(--sans); color: var(--muted); margin: 22px 4px 8px; }
.gl { overflow: hidden; }
.gl-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 10px 14px; text-align: left; color: var(--ink); }
.gl-row + .gl-row { border-top: 1px solid var(--line-2); }
.gl-row > .ico { color: var(--muted); }
.gl-row b { display: block; font-size: 15.5px; font-weight: 600; }
.gl-row small { display: block; font-size: 13.5px; color: var(--muted); margin-top: 1px; }
.gl-ic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--c); color: #fff; }
.gl-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--bloom); color: #fff; font-size: 12.5px; font-weight: 700; display: grid; place-items: center; }
@media (hover: hover) { .gl-row:hover { background: var(--surface-2); } }

/* Create sheet: icon grid */
.create-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 6px; padding: 6px 0 4px; }
.create-grid button { align-items: center; gap: 8px; padding: 4px 0; border: 0; background: none; border-radius: 14px; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.2; color: var(--ink-2); }
.create-grid button:hover { background: none; }
.create-grid button:hover .sc-ic { background: color-mix(in srgb, var(--c) 22%, #fff); }

/* Profile: preview control */
.preview-bar { background: #fff; color: var(--ink); border: 1px solid var(--line); padding: 10px 12px 12px; flex-direction: column; align-items: stretch; gap: 8px; }
.preview-bar .pv-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.preview-bar .seg { background: var(--surface-2); border-color: var(--line); }
.preview-bar .seg button { color: var(--ink-2); font-size: 13.5px; padding: 0 8px; }
.preview-bar .seg button.is-active { background: #fff; color: var(--ink); }
@media (max-width: 767px) {
  .profile-main h1 { font-size: 26px; }
  .profile-cover { height: 96px; }
}

h1, h2, h3, .ab-title b, .mtile .t { text-wrap: balance; }

/* Ladder: your position */
.ladder-me { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 12px; }
.ladder-me > .ico { color: var(--lagoon); }
.lm-rank { width: 64px; height: 64px; flex: none; border-radius: 18px; background: var(--lagoon); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.lm-rank b { font-family: var(--serif); font-weight: 400; font-size: 26px; }
.lm-rank small { font-size: 12px; opacity: .85; margin-top: 3px; }
/* Keep slide-in transitions from widening the page */
.app { overflow-x: clip; }
/* Hero greeting stays in the sky, clear of the houses */
.postcard .palm-l { display: none; }
@media (min-width: 768px) {
  .postcard .copy { right: auto; max-width: 40%; }
  .postcard h1 { font-size: clamp(30px, 3.6vw, 38px); line-height: 1.08; }
}
.postcard h1 { text-wrap: wrap; }
@media (max-width: 767px) {
  .postcard { display: flex; flex-direction: column; }
  .postcard .copy { position: static; order: -1; max-width: none; padding: 14px 16px 0; }
  .postcard h1 { font-size: 25px; }
  .postcard .art { aspect-ratio: 800 / 300; }
}
@media (max-width: 767px) {
  .postcard .copy { background: linear-gradient(color-mix(in srgb, var(--c) 10%, #fff), color-mix(in srgb, var(--c) 19%, #fff)); padding-bottom: 6px; }
}
