:root {
  color-scheme: light;
  --ink: #183237;
  --dark: #123d40;
  --teal: #08675e;
  --teal-dark: #05544e;
  --muted: #52696d;
  --line: #cddcda;
  --soft: #edf4f1;
  --paper: #fff;
  --page: #f2f6f4;
  font-family: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 100%;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
a { color: var(--teal-dark); text-underline-offset: .2em; }
a:hover { color: #073f3b; }
:focus-visible { outline: 3px solid #c97d17; outline-offset: 3px; }
h1, h2, h3, p, dl, dd, pre { margin: 0; }
h1, h2, h3 { line-height: 1.35; text-wrap: pretty; }
h1 { font-size: clamp(1.7rem, 2.7vw, 2.25rem); font-weight: 700; letter-spacing: -.045em; }
h2 { font-size: 1.25rem; font-weight: 680; letter-spacing: -.025em; }
h3 { font-size: 1.02rem; font-weight: 650; }
p { overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
button { touch-action: manipulation; }
.skip { position: absolute; left: 1rem; top: -5rem; z-index: 2; padding: .6rem 1rem; color: var(--ink); background: #fff; }
.skip:focus { top: .65rem; }
.app-bar { background: var(--dark); color: #f4faf7; }
.bar-inner { max-width: 78rem; margin: auto; padding: .65rem clamp(.85rem, 3vw, 2rem); min-height: 4.15rem; display: flex; align-items: center; gap: .7rem 1.6rem; flex-wrap: wrap; }
.identity { display: inline-flex; align-items: center; gap: .65rem; white-space: nowrap; font-size: 1.09rem; font-weight: 650; }
.mark { display: inline-block; width: 1.65rem; height: 1.65rem; border: 2px solid #b5dfc8; border-radius: .55rem .55rem .8rem .8rem; position: relative; }
.mark::after { content: ""; position: absolute; left: .34rem; top: .24rem; width: .55rem; height: .84rem; border: solid #b5dfc8; border-width: 0 2px 2px 0; transform: rotate(38deg); }
.bar-inner nav, .account { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.bar-inner a, .bar-button { color: #e9f3ee; text-decoration: none; border: 0; background: transparent; font-size: .92rem; font-weight: 520; padding: .52rem .66rem; min-height: 2.5rem; border-radius: .42rem; display: inline-flex; align-items: center; }
.bar-inner a:hover, .bar-inner a[aria-current=page], .bar-button:hover { background: #285451; color: #fff; }
.bar-inner a[aria-current=page] { box-shadow: inset 0 -2px #a5d3b9; }
.account, .login-link { margin-left: auto; }
.account > span { padding: .2rem .2rem .2rem 0; max-width: 10rem; overflow-wrap: anywhere; color: #c8ddd4; font-size: .88rem; }
.main { max-width: 76rem; margin: auto; padding: clamp(1.4rem, 3.1vw, 2.55rem) clamp(1rem, 3vw, 2rem) 4rem; }
.main-settings, .main-review { max-width: 62rem; }
.main-person, .main-verify { max-width: 58rem; }
.main-register, .main-team { max-width: 55rem; }
.main-register, .main-login, .main-done, .main-password { padding-top: clamp(1.4rem, 5vw, 4rem); }
.page-intro { margin: 0 0 1.3rem; }
.page-intro p, .compact > p { margin-top: .4rem; color: var(--muted); }
.panel { border: 1px solid var(--line); border-radius: .85rem; background: var(--paper); padding: clamp(1rem, 2.3vw, 1.55rem); }
.panel + .panel, .requests > * + * { margin-top: 1rem; }
.compact { max-width: 29rem; margin: auto; padding: clamp(1.25rem, 3vw, 2rem); }
.compact .stack, .panel > h2 + form, .panel > h2 + .details-grid { margin-top: 1rem; }
.form-panel { max-width: 51rem; }
.stack, .form-grid { display: grid; gap: 1rem; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }
label { display: block; min-width: 0; font-size: .94rem; font-weight: 570; }
.req { color: #9f3c29; }
input:not([type=checkbox]), select, textarea { display: block; margin-top: .35rem; width: 100%; min-width: 0; min-height: 2.75rem; padding: .55rem .72rem; border: 1px solid #9fb4b2; border-radius: .46rem; background: var(--paper); color: var(--ink); font-size: 1rem; font-weight: 430; }
input::placeholder, textarea::placeholder { color: #657a7d; }
select { appearance: none; padding-right: 2.1rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23466065' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-position: right .65rem center; background-repeat: no-repeat; }
textarea { resize: vertical; }
input[type=file] { padding: .32rem; }
input[type=file]::file-selector-button { font: inherit; padding: .27rem .65rem; border: 0; border-radius: .3rem; margin-right: .5rem; background: var(--soft); color: var(--teal-dark); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.65rem; padding: .48rem .95rem; border: 1px solid #9cb5af; border-radius: .48rem; font-size: .94rem; font-weight: 610; line-height: 1.45; text-decoration: none; background: #fff; color: var(--teal-dark); }
.btn:hover { background: var(--soft); color: var(--teal-dark); }
.btn.primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn.primary:hover { background: var(--teal-dark); }
.btn:disabled { cursor: default; opacity: .5; }
.form-actions, .checks, .team-list, .code-actions, .seg-nav { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.checks label { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.55rem; margin-right: .5rem; }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--teal); }
.notice { margin: 0 0 1.1rem; padding: .8rem 1rem; border-radius: .5rem; border: 1px solid #95bcad; background: #e4f3ec; color: #214d3f; overflow-wrap: anywhere; }
.notice.error { border-color: #dfb49e; background: #fcf0e8; color: #853e27; }
.notice pre { font-size: .94rem; white-space: pre-wrap; }
.success-mark { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; margin-bottom: .8rem; background: #d8efe2; border-radius: 50%; font-size: 1.45rem; color: var(--teal-dark); }
.receipt { display: grid; gap: .2rem; padding: 1rem; margin-top: 1.2rem; background: var(--soft); border-radius: .5rem; }
.receipt span, .muted, .meta, .source { color: var(--muted); }
.receipt span, .meta, .source { font-size: .88rem; }
.receipt strong, .id, .date { font-variant-numeric: tabular-nums; }
.receipt strong { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 1.27rem; overflow-wrap: anywhere; }
.id { display: block; color: var(--muted); font: .84rem/1.55 "IBM Plex Mono", ui-monospace, monospace; overflow-wrap: anywhere; }
.section-header, .history header, .profile-header, .code-toolbar { display: flex; justify-content: space-between; align-items: center; gap: .65rem 1rem; flex-wrap: wrap; }
.list-panel { padding: 0; overflow: hidden; }
.list-panel .section-header { padding: 1rem 1.2rem; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .94rem; text-align: left; }
th, td { text-align: left; padding: .72rem .85rem; border-bottom: 1px solid #dbe5e1; vertical-align: middle; }
th { background: var(--soft); color: #36504e; font-size: .87rem; font-weight: 620; }
tbody tr:last-child td { border-bottom: 0; }
.person-link { font-size: 1rem; font-weight: 660; }
.date { overflow-wrap: anywhere; }
.empty { padding: .7rem 0; color: var(--muted); }
.list-panel .empty { padding: .4rem 1.2rem 1.2rem; }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 1rem; margin-top: 1rem; }
.details-grid > div { min-width: 0; }
dt { color: var(--muted); font-size: .87rem; }
dd { margin-top: .15rem; overflow-wrap: anywhere; }
.profile-header h2 { font-size: 1.55rem; }
.level-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1px; margin: 1.25rem 0 0; border: 1px solid var(--line); border-radius: .5rem; overflow: hidden; background: var(--line); }
.level-grid > div { padding: .76rem; background: var(--soft); }
.level-grid > div > span { display: block; margin-bottom: .2rem; font-size: .87rem; color: #37504e; }
.level-grid strong { overflow-wrap: anywhere; font-size: 1rem; font-weight: 600; }
.source { margin-top: .7rem; overflow-wrap: anywhere; }
.history { margin-top: .45rem; }
.history article { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.history article:last-child { border: 0; padding-bottom: 0; }
.history p { margin-top: .2rem; color: var(--muted); }
.history header .date { font-size: .9rem; }
.requests, .team-list { margin-top: .65rem; }
.request { padding: 0; }
summary { display: flex; align-items: center; justify-content: space-between; gap: .65rem; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "⌄"; font-size: 1.05rem; color: var(--muted); }
details[open] > summary::after { content: "⌃"; }
.request summary { padding: .9rem 1.15rem; }
.summary-main { display: flex; flex: 1; gap: .45rem 1rem; flex-wrap: wrap; align-items: baseline; }
.summary-main > span { color: var(--muted); font-size: .91rem; }
.tag { display: inline-block; padding: .2rem .6rem; color: #33574c; background: var(--soft); border-radius: .38rem; font-size: .86rem; }
.request-body { padding: 0 1.15rem 1.15rem; }
.request-body .details-grid { margin: 0; padding-top: .9rem; border-top: 1px solid var(--line); }
.review-form { padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--line); }
.field-edit { border-bottom: 1px solid var(--line); padding: .15rem 0; }
.field-edit summary { min-height: 2.8rem; padding: .45rem 0; }
.field-edit summary strong { flex: 1; }
.field-edit form { margin: .35rem 0 .7rem; }
.add-field { border-bottom: 0; }
.stop-field { text-align: right; }
.text-btn { border: 0; color: #8f422e; background: transparent; padding: .5rem .1rem; text-decoration: underline; }
.block-heading { margin: 1.35rem 0 .75rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.team-list { margin-bottom: .9rem; }
.code-toolbar { margin: 0 0 1.1rem; }
.seg-nav a { display: inline-flex; align-items: center; padding: .55rem .85rem; border: 1px solid var(--line); border-radius: .45rem; background: #fff; text-decoration: none; }
.seg-nav a:hover { background: var(--soft); }
.code-item { padding: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: .7rem; }
.poster { padding: clamp(1rem, 3vw, 2rem); text-align: center; background: #fff; color: #172d2b; border: 1px solid #d3e1da; }
.poster h2 { font-size: clamp(1.45rem,3vw,2rem); }
.poster > p { margin-top: .45rem; }
.qr-art { background: #fff; color: #294944; }
.qr-art svg { width: 100%; height: auto; display: block; }
.poster .qr-art { width: min(100%, 14rem); margin: 1rem auto; }
.poster-foot { font-size: .92rem; }
.sticker { width: min(100%, 9.5rem); margin: .5rem auto; text-align: center; color: #111; }
.sticker-number { display: block; font: 600 .9rem/1.35 "IBM Plex Mono", ui-monospace, monospace; overflow-wrap: anywhere; }
.code-controls { padding-top: .8rem; border-top: 1px solid var(--line); margin-top: .8rem; }
.code-actions { font-size: .88rem; gap: .45rem .65rem; }
.code-actions .btn { font-size: .85rem; min-height: 2.45rem; padding: .34rem .65rem; }
@media(max-width:70rem) {
  .bar-inner { gap: .3rem 1rem; }
  .bar-inner nav { order: 3; flex-basis: 100%; }
}
@media(max-width:42rem) {
  .main { padding: 1rem .8rem 2.5rem; }
  .bar-inner { padding: .5rem .75rem; }
  .bar-inner a, .bar-button { padding: .38rem .48rem; }
  .identity { font-size: 1rem; }
  .form-grid { grid-template-columns: 1fr; }
  .level-grid { gap: 1px; }
  .level-grid > div { padding: .52rem .36rem; }
  .level-grid strong { font-size: .9rem; }
  .roster, .roster tbody, .roster tr, .roster td { display: block; }
  .roster thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
  .roster tr { padding: .7rem 1rem; border-top: 1px solid var(--line); }
  .roster td { display: grid; grid-template-columns: minmax(6rem, 36%) minmax(0, 1fr); gap: .1rem .5rem; padding: .13rem 0; border: 0; overflow-wrap: anywhere; }
  .roster td::before { content: attr(data-label); color: var(--muted); grid-row: 1 / span 2; font-size: .88rem; }
  .roster .id { grid-column: 2; }
  .section-header { align-items: flex-start; }
}
@media(max-width:22rem) { .account > span { max-width: 3.4rem; } }
/* Roster, training registration and print layout */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.roster-filter { margin: 0 0 1rem; }
.roster-filters {
  display: grid;
  grid-template-columns: minmax(11rem, 1.3fr) repeat(3, minmax(9rem, 1fr));
  gap: .85rem;
  margin-bottom: 1rem;
}
.special-list { margin: 0; padding: 0; list-style: none; }
.special-list li + li { padding-top: .32rem; margin-top: .32rem; border-top: 1px solid var(--line); }
.seg-nav { margin: 0 0 1rem; }
.seg-nav a[aria-current=page] { color: #fff; background: var(--teal); border-color: var(--teal); }
.event-fields { max-width: 45rem; }
.event-overview { margin-bottom: 1rem; }
.event-list { margin-top: 1rem; }
.poster-item { width: min(100%, 34rem); margin-bottom: 1rem; }
.duration {
  margin: 0;
  padding: .2rem .8rem .7rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 9rem));
  gap: .45rem;
}
.duration legend { padding: 0 .3rem; font-size: .94rem; font-weight: 570; }
.duration p { grid-column: 1 / -1; }
.fixed-field { display: grid; align-content: start; gap: .35rem; }
.fixed-field span, .eyebrow { font-size: .94rem; font-weight: 570; }
.fixed-field strong { padding: .53rem .72rem; background: var(--soft); border-radius: .45rem; }
.page-intro > .eyebrow { margin: 0 0 .4rem; }
.attendance-values dd { margin-bottom: .4rem; }
.inline-form { display: flex; align-items: end; flex-wrap: wrap; gap: .4rem; }
.inline-form label { max-width: 8.5rem; }
.role-help { margin: 0 0 1rem; padding: .6rem; background: var(--soft); border-radius: .45rem; }
.account-action { display: grid; gap: .45rem; margin: .6rem 0; }
.account-action .btn { justify-self: start; }
.helmet-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1.1rem; padding: 0 1.2rem 1rem; }
.helmet-controls label { display: flex; align-items: center; gap: .45rem; }
.helmet-controls input { margin: 0; }
.helmet-controls input[type=search] { min-width: min(100%, 10rem); }
.sheets { display: grid; gap: 1rem; }
.sticker-sheet {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .5rem;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: #fff;
}
.sticker-cell { min-width: 0; padding: .55rem .2rem; border: 1px dashed #bdc8c6; border-radius: .3rem; text-align: center; }
.sticker-actions p { margin: 0 .2rem .3rem; font-weight: 570; }
.sticker-actions .btn { min-height: 2rem; padding: .2rem .45rem; font-size: .78rem; }

@media(max-width:60rem) {
  .roster-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media(max-width:34rem) {
  .roster-filters { grid-template-columns: minmax(0, 1fr); }
  .sticker-sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@page { size: A4 portrait; margin: 10mm; }
@media print {
  :root, body { color: black; background: white; }
  .app-bar, .skip, .notice, .print-hide { display: none !important; }
  .main { padding: 0; margin: 0; max-width: none; }
  .poster-item { width: auto; border: 0; padding: 0; margin: 0; }
  .poster { padding: 21mm 9mm 12mm; border: 0; }
  .poster h2 { font-size: 27pt; }
  .poster > p { font-size: 16pt; margin-top: 6mm; }
  .poster .qr-art { width: 100mm; margin: 10mm auto; }
  .poster .poster-foot { font-size: 13pt; }
  .sheets { display: block; }
  .sticker-sheet {
    grid-template-columns: repeat(5, 35mm);
    grid-auto-rows: 34mm;
    gap: 3mm;
    padding: 0;
    border: 0;
    break-inside: avoid;
  }
  .sticker-sheet + .sticker-sheet { break-before: page; }
  .sticker-cell { width: 35mm; height: 34mm; padding: 1mm 0; border: .2mm dashed #9da8a3; break-inside: avoid; }
  .sticker { width: 31mm; background: #fff; margin: 0 auto; text-align: center; }
  .sticker .qr-art { width: 28mm; margin: 0 auto; }
  .sticker-number { font: 600 7pt/1.15 "IBM Plex Mono", monospace; color: #000; }
  .qr-art { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
