:root {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  color: #242b30; background: #fff; font-synthesis: none; letter-spacing: 0;
  line-height: 1.5; color-scheme: light; scroll-padding-bottom: 140px;
  --ink: #242b30; --muted: #778087; --line: #e4e8eb; --accent: #167668;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a, input, select, summary, textarea { -webkit-tap-highlight-color: transparent; }
button, select, input[type=file], summary { touch-action: manipulation; }
button, a, input, select, textarea { outline-offset: 3px; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); }
button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 11px 18px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; }
button:hover { background: #116556; }
button:disabled { opacity: .45; cursor: default; }
a { color: inherit; text-decoration: none; }
.secondary { color: #485158; background: #fff; border-color: #dfe4e7; }
.secondary:hover { background: #f3f5f6; }
.subtle { border-color: transparent; color: #677079; background: transparent; }
.subtle:hover { background: #f1f4f5; color: #242b30; }
.danger { background: #b44242; border-color: #b44242; }
.danger:hover { background: #983737; }
.danger-icon:hover { color: #b44242; background: #fdf0ee; }
.icon { display: inline-block; width: 20px; height: 20px; flex-shrink: 0; }
.icon-button { width: 44px; height: 44px; min-height: 44px; flex-shrink: 0; padding: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.site-header { border-bottom: 1px solid var(--line); padding: 0 24px; }
.header-inner { max-width: 1040px; height: 72px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 48px; font-size: 15px; font-weight: 800; }
.brand strong { font-weight: 500; color: #778087; }
.brand img { object-fit: contain; border-radius: 5px; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.back-link { display: flex; align-items: center; gap: 6px; min-height: 44px; color: #737d83; font-size: 13px; }
.back-link .icon { width: 16px; height: 16px; }
.back-link:hover { color: var(--accent); }
main { max-width: 940px; margin: 0 auto; padding: 38px 28px 80px; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.eyebrow { display: flex; gap: 9px; align-items: center; margin: 0 0 8px; font-size: 12px; color: #899197; font-weight: 600; }
.eyebrow > span:first-child { color: #69737b; }
.eyebrow-divider { width: 1px; height: 10px; background: #d7dcdf; }
h1 { font-size: 27px; font-weight: 800; line-height: 1.35; margin: 0; }
h2 { font-size: 17px; margin: 0; font-weight: 800; }
.intake-status { display: flex; align-items: center; gap: 6px; color: #31806d; font-size: 12px; font-weight: 700; white-space: nowrap; }
.intake-status > span { width: 6px; height: 6px; border-radius: 50%; background: #3da482; }
.privacy-line { display: flex; align-items: center; gap: 7px; color: #5c6870; font-size: 12px; margin-top: 14px; }
.privacy-line .icon { width: 14px; height: 14px; color: #7d8b92; }
.privacy-detail { border-left: 1px solid #dce1e4; margin-left: 3px; padding-left: 10px; color: #737d85; }
#message { padding: 12px 14px; border-radius: 5px; font-size: 13px; line-height: 1.6; background: #eff8f4; color: #206d56; margin: 20px 0 0; overflow-wrap: anywhere; }
#message:empty, #submitMessage:empty { display: none; }
#message.error { background: #fff0ee; color: #aa4141; }
#submitMessage.error, #deleteMessage, #loginMessage { color: #aa4141; }
#loadRetry { margin-top: 12px; }
#formPanel { margin-top: 28px; border-top: 1px solid var(--line); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-group { padding: 26px 0; border-bottom: 1px solid var(--line); }
.group-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.group-heading > div { display: flex; align-items: center; gap: 10px; }
.group-number { font-size: 11px; font-weight: 800; color: var(--accent); padding: 3px 5px; border-radius: 3px; background: #edf6f2; font-variant-numeric: tabular-nums; }
.group-meta { color: #727c84; font-size: 11px; font-weight: 600; }
label { display: block; min-width: 0; color: #58646e; font-size: 13px; font-weight: 700; }
input, select, textarea { display: block; width: 100%; min-width: 0; min-height: 50px; border: 1px solid #e2e6e9; border-radius: 6px; padding: 12px; margin-top: 8px; font-size: 16px; color: var(--ink); background: #f7f8f9; scroll-margin: 24px 0 140px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #7bb8aa; outline-offset: 1px; background: #fff; }
input::placeholder { color: #bcc2c6; }
select { padding-right: 24px; font-size: 15px; font-weight: 650; }
.fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.player-field label + label { margin-top: 14px; }
.percent-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.percent { position: relative; }
.percent input { padding: 11px 36px 11px 14px; font-size: 23px; line-height: 1.2; font-weight: 750; font-variant-numeric: tabular-nums; min-height: 60px; }
.percent span { position: absolute; top: 18px; right: 14px; color: #8d969d; font-weight: 500; font-size: 16px; }
.difference-line { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; color: #737e85; font-size: 12px; }
#percentDifference { color: #c16a45; font-weight: 750; font-size: 16px; min-height: 24px; font-variant-numeric: tabular-nums; }
.photos { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.photo-field { min-width: 0; }
.required { color: #b77563; }
.photo-input { position: relative; display: grid; place-items: center; aspect-ratio: 1.75; margin-top: 10px; border: 1px dashed #cfd7dc; border-radius: 6px; background: #f8fafb; overflow: hidden; }
.photo-input:hover { background: #f0f6f4; border-color: #91afa3; }
.photo-input:focus-within { outline: 2px solid #7bb8aa; outline-offset: 2px; }
.photo-input input { cursor: pointer; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; padding: 0; z-index: 2; }
.upload-placeholder { display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; color: #727e85; font-size: 13px; pointer-events: none; }
.upload-placeholder .icon { width: 26px; height: 26px; color: #a3afb6; }
.selected-photo { position: absolute; inset: 6px; }
.selected-photo img { width: 100%; height: 100%; object-fit: contain; }
.has-photo .photo-input { border-style: solid; border-color: #a2c9bc; background: #f5f8f6; }
.photo-details { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 40px; padding-top: 4px; }
.file-name { color: #737e85; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.has-photo .file-name { color: #4d7e6d; }
.photo-remove { width: 36px; height: 36px; min-height: 36px; }
.photo-remove .icon { width: 16px; height: 16px; }
.note { border-bottom: 1px solid var(--line); padding: 0; }
.note summary { display: flex; align-items: center; justify-content: space-between; min-height: 64px; cursor: pointer; list-style: none; color: #59646b; font-size: 13px; font-weight: 650; }
.note summary::-webkit-details-marker { display: none; }
.note summary > span { display: flex; align-items: center; gap: 8px; }
.note summary .icon { width: 17px; height: 17px; color: #8b979e; }
.optional { color: #7b848b; font-size: 11px; font-weight: 400; }
.note-chevron { transition: transform .15s ease; }
.note[open] .note-chevron { transform: rotate(180deg); }
textarea { resize: vertical; min-height: 110px; margin: 0 0 20px; line-height: 1.6; }
.form-end { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 24px; }
.form-end > div { min-width: 0; }
#photoCount { font-size: 13px; font-weight: 700; color: #737e85; }
#photoCount.complete { color: var(--accent); }
#submitMessage { font-size: 12px; color: #737d83; margin: 4px 0 0; overflow-wrap: anywhere; }
#submit { min-width: 190px; min-height: 52px; }
#submit .icon { width: 18px; height: 18px; }
.view-tabs, .photo-switch { display: flex; border-bottom: 1px solid var(--line); }
.view-tabs { margin: 24px 0 0; }
.view-tabs button, .photo-switch button { flex: 1; border: 0; border-radius: 0; background: transparent; color: #9ba3a9; border-bottom: 2px solid transparent; font-size: 14px; }
.view-tabs button[aria-selected=true], .photo-switch button[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }
.view-tabs:not([hidden]) + #formPanel { border-top: 0; margin-top: 0; }
#reviewPanel section { padding-top: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-heading h2 { display: flex; align-items: center; gap: 8px; }
.count-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; font-size: 12px; color: #6b7e75; background: #edf4ef; border-radius: 4px; }
.review-controls { margin: 20px 0 0; }
.search-field { display: flex; align-items: center; position: relative; }
.search-field > .icon { position: absolute; left: 14px; color: #929da4; width: 18px; height: 18px; }
.search-field input { padding-left: 42px; margin: 0; background: #f6f8f9; }
.status-filter { display: flex; gap: 4px; padding: 4px; background: #f2f4f5; border-radius: 6px; margin-top: 12px; }
.status-filter button { flex: 1; background: transparent; color: #68767e; border: 0; min-height: 40px; padding: 8px; font-size: 12px; }
.status-filter button[aria-pressed=true] { color: #394d44; background: #fff; box-shadow: 0 1px 3px #253c2c0d; }
.report { display: grid; grid-template-columns: minmax(0,1fr) 240px; align-items: start; gap: 24px; border-bottom: 1px solid var(--line); padding: 28px 0; }
.report-body { min-width: 0; }
.report-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.report h3 { font-size: 17px; font-weight: 800; margin: 0; overflow-wrap: anywhere; }
.report-subtitle { color: #737f86; font-size: 12px; margin: 5px 0 0; overflow-wrap: anywhere; }
.report-actions { display: flex; gap: 8px; align-items: center; }
.report-actions .icon-button { width: 32px; height: 32px; min-height: 32px; }
.report-actions .icon { width: 16px; height: 16px; }
.status { display: inline-flex; align-items: center; white-space: nowrap; font-size: 11px; color: #43876c; background: #eef7f1; padding: 4px 7px; border-radius: 4px; }
.status.pending { color: #a07937; background: #fbf4e7; }
.report-numbers { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 20px 0 0; gap: 10px; }
.report-numbers > div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.report-numbers dt { font-size: 11px; color: #737f86; }
.report-numbers dd { margin: 4px 0 0; font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.report-numbers .overage dd { color: #bc704f; }
.review-detail, .report-note { font-size: 12px; color: #7a858b; margin: 15px 0 0; overflow-wrap: anywhere; }
.report-note { line-height: 1.7; }
.report-photos { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; min-width: 0; }
.report-photos button { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 0; border: 0; background: transparent; color: #74838c; min-width: 0; }
.report-photos img { width: 100%; height: 125px; border: 1px solid #e0e5e7; border-radius: 5px; object-fit: contain; background: #f7f9fa; }
.photo-caption { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 11px; }
.photo-caption .icon { width: 14px; height: 14px; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 56px 16px; color: #a1abae; font-size: 13px; }
.empty > .icon { width: 28px; height: 28px; color: #bec9c9; }
.empty p { margin: 0; }
#adminArchives { margin-top: 24px; border-top: 1px solid var(--line); }
.archive-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
.archive-heading label { width: 100%; }
dialog { width: min(420px,calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 28px; border: 1px solid var(--line); border-radius: 8px; overflow: auto; color: var(--ink); }
dialog h2 { margin: 0 0 24px; font-size: 20px; }
dialog::backdrop { background: #1e293b80; }
.dialog-actions { display: flex; gap: 10px; margin-top: 24px; }
.dialog-actions button { flex: 1; }
.photo-dialog { width: min(100%,1100px); max-width: 100%; height: 92dvh; padding: 0; overflow: hidden; }
.photo-dialog[open] { display: grid; grid-template-rows: auto auto minmax(0,1fr); }
.photo-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: #fff; }
.photo-toolbar h2 { font-size: 15px; margin: 0; overflow-wrap: anywhere; }
.photo-toolbar > div { display: flex; gap: 8px; flex-shrink: 0; }
.photo-switch { background: #fff; }
.photo-canvas { background: #edf0f2; overflow: auto; padding: 16px; overscroll-behavior: contain; }
.photo-canvas img { display: block; width: 100%; max-width: 100%; height: auto; margin: auto; }
.photo-canvas.zoomed img { width: 200%; max-width: none; }
#photoMessage { text-align: center; color: #8a949b; font-size: 13px; }
@media (max-width: 680px) {
  .site-header { padding: 0 18px; }
  .header-inner { height: 62px; gap: 8px; }
  .brand { font-size: 13px; gap: 8px; }
  .brand img { width: 28px; height: 28px; }
  .header-actions { gap: 10px; }
  .back-link { font-size: 12px; }
  .back-link .icon { display: none; }
  main { padding: 26px 20px calc(118px + env(safe-area-inset-bottom)); }
  h1 { font-size: 23px; }
  .eyebrow { font-size: 11px; margin-bottom: 6px; }
  .intake-status { font-size: 11px; }
  .privacy-line { margin-top: 12px; font-size: 11px; }
  #formPanel { margin-top: 24px; }
  .form-group { padding: 22px 0; }
  .group-heading { margin-bottom: 16px; }
  .group-heading h2 { font-size: 16px; }
  .fields { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  .player-field { grid-column: 1 / -1; }
  select { font-size: 14px; min-height: 50px; padding: 12px 8px; }
  .percent-pair { gap: 12px; }
  .percent input { font-size: 23px; }
  .photos { gap: 14px; }
  .photo-input { aspect-ratio: 1.2; }
  .photo-field > label { font-size: 12px; }
  .upload-placeholder { gap: 8px; font-size: 12px; }
  .photo-details { gap: 4px; }
  .photo-remove { min-height: 40px; width: 40px; }
  .form-end { position: fixed; z-index: 5; inset: auto 0 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: #fffffffa; border-top: 1px solid var(--line); min-height: 80px; gap: 16px; }
  #submit { min-width: 160px; width: 49%; min-height: 50px; padding: 12px 14px; }
  #submitMessage { font-size: 11px; line-height: 1.5; }
  #photoCount { font-size: 12px; }
  .review-controls { margin-top: 16px; }
  .report { grid-template-columns: minmax(0,1fr); gap: 18px; padding: 24px 0; }
  .report h3 { font-size: 17px; }
  .report-actions .icon-button { min-height: 44px; width: 40px; }
  .report-photos img { height: 160px; }
  .photo-caption { font-size: 12px; }
  .photo-dialog { position: fixed; inset: 0; margin: 0; width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .photo-toolbar { padding: max(8px,env(safe-area-inset-top)) 12px 8px; }
  .photo-canvas { padding: 12px 12px max(12px,env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .site-header { padding: 0 14px; }
  .brand strong { display: none; }
  main { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 21px; }
  .form-end { padding-left: 16px; padding-right: 16px; }
  #submit { min-width: 142px; font-size: 14px; }
  .photos { gap: 12px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .photo-toolbar { padding: 4px 12px; }
  .photo-switch button { min-height: 40px; padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) { .note-chevron { transition: none; } }
