/* Layout: kasavu-bordered festival band hero, then calm single-column sections on a mundu-white ground */
:root {
  --bg: #fbfaf6;
  --surface: #ffffff;
  --fg: #2a1a17;
  --muted: #6f5e58;
  --line: #e7dfd2;
  --maroon: #8b1a1a;
  --maroon-ink: #ffffff;
  --gold: #b8892b;
  --leaf: #2f6b3a;
  --hero-bg: #8b1a1a;
  --hero-fg: #fff7ea;
  --leaf-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cg fill='none' stroke='%232f6b3a' stroke-opacity='.07' stroke-width='2'%3E%3Cpath d='M20 200 Q60 120 140 90'/%3E%3Cpath d='M50 160 l-18 -6 M64 140 l-18 -8 M80 122 l-16 -10 M98 108 l-14 -12 M116 98 l-10 -14 M50 160 l6 -18 M64 140 l8 -18 M80 122 l10 -16 M98 108 l12 -14 M116 98 l14 -10'/%3E%3C/g%3E%3Ccircle cx='180' cy='40' r='3' fill='%23b8892b' fill-opacity='.18'/%3E%3Ccircle cx='190' cy='180' r='2' fill='%23b8892b' fill-opacity='.18'/%3E%3C/svg%3E");
  --font-display: "Marcellus", "Palatino Linotype", Georgia, serif;
  --font-body: "Manrope", "Noto Sans Malayalam", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ml: "Noto Sans Malayalam", "Manrope", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1312; --surface: #241b19; --fg: #f3eae2; --muted: #b6a69d; --line: #3a2d2a;
    --maroon: #e0716b; --maroon-ink: #1a1312; --gold: #d9ae5a; --leaf: #7dbb88;
    --hero-bg: #4a0f0f; --hero-fg: #fff3e2; --leaf-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cg fill='none' stroke='%237dbb88' stroke-opacity='.09' stroke-width='2'%3E%3Cpath d='M20 200 Q60 120 140 90'/%3E%3Cpath d='M50 160 l-18 -6 M64 140 l-18 -8 M80 122 l-16 -10 M98 108 l-14 -12 M116 98 l-10 -14 M50 160 l6 -18 M64 140 l8 -18 M80 122 l10 -16 M98 108 l12 -14 M116 98 l14 -10'/%3E%3C/g%3E%3Ccircle cx='180' cy='40' r='3' fill='%23b8892b' fill-opacity='.18'/%3E%3Ccircle cx='190' cy='180' r='2' fill='%23b8892b' fill-opacity='.18'/%3E%3C/svg%3E"); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1312; --surface: #241b19; --fg: #f3eae2; --muted: #b6a69d; --line: #3a2d2a;
  --maroon: #e0716b; --maroon-ink: #1a1312; --gold: #d9ae5a; --leaf: #7dbb88;
  --hero-bg: #4a0f0f; --hero-fg: #fff3e2; --leaf-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cg fill='none' stroke='%237dbb88' stroke-opacity='.09' stroke-width='2'%3E%3Cpath d='M20 200 Q60 120 140 90'/%3E%3Cpath d='M50 160 l-18 -6 M64 140 l-18 -8 M80 122 l-16 -10 M98 108 l-14 -12 M116 98 l-10 -14 M50 160 l6 -18 M64 140 l8 -18 M80 122 l10 -16 M98 108 l12 -14 M116 98 l14 -10'/%3E%3C/g%3E%3Ccircle cx='180' cy='40' r='3' fill='%23b8892b' fill-opacity='.18'/%3E%3Ccircle cx='190' cy='180' r='2' fill='%23b8892b' fill-opacity='.18'/%3E%3C/svg%3E"); color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 16px; line-height: 1.6; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.15; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; }
a { color: var(--maroon); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.ml { font-family: var(--font-ml); }
.eyebrow { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }

/* Header */
header.site { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; background: var(--maroon); color: var(--maroon-ink); display: grid; place-items: center; font-family: var(--font-display); font-size: 1.2rem; box-shadow: inset 0 0 0 3px var(--gold); }
.brand b { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; letter-spacing: .02em; }
nav.main { display: flex; gap: 22px; flex-wrap: wrap; }
nav.main a { color: var(--fg); text-decoration: none; font-weight: 600; font-size: .95rem; }
nav.main a:hover { color: var(--maroon); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--fg); border-radius: 8px; padding: 6px 12px; font: inherit; font-weight: 600; cursor: pointer; }
@media (max-width: 760px) {
  .menu-btn { display: block; }
  nav.main { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; gap: 0; padding: 8px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); }
  nav.main.open { display: flex; }
  nav.main a { padding-block: 10px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 2px solid transparent; }
.btn-primary { background: var(--gold); color: #2a1a17; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { border-color: currentColor; color: inherit; background: transparent; }

/* Hero: illustrated tharavadu at golden hour, kasavu border below */
.hero { background: var(--hero-bg); color: var(--hero-fg); position: relative; overflow: hidden; }
.hero-art { position: absolute; top: 0; right: 0; bottom: 0; width: 60%; height: 100%; object-fit: cover; object-position: 45% 55%; display: block; max-width: 100%; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, var(--hero-bg) 40%, transparent 56%); }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; z-index: 2;
  background: linear-gradient(var(--gold), var(--gold)) 0 3px / 100% 5px no-repeat, linear-gradient(var(--gold), var(--gold)) 0 11px / 100% 2px no-repeat, var(--hero-bg); }
.hero .wrap { position: relative; z-index: 2; padding-block: 96px 120px; min-height: 560px; display: flex; flex-direction: column; justify-content: center; }
.hero .copy { max-width: min(480px, 40vw); }
@media (max-width: 760px) { .hero .copy { max-width: none; } }
.hero h1 { font-size: clamp(2.6rem, 6.5vw, 4.8rem); text-shadow: 0 2px 18px rgba(0,0,0,.25); }
.hero .ml-line { font-size: 1.2rem; color: #f2c46a; margin-top: 10px; }
.hero .eyebrow { color: #f2c46a; }
.hero p.lede { margin-top: 18px; font-size: 1.08rem; opacity: .95; }
.hero .today { font-size: .95rem; line-height: 1.6; margin: 0 0 18px; padding: 8px 14px; border-left: 3px solid #f2c46a; background: rgba(0,0,0,.18); border-radius: 0 8px 8px 0; display: inline-block; font-variant-numeric: tabular-nums; }
.hero .today .clocks { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 16px; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.18); font-size: .85rem; }
.hero .today .clocks span { display: grid; }
.hero .today .clocks small { opacity: .7; font-size: .75rem; }
@media (max-width: 460px) { .hero .today .clocks { grid-template-columns: repeat(2, auto); } }
.hero .today .sep { margin: 0 8px; opacity: .6; }
.hero .today #today-kollam { color: #f2c46a; font-weight: 600; }
.hero .h1-ml { font-family: var(--font-ml); font-size: .45em; font-weight: 600; color: #f2c46a; vertical-align: middle; white-space: nowrap; }
.hero p.lede-ml { margin-top: 10px; font-size: 1rem; line-height: 1.75; opacity: .9; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
@media (max-width: 760px) {
  .hero-art { position: relative; width: 100%; height: 280px; }
  .hero::before { background: linear-gradient(180deg, transparent 0, transparent 220px, var(--hero-bg) 280px); }
  .hero .wrap { min-height: 0; padding-block: 8px 56px; }
}
/* Next gathering band */
.gather { background: var(--surface); border-bottom: 1px solid var(--line); }
.gather .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; padding-block: 22px; }
.gather .what { min-width: 0; flex: 1 1 260px; }
.gather h3 { font-size: 1.5rem; margin-top: 2px; }
.gather .meta { color: var(--muted); font-size: .95rem; }
.countdown { display: flex; gap: 10px; }
.countdown div { min-width: 68px; text-align: center; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; }
.countdown b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; color: var(--maroon); font-variant-numeric: tabular-nums; }
.countdown span { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
/* Kerala motifs in the background */
.alt { background-image: var(--leaf-pattern); background-size: 220px 220px; }
.skyline { display: block; width: 100%; height: 120px; margin-bottom: -1px; }

/* Install banner */
.install { border-bottom: 1px solid var(--line); background: var(--surface); }
.install .wrap { display: flex; align-items: center; gap: 14px; padding-block: 12px; flex-wrap: wrap; }
.install p { flex: 1; min-width: 200px; font-size: .95rem; }
.install p b { display: block; }
.install .btn { padding: 8px 16px; background: var(--maroon); color: var(--maroon-ink); }
.install .close { background: none; border: 0; font-size: 1.4rem; color: var(--muted); cursor: pointer; line-height: 1; }

/* Sections */
section.block .wrap { padding-block: 72px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head p { color: var(--muted); max-width: 36em; margin-top: 8px; }
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; }
.about-grid > div { min-width: 0; }
.about-grid p + p { margin-top: 14px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 2px solid var(--maroon); }
.facts div { padding: 18px 12px 0 0; }
.facts b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 2.2rem; color: var(--maroon); font-variant-numeric: tabular-nums; }
.facts span { color: var(--muted); font-size: .9rem; }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; gap: 28px; } }

/* Events */
.events { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.events li { display: grid; grid-template-columns: 92px 1fr auto; gap: 20px; align-items: center; padding-block: 20px; border-bottom: 1px solid var(--line); }
.date { text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; background: var(--surface); }
.date b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.8rem; line-height: 1; color: var(--maroon); }
.date span { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.events .info { min-width: 0; }
.events .info p { color: var(--muted); font-size: .95rem; margin-top: 4px; }
.events .ml { font-size: .85rem; color: var(--gold); }
.tag { font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--leaf); color: var(--leaf); white-space: nowrap; }
@media (max-width: 560px) { .events li { grid-template-columns: 72px 1fr; } .events .tag { grid-column: 2; justify-self: start; } }

/* News */
.alt { background: var(--surface); border-block: 1px solid var(--line); }
.news { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.news article { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.news time { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.news p { color: var(--muted); font-size: .95rem; }
.news a.more { font-weight: 700; text-decoration: none; margin-top: auto; }
@media (max-width: 860px) { .news { grid-template-columns: 1fr; } }

/* Family wall */
.wall { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.wall > * { min-width: 0; }
.wall-feed { display: grid; gap: 16px; }
.wall-compose { display: grid; gap: 12px; }
.wall-compose textarea { font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg); width: 100%; min-height: 72px; resize: vertical; }
.wall-compose .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.wall-compose .row label { display: grid; gap: 4px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.wall-compose select, .wall-compose input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
.kind { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; border: 1px solid currentColor; margin-left: auto; white-space: nowrap; }
.kind-birthday { color: var(--gold); }
.kind-wedding { color: var(--maroon); }
.kind-announcement { color: var(--leaf); }
.kind-general { color: var(--muted); }
.invite { border: 1px solid var(--gold); outline: 3px double var(--gold); outline-offset: -8px; border-radius: 10px; padding: 26px 20px; text-align: center; display: grid; gap: 6px; }
.invite .eyebrow { color: var(--gold); }
.invite h4 { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; margin: 0; }
.invite p { color: var(--muted); }
.bday { border-radius: 10px; padding: 18px; display: flex; gap: 14px; align-items: center; background: radial-gradient(circle at 90% 20%, rgba(184,137,43,.25), transparent 50%), var(--bg); border: 1px dashed var(--gold); }
.bday b.big { font-family: var(--font-display); font-weight: 400; font-size: 2.4rem; color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums; }
.upcoming { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.upcoming li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; }
.upcoming .date { padding: 4px; }
.upcoming .date b { font-size: 1.3rem; }
.upcoming small { display: block; color: var(--muted); }
.signin-hint { color: var(--muted); font-size: .95rem; }
@media (max-width: 860px) { .wall { grid-template-columns: 1fr; } }

/* Chat */
.chat { display: grid; grid-template-columns: 280px 1fr; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); height: 560px; max-height: 80vh; }
.chat > * { min-width: 0; min-height: 0; }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; }
.chat-list .label { padding: 14px 14px 6px; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.convo { display: flex; gap: 10px; align-items: center; text-align: left; font: inherit; color: var(--fg); background: none; border: 0; padding: 10px 14px; cursor: pointer; width: 100%; }
.convo:hover { background: var(--bg); }
.convo[aria-current="true"] { background: var(--bg); box-shadow: inset 3px 0 0 var(--maroon); }
.convo .avatar { width: 40px; height: 40px; font-size: .9rem; flex: none; }
.convo > div { min-width: 0; }
.convo small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pane { display: flex; flex-direction: column; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-head .avatar { width: 36px; height: 36px; font-size: .85rem; }
.chat-head small { display: block; color: var(--muted); }
.chat-back { display: none; font: inherit; font-weight: 700; background: none; border: 0; color: var(--fg); cursor: pointer; padding: 0 6px 0 0; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.msg { max-width: 75%; display: grid; gap: 2px; }
.msg .bubble { padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
.msg small { color: var(--muted); font-size: .72rem; padding-inline: 6px; }
.msg.mine { align-self: flex-end; }
.msg.mine .bubble { background: var(--maroon); color: var(--maroon-ink); border-color: var(--maroon); border-radius: 16px 16px 4px 16px; }
.msg.mine small { text-align: right; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; font: inherit; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.chat-form .btn { padding: 8px 18px; }
.chat-hint { padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); }
@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; }
  .chat.in-convo .chat-list { display: none; }
  .chat:not(.in-convo) .chat-pane { display: none; }
  .chat-back { display: inline; }
}

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 160px; gap: 12px; }
.tile { border-radius: 10px; position: relative; overflow: hidden; display: flex; align-items: end; padding: 12px; color: #fff; font-weight: 700; font-size: .9rem; }
.tile span { position: relative; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.tile.big { grid-column: span 2; grid-row: span 2; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile small { position: relative; display: block; font-weight: 600; opacity: .9; font-size: .75rem; }
.tile::before { content: ""; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.45)); }
.t1 { background: radial-gradient(circle at 30% 30%, #f2b33d 0 18%, transparent 19%), radial-gradient(circle at 70% 60%, #e2562c 0 22%, transparent 23%), radial-gradient(circle at 45% 75%, #f7d36a 0 12%, transparent 13%), #7a1616; }
.t2 { background: repeating-linear-gradient(135deg, #2f6b3a 0 14px, #3f8a4c 14px 28px); }
.t3 { background: linear-gradient(160deg, #1e4c6b, #0f2a3d); }
.t4 { background: radial-gradient(circle at 50% 120%, #f2b33d, #8b1a1a 70%); }
.t5 { background: repeating-radial-gradient(circle at 50% 50%, #b8892b 0 6px, #8b1a1a 6px 14px); }
.t6 { background: linear-gradient(120deg, #4a3a8c, #b8892b); }
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 130px; } }

/* Family directory */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar input { flex: 1; min-width: 200px; font: inherit; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--fg); }
.chip { font: inherit; font-size: .85rem; font-weight: 700; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--maroon); border-color: var(--maroon); color: var(--maroon-ink); }
.gen-label { margin: 28px 0 12px; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.person { text-align: left; font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; cursor: pointer; }
.person:hover { border-color: var(--gold); }
.person > div { min-width: 0; }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.2rem; color: #fff; box-shadow: inset 0 0 0 2px var(--gold); }
.person b { display: block; }
.person small { color: var(--muted); display: block; }
.empty { color: var(--muted); }
/* Facebook-style profile page */
.profile-page { position: fixed; inset: 0; z-index: 20; background: var(--bg); overflow-y: auto; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.pp-bar { position: sticky; top: 0; z-index: 2; background: var(--bg); border-bottom: 1px solid var(--line); }
.pp-bar .wrap { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.pp-bar button { font: inherit; font-weight: 700; background: none; border: 1px solid var(--line); color: var(--fg); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.pp-cover { height: clamp(140px, 26vw, 260px); border-radius: 0 0 14px 14px; position: relative; }
.pp-head { display: flex; align-items: end; gap: 18px; flex-wrap: wrap; margin-top: -56px; padding-inline: 8px; position: relative; }
.pp-head .avatar { width: 136px; height: 136px; font-size: 2.8rem; box-shadow: 0 0 0 5px var(--bg), inset 0 0 0 3px var(--gold); flex: none; }
.pp-head > div { min-width: 0; padding-bottom: 8px; }
.pp-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.pp-head p { color: var(--muted); }
.pp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 18px; overflow-x: auto; }
.pp-tabs button { font: inherit; font-weight: 700; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); padding: 12px 14px; cursor: pointer; white-space: nowrap; }
.pp-tabs button[aria-selected="true"] { color: var(--maroon); border-bottom-color: var(--maroon); }
.pp-body { display: grid; grid-template-columns: 300px 1fr; gap: 20px; padding-block: 20px 48px; align-items: start; }
.pp-body > * { min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: grid; gap: 12px; }
.panel h3 { font-size: 1.15rem; }
.panel dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: .95rem; }
.panel dt { color: var(--muted); }
.panel dd { margin: 0; }
.rel { display: grid; gap: 8px; }
.rel-item { display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; color: var(--fg); background: none; border: 0; padding: 4px; border-radius: 8px; cursor: pointer; }
.rel-item:hover { background: var(--bg); }
.rel-item .avatar { width: 38px; height: 38px; font-size: .9rem; flex: none; }
.rel-item small { display: block; color: var(--muted); }
.feed { display: grid; gap: 16px; }
.post-head { display: flex; gap: 10px; align-items: center; }
.post-head .avatar { width: 40px; height: 40px; font-size: .9rem; flex: none; }
.post-head small { display: block; color: var(--muted); }
.post-img { height: 220px; border-radius: 10px; }
.post-foot { display: flex; gap: 18px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); padding-top: 10px; }
.post-foot button { font: inherit; font-weight: 700; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
.post-foot button[aria-pressed="true"] { color: var(--maroon); }
.composer { display: flex; gap: 10px; align-items: center; }
.composer input { flex: 1; min-width: 0; font: inherit; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos div { aspect-ratio: 1; border-radius: 8px; max-width: 100%; }
@media (max-width: 760px) { .pp-body { grid-template-columns: 1fr; } .pp-head .avatar { width: 108px; height: 108px; font-size: 2.2rem; } }
body.viewing { overflow: hidden; }
.join-wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; }
.join-wrap > div { min-width: 0; }
.steps { margin: 18px 0 0; padding-left: 1.2em; display: grid; gap: 8px; color: var(--muted); }
form.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: grid; gap: 14px; }
form label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
form input, form select, form textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn-solid { background: var(--maroon); color: var(--maroon-ink); justify-self: start; }
.you { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--maroon-ink); background: var(--maroon); border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: middle; }
.add-row { display: flex; flex-wrap: wrap; gap: 8px; }
.note { font-size: .9rem; color: var(--leaf); font-weight: 600; }
@media (max-width: 760px) { .join-wrap { grid-template-columns: 1fr; } .row2 { grid-template-columns: 1fr; } }

/* Footer */
footer.site { background: var(--hero-bg); color: var(--hero-fg); }
footer.site .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-block: 48px 32px; }
footer.site h3 { font-size: 1.1rem; margin-bottom: 10px; }
footer.site a { color: var(--hero-fg); opacity: .85; }
footer.site ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
footer.site .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.18); padding-top: 16px; font-size: .85rem; opacity: .75; }
@media (max-width: 760px) { footer.site .wrap { grid-template-columns: 1fr; } }

/* Sign-in and states */
.signin-wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; }
.signin-wrap > div { min-width: 0; }
.form-msg { font-size: .9rem; font-weight: 600; }
.form-msg.ok { color: var(--leaf); }
.form-msg.err { color: var(--maroon); }
.members-only { color: var(--muted); }
.loading { color: var(--muted); font-style: italic; }
.user-chip { font-size: .85rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.user-chip button { font: inherit; font-weight: 700; background: none; border: 1px solid var(--line); color: var(--fg); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar { overflow: hidden; }
.pp-cover { background: linear-gradient(120deg, #8b1a1a, #b8892b); background-size: cover; background-position: center; }
.post-img { background-size: cover; background-position: center; }
.post-img.has { height: auto; max-height: 520px; object-fit: cover; width: 100%; display: block; }
.del { margin-left: auto; font: inherit; font-size: .85rem; background: none; border: 0; color: var(--muted); cursor: pointer; }
@media (max-width: 760px) { .signin-wrap { grid-template-columns: 1fr; } }
.you.role { background: var(--gold); color: #2a1a17; }
.tile .tile-del { position: absolute; top: 8px; right: 8px; z-index: 1; background: rgba(0,0,0,.55); color: #fff; border-radius: 999px; padding: 4px 10px; font-size: .75rem; margin: 0; }
.msg-del { font-size: .72rem; padding: 0 0 0 8px; margin: 0; }
.msg.mine .msg-del { color: var(--muted); }
/* Profile photo editing */
.pp-cover { position: relative; }
.avatar-wrap { position: relative; flex: none; }
.photo-edit { position: absolute; z-index: 3; }
.cover-edit { right: 14px; bottom: 14px; }
.avatar-edit { right: 2px; bottom: 6px; }
.cam-btn { font: inherit; font-weight: 700; font-size: .9rem; border: 0; border-radius: 8px; padding: 8px 12px; background: var(--surface); color: var(--fg); box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer; }
.cam-btn.round { width: 40px; height: 40px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; }
.photo-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px; display: grid; }
.avatar-edit .photo-menu { left: 0; right: auto; }
.photo-menu label, .photo-menu button { font: inherit; font-weight: 600; text-align: left; padding: 10px 12px; border-radius: 8px; background: none; border: 0; color: var(--fg); cursor: pointer; }
.photo-menu label:hover, .photo-menu button:hover { background: var(--bg); }
.photo-menu button { color: var(--maroon); }
.edit-form { display: grid; gap: 12px; }
.edit-form label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.edit-form input, .edit-form select, .edit-form textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); width: 100%; }
.pp-cover.uploading::after, .avatar.uploading::after { content: "Uploading…"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font-weight: 700; border-radius: inherit; }
.avatar { position: relative; }
@media (max-width: 760px) { .cover-edit .cam-btn { font-size: 0; padding: 0; width: 40px; height: 40px; border-radius: 50%; } .cover-edit .cam-btn::before { content: "📷"; font-size: 1.1rem; } }

/* family adverts */
.ads { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.ad img { width: 100%; height: 180px; object-fit: cover; border-radius: 8px; display: block; }
.ad h3 { font-size: 1.15rem; overflow-wrap: anywhere; }
.ad p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ad .ad-price { font-weight: 800; color: var(--maroon); }
.ad .ad-contact { font-size: .9rem; overflow-wrap: anywhere; }
.ad .post-foot { align-items: center; }
#ad-form { margin-bottom: 4px; }
#ad-form input[type=file] { max-width: 220px; }
.ad-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-btns .chip { text-decoration: none; }
.ad-links label { flex: 1 1 150px; }
.ad-links input { width: 100%; }

/* photo crop dialog */
.crop-ov { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.crop-box { background: var(--surface); color: var(--fg); border-radius: 14px; padding: 18px; width: min(560px, 100%); display: grid; gap: 12px; }
.crop-box p { margin: 0; font-size: .9rem; }
.crop-stage { position: relative; width: 100%; border-radius: 10px; overflow: hidden; background: #222; touch-action: none; }
.crop-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-stage.round .crop-mask { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 9999px rgba(0,0,0,.5); pointer-events: none; }
.crop-ctl { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.crop-ctl label { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: .9rem; flex: 1 1 200px; }
.crop-ctl input[type=range] { flex: 1; accent-color: var(--maroon); }
/* show the whole 3:1 cover as cropped, instead of trimming top and bottom on wide screens */
.pp-cover { height: auto; aspect-ratio: 3 / 1; max-height: 380px; }
