:root { color-scheme: light; font-family: ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #f7f6f1; color: #19231f; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button { font: inherit; touch-action: manipulation; cursor: pointer; transition: transform 80ms ease, filter 80ms ease, background-color 80ms ease, border-color 80ms ease, box-shadow 80ms ease; }
button:not(:disabled):active { transform: scale(.965); filter: brightness(.93); }
button:focus-visible { outline: 3px solid #6cbf99; outline-offset: 2px; }
button:disabled { cursor: not-allowed; }
#app { max-width: 720px; margin: 0 auto; min-height: 100dvh; padding: env(safe-area-inset-top) 16px calc(28px + env(safe-area-inset-bottom)); }
.header { padding: 20px 4px 16px; }
.eyebrow { color: #5b695f; font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, p { margin: 0; }
h1 { font-size: 1.7rem; margin-top: 3px; }
h2 { font-size: 1.2rem; }
.subtle { margin-top: 6px; color: #5d665f; }
.target-card, .score-card, .notice { background: white; border: 1px solid #e1e4dc; border-radius: 16px; box-shadow: 0 2px 6px #18301b0c; }
.ianseo-import { margin-top: 12px; }
.ianseo-import-row { display: grid; grid-template-columns: minmax(0, 240px) max-content; align-items: end; gap: 8px; }
.ianseo-import-row .field { min-width: 0; margin: 0; }
.ianseo-import .subtle { margin: 8px 0 0; font-size: .86rem; }
@media (max-width: 460px) { .ianseo-import-row { grid-template-columns: 1fr; } .ianseo-import-row button { width: 100%; } }
.progress-panel { margin: 0 0 18px; padding: 15px; border: 1px solid #cadacc; border-radius: 16px; background: white; box-shadow: 0 2px 6px #18301b0c; }
.progress-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.progress-head p { margin-top: 4px; color: #526458; font-size: .84rem; }
.progress-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.progress-grid div { min-height: 61px; padding: 8px; border-radius: 9px; background: #f1f6f0; text-align: center; }
.progress-grid strong, .progress-grid span { display: block; }
.progress-grid strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.progress-grid span { color: #526458; font-size: .72rem; font-weight: 700; }
.progress-grid .attention { background: #fde9e6; color: #9a3026; }
.special-ranking { margin: 0 0 18px; padding: 16px; border: 1px solid #cadacc; border-radius: 16px; background: #f5f8f4; box-shadow: 0 2px 6px #18301b0c; }
.special-ranking-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.special-ranking-head h2 { margin-top: 3px; }
.special-ranking-head p { margin-top: 5px; color: #526458; font-size: .84rem; }
.ranking-settings { margin: 14px 0; padding: 10px 12px; border: 1px solid #cadacc; border-radius: 10px; background: white; }
.ranking-settings summary { cursor: pointer; color: #145c43; font-weight: 800; }
.ranking-settings p { margin: 9px 0; color: #526458; font-size: .82rem; }
.factor-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; margin: 10px 0; }
.factor-fields label { display: grid; gap: 4px; color: #405046; font-size: .78rem; font-weight: 800; }
.factor-fields input { min-width: 0; min-height: 38px; padding: 6px 8px; border: 1px solid #b9c7bb; border-radius: 8px; background: white; font: inherit; }
.ranking-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: end; margin: 12px 0; }
.ranking-view, .ranking-export-format { display: grid; gap: 4px; color: #405046; font-size: .78rem; font-weight: 800; }
.ranking-view select, .ranking-export-format select { min-height: 40px; padding: 6px 8px; border: 1px solid #b9c7bb; border-radius: 8px; background: white; color: #19231f; font: inherit; }
.ranking-actions > button { grid-column: 1 / -1; }
@media (min-width: 620px) { .ranking-actions { grid-template-columns: minmax(180px, 1fr) minmax(120px, .45fr) auto; } .ranking-actions > button { grid-column: auto; } }
.ranking-table-wrap { overflow-x: auto; border: 1px solid #dce5db; border-radius: 9px; background: white; }
.ranking-table { width: 100%; min-width: 570px; border-collapse: collapse; font-size: .8rem; }
.ranking-table th, .ranking-table td { padding: 8px 7px; border-bottom: 1px solid #e5ebe4; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ranking-table th { background: #e9f0e9; color: #526458; font-size: .68rem; letter-spacing: .02em; text-transform: uppercase; }
.ranking-table th:nth-child(2), .ranking-table th:nth-child(3), .ranking-table td:nth-child(2), .ranking-table td:nth-child(3) { text-align: left; }
.ranking-table tbody tr:last-child td { border-bottom: 0; }
.ranking-group { margin-top: 16px; }
.ranking-group h3 { margin: 0 0 7px; color: #254b38; font-size: .98rem; }
.audit-log { border-top: 1px solid #e1e8df; padding-top: 10px; }
.audit-log summary { cursor: pointer; color: #145c43; font-size: .86rem; font-weight: 800; }
.audit-entry { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; padding: 9px 0; border-bottom: 1px solid #edf0eb; font-size: .8rem; }
.audit-entry strong { color: #5d665f; text-transform: uppercase; font-size: .68rem; letter-spacing: .03em; }
.audit-entry.submitted strong { color: #166139; }
.audit-entry.failed strong { color: #a52718; }
.audit-entry p, .audit-entry small { grid-column: 1 / -1; margin: 0; color: #4d594f; }
.capture-panel { background: #e9f0e9; border: 1px solid #cadacc; border-radius: 16px; padding: 16px; margin-bottom: 18px; }
.capture-panel p { color: #526458; margin: 6px 0 14px; font-size: .9rem; }
.capture-panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.capture-panel-head h2 { margin-bottom: 0; }
.ocr-quality { margin: 12px 0 !important; padding: 9px 10px; border: 1px solid #d5dfd2; border-radius: 9px; background: #f8fbf7; color: #526458; font-size: .82rem !important; }
.ocr-quality.target-met { border-color: #90c59d; background: #e7f5e9; color: #155f37; font-weight: 700; }
.upload { display: block; text-align: center; cursor: pointer; }
.upload input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.capture-list { display: grid; gap: 10px; margin-top: 14px; }
.capture-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.capture-pagination button { min-width: 36px; min-height: 36px; padding: 4px 8px; border: 1px solid #9eb9aa; border-radius: 8px; background: white; color: #154c38; font-weight: 800; }
.capture-pagination button.current { border-color: #16885d; background: #16885d; color: white; }
.capture-pagination span { display: grid; min-width: 18px; place-items: center; color: #607064; font-weight: 800; }
.capture { background: white; border-radius: 10px; padding: 8px; display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: center; }
.capture img { width: 76px; height: 76px; object-fit: cover; border-radius: 6px; background: #dce3dc; }
.capture-content { min-width: 0; display: flex; align-items: center; gap: 12px; }
.capture-copy { min-width: 0; flex: 1; }
.capture p { margin: 4px 0 8px; font-size: .8rem; }
.capture-label { display: block; color: #166139; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ocr-count { color: #155c42 !important; font-weight: 800; }
.capture-assignment { display: block; color: #166139; font-size: .74rem; font-weight: 700; }
.capture-actions { display: grid; gap: 6px; margin-left: auto; flex: 0 0 auto; }
.compact { padding: 7px 11px; font-size: .82rem; }
.capture-delete { justify-self: end; padding: 2px 0; border: 0; background: transparent; color: #9a3026; font-size: .74rem; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.capture.review { border-left: 4px solid #dfbd5d; background: #fffaf0; }
.capture.checked { border-left: 4px solid #77bc89; background: #f2faf3; }
.capture.failed { border-left: 4px solid #dc887d; }
.capture.pending { border-left: 4px solid #9eb9aa; }
.capture-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.capture-filters label { display: grid; gap: 4px; color: #405046; font-size: .72rem; font-weight: 800; }
.capture-filters select { min-width: 0; min-height: 36px; border: 1px solid #b9c7bb; border-radius: 8px; background: white; color: #19231f; font: inherit; }
.capture-empty { margin: 14px 0 0 !important; color: #526458; font-size: .88rem !important; }
.sync-all-panel { display: grid; gap: 12px; margin: 18px 0; padding: 16px; border: 1px solid #cadacc; border-radius: 16px; background: #f3f7f1; }
.sync-all-panel h2 { margin-top: 3px; }
.sync-all-panel p { margin: 6px 0 0; color: #526458; font-size: .88rem; }
.sync-all-panel ul { margin: 10px 0 0; padding-left: 20px; color: #8a5a13; font-size: .88rem; }
.sync-all-panel .primary { width: 100%; }
.target-card { margin: 12px 0; overflow: hidden; }
.target-title { display: flex; justify-content: space-between; align-items: center; background: #e9f0e9; padding: 12px 14px; }
.target-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 10px 14px; border-bottom: 1px solid #edf0eb; background: #f8faf7; }
.target-tab { flex: 0 0 auto; min-width: 42px; min-height: 38px; padding: 6px 10px; border: 1px solid #a7c0ae; border-radius: 8px; background: white; color: #154c38; font-weight: 800; }
.target-tab.active { border-color: #16885d; background: #16885d; color: white; box-shadow: 0 1px 2px #18301b20; }
.target-detail-title { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px 7px; color: #405046; font-size: .9rem; }
.target-detail-title strong { color: #19231f; }
.archer { width: 100%; padding: 14px; border: 0; border-top: 1px solid #edf0eb; background: white; text-align: left; display: flex; gap: 12px; align-items: center; }
.archer:active { background: #f3f7f1; }
.position { flex: 0 0 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #123c30; color: white; font-weight: 800; }
.archer-info { flex: 1; min-width: 0; }
.archer-name { font-weight: 750; }
.archer-meta { margin-left: 5px; color: #5d665f; font-size: .87rem; }
.archer-club { display: block; margin-top: 3px; color: #5d665f; font-size: .8rem; }
.score-summary { text-align: right; font-variant-numeric: tabular-nums; }
.score-line { display: flex; justify-content: flex-end; align-items: baseline; gap: 3px; }
.score-summary strong { font-size: 1.12rem; }
.score-line span { font-size: .82rem; }
.badge { display: inline-block; font-size: .7rem; border-radius: 99px; padding: 3px 7px; margin-top: 3px; background: #edf0eb; color: #4e5b51; }
.badge.draft { background: #fff0c5; color: #785614; }
.badge.released { background: #d8eedf; color: #166139; }
.badge.submitted { background: #d8eedf; color: #166139; }
.back { border: 0; padding: 7px 0; background: transparent; color: #145c43; font-weight: 700; }
.score-card { margin-top: 12px; padding: 16px; }
.score-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.score-total { font-size: 1.75rem; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.score-total small { display: block; color: #5d665f; font-size: .75rem; font-weight: 600; }
.score-source { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #cadacc; border-radius: 10px; background: #f5f8f4; }
.score-source summary { cursor: pointer; color: #145c43; font-weight: 800; }
.score-source img { display: block; width: 100%; max-height: 56dvh; object-fit: contain; object-position: top; margin: 10px 0 8px; border-radius: 7px; background: white; }
.score-source a { color: #145c43; font-size: .9rem; font-weight: 800; }
.score-revisions { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #cadacc; border-radius: 10px; background: #f7faf6; }
.score-revisions > summary { cursor: pointer; color: #145c43; font-weight: 800; }
.score-revision { padding: 10px 0; border-bottom: 1px solid #dfe8de; font-size: .82rem; }
.score-revision:last-child { border-bottom: 0; padding-bottom: 0; }
.score-revision > div { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.score-revision > div span, .score-revision p, .score-revision small { color: #56665c; }
.score-revision p { margin: 3px 0; font-variant-numeric: tabular-nums; }
.score-revision a { display: inline-block; margin: 4px 0; color: #145c43; font-weight: 800; }
.score-revision details { margin-top: 5px; }
.score-revision details summary { cursor: pointer; color: #405046; }
.score-revision samp { display: grid; gap: 4px; margin-top: 6px; overflow-wrap: anywhere; color: #405046; white-space: normal; font-size: .73rem; line-height: 1.35; }
.score-revision del { color: #815149; text-decoration-color: #dc887d; }
.score-revision ins { color: #166139; text-decoration-color: #77bc89; }
.score-grid { display: grid; gap: 7px; }
.end-row, .score-grid-header { display: grid; grid-template-columns: 40px repeat(3, 1fr) 44px; align-items: center; gap: 7px; }
.score-grid-header { color: #607064; font-size: .72rem; font-weight: 800; text-align: center; padding-bottom: 1px; }
.score-grid-header span:last-child { text-align: right; }
.end-number { color: #607064; font-size: .85rem; font-weight: 800; text-align: center; }
.arrow-cell { min-height: 42px; border: 2px solid #dbe2d9; border-radius: 9px; background: #fff; font-size: 1.05rem; font-weight: 800; }
.arrow-cell.selected { border-color: #16885d; box-shadow: 0 0 0 2px #bce6d3; }
.end-total { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 18px 0; }
.value { min-height: 46px; border: 0; border-radius: 10px; background: #123c30; color: white; font-weight: 800; }
.value:active { background: #0a241d; }
.actions { display: grid; gap: 9px; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 14px; border-radius: 11px; font-weight: 800; letter-spacing: .01em; box-shadow: 0 2px 3px #18301b1a; }
.primary { border: 1px solid #16885d; color: white; background: #16885d; }
.primary:not(:disabled):hover { border-color: #116b49; background: #116b49; box-shadow: 0 3px 6px #18301b2b; }
.primary:disabled { opacity: .45; box-shadow: none; }
.secondary { color: #124b36; border: 1px solid #78a993; background: #e7f3ec; }
.secondary:not(:disabled):hover { border-color: #3d8265; background: #d8ede1; box-shadow: 0 3px 6px #18301b20; }
.primary.compact, .secondary.compact { min-height: 40px; }
.primary.upload { display: flex; width: 100%; }
.notice { margin-top: 14px; padding: 12px; color: #4d594f; font-size: .9rem; }
.error { color: #a52718; }
.toast { position: sticky; bottom: 12px; padding: 12px; border-radius: 10px; background: #172820; color: white; margin-top: 12px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; color: #405046; font-weight: 700; }
.field input { width: 100%; min-height: 46px; padding: 8px 10px; border: 1px solid #b9c7bb; border-radius: 9px; background: white; font: inherit; }
.field select { width: 100%; min-height: 46px; padding: 8px 10px; border: 1px solid #b9c7bb; border-radius: 9px; background: white; font: inherit; color: #19231f; }
.ocr-warnings { margin: 0 0 16px; padding-left: 20px; color: #4d594f; font-size: .88rem; }
.ocr-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; font-size: .78rem; font-weight: 800; }
.suggestion-note { margin: 12px 0; padding: 9px 10px; border-radius: 9px; background: #e5f5e9; color: #155f37; font-size: .88rem; font-weight: 700; }
.ocr-legend span { padding: 4px 7px; border-radius: 99px; }
.ocr-legend .verified { background: #d9f0df; color: #166139; }
.ocr-legend .uncertain { background: #fff0c5; color: #785614; }
.ocr-legend .missing { background: #f8d9d5; color: #a52718; }
.ocr-legend .conflicted { background: #eee1f8; color: #63328b; }
.ocr-legend .manual { background: #dcecf9; color: #1d5682; }
.arrow-cell.verified { background: #e5f5e9; border-color: #77bc89; color: #155f37; }
.arrow-cell.uncertain { background: #fff7df; border-color: #dfbd5d; color: #74530b; }
.arrow-cell.missing { background: #fde9e6; border-color: #dc887d; color: #9a3026; }
.arrow-cell.conflicted { background: #f2e8fb; border-color: #a67acb; color: #63328b; }
.arrow-cell.manual { background: #e5f1fb; border-color: #7cacd6; color: #1d5682; }
.arrow-cell.selected { border-color: #16885d; box-shadow: 0 0 0 2px #bce6d3; }
.end-total.verified { color: #166139; }
.end-total.uncertain { color: #785614; }
.end-total small { display: block; font-size: .68rem; font-weight: 700; }
.keyboard-help { margin: 12px 0 0; color: #56665c; font-size: .78rem; line-height: 1.35; }
.keyboard-help kbd { display: inline-block; min-width: 1.25em; padding: 0 .3em; border: 1px solid #b9c7bb; border-bottom-width: 2px; border-radius: 4px; background: white; color: #234234; font: 700 .9em ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; }
.ocr-review-layout { display: grid; gap: 12px; margin-top: 12px; }
.ocr-source { background: #e9f0e9; border: 1px solid #cadacc; border-radius: 16px; padding: 12px; }
.ocr-source img { display: block; width: 100%; max-height: 54dvh; margin: 8px 0; object-fit: contain; object-position: top; border-radius: 8px; background: white; }
.ocr-source a { color: #145c43; font-weight: 800; font-size: .9rem; }
@media (min-width: 620px) {
  .ocr-review-layout { grid-template-columns: minmax(200px, .8fr) minmax(0, 1.2fr); align-items: start; }
  .ocr-source { position: sticky; top: 12px; }
  .ocr-source img { max-height: calc(100dvh - 130px); }
  .ocr-review-layout .score-card { margin-top: 0; }
}
@media (min-width: 520px) { .palette { grid-template-columns: repeat(12, 1fr); } }
