:root {
	--bg: #f6f3ee;
	--surface: #ffffff;
	--surface-2: #efeae2;
	--text: #1f1b16;
	--muted: #6d6459;
	--line: #ddd5c9;
	--accent: #b4532a;
	--accent-text: #ffffff;
	--ok: #2f7a4b;
	--warn: #b7791f;
	--danger: #b42a2a;
	--info: #2b5fa8;
	--radius: 12px;
	--shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #15120f;
		--surface: #211d19;
		--surface-2: #2c2722;
		--text: #f2ece4;
		--muted: #a99d8f;
		--line: #3b342d;
		--accent: #e07a4a;
		--accent-text: #1a0f08;
		--ok: #5cbf83;
		--warn: #e2b04a;
		--danger: #f06a6a;
		--info: #79a7ee;
		--shadow: none;
		color-scheme: dark;
	}
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
	font-size: 16px;
	line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 120px; }
.wide { max-width: 1200px; }

header.top {
	position: sticky; top: 0; z-index: 10;
	background: var(--bg);
	border-bottom: 1px solid var(--line);
	padding: 12px 16px;
}
header.top .inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
header.top h1 { font-size: 17px; margin: 0; font-weight: 700; }
header.top .sub { color: var(--muted); font-size: 13px; }
.spacer { flex: 1; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
h2 { font-size: 15px; margin: 20px 0 8px; color: var(--muted); font-weight: 700; letter-spacing: 0.04em; }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 44px; padding: 0 16px; border-radius: 10px;
	border: 1px solid var(--line); background: var(--surface); font-weight: 600;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.badge.new { background: var(--accent); color: var(--accent-text); }
.badge.accepted { background: var(--info); color: #fff; }
.badge.served { background: var(--ok); color: #fff; }
.badge.cancelled { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.badge.warn { background: var(--warn); color: #1a1205; }
.badge.paid { background: var(--surface-2); color: var(--ok); }

.banner { border-radius: var(--radius); padding: 12px 14px; font-weight: 600; }
.banner.warn { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); border: 1px solid var(--warn); }
.banner.info { background: color-mix(in srgb, var(--info) 14%, var(--surface)); border: 1px solid var(--info); }
.banner.danger { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); border: 1px solid var(--danger); }

.tabs { display: flex; gap: 6px; margin: 12px 0; }
.tabs button { flex: 1; min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

input[type="text"], input[type="number"], input[type="date"], input[type="email"], select, textarea {
	width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
}
textarea { min-height: 80px; }
label.field { display: block; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 700; }
td.r, th.r { text-align: right; }

dialog { border: none; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
dialog .dlg { padding: 18px; }
dialog h3 { margin: 0 0 12px; font-size: 18px; }

.toast {
	position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
	background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 999px;
	font-weight: 600; z-index: 100; max-width: calc(100vw - 32px); text-align: center;
}
.hidden { display: none !important; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; }
.mt12 { margin-top: 12px; }
.grow { flex: 1; }
a.btn { text-decoration: none; color: inherit; }
a.btn.primary { color: var(--accent-text); }
