/*
 * Income & Expense app - core stylesheet (mobile first).
 *
 * Everything is scoped under #jie-root (the app) and #jie-layer (sheets, dock
 * and toasts, moved to <body>). ID-based selectors keep theme and page-builder
 * CSS from leaking in; the reset below uses :where() so our own component
 * rules always win over it.
 *
 * All colours live in the custom properties on :root below, so the whole app
 * can be re-themed from one place. Dark is the default when the device asks
 * for it; both schemes can be forced with data-jie-theme="dark" / "light" on
 * <html>. Screen-specific rules live in screens.css.
 */

:root {
	/* Light scheme (used when the device does not ask for dark). */
	--jie-bg: #f6f7fb;
	--jie-bg-2: #eef1f8;
	--jie-surface: #ffffff;
	--jie-surface-2: #f8fafc;
	--jie-glass: #ffffff;
	--jie-glass-border: #e9edf5;
	--jie-soft: #f1f5f9;
	--jie-border: #e2e8f0;
	--jie-border-2: #cbd5e1;

	--jie-text: #0f172a;
	--jie-text-2: #334155;
	--jie-muted: #64748b;
	--jie-faint: #94a3b8;

	--jie-accent: #6d28d9;
	--jie-accent-2: #2563eb;
	--jie-accent-700: #5b21b6;
	--jie-accent-50: #f1ecfe;
	--jie-accent-ink: #ffffff;
	--jie-ring: rgba(109, 40, 217, .25);

	--jie-income: #059669;
	--jie-income-2: #10b981;
	--jie-income-700: #047857;
	--jie-income-50: #ecfdf5;
	--jie-income-100: #d1fae5;
	--jie-income-btn: #059669;
	--jie-income-btn-2: #0d9488;
	--jie-income-ink: #ffffff;

	--jie-expense: #e11d48;
	--jie-expense-2: #f43f5e;
	--jie-expense-700: #be123c;
	--jie-expense-50: #fff1f3;
	--jie-expense-100: #ffe4e8;
	--jie-expense-btn: #e11d48;
	--jie-expense-btn-2: #be123c;
	--jie-expense-ink: #ffffff;

	--jie-toast-bg: #0f172a;
	--jie-toast-text: #f8fafc;
	--jie-dock-bg: rgba(255, 255, 255, .92);

	--jie-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .07);
	--jie-shadow-lg: 0 18px 50px rgba(15, 23, 42, .14);
	--jie-radius: 18px;
	--jie-radius-sm: 12px;
	--jie-radius-lg: 24px;
	--jie-ease: cubic-bezier(.2, .8, .2, 1);
	--jie-font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Bengali", "Helvetica Neue", Arial, sans-serif;
}

/* Dark scheme: the showcase look. */
@media (prefers-color-scheme: dark) {
	:root:not([data-jie-theme="light"]) {
		--jie-bg: #0b1020;
		--jie-bg-2: #151b35;
		--jie-surface: #141a30;
		--jie-surface-2: #1b2240;
		--jie-glass: rgba(17, 23, 43, .62);
		--jie-glass-border: rgba(255, 255, 255, .09);
		--jie-soft: rgba(255, 255, 255, .07);
		--jie-border: rgba(255, 255, 255, .1);
		--jie-border-2: rgba(255, 255, 255, .18);

		--jie-text: #f8fafc;
		--jie-text-2: #dbe3f0;
		--jie-muted: #94a3b8;
		--jie-faint: #7f8da4;

		--jie-accent: #8b5cf6;
		--jie-accent-2: #3b82f6;
		--jie-accent-700: #c4b5fd;
		--jie-accent-50: rgba(124, 58, 237, .18);
		--jie-accent-ink: #ffffff;
		--jie-ring: rgba(139, 92, 246, .45);

		--jie-income: #34d399;
		--jie-income-2: #10b981;
		--jie-income-700: #6ee7b7;
		--jie-income-50: rgba(16, 185, 129, .14);
		--jie-income-100: rgba(16, 185, 129, .22);
		--jie-income-btn: #10b981;
		--jie-income-btn-2: #34d399;
		--jie-income-ink: #04281d;

		--jie-expense: #fb7185;
		--jie-expense-2: #f43f5e;
		--jie-expense-700: #fda4af;
		--jie-expense-50: rgba(244, 63, 94, .14);
		--jie-expense-100: rgba(244, 63, 94, .22);
		--jie-expense-btn: #f43f5e;
		--jie-expense-btn-2: #fb7185;
		--jie-expense-ink: #2e0510;

		--jie-toast-bg: #f8fafc;
		--jie-toast-text: #0b1020;
		--jie-dock-bg: rgba(11, 16, 32, .9);

		--jie-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
		--jie-shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
	}
}

/* Forced dark, whatever the device says. */
:root[data-jie-theme="dark"] {
	--jie-bg: #0b1020;
	--jie-bg-2: #151b35;
	--jie-surface: #141a30;
	--jie-surface-2: #1b2240;
	--jie-glass: rgba(17, 23, 43, .62);
	--jie-glass-border: rgba(255, 255, 255, .09);
	--jie-soft: rgba(255, 255, 255, .07);
	--jie-border: rgba(255, 255, 255, .1);
	--jie-border-2: rgba(255, 255, 255, .18);
	--jie-text: #f8fafc;
	--jie-text-2: #dbe3f0;
	--jie-muted: #94a3b8;
	--jie-faint: #7f8da4;
	--jie-accent: #8b5cf6;
	--jie-accent-2: #3b82f6;
	--jie-accent-700: #c4b5fd;
	--jie-accent-50: rgba(124, 58, 237, .18);
	--jie-ring: rgba(139, 92, 246, .45);
	--jie-income: #34d399;
	--jie-income-2: #10b981;
	--jie-income-700: #6ee7b7;
	--jie-income-50: rgba(16, 185, 129, .14);
	--jie-income-100: rgba(16, 185, 129, .22);
	--jie-income-btn: #10b981;
	--jie-income-btn-2: #34d399;
	--jie-income-ink: #04281d;
	--jie-expense: #fb7185;
	--jie-expense-2: #f43f5e;
	--jie-expense-700: #fda4af;
	--jie-expense-50: rgba(244, 63, 94, .14);
	--jie-expense-100: rgba(244, 63, 94, .22);
	--jie-expense-btn: #f43f5e;
	--jie-expense-btn-2: #fb7185;
	--jie-expense-ink: #2e0510;
	--jie-toast-bg: #f8fafc;
	--jie-toast-text: #0b1020;
	--jie-dock-bg: rgba(11, 16, 32, .9);
	--jie-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
	--jie-shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
}

/* ---------- Hardened reset ---------- */
#jie-root, #jie-layer {
	all: initial;
	display: block;
	box-sizing: border-box;
	font-family: var(--jie-font);
	font-size: 16px;
	line-height: 1.45;
	font-weight: 400;
	color: var(--jie-text);
	text-align: left;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
#jie-root *, #jie-root *::before, #jie-root *::after,
#jie-layer *, #jie-layer *::before, #jie-layer *::after { box-sizing: border-box; }

#jie-root :where(div, section, header, form, fieldset, legend, p, h1, h2, h3, ul, li, label, span, strong, small, button, input, select, a, textarea),
#jie-layer :where(div, section, header, form, fieldset, legend, p, h1, h2, h3, ul, li, label, span, strong, small, button, input, select, a, textarea) {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	font: inherit;
	color: inherit;
	line-height: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	text-indent: 0;
	text-align: inherit;
	float: none;
	width: auto;
	min-width: 0;
	max-width: none;
	height: auto;
	min-height: 0;
	vertical-align: baseline;
	list-style: none;
	transition: none;
}
#jie-root :where(button, input, select), #jie-layer :where(button, input, select) {
	-webkit-appearance: none;
	appearance: none;
	font-family: var(--jie-font);
	-webkit-tap-highlight-color: transparent;
}
#jie-root :where(button), #jie-layer :where(button) { cursor: pointer; }
#jie-root svg, #jie-layer svg { display: inline-block; flex-shrink: 0; vertical-align: middle; max-width: none; width: 20px; height: 20px; }
#jie-root [hidden], #jie-layer [hidden] { display: none !important; }
#jie-root :focus-visible, #jie-layer :focus-visible { outline: 3px solid var(--jie-ring); outline-offset: 2px; }
#jie-root ::placeholder, #jie-layer ::placeholder { color: var(--jie-faint); opacity: 1; }

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

/* ---------- App frame ---------- */
#jie-root {
	width: 100%;
	max-width: 1040px;
	margin: 0 auto;
	padding: 14px calc(14px + env(safe-area-inset-left, 0px)) 18px calc(14px + env(safe-area-inset-right, 0px));
	border-radius: var(--jie-radius-lg);
	/* Own surface, so the dark scheme never depends on the theme's background. */
	background: linear-gradient(180deg, var(--jie-bg) 0%, var(--jie-bg-2) 100%);
	overflow-x: hidden;
	overflow-x: clip;
}
#jie-root .jie-boot { display: flex; align-items: center; justify-content: center; min-height: 260px; }
#jie-root .jie-boot__spin { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--jie-soft); border-top-color: var(--jie-accent); animation: jie-spin .8s linear infinite; }
#jie-root .jie-noscript { margin-left: 12px; color: var(--jie-muted); }

/* ---------- Buttons ---------- */
#jie-root .jie-btn, #jie-layer .jie-btn {
	position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 46px; padding: 0 18px; border: 1.5px solid transparent; border-radius: var(--jie-radius-sm);
	font-size: 15px; font-weight: 650; line-height: 1.2; white-space: nowrap; text-align: center;
	cursor: pointer; user-select: none; overflow: hidden; isolation: isolate;
	transition: transform .12s ease, filter .15s ease, background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
#jie-root .jie-btn:active, #jie-layer .jie-btn:active { transform: scale(.98); }
#jie-root .jie-btn:disabled, #jie-layer .jie-btn:disabled { cursor: default; }
#jie-root .jie-btn--lg, #jie-layer .jie-btn--lg { min-height: 52px; font-size: 16px; border-radius: 14px; }
#jie-root .jie-btn--sm, #jie-layer .jie-btn--sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
#jie-root .jie-btn--block, #jie-layer .jie-btn--block {
	display: flex; width: 100%; height: auto;
	/* A long (or translated) label wraps onto a second line instead of being clipped. */
	white-space: normal; text-align: center; padding-top: 8px; padding-bottom: 8px;
}
#jie-root .jie-btn--primary, #jie-layer .jie-btn--primary {
	background: linear-gradient(135deg, var(--jie-accent) 0%, var(--jie-accent-2) 100%);
	color: var(--jie-accent-ink); box-shadow: 0 8px 22px rgba(79, 70, 229, .3);
}
#jie-root .jie-btn--income, #jie-layer .jie-btn--income {
	background: linear-gradient(135deg, var(--jie-income-btn) 0%, var(--jie-income-btn-2) 100%);
	color: var(--jie-income-ink); box-shadow: 0 8px 22px rgba(5, 150, 105, .28);
}
#jie-root .jie-btn--expense, #jie-layer .jie-btn--expense,
#jie-root .jie-btn--danger, #jie-layer .jie-btn--danger {
	background: linear-gradient(135deg, var(--jie-expense-btn) 0%, var(--jie-expense-btn-2) 100%);
	color: var(--jie-expense-ink); box-shadow: 0 8px 22px rgba(225, 29, 72, .26);
}
#jie-root .jie-btn--ghost, #jie-layer .jie-btn--ghost { background: var(--jie-surface); color: var(--jie-text); border-color: var(--jie-border); }
/* WhatsApp green with dark ink: 7.9:1, well past AA. */
#jie-root .jie-btn--wa, #jie-layer .jie-btn--wa { background: #25d366; color: #04281d; box-shadow: 0 8px 22px rgba(37, 211, 102, .3); }
#jie-root .jie-btn--wa svg, #jie-layer .jie-btn--wa svg { fill: currentColor; stroke: none; }
@media (hover: hover) {
	#jie-root .jie-btn--primary:hover, #jie-layer .jie-btn--primary:hover,
	#jie-root .jie-btn--income:hover, #jie-layer .jie-btn--income:hover,
	#jie-root .jie-btn--expense:hover, #jie-layer .jie-btn--expense:hover,
	#jie-root .jie-btn--danger:hover, #jie-layer .jie-btn--danger:hover,
	#jie-root .jie-btn--wa:hover, #jie-layer .jie-btn--wa:hover { filter: brightness(1.06) saturate(1.05); transform: translateY(-1px); }
	#jie-root .jie-btn--ghost:hover, #jie-layer .jie-btn--ghost:hover { background: var(--jie-soft); }
}
#jie-root .jie-btn__label, #jie-layer .jie-btn__label { transition: opacity .15s ease; }
#jie-root .jie-btn__spin, #jie-layer .jie-btn__spin {
	display: none; position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
	border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: jie-spin .7s linear infinite;
}
#jie-root .jie-btn__done, #jie-layer .jie-btn__done {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	opacity: 0; transform: scale(.4); transition: opacity .2s ease, transform .3s var(--jie-ease); pointer-events: none;
}
#jie-root .jie-btn__done svg, #jie-layer .jie-btn__done svg { width: 24px; height: 24px; stroke-width: 3; fill: none; stroke: currentColor; }
#jie-root .jie-btn.is-loading .jie-btn__spin, #jie-layer .jie-btn.is-loading .jie-btn__spin { display: block; }
#jie-root .jie-btn.is-loading > :not(.jie-btn__spin):not(.jie-btn__done):not(.jie-ripple),
#jie-layer .jie-btn.is-loading > :not(.jie-btn__spin):not(.jie-btn__done):not(.jie-ripple),
#jie-root .jie-btn.is-done > :not(.jie-btn__spin):not(.jie-btn__done):not(.jie-ripple),
#jie-layer .jie-btn.is-done > :not(.jie-btn__spin):not(.jie-btn__done):not(.jie-ripple) { opacity: 0; }
#jie-root .jie-btn.is-done .jie-btn__done, #jie-layer .jie-btn.is-done .jie-btn__done { opacity: 1; transform: scale(1); }
/* Checkmark draws itself in on success. */
#jie-root .jie-btn.is-done .jie-btn__done svg path, #jie-layer .jie-btn.is-done .jie-btn__done svg path {
	stroke-dasharray: 26; stroke-dashoffset: 26; animation: jie-draw .4s .06s var(--jie-ease) forwards;
}

/* Press ripple (added by JS, removed on animationend). */
#jie-root .jie-ripple, #jie-layer .jie-ripple {
	position: absolute; z-index: -1; border-radius: 50%; pointer-events: none;
	background: currentColor; opacity: .26; transform: scale(0);
	animation: jie-ripple .55s var(--jie-ease) forwards;
}

#jie-root .jie-icon-btn, #jie-layer .jie-icon-btn {
	display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-width: 44px;
	border-radius: var(--jie-radius-sm); color: var(--jie-muted); transition: background-color .15s ease, color .15s ease;
}
#jie-root .jie-icon-btn svg, #jie-layer .jie-icon-btn svg { fill: none; stroke: currentColor; }
#jie-root .jie-icon-btn--soft { background: var(--jie-soft); color: var(--jie-text-2); }
#jie-root .jie-icon-btn:disabled { opacity: .35; cursor: default; }
@media (hover: hover) {
	#jie-root .jie-icon-btn:not(:disabled):hover, #jie-layer .jie-icon-btn:hover { background: var(--jie-soft); color: var(--jie-text); }
}
#jie-root .jie-linkbtn, #jie-layer .jie-linkbtn,
#jie-root a.jie-linkbtn, #jie-layer a.jie-linkbtn {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
	font-weight: 700; color: var(--jie-accent-700); text-decoration: underline; text-underline-offset: 3px;
	transition: color .15s ease, opacity .15s ease;
}
@media (hover: hover) {
	#jie-root .jie-linkbtn:hover, #jie-layer .jie-linkbtn:hover { color: var(--jie-accent); }
}

/* ---------- Shared inputs ---------- */
#jie-root .jie-pw, #jie-layer .jie-pw { position: relative; }
#jie-root .jie-pw input, #jie-layer .jie-pw input { padding-right: 54px; }
#jie-root .jie-eye, #jie-layer .jie-eye {
	position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; border-radius: 10px; color: var(--jie-muted);
}
#jie-root .jie-eye svg, #jie-layer .jie-eye svg { fill: none; stroke: currentColor; }
#jie-root .jie-eye .jie-ico--eye-off, #jie-layer .jie-eye .jie-ico--eye-off { display: none; }
#jie-root .jie-eye[aria-pressed="true"] .jie-ico--eye, #jie-layer .jie-eye[aria-pressed="true"] .jie-ico--eye { display: none; }
#jie-root .jie-eye[aria-pressed="true"] .jie-ico--eye-off, #jie-layer .jie-eye[aria-pressed="true"] .jie-ico--eye-off { display: inline-block; }

#jie-root .jie-field, #jie-layer .jie-field { display: block; margin: 0 0 16px; min-width: 0; }
#jie-root .jie-label, #jie-layer .jie-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 650; color: var(--jie-text-2); }
#jie-root .jie-label--sm, #jie-layer .jie-label--sm { font-size: 13px; }
#jie-root .jie-opt, #jie-layer .jie-opt { font-weight: 500; color: var(--jie-faint); }
#jie-root .jie-input, #jie-layer .jie-input {
	display: block; width: 100%; height: 52px; padding: 0 14px; font-size: 16px; color: var(--jie-text);
	background: var(--jie-surface); border: 1.5px solid var(--jie-border-2); border-radius: var(--jie-radius-sm);
	transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
#jie-root input[type="datetime-local"].jie-input, #jie-layer input[type="datetime-local"].jie-input { line-height: 49px; }
#jie-root .jie-input:focus, #jie-layer .jie-input:focus { outline: 0; border-color: var(--jie-accent); box-shadow: 0 0 0 4px var(--jie-ring); }
#jie-root .jie-input.is-invalid, #jie-layer .jie-input.is-invalid { border-color: var(--jie-expense); box-shadow: 0 0 0 4px var(--jie-expense-50); }
#jie-root .jie-money, #jie-layer .jie-money { position: relative; }
#jie-root .jie-money__cur, #jie-layer .jie-money__cur { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 700; color: var(--jie-faint); pointer-events: none; }
#jie-root .jie-input--money, #jie-layer .jie-input--money { height: 60px; padding-left: 40px; font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
#jie-root .jie-field__err, #jie-layer .jie-field__err { margin-top: 6px; font-size: 13.5px; font-weight: 600; color: var(--jie-expense); }
#jie-root .jie-form__err, #jie-layer .jie-form__err {
	margin: 0 0 12px; padding: 10px 14px; border-radius: var(--jie-radius-sm);
	background: var(--jie-expense-50); color: var(--jie-expense-700); font-size: 14px; font-weight: 600;
}
#jie-root .jie-hint, #jie-layer .jie-hint { display: flex; align-items: center; gap: 6px; margin: -4px 0 16px; font-size: 13px; color: var(--jie-muted); }
#jie-root .jie-hint svg, #jie-layer .jie-hint svg { width: 16px; height: 16px; fill: none; stroke: currentColor; }
#jie-layer .jie-field .jie-hint { margin: 6px 0 0; }

#jie-root .jie-chips, #jie-layer .jie-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#jie-root .jie-chip, #jie-layer .jie-chip { position: relative; display: inline-flex; cursor: pointer; }
#jie-root .jie-chip input, #jie-layer .jie-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
#jie-root .jie-chip span, #jie-layer .jie-chip span {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
	border: 1.5px solid var(--jie-border-2); background: var(--jie-surface); font-size: 15px; font-weight: 650; color: var(--jie-text-2);
	transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
}
#jie-root .jie-chip input:checked + span, #jie-layer .jie-chip input:checked + span { background: var(--jie-accent-50); border-color: var(--jie-accent); color: var(--jie-accent-700); }
#jie-root .jie-form--income .jie-chip input:checked + span { background: var(--jie-income-50); border-color: var(--jie-income); color: var(--jie-income-700); }
#jie-root .jie-form--expense .jie-chip input:checked + span { background: var(--jie-expense-50); border-color: var(--jie-expense); color: var(--jie-expense-700); }
#jie-root .jie-chip input:focus-visible + span, #jie-layer .jie-chip input:focus-visible + span { box-shadow: 0 0 0 4px var(--jie-ring); }
#jie-root .jie-chip:active span, #jie-layer .jie-chip:active span { transform: scale(.97); }
#jie-root .jie-other, #jie-layer .jie-other { padding-top: 12px; }

#jie-layer .jie-option {
	position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; margin-bottom: 8px;
	border: 1.5px solid var(--jie-border); border-radius: 14px; cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease;
}
#jie-layer .jie-option input { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 2px; border: 2px solid var(--jie-border-2); border-radius: 50%; background: var(--jie-surface); }
#jie-layer .jie-option input:checked { border: 6px solid var(--jie-accent); }
#jie-layer .jie-option:has(input:checked) { border-color: var(--jie-accent); background: var(--jie-accent-50); }
#jie-layer .jie-option__body { display: flex; flex-direction: column; min-width: 0; }
#jie-layer .jie-option__body strong { font-weight: 700; }
#jie-layer .jie-option__body span { font-size: 14px; color: var(--jie-muted); overflow-wrap: anywhere; }

/* ---------- Cards and collapsible panels ---------- */
#jie-root .jie-card {
	background: var(--jie-glass); border: 1px solid var(--jie-glass-border); border-radius: var(--jie-radius);
	box-shadow: var(--jie-shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
#jie-root .jie-collapse, #jie-layer .jie-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .38s var(--jie-ease); }
#jie-root .jie-collapse.is-open, #jie-layer .jie-collapse.is-open { grid-template-rows: 1fr; }
#jie-root .jie-collapse__inner, #jie-layer .jie-collapse__inner { min-height: 0; overflow: hidden; opacity: 0; transition: opacity .25s ease; }
#jie-root .jie-collapse.is-open > .jie-collapse__inner, #jie-layer .jie-collapse.is-open > .jie-collapse__inner { opacity: 1; }
#jie-root .jie-panel > .jie-collapse__inner { padding: 0 2px; }
#jie-root .jie-panel.is-open > .jie-collapse__inner { padding-top: 14px; padding-bottom: 6px; }

#jie-root .jie-form.jie-card { position: relative; overflow: hidden; padding: 20px 18px 18px; }
#jie-root .jie-form.jie-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; }
#jie-root .jie-form--income.jie-card::before { background: linear-gradient(90deg, var(--jie-income), var(--jie-income-2)); }
#jie-root .jie-form--expense.jie-card::before { background: linear-gradient(90deg, var(--jie-expense), var(--jie-expense-2)); }
#jie-root .jie-form__head { display: flex; align-items: center; justify-content: space-between; margin: -4px -6px 10px 0; }
#jie-root .jie-h2, #jie-layer .jie-h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 750; letter-spacing: -.01em; }
#jie-root .jie-dot { width: 10px; height: 10px; border-radius: 50%; }
#jie-root .jie-dot--income { background: var(--jie-income); }
#jie-root .jie-dot--expense { background: var(--jie-expense); }

/* ---------- Dashboard ---------- */
#jie-root .jie-dash.is-entering > * { animation: jie-rise .5s var(--jie-ease) both; }
#jie-root .jie-dash.is-entering > :nth-child(2) { animation-delay: .06s; }
#jie-root .jie-dash.is-entering > :nth-child(3) { animation-delay: .12s; }
#jie-root .jie-dash.is-entering > :nth-child(n+4) { animation-delay: .18s; }

#jie-root .jie-top { margin-bottom: 16px; }
#jie-root .jie-top__brand { display: flex; align-items: center; gap: 8px; color: var(--jie-muted); font-size: 14px; font-weight: 650; min-width: 0; }
#jie-root .jie-top__app { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#jie-root .jie-top__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
#jie-root .jie-hello { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }

#jie-root .jie-logo {
	display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; margin: 0 auto 16px;
	border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--jie-accent), var(--jie-accent-2));
	box-shadow: 0 12px 28px rgba(99, 102, 241, .38);
}
#jie-root .jie-logo svg { width: 30px; height: 30px; fill: none; stroke: currentColor; }
#jie-root .jie-logo--sm { width: 30px; height: 30px; margin: 0; border-radius: 9px; box-shadow: none; }
#jie-root .jie-logo--sm svg { width: 17px; height: 17px; }

#jie-root .jie-menu { position: relative; flex: 0 0 auto; }
#jie-root .jie-avatar {
	display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%;
	background: linear-gradient(135deg, var(--jie-accent), var(--jie-accent-2)); color: #fff; font-weight: 750; font-size: 15px; letter-spacing: .02em;
	box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}
#jie-root .jie-menu__pop {
	position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 250px; max-width: calc(100vw - 32px); padding: 8px;
	background: var(--jie-surface); border: 1px solid var(--jie-border); border-radius: var(--jie-radius); box-shadow: var(--jie-shadow-lg);
	transform-origin: top right; animation: jie-pop .18s var(--jie-ease) both;
}
#jie-root .jie-menu__who { display: flex; flex-direction: column; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--jie-border); min-width: 0; }
#jie-root .jie-menu__who strong { font-weight: 700; overflow-wrap: anywhere; }
#jie-root .jie-menu__who span { font-size: 13px; color: var(--jie-muted); overflow-wrap: anywhere; }
#jie-root .jie-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--jie-text-2); text-align: left; }
#jie-root .jie-menu__item svg { fill: none; stroke: currentColor; }
#jie-root .jie-menu__item:hover, #jie-root .jie-menu__item:focus-visible { background: var(--jie-soft); }
#jie-root .jie-menu__item--danger { color: var(--jie-expense); }

/* Balance card */
#jie-root .jie-summary {
	position: relative; overflow: hidden; padding: 20px; border-radius: var(--jie-radius-lg); color: #fff;
	background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
	box-shadow: 0 20px 44px rgba(79, 70, 229, .32);
	transition: box-shadow .35s ease;
}
#jie-root .jie-summary::before, #jie-root .jie-summary::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .1); pointer-events: none; }
#jie-root .jie-summary::before { width: 220px; height: 220px; right: -70px; top: -90px; }
#jie-root .jie-summary::after { width: 160px; height: 160px; left: -50px; bottom: -80px; }
#jie-root .jie-summary > * { position: relative; z-index: 1; }
#jie-root .jie-summary__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
#jie-root .jie-summary__title { font-size: 14px; font-weight: 650; opacity: .92; }
#jie-root .jie-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .18); }
#jie-root .jie-seg__btn { min-height: 44px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 650; color: #fff; transition: background-color .2s ease, color .2s ease; }
#jie-root .jie-seg__btn.is-active { background: #fff; color: #4338ca; box-shadow: 0 2px 6px rgba(15, 23, 42, .18); }
#jie-root .jie-balance__wrap { position: relative; }
#jie-root .jie-balance {
	margin-top: 14px; font-size: clamp(30px, 9vw, 44px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1;
	font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; overflow-wrap: anywhere;
}
#jie-root .jie-balance.is-negative { color: #fecdd3; }
#jie-root .jie-summary__period { margin-top: 4px; font-size: 13px; opacity: .85; }
#jie-root .jie-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 18px; }
#jie-root .jie-stat { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .14); }
#jie-root .jie-stat__icon { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; }
#jie-root .jie-stat__icon svg { width: 18px; height: 18px; stroke-width: 2.5; fill: none; stroke: currentColor; }
#jie-root .jie-stat--income .jie-stat__icon { background: #a7f3d0; color: #065f46; }
#jie-root .jie-stat--expense .jie-stat__icon { background: #fecdd3; color: #9f1239; }
#jie-root .jie-stat__text { display: flex; flex-direction: column; min-width: 0; }
#jie-root .jie-stat__label { font-size: 12px; opacity: .9; font-weight: 600; }
#jie-root .jie-stat__value { font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Saved-amount feedback: card glow + rising chip. */
#jie-root .jie-summary.is-pulse-income { animation: jie-glow-in .55s ease both; }
#jie-root .jie-summary.is-pulse-expense { animation: jie-glow-out .55s ease both; }
#jie-root .jie-fly { position: absolute; left: 0; right: 0; bottom: 100%; height: 0; pointer-events: none; }
#jie-root .jie-fly__chip {
	position: absolute; left: 0; bottom: 0; padding: 4px 12px; border-radius: 999px;
	font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap;
	background: rgba(255, 255, 255, .96); box-shadow: 0 8px 20px rgba(15, 23, 42, .25);
	animation: jie-fly .95s var(--jie-ease) forwards;
}
#jie-root .jie-fly__chip--income { color: #047857; }
#jie-root .jie-fly__chip--expense { color: #be123c; }
#jie-root .jie-summary.is-loading-first .jie-balance,
#jie-root .jie-summary.is-loading-first .jie-stat__value {
	border-radius: 8px; color: transparent;
	background-image: linear-gradient(90deg, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, .42) 50%, rgba(255, 255, 255, .2) 100%);
	background-size: 200% 100%; animation: jie-shimmer 1.2s linear infinite;
}

/* Add buttons */
#jie-root .jie-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 0; }
#jie-root .jie-actions .jie-btn[aria-expanded="true"] { box-shadow: 0 0 0 4px var(--jie-ring); }

/* ---------- History ---------- */
#jie-root .jie-history { margin-top: 20px; padding: 18px 16px 16px; }
#jie-root .jie-history__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
#jie-root .jie-monthbar { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
#jie-root .jie-select { position: relative; min-width: 0; }
#jie-root .jie-select__el {
	display: block; width: 100%; height: 44px; padding: 0 40px 0 14px; font-size: 16px; font-weight: 650; color: var(--jie-text);
	background: var(--jie-soft); border: 1.5px solid transparent; border-radius: var(--jie-radius-sm); cursor: pointer; text-overflow: ellipsis;
}
#jie-root .jie-select__el:focus { outline: 0; border-color: var(--jie-accent); box-shadow: 0 0 0 4px var(--jie-ring); }
#jie-root .jie-select svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--jie-muted); fill: none; stroke: currentColor; }
#jie-root .jie-filterline { margin-top: 10px; }
#jie-root .jie-pill {
	display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 4px; max-width: 100%; min-height: 44px; padding: 0 14px; border-radius: 999px;
	background: var(--jie-accent-50); color: var(--jie-accent-700); font-size: 14px; font-weight: 600;
}
#jie-root .jie-tabs { display: flex; margin-top: 12px; padding: 4px; border-radius: 14px; background: var(--jie-soft); }
#jie-root .jie-tabs__btn { flex: 1 1 0; min-height: 44px; padding: 0 8px; border-radius: 10px; font-size: 15px; font-weight: 650; color: var(--jie-muted); transition: background-color .2s ease, color .2s ease, box-shadow .2s ease; }
#jie-root .jie-tabs__btn.is-active { background: var(--jie-surface); color: var(--jie-text); box-shadow: 0 1px 3px rgba(15, 23, 42, .14); }
#jie-root .jie-period { margin: 14px 0 10px; font-size: 14px; color: var(--jie-muted); line-height: 1.6; }
#jie-root .jie-period b { font-weight: 700; font-variant-numeric: tabular-nums; }
#jie-root .jie-period .is-income { color: var(--jie-income); }
#jie-root .jie-period .is-expense { color: var(--jie-expense); }
#jie-root .jie-period .is-net { color: var(--jie-text); }
#jie-root .jie-thead { display: none; }

#jie-root .jie-list { display: flex; flex-direction: column; gap: 10px; }
#jie-root .jie-tx {
	--c: var(--jie-income); --c-50: var(--jie-income-50); --c-100: var(--jie-income-100); --c-700: var(--jie-income-700);
	position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto;
	grid-template-areas: "icon main amount" "icon main actions";
	column-gap: 12px; row-gap: 2px; align-items: center; overflow: hidden;
	padding: 12px 10px 12px 14px; border: 1px solid var(--jie-border); border-left: 4px solid var(--c); border-radius: 14px; background: var(--jie-surface);
}
#jie-root .jie-tx--expense { --c: var(--jie-expense); --c-50: var(--jie-expense-50); --c-100: var(--jie-expense-100); --c-700: var(--jie-expense-700); }
#jie-root .jie-tx__icon { grid-area: icon; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--c-100); color: var(--c-700); }
#jie-root .jie-tx__icon svg { stroke-width: 2.5; fill: none; stroke: currentColor; }
#jie-root .jie-tx__main { grid-area: main; min-width: 0; }
#jie-root .jie-tx__reason { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; word-break: break-word; }
#jie-root .jie-tx__reason.is-muted { color: var(--jie-faint); font-style: italic; font-weight: 500; }
#jie-root .jie-tx__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 13px; color: var(--jie-muted); }
#jie-root .jie-tx__method { display: inline-block; max-width: 100%; padding: 1px 8px; border-radius: 6px; background: var(--jie-soft); color: var(--jie-text-2); font-weight: 650; overflow-wrap: anywhere; }
#jie-root .jie-tx__date { white-space: nowrap; }
#jie-root .jie-tx__amount { grid-area: amount; justify-self: end; font-size: 16px; font-weight: 750; color: var(--c-700); white-space: nowrap; font-variant-numeric: tabular-nums; }
#jie-root .jie-tx__actions { grid-area: actions; justify-self: end; display: flex; gap: 2px; margin-right: -4px; }
#jie-root .jie-tx__actions .jie-icon-btn { width: 44px; height: 44px; min-width: 44px; color: var(--jie-faint); }
#jie-root .jie-tx__actions .jie-icon-btn svg { width: 18px; height: 18px; }
#jie-root .jie-tx__actions .jie-icon-btn--del:hover { color: var(--jie-expense); background: var(--jie-expense-50); }
/* A new row slides in and a highlight sweeps across it once. */
#jie-root .jie-tx.is-new { animation: jie-slide-in .45s var(--jie-ease) both; }
#jie-root .jie-tx.is-new::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(100deg, transparent 0%, var(--c-100) 45%, var(--c-50) 60%, transparent 100%);
	background-size: 220% 100%; animation: jie-sweep 1.1s .2s var(--jie-ease) forwards;
}
#jie-root .jie-tx.is-removing { transition: opacity .25s ease, transform .3s var(--jie-ease), height .3s var(--jie-ease) .15s, padding .3s ease .15s, margin .3s ease .15s, border-width .3s ease .15s; opacity: 0; transform: translateX(28px); }

#jie-root .jie-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 12px; text-align: center; color: var(--jie-muted); }
#jie-root .jie-empty__icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--jie-soft); color: var(--jie-faint); }
#jie-root .jie-empty__icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; }
#jie-root .jie-empty__text { max-width: 320px; font-size: 15px; font-weight: 550; }
#jie-root #jie-more { margin-top: 14px; }

#jie-root .jie-skel {
	height: 70px; border-radius: 14px; border: 1px solid var(--jie-border);
	background-image: linear-gradient(90deg, var(--jie-soft) 0%, var(--jie-surface-2) 50%, var(--jie-soft) 100%);
	background-size: 200% 100%; animation: jie-shimmer 1.2s linear infinite;
}

/* ---------- Layer: dock, toasts, sheets ---------- */
#jie-layer { position: static; }
#jie-layer .jie-dock {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 99990;
	display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
	padding: 10px max(16px, env(safe-area-inset-left, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px));
	background: var(--jie-dock-bg); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
	border-top: 1px solid var(--jie-border); box-shadow: 0 -8px 24px rgba(15, 23, 42, .12);
	transition: transform .3s var(--jie-ease);
	animation: jie-dock-in .45s var(--jie-ease) both;
}
#jie-layer .jie-dock.is-tucked { transform: translateY(120%); }
#jie-layer .jie-dock .jie-btn { padding: 0 10px; }

/* Toasts slide up from the bottom, above the safe-area inset and the dock. */
#jie-layer .jie-toasts {
	position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 100010; transform: translateX(-50%);
	display: flex; flex-direction: column-reverse; align-items: center; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none;
}
#jie-layer.has-dock .jie-toasts { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
#jie-layer .jie-toast {
	display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 12px 18px 12px 12px; border-radius: 14px;
	background: var(--jie-toast-bg); color: var(--jie-toast-text); font-size: 15px; font-weight: 600;
	box-shadow: 0 12px 30px rgba(15, 23, 42, .3); pointer-events: auto;
	animation: jie-toast-in .35s var(--jie-ease) both;
}
#jie-layer .jie-toast.is-leaving { animation: jie-toast-out .25s ease forwards; }
#jie-layer .jie-toast__icon { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; background: var(--jie-income-btn); color: var(--jie-income-ink); }
#jie-layer .jie-toast__icon svg { width: 16px; height: 16px; stroke-width: 3; fill: none; stroke: currentColor; }
#jie-layer .jie-toast--success .jie-toast__icon svg { stroke-dasharray: 24; stroke-dashoffset: 24; animation: jie-draw .45s .15s ease forwards; }
#jie-layer .jie-toast--error .jie-toast__icon { background: var(--jie-expense-btn); color: var(--jie-expense-ink); }

#jie-layer .jie-sheet { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: flex-end; justify-content: center; }
#jie-layer .jie-sheet__backdrop { position: absolute; inset: 0; background: rgba(8, 11, 24, .62); opacity: 0; transition: opacity .28s ease; }
#jie-layer .jie-sheet.is-open .jie-sheet__backdrop { opacity: 1; }
#jie-layer .jie-sheet__panel {
	position: relative; width: 100%; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
	padding: 6px 20px calc(20px + env(safe-area-inset-bottom, 0px)); border-radius: var(--jie-radius-lg) var(--jie-radius-lg) 0 0;
	background: var(--jie-surface); color: var(--jie-text); box-shadow: 0 -12px 40px rgba(8, 11, 24, .35);
	transform: translateY(100%); transition: transform .34s var(--jie-ease);
}
#jie-layer .jie-sheet.is-open .jie-sheet__panel { transform: none; }
#jie-layer .jie-sheet__grab { width: 42px; height: 5px; margin: 4px auto 10px; border-radius: 99px; background: var(--jie-border-2); }
#jie-layer .jie-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -8px 14px 0; }
#jie-layer .jie-sheet__text { margin-bottom: 18px; font-size: 16px; color: var(--jie-text-2); overflow-wrap: anywhere; }
#jie-layer .jie-sheet__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
#jie-layer .jie-edit-type { display: inline-flex; margin-bottom: 14px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
#jie-layer .jie-edit-type.is-income { background: var(--jie-income-100); color: var(--jie-income-700); }
#jie-layer .jie-edit-type.is-expense { background: var(--jie-expense-100); color: var(--jie-expense-700); }

/* ---------- Mobile: sticky dock instead of inline buttons ---------- */
@media (max-width: 767.98px) {
	#jie-root.has-dock { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
	#jie-root .jie-actions { display: none; }
	#jie-root .jie-panel.is-open > .jie-collapse__inner { padding-top: 16px; }
}
@media (max-width: 479.98px) {
	#jie-root .jie-summary { padding: 18px 16px; border-radius: 20px; }
	#jie-root .jie-seg__btn { padding: 0 11px; }
	#jie-root .jie-history { padding: 16px 12px 14px; }
	#jie-root .jie-form.jie-card { padding: 18px 14px 14px; }
}
@media (max-width: 359.98px) {
	#jie-root .jie-tx { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main amount" "main actions"; padding-left: 12px; }
	#jie-root .jie-tx__icon { display: none; }
	#jie-root .jie-hello { font-size: 21px; }
	#jie-root .jie-chip span, #jie-layer .jie-chip span { padding: 0 14px; }
	#jie-root .jie-monthbar { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 6px; }
	#jie-root .jie-icon-btn { width: 40px; min-width: 40px; }
	#jie-root .jie-select__el { padding: 0 32px 0 10px; font-size: 15px; }
	#jie-layer .jie-dock .jie-btn { font-size: 15px; gap: 4px; }
}

/* ---------- Tablet / desktop ---------- */
@media (min-width: 768px) {
	#jie-layer .jie-dock { display: none !important; }
	#jie-layer .jie-toasts { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
	#jie-layer.has-dock .jie-toasts { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
	#jie-root .jie-summary { padding: 26px 28px; }
	#jie-root .jie-stats { grid-template-columns: 1fr 1fr; max-width: 560px; }
	#jie-root .jie-history { padding: 22px 22px 18px; }
	#jie-root .jie-panel { max-width: 640px; }
	#jie-root .jie-actions { max-width: 640px; }
	#jie-root .jie-monthbar, #jie-root .jie-tabs { max-width: 520px; }
	#jie-root .jie-filterline { display: inline-block; }

	#jie-layer .jie-sheet { align-items: center; padding: 24px; }
	#jie-layer .jie-sheet__panel {
		max-width: 500px; max-height: calc(100vh - 48px); padding: 22px 24px 24px; border-radius: var(--jie-radius-lg);
		transform: translateY(18px) scale(.97); opacity: 0; transition: transform .26s var(--jie-ease), opacity .22s ease;
		box-shadow: var(--jie-shadow-lg);
	}
	#jie-layer .jie-sheet.is-open .jie-sheet__panel { transform: none; opacity: 1; }
	#jie-layer .jie-sheet__grab { display: none; }
}

/* The table needs room for a readable Reason column; below this the cards stay. */
@media (min-width: 900px) {
	#jie-root .jie-thead,
	#jie-root .jie-tx { grid-template-columns: minmax(0, 170px) 36px minmax(120px, 1fr) minmax(0, 150px) minmax(0, 140px) 100px; column-gap: 12px; }
	#jie-root .jie-thead {
		display: grid; padding: 0 8px 10px; border-bottom: 2px solid var(--jie-border);
		font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--jie-muted);
	}
	#jie-root .jie-thead > :first-child { grid-column: 1; }
	#jie-root .jie-thead > :nth-child(2) { grid-column: 2 / span 2; }
	#jie-root .jie-thead__num { text-align: right; }
	#jie-root .jie-list { gap: 0; }
	#jie-root .jie-tx {
		grid-template-areas: "date icon reason method amount actions"; align-items: center;
		padding: 10px 8px; border: 0; border-bottom: 1px solid var(--jie-border); border-radius: 0; background: transparent;
	}
	#jie-root .jie-tx:hover { background: var(--jie-soft); }
	#jie-root .jie-tx__main, #jie-root .jie-tx__meta { display: contents; }
	#jie-root .jie-tx__icon { width: 32px; height: 32px; }
	#jie-root .jie-tx__icon svg { width: 16px; height: 16px; }
	#jie-root .jie-tx__reason { grid-area: reason; }
	#jie-root .jie-tx__date { grid-area: date; font-size: 14px; color: var(--jie-muted); }
	#jie-root .jie-tx__method { grid-area: method; justify-self: start; font-size: 13px; }
	#jie-root .jie-tx__amount { grid-area: amount; }
	#jie-root .jie-tx__actions { grid-area: actions; margin-right: 0; }
}
@media (min-width: 1024px) {
	#jie-root .jie-hello { font-size: 28px; }
	#jie-root .jie-thead,
	#jie-root .jie-tx { grid-template-columns: minmax(0, 190px) 36px minmax(140px, 1fr) minmax(0, 170px) minmax(0, 150px) 100px; }
}

/* ---------- Animations (transform/opacity only) ---------- */
@keyframes jie-spin { to { transform: rotate(360deg); } }
@keyframes jie-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes jie-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes jie-pop { from { opacity: 0; transform: scale(.94) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes jie-slide-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes jie-sweep { from { opacity: 1; background-position: 200% 0; } to { opacity: 0; background-position: -60% 0; } }
@keyframes jie-toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes jie-toast-out { to { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes jie-draw { to { stroke-dashoffset: 0; } }
@keyframes jie-dock-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes jie-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes jie-ripple { to { transform: scale(1); opacity: 0; } }
@keyframes jie-fly {
	0% { opacity: 0; transform: translateY(6px) scale(.9); }
	22% { opacity: 1; transform: translateY(-6px) scale(1); }
	100% { opacity: 0; transform: translateY(-42px) scale(1); }
}
@keyframes jie-glow-in {
	0% { box-shadow: 0 20px 44px rgba(79, 70, 229, .32); }
	35% { box-shadow: 0 0 0 3px rgba(52, 211, 153, .85), 0 18px 46px rgba(16, 185, 129, .5); }
	100% { box-shadow: 0 20px 44px rgba(79, 70, 229, .32); }
}
@keyframes jie-glow-out {
	0% { box-shadow: 0 20px 44px rgba(79, 70, 229, .32); }
	35% { box-shadow: 0 0 0 3px rgba(251, 113, 133, .85), 0 18px 46px rgba(244, 63, 94, .5); }
	100% { box-shadow: 0 20px 44px rgba(79, 70, 229, .32); }
}

/* ---------- Reduced motion: no animation, no movement ---------- */
@media (prefers-reduced-motion: reduce) {
	#jie-root *, #jie-root *::before, #jie-root *::after,
	#jie-layer *, #jie-layer *::before, #jie-layer *::after {
		animation-duration: .001ms !important;
		animation-delay: 0s !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
		transition-delay: 0s !important;
		scroll-behavior: auto !important;
	}
	#jie-root .jie-btn:active, #jie-layer .jie-btn:active { transform: none; }
	#jie-root .jie-tx.is-new::after { display: none; }
	#jie-root .jie-fly__chip, #jie-root .jie-ripple { display: none !important; }
	#jie-root .jie-summary.is-loading-first .jie-balance,
	#jie-root .jie-summary.is-loading-first .jie-stat__value { background-image: none; color: inherit; }
	#jie-root .jie-skel { background-image: none; background-color: var(--jie-soft); }
	/* The two spinners stay, otherwise nothing would show progress. */
	#jie-root .jie-btn__spin, #jie-layer .jie-btn__spin, #jie-root .jie-boot__spin { animation: jie-spin 1.2s linear infinite !important; }
}
