:root {
  color-scheme: light;
  font-family: "Inter", "Microsoft YaHei", system-ui, sans-serif;
  background: #f3f6f2;
  color: #172f29;
  --accent: #24634f;
  --quiet: #476058;
  --border: #d8e3d9;
}
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { max-width: 1240px; margin: auto; padding-inline: clamp(15px, 4vw, 48px); }
.top { background: #163e34; color: white; }
.brand { display: flex; gap: 14px; align-items: center; padding-block: 16px; }
.brand strong { font-size: 20px; }
.brand small { display: block; margin-top: 4px; color: #d3e6d9; }
.mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #d9ebce; color: #163e34; font-size: 28px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 43px); letter-spacing: -.045em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p, .legend, .muted { color: var(--quiet); }
.intro p { margin-top: 8px; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: white; color: inherit; }
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
button:focus-visible, :is(input, select, textarea, summary):focus-visible { outline: 2px solid #227551; outline-offset: 2px; }
button:disabled { opacity: .55; cursor: wait; }
.primary { background: var(--accent); color: white; border-color: var(--accent); }
.toolbar, .actions { display: flex; flex-wrap: wrap; gap: 8px; }
#message { margin-top: 12px; color: #184b3a; font-size: 14px; }
#message[data-error="true"] { color: #972b22; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-block: 16px; }
.stat, .card { border: 1px solid var(--border); border-radius: 15px; background: #fff; }
.stat { padding: 12px 15px; }
.stat strong { display: block; font-size: 25px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--quiet); }
.workbench { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; padding-bottom: 32px; }
.card { padding: clamp(12px, 2vw, 22px); min-width: 0; }
.card-head { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 12px; }
.card-head label { display: flex; align-items: center; gap: 6px; }
.notice { padding: 9px 12px; background: #f8efda; border-radius: 8px; margin-top: 12px; font-size: 13px; }
.stage { margin: 15px auto 11px; padding: 8px; max-width: 350px; background: #e8efe5; border-radius: 7px; color: #365447; text-align: center; font-size: 13px; }
.legend { margin-block: 8px; font-size: 13px; }
#seats { display: grid; grid-template-columns: repeat(var(--cols), minmax(70px, 1fr)); overflow-x: auto; gap: 7px; padding: 4px; }
.seat { border: 1px solid var(--border); background: #f7f9f6; border-radius: 9px; padding: 4px; text-align: center; }
.seat small { display: block; color: var(--quiet); margin-bottom: 3px; }
.seat button { width: 47%; font-size: 13px; min-height: 34px; padding: 2px; position: relative; }
.seat button + button { margin-left: 4%; }
.seat button[aria-pressed="true"] { border-color: var(--accent); background: #d9eee0; font-weight: bold; }
.seat button[data-open="true"] { border-color: #bc8140; background: #fff0d9; }
.seat sup { color: #854413; font-weight: 700; }
.detail > p { margin-block: 9px; }
.record { border: 1px solid var(--border); border-radius: 9px; margin-top: 10px; padding: 10px; }
.record summary { cursor: pointer; overflow-wrap: anywhere; }
.record p { margin-block: 6px; overflow-wrap: anywhere; }
.record ol { padding-left: 22px; margin-bottom: 0; }
.status { display: inline-block; background: #e6efe6; color: #245340; padding: 2px 7px; border-radius: 6px; font-size: 12px; }
.photos { display: grid; grid-template-columns: repeat(auto-fit,minmax(90px,1fr)); gap: 7px; }
figure { margin: 4px 0; }
figure img { display: block; width: 100%; height: 80px; object-fit: contain; background: #eff3ee; border-radius: 5px; }
figcaption { font-size: 12px; color: var(--quiet); }
form { display: grid; gap: 8px; margin-top: 12px; }
form label { display: grid; gap: 3px; font-size: 13px; }
form input, form select, form textarea { width: 100%; }
textarea { min-height: 65px; resize: vertical; }
dialog { width: min(450px, calc(100vw - 26px)); border: 1px solid var(--border); border-radius: 15px; padding: 20px; }
dialog::backdrop { background: #163e3477; }
@media (max-width: 805px) { .workbench { grid-template-columns: 1fr; } }
@media (max-width: 450px) { .stats { grid-template-columns: repeat(2,1fr); } .brand small { font-size: 12px; } }

.record .actions { margin-top: 10px; }
button.danger { color: #a23228; }
#record-editor { max-height: 90vh; }
#edit-form fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 8px; display: grid; gap: 7px; }
#edit-form .photo-choice { display: flex; align-items: center; gap: 6px; }
#edit-form .photo-choice input { width: auto; }
