:root {
	--color-bg: #ffffff;
	--color-accent: #D00047;
	--color-accent-100: #fce6ed;
	--color-accent-700: #8c0031;
	--color-text: #1a1a1a;
	--color-text-muted: rgba(26, 26, 26, 0.6);
	--color-divider: #e5e5e5;
	--color-neutral-200: #ececec;
	--font-heading: "Segoe UI", Arial, sans-serif;
	--font-body: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: var(--font-body);
	color: var(--color-text);
	background: var(--color-bg);
}

.av-app {
	min-height: 100vh;
	background: var(--color-bg);
	display: flex;
	justify-content: center;
}

.av-shell {
	position: relative;
	width: 100%;
	max-width: 460px;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	color: var(--color-text);
	background: var(--color-bg);
	overflow: hidden;
}

.av-shell::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background-image: url('/img/aia-vitality-10th-anniversary.png');
	background-repeat: no-repeat;
	background-position: right 110px;
	background-size: 340px auto;
	opacity: 0.07;
	pointer-events: none;
}

.av-topbar, .av-screen {
	position: relative;
	z-index: 1;
}

.av-topbar {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding: 22px 24px;
	background: var(--color-accent);
	color: #fff;
}

.av-topbar__brand {
	display: flex;
	align-items: center;
	gap: 8px;
}

.av-topbar__logo { height: 58px; width: auto; flex: none; }

.av-screen { padding: 4px 20px 40px; flex: 1; display: none; flex-direction: column; }
.av-screen.is-active { display: flex; }

.av-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent-700); margin-bottom: 6px; margin-top: 20px; }
.av-h1 { font-family: var(--font-heading); font-weight: 800; font-size: 26px; line-height: 1.15; margin: 0 0 10px; }
.av-p { font-size: 14px; line-height: 1.5; color: rgba(26,26,26,0.7); margin: 0 0 24px; }

.btn { padding: 12px 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-primary[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: #f4f4f5; color: var(--color-text); border-color: var(--color-divider); }
.btn-secondary:hover { background: #ebebec; }
.btn-ghost { background: transparent; color: var(--color-text); padding-inline: 0; }
.btn-ghost:hover { text-decoration: underline; }
.av-topbar .btn-ghost { color: #fff; }
.av-topbar .btn-ghost:hover { background: rgba(255,255,255,0.15); text-decoration: none; }
.av-topbar .btn-ghost:active { background: rgba(255,255,255,0.25); }

.av-social { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.av-divider { display: flex; align-items: center; gap: 12px; margin: 4px 0 20px; }
.av-divider__line { flex: 1; height: 1px; background: var(--color-divider); }
.av-divider__label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(26,26,26,0.55); }

.field { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.field:first-of-type { margin-top: 0; }
.field label { font-weight: 600; font-size: 0.85rem; }
.av-input { padding: 10px; border: 1px solid var(--color-divider); border-radius: 8px; font-size: 1rem; background: var(--color-bg); color: var(--color-text); }
.av-input::placeholder { color: rgba(26,26,26,0.4); }
.av-input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 0; }

/* intl-tel-input's own wrapper defaults to inline-block with no set width — without this the phone
   field would sit narrower than every other full-width field in this form. */
.iti { width: 100%; }

.av-error { font-size: 12.5px; font-weight: 600; color: var(--color-accent-700); margin: 10px 0 0; }

.av-icon-badge { width: 56px; height: 56px; background: var(--color-accent-100); border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.seg { display: inline-flex; border: 1px solid var(--color-divider); border-radius: 999px; padding: 3px; background: #f4f4f5; }
.seg.seg-block { display: flex; width: 100%; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt label, .seg-opt > span { display: block; }
.seg-opt {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	color: var(--color-text);
	cursor: pointer;
}
.seg-opt.is-active { background: var(--color-accent); color: #fff; }
.seg.seg-block .seg-opt { flex: 1; }

.card { background: var(--color-bg); color: var(--color-text); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(0,0,0,0.12); border: 1px solid var(--color-divider); }
.card-kicker { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); font-weight: 700; }

.av-steps-row { display: flex; align-items: center; gap: 10px; }
.av-steps-row .av-input { flex: 1; font-size: 20px; font-weight: 600; color: var(--color-text); background: var(--color-bg); border-color: var(--color-divider); }
.av-steps-row .av-input::placeholder { color: rgba(26,26,26,0.4); }
.av-steps-unit { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; }

.av-success { font-size: 12.5px; color: var(--color-accent-700); margin: 0; }

.av-dropzone { width: 100%; aspect-ratio: 16 / 10; border: 1px dashed var(--color-divider); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); font-size: 13px; text-align: center; cursor: pointer; overflow: hidden; }
.av-dropzone img { width: 100%; height: 100%; object-fit: cover; }

.av-ocr-status { font-size: 12.5px; margin: 10px 0 0; }
.av-ocr-status.pending { color: var(--color-text-muted); font-style: italic; }
.av-ocr-status.ready { color: var(--color-accent-700); font-weight: 600; }
.av-ocr-status.none { color: var(--color-text-muted); }

.av-source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.av-source-opt { padding: 16px 12px; border-radius: 10px; border: 1px solid var(--color-divider); background: #f9f9fa; font-family: var(--font-heading); font-weight: 700; font-size: 13.5px; color: var(--color-text); cursor: pointer; text-align: center; }
.av-source-opt:hover { background: #f0f0f2; }
.av-source-opt.is-active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }

.av-source-chosen { display: flex; align-items: center; justify-content: space-between; }
.av-source-chosen span { font-weight: 700; font-size: 13.5px; }

.av-change-source-btn { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--color-accent); background: transparent; color: var(--color-accent); font-family: var(--font-heading); font-weight: 700; font-size: 12px; cursor: pointer; }
.av-change-source-btn:hover { background: var(--color-accent); color: #fff; }
.av-change-source-btn:active { background: var(--color-accent-700); border-color: var(--color-accent-700); color: #fff; }

.av-source-instructions { background: var(--color-accent-100); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.av-source-instructions ol { margin: 0; padding-left: 18px; }
.av-source-instructions li { font-size: 12.5px; line-height: 1.55; color: var(--color-accent-700); margin-bottom: 6px; }
.av-source-instructions li:last-child { margin-bottom: 0; }
.av-source-sample-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-accent-700); margin-top: 12px; }
.av-source-sample { display: block; width: 100%; max-width: 220px; margin: 8px auto 0; border-radius: 10px; border: 1px solid var(--color-divider); }

.av-entries { margin-top: 24px; }
.av-entry { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--color-divider); }
.av-entry__date { font-size: 14px; font-weight: 600; }
.av-entry__source { font-size: 12px; color: rgba(26,26,26,0.55); }
.av-entry__source a { color: var(--color-accent-700); text-decoration: underline; }
.av-entry__steps { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.av-entry__empty { font-size: 13px; color: rgba(26,26,26,0.55); }

.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; margin-top: 4px; }
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-700); }
.tag-outline { background: transparent; color: var(--color-text-muted); border: 1px solid var(--color-divider); }

.av-progress-meta { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }
.av-meter-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.av-meter-label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); }
.av-meter-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.av-meter-track { height: 10px; width: 100%; background: var(--color-neutral-200); border-radius: 999px; position: relative; overflow: hidden; }
.av-meter-fill { height: 100%; background: var(--color-accent); border-radius: 999px; transition: width 0.34s cubic-bezier(0.22, 0.68, 0.36, 1); }

.av-personal-row { display: flex; justify-content: space-between; align-items: baseline; }
.av-personal-value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; font-family: var(--font-heading); }

.av-wheel-frame { position: relative; height: 180px; margin-top: 6px; }
.av-wheel {
	height: 100%;
	overflow-y: auto;
	scroll-snap-type: y mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.av-wheel::-webkit-scrollbar { display: none; }
.av-wheel__item {
	height: 44px;
	line-height: 44px;
	text-align: center;
	font-size: 17px;
	font-weight: 600;
	color: var(--color-text-muted);
	scroll-snap-align: center;
	cursor: pointer;
	transition: color 0.15s, font-size 0.15s;
}
.av-wheel__item.is-selected { color: var(--color-accent); font-size: 23px; }
.av-wheel__spacer { height: 68px; }
.av-wheel__highlight {
	position: absolute;
	top: 68px;
	left: 0;
	right: 0;
	height: 44px;
	border-top: 1px solid var(--color-divider);
	border-bottom: 1px solid var(--color-divider);
	pointer-events: none;
}

.av-mission-card { gap: 10px; }
.av-mission-text { font-size: 15px; line-height: 1.45; font-weight: 600; margin: 4px 0 4px; }
.av-mission-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.av-mission-row .btn { flex: none; padding: 10px 16px; }

.av-streak-card { align-items: flex-start; }
.av-streak-value { font-size: 34px; font-weight: 800; font-family: var(--font-heading); margin-top: 6px; }

.av-badge-card { flex-direction: row; align-items: center; gap: 14px; margin-bottom: 14px; }
.av-badge-card.is-locked { opacity: 0.5; }
.av-badge-icon { font-size: 30px; width: 44px; text-align: center; flex: none; line-height: 1; }
.av-badge-info { flex: 1; min-width: 0; }
.av-badge-label { font-weight: 700; font-size: 15px; }
.av-badge-status { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.av-badge-card .btn { flex: none; padding: 8px 14px; font-size: 13px; }

.av-doc-shell { width: 100%; max-width: 760px; min-height: 100vh; display: flex; flex-direction: column; background: var(--color-bg); }
.av-doc { padding: 32px 24px 64px; }
.av-doc__meta { font-size: 13px; color: var(--color-text-muted); margin: 0 0 28px; }
.av-doc h2 { font-family: var(--font-heading); font-weight: 700; font-size: 17px; margin: 30px 0 10px; color: var(--color-accent-700); }
.av-doc h2:first-of-type { margin-top: 4px; }
.av-doc p { font-size: 14.5px; line-height: 1.65; color: rgba(26,26,26,0.8); margin: 0 0 14px; }
.av-doc ul { padding-left: 20px; margin: 0 0 14px; }
.av-doc li { font-size: 14.5px; line-height: 1.65; color: rgba(26,26,26,0.8); margin-bottom: 6px; }
.av-doc a { color: var(--color-accent-700); }
.av-doc strong { color: var(--color-text); }

/* ---- Admin panel ---- */

.av-admin-login-shell { width: 100%; max-width: 380px; min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; padding: 24px; }
.av-admin-login-card { background: var(--color-bg); border: 1px solid var(--color-divider); border-radius: 12px; padding: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.av-admin-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.av-admin-login-brand img { height: 36px; width: auto; }
.av-admin-login-brand span { font-family: var(--font-heading); font-weight: 800; font-size: 18px; color: var(--color-accent); }

.av-admin-shell { width: 100%; min-height: 100vh; display: flex; flex-direction: column; background: var(--color-bg); }
.av-admin-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 16px 28px; background: var(--color-accent); color: #fff; }
.av-admin-nav__brand { height: 30px; width: auto; margin-right: 24px; display: block; }
.av-admin-nav a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 13.5px; font-weight: 600; padding: 8px 12px; border-radius: 6px; }
.av-admin-nav a:hover { background: rgba(255,255,255,0.15); color: #fff; }
.av-admin-nav a.is-active { background: rgba(255,255,255,0.22); color: #fff; }
.av-admin-nav__spacer { flex: 1; }

.av-admin-main { max-width: 1160px; width: 100%; margin: 0 auto; padding: 28px 24px 64px; }
.av-admin-h1 { font-family: var(--font-heading); font-weight: 800; font-size: 22px; margin: 0 0 20px; }

.av-admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.av-admin-stat { background: var(--color-bg); border: 1px solid var(--color-divider); border-radius: 12px; padding: 18px 20px; }
.av-admin-stat__label { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); font-weight: 700; }
.av-admin-stat__value { font-size: 26px; font-weight: 800; font-family: var(--font-heading); margin-top: 6px; }
.av-admin-stat__meta { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }

.av-admin-card { background: var(--color-bg); border: 1px solid var(--color-divider); border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.av-admin-card h2 { font-family: var(--font-heading); font-weight: 700; font-size: 16px; margin: 0 0 16px; }

.av-admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.av-admin-table th, .av-admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--color-divider); vertical-align: middle; }
.av-admin-table th { font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-text-muted); font-weight: 700; }
.av-admin-table tbody tr:hover { background: #fafafa; }
.av-admin-table a { color: var(--color-accent-700); }
.av-admin-table img.av-admin-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--color-divider); }

.av-admin-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.av-admin-form .field { margin-top: 0; }
.av-admin-form-inline { display: flex; gap: 8px; align-items: center; }
.av-admin-form-inline .av-input { width: 90px; }

.av-admin-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.av-admin-badge--warn { background: var(--color-accent-100); color: var(--color-accent-700); }
.av-admin-badge--ok { background: #e7f6ec; color: #1c7a3c; }

.av-admin-alert { padding: 12px 16px; border-radius: 8px; font-size: 13.5px; margin-bottom: 20px; }
.av-admin-alert--error { background: var(--color-accent-100); color: var(--color-accent-700); }
.av-admin-alert--ok { background: #e7f6ec; color: #1c7a3c; }

.av-admin-btn-icon { background: transparent; border: 1px solid var(--color-divider); border-radius: 6px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; }
.av-admin-btn-icon:hover { background: #f4f4f5; }

.av-admin-pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px; border-top: 1px solid var(--color-divider); }
.av-admin-pager__label { font-size: 13px; color: var(--color-text-muted); }
.av-admin-pager__disabled { opacity: 0.4; pointer-events: none; }
