:root {
	color-scheme: light dark;
	--bg: #ffffff;
	--fg: #0b0d12;
	--muted: #5b6472;
	--accent: #2f6df6;
	--border: #e4e7ec;
	--danger: #b42318;
	--radius: 10px;
	--space: 1rem;
	--font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0b0d12;
		--fg: #f4f6fa;
		--muted: #9aa4b2;
		--accent: #6f9bff;
		--border: #232833;
		--danger: #ff9a8f;
	}
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.shell {
	max-width: 42rem;
	margin: 0 auto;
	padding: calc(var(--space) * 3) var(--space);
}

h1 {
	margin: 0 0 0.5rem;
	font-size: clamp(1.6rem, 4vw, 2.25rem);
	letter-spacing: -0.02em;
}

.lede {
	margin: 0 0 0.75rem;
	font-size: 1.05rem;
}

.hint {
	margin: 0;
	color: var(--muted);
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.55rem 0.9rem;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: var(--accent);
	color: #fff;
	font: inherit;
	font-weight: 500;
	cursor: pointer;
}

.btn:hover {
	filter: brightness(1.05);
}

.btn-secondary {
	background: transparent;
	color: var(--fg);
	border-color: var(--border);
}

.card {
	padding: var(--space);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
}

.input,
.select,
.textarea {
	width: 100%;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
	color: var(--fg);
	font: inherit;
}

.field {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.35rem;
	margin-bottom: var(--space);
}

.field > label {
	font-size: 0.875rem;
	color: var(--muted);
}

/*
 * 390px-safe, like .grid below. A grid with no column list gets one implicit
 * auto column, and an auto column is never narrower than its widest item's
 * min-content width. One nowrap scrolling strip (days, time slots) anywhere
 * inside an item therefore widened the whole column past the screen: the page
 * scrolled sideways instead of the strip scrolling on its own. minmax(0, 1fr)
 * caps the column at the container; the min-width rule keeps a child from
 * bringing the same floor back if an app redefines the columns. :where() adds
 * no specificity, so a min-width the app sets on a child still wins.
 */
.stack {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space);
}

:where(.field, .stack, .list) > * {
	min-width: 0;
}

.row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

/*
 * 390px-safe. An unclamped minmax track overflows a 390px viewport once the
 * shell padding is subtracted, and nothing in the pipeline ever looked at a
 * phone-width layout, so every generated app inherited the horizontal scroll.
 * min() clamps the track to the container instead.
 */
.grid {
	display: grid;
	gap: var(--space);
	grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
}

.list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.list-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.table {
	width: 100%;
	border-collapse: collapse;
}

.table th,
.table td {
	padding: 0.6rem 0.5rem;
	text-align: left;
	border-bottom: 1px solid var(--border);
}

.table th {
	font-size: 0.8125rem;
	color: var(--muted);
	font-weight: 600;
}

.empty {
	padding: calc(var(--space) * 2);
	text-align: center;
	color: var(--muted);
}

.empty-title {
	margin: 0 0 0.25rem;
	color: var(--fg);
	font-weight: 600;
}

/* Loading. Every fetch has one; without a primitive each app invented its own. */
.loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: calc(var(--space) * 1.5);
	color: var(--muted);
}

.spinner {
	flex: none;
	width: 1.15rem;
	height: 1.15rem;
	border: 2px solid var(--border);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: fab-spin 0.7s linear infinite;
}

@keyframes fab-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Placeholder for content whose shape is known before its data arrives. */
.skeleton {
	display: block;
	height: 1rem;
	border-radius: calc(var(--radius) / 2);
	background: linear-gradient(90deg, var(--border), transparent, var(--border));
	background-size: 200% 100%;
	animation: fab-shimmer 1.2s linear infinite;
}

@keyframes fab-shimmer {
	to {
		background-position: -200% 0;
	}
}

/* Error strip: a failure the user can see and retry, never a silent no-op. */
.alert {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--border);
	border-left: 3px solid var(--muted);
	border-radius: var(--radius);
}

.alert-error {
	border-left-color: var(--danger);
	color: var(--danger);
}

.badge {
	display: inline-block;
	padding: 0.1rem 0.5rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	font-size: 0.8125rem;
	color: var(--muted);
}

/*
 * The scaffold had exactly one @media rule (prefers-color-scheme) and no width
 * breakpoint at all, so the shell was a 42rem column at every size.
 * Mobile-first stays the default; these only widen it.
 */
@media (min-width: 48rem) {
	.shell {
		max-width: 52rem;
		padding: calc(var(--space) * 3) calc(var(--space) * 1.5);
	}
}

@media (min-width: 64rem) {
	.shell {
		max-width: 64rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.spinner,
	.skeleton {
		animation: none;
	}
}

:root { --accent: #d6336c; --bg: #fff8f5; --border: #f0dcd6; color-scheme: light; }
@media (prefers-color-scheme: dark) { :root { --bg: #fff8f5; --fg: #2a1a22; --muted: #7a6470; --accent: #d6336c; --border: #f0dcd6; --danger: #b42318; } }
body { font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif; color: #2a1a22; }
.hero { background: linear-gradient(135deg, #d6336c 0%, #f76707 100%); color: #fff; padding: 3rem 1rem 3.5rem; }
.hero-inner { max-width: 64rem; margin: 0 auto; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); max-width: 18ch; line-height: 1.1; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.15em; font-weight: 700; font-size: 0.8rem; margin: 0 0 0.75rem; opacity: 0.9; }
.hero .lede { max-width: 36rem; opacity: 0.95; }
.layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); padding-top: 1.5rem; }
@media (min-width: 60rem) { .layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } .layout aside { position: sticky; top: 1rem; } }
.card { background: #fff; border-radius: 16px; box-shadow: 0 2px 12px rgba(214, 51, 108, 0.06); }
.filters { display: grid; gap: 0.75rem; margin-top: -3rem; }
.grow { flex: 1 1 10rem; width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 0.3rem 0.75rem; font: inherit; font-size: 0.875rem; cursor: pointer; color: inherit; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.invites { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); }
.invite { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem; display: grid; gap: 0.6rem; align-content: start; }
.invite-top { display: flex; gap: 0.75rem; align-items: center; }
.invite-icon { font-size: 1.6rem; width: 3rem; height: 3rem; display: grid; place-items: center; background: #ffe8ef; border-radius: 12px; flex: none; }
.invite h3 { margin: 0; font-size: 1.05rem; }
.invite-when { margin: 0; color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.invite-place, .invite-note { margin: 0; }
.invite-note { color: var(--muted); font-style: italic; }
.small { font-size: 0.85rem; }
.join-form { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.join-form .input { flex: 1 1 100%; }
.btn { border-radius: 999px; justify-content: center; }
.btn:disabled { opacity: 0.6; }
.btn-block { width: 100%; }
.post-form h2, .post-done h2 { margin: 0 0 0.25rem; }
.post-form .hint { margin-bottom: 1rem; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 0.75rem; }
.post-done { display: grid; gap: 0.75rem; justify-items: start; }
.foot { text-align: center; color: var(--muted); padding: 2rem 1rem; font-size: 0.875rem; }

/* Feminine match theme */
:root { --accent: #c2477a; --bg: #fdf3f5; --border: #f3d6df; --muted: #8a6b78; }
body { font-family: "Nunito", system-ui, sans-serif; color: #3d2333; background: linear-gradient(180deg, #fde8ee 0%, #fdf3f5 40%, #f8eef8 100%); min-height: 100vh; }
.serif, h1, h2 { font-family: "Playfair Display", Georgia, serif; }
.script { font-family: "Great Vibes", cursive; font-size: 2.2rem; color: var(--accent); margin: 0; line-height: 1.1; }
.btn { background: linear-gradient(135deg, #e86a9a, #c2477a); border: none; color: #fff; box-shadow: 0 4px 14px rgba(194, 71, 122, 0.25); text-decoration: none; }
.btn-secondary { background: #fff; color: var(--accent); border: 1px solid var(--border); box-shadow: none; }
.card { border-radius: 24px; box-shadow: 0 6px 24px rgba(194, 71, 122, 0.08); border: 1px solid #f7e1e8; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 0.9rem 1.2rem; background: rgba(255,255,255,0.7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--border); }
.brand { font-family: "Playfair Display", serif; font-style: italic; font-size: 1.4rem; color: var(--accent); font-weight: 600; }
.linkish { background: none; border: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0.4rem; text-decoration: underline; }
.narrow { max-width: 30rem !important; }
.landing { display: grid; gap: 2rem; }
@media (min-width: 60rem) { .landing { grid-template-columns: 1fr 1fr; align-items: center; } .landing .auth { grid-column: 1 / -1; max-width: 28rem; justify-self: center; width: 100%; } }
.intro h1 { font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.1; margin: 0.3rem 0 1rem; }
.intro .lede { color: var(--muted); font-size: 1.05rem; margin-bottom: 1.5rem; }
.deck-wrap { display: grid; gap: 1rem; justify-items: center; }
.deck-wrap > * { width: 100%; max-width: 24rem; }
.sample-note { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 0; }
.pcard { background: #fff; border-radius: 28px; overflow: hidden; box-shadow: 0 12px 40px rgba(194, 71, 122, 0.18); }
.pcard-photo { position: relative; aspect-ratio: 3 / 4; background: #f6d9e3; }
.pcard-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-name { position: absolute; inset: auto 0 0 0; padding: 3rem 1.2rem 1rem; color: #fff; background: linear-gradient(transparent, rgba(61, 20, 40, 0.75)); }
.pcard-name h2 { margin: 0; font-size: 1.8rem; }
.pcard-name p { margin: 0; }
.photo-next { position: absolute; inset: 0 0 0 40%; background: transparent; border: 0; cursor: pointer; }
.dots { position: absolute; top: 0.6rem; left: 0.6rem; right: 0.6rem; display: flex; gap: 4px; }
.dots span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,0.45); }
.dots span.on { background: #fff; }
.pcard-body { padding: 1rem 1.2rem 0.5rem; }
.bio { margin: 0 0 0.5rem; }
.label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 700; margin: 0.8rem 0 0.4rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag { background: #c2477a; color: #fff; border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.82rem; }
.tag-soft { background: #fbe3ec; color: #9c2f5e; }
.meta { color: var(--muted); font-size: 0.85rem; }
.swipe-btns { display: flex; justify-content: center; gap: 1.5rem; padding: 0.5rem 0 1.2rem; }
.round { width: 4rem; height: 4rem; border-radius: 50%; font-size: 1.6rem; cursor: pointer; border: 1px solid var(--border); background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.round.pass { color: #a68a96; }
.round.like { color: #fff; background: linear-gradient(135deg, #f28bb0, #c2477a); border: none; }
.overlay { position: fixed; inset: 0; background: rgba(61, 20, 40, 0.5); display: grid; place-items: center; padding: 1rem; z-index: 20; }
.popup { background: #fff; border-radius: 28px; padding: 2rem 1.5rem; text-align: center; display: grid; gap: 0.8rem; max-width: 22rem; width: 100%; justify-items: center; }
.avatar-lg { width: 7rem; height: 7rem; border-radius: 50%; object-fit: cover; border: 4px solid #fbe3ec; }
.avatar { width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; flex: none; }
.editor { display: grid; gap: 0.4rem; }
.editor h2 { margin: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 0.8rem; }
.photo-slot { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: #fbe3ec; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot.add { display: grid; place-items: center; border: 2px dashed #e8a9c1; cursor: pointer; color: var(--accent); font-size: 0.8rem; text-align: center; font-weight: 700; }
.photo-slot.add input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.remove { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 50%; width: 1.6rem; height: 1.6rem; background: rgba(255,255,255,0.9); cursor: pointer; }
.saved { color: #2f8a5a; margin: 0; font-weight: 700; }
.tabs { display: flex; justify-content: center; gap: 0.3rem; padding: 0.6rem; flex-wrap: wrap; }
.tab { border: 0; background: transparent; padding: 0.5rem 0.9rem; border-radius: 999px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.tab.on { background: #fff; color: var(--accent); box-shadow: 0 2px 10px rgba(194, 71, 122, 0.15); }
.area-search { width: 100%; }
.match-list { display: grid; gap: 0.6rem; }
.match-row { display: flex; gap: 0.8rem; align-items: center; text-align: left; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 0.7rem; font: inherit; color: inherit; cursor: pointer; }
.match-row > span { display: grid; min-width: 0; }
.match-row .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--muted); margin: 0; }
.chat { display: grid; gap: 0.8rem; }
.chat-head { display: flex; gap: 0.7rem; align-items: center; }
.chat-body { display: flex; flex-direction: column; gap: 0.4rem; max-height: 55vh; overflow-y: auto; padding: 0.5rem 0; }
.bubble { margin: 0; padding: 0.55rem 0.9rem; border-radius: 18px 18px 18px 4px; background: #f6e6ee; max-width: 80%; align-self: flex-start; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; background: #c2477a; color: #fff; border-radius: 18px 18px 4px 18px; }
.meetups .filters { margin-top: 0; }

:where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
