:root {
  color-scheme: light;
  --paper: #f7f3eb;
  --card: #fffdf8;
  --ink: #171612;
  --muted: #8d897f;
  --line: #d8d1c5;
  --accent: #d7653e;
  --accent-soft: #f5dfd5;
  --circle: #2f7654;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
body { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
body.media-viewer-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.shell { width: min(720px, 100%); margin: 0 auto; padding: 18px 18px 104px; }
.masthead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.brand { font: 700 28px/1.05 Georgia, serif; letter-spacing: -.5px; }
.masthead-date { color: var(--accent); font-size: 13px; font-weight: 900; letter-spacing: 2px; }
.masthead-actions { display: flex; align-items: center; gap: 10px; }
.pilot { font-size: 10px; font-weight: 800; letter-spacing: 1.5px; color: var(--accent); }
.icon-button { border: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: white; font-size: 25px; }
.avatar-button { border: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: white; font-size: 13px; font-weight: 900; }

.home-greeting { position: relative; display: block; width: 100%; padding: 14px 42px 22px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.home-greeting > span:first-child, .home-circle-name { display: block; font: 500 clamp(38px, 10vw, 62px)/1.02 Georgia, serif; letter-spacing: -1.8px; }
.home-circle-name { margin-top: 3px; font-style: italic; }
.greeting-chevron { position: absolute; right: 8px; bottom: 28px; color: var(--muted); font-size: 24px; }

.circle-switcher { display: flex; align-items: center; width: 100%; gap: 14px; padding: 15px; border: 1px solid color-mix(in srgb, var(--circle) 32%, transparent); border-radius: 22px; background: var(--card); color: var(--ink); text-align: left; box-shadow: 0 12px 32px rgba(49,38,25,.06); }
.circle-mark { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; background: var(--circle); color: white; font-size: 22px; }
.eyebrow { display: block; font-size: 10px; font-weight: 900; letter-spacing: 1.8px; color: var(--muted); text-transform: uppercase; }
.circle-name { display: block; margin-top: 3px; font-size: 23px; font-weight: 800; }
.chevron { margin-left: auto; color: var(--muted); }

.section-head { display: flex; align-items: baseline; gap: 12px; margin-top: 24px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); font-size: 11px; font-weight: 900; letter-spacing: 1.8px; text-transform: uppercase; }
.section-head span:last-child { margin-left: auto; color: var(--muted); }
.people { display: flex; gap: 14px; overflow-x: auto; padding: 14px 2px 2px; scrollbar-width: none; }
.person { width: 62px; flex: 0 0 auto; text-align: center; font-size: 12px; font-weight: 700; }
.story-person { width: 70px; flex: 0 0 auto; border: 0; background: transparent; color: var(--ink); text-align: center; font-size: 12px; font-weight: 750; }
.story-person.active .avatar { outline: 2px solid var(--circle); outline-offset: 2px; }
.story-avatar-wrap { position: relative; display: block; width: 54px; margin: 0 auto; }
.story-avatar-wrap .avatar { margin-bottom: 6px; }
.story-add-badge { position: absolute; right: -3px; bottom: 3px; display: grid; place-items: center; width: 20px; height: 20px; border: 2px solid var(--paper); border-radius: 50%; background: var(--circle); color: white; font-size: 14px; font-weight: 900; line-height: 1; }
.avatar { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 6px; border: 2px solid var(--circle); border-radius: 50%; background: color-mix(in srgb, var(--circle) 14%, white); color: var(--circle); font-weight: 900; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

.hero { margin-top: 22px; padding: 23px; border-radius: 24px; background: var(--ink); color: white; }
.hero .eyebrow { color: color-mix(in srgb, var(--circle) 70%, white); }
.hero h1 { margin: 8px 0; font: italic 700 27px/1.12 Georgia, serif; }
.hero p { margin: 0; color: #c9c5bd; line-height: 1.45; }
.golf-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.golf-actions-three .wide { grid-column: 1 / -1; }
.golf-profile { display: flex; align-items: center; width: 100%; gap: 13px; color: var(--ink); text-align: left; }
.golf-profile strong { display: block; margin-top: 4px; }
.golf-score-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.golf-score-head h3 { margin: 4px 0 2px; font: 700 21px/1.15 Georgia, serif; }
.golf-score-head small, .muted { color: var(--muted); }
.card > small.muted { display: block; margin-top: 6px; }
.tee-count { color: var(--circle); font-size: 24px; }
.golf-rsvp, .reaction-row { display: flex; gap: 8px; margin-top: 14px; }
.golf-rsvp { align-items: center; flex-wrap: wrap; }
.golf-rsvp button, .reaction-row button { padding: 9px 12px; font-size: 11px; }
.thread-link { margin-left: auto; border: 0; background: transparent; color: var(--circle); font-weight: 850; }
.compact-field { width: auto; min-width: 108px; padding: 9px 30px 9px 11px; border-radius: 999px; }
.chat-scope { margin-top: 14px; }
.copy-message { border: 0; padding: 4px 0; background: transparent; color: var(--circle); font-size: 11px; font-weight: 850; }
.availability-card h3, .family-gathering h3 { margin: 0 0 4px; font: 700 21px/1.2 Georgia, serif; }
.availability-option { width: 100%; margin-top: 10px; padding: 13px; border-radius: 15px; background: color-mix(in srgb, var(--circle) 5%, white); color: var(--ink); }
.availability-option-head, .availability-summary, .availability-choices { display: flex; align-items: center; gap: 8px; }
.availability-option-head { justify-content: space-between; }
.availability-summary { min-height: 30px; margin-top: 8px; }
.availability-avatars { display: flex; padding-left: 5px; }
.availability-avatars .avatar { width: 28px; height: 28px; margin: 0 0 0 -5px; border-width: 1.5px; border-color: white; font-size: 9px; }
.availability-choices { margin-top: 10px; }
.availability-choices button { flex: 1; padding: 9px 7px; font-size: 11px; }
.availability-confirm { margin-top: 10px; border: 0; background: transparent; color: var(--circle); font-size: 11px; font-weight: 850; }
.leaderboard { padding-top: 10px; }
.leader-row { display: grid; grid-template-columns: minmax(0, 1fr) 38px 50px 42px; gap: 6px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.leader-row span:not(:first-child), .leader-row strong:last-child { text-align: center; }
.leader-head { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: 1px; }
.golf-round { display: block; width: 100%; color: var(--ink); text-align: left; }
.golf-round.clickable { cursor: pointer; }
.round-score { text-align: right; }
.round-score strong { display: block; font-size: 36px; line-height: .95; font-variant-numeric: tabular-nums; }
.round-score small { color: var(--circle); font-size: 9px; font-weight: 900; letter-spacing: 1px; }
.round-footer { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 11px; font-weight: 800; }
.golf-member { display: block; margin-top: 4px; color: var(--circle); }
.form-stack textarea.field { min-height: 84px; resize: vertical; }
.check-row { display: flex !important; grid-template-columns: auto 1fr; align-items: center; color: var(--ink) !important; }
.check-row input { width: 20px; height: 20px; accent-color: var(--circle); }
.form-stack a.secondary { display: block; text-align: center; text-decoration: none; }
.score-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hole-score-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.hole-score-grid label { gap: 3px; text-align: center; }
.hole-score-grid .field { min-width: 0; padding: 10px 4px; text-align: center; }
.score-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.score-summary span { display: grid; gap: 3px; padding: 12px; border-radius: 14px; background: #ece7dd; }
.score-summary small { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: 1px; }
.score-summary strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.round-scorecard { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin-top: 12px; }
.round-scorecard span, .round-totals span { display: grid; gap: 2px; padding: 7px 2px; border-radius: 8px; background: #f1ede5; text-align: center; }
.round-scorecard small, .round-totals small { color: var(--muted); font-size: 8px; font-weight: 900; }
.round-scorecard strong, .round-totals strong { font-variant-numeric: tabular-nums; }
.round-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.comment p { margin: 7px 0 0; }
.comment-composer { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 14px; }
.family-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.birthday-card { padding-top: 5px; padding-bottom: 5px; }
.birthday-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.birthday-row:last-child { border-bottom: 0; }
.birthday-row span:nth-child(2) strong, .birthday-row span:nth-child(2) small { display: block; }
.birthday-row span:nth-child(2) small { margin-top: 2px; color: var(--muted); }
.mini-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--circle) 13%, white); color: var(--circle); font-size: 11px; font-weight: 900; }
.birthday-count, .rsvp-count { margin-left: auto; color: var(--circle); font-size: 11px; }
.family-location { margin: 8px 0; font-weight: 750; }
.birthday-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.composer, .card, .empty { margin-top: 14px; padding: 17px; border-radius: 20px; background: var(--card); border: 1px solid #ece5d9; }
.composer textarea, .chat-row input, .field { width: 100%; border: 1px solid var(--line); border-radius: 15px; background: white; color: var(--ink); padding: 13px 14px; outline: none; }
.composer textarea:focus, .chat-row input:focus, .field:focus { border-color: var(--circle); box-shadow: 0 0 0 3px color-mix(in srgb, var(--circle) 14%, transparent); }
.composer textarea { min-height: 78px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; }
.primary, .secondary, .danger { border: 0; border-radius: 999px; padding: 12px 17px; font-weight: 850; }
.primary { background: var(--circle); color: white; }
.secondary { background: #ece7dd; color: var(--ink); }
.danger { background: #fae0dc; color: #962d1d; }
.composer .row { justify-content: flex-end; margin-top: 10px; }
.composer-actions { flex-wrap: wrap; }
.media-control { display: inline-flex; }
.media-button { border: 1px solid color-mix(in srgb, var(--circle) 36%, var(--line)); border-radius: 999px; padding: 10px 13px; background: transparent; color: var(--circle); font-size: 12px; font-weight: 850; white-space: nowrap; }
.media-status { min-width: 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.composer-actions .media-status { margin-right: auto; }
.protected-media { display: grid; place-items: center; width: 100%; min-height: 180px; margin-top: 12px; overflow: hidden; border-radius: 16px; background: #ece7dd; color: var(--muted); font-size: 12px; }
.clickable-media { cursor: zoom-in; }
.video-media { position: relative; }
.media-expand { position: absolute; right: 10px; top: 10px; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(0,0,0,.62); color: white; font-size: 20px; }
.video-play { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 64px; height: 64px; border: 2px solid rgba(255,255,255,.9); border-radius: 50%; background: rgba(0,0,0,.54); color: white; font-size: 25px; transform: translate(-50%, -50%); }
.circle-media { display: block; width: 100%; max-height: min(68dvh, 620px); object-fit: contain; background: #171612; }
.media-collection { width: 100%; overflow: hidden; border-radius: 16px; }
.media-collection.multiple { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
.media-collection.multiple .protected-media { min-height: 140px; margin: 0; border-radius: 0; aspect-ratio: 1; }
.media-collection.multiple .protected-media:first-child:nth-last-child(3) { grid-row: span 2; aspect-ratio: auto; }
.loading-media { animation: media-pulse 1.3s ease-in-out infinite alternate; }
@keyframes media-pulse { to { opacity: .55; } }

.post-meta, .message-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.post-body { margin: 9px 0 0; font: italic 600 20px/1.35 Georgia, serif; white-space: pre-wrap; }
.moment-footer, .moment-reactions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.moment-heart, .moment-detail-link { min-height: 38px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: white; color: var(--circle); font-weight: 850; }
.moment-detail-link { margin-left: auto; border: 0; background: transparent; color: var(--muted); }
.moment-author { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 14px; }
.moment-author .avatar { width: 44px; height: 44px; margin: 0; }
.moment-author small { display: block; margin-top: 2px; }
.moment-comment { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.moment-comment .avatar { width: 36px; height: 36px; margin: 0; }
.moment-comment p { margin: 3px 0 0; }
.moment-detail .danger { margin-top: 22px; }
.detail-media.multiple { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
.detail-media.multiple .protected-media { min-width: 100%; min-height: min(62dvh, 560px); scroll-snap-align: start; }
.message-body { margin: 6px 0 0; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-body a { color: var(--circle); text-decoration: underline; }
.reply-composer, .pinned-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; padding: 9px 11px; border-left: 3px solid var(--circle); border-radius: 8px; background: color-mix(in srgb, var(--circle) 8%, white); color: var(--muted); font-size: 12px; }
.reply-quote { margin: 8px 0; padding: 8px 10px; border-left: 3px solid var(--circle); border-radius: 7px; background: #f3f0e9; color: var(--muted); font-size: 12px; }
.youtube-card { position: relative; display: block; margin-top: 10px; overflow: hidden; border-radius: 12px; }
.youtube-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.youtube-card span { position: absolute; top: 50%; left: 50%; display: grid; width: 52px; height: 38px; place-items: center; border-radius: 11px; background: #f32621; color: white; transform: translate(-50%, -50%); text-decoration: none; }
.message-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.message-actions > button, .message-actions summary { min-height: 34px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--muted); font-size: 11px; font-weight: 800; cursor: pointer; }
.message-reactions { display: flex; gap: 5px; margin-top: 7px; }
.message-reactions span { padding: 3px 7px; border-radius: 999px; background: #f3f0e9; font-size: 12px; }
.reaction-menu { position: relative; }
.reaction-menu summary { list-style: none; }
.reaction-choices { position: absolute; z-index: 7; bottom: 40px; left: 0; display: grid; grid-template-columns: repeat(3, 48px); gap: 3px; padding: 7px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 10px 30px rgba(0,0,0,.16); }
.reaction-choices button { width: 48px; height: 48px; border: 0; background: transparent; font-size: 26px; }
.danger-text { color: #b3261e !important; }
.circle-media[controls] { min-height: 48px; }
.empty { color: var(--muted); text-align: center; line-height: 1.45; }

.tabs { position: fixed; z-index: 5; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; grid-template-columns: repeat(4, 1fr); width: min(680px, calc(100% - 28px)); padding: 7px; border: 1px solid rgba(255,255,255,.72); border-radius: 25px; background: rgba(255,253,248,.88); box-shadow: 0 14px 40px rgba(36,25,16,.18); backdrop-filter: blur(22px); }
.announcement { border-color: color-mix(in srgb, var(--circle) 28%, #ece5d9); }
.announcement h2 { margin: 6px 0; font: 700 25px/1.15 Georgia, serif; }
.tab { display: grid; place-items: center; gap: 2px; border: 0; border-radius: 19px; padding: 7px 5px; background: transparent; color: var(--ink); font-size: 11px; font-weight: 800; }
.tab-icon { font-size: 21px; line-height: 1; }
.tab.active { background: color-mix(in srgb, var(--circle) 14%, white); color: var(--circle); }

.page-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 10px 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.page-title h1 { margin: 0; font: 500 48px/1 Georgia, serif; }
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.album-tile { position: relative; min-height: 128px; overflow: hidden; border-radius: 18px; background: var(--card); border: 1px solid #ece5d9; color: var(--ink); text-align: left; }
.album-tile .protected-media { height: 100%; min-height: 128px; margin: 0; border-radius: 0; }
.album-tile .circle-media { width: 100%; height: 100%; min-height: 128px; object-fit: cover; }
.album-tile p { margin: 0; padding: 14px; font: italic 600 15px/1.3 Georgia, serif; }
.album-tile.has-media p { position: absolute; right: 0; bottom: 0; left: 0; padding: 24px 10px 10px; background: linear-gradient(transparent, rgba(0,0,0,.66)); color: white; font: 700 11px/1.25 ui-rounded, system-ui; }
.calendar-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; }
.calendar-button { width: 100%; color: inherit; text-align: left; }
.calendar-card h3 { margin: 4px 0; font: 700 20px/1.15 Georgia, serif; }
.calendar-date { color: var(--circle); font-size: 12px; font-weight: 900; }
.calendar-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.calendar-detail-date { margin: 12px 0; color: var(--circle); font: 700 22px/1.2 Georgia, serif; }
.calendar-preset { display: grid; gap: 3px; width: 100%; margin: 12px 0 18px; padding: 14px; border: 0; border-radius: 14px; background: color-mix(in srgb, var(--circle) 10%, white); color: var(--circle); text-align: left; }
.calendar-preset small { color: var(--muted); }
.emoji-choices { display: flex; flex-wrap: wrap; gap: 7px; }
.emoji-choice { width: 40px; height: 40px; border: 1px solid transparent; border-radius: 50%; background: transparent; font-size: 22px; opacity: .42; }
.emoji-choice.selected { border-color: var(--circle); background: color-mix(in srgb, var(--circle) 10%, white); opacity: 1; }
.calendar-response { margin-top: 20px; }
.response-choices { display: flex; gap: 8px; margin: 10px 0 16px; }
.arrival-note { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 18px; }
.roll-call { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.roll-call .avatar { width: 38px; height: 38px; margin: 0; }
.roll-call small { display: block; color: var(--muted); }
.shared-gathering-home { width: 100%; margin-top: 18px; border: 0; background: #181713; color: white; text-align: left; }
.shared-gathering-home h2 { margin: 6px 0; font: 700 27px/1.15 Georgia, serif; }
.shared-gathering-home p { color: rgba(255,255,255,.74); }
.shared-gathering-home strong { display: block; margin-top: 9px; color: #f39a75; }
.gathering-avatars { display: flex; margin-top: 12px; }
.gathering-avatars .avatar { margin-right: -7px; border: 2px solid #181713; }
.resolved-label { margin: 16px 0; color: var(--circle); font-weight: 850; }

.moment-media-viewer { position: fixed; z-index: 70; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); background: #000; color: white; }
.moment-media-toolbar { z-index: 2; display: flex; justify-content: space-between; padding: max(12px, env(safe-area-inset-top)) 16px 10px; background: #000; }
.viewer-control { min-height: 44px; border: 0; border-radius: 999px; padding: 0 15px; background: rgba(255,255,255,.14); color: white; font-weight: 850; }
.moment-media-stage { display: grid; place-items: center; min-height: 0; overflow: hidden; touch-action: none; }
.moment-media-stage .protected-media { width: 100%; height: 100%; min-height: 0; margin: 0; border-radius: 0; background: #000; }
.moment-media-stage .circle-media { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center; will-change: transform; }

.story-overlay { z-index: 50; place-items: center; background: #000; }
.story-viewer { position: relative; width: min(560px, 100%); height: 100dvh; display: grid; align-content: center; overflow: hidden; background: #000; color: white; }
.story-viewer .protected-media { min-height: 70dvh; margin: 0; border-radius: 0; background-color: #000; background-size: cover; background-position: center; }
.story-viewer .circle-media { max-height: 78dvh; object-fit: contain; }
.story-head { position: absolute; z-index: 4; top: max(18px, env(safe-area-inset-top)); right: 16px; left: 16px; display: flex; align-items: center; justify-content: space-between; }
.story-progress { position: absolute; z-index: 5; top: max(8px, env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; gap: 4px; }
.story-progress span { height: 3px; flex: 1; border-radius: 99px; background: rgba(255,255,255,.35); }
.story-progress span.watched { background: white; }
.story-close { background: rgba(255,255,255,.18); color: white; }
.story-save { min-height: 42px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(255,255,255,.18); color: white; font-weight: 800; }
.story-caption { position: absolute; right: 18px; bottom: max(28px, env(safe-area-inset-bottom)); left: 18px; padding: 12px; border-radius: 14px; background: rgba(0,0,0,.55); }
.story-target { position: absolute; z-index: 3; top: 76px; bottom: 76px; border: 0; background: transparent; }
.story-back { left: 0; width: 33.333%; }
.story-next { right: 0; width: 66.667%; }

.overlay { position: fixed; z-index: 10; inset: 0; display: grid; place-items: end center; background: rgba(18,16,12,.35); }
.sheet { width: min(720px, 100%); max-height: 86dvh; overflow: auto; padding: 20px 18px max(25px, env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: var(--paper); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sheet h2, .welcome h1 { margin: 0; font: 700 30px/1.1 Georgia, serif; }
.close { border: 0; border-radius: 999px; padding: 10px 14px; background: #ece7dd; font-weight: 800; }
.circle-option { display: flex; align-items: center; width: 100%; gap: 13px; margin: 9px 0; padding: 14px; border: 1px solid #e8e1d5; border-radius: 18px; background: var(--card); text-align: left; }
.circle-option strong { display: block; font-size: 18px; }
.circle-option small { color: var(--muted); }
.form-stack { display: grid; gap: 12px; margin-top: 20px; }
.form-stack label { display: grid; gap: 6px; font-size: 12px; font-weight: 850; color: var(--muted); }
.profile-editor > .avatar { width: 88px; height: 88px; margin: 2px auto 4px; }
.member-row { width: 100%; margin-bottom: 10px; border: 1px solid #e8e1d5; color: var(--ink); text-align: left; }
.member-row .avatar { flex: 0 0 auto; margin: 0; }
.member-row > div { min-width: 0; flex: 1; }
.member-detail .member-identity { display: grid; justify-items: center; gap: 5px; padding: 6px 0 18px; text-align: center; }
.member-detail .member-identity .avatar { width: 88px; height: 88px; margin: 0 0 5px; }
.member-detail .member-identity h2 { font-size: 27px; }
.member-message { margin-bottom: 18px; }
.member-facts > div, .member-today > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.member-facts > div:last-child, .member-today > div:last-child { border-bottom: 0; }
.member-facts span, .member-today span { color: var(--muted); }
.avatar-crop-overlay { z-index: 40; place-items: center; padding: 18px; background: rgba(0,0,0,.82); }
.avatar-crop-card { width: min(420px, 100%); padding: 20px; border-radius: 28px; background: var(--paper); }
.avatar-crop-card h2 { margin: 0 0 8px; font: 700 28px/1.1 Georgia, serif; }
.avatar-crop-canvas { display: block; width: min(100%, 320px); height: auto; margin: 18px auto; border-radius: 50%; background: #111; touch-action: none; cursor: grab; }
.avatar-crop-canvas:active { cursor: grabbing; }
.avatar-zoom { width: 100%; accent-color: var(--circle); }
.crop-actions { justify-content: flex-end; margin-top: 16px; }

.welcome { display: grid; align-content: center; min-height: 100dvh; width: min(560px, 100%); margin: auto; padding: 30px 24px; text-align: center; }
.welcome-mark { display: grid; place-items: center; width: 92px; height: 92px; margin: 0 auto 22px; border-radius: 28px; background: var(--accent); color: white; font-size: 42px; box-shadow: 0 18px 42px rgba(215,101,62,.25); }
.welcome p { color: var(--muted); line-height: 1.5; }
.welcome .form-stack { text-align: left; }
.welcome .primary { width: 100%; margin-top: 4px; padding: 14px; background: var(--accent); }
.error { margin: 12px 0; color: #a42e20; font-weight: 750; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 100px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 999px; background: var(--ink); color: white; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-weight: 750; text-align: center; }
.loading { display: grid; place-items: center; min-height: 100dvh; font: 700 26px Georgia, serif; }

@media (min-width: 720px) {
  .shell { padding-top: 30px; }
  .sheet { margin-bottom: 24px; border-radius: 28px; }
  .overlay { place-items: center; }
}

@media (max-width: 420px) {
  .arrival-note { grid-template-columns: 1fr; }
  .arrival-note .secondary { width: 100%; }
  .chat-row .row { align-items: stretch; flex-wrap: wrap; }
  .chat-row input { min-width: 0; flex: 1 1 190px; }
  .chat-row .media-control { flex: 0 0 auto; }
  .album-grid { grid-template-columns: repeat(2, 1fr); }
}
