: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: #0f4c3a; --gold: #c9a227; color-scheme: light; --bg: #fbfaf6; --fg: #14201b; --border: #e2ddcf; }
body { font-family: "Georgia", serif; }
button, input, select, textarea, .small, .hint, .badge { font-family: var(--font); }
h1, h2, h3 { margin: 0; }
html { scroll-behavior: smooth; }
.brand-btn { background: none; border: 0; color: #fff; text-align: left; cursor: pointer; padding: 0; }
.brand-logo { border-radius: 50%; background: #fff; object-fit: cover; }
.topnav { gap: 1rem; align-items: center; }
.topnav a { color: #fff; text-decoration: none; }
.btn.gold { background: var(--gold); color: #14201b; border-color: var(--gold); }
.btn.ghost { background: transparent; color: #fff; border: 1px solid #fff; }
.btn.sm { padding: .35rem .8rem; }
.home-hero { background: radial-gradient(circle at 50% 0%, #1b6b4f, #0a3a2b 70%); color: #fff; text-align: center; }
.btn { font-family: var(--font); }
.home-hero-in { max-width: 44rem; margin: 0 auto; padding: 3.5rem 1.25rem 4rem; display: grid; gap: 1rem; justify-items: center; }
.home-logo { border-radius: 50%; background: #fff; border: 4px solid var(--gold); width: 9.5rem; height: 9.5rem; object-fit: cover; }
.home-hero h1 { font-size: clamp(2.4rem, 8vw, 4rem); line-height: 1.05; }
.eyebrow.light { color: #e8cf6a; }
.lede.light { color: #e9f2ee; font-size: 1.15rem; margin: 0; }
.home-hero .row { justify-content: center; }
.band { padding: 3.5rem 0; }
.band.alt { background: #f1eee3; }
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1.25rem; display: grid; gap: 1.25rem; }
.wrap.two { gap: 2rem; }
@media (min-width: 52rem) { .wrap.two { grid-template-columns: 1.3fr 1fr; align-items: center; } }
.band h2 { color: var(--accent); font-size: clamp(1.6rem, 5vw, 2.2rem); }
.pillars { display: grid; gap: .75rem; }
.pillar { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: .9rem 1rem; display: grid; }
.pillar span { color: var(--muted); font-family: var(--font); font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { font-family: var(--font); border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: .35rem .9rem; cursor: pointer; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.news-grid { display: grid; gap: 1rem; }
@media (min-width: 52rem) { .news-grid { grid-template-columns: repeat(2, 1fr); } .lead-news { grid-column: 1 / -1; } }
.news { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: grid; gap: .5rem; align-content: start; }
.news time { color: var(--muted); font-family: var(--font); font-size: .8rem; }
.news p { margin: 0; line-height: 1.55; }
.lead-news h3 { font-size: 1.5rem; color: var(--accent); }
.acts { display: grid; gap: .75rem; }
.act { display: flex; gap: 1rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; flex-wrap: wrap; }
.act-date { font-family: var(--font); font-weight: 600; color: var(--accent); min-width: 6.5rem; }
.gallery { display: grid; gap: .75rem; }
@media (min-width: 40rem) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery img { width: 100%; height: 14rem; object-fit: cover; border-radius: var(--radius); }
.join-band { background: var(--accent); color: #fff; text-align: center; padding: 3rem 0; }
.join-band .wrap { justify-items: center; }
.join-band h2 { color: #fff; }
textarea.input { resize: vertical; }
.top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem;
	padding: .9rem 1.25rem; background: var(--accent); color: #fff; border-bottom: 3px solid var(--gold); }
.top .link { color: #fff; }
.brand { display: flex; gap: .7rem; align-items: center; }
.brand small { display: block; font-size: .75rem; opacity: .8; font-family: var(--font); }
.crest { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--gold); color: var(--accent);
	display: grid; place-items: center; font-weight: 700; border: 2px solid #fff; }
.hero { display: grid; gap: 2rem; padding: 3rem 1.25rem; max-width: 64rem; margin: 0 auto; }
@media (min-width: 52rem) { .hero { grid-template-columns: 1.2fr 1fr; align-items: center; padding: 5rem 1.5rem; } }
.eyebrow { color: #8a6d12; text-transform: uppercase; letter-spacing: .12em; font: 600 .78rem var(--font); }
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.1; margin: .5rem 0 1rem; color: var(--accent); }
.feat { padding: 0; list-style: none; display: grid; gap: .5rem; font-family: var(--font); }
.feat li { padding-left: 1.4rem; position: relative; }
.feat li::before { content: "◆"; position: absolute; left: 0; color: var(--gold); }
.auth { background: #fff; box-shadow: 0 10px 30px rgba(15, 76, 58, .1); }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.small { font-size: .85rem; }
.err { color: var(--danger); }
.narrow { max-width: 14rem; }
.wide { padding-top: 1.5rem; }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab, .chip { border: 1px solid var(--border); background: #fff; padding: .5rem .9rem; border-radius: 999px; cursor: pointer; font: 500 .9rem var(--font); color: var(--fg); }
.tab.on, .chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chat { display: grid; gap: .75rem; background: #fff; }
.msgs { height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; padding: .5rem;
	background: #f4f1e8; border-radius: var(--radius); }
.msg { max-width: 85%; background: #fff; padding: .5rem .75rem; border-radius: 12px; border: 1px solid var(--border); font-family: var(--font); }
.msg.mine { align-self: flex-end; background: #e3efe9; }
.msg .meta { font-size: .72rem; color: var(--muted); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.compose { display: flex; gap: .5rem; }
.join-card { margin-top: 1.25rem; background: #fff; color: var(--fg); border-radius: 16px; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.join-card img { display: block; width: 100%; height: 190px; object-fit: cover; }
.join-card-body { display: flex; gap: .75rem; align-items: center; padding: .75rem 1rem; }
.join-card-body span { display: block; font-size: .78rem; color: var(--muted); }
.join-chat { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.jc-bubble { display: flex; gap: .5rem; align-items: flex-end; max-width: 85%; }
.jc-bubble i { width: 28px; height: 28px; border-radius: 50%; background: #e8c04a; color: #123; font-style: normal; font-weight: 700; display: grid; place-items: center; font-size: .8rem; flex: none; }
.jc-bubble p { margin: 0; background: #fff; color: var(--fg); padding: .5rem .8rem; border-radius: 16px 16px 16px 4px; font-size: .9rem; }
.jc-bubble.mine { align-self: flex-end; }
.jc-bubble.mine p { background: #dcf3e4; border-radius: 16px 16px 4px 16px; }
.rooms { display: flex; gap: .5rem; overflow-x: auto; }
.room { display: flex; align-items: center; gap: .6rem; text-align: left; flex: 1 1 200px; border: 1px solid var(--border); background: #fff;
	border-radius: 14px; padding: .5rem .75rem; cursor: pointer; font: 500 .9rem var(--font); color: var(--fg); }
.room span:last-child { display: grid; }
.room small { color: var(--muted); font-size: .75rem; }
.room.on { background: #e3efe9; border-color: var(--accent); }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center;
	font-weight: 700; font-size: .9rem; }
.avatar.sm { width: 30px; height: 30px; font-size: .72rem; background: #6b8f7d; }
.chat-head { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem; border-bottom: 1px solid var(--border); }
.msg { display: flex; gap: .45rem; align-items: flex-end; max-width: 92%; background: none; border: 0; padding: 0; }
.msg.mine { flex-direction: row-reverse; background: none; }
.msg .bubble { background: #fff; border: 1px solid var(--border); border-radius: 16px 16px 16px 4px; padding: .45rem .75rem; min-width: 0; }
.msg.mine .bubble { background: #dcefe3; border-radius: 16px 16px 4px 16px; }
.msg .time { font-size: .65rem; color: var(--muted); text-align: right; }
.compose .input { border-radius: 999px; }
.compose .btn { border-radius: 999px; }
.between { justify-content: space-between; }
.act { background: #fff; display: grid; gap: .4rem; border-left: 4px solid var(--gold); }
.badge.gold { background: var(--gold); color: var(--accent); border: 0; font-weight: 600; }
.st-Completed, .k-income { background: #e3efe9; color: var(--accent); }
.st-Inprogress, .k-budget { background: #fbf1d3; color: #7a5d00; }
.k-expense, .st-Upcoming { background: #f9e4e1; color: #8c2a1c; }
.stats { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr)); }
.stat { background: var(--accent); color: #fff; padding: 1rem; border-radius: var(--radius); }
.stat small { display: block; opacity: .8; font-family: var(--font); }
.stat b { font-size: 1.35rem; }
.admin-unlock { margin-top: 2rem; }
.foot { text-align: center; padding: 2rem 1rem; color: var(--muted); font-size: .85rem; }

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