.score-photo-import {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #c9e3e7;
  border-radius: 8px;
  background: #f7fcfd;
  color: #10233a;
  box-sizing: border-box;
  overflow: hidden;
}

.score-photo-import *,
.score-photo-import *::before,
.score-photo-import *::after {
  box-sizing: border-box;
  min-width: 0;
}

.score-photo-import [hidden] { display: none !important; }
.score-recognition-progress { margin: 14px 0; padding: 12px 0; border-block: 1px solid #c9e3e7; }
.score-recognition-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0 0 12px; }
.score-recognition-steps li { border-top: 4px solid #d5dfe4; padding-top: 7px; font-size: .85rem; line-height: 1.4; color: #617087; overflow-wrap: anywhere; }
.score-recognition-steps li[data-state=done] { border-color: #398657; color: #286440; }
.score-recognition-steps li[data-state=current] { border-color: #087985; color: #075e67; font-weight: 800; }
.score-recognition-steps li[data-state=error] { border-color: #b74136; color: #a32922; }
.score-recognition-progress > strong { display: block; margin-top: 8px; font-variant-numeric: tabular-nums; }
.score-recognition-progress > p { margin: 6px 0 0; color: #53647b; line-height: 1.5; font-size: .88rem; }
.score-photo-import strong, .score-photo-import span, .score-photo-import small {
  overflow-wrap: anywhere;
}
.score-pdf { margin-top: 12px; }
.score-pdf > strong { display: block; }
.score-pdf-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 12px 0; }
.score-pdf-toolbar label { display: flex; gap: 8px; align-items: center; }
.score-pdf-toolbar input[type=number] {
  width: 88px; min-height: 44px; padding: 8px; font: inherit;
  border: 1px solid #83cbd3; border-radius: 4px; background: white; color: #10233a;
}
.score-pdf-preview { max-height: 520px; overflow: auto; background: #e8edef; padding: 8px; }
.score-pdf-preview canvas { display: block; width: 100%; height: auto; background: white; }
.score-photo-import-actions label:focus-within { outline: 3px solid #247cbc; outline-offset: 3px; }

.score-photo-import[hidden] {
  display: none !important;
}

.score-photo-import-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.score-photo-import-head div {
  display: grid;
  gap: 4px;
}

.score-photo-import-head span,
.score-photo-import-head small {
  color: #617087;
  font-weight: 700;
}

.score-photo-testing-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff0c7;
  color: #8b5a00;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.score-photo-import-head strong {
  font-size: 1.08rem;
}

.score-photo-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.score-photo-import-actions label,
.score-photo-result button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid #83cbd3;
  border-radius: 8px;
  background: #e7f8fa;
  color: #087985;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-sizing: border-box;
}

.score-photo-import-actions label:first-child,
.score-photo-result button {
  border-color: #128b96;
  background: #128b96;
  color: #fff;
}

.score-photo-import-actions label[aria-disabled="true"] {
  border-color: #d5dfe4;
  background: #edf2f4;
  color: #7a8796;
  cursor: not-allowed;
  opacity: 0.78;
}

.score-photo-import[data-state="testing"] {
  border-color: #d8e3e7;
  background: #f7fafb;
}

.score-photo-import[data-state="restricted"] {
  border-color: #d7e0e5;
  background: #f7fafb;
}

.score-photo-import[data-state="eligible"] {
  border-color: #d7c98c;
  background: #fffdf5;
}

.score-photo-import[data-state="eligible"] .score-photo-testing-badge {
  background: #e9f4ff;
  color: #1463a5;
}

.score-photo-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.score-photo-import-actions input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.score-photo-import-note {
  margin: 10px 0 0;
  color: #617087;
  font-size: 0.9rem;
}

.score-photo-result {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #d9eaed;
}

.score-photo-result[hidden] {
  display: none;
}

.score-photo-status {
  display: grid;
  gap: 4px;
}

.score-photo-status span,
.score-photo-result > p,
.score-photo-result li {
  color: #53647b;
  line-height: 1.55;
}

.score-photo-result > p {
  margin: 10px 0;
  font-weight: 700;
}

.score-photo-preview {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 120px;
  max-height: min(52vh, 520px);
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  border: 1px solid #d7e3e7;
  border-radius: 6px;
  background: #fffdfa;
  -webkit-overflow-scrolling: touch;
  contain: inline-size layout paint;
}

.score-photo-preview svg {
  display: block;
  width: max(680px, 100%) !important;
  max-width: none !important;
  height: auto !important;
}

.score-photo-result ul {
  margin: 12px 0;
  padding-left: 22px;
}

.score-local-history, .score-source { margin: 14px 0; min-width: 0; }
.score-local-history summary, .score-source summary { cursor: pointer; font-weight: 600; }
.score-history-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.score-history-controls select { flex: 1 1 220px; min-width: 0; max-width: 100%; padding: 10px; }
.score-history-controls button { padding: 10px 16px; white-space: normal; }
.score-source img { display: block; max-width: 100%; height: auto; margin-top: 10px; }
.score-review-ack { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; line-height: 1.5; overflow-wrap: anywhere; }
.score-review-ack input[type="checkbox"] { appearance: auto; width: 20px; height: 20px; flex: 0 0 20px; margin: 2px 0 0; }
.score-photo-result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.score-photo-result-actions button { height: auto; min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
[data-score-save-status], [data-score-photo-warnings] { overflow-wrap: anywhere; }

.score-photo-result button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.score-photo-import[data-state="error"] {
  border-color: #e7aaa5;
  background: #fff8f7;
}

.score-photo-import[data-state="confirmed"] {
  border-color: #78c3a8;
  background: #f5fcf8;
}

@media (max-width: 640px) {
  .score-photo-import {
    margin-top: 10px;
    padding: 12px;
  }

  .score-photo-import-head {
    display: grid;
  }

  .score-photo-import-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .score-photo-import-actions label,
  .score-photo-result button {
    width: 100%;
    padding: 0 12px;
  }

  .score-photo-import-head {
    gap: 7px;
  }

  .score-photo-import-head small,
  .score-photo-import-note,
  .score-photo-status span,
  .score-photo-result > p,
  .score-photo-result li {
    font-size: 0.84rem;
  }

  .score-photo-preview {
    min-height: 180px;
    max-height: 48vh;
    padding: 8px;
  }

  .score-photo-preview svg {
    width: 620px !important;
    min-width: 620px;
  }

  .score-photo-result ul {
    padding-left: 18px;
  }
}
