/* The assistant sign-in and consent pages (apps/server/src/connect/pages.tsx). Tokens and rules
   are the approved prototype's: artifacts/ai-baglanti screen.css with the artifact kit's
   theme.css and kit.css values it relies on. Light only, as the app is.
   Fonts: Baloo 2 and Nunito from @fontsource-variable 5.3.0, SIL Open Font License 1.1. */

/* Declare latin-ext before latin so CSS Fonts 4 reverse-order matching resolves
   overlapping code points (such as U+0131) from the preloaded latin subset. */
@font-face {
	font-family: "Baloo 2";
	src: url("fonts/baloo-2-latin-ext-wght-normal.woff2") format("woff2");
	font-weight: 400 800;
	font-display: fallback;
	unicode-range:
		U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Baloo 2";
	src: url("fonts/baloo-2-latin-wght-normal.woff2") format("woff2");
	font-weight: 400 800;
	font-display: fallback;
	unicode-range:
		U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Nunito";
	src: url("fonts/nunito-latin-ext-wght-normal.woff2") format("woff2");
	font-weight: 200 1000;
	font-display: fallback;
	unicode-range:
		U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Nunito";
	src: url("fonts/nunito-latin-wght-normal.woff2") format("woff2");
	font-weight: 200 1000;
	font-display: fallback;
	unicode-range:
		U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Weight-matched fallbacks (measured against Baloo 2 600 and Nunito 600/800) so slow
   cold loads stay visible past font-display: fallback's ~100ms block window without
   shifting layout. Nunito splits at 649/650 so 600 body copy stays Regular and 700/800
   CTAs render Bold; Roboto Bold falls back to variable local("Roboto") on Android 12+. */
@font-face {
	font-family: "Baloo 2 Fallback: Arial";
	src: local("Arial Bold"), local("Arial-BoldMT");
	font-weight: 400 800;
	ascent-override: 118.1528%;
	descent-override: 57.4323%;
	line-gap-override: 0%;
	size-adjust: 91.2378%;
}
@font-face {
	font-family: "Baloo 2 Fallback: Roboto";
	src: local("Roboto Bold"), local("Roboto-Bold"), local("Roboto");
	font-weight: 400 800;
	ascent-override: 117.894%;
	descent-override: 57.306%;
	line-gap-override: 0%;
	size-adjust: 91.438%;
}
@font-face {
	font-family: "Nunito Fallback: Arial";
	src: local("Arial"), local("ArialMT");
	font-weight: 100 649;
	ascent-override: 98.8449%;
	descent-override: 34.5126%;
	line-gap-override: 0%;
	size-adjust: 102.2815%;
}
@font-face {
	font-family: "Nunito Fallback: Arial";
	src: local("Arial Bold"), local("Arial-BoldMT");
	font-weight: 650 900;
	ascent-override: 101.7084%;
	descent-override: 35.5124%;
	line-gap-override: 0%;
	size-adjust: 99.4018%;
}
@font-face {
	font-family: "Nunito Fallback: Roboto";
	src: local("Roboto"), local("Roboto Regular"), local("Roboto-Regular");
	font-weight: 100 649;
	ascent-override: 98.628%;
	descent-override: 34.437%;
	line-gap-override: 0%;
	size-adjust: 102.506%;
}
@font-face {
	font-family: "Nunito Fallback: Roboto";
	src: local("Roboto Bold"), local("Roboto-Bold"), local("Roboto");
	font-weight: 650 900;
	ascent-override: 101.486%;
	descent-override: 35.435%;
	line-gap-override: 0%;
	size-adjust: 99.62%;
}

:root {
	--bg: #fff8f3;
	--card: #ffffff;
	--line: #f5e6dd;
	--line-warm: #e6ccbb;
	--line-strong: #d5b29c;
	--ink: #6b4a3d;
	--ink-2: #8a685a;
	--peach: #f8bfa8;
	--peach-dark: #e8977a;
	--peach-tint: #fff0e7;
	--peach-ink: #a8573a;
	--on-peach: #543a30;
	--coral: #cb4137;
	--chat-ink: #0d0d0d;
	--ios-green: #34c759;
	--head:
		"Baloo 2", "Baloo 2 Fallback: Arial", "Baloo 2 Fallback: Roboto",
		ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
	--body:
		"Nunito", "Nunito Fallback: Arial", "Nunito Fallback: Roboto", ui-rounded,
		system-ui, -apple-system, "Segoe UI", sans-serif;
	--hfloor: 1.36;
	--shadow-cta: 0 6px 16px rgba(232, 151, 122, 0.33);
	--shadow-lift: 0 2px 10px rgba(107, 74, 61, 0.09);
	--t-press: 150ms;
	--t-quick: 240ms;
	--ease-press: ease-out;
	--ease-rise: cubic-bezier(0.455, 0.03, 0.515, 0.955);
	--gut: 20px;
	--page-max: 440px;
	--sa-t: env(safe-area-inset-top, 0px);
	--sa-b: env(safe-area-inset-bottom, 0px);
	--sa-l: env(safe-area-inset-left, 0px);
	--sa-r: env(safe-area-inset-right, 0px);
	color-scheme: light;
}

* {
	box-sizing: border-box;
}
html,
body {
	margin: 0;
	min-height: 100%;
}
body {
	background: var(--bg);
	color: var(--ink);
	font: 600 15px / 1.5 var(--body);
	-webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p {
	margin: 0;
}
h1,
h2,
h3 {
	font-family: var(--head);
	color: var(--ink);
	text-wrap: balance;
}
img {
	display: block;
	max-width: 100%;
}
[hidden] {
	display: none !important;
}
button {
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: inherit;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
button:disabled,
button[aria-disabled="true"] {
	cursor: default;
}
:focus-visible {
	outline: 3px solid var(--peach-dark);
	outline-offset: 2px;
	border-radius: 12px;
}
svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.defs {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}
.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Scaled text (kit.css .tx): each element sets --size in px. */
.tx {
	font-size: calc(var(--size) * 1px);
}
.tx-h {
	font-family: var(--head);
	font-weight: 600;
	line-height: max(var(--r, 1.25), var(--hfloor));
}
.tx-b {
	font-family: var(--body);
	font-weight: 600;
	line-height: var(--r, 1.35);
}

/* Calm motion: a press scales once, a switch slides its knob. */
.press {
	transition: transform var(--t-press) var(--ease-press);
}
.press:active {
	transform: scale(0.96);
}
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 1ms !important;
		animation-duration: 1ms !important;
	}
}

.n-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 54px;
	padding: 8px 16px;
	border-radius: 18px;
	background: var(--peach);
	color: var(--on-peach);
	box-shadow: var(--shadow-cta);
	text-align: center;
}
.n-cta[aria-disabled="true"],
.n-cta:disabled {
	opacity: 0.45;
	box-shadow: none;
}
.n-cta .tx,
.ghost .tx {
	--size: 17;
	font-weight: 800;
}
.ghost {
	min-height: 48px;
	border-radius: 16px;
	color: var(--ink);
}
.sub {
	--size: 15;
	color: var(--ink-2);
}
.fine {
	--size: 13;
	color: var(--ink-2);
}
.sec {
	--size: 13;
	font-weight: 800;
	color: var(--ink-2);
	letter-spacing: 0.3px;
	text-transform: uppercase;
	padding: 10px 4px 0;
}
.msg {
	--size: 14;
	color: var(--coral);
	font-weight: 800;
}
/* Turnstile draws here only when a visitor must interact (appearance: interaction-only). */
.turnstile {
	display: flex;
	justify-content: center;
	margin-block: 12px;
}

.turnstile:empty {
	display: none;
}

.msg:empty {
	display: none;
}
.msg.ok {
	color: var(--ink-2);
}

.scroll {
	display: grid;
	grid-auto-rows: max-content;
	align-content: start;
	gap: 12px;
	width: 100%;
	max-width: calc(var(--page-max) + var(--sa-l) + var(--sa-r));
	margin: 0 auto;
	padding: calc(var(--sa-t) + 6px) calc(var(--sa-r) + var(--gut))
		calc(var(--sa-b) + 24px) calc(var(--sa-l) + var(--gut));
}

/* ---------- Sign-in steps ---------- */
.signin {
	display: grid;
	justify-items: center;
	text-align: center;
	padding-top: 32px;
	gap: 14px;
}
.hero-mascot {
	width: 120px;
	height: 120px;
	object-fit: contain;
}
.signin h1 {
	--size: 26;
}
.sso {
	display: grid;
	gap: 10px;
	width: 100%;
	margin-top: 10px;
}
.sso-b {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	border-radius: 16px;
}
.sso-b .tx {
	--size: 16;
	font-weight: 800;
}
.sso-b svg {
	width: 20px;
	height: 20px;
}
.sso-b.apple {
	background: #000;
	color: #fff;
}
.sso-b.google {
	background: var(--card);
	box-shadow: inset 0 0 0 1.5px var(--line-warm);
}
.sso-b.mail {
	background: var(--peach);
	color: var(--on-peach);
}
.wide {
	width: 100%;
}
.field {
	display: grid;
	gap: 4px;
	width: 100%;
	text-align: start;
	padding: 12px 16px;
	border-radius: 16px;
	background: var(--card);
	box-shadow: inset 0 0 0 1.5px var(--line-warm);
	cursor: text;
}
.field:focus-within {
	box-shadow: inset 0 0 0 2px var(--peach-dark);
}
.field span {
	--size: 13;
	color: var(--ink-2);
}
.field input {
	--size: 17;
	width: 100%;
	padding: 0;
	border: 0;
	outline: 0;
	background: none;
	color: var(--ink);
	font-weight: 600;
}
.field input::placeholder {
	color: var(--ink-2);
	opacity: 0.6;
}
.digits {
	position: relative;
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 8px;
	width: 100%;
	direction: ltr;
}
.digits b {
	display: grid;
	place-items: center;
	height: 56px;
	border-radius: 14px;
	background: var(--card);
	box-shadow: inset 0 0 0 1.5px var(--line-warm);
	font: 700 24px / 1 var(--body);
	color: var(--ink);
}
.digits b.at {
	box-shadow: inset 0 0 0 2px var(--peach-dark);
}
/* One real input, laid over the six boxes, so paste and the phone's code suggestion work. */
.digits input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	border: 0;
	font-size: 16px;
	caret-color: transparent;
}
.textlink {
	min-height: 44px;
	color: var(--peach-ink);
}
.textlink .tx {
	--size: 15;
	font-weight: 700;
}
.store-box {
	display: grid;
	gap: 8px;
	width: 100%;
	margin-top: 4px;
}
.store-links {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	width: 100%;
}
@media (max-width: 340px) {
	.store-links {
		grid-template-columns: 1fr;
	}
}
.store-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 8px 12px;
	border-radius: 14px;
	background: var(--card);
	box-shadow: inset 0 0 0 1.5px var(--line-warm);
	color: var(--ink);
	text-decoration: none;
	text-align: center;
}
.store-btn .tx {
	--size: 13.5;
	font-weight: 800;
}
.g {
	font: 800 18px / 1 var(--body);
	background: conic-gradient(
		from -45deg,
		#ea4335 0 25%,
		#4285f4 0 50%,
		#34a853 0 75%,
		#fbbc05 0
	);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* ---------- Consent ---------- */
.consent {
	display: flex;
	flex-direction: column;
	min-height: 100dvh;
}
.consent .scroll {
	flex: 1;
}
.bond {
	display: flex;
	justify-content: center;
	align-items: center;
	padding-top: 10px;
}
.bd {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--card);
	box-shadow: var(--shadow-lift);
}
.bd.nz {
	background: var(--peach-tint);
}
.bd.nz img {
	width: 52px;
	height: 52px;
	object-fit: contain;
}
.bd.ai svg {
	width: 28px;
	height: 28px;
	color: var(--chat-ink);
}
.bd-line {
	width: 36px;
	border-top: 2px dashed var(--line-strong);
}
.ctitle {
	--size: 24;
	text-align: center;
}
.consent .sub {
	text-align: center;
}
.picker {
	display: grid;
	gap: 8px;
}
.babies {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.baby {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding-block: 0;
	padding-inline: 10px 16px;
	border-radius: 22px;
	background: var(--card);
	box-shadow: inset 0 0 0 1.5px var(--line);
	transition:
		background var(--t-quick),
		box-shadow var(--t-quick),
		transform var(--t-press) var(--ease-press);
}
.baby i {
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.baby svg {
	width: 14px;
	height: 14px;
	stroke-width: 3;
	opacity: 0;
}
.baby .tx {
	--size: 15;
	font-weight: 800;
}
.baby[aria-pressed="true"] {
	background: var(--peach-tint);
	box-shadow: inset 0 0 0 2px var(--peach-dark);
}
.baby[aria-pressed="true"] i {
	background: var(--peach-dark);
	box-shadow: none;
	color: #fff;
}
.baby[aria-pressed="true"] svg {
	opacity: 1;
}
.group {
	display: grid;
	overflow: hidden;
	border-radius: 14px;
	background: var(--card);
	box-shadow: inset 0 0 0 1.5px var(--line);
}
.srow {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 52px;
	padding: 10px 16px;
	text-align: start;
}
.srow + .srow {
	box-shadow: 0 -1px 0 var(--line);
}
.srow > span {
	flex: 1;
	display: grid;
	gap: 2px;
}
.srow .tx {
	--size: 15;
}
.srow small.tx {
	--size: 12.5;
	color: var(--ink-2);
}
.sw {
	position: relative;
	flex: none;
	width: 51px;
	height: 31px;
	border-radius: 16px;
	background: #e9e9ea;
	transition: background var(--t-quick);
}
.sw::after {
	content: "";
	position: absolute;
	top: 2px;
	inset-inline-start: 2px;
	width: 27px;
	height: 27px;
	border-radius: 50%;
	background: #fff;
	box-shadow:
		0 3px 8px rgba(0, 0, 0, 0.15),
		0 1px 1px rgba(0, 0, 0, 0.16);
	transition: transform var(--t-quick) var(--ease-rise);
}
[aria-checked="true"] .sw {
	background: var(--ios-green);
}
[aria-checked="true"] .sw::after {
	transform: translateX(20px);
}
[dir="rtl"] [aria-checked="true"] .sw::after {
	transform: translateX(-20px);
}
.gnote {
	--size: 12.5;
	color: var(--ink-2);
	padding: 0 4px;
}
.seg {
	min-inline-size: 0;
	margin: 0;
	border: 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	padding: 4px;
	border-radius: 16px;
	background: var(--card);
	box-shadow: inset 0 0 0 1.5px var(--line);
}
.seg button {
	min-height: 44px;
	border-radius: 12px;
	color: var(--ink-2);
	transition:
		background var(--t-quick),
		color var(--t-quick),
		transform var(--t-press) var(--ease-press);
}
.seg button .tx {
	--size: 14;
	font-weight: 800;
}
.seg button[aria-pressed="true"] {
	background: var(--peach);
	color: var(--on-peach);
}
.dock {
	position: sticky;
	bottom: 0;
	display: grid;
	gap: 4px;
	width: 100%;
	padding: 10px calc(var(--sa-r) + var(--gut)) max(var(--sa-b), 14px)
		calc(var(--sa-l) + var(--gut));
	background: var(--bg);
	box-shadow: 0 -1px 0 var(--line);
}
.dock > * {
	width: 100%;
	max-width: var(--page-max);
	margin: 0 auto;
}
.sum {
	--size: 14;
	text-align: center;
	color: var(--ink-2);
}
.sum.warn {
	color: var(--coral);
	font-weight: 800;
}

/* ---------- /connect/account: the assistants a parent connected ---------- */
.account {
	gap: 12px;
}
.alist {
	display: grid;
	gap: 8px;
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}
.arow {
	display: grid;
	grid-template-columns: 40px 1fr;
	gap: 10px 12px;
	align-items: center;
	padding: 12px 14px;
	border-radius: 14px;
	background: var(--card);
	box-shadow: inset 0 0 0 1.5px var(--line);
}
.arow > i {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: #f1f1f1;
	color: #0d0d0d;
}
.arow > span {
	display: grid;
	gap: 2px;
	min-width: 0;
}
.arow b.tx {
	--size: 16;
}
.arow small.tx {
	--size: 12.5;
	color: var(--ink-2);
}
.arow .ameta {
	color: var(--ink-2);
	opacity: 0.9;
}
.arow-actions {
	grid-column: 1 / -1;
	display: grid;
	gap: 8px;
	margin-top: 2px;
}
.secondary {
	width: 100%;
	min-height: 46px;
	padding: 0 14px;
	border-radius: 16px;
	background: var(--peach-tint);
	box-shadow: inset 0 0 0 1.5px var(--line-warm);
	color: var(--ink);
}
.secondary .tx {
	--size: 15;
	font-weight: 800;
}
.aeditor {
	grid-column: 1 / -1;
	display: grid;
	gap: 12px;
	margin-top: 4px;
	padding-top: 12px;
	border-top: 1px solid var(--line);
}
.aeditor .picker {
	width: 100%;
}
.history {
	display: grid;
	gap: 6px;
	padding-top: 4px;
}
.hlist {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.hrow {
	display: grid;
	gap: 2px;
	padding: 8px 12px;
	border-radius: 12px;
	background: var(--bg);
}
.htitle.tx {
	--size: 13.5;
	font-weight: 800;
}
.hdetail.tx {
	--size: 12;
	color: var(--ink-2);
}

/* ---------- Top account bar (signed-in email + sign out / switch account) ---------- */
.topbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px 12px;
	width: 100%;
	margin-bottom: 4px;
}
.account-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	max-width: 100%;
	margin-inline-start: auto;
}
.acct-email {
	--size: 13;
	color: var(--ink-2);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 200px;
}
.signout-form {
	display: inline-flex;
	margin: 0;
}
.pill-btn {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 0 12px;
	border-radius: 12px;
	background: var(--card);
	box-shadow: inset 0 0 0 1.5px var(--line-warm);
	color: var(--ink);
	white-space: nowrap;
}
.pill-btn .tx {
	--size: 13;
	font-weight: 800;
}

/* ---------- Step back button & busy/loading states ---------- */
.step-nav {
	display: flex;
	width: 100%;
	justify-content: flex-start;
}
.back-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 44px;
	padding-block: 0;
	padding-inline: 4px 10px;
	margin-inline-start: -4px;
	border-radius: 12px;
	color: var(--ink-2);
}
.back-btn svg {
	width: 18px;
	height: 18px;
}
[dir="rtl"] .back-btn svg {
	transform: scaleX(-1);
}
.back-btn .tx {
	--size: 15;
	font-weight: 800;
}
button[aria-busy="true"] {
	opacity: 0.65;
	cursor: progress;
}
.busy button:disabled,
button[data-resend]:disabled {
	opacity: 0.55;
}
.danger {
	width: 100%;
	min-height: 50px;
	border-radius: 16px;
	background: var(--card);
	box-shadow: inset 0 0 0 1.5px var(--line);
	color: var(--coral);
}
.arow .danger {
	margin-top: 0;
}
.danger .tx {
	--size: 16;
	font-weight: 800;
}
.danger.solid {
	background: var(--coral);
	color: #fff;
	box-shadow: none;
}
.empty {
	--size: 15;
	width: 100%;
	padding: 16px;
	border-radius: 14px;
	background: var(--card);
	box-shadow: inset 0 0 0 1.5px var(--line);
	color: var(--ink-2);
	text-align: center;
}
.scrim {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	background: rgba(43, 29, 22, 0.32);
	animation: fade var(--t-quick, 180ms) ease-out both;
}
.sheet {
	display: grid;
	gap: 12px;
	width: 100%;
	max-width: var(--page-max);
	padding: 20px calc(var(--sa-r) + var(--gut)) max(var(--sa-b), 20px)
		calc(var(--sa-l) + var(--gut));
	border-radius: 24px 24px 0 0;
	background: var(--bg);
	animation: rise 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.sheet h2.tx {
	--size: 21;
}
@keyframes fade {
	from {
		opacity: 0;
	}
}
@keyframes rise {
	from {
		transform: translateY(24px);
		opacity: 0;
	}
}
@media (prefers-reduced-motion: reduce) {
	.scrim,
	.sheet {
		animation: none;
	}
}
