/* meet.space: Tinted. Group colors arrive as --deep / --tint on the body or on a card. */

:root {
  --brand: #5B3FD1;
  --brand-on-ink: #A78BFA;
  --ink: #1D1B26;
  --soft-ink: #3B3848;
  --muted: #5B5868;
  --line: #E6E3EE;
  --page: #F6F5F9;
  --card: #FFFFFF;
  --deep: #1D1B26;
  --tint: #F6F5F9;
  --error: #B3121B;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(29, 27, 38, 0.05), 0 8px 24px rgba(29, 27, 38, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* or a class's display (.btn's inline-flex) shows it anyway */
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--body); line-height: 1.5; }
body.tinted { background: var(--tint); transition: background-color 300ms ease; }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #5B3FD1; outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* layout */
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.page { max-width: 1160px; margin: 0 auto; padding: 24px 24px 120px; }
.stack-sm > * + * { margin-top: 8px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > .main { flex: 999 1 520px; min-width: 0; }
.split > .side { flex: 1 1 340px; min-width: 0; }
.split > .form-actions { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 12px; }
.narrow { max-width: 760px; }
.list { display: flex; flex-direction: column; gap: 14px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.section-title { margin: 64px 0 20px; }

/* header */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; background: var(--ink); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 20px; }
.brand-mark-dot { align-self: flex-end; width: 6px; height: 6px; margin: 0 0 11px 1px; border-radius: 50%; background: var(--brand-on-ink); }
/* the dot in meet.space: the group's color on group pages, the brand violet elsewhere */
.brand-dot { color: var(--brand); }
body.tinted .brand-dot { color: var(--deep); }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.03em; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 6px; border-radius: 22px; background: var(--card); font-size: 14px; font-weight: 600; box-shadow: 0 1px 2px rgba(29, 27, 38, 0.08); text-decoration: none; }
.icon-btn { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--card); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(29, 27, 38, 0.08); cursor: pointer; }
.icon-btn:hover { color: var(--ink); }
.user-chip .dot { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }

/* type */
.display-xl { font-family: var(--display); font-size: clamp(44px, 7vw, 88px); font-weight: 800; line-height: 0.95; letter-spacing: -0.045em; }
.display-lg { font-family: var(--display); font-size: clamp(40px, 6vw, 72px); font-weight: 800; line-height: 0.95; letter-spacing: -0.045em; }
.display-md { font-family: var(--display); font-size: clamp(36px, 5vw, 60px); font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.h2 { font-family: var(--display); font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.h3 { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.eyebrow { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--deep); }
.eyebrow.muted { color: var(--muted); }
.lede { font-size: 18px; line-height: 1.55; color: var(--soft-ink); max-width: 600px; }
.muted { color: var(--muted); }
.error { color: var(--error); font-weight: 700; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; font-weight: 800; text-decoration: none; cursor: pointer; background: var(--card); color: var(--ink); }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-deep { background: var(--deep); color: #FFFFFF; }
.btn-ink { background: var(--ink); color: #FFFFFF; }
.btn-soft { background: var(--tint); color: var(--deep); }
.btn-outline-white { background: transparent; color: #FFFFFF; box-shadow: inset 0 0 0 2px #FFFFFF; }
.btn-link { min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--muted); font-weight: 600; text-decoration: underline; cursor: pointer; }
.btn-link svg { vertical-align: -3px; margin-right: 4px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 16px 0 10px; border-radius: 22px; background: var(--card); font-weight: 700; text-decoration: none; }
.back svg, .btn svg { flex: none; }
form.inline { display: inline; }

/* cards */
.card { background: var(--card); border-radius: 28px; padding: 28px; }
.card-lg { background: var(--card); border-radius: 32px; padding: 40px; }
.card-pad-sm { padding: 20px 24px; }
.empty { background: var(--card); border-radius: 24px; padding: 28px; color: var(--muted); font-size: 17px; }
.archived-banner { margin-bottom: 24px; }
.audience { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.audience legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
.audience .check { align-items: center; min-height: 36px; }
.audience input[type=radio] { flex: none; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; }
.callout { background: var(--card); border-radius: 24px; padding: 24px 28px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }

/* group avatar */
.avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; background: var(--deep); color: #FFFFFF; font-family: var(--display); font-weight: 800; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar svg { width: 50%; height: 50%; }
.avatar-sm { width: 34px; height: 34px; border-radius: 12px; font-size: 17px; }
.avatar-md { width: 56px; height: 56px; border-radius: 18px; font-size: 30px; }
.avatar-lg { width: 60px; height: 60px; border-radius: 20px; font-size: 32px; }
.avatar-xl { width: 96px; height: 96px; border-radius: 30px; font-size: 52px; }

/* discover */
.group-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.group-pill { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px 0 7px; border-radius: 24px; background: var(--tint); color: var(--deep); font-weight: 700; text-decoration: none; }
.group-card { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: 28px; background: var(--tint); text-decoration: none; }
.group-card .name { margin-top: 8px; font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; color: var(--deep); }
.event-card { display: flex; flex-direction: column; gap: 16px; padding: 22px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow); text-decoration: none; }
.event-card .when { display: flex; align-items: flex-end; gap: 12px; }

/* big dates */
.bigdate { font-family: var(--display); font-weight: 800; line-height: 0.8; letter-spacing: -0.05em; color: var(--deep); }
.bigdate-md { font-size: 64px; }
.bigdate-lg { font-size: 72px; }
.bigdate-xl { font-size: clamp(110px, 14vw, 180px); line-height: 0.75; letter-spacing: -0.06em; }
.bigdate-tbd { font-size: 40px; }

/* attendee stack */
.attendees { display: flex; align-items: center; gap: 10px; }
.faces { display: flex; }
.face { width: 32px; height: 32px; margin-right: -8px; border-radius: 50%; border: 2px solid #FFFFFF; background: var(--tint); color: var(--deep); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.face img, .post-face img, .user-chip .dot img, .profile-face img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.profile-face { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--ink); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; overflow: clip; }
.face-you { background: var(--deep); color: #FFFFFF; font-size: 9px; }
.attendees .count { margin-left: 8px; font-weight: 700; font-size: 15px; }

/* badges */
.badge { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--tint); color: var(--deep); }
.badge-deep { background: var(--deep); color: #FFFFFF; }
.badge-ink { background: var(--ink); color: #FFFFFF; }

/* group header */
/* avatar | name over description | membership; on phones the description and membership go full width */
.group-hero { margin-top: 20px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "avatar info actions" "avatar about actions"; column-gap: 28px; align-items: center; }
.group-hero > .avatar { grid-area: avatar; }
.group-hero .info { grid-area: info; min-width: 0; align-self: end; }
.group-hero .about { grid-area: about; align-self: start; margin-top: 14px; }
.group-hero .actions { grid-area: actions; }
.group-hero .group-name { margin-top: 8px; }
.group-hero .actions, .event-group .actions { flex: none; }
.membership { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.organizer-bar { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }

/* tabs */
.tabs { margin-top: 28px; display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); }
.tab { min-height: 44px; padding: 0 20px; border-radius: 999px; display: inline-flex; align-items: center; font-weight: 700; color: var(--soft-ink); text-decoration: none; }
.tab[aria-selected="true"] { background: var(--deep); color: #FFFFFF; }
.tab-panel { margin-top: 20px; max-width: 820px; }

/* event rows (group page) */
.event-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; align-items: center; padding: 24px; border-radius: 24px; background: var(--card); text-decoration: none; }
.event-row .meta { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.row-link { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: 24px; background: var(--card); text-decoration: none; }
.row-link .text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-link .title { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.icon-tile { flex: none; width: 48px; height: 48px; border-radius: 16px; background: var(--tint); color: var(--deep); display: inline-flex; align-items: center; justify-content: center; }

/* event page */
.event-group { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 20px 24px; }
.event-group .who { flex: 1 1 320px; min-width: 0; display: flex; align-items: center; gap: 16px; text-decoration: none; }
.event-group .name { font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.event-when { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.fact { display: flex; gap: 12px; align-items: flex-start; }
.fact-icon { flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--tint); color: var(--deep); display: inline-flex; align-items: center; justify-content: center; }
.details { display: flex; flex-direction: column; gap: 20px; }
.location-picker .when-online, .location-picker .when-new { display: none; }
.location-picker:has(option[value="online"]:checked) .when-online,
.location-picker:has(option[value="new"]:checked) .when-new { display: block; }
.meeting-url { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.mini-map { display: block; width: 100%; height: 180px; border: 0; border-radius: 18px; background: var(--tint); }
.map-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -8px; }
.map-links .btn { flex: 1 1 auto; min-height: 44px; padding: 0 16px; font-size: 14px; }
.canceled-note { margin-top: 20px; padding: 14px 18px; border-radius: 16px; background: var(--ink); color: #FFFFFF; font-weight: 700; }
.rsvp-done { background: var(--deep); color: #FFFFFF; }
.rsvp-terms { font-size: 13px; }
.rsvp-terms a { color: inherit; }
.draft-note { margin-top: 20px; padding: 16px 18px; border-radius: 16px; background: var(--tint); color: var(--ink); display: flex; flex-direction: column; gap: 12px; }
.draft-note p { margin: 0; overflow-wrap: anywhere; }
.badge-draft { background: transparent; color: var(--deep); box-shadow: inset 0 0 0 2px var(--deep); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
.check-dot { width: 56px; height: 56px; border-radius: 50%; background: #FFFFFF; color: var(--deep); display: inline-flex; align-items: center; justify-content: center; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
.field .hint { font-weight: 500; color: var(--muted); }
.input, .field input, .field textarea, .field select { min-height: 50px; padding: 0 16px; border: 2px solid var(--line); border-radius: 16px; font-size: 17px; font-weight: 500; background: #FFFFFF; color: var(--ink); }
.prefixed { display: flex; align-items: center; min-height: 50px; border: 2px solid var(--line); border-radius: 16px; background: #FFFFFF; overflow: clip; }
.prefixed:focus-within { outline: 3px solid #5B3FD1; outline-offset: 2px; }
.prefixed .prefix { padding-left: 16px; color: var(--muted); font-weight: 500; font-size: 15px; white-space: nowrap; }
.field .prefixed input { flex: 1; min-width: 0; border: 0; padding-left: 2px; outline: none; }
.field input[type="file"] { min-height: 0; padding: 10px; font-size: 15px; }
.field input[type="file"]::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 999px; background: var(--tint); color: var(--deep); font: inherit; font-weight: 700; cursor: pointer; }
.field textarea { padding: 12px 16px; min-height: 120px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-grid-tight { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.form-errors { margin: 0; padding: 14px 18px; border-radius: 16px; background: #FFEDEA; color: var(--error); font-weight: 700; list-style: none; }

/* rich text: the Crepe editor (public/editor.css, built from editor/) in the group colors, and the Markdown it produces */
/* no overflow clipping: the floating toolbar, link popover and menus extend outside the box */
.md-editor { border: 2px solid var(--line); border-radius: 16px; background: #FFFFFF; font-weight: 400; }
.md-editor:focus-within { border-color: var(--deep); }
.md-editor textarea { display: block; box-sizing: border-box; width: 100%; min-height: 160px; padding: 12px 16px; border: 0; font: inherit; font-size: 17px; resize: vertical; }
.md-editor .milkdown {
  --crepe-color-background: #FFFFFF; --crepe-color-on-background: var(--ink);
  --crepe-color-surface: #FFFFFF; --crepe-color-surface-low: var(--tint);
  --crepe-color-on-surface: var(--ink); --crepe-color-on-surface-variant: var(--muted);
  --crepe-color-outline: var(--muted); --crepe-color-primary: var(--deep);
  --crepe-color-secondary: var(--tint); --crepe-color-on-secondary: var(--deep);
  --crepe-color-hover: var(--tint); --crepe-color-selected: var(--tint); --crepe-color-inline-area: var(--tint);
  --crepe-color-inline-code: var(--deep);
  --crepe-font-default: var(--body); --crepe-font-title: var(--display); --crepe-base-font-size: 17px;
}
/* hidden by class, not the hidden attribute: htmx resets attributes on swapped-in elements that have an id */
.md-editor.is-mounted textarea { display: none; }
/* the box draws the background and corners; the editor inside stays clear so it doesn't square them off */
.md-editor .milkdown { background: transparent; border-radius: 14px; }
.md-editor .milkdown .milkdown-top-bar { border-radius: 14px 14px 0 0; }
.md-editor .milkdown .ProseMirror { min-height: 160px; padding: 14px 16px 14px 52px; }
.md-editor[data-editor="compact"] .milkdown .ProseMirror { min-height: 0; padding: 10px 14px; }
.md-editor .milkdown .ProseMirror p { font-size: 17px; line-height: 1.55; }

.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre { margin: 0 0 0.8em; }
.prose h1, .prose h2, .prose h3 { font-family: var(--display); color: var(--ink); line-height: 1.1; margin: 1.2em 0 0.4em; }
.prose h1 { font-size: 1.6em; } .prose h2 { font-size: 1.35em; } .prose h3 { font-size: 1.15em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose a { color: var(--deep); font-weight: 700; }
.prose img { max-width: 100%; height: auto; border-radius: 16px; display: block; }
.prose blockquote { padding-left: 14px; border-left: 4px solid var(--tint); color: var(--muted); }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; padding: 1px 5px; border-radius: 6px; background: var(--tint); }
.prose pre { padding: 12px 14px; border-radius: 12px; background: var(--tint); overflow-x: auto; }
.prose pre code { padding: 0; background: none; }

/* discussion */
.posts { list-style: none; margin: 0; padding: 0; border-radius: 24px; background: var(--card); }
.posts:empty { display: none; }
.posts:not(:empty) + .no-posts { display: none; }
.posts > li + li { border-top: 1px solid var(--line); }
.post { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 20px 24px; }
.post-face { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--tint); color: var(--deep); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; overflow: clip; }
.post-meta { margin: 0; font-size: 15px; line-height: 1.4; }

/* organizers' member pages (views/group/members.html.erb, member.html.erb) */
.member-sort { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); }
.member-sort a { color: var(--ink); font-weight: 700; }
.member-sort a[aria-current] { color: var(--deep); text-decoration: none; }
.member-name { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.member-name .badge { padding: 2px 8px; font-size: 11px; vertical-align: 2px; }
.member-line { font-size: 14px; }
.member-id { display: flex; align-items: center; gap: 20px; }
.member-face { flex: none; width: 88px; height: 88px; border-radius: 50%; background: var(--tint); color: var(--deep); display: inline-flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 800; overflow: clip; }
.member-face img, .post-face img { width: 100%; height: 100%; object-fit: cover; }
.member-facts { margin-bottom: 0; display: grid; gap: 12px; } /* margin-top comes from the card's .stack */
.member-facts dt { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.member-facts dd { margin: 2px 0 0; }
.post-meta .badge { padding: 2px 8px; font-size: 11px; vertical-align: 1px; }
.post-meta .post-edit { min-height: 0; padding: 0 0 0 6px; font-size: 13px; }
.post-title { color: var(--soft-ink); }
.post-editing .md-editor { margin-top: 6px; }
.post-body { margin-top: 6px; font-size: 17px; line-height: 1.55; overflow-wrap: anywhere; }
.posts-start { margin-top: 24px; background: none; }
.posts-start .post { padding: 0; }
.posts-start .post-body { font-size: 18px; }
.thread-heading { margin: 32px 0 12px; }
.post .files { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.post .files a { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--tint); color: var(--deep); font-size: 13px; font-weight: 700; text-decoration: none; }
.post .attached-images { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.post .attached-images img { display: block; max-width: min(100%, 420px); max-height: 320px; border-radius: 14px; object-fit: cover; }
.post .attached-images a:only-child img { max-height: 420px; }
.composer { margin-top: 20px; padding: 16px; border-radius: 24px; background: var(--card); display: flex; flex-direction: column; gap: 12px; }
.composer-head { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.composer-head .post-face { width: 32px; height: 32px; font-size: 13px; }
.composer-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
/* uploads (views/group/_uploader.html.erb, public/js/app.js) */
.file-uploader { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.file-uploader-compact { flex-direction: row; flex-wrap: wrap; align-items: center; flex: 1 1 auto; }
.file-uploader-compact .upload-list { order: 2; flex: 1 1 100%; }
.dropzone { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 96px; padding: 20px; border: 2px dashed var(--line); border-radius: 20px; background: var(--card); color: var(--soft-ink); text-align: center; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease; }
.dropzone input { width: 0; height: 0; opacity: 0; position: absolute; }
.dropzone > span { display: flex; flex-direction: column; gap: 2px; }
.dropzone-choose { color: var(--deep); font-weight: 700; text-decoration: underline; }
.dropzone:focus-within { outline: 3px solid #5B3FD1; outline-offset: 2px; }
.file-uploader.dragging .dropzone, .file-uploader-compact.dragging .attach { border-color: var(--deep); background: var(--tint); }
.file-uploader-compact.dragging { outline: 2px dashed var(--deep); outline-offset: 6px; border-radius: 12px; }
.upload-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.upload-list:empty { display: none; }
.upload { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 12px; padding: 10px 14px; border-radius: 14px; background: var(--card); box-shadow: 0 1px 2px rgba(29, 27, 38, 0.06); font-size: 14px; }
.upload-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-size { grid-area: 1 / 2; }
.upload .btn-link { grid-area: 1 / 3; min-height: 32px; padding: 0 4px; }
.upload progress { grid-area: 2 / 1 / 3 / 4; width: 100%; height: 8px; accent-color: var(--deep); }
.upload.uploading .upload-size { font-variant-numeric: tabular-nums; }
.upload.done .upload-name::before { content: "✓ "; color: var(--deep); }
.upload.failed .upload-size { color: var(--error); }
/* sharing (views/group/_share.html.erb): a link that opens a popup */
.share-trigger { display: inline-flex; align-items: center; gap: 6px; }
.share-trigger svg { margin: 0; }
.event-share { margin-left: auto; align-self: center; }
.group-hero .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.share-popup:popover-open { display: flex; flex-direction: column; gap: 18px; } /* a gap, not margins: each row's own margin can't squeeze it */
.share-popup { width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 24px; border: 0; border-radius: 24px; background: var(--card); color: var(--ink); box-shadow: 0 24px 64px rgba(29, 27, 38, 0.24); }
.share-popup::backdrop { background: rgba(29, 27, 38, 0.35); }
.share-popup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.share-popup-head .h3 { overflow-wrap: anywhere; }
.share-popup .icon-btn { flex: none; box-shadow: none; background: var(--page); }
.share-link { display: flex; gap: 8px; }
.share-link input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--page); font-size: 15px; }
.share-sites { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; max-width: 340px; }
.share-site { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--brand); color: #FFFFFF; transition: transform 120ms ease, opacity 120ms ease; }
.share-site:hover { opacity: 0.88; transform: translateY(-1px); }
.share-site svg { display: block; }
.share-qr { display: flex; align-items: center; gap: 16px; padding-top: 4px; font-size: 14px; }
.share-qr img { flex: none; border-radius: 12px; border: 1px solid var(--line); }
.files-form { display: flex; flex-direction: column; gap: 12px; }
.composer .attach { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 22px; background: var(--tint); color: var(--deep); font-weight: 700; font-size: 14px; cursor: pointer; }
.composer .attach input { width: 0; height: 0; opacity: 0; position: absolute; }
.discussion-row .preview { font-size: 15px; color: var(--soft-ink); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.discussion-row .meta { display: flex; align-items: center; gap: 14px; margin-top: 6px; font-size: 14px; }
.reply-error { flex-basis: 100%; padding: 0 14px 6px; }

/* toast */
.toast-region { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; width: max-content; max-width: calc(100% - 32px); }
.toast { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 22px; border-radius: 28px; background: var(--ink); color: #FFFFFF; font-weight: 700; box-shadow: 0 12px 32px rgba(29, 27, 38, 0.3); animation: toast-out 300ms ease 5s forwards; }
.toast button { flex: none; width: 44px; height: 44px; border: 0; background: none; color: #FFFFFF; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
@keyframes toast-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } body.tinted { transition: none; } }

/* customize: the checked radios drive the live preview through :has() */
.swatches { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.swatch { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 12px; border-radius: 22px; background: var(--sw-tint); color: var(--sw-deep); font-size: 13px; font-weight: 800; cursor: pointer; }
.swatch input, .choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch .chip { width: 44px; height: 44px; border-radius: 50%; background: var(--sw-deep); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; }
.swatch .chip svg { visibility: hidden; }
.swatch:has(input:checked) { box-shadow: inset 0 0 0 3px var(--sw-deep); }
.swatch:has(input:checked) .chip svg { visibility: visible; }
.swatch:has(input:focus-visible), .choice:has(input:focus-visible) { outline: 3px solid #5B3FD1; outline-offset: 2px; }
.segmented { margin-top: 16px; display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--tint); }
.segmented .choice { position: relative; min-height: 44px; padding: 0 20px; border-radius: 999px; display: inline-flex; align-items: center; font-weight: 700; color: var(--deep); cursor: pointer; }
.segmented .choice:has(input:checked) { background: var(--deep); color: #FFFFFF; }
.icon-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; max-width: 560px; }
.icon-grid .choice { position: relative; height: 64px; border-radius: 20px; background: var(--tint); color: var(--deep); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-grid .choice:has(input:checked) { background: var(--deep); color: #FFFFFF; }
.kind-panel { display: none; }
.customize:has(input[name="avatar_kind"][value="initial"]:checked) .kind-panel-initial,
.customize:has(input[name="avatar_kind"][value="icon"]:checked) .kind-panel-icon,
.customize:has(input[name="avatar_kind"][value="photo"]:checked) .kind-panel-photo { display: block; }
.uploader { position: relative; margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 20px; border-radius: 22px; border: 2px dashed var(--deep); background: var(--tint); cursor: pointer; }
.uploader .photo-tile { width: 72px; height: 72px; padding: 0; overflow: clip; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.uploader input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.uploader:has(input:focus-visible) { outline: 3px solid #5B3FD1; outline-offset: 2px; }
.preview .pv { display: none; }
.preview .pv-photo { width: 100%; height: 100%; object-fit: cover; }
.customize:has(input[name="avatar_kind"][value="initial"]:checked) .pv-initial { display: inline; }
.customize:has(input[name="avatar_kind"][value="photo"]:checked) .pv-photo { display: block; }
.customize:has(input[name="avatar_kind"][value="photo"]:checked) .pv-noph { display: inline; }
.fake-button { min-height: 52px; border-radius: 26px; background: var(--deep); color: #FFFFFF; font-weight: 800; display: flex; align-items: center; justify-content: center; }

@media (max-width: 560px) {
  .card-lg { padding: 28px 22px; }
  .event-row { grid-template-columns: 72px minmax(0, 1fr); padding: 20px; }
  .bigdate-lg { font-size: 56px; }

  /* the header fits on one line: the chip shows just your face */
  .user-chip { padding-right: 6px; }
  .user-chip .chip-name { display: none; }
  .header-start { padding: 0 12px; }
  .site-header .header-logout { display: none; } /* on the profile page instead, so the header fits */
  .site-header .header-discover { display: none; } /* no room on a phone; the logo goes to Discover */
  .header-start .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* icon only; the name stays for screen readers */

  /* group header: a compact strip so the events show on the first screen */
  .group-hero { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "avatar info" "about about" "actions actions"; gap: 12px 14px; padding: 20px; }
  .group-hero > .avatar-xl { width: 56px; height: 56px; border-radius: 18px; font-size: 28px; }
  .group-hero > .avatar-xl svg { width: 28px; height: 28px; }
  .group-hero .info { align-self: center; }
  .group-hero .group-name { margin-top: 2px; font-size: 30px; }
  .group-hero .about { margin-top: 0; font-size: 16px; }
  .membership .status-pill, .membership .btn-lg { min-height: 40px; padding: 0 14px; font-size: 14px; }
  .organizer-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .organizer-bar .btn { flex: none; }
  .tabs { margin-top: 20px; flex-wrap: nowrap; }
  .tab { padding: 0 14px; white-space: nowrap; }

  /* the group strip on event pages */
  .event-group { padding: 14px 16px; gap: 10px; }
  .event-group .avatar-lg { width: 44px; height: 44px; border-radius: 14px; font-size: 22px; }
  .event-group .who { gap: 12px; }
  .event-group .name { font-size: 20px; }
}

/* small pieces */
.status-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; background: var(--tint); color: var(--deep); font-weight: 800; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain legend { padding: 0; }
.center-card { max-width: 480px; margin: 40px auto 0; }
.btn-google { box-shadow: inset 0 0 0 2px var(--line); }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.preview .pv svg { width: 36px; height: 36px; }
.preview .pv-photo-slot { display: contents; }
.preview .avatar-preview { width: 72px; height: 72px; border-radius: 24px; font-size: 40px; }

/* city picker, location bar, footer */
.city-picker { position: relative; }
.city-picker input[type="search"] { width: 100%; box-sizing: border-box; }
.city-options { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; max-height: 320px; overflow-y: auto; padding: 6px; border-radius: 16px; background: #FFFFFF; box-shadow: 0 8px 28px rgba(29, 27, 38, 0.16); }
.city-options:empty { display: none; }
.city-option { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.city-option:hover, .city-option:focus-visible { background: var(--tint); }
.city-none { margin: 0; padding: 10px 12px; }
.location-line { margin-top: 20px; }
.location-line > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; list-style: none; cursor: pointer; font-size: 15px; }
.location-line > summary::-webkit-details-marker { display: none; }
.location-change { color: var(--muted); font-weight: 600; text-decoration: underline; }
.location-line[open] .location-change { display: none; }
.location-panel { margin-top: 12px; padding: 18px 22px; border-radius: 24px; background: var(--card); display: flex; flex-direction: column; gap: 12px; }
.location-panel > p { margin: 0; }
.location-form { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.location-form .city-picker { flex: 1 1 260px; }
.site-footer { margin-top: 64px; padding-bottom: 32px; color: var(--muted); font-size: 13px; }
.site-footer a { color: inherit; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 600; cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--ink); }
.profile-id { display: flex; gap: 18px; align-items: center; }
.profile-id-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.profile-photo { position: relative; flex: none; border-radius: 50%; cursor: pointer; }
.profile-photo .profile-face { width: 84px; height: 84px; font-size: 32px; }
.profile-photo-edit { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(29, 27, 38, 0.25); display: flex; align-items: center; justify-content: center; }
.profile-photo:hover .profile-photo-edit { background: var(--ink); color: #FFFFFF; }
.profile-photo:has(input:focus-visible) { outline: 3px solid #5B3FD1; outline-offset: 3px; }
.topic-picker { position: relative; display: flex; flex-direction: column; gap: 8px; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.topic-chips:empty { display: none; }
.topic-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--tint); color: var(--deep); font-size: 14px; font-weight: 700; }
.topic-remove { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; font: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.topic-remove:hover { background: rgba(0, 0, 0, 0.08); }
.topics { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.group-hero .about-topics { grid-column: 2 / 3; margin-top: 12px; }
@media (max-width: 560px) { .group-hero .about-topics { grid-column: 1 / -1; margin-top: 0; } }
.header-start, .header-discover { min-height: 44px; }
.profile-logout { margin-top: 12px; text-align: center; }
.logins { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.logins li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; border-bottom: 1px solid var(--line); }
.logins li:last-child { border-bottom: 0; }
