:root {
	--bg: #fbf8f5;
	--fg: #2a2230;
	--muted: #6d6474;
	--line: #e3dcd6;
	--accent: #d9437f;
	--accent-fg: #ffffff;
	--card: #ffffff;
	--error: #b3261e;
	color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
	:root { --bg: #17141a; --fg: #f1ecf4; --muted: #a79fae; --line: #342e3a; --card: #211d25; --error: #ff8a80; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; background: var(--bg); color: var(--fg);
	font: 16px/1.6 system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Leelawadee UI", sans-serif;
}
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }
h1 { font-size: 1.35rem; margin: 8px 0; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }
h3 { font-size: 0.95rem; margin: 20px 0 4px; }
.tag { font-size: 0.7rem; vertical-align: middle; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--muted); }
.privacy { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0 16px; font-size: 0.92rem; }
.step, .note { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 0 0 16px; }
.note { border-color: var(--error); }
.muted { color: var(--muted); font-size: 0.88rem; margin: 6px 0; }
.error { color: var(--error); font-size: 0.92rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.big { font-size: 1.1rem; min-width: 6.5em; text-align: center; }
.row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.row.wrap { flex-wrap: wrap; }
.row input[type=range] { flex: 1; min-width: 0; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.button {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
	background: var(--bg); color: var(--fg); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button.small { min-height: 36px; padding: 4px 12px; font-size: 0.88rem; font-weight: 500; }
.button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.button:disabled { opacity: 0.5; cursor: default; }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file { position: relative; }
.stage { position: relative; display: flex; justify-content: center; background: #000; border-radius: 12px; overflow: hidden; }
.stage canvas#rec-canvas { max-width: 360px; }
.countdown {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	font-size: 7rem; font-weight: 800; color: #fff; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6); pointer-events: none;
}
.rec-badge {
	position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
	background: #d92d2d; color: #fff; font-size: 0.85rem; font-weight: 700; border-radius: 999px; padding: 2px 10px;
}
.styles { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 8px 0 12px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.styles legend { font-size: 0.85rem; color: var(--muted); padding: 0 4px; }
.styles label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: 0.95rem; }
.styles input { accent-color: var(--accent); width: 18px; height: 18px; }
.ok { background: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 0.92rem; margin: 6px 0 10px; }
.stage canvas, #result-video { display: block; width: 100%; max-width: 320px; aspect-ratio: 9 / 16; height: auto; background: #000; }
#result { display: grid; justify-items: center; gap: 12px; margin-top: 12px; }
#result-video { border-radius: 12px; }
progress { width: 100%; height: 10px; accent-color: var(--accent); }
.slider { display: block; margin: 10px 0; font-size: 0.92rem; }
.slider output { float: right; color: var(--muted); }
.diag { margin: 16px 0; font-size: 0.85rem; }
.diag pre { white-space: pre-wrap; word-break: break-all; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
footer { margin-top: 24px; }
a { color: var(--accent); }
[hidden] { display: none !important; }
