/* Copyright (c) 2026 ARTISMED MB. All rights reserved. Proprietary software: no copying, redistribution or reverse engineering without written permission. */
/* Family Motivation - front-end styles */
:root {
	--fm-bg: #f3f5fa;
	--fm-card: #ffffff;
	--fm-ink: #0f172a;
	--fm-muted: #64748b;
	--fm-line: #e2e8f0;
	--fm-soft: #f1f5f9;
	--fm-brand: #4f46e5;
	--fm-pos: #15803d;
	--fm-neg: #dc2626;
	--fm-good-bg: #dcfce7;
	--fm-bad-bg: #fee2e2;
	--fm-z-growth: #16a34a;
	--fm-z-growth-bg: #dcfce7;
	--fm-z-stable: #3b82f6;
	--fm-z-stable-bg: #dbeafe;
	--fm-z-amber: #f59e0b;
	--fm-z-amber-bg: #fef3c7;
	--fm-z-red: #ef4444;
	--fm-z-red-bg: #fee2e2;
	--fm-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 14px rgba(15, 23, 42, .05);
	--fm-radius: 16px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--fm-bg: #0b1220;
		--fm-card: #121c31;
		--fm-ink: #e8edf6;
		--fm-muted: #93a1b8;
		--fm-line: #24324d;
		--fm-soft: #172440;
		--fm-brand: #818cf8;
		--fm-pos: #4ade80;
		--fm-neg: #f87171;
		--fm-good-bg: rgba(74, 222, 128, .16);
		--fm-bad-bg: rgba(248, 113, 113, .16);
		--fm-z-growth-bg: rgba(74, 222, 128, .18);
		--fm-z-stable-bg: rgba(96, 165, 250, .18);
		--fm-z-amber-bg: rgba(251, 191, 36, .18);
		--fm-z-red-bg: rgba(248, 113, 113, .18);
		--fm-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
	}
}

.fm-body { margin: 0; background: var(--fm-bg); }

.fm-app, .fm-app *, .fm-sheet, .fm-sheet *, .fm-overlay { box-sizing: border-box; }
.fm-app {
	max-width: 1080px;
	margin: 0 auto;
	padding: 16px 16px 96px;
	color: var(--fm-ink);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.45;
	background: var(--fm-bg);
}
:where(.fm-app) h1, :where(.fm-app) h2, :where(.fm-app) h3, :where(.fm-app) p { margin: 0; }
:where(.fm-app) ul { list-style: none; margin: 0; padding: 0; }
.fm-app button { font: inherit; color: inherit; cursor: pointer; }
.fm-app button:disabled { opacity: .55; cursor: default; }
.fm-app :focus-visible, .fm-sheet :focus-visible { outline: 3px solid var(--fm-brand); outline-offset: 2px; }

/* ---------------------------------------------------------------- top bar */
.fm-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px 12px; flex-wrap: wrap; }
.fm-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.fm-logo { display: block; width: 40px; height: 40px; border-radius: 12px; }
.fm-login-logo { display: block; margin: 0 0 12px; width: 64px; height: 64px; border-radius: 18px; }
.fm-user { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--fm-muted); }
.fm-user-name { font-weight: 600; color: var(--fm-ink); }
.fm-link { color: var(--fm-brand); text-decoration: none; font-weight: 600; }
.fm-link:hover { text-decoration: underline; }

/* -------------------------------------------------------------------- nav */
.fm-nav { display: flex; gap: 6px; overflow-x: auto; padding: 4px; background: var(--fm-card); border: 1px solid var(--fm-line); border-radius: 999px; box-shadow: var(--fm-shadow); margin-bottom: 18px; -webkit-overflow-scrolling: touch; }
.fm-tab { flex: 1 0 auto; border: 0; background: transparent; padding: 10px 18px; border-radius: 999px; font-weight: 600; color: var(--fm-muted); white-space: nowrap; }
.fm-tab.is-on { background: var(--fm-brand); color: #fff; }
.fm-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 8px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 12px; font-weight: 700; }

/* ------------------------------------------------------------ head/period */
.fm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.fm-head h1 { font-size: 26px; line-height: 1.15; }
.fm-who { display: flex; align-items: center; gap: 14px; }
.fm-sub { color: var(--fm-muted); font-size: 14px; }
.fm-avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.fm-avatar.is-big { width: 54px; height: 54px; font-size: 20px; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
.fm-avatar.is-photo { background-size: cover; background-position: center; background-repeat: no-repeat; }
.fm-avatar.is-emoji { font-size: 16px; line-height: 1; }
.fm-avatar.is-emoji.is-big { font-size: 30px; }

.fm-userbtn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 2px 6px 2px 2px; border-radius: 999px; }
.fm-userbtn:hover { background: var(--fm-soft); }
.fm-row-name.fm-row-person { flex-direction: row; align-items: center; gap: 10px; }
.fm-row-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; }
.fm-avatar-preview { display: flex; justify-content: center; margin: 10px 0 14px; }
.fm-avatar-preview .fm-avatar.is-big { width: 96px; height: 96px; font-size: 34px; }
.fm-avatar-preview .fm-avatar.is-emoji.is-big { font-size: 54px; }
.fm-emojigrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; margin-bottom: 14px; }
.fm-emoji { aspect-ratio: 1; border: 2px solid var(--fm-line); background: var(--fm-card); border-radius: 14px; font-size: 26px; line-height: 1; padding: 0; }
.fm-emoji.is-on { border-color: var(--fm-brand); background: var(--fm-soft); }
.fm-avatar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-pill { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--fm-line); background: var(--fm-card); padding: 5px 14px 5px 6px; border-radius: 999px; font-weight: 600; }
.fm-pill.is-on { border-color: var(--pill, var(--fm-brand)); background: color-mix(in srgb, var(--pill, var(--fm-brand)) 14%, var(--fm-card)); }
.fm-pill > span:only-child { padding-left: 8px; }

.fm-ovtabs { display: flex; gap: 6px; }
.fm-periods { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
/* One compact toolbar above the overview: who, child switcher, view + period buttons. */
.fm-ovbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 14px; }
.fm-ovbar .fm-pills { flex-wrap: nowrap; }
.fm-ovbar .fm-who { margin-right: auto; }
.fm-ovcontrols { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.fm-periods-label { font-weight: 700; margin-right: 6px; color: var(--fm-muted); font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.fm-seg { border: 1px solid var(--fm-line); background: var(--fm-card); padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.fm-seg.is-on { background: var(--fm-ink); border-color: var(--fm-ink); color: var(--fm-card); }

/* ------------------------------------------------------------------ cards */
.fm-card { background: var(--fm-card); border: 1px solid var(--fm-line); border-radius: var(--fm-radius); box-shadow: var(--fm-shadow); overflow: hidden; }

.fm-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "a b" "c d" "e r" "s s"; }
.fm-cat-A { grid-area: a; } .fm-cat-B { grid-area: b; } .fm-cat-C { grid-area: c; }
.fm-cat-D { grid-area: d; } .fm-cat-E { grid-area: e; }
.fm-recent { grid-area: r; } .fm-score { grid-area: s; }

.fm-cat { position: relative; border-top: 5px solid var(--accent); background: var(--cat-theme-bg, var(--fm-card)); }
.fm-cat-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px 10px; }
.fm-cat-h.is-plain { padding-bottom: 6px; }
.fm-cat-h h2 { font-size: 18px; flex: 1; }
.fm-badge { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent, var(--fm-brand)); color: #fff; font-weight: 800; font-size: 15px; flex: 0 0 auto; }
.fm-cat-total { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fm-cat-stars { padding: 0 18px 10px; }

/* ---------------------------------------------------------------- stars */
.fm-stars { display: inline-flex; gap: 2px; }
.fm-star { color: var(--fm-line); font-size: 15px; line-height: 1; }
.fm-star.is-on { color: #f59e0b; }

/* ----------------------------------------------------- progress ring (points) */
.fm-ringtotal { position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; }
.fm-ringtotal svg { display: block; }
.fm-ring-bg { fill: none; stroke: var(--fm-line); }
.fm-ring-fg { fill: none; transition: stroke-dashoffset .5s ease; }
.fm-ringtotal-num { position: absolute; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; }
.fm-ringtotal.is-mini .fm-ringtotal-num { font-size: 10px; }

/*
 * Automatic photo background treatment: any category slot backed by an uploaded image (an
 * operator-added theme, or a family's own private photo) gets faded, blurred and fitted
 * automatically - a parent never has to pre-edit a photo for it to "work" here. Gradient slots
 * are untouched (no overlay, no blur): they're already pastel and legible by design.
 * The photo itself goes on ::before, scaled slightly past the card's edge so the blur never
 * shows a transparent fringe; a translucent wash on ::after keeps the (always-dark-on-light,
 * or always-light-on-dark) card text readable over whatever is in the picture; both sit behind
 * the real content (z-index), which `.fm-cat`/`.fm-minirow` being a positioning context contains.
 */
.fm-cat.has-photo::before, .fm-minirow.has-photo::before,
.fm-cat.has-photo::after, .fm-minirow.has-photo::after {
	content: ''; position: absolute; inset: 0; pointer-events: none;
}
.fm-cat.has-photo::before, .fm-minirow.has-photo::before {
	z-index: 0; background-image: var(--cat-theme-img); background-position: center; background-size: cover;
	filter: blur(3px) saturate(1.05); transform: scale(1.08);
}
.fm-cat.has-photo::after, .fm-minirow.has-photo::after {
	z-index: 1; background: rgba(255, 255, 255, .72);
}
@media (prefers-color-scheme: dark) {
	.fm-cat.has-photo::after, .fm-minirow.has-photo::after { background: rgba(10, 16, 28, .62); }
}
.fm-cat.has-photo > *, .fm-minirow.has-photo > * { position: relative; z-index: 2; }
/* The point ring sits on the busiest part of a photo more often than not, so it gets its own
   small "legibility plate" rather than relying on the card-wide wash alone. */
.fm-cat.has-photo .fm-ringtotal, .fm-minirow.has-photo .fm-ringtotal {
	background: rgba(255, 255, 255, .6); border-radius: 999px; backdrop-filter: blur(2px);
}
@media (prefers-color-scheme: dark) {
	.fm-cat.has-photo .fm-ringtotal, .fm-minirow.has-photo .fm-ringtotal { background: rgba(10, 16, 28, .55); }
}

/* A theme paints a light pastel gradient behind a category card. In the dark look the card keeps that light
   background, so its text and colours switch back to the light-look values (dark text on pastel). */
@media (prefers-color-scheme: dark) {
	.fm-cat.has-theme, .fm-minirow.has-theme {
		color: #0f172a;
		--fm-ink: #0f172a; --fm-muted: #475569; --fm-line: rgba(15, 23, 42, .16); --fm-soft: rgba(255, 255, 255, .6);
		--fm-card: #ffffff; --fm-brand: #4f46e5; --fm-pos: #15803d; --fm-neg: #dc2626;
	}
}

.fm-rows { padding: 0 18px 12px; }
.fm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--fm-line); }
.fm-row-name { display: flex; flex-direction: column; min-width: 0; }
.fm-recent-label { font-weight: 600; }
.fm-recent-meta { color: var(--fm-muted); font-size: 13px; }
.fm-recent-row.is-pending .fm-recent-label { color: var(--fm-muted); font-style: italic; }
.fm-empty { color: var(--fm-muted); font-size: 14px; padding: 6px 0; }

.fm-pts { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fm-pts.big { font-size: 22px; }
.fm-pts.is-muted { opacity: .5; }
.pos { color: var(--fm-pos); } .neg { color: var(--fm-neg); } .zero { color: var(--fm-muted); }

/* ------------------------------------------------------------- score card */
.fm-score { padding-bottom: 8px; }
.fm-score .fm-cat-h { padding-top: 16px; }
.fm-score-main { display: flex; align-items: baseline; gap: 14px; padding: 0 18px; flex-wrap: wrap; }
.fm-score-num { font-size: 64px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.fm-score-cap { color: var(--fm-muted); font-size: 15px; display: flex; flex-direction: column; }
.fm-score-sub { font-size: 13px; }
.fm-hint { padding: 6px 18px 0; color: var(--fm-muted); font-size: 14px; }
.fm-zone { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.fm-zone-growth { background: var(--fm-z-growth-bg); color: var(--fm-z-growth); }
.fm-zone-stable { background: var(--fm-z-stable-bg); color: var(--fm-z-stable); }
.fm-zone-amber { background: var(--fm-z-amber-bg); color: #b45309; }
.fm-zone-red { background: var(--fm-z-red-bg); color: var(--fm-z-red); }
@media (prefers-color-scheme: dark) { .fm-zone-amber { color: #fbbf24; } }
.fm-zonecounts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 18px 0; }
.fm-zonecounts-label { color: var(--fm-muted); font-size: 13px; margin-right: 4px; }

.fm-meter { padding: 16px 18px 6px; }
.fm-meter-track { position: relative; }
.fm-meter-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; }
.fm-seg-red { background: var(--fm-z-red); } .fm-seg-amber { background: var(--fm-z-amber); }
.fm-seg-stable { background: var(--fm-z-stable); } .fm-seg-growth { background: var(--fm-z-growth); }
.fm-meter-marker { position: absolute; top: -5px; width: 5px; height: 24px; margin-left: -2.5px; border-radius: 3px; background: var(--fm-ink); box-shadow: 0 0 0 3px var(--fm-card); }
.fm-meter-ticks { position: relative; height: 20px; margin-top: 8px; font-size: 12px; color: var(--fm-muted); }
.fm-meter-ticks span { position: absolute; transform: translateX(-50%); font-variant-numeric: tabular-nums; }

.fm-bars-title { padding: 14px 18px 0; color: var(--fm-muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.fm-bars { display: flex; align-items: stretch; gap: 3px; height: 110px; padding: 6px 18px 12px; }
.fm-bar-col { flex: 1 1 0; max-width: 28px; display: flex; flex-direction: column; min-width: 0; }
.fm-bar-up, .fm-bar-down { flex: 1 1 50%; display: flex; }
.fm-bar-up { align-items: flex-end; border-bottom: 1px solid var(--fm-line); }
.fm-bar-down { align-items: flex-start; }
.fm-bar { display: block; width: 100%; border-radius: 4px; background: var(--fm-z-stable); }
.fm-bar.fm-zone-growth { background: var(--fm-z-growth); } .fm-bar.fm-zone-stable { background: var(--fm-z-stable); }
.fm-bar.fm-zone-amber { background: var(--fm-z-amber); } .fm-bar.fm-zone-red { background: var(--fm-z-red); }

.fm-money { margin: 14px 18px 12px; padding: 4px 14px; border-radius: 12px; background: var(--fm-soft); }
.fm-mrow { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--fm-line); font-size: 15px; }
.fm-mrow:first-child { border-top: 0; }
.fm-mrow.is-pos strong { color: var(--fm-pos); } .fm-mrow.is-neg strong { color: var(--fm-neg); }
.fm-mrow.is-total { font-size: 17px; }
.fm-promo { margin: 4px 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--fm-good-bg); color: var(--fm-pos); font-weight: 700; font-size: 15px; line-height: 1.4; }
.fm-pilot { margin: 14px 18px 12px; padding: 10px 14px; border-radius: 12px; background: var(--fm-z-amber-bg); color: var(--fm-ink); font-size: 14px; }
.fm-foot { margin-top: 12px; color: var(--fm-muted); font-size: 13px; text-align: center; }

/* ----------------------------------------------------------- overview summary */
.fm-summary { width: 100%; max-width: 440px; margin: 0 auto; padding: 20px 18px 18px; display: flex; flex-direction: column; gap: 16px; }
.fm-sum-left, .fm-sum-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fm-summary-top { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.fm-summary-tag { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fm-summary .fm-score-cap { align-items: center; }
.fm-summary .fm-meter { width: 100%; padding-left: 0; padding-right: 0; }
.fm-minichart { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.fm-minirow { position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--cat-theme-bg, var(--fm-soft)); text-align: left; }
.fm-mini-name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-minirow .fm-pts { white-space: nowrap; }
.fm-summary .fm-moneycard { margin: 0; }
.fm-sum-recentbox .fm-rows { padding: 0; }
.fm-sum-recentbox .fm-row { padding: 7px 0; }
.fm-sum-recentbox .fm-money-title { font-size: 15px; margin-bottom: 2px; }
.fm-sum-recenthead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.fm-linkbtn { border: 0; background: none; padding: 4px 0; font-size: 14px; }
.fm-sum-recent .fm-recent-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Wide screens (laptop/desktop): two columns so everything fits without scrolling. */
@media (min-width: 900px) {
	.fm-summary { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; padding: 18px 24px 18px; }
	.fm-summary-top { flex-direction: row; justify-content: center; gap: 18px; }
	.fm-summary-top .fm-score-num { font-size: 56px; }
	.fm-summary-tag { align-items: flex-start; }
	.fm-summary .fm-score-cap { align-items: flex-start; }
	.fm-summary .fm-minichart { gap: 6px; margin-top: 0; }
	.fm-summary .fm-minirow { padding: 6px 12px; }
	.fm-summary .fm-moneycard { margin: 0; padding: 10px 16px 2px; }
	.fm-summary .fm-mline { padding: 7px 0; }
	.fm-summary .fm-money-sub { margin-bottom: 4px; }
	.fm-summary .fm-money-title { font-size: 16px; }
	.fm-summary .fm-money-note { margin: 2px 0 6px; font-size: 12.5px; }
	.fm-summary .fm-pilot { margin: 0; }
	.fm-app { padding-bottom: 24px; }
	.fm-top { padding-bottom: 6px; }
	.fm-nav { margin-bottom: 12px; }
	.fm-ovbar { flex-wrap: nowrap; gap: 10px 14px; margin-bottom: 10px; }
	.fm-ovbar .fm-who { margin-right: auto; min-width: 0; }
	.fm-ovbar .fm-seg { padding: 6px 12px; font-size: 13px; }
	.fm-ovcontrols { flex-wrap: nowrap; gap: 8px 12px; }
	.fm-ovbar .fm-pill { padding: 3px 12px 3px 4px; }
	.fm-sum-recentbox .fm-row { padding: 5px 0; }
	.fm-sum-recentbox .fm-row-name { flex: 1; }
	.fm-ovbar h1 { font-size: 22px; }
	.fm-ovbar .fm-avatar.is-big { width: 44px; height: 44px; font-size: 17px; }
	.fm-ovbar .fm-avatar.is-emoji.is-big { font-size: 26px; }
}
.fm-moneycard { margin: 14px 18px 12px; padding: 14px 16px 6px; border-radius: 14px; background: var(--fm-soft); text-align: left; }
.fm-money-title { font-size: 17px; margin: 0 0 2px; }
.fm-money-sub { margin: 0 0 8px; font-size: 14px; color: var(--fm-muted); }
.fm-mline { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 10px 0; border-top: 1px solid var(--fm-line); }
.fm-money-sub + .fm-mline, .fm-money-title + .fm-mline { border-top: 0; }
.fm-mline-text { display: flex; flex-direction: column; min-width: 0; }
.fm-mline-label { font-size: 16px; font-weight: 600; }
.fm-mline small { font-size: 13px; color: var(--fm-muted); line-height: 1.35; margin-top: 2px; }
.fm-mline strong { font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fm-mline.is-pos strong { color: var(--fm-pos); } .fm-mline.is-neg strong { color: var(--fm-neg); }
.fm-mline.is-total { border-top: 2px solid var(--fm-ink); }
.fm-mline.is-total .fm-mline-label, .fm-mline.is-total strong { font-size: 19px; font-weight: 800; }
.fm-money-note { margin: 4px 0 10px; font-size: 13px; color: var(--fm-muted); }
.fm-summary-money { margin: 2px 0 0; font-size: 14px; color: var(--fm-muted); }
.fm-summary-money strong { color: var(--fm-ink); }
.fm-summary-btn { margin-top: 2px; }

/* ---------------------------------------------------------- add / claim */
.fm-toolbar { display: grid; grid-template-columns: auto auto 1fr; gap: 12px 18px; align-items: end; margin-bottom: 12px; }
.fm-field label, .fm-sheet label { display: block; font-size: 13px; font-weight: 700; color: var(--fm-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.fm-input { width: 100%; padding: 10px 12px; border: 1px solid var(--fm-line); border-radius: 12px; background: var(--fm-card); color: var(--fm-ink); font: inherit; min-height: 44px; }
.fm-search { margin-bottom: 12px; }
.fm-cattabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.fm-cattab { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; border: 2px solid var(--fm-line); background: var(--fm-card); padding: 6px 14px 6px 6px; border-radius: 999px; font-weight: 600; }
.fm-cattab.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--fm-card)); }

.fm-tapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.fm-subject { grid-column: 1 / -1; margin-top: 10px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--fm-muted); }
.fm-mt { margin-top: 26px; margin-bottom: 8px; }
.fm-tap { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; min-height: 78px; padding: 12px 64px 12px 14px; border: 1px solid var(--fm-line); border-left: 6px solid var(--accent, var(--fm-brand)); border-radius: 14px; background: var(--fm-card); box-shadow: var(--fm-shadow); transition: transform .08s ease; }
.fm-tap:active { transform: scale(.97); }
.fm-tap-label { font-weight: 600; line-height: 1.25; }
.fm-tap-meta { font-size: 12px; color: var(--fm-muted); }
.fm-tap-pts { position: absolute; right: 12px; top: 12px; min-width: 40px; text-align: center; padding: 4px 8px; border-radius: 999px; font-weight: 800; background: var(--fm-soft); }
.fm-tap.pos .fm-tap-pts { background: var(--fm-good-bg); color: var(--fm-pos); }
.fm-tap.neg .fm-tap-pts { background: var(--fm-bad-bg); color: var(--fm-neg); }

/* ------------------------------------------------------ lists / approvals */
.fm-list { display: grid; gap: 10px; }
.fm-event, .fm-claim { padding: 14px 16px; }
.fm-event { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fm-event-main, .fm-claim-top { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; }
.fm-event-text, .fm-claim-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.fm-claim-label { font-weight: 600; margin-top: 2px; }
.fm-claim-note { color: var(--fm-muted); font-size: 14px; font-style: italic; }
.fm-claim-actions { display: flex; gap: 10px; margin-top: 12px; }
.fm-event.is-rejected, .fm-event.is-void { opacity: .6; }
.fm-status { align-self: flex-start; margin-top: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--fm-soft); color: var(--fm-muted); }
.fm-status.is-pending { background: var(--fm-z-amber-bg); color: #b45309; }
@media (prefers-color-scheme: dark) { .fm-status.is-pending { color: #fbbf24; } }
.fm-allgood { padding: 26px; text-align: center; color: var(--fm-muted); }
.fm-claim { display: block; }

.fm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 20px; border: 1px solid var(--fm-line); border-radius: 12px; background: var(--fm-card); font-weight: 700; text-decoration: none; color: var(--fm-ink); }
.fm-btn.is-good { background: var(--fm-z-growth); border-color: var(--fm-z-growth); color: #fff; }
.fm-btn.is-bad { background: var(--fm-card); border-color: var(--fm-z-red); color: var(--fm-z-red); }
.fm-btn.is-small { min-height: 34px; padding: 4px 14px; font-size: 14px; }
.fm-claim-actions .fm-btn { flex: 1; }

.fm-no-children { padding: 28px; }
.fm-no-children h2 { margin-bottom: 8px; }
.fm-no-children p { margin-bottom: 16px; color: var(--fm-muted); }
.fm-loading { padding: 36px; text-align: center; color: var(--fm-muted); }
.fm-fatal { max-width: 460px; margin: 60px auto; text-align: center; }
.fm-fatal h2 { margin-bottom: 10px; } .fm-fatal p { margin-bottom: 16px; color: var(--fm-muted); }

/* ------------------------------------------------------------ toast/sheet */
.fm-toast { position: fixed; left: 50%; bottom: 22px; z-index: 99999; display: none; align-items: center; gap: 14px; max-width: min(560px, calc(100vw - 24px)); padding: 12px 16px; border-radius: 14px; background: #0f172a; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transform: translateX(-50%); font-size: 15px; }
.fm-toast.show { display: flex; }
.fm-toast.is-err { background: #991b1b; }
.fm-toast-warn { color: #fbbf24; font-size: 13px; }
.fm-toast-undo { border: 0; background: rgba(255, 255, 255, .16); color: #fff; padding: 6px 14px; border-radius: 999px; font-weight: 700; cursor: pointer; }

.fm-overlay { position: fixed; inset: 0; z-index: 99998; display: flex; align-items: flex-end; justify-content: center; background: rgba(15, 23, 42, .55); }
.fm-sheet { width: min(520px, 100%); max-height: 92vh; overflow: auto; padding: 22px 20px 26px; border-radius: 20px 20px 0 0; background: var(--fm-card); color: var(--fm-ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.fm-sheet h2 { margin: 0 0 4px; font-size: 20px; }
.fm-sheet .fm-sub { margin: 0 0 14px; color: var(--fm-muted); font-size: 14px; }
.fm-sheet label { margin-top: 12px; }
.fm-sheet .fm-input { width: 100%; }
.fm-sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.fm-sheet-actions .fm-btn { flex: 1; }
.fm-sheet .fm-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border: 1px solid var(--fm-line); border-radius: 12px; background: var(--fm-card); color: var(--fm-ink); font: inherit; font-weight: 700; cursor: pointer; }
.fm-sheet .fm-btn.is-good { background: var(--fm-z-growth); border-color: var(--fm-z-growth); color: #fff; }
@media (min-width: 640px) { .fm-overlay { align-items: center; } .fm-sheet { border-radius: 20px; } }

/* ------------------------------------------------------------------ login */
.fm-login { max-width: 400px; margin: 48px auto; padding: 28px; background: var(--fm-card); border: 1px solid var(--fm-line); border-radius: 20px; box-shadow: var(--fm-shadow); color: var(--fm-ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.fm-login h1 { margin: 0 0 4px; font-size: 24px; }
.fm-login p { margin: 0 0 16px; color: var(--fm-muted); }
.fm-login label { display: block; margin: 12px 0 6px; font-size: 13px; font-weight: 700; color: var(--fm-muted); text-transform: uppercase; letter-spacing: .04em; }
.fm-login input[type="text"], .fm-login input[type="password"], .fm-login input[type="email"] { width: 100%; padding: 12px; border: 1px solid var(--fm-line); border-radius: 12px; background: var(--fm-card); color: var(--fm-ink); font-size: 16px; box-sizing: border-box; }
.fm-pw-wrap { position: relative; display: block; }
.fm-login .fm-pw-wrap input[type="password"], .fm-login .fm-pw-wrap input[type="text"] { padding-right: 84px; }
.fm-login .fm-pw-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: auto; margin: 0; min-height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: var(--fm-soft); color: var(--fm-brand); font-size: 14px; font-weight: 700; cursor: pointer; }
.fm-login .login-remember { margin-top: 10px; font-size: 14px; }
.fm-login .login-remember label { display: inline; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--fm-ink); }
.fm-login input[type="submit"], .fm-login button[type="submit"] { width: 100%; margin-top: 16px; min-height: 46px; border: 0; border-radius: 12px; background: var(--fm-brand); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.fm-login .fm-login-err { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--fm-bad-bg); color: var(--fm-neg); font-size: 14px; }
.fm-login .fm-signup-link { margin: 16px 0 0; text-align: center; font-size: 14px; }
.fm-signup p { margin-bottom: 20px; }

.fm-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; font-size: 14px; font-weight: 600; }
.fm-banner.is-info { background: var(--fm-z-stable-bg); color: var(--fm-z-stable); }
.fm-banner.is-good { background: var(--fm-good-bg); color: var(--fm-pos); }
.fm-banner.is-warn { background: var(--fm-bad-bg); color: var(--fm-neg); }
.fm-banner .fm-link { white-space: nowrap; }

/* ---------------------------------------------------------------- narrow */
@media (max-width: 760px) {
	.fm-app { padding: 12px 12px 96px; }
	.fm-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "s" "a" "b" "c" "d" "e" "r"; }
	.fm-toolbar { grid-template-columns: 1fr; }
	.fm-score-num { font-size: 54px; }
	.fm-head h1, .fm-ovbar h1 { font-size: 22px; }
	.fm-tapgrid { grid-template-columns: 1fr; }
	.fm-user-name { display: none; }
	.fm-tab { padding: 10px 12px; font-size: 15px; }
	.fm-count { margin-left: 6px; }
}

/* ---- How it works page ---- */
.fm-rules { display: flex; flex-direction: column; gap: 16px; }
.fm-rules-h { font-size: 18px; margin: 10px 2px 0; }
.fm-rules-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.fm-limits { margin: 0 0 6px; padding: 0 18px; font-size: 13px; color: var(--fm-muted); }
.fm-subject-row { list-style: none; padding: 10px 18px 2px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent, var(--fm-muted)); }
.fm-rule-row .fm-recent-meta { display: block; }
.fm-guidance { font-style: italic; }
.fm-rules-edit { margin: 0; }
.fm-steps { margin: 0; padding: 0 18px 14px 40px; display: flex; flex-direction: column; gap: 8px; line-height: 1.45; }
.fm-bullets { margin: 0; padding: 0 18px 14px 38px; display: flex; flex-direction: column; gap: 8px; line-height: 1.45; }
.fm-rulecard .fm-sub { padding: 0 18px; margin: 0 0 8px; }
.fm-rulecard .fm-meter { margin: 0 0 4px; }
.fm-rulecard .fm-money { margin: 0 18px 14px; }
.fm-rulecard .fm-pilot { margin: 0 18px 14px; }
.fm-zonelist { list-style: none; margin: 0; padding: 0 18px 14px; display: flex; flex-direction: column; gap: 10px; }
.fm-zonelist li { display: grid; grid-template-columns: 90px 110px 1fr; gap: 10px; align-items: center; }
.fm-zonelist .fm-zd { color: var(--fm-muted); font-size: 14px; }
.fm-childrules-h { display: flex; align-items: center; gap: 8px; margin: 4px 18px 8px; font-size: 16px; }
@media (max-width: 720px) {
	.fm-rules-cats { grid-template-columns: minmax(0, 1fr); }
	.fm-zonelist li { grid-template-columns: 90px 1fr; }
	.fm-zonelist .fm-zd { grid-column: 1 / -1; }
}
.fm-rules-cats .fm-cat { grid-area: auto; margin: 0; }
.fm-bullets { list-style: disc; }
.fm-steps { list-style: decimal; }

/* ---- Day sheet ---- */
.fm-addview { display: flex; flex-direction: column; gap: 14px; }
.fm-modes { display: flex; gap: 6px; }
.fm-sheetview { display: flex; flex-direction: column; gap: 14px; }
.fm-sheettools { grid-template-columns: auto auto 1fr; }
.fm-daynav { display: flex; align-items: center; gap: 6px; }
.fm-daynav .fm-input { width: auto; min-width: 150px; }
.fm-daynav .fm-btn { min-height: 44px; padding: 4px 14px; font-size: 18px; }
.fm-sheetgrid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.fm-scol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.fm-sumcard { grid-column: 1 / -1; }
.fm-srows { padding-bottom: 8px; }
.fm-srows .fm-subject-row { padding-left: 0; padding-right: 0; }
.fm-srow { list-style: none; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--fm-line); padding: 2px 0; }
.fm-srow.is-changed { background: color-mix(in srgb, var(--accent) 12%, transparent); margin: 0 -18px; padding: 2px 18px; }
.fm-srow.is-waiting .fm-recent-meta { color: #b45309; font-weight: 600; }
.fm-check { flex: 0 0 auto; width: 26px; height: 26px; margin: 0; accent-color: var(--accent, var(--fm-brand)); cursor: pointer; }
.fm-srow-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px 0; cursor: pointer; line-height: 1.3; }
.fm-srow-text .fm-recent-label { font-weight: 600; }
.fm-srow:not(.is-on) .fm-srow-text .fm-recent-label { font-weight: 500; }
.fm-stepper { display: inline-flex; align-items: center; gap: 4px; }
.fm-step { width: 30px; height: 30px; border-radius: 999px; border: 1px solid var(--fm-line); background: var(--fm-card); font-size: 18px; line-height: 1; font-weight: 700; color: var(--fm-ink); cursor: pointer; }
.fm-count-val { min-width: 26px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.fm-sumbody .fm-rows { padding-bottom: 4px; }
.fm-sumempty { padding: 4px 18px 8px; margin: 0; }
.fm-sumrow.is-removed .fm-recent-label { text-decoration: line-through; opacity: .7; }
.fm-sumrow.is-new .fm-recent-meta { color: var(--fm-brand); font-weight: 600; }
.fm-badge.is-mini { width: 24px; height: 24px; border-radius: 8px; font-size: 12px; }
.fm-sumtotal { margin: 0 18px 8px; padding: 10px 0 4px; }
.fm-sumtotal strong.pos { color: var(--fm-pos); } .fm-sumtotal strong.neg { color: var(--fm-neg); }
.fm-sumbody .fm-foot { padding: 0 18px 14px; margin: 0; }
.fm-savebar { position: sticky; bottom: 12px; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 16px; background: var(--fm-card); border: 1px solid var(--fm-line); box-shadow: 0 8px 28px rgba(15, 23, 42, .18); }
.fm-savebar.has-changes { border-color: var(--fm-brand); }
.fm-savebar-info { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fm-savebar-total { font-weight: 800; font-variant-numeric: tabular-nums; }
.fm-savebar-total.pos { color: var(--fm-pos); } .fm-savebar-total.neg { color: var(--fm-neg); }
.fm-savebar-actions { display: flex; gap: 8px; }
.fm-btn:disabled { opacity: .5; cursor: not-allowed; }
.fm-app.has-savebar .fm-toast { bottom: 96px; }
@media (max-width: 720px) {
	.fm-sheettools { grid-template-columns: 1fr; }
	.fm-sheetgrid { display: flex; flex-direction: column; }
	.fm-scol { display: contents; }
	.fm-scat-A { order: 1; } .fm-scat-B { order: 2; } .fm-scat-C { order: 3; } .fm-scat-D { order: 4; } .fm-scat-E { order: 5; } .fm-scat-month { order: 6; }
	.fm-sumcard { order: 7; }
	.fm-sumbody .fm-rows { columns: 1; }
	.fm-savebar { bottom: 8px; flex-wrap: nowrap; }
	.fm-savebar-info { flex-direction: column; gap: 0; }
	.fm-savebar-info .fm-recent-meta { display: none; }
	.fm-savebar-info { flex: 1; min-width: 0; }
	.fm-savebar-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.fm-savebar-total { white-space: nowrap; font-size: 14px; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
	.fm-savebar-actions { gap: 6px; flex: 0 0 auto; }
	.fm-savebar .fm-btn { padding: 8px 10px; white-space: nowrap; }
}

.fm-srow-text { color: var(--fm-ink); }
.fm-srow-text .fm-recent-meta { color: var(--fm-muted); }
.fm-sumbody .fm-rows { columns: 2; column-gap: 36px; }
.fm-sumrow { break-inside: avoid; justify-content: flex-start; }
.fm-sumrow .fm-row-name { flex: 1; text-align: left; display: flex; flex-direction: column; }
.fm-sumrow .fm-pts { margin-left: auto; }

/* ---- Monthly milestone card ---- */
.fm-milecard { margin-bottom: 16px; border-top: 5px solid var(--fm-brand); }
.fm-mile-h { justify-content: space-between; }
.fm-milenav { display: flex; align-items: center; gap: 8px; }
.fm-milemonth { min-width: 110px; text-align: center; font-weight: 700; }
.fm-milebanner { margin: 0 18px 4px; padding: 8px 14px; border-radius: 12px; background: var(--fm-z-amber-bg); color: var(--fm-ink); font-weight: 600; font-size: 14px; }
.fm-milebody { padding: 2px 18px 10px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fm-miletext { margin: 0; font-size: 16px; flex: 1; min-width: 180px; }
.fm-milestatus { padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.fm-milestatus.is-open { background: var(--fm-soft); color: var(--fm-muted); }
.fm-milestatus.is-done { background: var(--fm-good-bg); color: var(--fm-pos); }
.fm-milestatus.is-missed { background: var(--fm-bad-bg); color: var(--fm-neg); }
.fm-milebtn { padding: 0 18px 16px; }
.fm-radios { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.fm-radio { display: flex; align-items: center; gap: 8px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.fm-radio input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
/* Radio choices live inside .fm-field, whose label style (small grey uppercase block) must not apply to them. */
.fm-field label.fm-radio, .fm-sheet label.fm-radio { display: flex; margin-bottom: 0; font-size: 15px; font-weight: 600; color: var(--fm-ink); text-transform: none; letter-spacing: 0; }
@media (max-width: 480px) {
	.fm-mile-h { flex-direction: column; align-items: flex-start; gap: 8px; }
	.fm-milenav { align-self: stretch; justify-content: space-between; }
}

/* ---- Settings (in-app family administration) ---- */
button.fm-link { background: none; border: none; padding: 0; font: inherit; cursor: pointer; }
.fm-settings { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.fm-setbody { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.fm-setgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; align-items: start; }
/* Labels differ in length (one or two lines): reserve two lines for every label so all inputs in a row start at the same height. */
.fm-setgrid .fm-field { min-width: 0; }
.fm-setgrid .fm-field label { min-height: 2.9em; margin-bottom: 4px; }
.fm-setgrid .fm-input { width: 100%; box-sizing: border-box; }
.fm-rsetcat { display: grid; grid-template-columns: 36px repeat(3, minmax(100px, 1fr)); gap: 10px; align-items: end; padding-top: 10px; border-top: 1px solid var(--fm-line); }
.fm-rsetcat:first-child { border-top: none; padding-top: 0; }
.fm-psettable { display: flex; flex-direction: column; gap: 10px; margin: 0 18px; }
.fm-psetrow { display: grid; grid-template-columns: 70px 90px 1.2fr 1.6fr 70px 90px repeat(4, auto) 70px; gap: 8px; align-items: end; padding: 10px 0; border-top: 1px solid var(--fm-line); }
.fm-psetrow:first-child { border-top: none; }
.fm-checkline { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.fm-checkline input { width: 18px; height: 18px; margin: 0; }
.fm-ok { color: var(--fm-pos); font-weight: 600; }
code.fm-pw { background: var(--fm-soft); padding: 2px 8px; border-radius: 6px; }

/* ---- Theme picker (per-child Overview background) ---- */
.fm-themepicks { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-themepick { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px solid var(--fm-line); background: var(--fm-card); border-radius: 14px; padding: 8px 10px; min-width: 76px; }
.fm-themepick.is-on { border-color: var(--fm-brand); }
.fm-themeswatch { display: flex; width: 60px; height: 22px; border-radius: 8px; overflow: hidden; border: 1px solid var(--fm-line); }
.fm-themeswatch-seg { flex: 1; }
.fm-themepick-name { font-size: 12px; font-weight: 600; }

/* ----------------------------------------------------- "your photos" grid (Settings > Family) */
.fm-photogrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.fm-phototile {
	position: relative; aspect-ratio: 1; border: 2px dashed var(--fm-line); border-radius: 12px;
	background-color: var(--fm-soft); background-position: center; background-size: cover; background-repeat: no-repeat;
	padding: 0; cursor: pointer;
}
.fm-phototile.has-photo { border-style: solid; border-color: var(--fm-line); }
.fm-phototile-cat { position: absolute; top: 4px; left: 6px; font-size: 11px; font-weight: 800; color: var(--fm-muted); }
.fm-phototile.has-photo .fm-phototile-cat { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.fm-phototile-plus { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; font-weight: 700; color: var(--fm-muted); }
.fm-phototile-x {
	position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center;
	background: rgba(15, 23, 42, .55); color: #fff; font-size: 14px; line-height: 1;
}
@media (max-width: 720px) {
	.fm-psetrow { grid-template-columns: repeat(2, 1fr); }
	.fm-rsetcat { grid-template-columns: 1fr; }
}

/* Money plans (Settings > Money) */
.fm-plans-title { font-size: 16px; margin: 18px 0 8px; }
.fm-plans { display: grid; gap: 10px; }
.fm-plan { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--fm-line); border-radius: 14px; background: var(--fm-card); cursor: pointer; }
.fm-plan.is-on { border-color: var(--fm-brand); background: var(--fm-soft); }
.fm-plan input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; }
.fm-plan-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-transform: none; letter-spacing: 0; }
.fm-plan-body strong { font-size: 16px; color: var(--fm-ink); }
.fm-plan-body small { font-size: 14px; color: var(--fm-muted); font-weight: 400; }
.fm-plan-pcts { font-size: 13px; font-weight: 700; color: var(--fm-brand); margin-top: 2px; }
.fm-setgrid label.fm-plan, .fm-field label.fm-plan { text-transform: none; letter-spacing: 0; margin: 0; min-height: 0; display: flex; color: var(--fm-ink); font-size: 14px; }
.fm-plan-example { margin: 14px 0 4px; padding: 12px 16px 4px; border-radius: 14px; background: var(--fm-soft); }
.fm-plan-example > p { margin: 4px 0 4px; font-size: 14px; color: var(--fm-muted); }
.fm-advanced { margin-top: 16px; border-top: 1px solid var(--fm-line); padding-top: 10px; }
.fm-advanced summary { cursor: pointer; font-weight: 700; color: var(--fm-muted); padding: 6px 0; }
.fm-advanced .fm-field { margin: 10px 0; }
.fm-custom-fields { margin-top: 12px; }

/* Cancel / delete, and the small links at the bottom of the app */
.fm-btn.is-danger { background: var(--fm-card); color: var(--fm-neg); border: 2px solid var(--fm-neg); font-weight: 700; }
.fm-sheet .fm-btn.is-danger { background: var(--fm-neg); color: #fff; border-color: var(--fm-neg); }
.fm-ok { color: var(--fm-pos); font-weight: 600; }
.fm-billing-links { margin-top: 4px; }
.fm-appfoot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 10px 0 0; font-size: 13px; }
.fm-appfoot .fm-link { font-weight: 500; color: var(--fm-muted); }
.fm-appfoot .fm-linkbtn { padding: 0; }

/* Focus models: the pill row that picks a focus, its one-line description, and the "Focus: ..." caption. */
.fm-focus .fm-pills { margin-bottom: 4px; }
.fm-focus .fm-pill { padding: 6px 16px; }
.fm-focus-tag { margin: 6px 0 14px; max-width: 62ch; }
.fm-focusline { margin: 6px 0 12px; font-weight: 600; }

/* ------------------------------------------------------------- coach message */
.fm-coach { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 14px; padding: 14px 16px; border: 1px solid var(--fm-line); border-left: 6px solid var(--fm-z-stable); border-radius: var(--fm-radius); background: var(--fm-card); box-shadow: var(--fm-shadow); }
.fm-coach-icon { font-size: 30px; line-height: 1; }
.fm-coach-body { min-width: 0; }
.fm-coach p { margin: 0; }
.fm-coach-head { font-weight: 700; font-size: 17px; line-height: 1.35; }
.fm-coach-line { margin-top: 6px; color: var(--fm-ink); font-size: 15px; line-height: 1.4; }
.fm-coach-sub { margin-top: 6px; color: var(--fm-muted); font-size: 13px; }
.fm-coach-top { border-left-color: var(--fm-z-growth); background: var(--fm-z-growth-bg); }
.fm-coach-top .fm-coach-head { font-size: 19px; }
.fm-coach-top .fm-coach-icon { animation: fm-pop .9s ease-out 1; }
.fm-coach-close { border-left-color: var(--fm-z-growth); }
.fm-coach-onway { border-left-color: var(--fm-z-stable); }
.fm-coach-slip { border-left-color: var(--fm-z-amber); background: var(--fm-z-amber-bg); }
.fm-coach-nodata { border-left-color: var(--fm-line); }
@keyframes fm-pop { 0% { transform: scale(.4) rotate(-20deg); opacity: 0; } 60% { transform: scale(1.3) rotate(8deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@media (prefers-reduced-motion: reduce) { .fm-coach-top .fm-coach-icon { animation: none; } }

.fm-coach-tips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.fm-coach-tiplabel { color: var(--fm-muted); font-size: 13px; margin-right: 2px; }
.fm-coach-tip { display: inline-block; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--fm-line); background: var(--fm-soft); font-size: 13px; line-height: 1.35; }

.fm-codeline { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.fm-codeline .fm-input { flex: 1 1 160px; min-width: 0; }

.fm-plan-choose { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 8px 0 16px; }
.fm-plan-pick { padding: 16px; border-radius: 14px; border: 2px solid var(--fm-line, rgba(127,127,127,.25)); display: flex; flex-direction: column; gap: 6px; }
.fm-plan-pick.is-year { border-color: var(--fm-pos); background: var(--fm-good-bg); }
.fm-plan-badge { align-self: flex-start; padding: 3px 10px; border-radius: 999px; background: var(--fm-pos); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.fm-plan-pick h3 { margin: 0; font-size: 20px; font-weight: 800; }
.fm-plan-price { margin: 0; font-size: 30px; line-height: 1.1; font-weight: 800; }
.fm-plan-pick .fm-btn { margin-top: auto; }
.fm-plan-badge.is-plain { background: var(--fm-line, #e3e6ee); color: var(--fm-ink-2, #4a5568); }
.fm-plan-full s { text-decoration-thickness: 2px; }

.fm-summary.is-holiday { max-width: 440px; display: flex; flex-direction: column; }

/* Birthday reminders */
.fm-bdays { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.fm-bdays:empty { display: none; }
.fm-bday .fm-coach-line { margin: 4px 0 0; }
.fm-bday .fm-btn { margin-top: 8px; }
.fm-bday.is-today { border-color: #f59e0b; background: linear-gradient(135deg, #fffbeb, #fef3c7); }

/* ------------------------------------------------------------------ help panel */
.fm-helpbtn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--fm-line); background: var(--fm-card); border-radius: 999px; padding: 4px 12px 4px 5px; font-size: 14px; font-weight: 600; color: var(--fm-ink); position: relative; }
.fm-helpbtn:hover { background: var(--fm-soft); }
.fm-helpbtn-q { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--fm-brand); color: #fff; font-size: 14px; font-weight: 700; line-height: 1; }
.fm-helpbtn.is-new::after { content: ""; position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 2px var(--fm-bg); }
.fm-help {
	position: fixed; top: 0; right: 0; bottom: 0; z-index: 99997; width: min(420px, 100%);
	display: flex; flex-direction: column; background: var(--fm-card); color: var(--fm-ink); border-left: 1px solid var(--fm-line);
	box-shadow: -8px 0 28px rgba(15, 23, 42, .14); overflow-y: auto; box-sizing: border-box;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 15px; line-height: 1.45;
}
.fm-help *, .fm-help *::before, .fm-help *::after { box-sizing: border-box; }
.fm-help h2, .fm-help h3, .fm-help p, .fm-help ol, .fm-help ul { margin: 0; padding: 0; }
.fm-help ul, .fm-help ol { list-style: none; }
.fm-help button { font: inherit; color: inherit; cursor: pointer; }
.fm-help-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: var(--fm-card); border-bottom: 1px solid var(--fm-line); }
.fm-help-head h2 { font-size: 18px; }
.fm-help-back { border: 0; background: none; color: var(--fm-brand); font-weight: 600; padding: 6px 4px; }
.fm-help-x { border: 0; background: var(--fm-soft); width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; flex: none; }
.fm-help-body { padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.fm-help-title { font-size: 21px; line-height: 1.25; }
.fm-help-intro { color: var(--fm-muted); }
.fm-help-steps { display: flex; flex-direction: column; gap: 10px; counter-reset: st; }
.fm-help-steps li { counter-increment: st; position: relative; padding: 2px 0 2px 38px; }
.fm-help-steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--fm-brand); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.fm-help-tip { background: var(--fm-z-amber-bg); color: #78350f; border-left: 4px solid var(--fm-z-amber); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.fm-help-open { align-self: flex-start; }
.fm-help-search { width: 100%; }
.fm-help-start { border: 1px solid var(--fm-line); background: var(--fm-soft); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.fm-help-start h3 { font-size: 16px; }
.fm-help-bar { height: 8px; border-radius: 999px; background: var(--fm-line); overflow: hidden; }
.fm-help-bar span { display: block; height: 100%; background: var(--fm-z-growth); border-radius: 999px; }
.fm-help-check { display: flex; flex-direction: column; gap: 6px; }
.fm-help-check li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fm-help-check label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.fm-help-check input { margin-top: 3px; flex: none; width: 18px; height: 18px; }
.fm-help-check li.is-done label span { color: var(--fm-muted); text-decoration: line-through; }
.fm-help-check .fm-linkbtn { flex: none; font-weight: 600; }
.fm-help-list { display: flex; flex-direction: column; gap: 6px; }
.fm-help-group { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--fm-muted); margin: 10px 0 2px; }
.fm-help-topics { display: flex; flex-direction: column; gap: 8px; }
.fm-help-topic { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--fm-line); border-radius: 12px; background: var(--fm-card); }
.fm-help-topic:hover { border-color: var(--fm-brand); background: var(--fm-soft); }
.fm-help-topic span { color: var(--fm-muted); font-size: 13px; }
/* Wide screen: the app is squeezed to the left so both stay in view. */
@media (min-width: 1100px) {
	.fm-app.has-help { margin-left: 16px; margin-right: 436px; max-width: none; }
}
@media (max-width: 1099px) {
	.fm-help { width: min(440px, 100%); }
}
@media (max-width: 760px) {
	.fm-help { width: 100%; border-left: 0; }
	.fm-helpbtn-t { display: none; }
	.fm-helpbtn { padding: 4px 5px; }
}
@media (prefers-color-scheme: dark) { .fm-help-tip { background: #3b2a06; color: #fde68a; } }

/* The monthly milestone is visible in every list but cannot be tapped: it is set on Overview, Details. */
.fm-tap.is-locked { opacity: .55; cursor: not-allowed; filter: grayscale(.4); }
.fm-srow.is-locked { opacity: .65; }
.fm-srow.is-locked .fm-check, .fm-srow.is-locked label { cursor: not-allowed; }

/* Money screen: coloured week types and euro examples */
.fm-plan-eur { font-size: 13px; color: var(--fm-ink); margin-top: 4px; line-height: 1.4; }
.fm-ex-line { margin: 6px 0 8px; padding: 8px 12px; border-left: 4px solid var(--fm-z-stable); border-radius: 8px; background: var(--fm-card); color: var(--fm-ink); font-size: 14px; }
.fm-zline { align-items: center; }
.fm-zdot { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; margin-right: 2px; }
.fm-zline .fm-mline-text { flex: 1 1 auto; }

/* The standard models chart */
.fm-fchart { margin: 10px 0 14px; }
.fm-fchart-title { font-size: 16px; margin: 0 0 8px; }
.fm-fchart-scroll { overflow-x: auto; border: 1px solid var(--fm-line); border-radius: 12px; }
.fm-fchart-table { border-collapse: collapse; width: 100%; min-width: 440px; font-size: 13px; }
.fm-fchart-table th, .fm-fchart-table td { padding: 8px 8px; text-align: center; border-top: 1px solid var(--fm-line); vertical-align: middle; }
.fm-fchart-table thead th { border-top: 0; font-size: 13px; background: var(--fm-soft); }
.fm-fchart-table tbody th { text-align: left; font-weight: 600; width: 34%; position: sticky; left: 0; background: var(--fm-card); }
.fm-lvl-dots { display: flex; justify-content: center; gap: 3px; margin: 0 0 3px; min-height: 9px; }
.fm-lvl-w { display: block; }
.fm-lvl-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--fm-line); display: inline-block; }
.fm-lvl-dots i.is-on { background: var(--fm-brand); }
.fm-lvl.is-same { color: var(--fm-muted); }
.fm-fchart-best td { font-size: 12px; color: var(--fm-muted); text-align: left; vertical-align: top; }
.fm-fchart-note { margin: 8px 0 0; }
.fm-fchart-more { margin: 4px 0 8px; }
.fm-fchart-more > summary { cursor: pointer; font-weight: 600; color: var(--fm-brand); }

.fm-milecard.is-compact{padding:10px 14px}
.fm-milecard.is-compact .fm-mile-h{margin-bottom:6px}
.fm-milecard.is-compact .fm-mile-h h2{font-size:15px}
.fm-milerow{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.fm-milerow .fm-miletext{flex:1 1 220px;margin:0}
.fm-milerow .fm-empty{flex:1 1 220px}

/* ---- Invite families (Billing) ---- */
.fm-refrow { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; margin: 4px 0 10px; }
.fm-reflink { flex: 1 1 220px; min-width: 0; font-size: 14px; }
.fm-refshare { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.fm-refshare .fm-btn { text-decoration: none; display: inline-flex; align-items: center; }
.fm-refprog { margin: 8px 0 6px; }
.fm-refdots { display: flex; gap: 8px; margin-bottom: 8px; }
.fm-refdot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--fm-line); background: var(--fm-card); box-sizing: border-box; }
.fm-refdot.is-on { background: var(--fm-good, #16a34a); border-color: var(--fm-good, #16a34a); }

.fm-refplan { background: var(--fm-soft, #f1f5f9); border-radius: 12px; padding: 10px 14px; margin: 4px 0 10px; }
.fm-refplan p { margin: 4px 0; font-size: 14px; }

.fm-reftable { width: 100%; border-collapse: collapse; margin: 2px 0 6px; font-size: 14px; }
.fm-reftable th, .fm-reftable td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--fm-line); }
.fm-reftable thead th { font-size: 12px; font-weight: 600; color: var(--fm-muted); }
.fm-reftable tbody th { font-weight: 600; }
.fm-reftable .fm-refnew { font-weight: 700; color: var(--fm-good, #15803d); }
.fm-reftable tr.is-mine { background: color-mix(in srgb, var(--fm-good, #16a34a) 10%, transparent); }
.fm-refmine { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--fm-good, #16a34a); color: #fff; }

.fm-refpay { display: block; font-weight: 400; font-size: 12px; color: var(--fm-muted); margin-top: 2px; }


/* ---- Vault ---- */
.fm-vaultcard { padding: 18px 20px; }
.fm-vault-h { margin-bottom: 10px; }
.fm-vault-top { display: flex; align-items: center; gap: 14px; }
.fm-vault-ico { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 16px; background: var(--fm-good-bg); display: flex; align-items: center; justify-content: center; font-size: 28px; line-height: 1; }
.fm-vault-ico.is-dash { background: var(--fm-soft); border: 2px dashed var(--fm-line); }
.fm-vault-name { display: flex; flex-direction: column; min-width: 0; }
.fm-vault-name strong { font-size: 19px; overflow-wrap: anywhere; }
.fm-vault-name small { color: var(--fm-muted); font-size: 14px; }
.fm-vault-bar { position: relative; height: 18px; border-radius: 9px; background: var(--fm-soft); margin: 16px 0 6px; overflow: hidden; }
.fm-vault-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 9px; background: var(--fm-z-growth); transition: width .6s ease; min-width: 0; }
.fm-vault-fill.is-full { background: var(--fm-z-stable); }
.fm-vault-tick { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: var(--fm-card); }
.fm-vault-stops { position: relative; height: 16px; font-size: 12px; color: var(--fm-muted); }
.fm-vault-stops span { position: absolute; top: 0; transform: translateX(-50%); }
.fm-vault-stops span:nth-child(1) { left: 25%; }
.fm-vault-stops span:nth-child(2) { left: 50%; }
.fm-vault-stops span:nth-child(3) { left: 75%; }
.fm-vault-stops span:nth-child(4) { left: auto; right: 0; transform: none; }
.fm-vault-saved { margin: 10px 0 0; font-size: 15px; color: var(--fm-muted); }
.fm-vault-saved strong { font-size: 28px; color: var(--fm-ink); }
.fm-vault-sub { margin: 2px 0 12px; font-size: 14px; color: var(--fm-muted); }
.fm-vault-full { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--fm-z-growth-bg); color: var(--fm-ink); }
.fm-vault-full strong { font-size: 17px; }
.fm-vault-rows { border-top: 1px solid var(--fm-line); }
.fm-vault-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--fm-line); font-size: 14px; }
.fm-vault-row span { color: var(--fm-muted); }
.fm-vault-row strong { text-align: right; }
.fm-vault-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fm-vault-act .fm-btn { flex: 1 1 auto; min-height: 40px; padding: 8px 14px; }
.fm-vault-act .fm-btn.is-quiet { color: var(--fm-muted); font-weight: 600; }
.fm-vault-wait { margin: 14px 0 0; color: var(--fm-muted); }
.fm-vault-note { margin: 12px 0 0; font-size: 12px; color: var(--fm-muted); }
.fm-vault-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.fm-vault-shelf { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--fm-line); }
.fm-vault-shelf h3 { margin: 0 0 8px; font-size: 14px; }
.fm-vault-shelfrow { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.fm-vault-shelfrow.is-stopped { opacity: .75; }
.fm-vault-mini { width: 34px; height: 34px; border-radius: 10px; background: var(--fm-soft); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.fm-vault-shelfname { display: flex; flex-direction: column; min-width: 0; }
.fm-vault-shelfname small { color: var(--fm-muted); }
.fm-vault-log { margin-top: 12px; font-size: 13px; color: var(--fm-muted); }
.fm-vault-log summary { cursor: pointer; font-weight: 600; }
.fm-vault-log p { margin: 6px 0 0; }
.fm-vault-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-vault-pick { width: 48px; height: 48px; border-radius: 14px; border: 2px solid var(--fm-line); background: var(--fm-card); font-size: 24px; line-height: 1; cursor: pointer; }
.fm-vault-pick.is-on { border-color: var(--fm-brand); background: var(--fm-soft); }
.fm-vault-slide { display: flex; align-items: center; gap: 14px; }
.fm-vault-range { flex: 1; min-height: 44px; accent-color: var(--fm-brand); }
.fm-vault-pctout { min-width: 48px; text-align: right; font-size: 18px; }
.fm-vault-preview { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--fm-soft); color: var(--fm-ink); }
.fm-vaultcard.is-compact { padding: 14px 18px; }
.fm-vaultcard.is-compact .fm-vault-h { margin-bottom: 6px; }
.fm-vaultcard.is-compact .fm-vault-ico { width: 44px; height: 44px; font-size: 24px; border-radius: 13px; }
.fm-vaultcard.is-compact .fm-vault-bar { margin-top: 12px; }
.fm-vaultcard.is-compact .fm-vault-saved strong { font-size: 22px; }
.fm-vaultcard.is-compact .fm-vault-sub { margin-bottom: 4px; }
.fm-vaultcard.is-compact .fm-vault-act { margin-top: 8px; }
.fm-vault-basis { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.fm-vault-basis .fm-radio { display: flex; align-items: flex-start; gap: 10px; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 14px; color: var(--fm-ink); margin: 0; }
.fm-vault-owed { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--fm-z-amber-bg); color: var(--fm-ink); }
.fm-vault-owed h3 { margin: 0 0 8px; font-size: 14px; }
.fm-vault-owedrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.fm-vault-owedrow .fm-btn { min-height: 38px; padding: 6px 14px; }

/* Weekly check-in */
.fm-weeklabel { flex: 1; text-align: center; font-weight: 600; white-space: nowrap; min-width: 150px; }
.fm-weekhint { margin: 12px 0 0; }
.fm-ratingrow { display: block; padding: 4px 10px 8px; }
.fm-rating { display: flex; flex-wrap: wrap; gap: 6px; }
.fm-seg.is-rate { flex: 1 1 auto; min-width: 58px; padding: 7px 8px; font-size: 13px; text-align: center; }
.fm-seg.is-rate.pos.is-on { background: var(--fm-z-growth); border-color: var(--fm-z-growth); color: var(--fm-ink); }
.fm-seg.is-rate.neg.is-on { background: var(--fm-z-red); border-color: var(--fm-z-red); color: var(--fm-ink); }
.fm-seg.is-rate:disabled { opacity: .55; }
.fm-scat-month { --accent: var(--fm-ink); }

/* monthly milestone goals */
.fm-milebody{flex-direction:column;align-items:stretch;gap:10px}
.fm-miletop{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px}
.fm-milecount{font-weight:800;font-size:18px}
.fm-milechip{margin-left:auto;padding:3px 10px;border-radius:999px;background:var(--fm-soft);color:var(--fm-muted);font-size:13px;font-weight:700}
.fm-milebar{display:flex;gap:6px}
.fm-milebar span{flex:1;height:10px;border-radius:999px;background:var(--fm-soft)}
.fm-milebar span.is-on{background:var(--fm-pos)}
.fm-milegoals{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.fm-milegoals li{display:flex;align-items:center;gap:10px;font-size:16px}
.fm-milegoals li .t{flex:1}
.fm-milegoals li.is-done .t{color:var(--fm-muted);text-decoration:line-through}
.fm-milepts{font-weight:700;color:var(--fm-pos);font-size:14px}
.fm-mile-tick{flex:none;width:30px;height:30px;border-radius:50%;border:2px solid var(--fm-muted);background:transparent;color:#fff;font-size:17px;line-height:1;display:inline-flex;align-items:center;justify-content:center;padding:0;cursor:pointer}
span.fm-mile-tick{cursor:default}
.fm-mile-tick.is-done{background:var(--fm-pos);border-color:var(--fm-pos)}
.fm-milerows{display:flex;flex-direction:column;gap:8px;margin-bottom:8px}
.fm-milerow-e{display:flex;align-items:center;gap:8px}
.fm-milerow-e .fm-input{flex:1;min-width:0}
.fm-sheet .fm-mileskip{display:flex;align-items:center;gap:8px;margin:12px 0}
.fm-undonebar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;padding:8px 4px 16px}
.fm-undonebar .fm-linkbtn{font-weight:600;text-decoration:underline;cursor:pointer;color:var(--fm-brand)}

.fm-help-topic mark{background:#fde68a;color:inherit;border-radius:3px;padding:0 1px}
.fm-help-snip{font-size:13px;color:var(--fm-muted)}
.fm-help-count{margin:8px 2px}

/* child's page: big picture panel beside the monthly milestone */
.fm-hero{display:grid;grid-template-columns:270px minmax(0,1fr);gap:16px;margin-bottom:16px;align-items:stretch}
.fm-hero .fm-milecard{margin-bottom:0}
.fm-portrait{padding:14px;text-align:center;border-top:5px solid var(--kid,var(--fm-brand));display:flex;flex-direction:column;gap:10px}
.fm-portrait-btn{display:block;width:100%;padding:0;border:0;background:none;cursor:pointer;border-radius:20px}
.fm-portrait-btn.is-static{cursor:default}
.fm-portrait-img{display:grid;place-items:center;width:100%;aspect-ratio:1/1;border-radius:20px;color:#fff;font-size:92px;font-weight:800;box-shadow:0 6px 18px rgba(0,0,0,.16)}
.fm-portrait-img.is-photo{background-size:cover;background-position:50% 28%;background-repeat:no-repeat}
.fm-portrait-img.is-emoji{font-size:110px;line-height:1}
.fm-portrait-btn:not(.is-static):hover .fm-portrait-img{filter:brightness(.96)}
.fm-portrait-text h1{font-size:26px;line-height:1.15;margin:0}
.fm-portrait-text .fm-sub{margin:2px 0 0}
@media (max-width:979px){
 .fm-hero{grid-template-columns:1fr;gap:12px;margin-bottom:12px}
 .fm-portrait{flex-direction:row;align-items:center;text-align:left;gap:14px;padding:12px}
 .fm-portrait-btn{width:104px;flex:none}
 .fm-portrait-img{font-size:44px;border-radius:18px}
 .fm-portrait-img.is-emoji{font-size:54px}
 .fm-portrait-text h1{font-size:24px}
}

/* Day sheet: week-so-far note under the late / skipped counters; Quick tap: "x2 today" badge; Start fresh sheet */
.fm-attnote { list-style: none; margin: 8px 0 6px; padding: 9px 12px; border-radius: 10px; background: #fef3c7; color: #78350f; font-size: 13px; line-height: 1.4; }
@media (prefers-color-scheme: dark) { .fm-attnote { background: rgba(245, 158, 11, .18); color: #fcd34d; } }
.fm-tap.has-badge { padding-right: 132px; }
.fm-tap-badge { position: absolute; right: 64px; top: 14px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--fm-bad-bg); color: var(--fm-neg); white-space: nowrap; }
.fm-fresh-h { color: var(--fm-neg); }
.fm-fresh-list { margin: 4px 0 10px 20px; padding: 0; }
.fm-fresh-list li { margin: 3px 0; }

/* Monthly milestone: points in total */
.fm-miletotal { margin: 8px 0 0; font-size: 13px; }

/* Repair items that have no incident to repair yet */
.fm-srow.is-norepair { opacity: .5; }
.fm-srow.is-norepair .fm-srow-text { cursor: not-allowed; }
.fm-srow.is-norepair .fm-recent-meta { color: #92400e; }

/* Score in the name card (Overview) */
.fm-pscore { display: none; text-align: center; }
.fm-pscore.is-on { display: block; }
.fm-pscore-num { font-size: 56px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 2px 0 6px; }
.fm-pscore-cap { color: var(--fm-muted); font-size: 13px; margin-top: 4px; }
@media (max-width: 979px) {
 .fm-portrait-btn { width: 88px; }
 .fm-portrait-text { flex: 1; min-width: 0; }
 .fm-portrait-text h1 { font-size: 20px; overflow-wrap: anywhere; }
 .fm-pscore.is-on { flex: none; min-width: 84px; margin-left: auto; }
 .fm-pscore-num { font-size: 42px; margin: 0 0 4px; }
 .fm-pscore-cap { font-size: 11.5px; line-height: 1.2; }
}

/* Wide screens: name card, milestone and score side by side in one low row */
.fm-pscore-card { display: none; }
@media (max-width: 979px) { .fm-pscore-card, .fm-pscore-card.is-on { display: none !important; } }
@media (min-width: 980px) {
 .fm-hero { grid-template-columns: 250px minmax(0, 1fr) 270px; gap: 16px; align-items: stretch; }
 .fm-pscore, .fm-pscore.is-on { display: none; }
 /* The photo stays big and fills the card; the name and the dates sit under it. */
 .fm-portrait { flex-direction: column; align-items: stretch; text-align: center; gap: 8px; padding: 14px; justify-content: space-between; }
 .fm-portrait-btn { width: 100%; flex: none; }
 .fm-portrait-img { font-size: 84px; border-radius: 20px; }
 .fm-portrait-img.is-emoji { font-size: 100px; }
 .fm-portrait-text h1 { font-size: 22px; overflow-wrap: anywhere; }
 .fm-portrait-text .fm-sub { margin-top: 2px; }
 .fm-portrait-text { min-width: 0; }
 .fm-pscore-card.is-on { display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 16px 20px; margin-bottom: 0; border-top: 5px solid var(--fm-z-stable); }
 .fm-pscore-card.is-zone-growth { border-top-color: var(--fm-z-growth); }
 .fm-pscore-card.is-zone-stable { border-top-color: var(--fm-z-stable); }
 .fm-pscore-card.is-zone-amber { border-top-color: var(--fm-z-amber); }
 .fm-pscore-card.is-zone-red { border-top-color: var(--fm-z-red); }
 .fm-pscore-num.is-big { font-size: 72px; margin: 0 0 8px; }
 .fm-pscore-card .fm-pscore-cap { font-size: 14px; margin-top: 6px; }
 .fm-pscore-card .fm-meter { margin: 14px 0 0; padding: 0; }
 .fm-pscore-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--fm-muted); }
}
@media (min-width: 980px) {
 .fm-hero .fm-milebtn { margin-top: 2px; }
 .fm-hero .fm-milebtn .fm-btn { padding: 6px 18px; font-size: 14px; }
 .fm-hero .fm-miletotal { margin-top: 4px; }
}
@media (min-width: 1180px) { .fm-hero .fm-mile-h h2 { white-space: nowrap; } }

/* Vault: a slimmer card (empty state on one line, tighter running goal) */
.fm-vaultcard { padding: 12px 20px; }
.fm-vault-h { margin-bottom: 6px; }
.fm-vault-empty { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.fm-vault-empty .fm-vault-ico { width: 40px; height: 40px; font-size: 22px; border-radius: 12px; }
.fm-vault-empty .fm-empty { margin: 0; flex: 1 1 220px; }
.fm-vault-empty .fm-btn { margin-left: auto; }
.fm-vault-bar { margin: 10px 0 4px; }
.fm-vault-saved { margin: 6px 0 0; }
.fm-vault-saved strong { font-size: 24px; }
.fm-vault-sub { margin: 2px 0 8px; }
.fm-vault-act { margin-top: 10px; }

/* Vault with a goal: one line "VAULT: [icon] NAME ... Goal", and a thinner bar */
.fm-vault-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 4px; }
.fm-vault-t { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.fm-vault-t::after { content: ":"; }
.fm-vault-mi { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; background: var(--fm-good-bg); display: flex; align-items: center; justify-content: center; font-size: 19px; line-height: 1; }
.fm-vault-nm { font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
.fm-vault-gl { margin-left: auto; color: var(--fm-muted); font-size: 14px; }
.fm-vault-bar { height: 9px; border-radius: 5px; margin: 10px 0 4px; }
.fm-vault-fill { border-radius: 5px; }
.fm-vaultcard.is-compact .fm-vault-bar { margin-top: 10px; }

/* Settings > Family > Language */
.fm-lang-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-lang-row .fm-seg { padding: 10px 18px; font-size: 15px; }
.fm-lang-note { margin: 10px 0 0; font-size: 13px; }
.fm-rep-btn { margin: 12px 0; }
.fm-checkline.fm-rep-mail { white-space: normal; align-items: flex-start; margin-top: 6px; }
.fm-checkline.fm-rep-mail input { margin-top: 2px; flex: 0 0 auto; }

/* Phones: the "ticked for this day" list is one column (the two-column rule above it came later and won). */
@media (max-width: 720px) {
	.fm-sumbody .fm-rows { columns: 1; }
}

/* calendar link card */
.fm-cal-linkrow { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.fm-cal-linkrow .fm-input { flex: 1 1 auto; min-width: 0; }
.fm-cal-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.fm-cal-btns .fm-btn { text-decoration: none; }
.fm-cal-toggle { display: block; margin: 4px 0; font-weight: 600; }
.fm-cal-list { list-style: none; margin: 8px 0; padding: 0; }
.fm-cal-list[hidden] { display: none; }
.fm-cal-item { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid rgba(0,0,0,.08); }
.fm-cal-item.is-off { opacity: .55; }
.fm-cal-sub { display: block; font-weight: 400; margin: 2px 0 0; }
.fm-cal-when { display: flex; gap: 6px; }
.fm-cal-sel { width: auto; min-width: 74px; padding: 6px 8px; }
.fm-cal-tag { display: inline-block; margin: 0 0 6px; padding: 2px 10px; border-radius: 999px; background: #e3f4e8; color: #1f6b3a; font-size: 12px; font-weight: 600; }
.fm-cal-reset { margin: 6px 0 0; }

/* sticker version (little ones) */
.fm-stk { max-width: 560px; margin: 0 auto; padding-bottom: 12px; }
.fm-stk-head { display: flex; align-items: center; gap: 14px; margin: 6px 4px 10px; }
.fm-stk-head h1 { margin: 0; font-size: 26px; line-height: 1.1; }
.fm-stk-sub { margin: 2px 0 0; font-size: 15px; font-weight: 700; color: #92600a; }
.fm-stk-wait { margin: 6px 0 10px; padding: 8px 12px; border-radius: 12px; background: #fff7e0; border: 1.5px solid #fcd34d; font-weight: 600; font-size: 14px; }
.fm-stk-tile { display: flex; align-items: center; gap: 14px; width: 100%; margin: 0 0 10px; padding: 12px 14px; border-radius: 22px; border: 3px solid #fff; background: #fff; box-shadow: 0 3px 0 rgba(15,23,42,.09); font: inherit; color: var(--fm-ink); text-align: left; cursor: pointer; min-height: 76px; }
.fm-stk-tile:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(15,23,42,.09); }
.fm-stk-ic { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 18px; background: #fff4d6; font-size: 36px; }
.fm-stk-tx { flex: 1 1 auto; font-size: 19px; font-weight: 800; line-height: 1.15; }
.fm-stk-tx small { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 600; color: var(--fm-muted); }
.fm-stk-st { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 50%; border: 3px dashed #cbd5e1; font-size: 26px; color: #cbd5e1; }
.fm-stk-tile.is-done { border-color: #fcd34d; background: #fffbea; }
.fm-stk-tile.is-done .fm-stk-st { border: 0; background: #fde68a; color: inherit; font-size: 30px; transform: rotate(-8deg); }
.fm-stk-tile.is-wait { border-color: #c7d2fe; background: #f5f7ff; }
.fm-stk-tile.is-wait .fm-stk-st { border-style: solid; border-color: #c7d2fe; color: inherit; }
.fm-stk-hint, .fm-stk-note { margin: 4px 8px 12px; text-align: center; font-size: 13px; color: var(--fm-muted); }
.fm-stk-card { padding: 14px; margin-bottom: 12px; }
.fm-stk-card h2 { margin: 0 0 8px; font-size: 17px; }
.fm-stk-card h3 { margin: 12px 0 4px; font-size: 15px; }
.fm-stk-days { display: flex; justify-content: space-between; gap: 4px; }
.fm-stk-day { flex: 1 1 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--fm-muted); text-transform: capitalize; }
.fm-stk-day i { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin: 4px auto 0; border-radius: 50%; background: #f1f5f9; font-style: normal; font-size: 20px; font-weight: 800; color: #92600a; }
.fm-stk-day.is-on i { background: #fde68a; }
.fm-stk-day.is-today i { outline: 3px solid var(--fm-brand); outline-offset: 1px; }
.fm-stk-day.is-future i { opacity: .55; }
.fm-stk-coll { margin: 0; font-size: 26px; line-height: 1.35; letter-spacing: 2px; word-break: break-all; }
.fm-stk-treat { display: flex; align-items: center; gap: 14px; padding: 14px; margin-bottom: 12px; background: linear-gradient(90deg, #ede9fe, #fce7f3); }
.fm-stk-treat.is-reached { background: linear-gradient(90deg, #dcfce7, #fef9c3); }
.fm-stk-treat > div { flex: 1 1 auto; min-width: 0; }
.fm-stk-treat strong { font-size: 17px; }
.fm-stk-treat small { display: block; margin-top: 4px; font-size: 13px; font-weight: 700; color: #6b21a8; }
.fm-stk-treat-ic { font-size: 40px; }
.fm-stk-bar { height: 16px; margin-top: 6px; border-radius: 99px; background: #fff; overflow: hidden; }
.fm-stk-bar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f59e0b, #f472b6); }

/* worlds */
.fm-world { padding: 14px; margin-bottom: 12px; background: var(--w-bg, #0f1b33); color: #fff; border: 0; }
.fm-world-top { display: flex; align-items: center; gap: 12px; }
.fm-world-ic { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 16px; background: rgba(255,255,255,.12); font-size: 32px; }
.fm-world-top > div { flex: 1 1 auto; min-width: 0; }
.fm-world-name { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--w-accent, #facc15); }
.fm-world-rank { font-size: 24px; font-weight: 800; line-height: 1.15; }
.fm-world-badge { padding: 4px 10px; border-radius: 9px; background: var(--w-accent, #facc15); color: #1f2937; font-size: 13px; font-weight: 800; }
.fm-world-bar { height: 14px; margin: 12px 0 6px; border-radius: 99px; background: rgba(0,0,0,.35); overflow: hidden; }
.fm-world-bar > div { height: 100%; border-radius: 99px; background: repeating-linear-gradient(135deg, var(--w-accent, #facc15) 0 10px, rgba(255,255,255,.55) 10px 20px); }
.fm-world-note { margin: 0; font-size: 13px; color: rgba(255,255,255,.82); }
.fm-stk.has-world .fm-stk-world { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 14px; border-radius: 14px; background: var(--w-bg); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-bottom: 4px solid var(--w-accent); }
.fm-stk.has-world .fm-stk-tile { border-color: var(--w-soft); background: #fff; }
.fm-stk.has-world .fm-stk-ic { background: var(--w-soft); }
.fm-stk.has-world .fm-stk-tile.is-done { border-color: var(--w-accent); background: var(--w-soft); }
.fm-stk.has-world .fm-stk-tile.is-done .fm-stk-st { background: var(--w-accent); }
.fm-stk.has-world .fm-stk-sub { color: var(--w-bg); }
.fm-stk.has-world .fm-stk-day.is-on i { background: var(--w-accent); color: #1f2937; }
.fm-stk.has-world .fm-stk-treat { background: linear-gradient(90deg, var(--w-soft), #fff); }
.fm-stk.has-world .fm-stk-bar > div { background: var(--w-accent); }
.fm-stk.has-world .fm-stk-treat small { color: var(--w-bg); }

/* ---- family adventure (0.41.0) */
.fm-adv { display: grid; gap: 14px; max-width: 640px; margin: 0 auto; }
.fm-adv-hero { background: linear-gradient(135deg, #dcfce7, #e0f2fe); border-color: #bbf7d0; }
.fm-adv-hero.is-reached { background: linear-gradient(135deg, #fef9c3, #dcfce7); border-color: #fde68a; }
.fm-adv-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .08em; color: #15803d; }
.fm-adv-name { margin: 0 0 14px; font-size: 24px; line-height: 1.2; }
.fm-adv-bar { position: relative; height: 16px; border-radius: 99px; background: rgba(255, 255, 255, .85); box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08); margin: 26px 8px 10px; }
.fm-adv-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #22c55e, #14b8a6); transition: width .4s; min-width: 16px; }
.fm-adv-thumb { position: absolute; top: -22px; transform: translateX(-50%); font-size: 26px; line-height: 1; }
.fm-adv-flag { position: absolute; right: -6px; top: -26px; font-size: 26px; line-height: 1; }
.fm-adv-count { margin: 4px 0 8px; font-size: 15px; }
.fm-adv-done { margin: 6px 0 10px; font-weight: 700; color: #92400e; }
.fm-adv-people { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.fm-adv-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border-radius: 99px; padding: 4px 12px 4px 4px; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); font-size: 14px; }
.fm-adv-chip .fm-avatar { width: 26px; height: 26px; font-size: 13px; }
.fm-adv-chip i { font-style: normal; font-weight: 800; color: #15803d; }
.fm-adv-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.fm-adv-stepped { font-weight: 700; color: #15803d; }
.fm-adv-date { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.fm-adv-date label { font-size: 13px; color: #475569; }
.fm-adv-date .fm-input { width: auto; }
.fm-adv-stop { margin-top: 10px; font-size: 13px; }
.fm-adv-empty { text-align: center; }
.fm-adv-empty span { font-size: 42px; }
.fm-adv-how ul, .fm-adv-hist { list-style: none; margin: 8px 0 0; padding: 0; }
.fm-adv-how li { padding: 8px 0; border-top: 1px solid #eef2f7; font-size: 14px; }
.fm-adv-how li:first-child { border-top: 0; }
.fm-adv-hist li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid #eef2f7; }
.fm-adv-hist li:first-child { border-top: 0; }
.fm-adv-hist small { margin-left: auto; color: #64748b; }
.fm-adv-set summary { cursor: pointer; font-weight: 700; }
.fm-adv-tile { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; background: linear-gradient(135deg, #dcfce7, #e0f2fe); border-color: #bbf7d0; }
.fm-adv-tile-ic { font-size: 34px; }
.fm-adv-tile-tx { display: grid; gap: 4px; flex: 1; }
.fm-adv-mini { display: block; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .9); overflow: hidden; }
.fm-adv-mini i { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #14b8a6); }
.fm-adv .fm-card, .fm-adv-tile { padding: 16px; }
.fm-adv-tile { margin-top: 12px; }
.fm-adv h2 { margin-top: 0; }
.fm-adv-set > summary { padding: 0; }
.fm-adv-set .fm-setbody { margin-top: 10px; }

/* ---- worlds picker groups (0.42.0) */
.fm-world-group { margin: 12px 0 2px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--fm-muted); }

/* ---- weekday under dates and the week being closed (0.43.0) */
.fm-daybadge { margin-top: 4px; font-size: 13px; color: var(--fm-ink); }
.fm-daybadge strong { font-weight: 800; }
.fm-daybadge-note { color: #b45309; font-weight: 600; }
.fm-weeknote { margin: 6px 0 0; color: #b45309; }

/* ---- closing the week (0.44.0) */
.fm-closebox:empty { display: none; }
.fm-closebox { margin-bottom: 12px; }
.fm-closebanner { padding: 14px 16px; background: #fffbeb; border-color: #fcd34d; }
.fm-closebanner h2 { margin: 0 0 4px; font-size: 17px; }
.fm-closebanner p { margin: 2px 0; }
.fm-closenames { font-weight: 800; margin: 6px 0 10px !important; }
.fm-closechild { padding: 14px 16px; background: #ecfdf5; border-color: #86efac; }
.fm-closechild p { margin: 4px 0 0; }
.fm-closewrap { margin: 12px 0 90px; display: grid; gap: 10px; }
.fm-closecard { padding: 0; }
.fm-closecard .fm-setbody { padding-top: 4px; }
.fm-closescore { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.fm-closebtn { width: 100%; justify-content: center; font-size: 17px; padding: 14px 18px; }
.fm-closenote { text-align: center; margin: 0; }
.fm-closedone { padding: 18px 16px; text-align: center; background: #dcfce7; border-color: #86efac; }
.fm-closedone-ic { font-size: 40px; line-height: 1; }
.fm-closedone h2 { margin: 6px 0; }
.fm-closedone p { margin: 4px 0; }
.fm-closedone-line { font-weight: 800; }
.fm-closemark { display: inline-block; margin-top: 6px; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 800; border: 0; font-family: inherit; }
.fm-closemark.is-closed { background: #dcfce7; color: #166534; }
.fm-closemark.is-open { background: #fef3c7; color: #92400e; cursor: pointer; }

/* ---- the spark (0.45.0): celebration and cheers */
.fm-stk-tile, .fm-cheer-got { position: relative; }
.fm-pop { animation: fm-jump .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes fm-jump { 0% { transform: scale(1); } 30% { transform: scale(1.07) rotate(-1.5deg); } 60% { transform: scale(.98) rotate(1deg); } 100% { transform: scale(1); } }
.fm-burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.fm-burst i { position: absolute; left: 0; top: 0; font-style: normal; font-size: 22px; opacity: 0; animation: fm-fly 1s ease-out forwards; animation-delay: var(--dl, 0ms); }
@keyframes fm-fly { 0% { transform: translate(0, 0) scale(.3); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: 0; } }
.fm-burst-label { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); background: #facc15; color: #713f12; font-size: 15px; font-weight: 800; border-radius: 99px; padding: 5px 13px; white-space: nowrap; box-shadow: 0 2px 0 #ca8a04; animation: fm-rise 1.2s ease-out forwards; }
@keyframes fm-rise { 0% { transform: translate(-50%, -20%) scale(.5); opacity: 0; } 25% { transform: translate(-50%, -80%) scale(1.1); opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(-50%, -190%) scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fm-pop, .fm-burst i, .fm-burst-label { animation: none; } }
.fm-spark-sound { margin-left: auto; align-self: flex-start; border: 0; background: rgba(255,255,255,.8); border-radius: 99px; width: 40px; height: 40px; font-size: 20px; cursor: pointer; }
.fm-cheerbox:empty { display: none; }
.fm-cheerbox { margin-bottom: 12px; }
.fm-cheer-card { padding: 12px 14px; }
.fm-cheer-card h2 { margin: 0 0 8px; font-size: 16px; }
.fm-cheer-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.fm-cheer-btn { border: 2px solid #c7d2fe; background: #eef2ff; border-radius: 14px; padding: 8px 12px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; color: inherit; }
.fm-cheer-btn:active { transform: translateY(1px); }
.fm-cheer-btn:disabled { opacity: .5; cursor: default; }
.fm-cheer-msg { width: 100%; }
.fm-cheer-note { margin: 6px 0 0; }
.fm-cheer-got { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: linear-gradient(135deg, #fff7ed, #ffedd5); border: 3px solid #fdba74; margin-bottom: 10px; }
.fm-cheer-ic { font-size: 42px; line-height: 1; }
.fm-cheer-tx { flex: 1; }
.fm-cheer-tx p { margin: 4px 0 0; color: #7c2d12; }
.fm-check-line { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; font-weight: 700; }
.fm-stk-tile .fm-burst { left: 86%; }

/* ---- the Today version (8 to 12): the sticker look, plus the setup sheet ---- */
.fm-today-rows { display: grid; gap: 10px; margin: 8px 0 12px; }
.fm-today-row { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--fm-line, #e5e7eb); border-radius: 12px; }
.fm-today-row2 { display: flex; gap: 8px; align-items: center; }
.fm-today-row2 .fm-input { flex: 1 1 auto; min-width: 0; }
.fm-today-row2 .fm-today-ico { flex: 0 0 64px; text-align: center; font-size: 20px; }
.fm-today .fm-stk-day.is-on i { font-size: 20px; }

/* ---- phone notifications ---- */
.fm-pushbanner { padding: 14px 16px; margin: 0 0 14px; border: 2px solid #c7d2fe; background: #eef2ff; }
.fm-pushbanner h2 { margin: 0 0 4px; font-size: 18px; }
.fm-pushbanner p { margin: 0 0 8px; }
.fm-inst-step { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; }
.fm-inst-step p { margin: 0; flex: 1; }
.fm-inst-n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: #4f46e5; color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.fm-inst-ic { flex: 0 0 34px; font-size: 26px; text-align: center; }
.fm-push-ctl { margin: 4px 0 8px; }
/* ---- mystery boxes and the collection ---- */
.fm-great { text-align: center; background: linear-gradient(180deg, #fff7d6, #fff); border: 2px solid #fcd34d; }
.fm-great h2 { margin: 4px 0; font-size: 26px; }
.fm-great-party { font-size: 44px; }
.fm-boxes { display: flex; justify-content: center; gap: 12px; margin: 14px 0 6px; }
.fm-box { position: relative; width: 86px; height: 86px; border-radius: 22px; border: 0; font-size: 40px; color: #fff; background: linear-gradient(180deg, #c4b5fd, #818cf8); box-shadow: 0 5px 0 #6366f1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-family: inherit; }
.fm-box:active { transform: translateY(3px); box-shadow: 0 2px 0 #6366f1; }
.fm-box.is-closed { opacity: .45; box-shadow: none; cursor: default; }
.fm-box.is-found { background: linear-gradient(180deg, #fde68a, #f59e0b); box-shadow: 0 5px 0 #d97706; }
.fm-found-big { font-size: 72px; line-height: 1.1; margin: 8px 0; }
.fm-found-name { font-size: 19px; font-weight: 800; margin: 8px 0 2px; }
.fm-day-end { margin: 12px 0 0; padding: 10px 12px; border-radius: 14px; background: #eef2ff; font-weight: 700; color: #3730a3; }
.fm-coll-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 10px 0 6px; }
.fm-coll-it { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 14px; background: #f1f5f9; font-size: 26px; opacity: .55; }
.fm-coll-it.is-got { background: #fff; opacity: 1; box-shadow: 0 2px 0 rgba(15,23,42,.1); font-size: 30px; }
.fm-box .fm-burst { left: 50%; top: 50%; }
@media (max-width: 420px) { .fm-box { width: 76px; height: 76px; } }
.fm-great, .fm-coll { padding: 16px; margin: 0 0 14px; }
.fm-coll h2 { margin: 0 0 4px; font-size: 20px; }
.fm-coll .fm-sub { margin: 4px 0 0; }

/* ---- My deal (13+): calm, dark, no cartoons ---- */
.fm-deal { --d-bg: #11152b; --d-card: #1a2040; --d-line: #2a3160; --d-ink: #eef0ff; --d-mut: #a4abd6; --d-acc: #7c6cf5; --d-ok: #22c55e;
	background: var(--d-bg); color: var(--d-ink); border-radius: 20px; padding: 14px 14px 20px; margin: 8px 0 16px; }
.fm-deal .fm-sub, .fm-deal .fm-sub a { color: var(--d-mut); }
.fm-deal-tabs { display: flex; gap: 6px; margin-bottom: 12px; background: var(--d-card); border-radius: 14px; padding: 4px; }
.fm-deal-tab { flex: 1 1 0; border: 0; background: transparent; color: var(--d-mut); font: inherit; font-size: 13px; font-weight: 600; padding: 10px 2px; white-space: nowrap; border-radius: 11px; cursor: pointer; }
.fm-deal-tab.is-on { background: var(--d-acc); color: #fff; }
.fm-deal-h { margin: 6px 2px 12px; font-size: 20px; color: var(--d-ink); font-family: inherit; }
.fm-deal-row { display: flex; align-items: center; gap: 12px; background: var(--d-card); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.fm-deal-ico { font-size: 22px; width: 30px; text-align: center; }
.fm-deal-lbl { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.fm-deal-lbl strong { font-size: 16px; }
.fm-deal-lbl small { color: var(--d-mut); font-size: 12px; }
.fm-deal-switch { flex: 0 0 auto; width: 52px; height: 30px; border-radius: 99px; border: 0; background: #3a4170; position: relative; cursor: pointer; padding: 0; transition: background .15s; }
.fm-deal-switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; }
.fm-deal-switch.is-on { background: var(--d-ok); }
.fm-deal-switch.is-on i { transform: translateX(22px); }
.fm-deal-done { display: block; width: 100%; margin: 12px 0 6px; padding: 15px; border: 0; border-radius: 14px; background: var(--d-acc); color: #fff; font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; }
.fm-deal-done.is-done { background: #2c6a46; }
.fm-deal-link { display: block; margin: 2px auto 12px; background: none; border: 0; color: var(--d-mut); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; padding: 6px; }
.fm-deal-run { background: var(--d-card); border-radius: 14px; padding: 12px 14px; text-align: center; display: grid; gap: 3px; margin-bottom: 10px; }
.fm-deal-run small { color: var(--d-mut); }
.fm-deal-week { display: flex; justify-content: space-between; gap: 6px; margin: 10px 0; }
.fm-deal-day { display: grid; justify-items: center; gap: 4px; flex: 1 1 0; }
.fm-deal-day small { color: var(--d-mut); font-size: 11px; }
.fm-deal-dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--d-card); border: 2px solid var(--d-line); color: var(--d-ink); font-weight: 700; }
.fm-deal-day.is-in .fm-deal-dot { background: #1f5a3a; border-color: var(--d-ok); color: #bbf7d0; }
.fm-deal-day.is-rest .fm-deal-dot { background: #4a3f1c; border-color: #d4a72c; }
.fm-deal-day.is-future .fm-deal-dot { opacity: .45; }
.fm-deal-day.is-today .fm-deal-dot { border-color: var(--d-acc); box-shadow: 0 0 0 2px rgba(124, 108, 245, .35); }
.fm-deal-foot { color: var(--d-mut); font-size: 13px; text-align: center; margin: 10px 4px 4px; }
.fm-deal-note { background: #2a2552; border-radius: 12px; padding: 10px 12px; color: var(--d-ink); font-size: 14px; }
.fm-deal-more { margin-top: 14px; background: var(--d-card); border-radius: 14px; padding: 10px 14px; }
.fm-deal-more summary { cursor: pointer; font-weight: 600; }
.fm-deal-more .fm-sub, .fm-deal-more label, .fm-deal-more .fm-check-line { color: var(--d-ink); }
.fm-deal-more .fm-input { background: #11152b; color: var(--d-ink); border-color: var(--d-line); }
.fm-deal-more .fm-btn { background: #232a55; color: var(--d-ink); border-color: var(--d-line); }
.fm-deal-more .fm-btn.is-good { background: var(--d-acc); color: #fff; border-color: transparent; }
.fm-deal-cap { margin: 14px 2px 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--d-mut); }
.fm-deal-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-deal-chip { background: #3b2f86; border-radius: 99px; padding: 8px 13px; font-size: 14px; }
.fm-deal-chip.is-want { background: #2a3b86; }
.fm-deal-chip.is-ghost { background: transparent; border: 1px dashed var(--d-line); color: var(--d-mut); }
.fm-deal-promise { list-style: none; margin: 0; padding: 12px 14px; background: var(--d-card); border-radius: 14px; display: grid; gap: 6px; font-size: 14px; }
.fm-deal-promise li::before { content: '✓ '; color: var(--d-ok); }
.fm-deal-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.fm-deal-acts .fm-deal-done { margin: 0; flex: 1 1 200px; }
.fm-deal-acts .fm-btn { background: #232a55; color: var(--d-ink); border-color: var(--d-line); }
.fm-deal-signed { color: var(--d-mut); font-size: 14px; }
.fm-deal-level { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: var(--d-card); border: 2px solid transparent; border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.fm-deal-level.is-unlocked { background: #17402c; }
.fm-deal-level.is-next { border-color: var(--d-acc); }
.fm-deal-level.is-later { opacity: .8; }
.fm-deal-num { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #2c3366; font-weight: 700; }
.fm-deal-level.is-unlocked .fm-deal-num { background: var(--d-ok); color: #052e16; }
.fm-deal-level.is-next .fm-deal-num { background: var(--d-acc); }
.fm-deal-bar { flex: 1 1 100%; height: 8px; border-radius: 99px; background: #2c3366; overflow: hidden; }
.fm-deal-bar i { display: block; height: 100%; background: var(--d-acc); }
.fm-deal-claim { border: 0; border-radius: 10px; padding: 9px 14px; background: var(--d-ok); color: #052e16; font: inherit; font-weight: 700; cursor: pointer; }
.fm-deal-weeks { max-width: 170px; }
/* the parent's weekly summary */
.fm-dealp { margin-bottom: 12px; }
.fm-dealp .fm-deal-week { margin: 6px 0 10px; }
.fm-dealp .fm-deal-dot { background: var(--fm-soft); border-color: var(--fm-line); color: var(--fm-ink); }
.fm-dealp .fm-deal-day.is-in .fm-deal-dot { background: #bbf7d0; border-color: #4ade80; color: #14532d; }
.fm-dealp .fm-deal-day.is-rest .fm-deal-dot { background: #fef3c7; border-color: #f59e0b; }
.fm-dealp .fm-deal-day small { color: var(--fm-muted); }
.fm-dealp-line { margin: 4px 0 10px; }
.fm-dealp-say { background: #fffbeb; border: 2px solid #fcd34d; border-radius: 14px; padding: 10px 14px; display: grid; gap: 4px; color: #1f2937; margin-bottom: 8px; }
.fm-dealp-say b { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #92400e; }

/* ---- dark mode for the colourful cards (0.51.3): light cards got light text and looked empty ---- */
.fm-stk.has-world .fm-stk-tile.is-done, .fm-stk.has-world .fm-stk-treat { color: #1f2937; }
.fm-stk.has-world .fm-stk-tile.is-done .fm-stk-tx small { color: #475569; }
@media (prefers-color-scheme: dark) {
  .fm-pushbanner { background: rgba(129, 140, 248, .16); border-color: #4f46e5; }
  .fm-cheer-btn { background: #1e2a4a; border-color: #3b4a80; }
  .fm-cheer-got { background: linear-gradient(135deg, #3a2410, #2e1d0e); border-color: #b45309; }
  .fm-cheer-tx p { color: #fdba74; }
  .fm-stk-wait { background: #3a2e0c; border-color: #a16207; color: #fde68a; }
  .fm-stk-ic { background: #3a2e0c; }
  .fm-stk-treat { background: linear-gradient(90deg, #2a2250, #3b1f3f); }
  .fm-stk-treat.is-reached { background: linear-gradient(90deg, #14351f, #2f3012); }
  .fm-stk-treat small { color: #d8b4fe; }
  .fm-stk-sub { color: #fbbf24; }
  .fm-stk-tile.is-done { background: #33280a; border-color: #a16207; }
  .fm-stk-tile.is-done .fm-stk-st { color: #3b2a06; }
  .fm-stk-tile.is-wait { background: #1a2244; border-color: #4f5fb0; }
  .fm-stk-tile.is-wait .fm-stk-st { border-color: #4f5fb0; }
  .fm-stk-day i { background: #1e293b; color: #fbbf24; }
  .fm-stk-day.is-on i { background: #fde68a; color: #92600a; }
  .fm-great { background: linear-gradient(180deg, #3a2e0c, var(--fm-card)); border-color: #a16207; }
  .fm-day-end { background: rgba(129, 140, 248, .16); color: #c7d2fe; }
  .fm-coll-it { background: #1e293b; }
  .fm-coll-it.is-got { background: #2a3552; box-shadow: none; }
  .fm-adv-chip { background: #1e293b; }
  .fm-adv-chip i { color: #4ade80; }
  .fm-stk.has-world .fm-stk-tile { background: var(--fm-card); }
  .fm-stk.has-world .fm-stk-tile.is-done { background: var(--w-soft); }
  .fm-stk.has-world .fm-stk-sub { color: var(--w-soft); }
  .fm-stk.has-world .fm-stk-treat small { color: #475569; }
}

/* headings: never let the site's theme colour or font them (dark text on dark cards in dark mode) */
.fm-app h1, .fm-app h2, .fm-app h3, .fm-app h4, .fm-app h5,
.fm-sheet h1, .fm-sheet h2, .fm-sheet h3, .fm-sheet h4, .fm-sheet h5 { color: inherit; font-family: inherit; }

/* ---- kids pick their own world (0.52.0) ---- */
.fm-kidworld-btn { margin-left: auto; border: 0; border-radius: 99px; padding: 5px 12px; background: rgba(255,255,255,.22); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 0; text-transform: none; cursor: pointer; }
.fm-kidworld-btn:active { transform: translateY(1px); }
.fm-kidworld-chip { border: 2px dashed var(--fm-brand); border-radius: 99px; padding: 8px 16px; background: transparent; color: var(--fm-brand); font-weight: 800; font-size: 14px; cursor: pointer; }
.fm-kidworld-row { margin: 0 0 10px; }
.fm-kidworld-none { padding: 12px; margin-bottom: 12px; }
.fm-wgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 6px; }
.fm-wtile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 10px 4px; border-radius: 16px; border: 3px solid transparent; font: inherit; font-size: 12px; text-align: center; cursor: pointer; }
.fm-wtile span { font-size: 30px; line-height: 1.1; }
.fm-wtile.is-on { border-color: #facc15; box-shadow: 0 0 0 2px #fff inset; }
.fm-wtile:disabled { opacity: .55; cursor: default; }
.fm-sheet .fm-pill { color: var(--fm-ink); font-family: inherit; font-size: 15px; cursor: pointer; }
.fm-world-free { display: flex; align-items: center; gap: 10px; margin: 12px 0 2px; font-weight: 700; cursor: pointer; }
.fm-world-free input { width: 20px; height: 20px; flex: 0 0 auto; }
