:root {
  --blue: #1769e0;
  --blue-dark: #0e4fae;
  --ink: #111827;
  --muted: #5b6472;
  --surface: #ffffff;
  --background: #f3f6fa;
  --border: #263244;
  --danger: #b42318;
  font-size: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
  font-family: Arial, "Noto Sans KR", sans-serif;
}

button, input, a { font: inherit; }
button, label, a { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(100% - 28px, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 48px;
}

.app-header { margin-bottom: 28px; }
.brand { margin: 0 0 14px; font-size: 1.2rem; font-weight: 800; }
.progress { height: 14px; overflow: hidden; border-radius: 999px; background: #d9e1ec; }
.progress-bar { width: 20%; height: 100%; border-radius: inherit; background: var(--blue); transition: width .2s ease; }
.step-label { margin: 10px 0 0; font-size: 1.1rem; font-weight: 800; }

.screen { display: none; }
.screen.active { display: block; }

h1 {
  margin: 0 0 28px;
  font-size: clamp(2rem, 7vw, 2.8rem);
  line-height: 1.3;
  letter-spacing: -0.03em;
  word-break: keep-all;
}

.large-input {
  width: 100%;
  min-height: 82px;
  padding: 18px 20px;
  border: 4px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 700;
}
.large-input:focus { outline: 5px solid rgba(23,105,224,.22); border-color: var(--blue); }
.help-text { margin: 14px 0 0; color: var(--muted); font-size: 1.1rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 15px 20px;
  border: 4px solid var(--border);
  border-radius: 18px;
  text-decoration: none;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 900;
  cursor: pointer;
}
.button:focus-visible { outline: 6px solid rgba(23,105,224,.25); outline-offset: 3px; }
.button.primary { border-color: var(--blue); background: var(--blue); color: white; }
.button.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button.secondary { background: white; color: var(--ink); }
.button:disabled { cursor: not-allowed; border-color: #aeb7c3; background: #d7dde5; color: #5d6570; }
.button.compact { min-height: 58px; padding: 10px 16px; font-size: 1.05rem; }
.button.full, .single-action .button { width: 100%; }
.single-action { margin-top: 34px; }

.bottom-actions { display: grid; grid-template-columns: 1fr 1.8fr; gap: 14px; margin-top: 30px; }

.job-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.job-card {
  position: relative;
  min-height: 248px;
  padding: 14px;
  border: 4px solid var(--border);
  border-radius: 22px;
  background: white;
  color: var(--ink);
  cursor: pointer;
}
.job-card img { width: 100%; height: 155px; object-fit: contain; border-radius: 14px; background: #f3f6fa; }
.job-card strong { display: block; margin-top: 12px; font-size: 1.45rem; line-height: 1.25; word-break: keep-all; }
.job-card.selected { border: 7px solid var(--blue); background: #eaf3ff; }
.job-card .selected-label { display: block; margin-top: 8px; color: var(--blue-dark); font-size: 1rem; font-weight: 900; }

.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 22px; }
.pager strong { text-align: center; font-size: 1.15rem; }

.photo-guide, .consent-card, .confirm-card {
  padding: 24px;
  border: 4px solid var(--border);
  border-radius: 22px;
  background: white;
}
.photo-guide { margin-bottom: 22px; }
.photo-guide strong { font-size: 1.35rem; }
.photo-guide p, .consent-card p { margin: 14px 0 0; font-size: 1.3rem; font-weight: 700; line-height: 1.6; word-break: keep-all; }
.photo-actions, .result-actions { display: grid; gap: 14px; }
.file-button { width: 100%; }
.photo-preview-wrap { text-align: center; }
.preview-question { margin: 0 0 18px; font-size: 1.45rem; font-weight: 900; }
.photo-preview { width: min(100%, 430px); max-height: 520px; object-fit: contain; border: 4px solid var(--border); border-radius: 22px; background: white; }
.photo-preview-wrap .button { width: 100%; margin-top: 16px; }
.error-message { min-height: 1.5em; color: var(--danger); font-size: 1.1rem; font-weight: 800; }

.consent-card p { margin-top: 0; margin-bottom: 24px; font-size: 1.45rem; }
.consent-card p:last-child { margin-bottom: 0; }

.confirm-card { margin-bottom: 18px; }
.confirm-card h2 { margin: 0 0 10px; font-size: 1.25rem; }
.confirm-card p { margin: 0 0 16px; font-size: 1.7rem; font-weight: 900; }
.confirm-job { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.confirm-job img { width: 110px; height: 110px; object-fit: contain; border-radius: 14px; background: #f3f6fa; }
.confirm-job p { margin: 0; }
.confirm-photo { display: block; width: min(100%, 320px); max-height: 360px; object-fit: contain; margin: 0 0 16px; border-radius: 16px; }

.loading-screen { text-align: center; padding-top: 10vh; }
.loading-screen p { font-size: 1.25rem; line-height: 1.6; }
.loader { width: 84px; height: 84px; margin: 0 auto 30px; border: 12px solid #dbe4f0; border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-image { display: block; width: 100%; max-height: 78vh; object-fit: contain; border: 4px solid var(--border); border-radius: 22px; background: white; }
.result-actions { margin-top: 22px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 520px) {
  :root { font-size: 17px; }
  .app-shell { width: min(100% - 20px, 760px); padding-top: 16px; }
  .job-grid { gap: 10px; }
  .job-card { min-height: 210px; padding: 10px; }
  .job-card img { height: 125px; }
  .job-card strong { font-size: 1.23rem; }
  .bottom-actions { grid-template-columns: 1fr 1.55fr; gap: 10px; }
  .button { min-height: 68px; padding-inline: 13px; }
  .pager .button { min-height: 58px; font-size: .98rem; }
  .confirm-job img { width: 90px; height: 90px; }
}

@media (max-width: 360px) {
  .job-card { min-height: 190px; }
  .job-card img { height: 108px; }
  .job-card strong { font-size: 1.1rem; }
}
