:root {
	color-scheme: light;
	--ink: #23201b;
	--muted: #7a7266;
	--paper: #f6f1e7;
	--card: #fffdf8;
	--line: #e4dccb;
	--accent: #b4532a;
	--accent-ink: #fff;
	--ok: #2f7a4b;
	--warn: #a86b12;
	--bad: #b3261e;
}
* { box-sizing: border-box; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 16px/1.55 -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
.shell { max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; }
header { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
h1 { margin: 0; font-size: 28px; letter-spacing: 0.04em; }
h2 { margin: 0 0 12px; font-size: 18px; }
.eyebrow { margin: 0; color: var(--accent); font-size: 13px; letter-spacing: 0.2em; }
.who { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
label { display: block; font-size: 14px; margin: 12px 0 4px; color: var(--muted); }
input { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: 10px 18px; background: var(--accent); color: var(--accent-ink); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.quiet { background: transparent; color: var(--accent); border: 1px solid var(--line); padding: 6px 12px; }
#login-form button { margin-top: 16px; width: 100%; }
#message { min-height: 0; }
#message.show { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
#message.ok { background: #e6f2ea; color: var(--ok); }
#message.err { background: #fbe9e7; color: var(--bad); }
#message.info { background: #fdf3e1; color: var(--warn); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row-between h2 { margin: 0; }
.pill { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.characters { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.character { text-align: left; background: #fff; color: var(--ink); border: 2px solid var(--line); }
.character.selected { border-color: var(--accent); background: #fbefe8; }
.character .name { font-weight: 600; display: block; }
.character .state { font-size: 12px; }
.state.ready { color: var(--ok); }
.state.busy, .state.loading { color: var(--warn); }
.state.offline { color: var(--muted); }
.filter { margin: 12px 0 4px; }
.items { display: grid; gap: 8px; margin-top: 12px; }
.item { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.item .name { font-weight: 600; }
.item .quota { font-size: 12px; color: var(--muted); }
.item input { width: 76px; text-align: center; padding: 8px; }
.item.empty { opacity: 0.55; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.history li:last-child { border-bottom: 0; }
.history .when { color: var(--muted); font-size: 12px; }
.tag { font-size: 12px; white-space: nowrap; }
.tag.ok { color: var(--ok); }
.tag.wait { color: var(--warn); }
.tag.bad { color: var(--bad); }
footer { margin-top: 20px; text-align: center; }
[hidden] { display: none !important; }
@media (max-width: 520px) {
	.item { grid-template-columns: 1fr auto; }
	.item .qty-wrap { grid-column: 1 / 2; }
}
