:root {
	color-scheme: light dark;
	--md-sys-color-primary: rgb(140 79 38);
	--md-sys-color-surface: rgb(255 248 245);
	--md-sys-color-on-surface: rgb(34 26 21);
	--md-sys-color-on-surface-variant: rgb(82 68 60);
	--md-sys-color-outline-variant: rgb(215 194 184);
	--md-sys-color-shadow: rgb(0 0 0);
	--md-sys-color-surface-container-low: rgb(255 241 234);
	--md-sys-color-surface-container: rgb(252 234 226);
	--app-smf: #d45f8a;
	--forest-dim: 1;
}
@media (prefers-color-scheme: dark) {
	:root {
		--md-sys-color-primary: rgb(255 182 139);
		--md-sys-color-surface: rgb(26 18 13);
		--md-sys-color-on-surface: rgb(240 223 215);
		--md-sys-color-on-surface-variant: rgb(215 194 184);
		--md-sys-color-outline-variant: rgb(82 68 60);
		--md-sys-color-shadow: rgb(0 0 0);
		--md-sys-color-surface-container-low: rgb(34 26 21);
		--md-sys-color-surface-container: rgb(39 30 25);
		--forest-dim: 0.82;
	}
}
:root {
	--font-display: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
	--font-body: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
	--bg: var(--md-sys-color-surface);
	--fg: var(--md-sys-color-on-surface);
	--muted: var(--md-sys-color-on-surface-variant);
	--panel: var(--md-sys-color-surface-container-low);
	--panel-hover: var(--md-sys-color-surface-container);
	--line: var(--md-sys-color-outline-variant);
	--accent: var(--md-sys-color-primary);
	--shadow: color-mix(in srgb, var(--md-sys-color-shadow) 14%, transparent);
	--content-max: 600px;
}

* { box-sizing: border-box; }
body {
	margin: 0;
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font-body);
	line-height: 1.8;
}
main { flex: 1 0 auto; align-content: start; }

.site-body { display: grid; gap: 28px; padding: 32px 24px 8px; }
.site-body > .masthead { margin-bottom: 16px; }
a { color: inherit; text-decoration: none; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.en { display: block; font-size: 0.8em; color: var(--muted); }

.masthead { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; }
.avatar { width: clamp(64px, 18vw, 88px); height: auto; }
.site-title {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(2rem, 7vw, 2.6rem);
	line-height: 1.1;
	letter-spacing: -0.01em;
	text-wrap: balance;
}
.site-title span { color: var(--accent); }

.shelf-section { display: grid; gap: 12px; }
.shelf-heading {
	margin: 0;
	display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
	font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.4;
}
.shelf-heading .en { display: inline; font-family: var(--font-body); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.03em; }
.shelf { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.app { background: var(--panel); border-radius: 18px; transition: box-shadow 0.2s; }
.app[open] { box-shadow: 0 6px 18px -10px var(--shadow); }
.app-row {
	display: grid; grid-template-columns: 64px minmax(0, 1fr) 20px; gap: 18px; align-items: center;
	padding: 18px;
	border-radius: 18px;
	cursor: pointer;
	list-style: none;
	transition: background-color 0.2s;
}
.app-row::-webkit-details-marker { display: none; }
.app-row:hover { background: var(--panel-hover); }
.app-icon { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 2px 6px var(--shadow); }
.app-text { display: grid; gap: 6px; min-width: 0; }
.app-name { display: block; margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.4; text-wrap: balance; }
.app-desc { display: block; margin: 0; font-size: 0.85rem; line-height: 1.65; color: var(--muted); }
.go { width: 20px; height: 20px; color: var(--muted); transition: transform 0.2s; }
.app[open] .go { transform: rotate(180deg); }

.app-more { display: grid; gap: 18px; padding: 8px 18px 18px; }

.app-smf { --app-accent: var(--app-smf); --app-tint: color-mix(in srgb, var(--app-accent) 9%, var(--bg)); --app-tint-hover: color-mix(in srgb, var(--app-accent) 15%, var(--bg)); }
.actions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.action {
	display: grid; grid-template-columns: minmax(0, 1fr) 20px; gap: 12px; align-items: center;
	padding: 12px 16px;
	border-radius: 12px;
	background: var(--bg);
	transition: background-color 0.2s;
}
.action:hover { background: var(--panel-hover); }
.action-label { font-weight: 500; line-height: 1.45; }
.action svg { width: 20px; height: 20px; color: var(--muted); }
.action.store { background: var(--app-tint); box-shadow: inset 0 0 0 1.5px var(--app-accent); }
.action.store:hover { background: var(--app-tint-hover); }
.action.store svg { color: var(--app-accent); }

.lost { display: grid; justify-items: center; gap: 18px; padding: 40px 24px 8px; text-align: center; }
.lost-risu { width: clamp(104px, 30vw, 132px); height: auto; }
.lost-code { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.08em; color: var(--accent); }
.lost h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; line-height: 1.4; text-wrap: balance; }
.lost h1 .en { margin-top: 2px; font-size: 0.6em; font-weight: 500; }
.lost-text { margin: 0; max-width: 34ch; font-size: 0.9rem; color: var(--muted); }
.lost-text .en { margin-top: 4px; }
.home {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 12px 22px; border-radius: 14px;
	background: var(--panel);
	font-family: var(--font-display); font-weight: 700;
	transition: background-color 0.2s;
}
.home:hover { background: var(--panel-hover); }
.home svg { width: 18px; height: 18px; }

.back { justify-self: start; display: inline-flex; align-items: center; gap: 2px; font-size: 0.85rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.back svg { width: 14px; height: 14px; }
.policy { background: color-mix(in srgb, var(--app-accent) 5%, var(--bg)); border: 1px solid color-mix(in srgb, var(--app-accent) 28%, var(--bg)); border-radius: 20px; padding: 24px 20px; box-shadow: 0 4px 16px -8px color-mix(in srgb, var(--app-accent) 40%, transparent); }
.policy h1 { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; line-height: 1.4; }
.policy h1 img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 2px 6px color-mix(in srgb, var(--app-accent) 35%, transparent); }
.policy .updated { margin: 0 0 18px; font-size: 0.8rem; color: var(--muted); }
.policy h2 { font-family: var(--font-display); font-size: 1.05rem; margin: 28px 0 8px; padding-bottom: 6px; border-bottom: 2px solid color-mix(in srgb, var(--app-accent) 30%, var(--bg)); }
.policy h3 { font-family: var(--font-display); font-size: 0.95rem; margin: 20px 0 6px; }
.policy h3::before { content: '🌸 '; font-size: 0.9em; }
.policy p, .policy li { font-size: 0.9rem; }
.policy ul { padding-left: 22px; margin: 6px 0; }
.policy li { margin: 6px 0; }
.policy li::marker { content: '・'; color: var(--muted); }
.policy a { color: var(--accent); border-bottom: 1px solid var(--line); }
.policy a:hover { border-bottom-color: var(--muted); }
.policy .lock { border-radius: 14px; padding: 12px 16px; margin: 14px 0; font-weight: 500; font-size: 0.9rem; background: color-mix(in srgb, var(--app-accent) 12%, var(--bg)); }
.policy table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.policy th, .policy td { padding: 6px 10px; text-align: left; font-size: 0.85rem; border: 1px solid color-mix(in srgb, var(--app-accent) 28%, var(--bg)); }
.policy th { background: color-mix(in srgb, var(--app-accent) 9%, var(--bg)); }

.site-foot { margin-top: 24px; display: grid; gap: 4px; }
.foot-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 16px; padding: 0 24px; }
.foot-links { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 0.78rem; color: var(--muted); }
.foot-links a { border-bottom: 1px solid var(--line); }
.foot-links a:hover { border-bottom-color: var(--muted); }
.foot-links svg { width: 12px; height: 12px; margin-left: 2px; vertical-align: -1px; }
.sign { margin: 0 0 0 auto; font-size: 0.75rem; letter-spacing: 0.02em; color: var(--muted); }
.forest {
	width: 100%; aspect-ratio: 3584 / 1184; min-height: 150px; object-fit: cover; object-position: 50% 60%;
	filter: brightness(var(--forest-dim));
	-webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 38%);
	        mask-image: linear-gradient(to bottom, transparent 0%, black 38%);
}

.site-body, .lost, .foot-row { width: 100%; max-width: var(--content-max); margin-inline: auto; }

@media (prefers-reduced-motion: reduce) {
	.app, .app-row, .go, .action, .home { transition: none; }
}

@media (forced-colors: active) {
	.app, .action, .home, .policy .lock { border: 1px solid CanvasText; }
}
