* { box-sizing: border-box; }
body {
	margin: 0;
	font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
	background: radial-gradient(circle at 18% 18%, rgba(110, 40, 217, 0.08), rgba(14, 165, 233, 0.05)), #0a0f1f;
	color: #e5e7eb;
}
a { color: #0d6efd; text-decoration: none; }
a:hover { text-decoration: underline; }

.nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 24px;
	background: #0a0f1f;
	color: #fff;
	position: sticky;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 10;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}
.nav a { color: #d4e1ff; }
.nav__actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav__brand { font-weight: 700; letter-spacing: 0.02em; font-size: 1.05rem; }
.nav__brand a { color: #fff; text-decoration: none; }
.nav__user { padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,0.08); color: #e5ecff; font-weight: 600; }
.nav__support { margin: 0; }
.nav__support .ghost-button { padding: 8px 10px; }
.nav__supporter { padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,0.08); color: #e5ecff; font-weight: 700; }

/* Mobile menu (keeps navbar uncluttered on small screens) */
.nav__mobile { display: none; align-items: center; gap: 10px; }
.nav__mobile .nav__support { margin: 0; }
.nav__mobile .nav__support .ghost-button { padding: 9px 10px; }
.nav__supporter--compact { padding: 8px 10px; }
.nav__menu { position: relative; }
.nav__menu summary { list-style: none; cursor: pointer; }
.nav__menu summary::-webkit-details-marker { display: none; }
.nav__menuPanel {
	position: absolute;
	right: 0;
	top: calc(100% + 10px);
	min-width: 240px;
	padding: 10px;
	border-radius: 14px;
	background: rgba(11, 16, 33, 0.98);
	border: 1px solid rgba(255,255,255,0.10);
	box-shadow: 0 18px 60px rgba(0,0,0,0.55);
	display: grid;
	gap: 10px;
}
.nav__menuUser { font-weight: 700; color: #e5ecff; overflow-wrap: anywhere; }
.nav__menuPanel a,
.nav__menuPanel button,
.nav__menuPanel form {
	width: 100%;
}
.nav__menuPanel a.ghost-button,
.nav__menuPanel button.ghost-button {
	justify-content: flex-start;
}
.nav__menuPanel form { margin: 0; }

@media (max-width: 640px) {
	.nav {
		padding-top: max(12px, env(safe-area-inset-top));
		padding-right: max(14px, env(safe-area-inset-right));
		padding-bottom: 12px;
		padding-left: max(14px, env(safe-area-inset-left));
	}
	.nav__actions { display: none; }
	.nav__mobile { display: flex; }
}

.page { max-width: 1140px; margin: 36px auto; padding: 0 18px 48px; }
.hero { display: grid; gap: 20px; }
.hero + .hero { margin-top: 32px; }

.card {
	background: rgba(255,255,255,0.04);
	padding: 18px 20px;
	border-radius: 16px;
	box-shadow: 0 18px 50px rgba(0,0,0,0.35);
	display: grid;
	gap: 10px;
	border: 1px solid rgba(255,255,255,0.06);
}
.card.hoverable:hover { box-shadow: 0 24px 65px rgba(0, 0, 0, 0.45); transform: translateY(-2px); transition: 180ms ease; }

label { font-weight: 600; color: #e5e7eb; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
	width: 100%;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid #cbd5e1;
	background: #f8fafc;
}

input:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: rgba(147, 197, 253, 0.95);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding-right: 38px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 16px 16px;
}

select:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.field { display: grid; gap: 6px; font-weight: 600; }
.field.wide { grid-column: 1 / -1; }
.form-grid { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
@media (min-width: 960px) {
	.form-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

.button {
	display: inline-block;
	padding: 12px 16px;
	border-radius: 12px;
	background: linear-gradient(135deg, #6d28d9, #0ea5e9);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 12px 40px rgba(109, 40, 217, 0.35);
}
.button:hover { background: linear-gradient(135deg, #7c3aed, #22b0ef); }

button {
	padding: 11px 14px;
	border: none;
	border-radius: 10px;
	background: linear-gradient(135deg, #6d28d9, #0ea5e9);
	color: #fff;
	cursor: pointer;
	font-weight: 700;
	letter-spacing: 0.01em;
}
button:hover { background: linear-gradient(135deg, #7c3aed, #22b0ef); }

.status { font-size: 0.9rem; color: #0f172a; min-height: 1.2em; }
.link-button {
	background: transparent;
	color: #d4e1ff;
	padding: 6px 10px;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	font-weight: 600;
}
.link-button:hover { text-decoration: underline; color: #f8fbff; }

.card-list { display: grid; gap: 14px; }
.card-link { text-decoration: none; color: inherit; }
.grid.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.grid.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }

/* Allow grid children to shrink on narrow screens (prevents horizontal scroll) */
.grid.two > *,
.grid.three > * {
	min-width: 0;
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.button-row form { margin: 0; display: inline-flex; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.08); text-align: left; color: #e5e7eb; }
.table th { background: rgba(255,255,255,0.05); color: #f8fafc; }
.table--sticky-first th:first-child, .table--sticky-first td:first-child {
	position: sticky;
	left: 0;
	background: rgba(10,15,31,0.9);
	backdrop-filter: blur(4px);
}
.table--sticky-first th:first-child { z-index: 2; }
.actions-col { width: 92px; text-align: center; }
.table-actions { display: inline-flex; gap: 6px; align-items: center; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; border: 1px solid rgba(255,255,255,0.06); }
.table-scroll .table { min-width: 760px; }
@media (max-width: 720px) {
	.table th, .table td { padding: 8px 6px; font-size: 0.92rem; }
}

.table-cards { display: none; gap: 10px; }
.table-card {
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 12px;
	padding: 12px 14px;
	background: rgba(255,255,255,0.04);
	box-shadow: 0 6px 26px rgba(0,0,0,0.25);
}
.table-card__row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.table-card__row:last-child { border-bottom: none; }
.table-card__row span:first-child { color: #9ca3af; font-weight: 600; }
.table-card__row span:last-child { color: #e5e7eb; text-align: right; }
.table-card__header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.table-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.ghost-button.danger { border-color: rgba(248,113,113,0.6); color: #fecdd3; }
.ghost-button.danger:hover { background: rgba(248,113,113,0.12); }

dialog.modal {
	border: none;
	padding: 0;
	border-radius: 16px;
	max-width: min(860px, calc(100vw - 28px));
	width: 100%;
	background: rgba(10,15,31,0.96);
	color: #e5e7eb;
	box-shadow: 0 18px 70px rgba(0,0,0,0.65);
}
dialog.modal::backdrop {
	background: rgba(0,0,0,0.55);
	backdrop-filter: blur(3px);
}
.modal__content {
	padding: 14px 16px;
}

.icon-btn svg { width: 16px; height: 16px; }
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.hide-mobile { display: block; }
.show-mobile { display: none; }
@media (max-width: 640px) {
	.hide-mobile { display: none; }
	.show-mobile { display: grid; }
	.grid.two { grid-template-columns: 1fr; }
	.page { padding-left: 14px; padding-right: 14px; }
}

.chart-container { width: 100%; height: clamp(220px, 50vw, 360px); overflow: hidden; }
.chart-container > div,
.chart-container svg {
	max-width: 100% !important;
}

/* Google Charts can inject fixed-width wrappers; force them to stay within the card */
.chart-container {
	min-width: 0;
	max-width: 100%;
	overflow-x: hidden;
}
.chart-container > div {
	width: 100% !important;
}
.chart-container svg {
	width: 100% !important;
}

/* Stack card title + pills on mobile to avoid overflow */
.card-title-row--stack {
	align-items: flex-start;
	flex-wrap: wrap;
}
.card-title-row--stack h3 {
	white-space: normal;
	overflow: visible;
	text-overflow: unset;
}
@media (max-width: 640px) {
	.card-title-row--stack {
		flex-direction: column;
		align-items: flex-start;
	}
}

.muted { color: #9ca3af; font-size: 0.95rem; }
.error { color: #b91c1c; font-size: 0.9rem; margin-left: 6px; }
textarea { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid #cbd5e1; }

.badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; background: #e0e7ff; color: #1e3a8a; }
.tag { display: inline-flex; padding: 4px 8px; border-radius: 10px; background: #ecfeff; color: #0f172a; font-weight: 600; font-size: 0.85rem; }

.stack { display: grid; gap: 10px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-title-row h4, .card-title-row h3 {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.card-title-row .badge {
	flex-shrink: 0;
	white-space: nowrap;
}

.list-grid { display: grid; gap: 10px; }

.pill-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card p, .item-card p { overflow-wrap: anywhere; }
.item-card { border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 12px 14px; background: rgba(255,255,255,0.04); box-shadow: 0 6px 26px rgba(0,0,0,0.25); color: #e5e7eb; overflow-wrap: anywhere; }
.item-card h4 { margin: 0 0 6px 0; color: #f8fafc; }
.item-meta { color: #9ca3af; font-size: 0.9rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-word; }
.item-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.item-actions form,
.table-actions form,
.table-card__actions form {
	display: inline-flex;
	margin: 0;
	align-items: center;
}
.ghost-button {
	padding: 10px 12px;
	border-radius: 10px;
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(255,255,255,0.1);
	color: #e5e7eb;
	font-weight: 600;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1.1;
	gap: 6px;
}
.ghost-button:hover { background: rgba(255,255,255,0.08); }
button.ghost-button {
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(255,255,255,0.1);
	color: #e5e7eb;
	box-shadow: none;
	padding: 10px 12px;
}
.table-card__actions .ghost-button { padding: 8px 12px; line-height: 1; font-size: 0.95rem; }
.table-card__actions form { margin: 0; }

details.fieldset {
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 12px;
	padding: 10px 12px;
	background: rgba(255,255,255,0.02);
}
details.fieldset summary {
	font-weight: 700;
	cursor: pointer;
	margin-bottom: 8px;
}
details.fieldset[open] {
	background: rgba(255,255,255,0.04);
}
details.fieldset > *:not(summary) {
	margin-top: 6px;
}

.landing-hero {
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	align-items: center;
}
.landing-hero__copy { display: grid; gap: 14px; }
.landing-hero__copy h1 { margin: 0; font-size: 2.3rem; color: #f8fafc; }
.landing-hero__copy .lede { font-size: 1.05rem; color: #cbd5e1; max-width: 42ch; }
.pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(109, 40, 217, 0.16);
	color: #c4b5fd;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 0.78rem;
}
.hero-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.metric { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 10px 12px; }
.metric__label { color: #9ca3af; font-size: 0.9rem; display: block; margin-bottom: 4px; }
.metric strong { color: #f8fafc; font-size: 1.05rem; }

.landing-hero__panel { position: relative; }
.panel-glow { position: absolute; inset: -20px; background: radial-gradient(circle at 30% 30%, rgba(14,165,233,0.35), rgba(109,40,217,0.25), rgba(10,15,31,0.6)); filter: blur(40px); z-index: 0; }
.panel-card { position: relative; z-index: 1; background: rgba(10,15,31,0.85); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 14px 16px; display: grid; gap: 12px; box-shadow: 0 18px 60px rgba(0,0,0,0.45); }
.panel-header { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.3); }
.dot--blue { background: #0ea5e9; }
.dot--purple { background: #6d28d9; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.chip { display: inline-block; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); color: #e5e7eb; margin-bottom: 6px; font-size: 0.95rem; }
.panel-footer { color: #cbd5e1; font-size: 0.95rem; }

.feature-cards .card.subtle { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); box-shadow: none; }

.callout { display: flex; justify-content: space-between; align-items: center; gap: 14px; background: linear-gradient(135deg, rgba(109,40,217,0.16), rgba(14,165,233,0.18)); border: 1px solid rgba(255,255,255,0.12); }
.callout__copy h2 { margin: 0 0 6px 0; color: #f8fafc; }
.callout__copy { max-width: 640px; }

.hide-desktop { display: inline-flex; }
@media (min-width: 900px) {
	.hide-desktop { display: none !important; }
}

.supporter { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: center; background: linear-gradient(135deg, rgba(109,40,217,0.14), rgba(14,165,233,0.12)); border: 1px solid rgba(255,255,255,0.12); }
.supporter__copy h2 { margin: 0 0 6px 0; color: #f8fafc; }
.supporter__actions { display: grid; gap: 6px; justify-items: start; }

input, select, textarea {
	color: #0f172a;
}
input::placeholder { color: #94a3b8; }
