:root {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #171d24; background: #eef3f6; color-scheme: light;
  --navy: #17374a; --dark: #102d3e; --line: #cbd7df; --muted: #4d6371;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.6; }
a { color: var(--navy); text-underline-offset: .22em; }
header { background: #fff; border-bottom: 1px solid var(--line); }
.bar, .shell { width: min(calc(100% - 48px), 920px); margin: auto; }
.bar { min-height: 64px; display: flex; gap: 20px; align-items: center; justify-content: space-between; }
.brand { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 12px; }
.brand img { object-fit: contain; }
.back { min-height: 44px; display: flex; align-items: center; font-size: .875rem; }
.intro { margin: 32px 0 22px; }
.intro h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); margin: 0 0 .2em; line-height: 1.25; color: var(--dark); }
.intro p, .hint, #options-status, footer { color: var(--muted); }
.intro p { margin: 0; }
.panel { border: 1px solid var(--line); background: #fff; border-radius: 14px; }
.block { display: grid; gap: 14px; padding: 24px 30px; }
.block + .block { border-top: 1px solid var(--line); }
h2 { margin: 0; color: var(--dark); font-size: 1.17rem; }
.field { display: grid; gap: 4px; align-content: start; font-size: .9375rem; font-weight: 600; min-width: 0; }
small { color: var(--muted); font-weight: 400; margin-left: .35em; }
.hint { font-weight: 400; font-size: .8125rem; }
input, select, textarea, button { font: inherit; }
input:not([type=checkbox]), select, textarea {
  width: 100%; min-width: 0; min-height: 44px; padding: 8px 11px; border-radius: 7px;
  border: 1px solid #a6b8c4; color: #171d24; background: #fff; font-weight: 400; font-size: 1rem;
}
textarea { resize: vertical; }
select:disabled { opacity: 1; color: var(--muted); background: #edf2f5; }
button { cursor: pointer; min-height: 44px; padding: 8px 14px; font-weight: 650; border-radius: 7px; }
button:disabled { cursor: not-allowed; opacity: .62; }
.primary { color: #fff; background: var(--navy); border: 1px solid var(--navy); min-width: 144px; justify-self: start; }
.primary:not(:disabled):hover { background: var(--dark); }
.secondary { color: var(--navy); background: #fff; border: 1px solid #a6b8c4; justify-self: start; text-align: left; }
.secondary:not(:disabled):hover { background: #eef3f6; }
.remove { color: #8b2b31; background: transparent; border: 1px solid transparent; font-size: .875rem; justify-self: end; align-self: end; }
.remove:hover { background: #fae9e9; }
:focus-visible { outline: 3px solid #156586; outline-offset: 2px; }
[aria-invalid=true] { border-color: #a82e36 !important; }
#options-status { margin: 0; font-size: .9rem; }
.grid { display: grid; gap: 12px; }
.pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.region { grid-template-columns: repeat(3, minmax(0, 1fr)); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin: 0 0 4px; font-weight: 650; }
.records { display: grid; gap: 10px; align-content: start; min-width: 0; }
.records.is-scroll { overflow-y: auto; padding: 3px; scrollbar-gutter: stable; border: 1px solid var(--line); border-radius: 8px; }
.group { display: grid; gap: 10px; min-width: 0; background: #f4f7f9; border: 1px solid var(--line); padding: 12px; border-radius: 8px; }
.group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; }
.group-head h3 { margin: 0; color: var(--dark); font-size: .95rem; }
.row { display: grid; gap: 8px 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 9rem) auto; align-items: end; }
.scene-row { grid-template-columns: minmax(0, 1fr) auto; }
.scene-row .custom { grid-column: 1; grid-row: 2; }
.primary-rows { padding-top: 3px; }
.privacy { color: var(--muted); font-size: .9rem; }
.privacy summary { min-height: 36px; cursor: pointer; font-weight: 650; color: var(--navy); }
.privacy p { margin: 6px 0 12px; }
.consent { display: flex; align-items: flex-start; gap: 9px; font-size: .9rem; cursor: pointer; }
.consent input { flex: 0 0 19px; width: 19px; height: 19px; margin: 2px 0 0; accent-color: var(--navy); }
.message { padding: 10px 12px; border: 1px solid #e2b4b4; background: #fdf1f1; border-radius: 8px; color: #8b2b31; }
.receipt { padding: 28px; overflow-wrap: anywhere; }
.receipt output { font: 600 1rem ui-monospace, monospace; }
footer { text-align: center; font-size: .85rem; padding: 18px 16px 26px; }
@media (max-width: 600px) {
  .shell, .bar { width: calc(100% - 28px); }
  .bar { min-height: 57px; }
  .intro { margin: 23px 0 15px; }
  .block { padding: 19px 15px; }
  .region, .pair { grid-template-columns: minmax(0, 1fr); }
  .row:not(.scene-row) { grid-template-columns: minmax(0, 1fr) minmax(0, 5.5rem); }
  .row:not(.scene-row) .remove { grid-column: 2; }
  .group { padding: 9px; }
  .primary { width: 100%; }
}
