/**
 * Toomi Money theme — base: design tokens, reset, typography.
 *
 * Mobile-first. Only relative units and fluid widths are used so that
 * 320px viewports up to desktop never produce unintended horizontal
 * overflow. No external frameworks.
 *
 * Color system ("tokens"): ink/muted/paper/surface/border neutrals plus
 * one accent per meaning — blue trust, green free, orange reward,
 * purple premium, yellow caution. At most two lead colors per screen.
 */

:root {
	--tm-color-ink: #1c2430;
	--tm-color-text: #2b3648;
	--tm-color-muted: #5f6f84;
	--tm-color-faint: #8b99ad;
	--tm-color-background: #ffffff;
	--tm-color-surface: #f3f6fb;
	--tm-color-surface-warm: #fff8ef;
	--tm-color-border: #dbe4ef;
	--tm-color-border-strong: #b9c7da;

	--tm-color-navy-900: #16264c;
	--tm-color-navy-700: #27407c;
	--tm-color-navy-100: #e3e9f6;

	--tm-color-primary: #1f5fe0;
	--tm-color-primary-dark: #1749ad;
	--tm-color-primary-contrast: #ffffff;
	--tm-color-primary-soft: #e8effe;

	--tm-color-green: #177245;
	--tm-color-green-soft: #e2f3e8;
	--tm-color-orange: #d35400;
	--tm-color-orange-soft: #ffefe0;
	--tm-color-purple: #6a3fd4;
	--tm-color-purple-soft: #efe8fd;
	--tm-color-yellow: #ffd43b;
	--tm-color-yellow-soft: #fff7dd;
	--tm-color-yellow-text: #7a5200;
	--tm-color-red: #c92a2a;
	--tm-color-red-soft: #fce8e6;

	--tm-color-notice: #f0f4f8;
	--tm-color-ended: #fce8e8;
	--tm-color-badge-active: #e6f4ea;
	--tm-color-badge-active-text: #137333;
	--tm-color-badge-ended: #fce8e6;
	--tm-color-badge-ended-text: #a50e0e;
	--tm-color-badge-unknown: #fef7e0;
	--tm-color-badge-unknown-text: #795600;
	--tm-color-focus: #1f5fe0;

	--tm-space-2xs: 0.125rem;
	--tm-space-xs: 0.25rem;
	--tm-space-sm: 0.5rem;
	--tm-space-md: 1rem;
	--tm-space-lg: 1.5rem;
	--tm-space-xl: 2.5rem;
	--tm-space-2xl: 4rem;

	--tm-font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
	--tm-font-size-base: 1rem;
	--tm-font-size-sm: 0.875rem;
	--tm-font-size-xs: 0.8125rem;
	--tm-line-height: 1.8;
	--tm-line-height-tight: 1.5;

	--tm-radius-sm: 6px;
	--tm-radius: 10px;
	--tm-radius-lg: 16px;
	--tm-radius-pill: 999px;

	--tm-shadow-sm: 0 1px 2px rgba(22, 38, 76, 0.08);
	--tm-shadow-md: 0 4px 16px rgba(22, 38, 76, 0.12);
	--tm-shadow-lg: 0 12px 32px rgba(22, 38, 76, 0.16);

	--tm-container-max: 75rem;
	--tm-container-narrow: 44rem;
	--tm-sidebar-width: 20rem;

	--tm-breakpoint-tablet: 48rem;
	--tm-breakpoint-desktop: 64rem;
	--tm-breakpoint-wide: 80rem;

	--tm-motion-fast: 120ms ease-out;
	--tm-motion-base: 200ms ease-out;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--tm-color-background);
	color: var(--tm-color-text);
	font-family: var(--tm-font-family);
	font-size: var(--tm-font-size-base);
	line-height: var(--tm-line-height);
	overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	color: var(--tm-color-ink);
	line-height: var(--tm-line-height-tight);
	margin: 0 0 var(--tm-space-md);
	overflow-wrap: break-word;
}

p,
ul,
ol,
dl,
figure,
blockquote {
	margin: 0 0 var(--tm-space-md);
}

ul,
ol {
	padding-left: 1.5em;
}

img,
video,
iframe {
	max-width: 100%;
}

img {
	height: auto;
}

a {
	color: var(--tm-color-primary);
	overflow-wrap: break-word;
}

a:hover {
	text-decoration-thickness: 2px;
}

/* Visible keyboard focus everywhere. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
	outline: 3px solid var(--tm-color-focus);
	outline-offset: 2px;
	border-radius: 2px;
}

table {
	border-collapse: collapse;
	width: 100%;
	max-width: 100%;
	display: block;
	overflow-x: auto;
}

button,
input,
select,
textarea {
	font: inherit;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal;
}

.skip-link {
	background: var(--tm-color-navy-900);
	color: #fff;
	left: var(--tm-space-md);
	padding: var(--tm-space-sm) var(--tm-space-md);
	position: absolute;
	top: -100px;
	z-index: 200;
}

.skip-link:focus {
	top: var(--tm-space-sm);
	color: #fff;
}

/* Inline SVG icon sizing. */
.tm-icon {
	flex: none;
	height: 1.25em;
	vertical-align: -0.25em;
	width: 1.25em;
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
