:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #203746;
  background: #f3f7f8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: #08687b; }
:focus-visible { outline: 3px solid #d48a21; outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -5rem; left: 1rem; z-index: 5; padding: .6rem 1rem; background: #fff; }
.skip-link:focus { top: .5rem; }
.site-header { background: #173747; color: #fff; }
.site-header-inner { max-width: 1040px; min-height: 64px; margin: auto; padding: .65rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; font-size: 1.02rem; white-space: nowrap; }
.brand strong { font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; background: #30b0aa; color: #12313d; font-weight: 800; }
.header-link { color: #fff; font-weight: 600; text-underline-offset: 3px; }
.shell { max-width: 1040px; margin: auto; padding: 1.3rem 1rem calc(2rem + env(safe-area-inset-bottom)); }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.eyebrow { margin: 0 0 .25rem; color: #136a78; font-size: .82rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; color: #153240; font-size: clamp(1.65rem, 4vw, 2.25rem); line-height: 1.2; }
.lede { max-width: 680px; margin: .55rem 0 0; color: #4a6070; }
.account { max-width: 270px; color: #4a6070; font-size: .88rem; text-align: right; }
.panel { margin: 0 0 1rem; padding: 1.25rem; background: #fff; border: 1px solid #d6e0e4; border-radius: 14px; box-shadow: 0 2px 10px #1837460a; }
.step-heading { display: flex; align-items: flex-start; gap: .8rem; margin-bottom: 1.1rem; }
.step-heading h2 { margin: 0; font-size: 1.22rem; line-height: 1.3; color: #173747; }
.step-heading p { margin: .2rem 0 0; color: #526777; }
.step-number { flex: none; display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 .3rem; background: #e0f2f0; color: #126a6b; border-radius: 9px; font-weight: 800; }
.step-number-file { min-width: 42px; font-size: .75rem; }
.step-number-check { background: #e9f1e0; color: #466720; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .65rem 1rem; border-radius: 9px; font-weight: 700; text-align: center; border: 1px solid transparent; text-decoration: none; }
.button-primary { background: #087884; border-color: #087884; color: #fff; }
.button-primary:not(:disabled):hover { background: #08616c; }
.button-secondary { background: #fff; border-color: #8fa9b2; color: #1d5362; }
.button-secondary:not(:disabled):hover { background: #edf6f6; }
.text-button { border: 0; background: transparent; color: #08687b; text-decoration: underline; font-weight: 650; padding: .35rem; }
.photo-actions, .process-row, .pdf-actions, .confirm-row { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.help { margin: .7rem 0 0; color: #526777; font-size: .9rem; }
.empty-state { margin-top: 1rem; padding: 1.2rem; border: 1px dashed #b8c9d0; border-radius: 9px; color: #526777; text-align: center; }
.photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; padding: 0; margin: 1rem 0; list-style: none; }
.photo-card { overflow: hidden; border: 1px solid #d6e0e4; border-radius: 9px; background: #f8fbfb; }
.photo-card img { width: 100%; height: 145px; display: block; object-fit: contain; background: #e8eff1; }
.photo-card-body { padding: .65rem; }
.photo-name { display: block; font-weight: 650; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-size, .photo-status { display: block; color: #526777; font-size: .8rem; }
.photo-card .text-button { margin: .15rem 0 0 -.35rem; }
.photo-bottom { display: flex; justify-content: space-between; align-items: center; color: #526777; font-size: .9rem; }
.field-label { display: block; font-weight: 700; margin-bottom: .4rem; }
textarea, .contact-field input, .conflict-choice select { width: 100%; padding: .7rem .75rem; border: 1px solid #9eb4be; border-radius: 8px; color: #203746; background: #fff; }
textarea { resize: vertical; min-height: 105px; }
.process-row { margin-top: 1rem; }
.progress-text { color: #345866; font-size: .9rem; }
.alert { margin: 0 0 1rem; padding: .85rem 1rem; border: 1px solid #d89a8b; border-left: 5px solid #a63b2c; background: #fff5f2; border-radius: 8px; color: #772719; }
.result-summary { padding: .8rem 1rem; border-radius: 9px; background: #eff8f7; border: 1px solid #c5e1dd; }
.result-summary p { margin: 0; }
.other-result { margin-top: .8rem; padding: .9rem 1rem; background: #f8fbfb; border: 1px solid #cbdde0; border-radius: 9px; }
.other-result h3 { margin: 0 0 .35rem; font-size: 1rem; }
.other-result > p { margin: 0; white-space: pre-wrap; }
.other-result > .help { margin-top: .7rem; }
.warning-list { margin: 1rem 0; padding: .8rem 1rem .8rem 2rem; border-radius: 9px; background: #fff9e9; color: #594513; }
.ocr-details { margin-top: 1rem; color: #2a5967; }
.ocr-details summary { cursor: pointer; font-weight: 650; }
.ocr-pages { max-height: 320px; overflow: auto; margin-top: .5rem; padding: .8rem; white-space: pre-wrap; background: #f8fbfb; border: 1px solid #d6e0e4; border-radius: 8px; color: #203746; font-size: .86rem; }
.ocr-page + .ocr-page { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #d6e0e4; }
.ocr-page h4 { margin: 0 0 .35rem; font-size: .86rem; }
.ocr-page p { margin: 0; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: 1.3rem 0 .7rem; }
.section-title-row h3 { margin: 0; font-size: 1.07rem; }
.count-pill { padding: .25rem .65rem; border-radius: 999px; background: #e6f2f1; color: #1b6870; font-size: .85rem; font-weight: 700; }
.contact-list, .conflict-list, .new-row-list { display: grid; gap: .8rem; }
.contact-card, .conflict-card, .new-row-card { padding: 1rem; border: 1px solid #cfdee1; border-radius: 10px; }
.contact-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; margin-bottom: .75rem; }
.contact-card-header h4 { margin: 0; font-size: 1rem; }
.contact-card-header p { margin: .12rem 0 0; color: #526777; font-size: .87rem; }
.contact-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.contact-field { display: block; min-width: 0; }
.contact-field span { display: block; margin-bottom: .25rem; color: #3d5360; font-weight: 650; font-size: .86rem; }
.contact-field input { min-height: 44px; }
.contact-extra { margin-top: .8rem; }
.contact-extra summary { color: #08687b; cursor: pointer; font-weight: 650; }
.contact-extra .contact-fields { margin-top: .7rem; }
.review-actions { margin-top: 1rem; }
.review-actions .help { margin-top: .4rem; }
.notice { padding: .8rem 1rem; border-radius: 8px; background: #f1f5f6; color: #3c5663; }
.count-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin-bottom: 1rem; }
.count-item { padding: .7rem .8rem; border: 1px solid #d6e0e4; border-radius: 8px; background: #f8fbfb; }
.count-item strong { display: block; color: #173747; font-size: 1.25rem; }
.count-item span { color: #526777; font-size: .82rem; }
.conflict-card h3 { margin: 0 0 .3rem; font-size: 1rem; }
.new-row-list { margin-bottom: .8rem; }
.new-row-card h3 { margin: 0 0 .3rem; font-size: 1rem; }
.new-row-card p { margin: .25rem 0 .7rem; color: #526777; }
.new-row-card details { margin: .7rem 0; padding: .6rem; border-radius: 7px; background: #fff9e9; }
.new-row-card details summary { cursor: pointer; font-weight: 700; color: #6c5117; }
.conflict-card p { margin: .25rem 0 .7rem; color: #526777; }
.conflict-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin: .7rem 0; }
.conflict-version { min-width: 0; padding: .65rem; background: #f7fafb; border-radius: 7px; font-size: .87rem; overflow-wrap: anywhere; }
.conflict-version strong { display: block; margin-bottom: .25rem; }
.conflict-version dl { margin: 0; }
.conflict-version dt { font-weight: 650; }
.conflict-version dd { margin: 0 0 .25rem; }
.conflict-choice { display: block; margin: .45rem 0; font-weight: 600; }
.conflict-choice input { width: 19px; height: 19px; vertical-align: middle; margin: 0 .45rem 0 0; }
.conflict-target { margin-top: .5rem; }
.conflict-target label { display: block; margin-bottom: .2rem; font-weight: 650; }
.confirm-row { margin-top: 1rem; }
.pdf-panel { margin-top: 1rem; }
@media (max-width: 620px) {
  .shell { padding: 1rem .7rem calc(1.5rem + env(safe-area-inset-bottom)); }
  .page-heading { display: block; }
  .account { max-width: none; margin-top: .6rem; text-align: left; }
  .panel { padding: 1rem .85rem; }
  .photo-actions .button { flex: 1 1 135px; }
  .photo-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-card img { height: 120px; }
  .contact-fields, .conflict-comparison { grid-template-columns: 1fr; }
  .count-grid { gap: .35rem; }
  .count-item { padding: .55rem; }
  .count-item strong { font-size: 1.1rem; }
  .count-item span { font-size: .75rem; }
  .process-row .button, .review-actions .button { width: 100%; }
}
@media (max-width: 360px) {
  .photo-list { grid-template-columns: 1fr; }
  .confirm-row .button, .pdf-actions .button { width: 100%; }
}
