:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --ink: #131a2a;
  --muted: #5b6579;
  --line: #d8dde7;
  --accent: #1f4fd1;
  --accent-ink: #ffffff;
  --accent-soft: #e5ecfd;
  --signal: #c2410c;
  --ok: #157347;
  --ok-soft: #e3f4ea;
  --warn: #9a6200;
  --warn-soft: #fbf0d9;
  --err: #b42318;
  --err-soft: #fde8e6;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --radius: 10px;
  --banner-bg: #0a1a5c; /* matches the event banner edge, same in both themes */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1320; --surface: #161d2e; --surface-2: #1d2539; --ink: #e7ebf3; --muted: #9aa4b8;
    --line: #2b3550; --accent: #7c9cff; --accent-ink: #0e1320; --accent-soft: #1f2a4a; --signal: #fb923c;
    --ok: #5fd08f; --ok-soft: #14301f; --warn: #f2c25b; --warn-soft: #33290f; --err: #ff8a7f; --err-soft: #3a1a18;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1320; --surface: #161d2e; --surface-2: #1d2539; --ink: #e7ebf3; --muted: #9aa4b8;
  --line: #2b3550; --accent: #7c9cff; --accent-ink: #0e1320; --accent-soft: #1f2a4a; --signal: #fb923c;
  --ok: #5fd08f; --ok-soft: #14301f; --warn: #f2c25b; --warn-soft: #33290f; --err: #ff8a7f; --err-soft: #3a1a18;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font-body); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; text-wrap: balance; margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }


/* Event banner (image and strip color come from the event settings) */
.banner { background: var(--banner-bg); }
.banner img { display: block; width: 100%; max-width: 1600px; height: auto; margin: 0 auto; }

/* Top bar */
.top { background: var(--surface); border-bottom: 1px solid var(--line); padding-inline: 16px; }
.top-inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brand h1 { font-size: 18px; letter-spacing: -.01em; }
.brand .ev { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.who { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 16px; padding-block: 24px 80px; }

/* Login */
.login { max-width: 420px; margin: 48px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: grid; gap: 16px; }
.login h2 { font-size: 22px; }
.login p { margin: 0; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.hint code { font-family: var(--font-mono); color: var(--ink); }
.code-input { font-family: var(--font-mono); font-size: 22px; letter-spacing: .4em; text-align: center; }

/* Fields */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field label, .lbl { font-weight: 500; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.req { color: var(--signal); }
.tag { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 1px 6px; font-weight: 500; }
.help { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.count { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.count.over { color: var(--err); }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=tel], select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; min-width: 0;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field.invalid input, .field.invalid textarea, .field.invalid select, .field.invalid .drop { border-color: var(--err); }
.errmsg { font-size: 12.5px; color: var(--err); }
.ro { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; padding: 9px 11px; color: var(--muted); }

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px 16px; cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.field label.btn { display: inline-flex; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--err); border-color: transparent; }

/* Summary */
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: grid; grid-template-columns: 1fr auto; gap: 18px 24px; align-items: start; }
.summary h2 { font-size: 24px; letter-spacing: -.01em; }
.summary .legal { color: var(--muted); font-size: 13px; margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 500; background: var(--surface-2); }
.chip.level { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .mono { font-family: var(--font-mono); font-weight: 400; }
.meta { display: grid; gap: 8px; justify-items: end; text-align: right; }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-progress { background: var(--warn-soft); color: var(--warn); }
.st-complete { background: var(--ok-soft); color: var(--ok); }
.st-changed { background: var(--warn-soft); color: var(--warn); }
.deadline { font-size: 13px; color: var(--muted); }
.deadline b { color: var(--ink); font-variant-numeric: tabular-nums; }
.progress { grid-column: 1 / -1; display: grid; gap: 6px; }
.bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.progress .help { justify-content: flex-start; }

/* Layout */
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; margin-top: 24px; align-items: start; }
.nav { position: sticky; top: 16px; display: grid; gap: 2px; }
.nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.nav a:hover { background: var(--surface); }
.nav .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.nav .dot.done { background: var(--ok); }
.nav .dot.todo { background: var(--signal); }
.nav .navlbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 4px 12px 8px; }

.sections { display: grid; gap: 24px; min-width: 0; }
.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 18px; scroll-margin-top: 16px; min-width: 0; }
.section-head { display: grid; gap: 4px; }
.section-head h3 { font-size: 18px; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.full { grid-column: 1 / -1; }

/* Upload */
.drop { border: 1.5px dashed var(--line); border-radius: 10px; padding: 16px; display: flex; gap: 16px; align-items: center; background: var(--surface-2); flex-wrap: wrap; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.logo-prev { width: 120px; height: 120px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--muted); font-size: 12px; text-align: center; }
.logo-prev img { width: 100%; height: 100%; object-fit: contain; }
.drop-txt { display: grid; gap: 6px; min-width: 0; flex: 1; font-size: 13.5px; }
.files { display: grid; gap: 6px; }
.file-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; background: var(--surface-2); border-radius: 8px; padding: 6px 10px; }
.file-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Repeaters */
.rep { display: grid; gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-head strong { font-size: 14px; }
.badge { font-size: 12px; border-radius: 4px; padding: 2px 8px; background: var(--surface-2); color: var(--muted); }
.checks { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.checks label { display: inline-flex; gap: 8px; align-items: center; font-weight: 400; }
.staff-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 8px; align-items: center; }
.staff-head { font-size: 12px; color: var(--muted); }

/* Footer bar */
.actions { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding-inline: 16px; padding-block: 12px calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 10; }
.actions-inner { max-width: 1120px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions .saved { font-size: 13px; color: var(--muted); }
.actions .btns { display: flex; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 20; max-width: calc(100% - 32px); }
.alert { border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.alert.err { background: var(--err-soft); color: var(--err); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--accent-soft); color: var(--ink); }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .nav .navlbl { display: none; }
  .nav a { white-space: nowrap; background: var(--surface); border: 1px solid var(--line); }
  .summary { grid-template-columns: 1fr; }
  .meta { justify-items: start; text-align: left; }
}
@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
  .staff-row { grid-template-columns: 1fr 1fr; }
  .staff-row .em { grid-column: 1 / -1; }
  .staff-head { display: none; }
  .section { padding: 16px; }
}
.devhint { border: 1px dashed var(--signal); }
.readonly-note { margin-top: 16px; }
.field input:disabled, .field textarea:disabled, .field select:disabled { opacity: .75; cursor: not-allowed; }
.spin { opacity: .6; pointer-events: none; }

.foot { max-width: 1120px; margin: 0 auto; padding: 8px 16px 110px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--muted); }
.foot a { color: var(--muted); }

.consent-label { font-weight: 400 !important; align-items: flex-start !important; flex-wrap: nowrap !important; gap: 10px !important; }
.consent-label input { margin-top: 4px; flex: none; }
.choice { gap: 12px; }
.muted { color: var(--muted); font-size: 13.5px; }
.section.attention { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }

.fp-prev { width: 160px; height: 120px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; flex: none; text-decoration: none; }
.fp-prev img { width: 100%; height: 100%; object-fit: contain; }
.fp-pdf { font-family: var(--font-mono); font-weight: 500; color: var(--muted); letter-spacing: .08em; }
.warnbadge { background: var(--warn-soft); color: var(--warn); }
.floorplan a.btn { text-decoration: none; display: inline-block; color: inherit; }
