:root {
	color-scheme: light;
	--bg: #f3f4f6;
	--card: rgba(255, 255, 255, 0.88);
	--card-border: rgba(255, 255, 255, 0.72);
	--text: #111827;
	--muted: #6b7280;
	--line: rgba(15, 23, 42, 0.08);
	--accent: #111827;
	--accent-soft: rgba(17, 24, 39, 0.08);
	--shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
	background:
		radial-gradient(circle at top, rgba(255, 255, 255, 0.92), rgba(243, 244, 246, 0.96)),
		linear-gradient(180deg, #eef2ff 0%, #f3f4f6 35%, #f8fafc 100%);
	color: var(--text);
	padding: 14px 16px 48px;
}

.container {
	max-width: 860px;
	margin: 0 auto;
}

.card {
	background: rgba(255, 255, 255, 0.94);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	border: 1px solid rgba(148, 163, 184, 0.24);
	border-radius: 28px;
	padding: 24px;
	margin-top: 18px;
	box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.top-strip {
	padding: 4px 2px 6px;
}

.top-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
}

.eyebrow {
	margin: 0;
	color: var(--muted);
	font-size: 13px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}


h1 {
	margin: 8px 0 0;
	font-size: clamp(34px, 6vw, 46px);
	line-height: 1.08;
}

.hero-copy {
	margin: 10px 0 0;
	color: var(--muted);
	font-size: 16px;
}

.hero-copy::before {
	content: "✨ ";
}


#weight-panel {
	background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
	border-color: rgba(59, 130, 246, 0.28);
}

#measure-panel {
	background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
	border-color: rgba(139, 92, 246, 0.28);
}

.mode-switch {
	background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
	border-color: rgba(15, 23, 42, 0.18);
}

#latest-card {
	background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
	border-color: rgba(16, 185, 129, 0.24);
}

.chart-card {
	background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
	border-color: rgba(245, 158, 11, 0.24);
}

.user-bar {
	margin-top: 4px;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	color: #374151;
	font-size: 14px;
	white-space: nowrap;
}

.ghost-button {
	appearance: none;
	border: 1px solid rgba(148, 163, 184, 0.35);
	background: rgba(255, 255, 255, 0.8);
	color: #374151;
	border-radius: 14px;
	padding: 8px 12px;
	font: inherit;
	cursor: pointer;
}

.ghost-button:hover {
	transform: translateY(-1px);
}

.auth-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.auth-grid h3 {
	margin: 0;
	font-size: 18px;
}

.auth-message {
	min-height: 22px;
	margin: 16px 2px 0;
	font-size: 14px;
	color: var(--muted);
}

.auth-message.error {
	color: #dc2626;
}

.auth-message.success {
	color: #059669;
}

.mode-switch {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	padding: 10px;
}

.quick-entry-zone,
.insight-zone {
	display: grid;
	gap: 0;
}

.quick-entry-zone {
	margin-top: 8px;
}

.insight-zone {
	margin-top: 8px;
}

.mode-button,
.primary-button,
.filter-chip {
	appearance: none;
	border: none;
	border-radius: 18px;
	font: inherit;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.mode-button {
	padding: 14px 18px;
	background: transparent;
	color: var(--muted);
	font-weight: 600;
}

.mode-button.active {
	background: var(--accent);
	color: white;
	box-shadow: 0 12px 24px rgba(17, 24, 39, 0.16);
}

.section-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}

.section-heading h2 {
	margin: 0;
	font-size: 22px;
}

.section-heading p {
	margin: 6px 0 0;
	color: var(--muted);
	font-size: 14px;
}

.record-form {
	display: grid;
	gap: 16px;
}

.record-form label {
	display: grid;
	gap: 8px;
	color: #374151;
	font-size: 14px;
	font-weight: 600;
}

.record-form input {
	width: 100%;
	border: 1px solid rgba(148, 163, 184, 0.22);
	border-radius: 18px;
	padding: 14px 16px;
	font: inherit;
	color: var(--text);
	background: rgba(255, 255, 255, 0.92);
	outline: none;
}

.record-form input:focus {
	border-color: rgba(59, 130, 246, 0.35);
	box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.record-form input[type="date"] {
	width: 100%;
	max-width: 100%;
	min-height: 48px;
	font-size: 16px;
	line-height: 1.2;
	-webkit-appearance: none;
	appearance: none;
}

.record-form input[type="date"]::-webkit-date-and-time-value {
	text-align: left;
}

.primary-button {
	padding: 14px 18px;
	background: var(--accent);
	color: white;
	font-weight: 700;
}

#weight-panel .primary-button {
	background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
	box-shadow: 0 14px 28px rgba(29, 78, 216, 0.28);
	letter-spacing: 0.01em;
}

#weight-panel .primary-button:hover {
	box-shadow: 0 18px 34px rgba(29, 78, 216, 0.34);
}

#weight-panel .primary-button:focus-visible {
	outline: 3px solid rgba(59, 130, 246, 0.36);
	outline-offset: 2px;
}

.primary-button:hover,
.mode-button:hover,
.filter-chip:hover {
	transform: translateY(-1px);
}

.measure-grid .grid-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.latest-highlight,
.latest-grid {
	display: grid;
	gap: 14px;
}

.latest-highlight {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: end;
}

.single-metric {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-label {
	margin: 0 0 6px;
	color: var(--muted);
	font-size: 13px;
}

.meta-value {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
}

.metric-value {
	margin: 0;
	font-size: clamp(28px, 4vw, 38px);
	font-weight: 800;
	letter-spacing: -0.03em;
}

.metric-value span {
	margin-left: 6px;
	font-size: 16px;
	color: var(--muted);
}

.delta {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
}

.delta.up {
	color: #ef4444;
}

.delta.down {
	color: #10b981;
}

.delta.neutral {
	color: var(--muted);
}

.latest-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.latest-date-row,
.latest-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.72);
	border: 1px solid rgba(148, 163, 184, 0.12);
}

.latest-date-row {
	grid-column: 1 / -1;
}

.chart-heading {
	align-items: flex-start;
}

.measure-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
}

.filter-chip {
	padding: 10px 14px;
	background: var(--accent-soft);
	color: #374151;
	font-size: 14px;
	font-weight: 600;
}

.filter-chip.active {
	background: var(--accent);
	color: white;
}

.chart-wrap {
	position: relative;
	height: 360px;
	margin-top: 16px;
}

.empty-state {
	padding: 20px;
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.72);
	border: 1px dashed rgba(148, 163, 184, 0.32);
	color: var(--muted);
	text-align: center;
}

.hidden {
	display: none;
}

.admin-shell {
	max-width: 1080px;
}

.admin-top {
	margin-bottom: 6px;
}

.admin-overview {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

.admin-stat {
	padding: 16px;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.82);
	border: 1px solid rgba(148, 163, 184, 0.18);
}

.admin-table-wrap {
	overflow-x: auto;
}

.admin-table {
	width: 100%;
	min-width: 900px;
	border-collapse: collapse;
	font-size: 14px;
}

.admin-table th,
.admin-table td {
	padding: 12px 10px;
	border-bottom: 1px solid rgba(148, 163, 184, 0.2);
	text-align: left;
	vertical-align: middle;
}

.admin-table th {
	font-size: 13px;
	font-weight: 700;
	color: #475569;
	white-space: nowrap;
}

.table-sub {
	font-size: 12px;
	color: #6b7280;
}

.admin-badge {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	background: rgba(37, 99, 235, 0.14);
	color: #1d4ed8;
}

.admin-empty {
	text-align: center;
	color: #6b7280;
}

@media (max-width: 720px) {
	body {
		padding: 10px 12px 40px;
	}

	.card {
		padding: 20px;
		border-radius: 24px;
	}

	.quick-entry-zone {
		min-height: 88vh;
	}

	#weight-panel {
		min-height: 66vh;
	}

	#weight-panel .primary-button {
		padding: 15px 18px;
	}

	.insight-zone {
		margin-top: 22px;
	}

	.top-row {
		flex-direction: column;
		align-items: stretch;
	}

	.user-bar {
		justify-content: space-between;
		margin-top: 2px;
	}

	h1 {
		font-size: clamp(28px, 8.5vw, 38px);
	}

	.hero-copy {
		font-size: 14px;
	}

	.card {
		box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
	}

	.latest-highlight,
	.single-metric,
	.latest-grid,
	.measure-grid .grid-fields,
	.mode-switch,
	.auth-grid {
		grid-template-columns: 1fr;
	}

	.section-heading,
	.chart-heading {
		flex-direction: column;
		align-items: stretch;
	}

	.measure-filters {
		justify-content: flex-start;
	}

	.chart-wrap {
		height: 320px;
	}

	.admin-overview {
		grid-template-columns: 1fr;
	}

	.admin-table {
		min-width: 760px;
		font-size: 13px;
	}
}