/* SpendTalk app styles. Tokens come from the approved mockups. */

/* Inter is bundled (SIL Open Font License, see assets/fonts/LICENSE-Inter.txt), so body text needs no third-party request. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-400.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/inter-500.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-600.woff') format('woff'); }

:root {
	--st-bg: #F2F4F3;
	--st-surface: #FFFFFF;
	--st-surface-2: #F7F9F8;
	--st-border: #DDE3E0;
	--st-border-2: #CBD4D0;
	--st-row: #E8EDEA;
	--st-track: #E4EAE7;
	--st-track-2: #E8EDEA;
	--st-ink: #12201B;
	--st-ink-2: #33423C;
	--st-muted: #55645E;
	--st-placeholder: #6B7872;
	--st-primary: #0E6B57;
	--st-primary-hover: #0A5242;
	--st-primary-tint: #DDF0EA;
	--st-primary-ink: #0B5445;
	--st-bar: #4AA08B;
	--st-amber: #F5B83D;
	--st-amber-ink: #3A2900;
	--st-warn-bg: #FFF3D6;
	--st-warn-border: #F0D9A0;
	--st-warn-ink: #5A3F00;
	--st-warn-mark: #8A6200;
	--st-danger: #9B1C10;
	--st-danger-bg: #FFF7F5;
	--st-danger-border: #E0A9A0;
	--st-danger-line: #C9564A;
	--st-dark: #12201B;
	--st-dark-2: #1C3029;
	--st-dark-line: #2C463D;
	--st-dark-ink: #EAF3EF;
	--st-dark-muted: #9FB8AE;
	--st-user-bubble: #E9F3EF;
	--st-display: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--st-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
	color-scheme: light;
}

html[data-theme='dark'] {
	--st-bg: #0C1512;
	--st-surface: #14221D;
	--st-surface-2: #1A2B25;
	--st-border: #2A3D36;
	--st-border-2: #3A5249;
	--st-row: #22342D;
	--st-track: #263A33;
	--st-track-2: #263A33;
	--st-ink: #EAF3EF;
	--st-ink-2: #CFE3DB;
	--st-muted: #9FB8AE;
	--st-placeholder: #7F988E;
	--st-primary: #3FB896;
	--st-primary-hover: #55C8A7;
	--st-primary-tint: #17382F;
	--st-primary-ink: #8FE0C8;
	--st-bar: #3A9C83;
	--st-warn-bg: #3A2E0F;
	--st-warn-border: #5A4616;
	--st-warn-ink: #F6D98A;
	--st-warn-mark: #F5B83D;
	--st-danger: #FF8F82;
	--st-danger-bg: #301B18;
	--st-danger-border: #6B3029;
	--st-danger-line: #FF8F82;
	--st-dark: #0A110E;
	--st-user-bubble: #E9F3EF;
	color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
	html[data-theme='system'] {
		--st-bg: #0C1512;
		--st-surface: #14221D;
		--st-surface-2: #1A2B25;
		--st-border: #2A3D36;
		--st-border-2: #3A5249;
		--st-row: #22342D;
		--st-track: #263A33;
		--st-track-2: #263A33;
		--st-ink: #EAF3EF;
		--st-ink-2: #CFE3DB;
		--st-muted: #9FB8AE;
		--st-placeholder: #7F988E;
		--st-primary: #3FB896;
		--st-primary-hover: #55C8A7;
		--st-primary-tint: #17382F;
		--st-primary-ink: #8FE0C8;
		--st-bar: #3A9C83;
		--st-warn-bg: #3A2E0F;
		--st-warn-border: #5A4616;
		--st-warn-ink: #F6D98A;
		--st-warn-mark: #F5B83D;
		--st-danger: #FF8F82;
		--st-danger-bg: #301B18;
		--st-danger-border: #6B3029;
		--st-danger-line: #FF8F82;
		--st-dark: #0A110E;
		color-scheme: dark;
	}
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.st-body {
	margin: 0;
	background: var(--st-bg);
	color: var(--st-ink);
	font-family: var(--st-body);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.st-body a { color: var(--st-primary); }
.st-body a:hover { color: var(--st-primary-hover); }
.st-body button, .st-body input, .st-body select, .st-body textarea { font: inherit; color: inherit; }
.st-body ::placeholder { color: var(--st-placeholder); opacity: 1; }

:focus-visible { outline: 3px solid var(--st-primary); outline-offset: 2px; }

.st-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.st-skip {
	position: absolute; left: 12px; top: -60px;
	background: var(--st-ink); color: var(--st-bg) !important;
	padding: 10px 16px; border-radius: 10px; z-index: 100;
}
.st-skip:focus { top: 12px; }

/* ---------- Shell ---------- */

.st-app { display: flex; flex-wrap: wrap; min-height: 100vh; }

.st-side {
	flex: 1 1 240px; max-width: 260px;
	background: var(--st-surface);
	border-right: 1px solid var(--st-border);
	padding: 28px 20px;
	display: flex; flex-direction: column; gap: 28px;
	position: sticky; top: 0; align-self: flex-start; min-height: 100vh;
}

.st-brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; text-decoration: none; color: var(--st-ink) !important; }
.st-brand__mark {
	width: 40px; height: 40px; border-radius: 12px;
	background: var(--st-primary); color: #fff;
	display: flex; align-items: center; justify-content: center;
}
.st-brand__name { font-family: var(--st-display); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }

.st-nav { display: flex; flex-direction: column; gap: 4px; }
.st-nav__link {
	display: flex; align-items: center; gap: 12px;
	min-height: 44px; padding: 0 14px; border-radius: 12px;
	color: var(--st-ink-2) !important; font-size: 15px; font-weight: 500; text-decoration: none;
}
.st-nav__link:hover { background: var(--st-surface-2); }
.st-nav__link[aria-current='page'] { background: var(--st-primary-tint); color: var(--st-primary-ink) !important; font-weight: 600; }

.st-user {
	margin-top: auto; display: flex; align-items: center; gap: 12px;
	padding: 12px; border: 1px solid var(--st-border); border-radius: 14px;
}
.st-avatar {
	flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
	background: var(--st-ink); color: var(--st-bg);
	display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.st-avatar--lg { width: 56px; height: 56px; font-size: 22px; }
.st-user__text { display: flex; flex-direction: column; min-width: 0; }
.st-user__name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-user__mail { font-size: 12px; color: var(--st-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-user__out { font-size: 12px; font-weight: 600; }

.st-main {
	flex: 999 1 560px; min-width: 0;
	padding: 32px 40px 48px;
	display: flex; flex-direction: column; gap: 24px;
}

.st-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.st-head__eyebrow { margin: 0 0 4px; font-size: 14px; color: var(--st-muted); }
.st-title { margin: 0; font-family: var(--st-display); font-size: 32px; line-height: 1.15; letter-spacing: -0.01em; font-weight: 600; }
.st-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.st-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; font-weight: 600; text-decoration: none; }

/* Mobile bottom navigation */
.st-tabbar {
	display: none;
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
	background: var(--st-surface); border-top: 1px solid var(--st-border);
	padding-bottom: env(safe-area-inset-bottom);
}
.st-tabbar a {
	flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
	color: var(--st-muted) !important; font-size: 12px; font-weight: 500; text-decoration: none;
}
.st-tabbar a[aria-current='page'] { color: var(--st-primary-ink) !important; font-weight: 600; }

.st-topbar { display: none; align-items: center; justify-content: space-between; gap: 12px; }
.st-topbar .st-avatar { text-decoration: none; color: var(--st-bg) !important; }

@media (max-width: 900px) {
	.st-topbar { display: flex; }
	.st-side { display: none; }
	.st-tabbar { display: flex; }
	.st-main { padding: 20px 16px 96px; gap: 20px; }
	.st-title { font-size: 26px; }
}

/* The hidden attribute must always win over component display rules. */
[hidden] { display: none !important; }

/* ---------- Layout helpers ---------- */

.st-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 24px; }
.st-row--start { align-items: flex-start; }
.st-col-3 { flex: 3 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.st-col-2 { flex: 2 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.st-col-1 { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.st-stack { display: flex; flex-direction: column; gap: 16px; }
.st-stack--sm { gap: 8px; }
.st-kpis { display: flex; flex-wrap: wrap; gap: 16px; }
.st-flex { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- Cards ---------- */

.st-card {
	background: var(--st-surface); border: 1px solid var(--st-border);
	border-radius: 20px; padding: 24px;
	display: flex; flex-direction: column; gap: 16px;
}
.st-card--dark { background: var(--st-dark); border-color: var(--st-dark); color: var(--st-dark-ink); }
.st-card__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.st-card__title { margin: 0; font-family: var(--st-display); font-size: 20px; font-weight: 600; }
.st-card__meta { font-size: 13px; color: var(--st-muted); }
.st-card--dark .st-card__meta { color: var(--st-dark-muted); }
.st-card__lead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.st-badge-icon {
	flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
	background: var(--st-primary-tint); color: var(--st-primary-ink);
	display: flex; align-items: center; justify-content: center;
}
.st-badge-icon--amber { background: var(--st-amber); color: var(--st-amber-ink); }

.st-kpi {
	flex: 1 1 220px; background: var(--st-surface); border: 1px solid var(--st-border);
	border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 8px;
}
.st-kpi__label { font-size: 13px; font-weight: 500; color: var(--st-muted); }
.st-kpi__value { font-family: var(--st-display); font-size: 30px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.st-kpi__note { font-size: 13px; color: var(--st-muted); }

.st-banner {
	display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
	background: var(--st-warn-bg); border: 1px solid var(--st-warn-border);
	border-radius: 16px; padding: 14px 20px; color: var(--st-warn-ink);
}
.st-banner p { margin: 0; flex: 1 1 320px; font-size: 15px; line-height: 1.45; }

.st-notice {
	display: flex; align-items: center; gap: 14px; padding: 14px 20px;
	border-radius: 16px; background: var(--st-surface); border: 1px solid var(--st-border);
}
.st-notice p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--st-ink-2); }
.st-alert { border-color: var(--st-danger-border); background: var(--st-danger-bg); }
.st-alert p { color: var(--st-danger); }

.st-pill-badge {
	align-self: flex-start; display: inline-block; font-size: 12px; font-weight: 600;
	padding: 3px 10px; border-radius: 999px; background: var(--st-track); color: var(--st-ink);
}
.st-pill-badge--warn { background: var(--st-warn-bg); color: var(--st-warn-ink); }
.st-pill-badge--ok { background: var(--st-primary-tint); color: var(--st-primary-ink); }
.st-pill-badge--over { background: var(--st-danger-bg); color: var(--st-danger); border: 1px solid var(--st-danger-border); }

/* ---------- Buttons ---------- */

.st-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 12px;
	font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2;
	background: var(--st-surface); color: var(--st-ink) !important; border-color: var(--st-border-2);
}
.st-btn:hover { background: var(--st-surface-2); }
.st-btn[disabled], .st-btn[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; }
.st-btn--primary { background: var(--st-primary); border-color: var(--st-primary); color: #fff !important; font-size: 15px; }
.st-btn--primary:hover { background: var(--st-primary-hover); }
html[data-theme='dark'] .st-btn--primary { color: #06231B !important; }
.st-btn--dark { background: var(--st-dark); border-color: var(--st-dark); color: #fff !important; }
.st-btn--dark:hover { background: var(--st-dark-2); }
.st-btn--amber { background: var(--st-amber); border-color: var(--st-amber); color: var(--st-amber-ink) !important; }
.st-btn--amber:hover { background: #E8AA2C; }
.st-btn--danger { color: var(--st-danger) !important; border-color: var(--st-danger-line); }
.st-btn--link { border: 0; background: transparent; padding: 0 10px; color: var(--st-primary-ink) !important; }
.st-btn--block { width: 100%; }
.st-btn--ondark { background: transparent; border-color: #3C5A50; color: #CFE3DB !important; }
.st-btn--ondark:hover { background: var(--st-dark-2); }

.st-icon-btn {
	flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
	border: 1px solid var(--st-border-2); background: var(--st-surface); color: var(--st-ink);
	display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.st-icon-btn:hover { background: var(--st-surface-2); }
.st-icon-btn[aria-pressed='true'] { background: var(--st-primary); border-color: var(--st-primary); color: #fff; }

.st-suggest {
	min-height: 44px; padding: 0 14px; border: 1px solid var(--st-border-2); border-radius: 999px;
	background: var(--st-surface-2); color: var(--st-ink); font-size: 13px; cursor: pointer;
}
.st-suggest:hover { background: var(--st-track); }
.st-card--dark .st-suggest { background: transparent; border-color: #3C5A50; color: #CFE3DB; }
.st-card--dark .st-suggest:hover { background: var(--st-dark-2); }

/* ---------- Forms ---------- */

.st-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.st-field--grow { flex: 1 1 180px; }
.st-label { font-size: 13px; font-weight: 500; color: var(--st-ink-2); }
.st-hint { margin: 0; font-size: 12px; line-height: 1.5; color: var(--st-muted); }
.st-input, .st-select, .st-textarea {
	width: 100%; height: 44px; padding: 0 14px;
	border: 1px solid var(--st-border-2); border-radius: 12px;
	background: var(--st-surface); color: var(--st-ink); font-size: 15px;
}
.st-textarea { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; }
.st-select { appearance: auto; }
.st-form { display: flex; flex-direction: column; gap: 16px; }
.st-form-row { display: flex; flex-wrap: wrap; gap: 16px; }
.st-error { margin: 0; font-size: 13px; color: var(--st-danger); }

.st-prefix { position: relative; }
.st-prefix > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--st-muted); pointer-events: none; }
.st-prefix > input { padding-left: 34px; }

.st-seg { display: flex; gap: 2px; padding: 3px; background: var(--st-bg); border-radius: 12px; }
.st-seg label { flex: 1; position: relative; }
.st-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.st-seg span {
	display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 9px;
	border: 1px solid transparent; font-size: 13px; font-weight: 500; color: var(--st-ink-2); text-align: center; padding: 0 8px;
}
.st-seg input:checked + span { background: var(--st-surface); border-color: var(--st-border); color: var(--st-ink); font-weight: 600; }
.st-seg input:focus-visible + span { outline: 3px solid var(--st-primary); outline-offset: 2px; }

.st-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.st-choice { position: relative; }
.st-choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.st-choice span {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
	border: 1px solid var(--st-border-2); background: var(--st-surface); font-size: 14px; cursor: pointer;
}
.st-choice input:checked + span { background: var(--st-primary-tint); border-color: var(--st-primary); color: var(--st-primary-ink); font-weight: 600; }
.st-choice input:focus-visible + span { outline: 3px solid var(--st-primary); outline-offset: 2px; }

.st-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; cursor: pointer; }
.st-check input { width: 18px; height: 18px; accent-color: var(--st-primary); }
.st-check-cell { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0 auto; }
.st-check-cell input { width: 18px; height: 18px; accent-color: var(--st-primary); }

.st-switch { flex: 0 0 auto; width: 52px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; }
.st-switch__track { display: flex; align-items: center; justify-content: flex-start; width: 48px; height: 28px; padding: 3px; border-radius: 14px; background: var(--st-border-2); transition: background 0.15s; }
.st-switch__knob { width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.st-switch[aria-checked='true'] .st-switch__track { background: var(--st-primary); }
.st-switch[aria-checked='true'] .st-switch__knob { transform: translateX(20px); }

.st-setting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--st-row); }
.st-setting__text { display: flex; flex-direction: column; max-width: 420px; }
.st-setting__name { font-size: 14px; font-weight: 600; }
.st-setting__desc { font-size: 13px; color: var(--st-muted); }

/* ---------- Tabs ---------- */

.st-tabs { display: flex; gap: 4px; padding: 4px; background: var(--st-track); border-radius: 12px; align-self: flex-start; max-width: 100%; overflow-x: auto; }
.st-tabs a {
	display: flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 9px; white-space: nowrap;
	color: var(--st-ink-2) !important; font-size: 14px; font-weight: 500; text-decoration: none;
}
.st-tabs a[aria-current='page'] { background: var(--st-surface); color: var(--st-ink) !important; font-weight: 600; }

/* ---------- Bars and charts ---------- */

.st-meter { height: 8px; border-radius: 4px; background: var(--st-track); position: relative; }
.st-meter--lg { height: 10px; border-radius: 5px; background: var(--st-track-2); }
.st-meter__fill { height: 100%; border-radius: inherit; background: var(--st-primary); }
.st-meter__mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--st-ink); border-radius: 1px; }

.st-catbar { display: flex; align-items: center; gap: 12px; }
.st-catbar__name { display: flex; align-items: center; gap: 8px; flex: 0 0 150px; min-width: 0; font-size: 14px; font-weight: 500; }
.st-catbar__name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-swatch { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--st-primary)); }
.st-catbar__track { flex: 1; }
.st-catbar__value { flex: 0 0 84px; text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
	.st-catbar { flex-wrap: wrap; row-gap: 6px; }
	.st-catbar__name { flex: 1 1 0; }
	.st-catbar__value { flex: 0 0 auto; }
	.st-catbar__track { flex: 1 0 100%; order: 3; }
	.st-kpis { gap: 12px; }
	.st-kpi { flex: 1 1 calc(50% - 6px); min-width: 0; padding: 16px; }
	.st-kpi__value { font-size: 24px; }
}

.st-daily { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.st-daily__bar { flex: 1; min-width: 2px; border-radius: 4px 4px 0 0; background: var(--st-bar); }
.st-daily__bar.is-today { background: var(--st-primary); }
.st-daily__avg { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--st-ink); opacity: 0.55; }
.st-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--st-muted); }

.st-chip {
	display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
	background: var(--chip-bg, var(--st-track)); color: var(--chip-fg, var(--st-ink)); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.st-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--st-muted)); }
html[data-theme='dark'] .st-chip { background: color-mix(in srgb, var(--c, #6B7872) 24%, transparent); color: color-mix(in srgb, var(--c, #6B7872) 40%, #fff); }
@media (prefers-color-scheme: dark) {
	html[data-theme='system'] .st-chip { background: color-mix(in srgb, var(--c, #6B7872) 24%, transparent); color: color-mix(in srgb, var(--c, #6B7872) 40%, #fff); }
}

/* ---------- Tables ---------- */

.st-table-wrap { overflow-x: auto; }
.st-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 14px; }
.st-table th {
	padding: 10px 12px; text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
	color: var(--st-muted); border-bottom: 1px solid var(--st-border); white-space: nowrap;
}
.st-table td { padding: 14px 12px; border-bottom: 1px solid var(--st-row); vertical-align: middle; }
.st-table .is-num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-table .is-muted { color: var(--st-muted); }
.st-table tr.is-selected td { background: var(--st-primary-tint); }
.st-table tbody tr:hover td { background: var(--st-surface-2); }
.st-table .st-rowlink { color: var(--st-ink) !important; font-weight: 500; text-decoration: none; display: inline-block; padding: 8px 0; }
.st-table .st-rowlink:hover { text-decoration: underline; }
.st-income { color: var(--st-primary-ink); }

.st-empty { text-align: center; padding: 36px 12px; color: var(--st-muted); }
.st-empty strong { display: block; color: var(--st-ink); font-size: 16px; margin-bottom: 4px; }

.st-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--st-muted); }
.st-pager__links { display: flex; gap: 8px; }

/* ---------- Chat and review ---------- */

.st-chat { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 120px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.st-msg { padding: 12px 16px; font-size: 14px; line-height: 1.55; max-width: 92%; overflow-wrap: anywhere; white-space: pre-wrap; }
.st-msg--user { align-self: flex-end; max-width: 85%; border-radius: 16px 16px 4px 16px; background: var(--st-user-bubble); color: #12201B; line-height: 1.5; }
.st-msg--bot { align-self: flex-start; border-radius: 16px 16px 16px 4px; background: var(--st-dark-2); border: 1px solid var(--st-dark-line); color: var(--st-dark-ink); }
.st-card:not(.st-card--dark) .st-msg--bot { background: var(--st-surface-2); border-color: var(--st-border); color: var(--st-ink); }
.st-msg--error { border-color: var(--st-danger-line); }
.st-msg--wait { opacity: 0.8; font-style: italic; }

.st-ask {
	position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px;
	border: 1px solid var(--st-dark-line); border-radius: 14px; background: var(--st-dark-2);
}
.st-ask input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; color: var(--st-dark-ink); font-size: 14px; }
.st-ask input::placeholder { color: var(--st-dark-muted); }
.st-ask:focus-within { outline: 3px solid var(--st-amber); outline-offset: 2px; }

.st-quick {
	position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
	border: 2px solid var(--st-primary); border-radius: 16px; padding: 8px 8px 8px 20px; background: var(--st-surface);
}
.st-quick input { flex: 1 1 260px; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; font-size: 16px; }
.st-quick:focus-within { outline: 3px solid var(--st-primary); outline-offset: 2px; }

.st-review { display: flex; flex-direction: column; gap: 14px; }
.st-review__empty { color: var(--st-muted); font-size: 14px; padding: 28px 8px; text-align: center; }
.st-draft { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid var(--st-border); border-radius: 16px; background: var(--st-surface-2); }
.st-draft__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-conf { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--st-primary-tint); color: var(--st-primary-ink); }
.st-conf--low { background: var(--st-warn-bg); color: var(--st-warn-ink); }
.st-assume { margin: 0; padding-left: 18px; font-size: 13px; color: var(--st-ink-2); }
.st-dup { padding: 12px 14px; border-radius: 12px; background: var(--st-warn-bg); border: 1px solid var(--st-warn-border); color: var(--st-warn-ink); font-size: 13px; }

.st-modes { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Drawer ---------- */

.st-scrim { position: fixed; inset: 0; background: rgba(10, 20, 16, 0.45); z-index: 50; }
.st-drawer {
	position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 60;
	background: var(--st-surface); border-left: 1px solid var(--st-border);
	padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px;
}
.st-kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0; font-size: 14px; }
.st-kv dt { color: var(--st-muted); }
.st-kv dd { margin: 0; font-weight: 500; }
.st-history { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.st-history li { display: flex; flex-direction: column; }
.st-history time { font-size: 12px; color: var(--st-muted); }

.st-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--st-primary-tint); color: var(--st-primary-ink); font-weight: 600; font-size: 14px; }
.st-filterbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.st-filterbar .st-field { flex: 0 1 180px; }

.st-toast {
	position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 80;
	max-width: min(520px, calc(100% - 32px)); padding: 12px 18px; border-radius: 14px;
	background: var(--st-ink); color: var(--st-bg); font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}
.st-toast--error { background: var(--st-danger); color: #fff; }
@media (max-width: 900px) { .st-toast { bottom: 80px; } }

/* ---------- Auth ---------- */

.st-auth { display: flex; flex-wrap: wrap; min-height: 100vh; }
.st-auth__hero {
	flex: 1 1 420px; background: var(--st-dark); color: var(--st-dark-ink);
	padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
}
.st-auth__hero .st-brand { color: #fff !important; }
.st-auth__hero h1 { margin: 0; font-family: var(--st-display); font-size: 40px; line-height: 1.12; letter-spacing: -0.02em; font-weight: 600; max-width: 14ch; }
.st-auth__hero p { margin: 0; font-size: 16px; line-height: 1.55; color: #CFE3DB; max-width: 40ch; }
.st-auth__promise { font-size: 14px; color: var(--st-dark-muted); }
.st-auth__panel { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: var(--st-bg); }
.st-auth__box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; }
.st-auth__box h2 { margin: 0; font-family: var(--st-display); font-size: 28px; font-weight: 600; }
.st-auth__sub { margin: 4px 0 0; color: var(--st-muted); }
.st-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 700px) { .st-auth__hero { padding: 28px 20px; } .st-auth__hero h1 { font-size: 30px; } }

/* ---------- Misc ---------- */

.st-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.st-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0; border-top: 1px solid var(--st-row); }
.st-list > li:first-child { border-top: 0; }
.st-stat-line { display: flex; flex-direction: column; }
.st-stat-line small { color: var(--st-muted); font-size: 13px; }

.st-range { position: relative; padding: 30px 0 34px; }
.st-range__bar { position: relative; height: 16px; border-radius: 8px; background: var(--st-track); }
.st-range__band { position: absolute; top: 0; height: 16px; border-radius: 8px; background: var(--st-amber); border: 1.5px solid var(--st-warn-mark); }
.st-range__likely { position: absolute; top: -6px; width: 3px; height: 28px; background: var(--st-ink); border-radius: 2px; }
.st-range__budget { position: absolute; top: -6px; height: 28px; border-left: 2px dashed var(--st-ink); }
.st-range__label { position: absolute; font-size: 12px; white-space: nowrap; }

.st-print-only { display: none; }
@media print {
	.st-side, .st-tabbar, .st-head__actions, .st-tabs, .st-btn, .st-toast, .st-no-print { display: none !important; }
	.st-main { padding: 0; }
	.st-app { display: block; }
	.st-card { break-inside: avoid; border-color: #999; }
	.st-print-only { display: block; }
	body.st-body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Month switcher, extras ---------- */
.st-month { display: inline-flex; align-items: center; gap: 8px; }
.st-month__label { min-width: 120px; text-align: center; font-size: 14px; font-weight: 600; }
.st-meter__fill--over { background: var(--st-danger-line); }
.st-meter__fill--warn { background: var(--st-amber); }
.st-icon-btn { text-decoration: none; color: var(--st-ink) !important; }

.st-prefix--end { position: relative; }
.st-prefix--end > input { padding-right: 76px; }
.st-prefix--end .st-reveal { position: absolute; right: 2px; top: 0; min-height: 44px; }
.st-social { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Capture ---------- */
.st-mode {
	display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
	border: 1px solid var(--st-border-2); background: var(--st-surface); color: var(--st-ink); font-size: 14px; font-weight: 500;
}
.st-mode[aria-pressed='true'] { background: var(--st-ink); border-color: var(--st-ink); color: var(--st-bg); font-weight: 600; }
.st-ask--light { background: var(--st-surface); border-color: var(--st-border-2); }
.st-ask--light input { color: var(--st-ink); }
.st-ask--light input::placeholder { color: var(--st-placeholder); }
.st-ask--light:focus-within { outline-color: var(--st-primary); }
.st-icon-btn--flat { border: 0; background: transparent; }
.st-send { width: 44px; padding: 0; }
.st-today { display: none; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-radius: 16px; }
@media (max-width: 900px) { .st-today { display: flex; } }
.st-draft__fields { display: flex; flex-direction: column; gap: 10px; }
.st-draft__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.st-draft__row > span:first-child { color: var(--st-muted); }
.st-draft__row .st-input, .st-draft__row .st-select { max-width: 220px; height: 40px; }
.st-account-chips .st-suggest { border-color: #D9BE7A; background: var(--st-surface); font-size: 14px; }
.st-account-chips .st-suggest[aria-pressed='true'] { background: var(--st-warn-bg); border-color: var(--st-warn-mark); font-weight: 600; }
.st-draft__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.st-draft__actions .st-btn { min-height: 48px; }
.st-draft__actions .st-btn--primary { flex: 1 1 160px; }
.st-remember { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--st-ink-2); }
.st-total { font-family: var(--st-display); font-size: 22px; font-weight: 600; }

.st-filterform { gap: 14px; padding: 20px; }
.st-filterform [hidden], .st-bulk[hidden] { display: none !important; }

.st-drop {
	display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; cursor: pointer;
	padding: 24px 16px; border: 2px dashed var(--st-border-2); border-radius: 16px; color: var(--st-ink-2); font-size: 14px;
}
.st-drop:hover, .st-drop:focus-within { border-color: var(--st-primary); background: var(--st-surface-2); }
[data-st-for][hidden] { display: none !important; }

.st-account.is-on { border-color: var(--st-primary); box-shadow: 0 0 0 1px var(--st-primary); }

@media print {
	body.st-printing-report .st-main > *:not(.st-report-card) { display: none !important; }
	body.st-printing-report .st-report-card .st-flex, body.st-printing-report .st-report-card form { display: none !important; }
}
.st-report-text { margin: 0; font-size: 15px; line-height: 1.6; }
.st-form-row > .st-field--grow { min-width: 140px; }
