:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #172a39;
  background: #f3f6f4;
  line-height: 1.55;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.topbar { background: #172a39; color: #fff; padding: 1.4rem 1.25rem; }
.topbar-inner { max-width: 1040px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 1.6rem; line-height: 1.2; margin-bottom: 0; }
h2 { font-size: 1.25rem; line-height: 1.3; margin-bottom: .5rem; }
h3 { font-size: .9rem; margin-bottom: .25rem; }
.eyebrow { margin-bottom: .25rem; color: #286d59; font-size: .75rem; font-weight: 700; letter-spacing: .07em; }
.topbar .eyebrow { color: #a8d5c4; }
.container { max-width: 1040px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.panel { background: #fff; border: 1px solid #dbe5df; border-radius: 14px; padding: 1.4rem; margin-bottom: 1rem; box-shadow: 0 4px 18px #173c3010; }
.login-panel { max-width: 520px; margin: 2rem auto; }
.qr-image { display: block; width: min(260px, 100%); height: auto; margin: .8rem 0; border: 1px solid #dbe5df; border-radius: 8px; }
.compare-code { font-size: 1.5rem; font-weight: 700; letter-spacing: .2em; }
.operator-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid #e0e9e3; }
#invite-start { margin-top: 1rem; }
#invite-code { max-width: 14rem; margin-bottom: .7rem; }
.muted, .explanation, .field-hint { color: #526a61; }
.muted, .explanation { font-size: .92rem; }
.explanation { max-width: 78ch; margin-bottom: 1.2rem; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
label { display: block; font-size: .9rem; font-weight: 700; margin: .9rem 0 .35rem; }
input:not([type="checkbox"]), textarea { display: block; width: 100%; border: 1px solid #aebfb6; border-radius: 8px; padding: .65rem .75rem; background: #fff; color: #172a39; font: inherit; }
input:not([type="checkbox"]) { min-height: 44px; }
textarea { resize: vertical; }
input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin: .2rem .65rem 0 0; accent-color: #246c55; flex: none; }
input:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid #79bea0; outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled { opacity: .68; }
.switch-line { display: flex; align-items: flex-start; margin: .3rem 0 1rem; }
.switch-line .field-hint { display: block; font-weight: 400; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; max-width: 700px; }
.field-hint { font-size: .82rem; margin: .3rem 0 .7rem; font-weight: 400; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; border: 1px solid transparent; border-radius: 8px; padding: .55rem .9rem; font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; }
.button.primary { background: #246c55; color: #fff; }
.button.secondary { background: #eef4f0; color: #214d3e; border-color: #ceded4; }
.button.compact { min-height: 38px; white-space: nowrap; }
.button:hover:not(:disabled) { filter: brightness(.94); }
.button:disabled { opacity: .52; cursor: not-allowed; }
#login-button { margin-top: 1rem; }
.message { padding: .75rem .9rem; border-radius: 8px; background: #edf6ef; color: #214d3e; font-size: .9rem; overflow-wrap: anywhere; }
.message.error { background: #fff0ec; color: #8b3425; }
.schedule { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; border-top: 1px solid #e0e9e3; padding-top: 1rem; margin-top: 1.2rem; }
.schedule pre { margin: 0; color: #526a61; font: inherit; font-size: .88rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.prizes-list { display: grid; gap: .8rem; }
.more-actions .button { margin-top: .8rem; }
.prize { border: 1px solid #dbe5df; border-radius: 10px; padding: 1rem; }
.prize-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .7rem; }
.prize-heading h3 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.badge { padding: .2rem .55rem; border-radius: 999px; background: #eef4f0; color: #214d3e; font-size: .8rem; font-weight: 700; overflow-wrap: anywhere; }
.badge.occupied { background: #fff1d8; color: #744806; }
.prize-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem 1rem; margin: 0; }
.prize-details div { min-width: 0; }
.prize-details dt { color: #526a61; font-size: .8rem; }
.prize-details dd { margin: .15rem 0 0; font-size: .92rem; overflow-wrap: anywhere; }
.prize-actions, .dialog-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.prize-hint { color: #526a61; font-size: .82rem; margin: .6rem 0 0; }
dialog { width: min(100% - 2rem, 520px); max-height: calc(100% - 2rem); border: 1px solid #dbe5df; border-radius: 14px; padding: 1.4rem; color: #172a39; box-shadow: 0 12px 50px #0004; }
dialog::backdrop { background: #10241dcc; }
.warning { background: #fff6e5; border-left: 4px solid #ae711a; padding: .75rem; font-size: .9rem; }
.dialog-actions { justify-content: flex-end; }
@media (max-width: 600px) {
  .container { padding: 1rem .75rem 2rem; }
  .panel { padding: 1rem; }
  .topbar { padding: 1.1rem 1rem; }
  .topbar-inner { align-items: flex-start; }
  .topbar .button { max-width: 11rem; }
  .fields, .schedule { grid-template-columns: 1fr; gap: .25rem; }
  .prize-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prize-actions .button { flex: 1 1 auto; }
}
