.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.add-actions:has(.photo-entry) { justify-content: space-between; align-items: center; }
.photo-entry { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; background: none; color: var(--secondary); font-size: 14px; }
.photo-entry .app-icon { width: 21px; height: 21px; }
.photo-entry:hover { color: var(--primary); }
.photo-header { border: 0; height: 64px; }
.photo-header h1 { margin: 0; font-size: 16px; font-weight: 600; }
.photo-header > :first-child { margin-left: -8px; }
.photo-header > :last-child { min-width: 36px; }
.photo-main { padding: 20px 28px 118px; }
.photo-text-button { min-height: 44px; padding: 6px 0; background: none; color: var(--secondary); font-size: 13px; line-height: 1.4; white-space: nowrap; }
.photo-text-button:hover { color: var(--primary); }
.photo-text-button:disabled { opacity: .45; cursor: default; }
.photo-picker { min-height: 410px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.photo-camera-mark { display: grid; place-items: center; width: 84px; height: 84px; margin-bottom: 24px; color: var(--primary); }
.photo-camera-mark .app-icon { width: 54px; height: 54px; stroke-width: 1.1; }
.photo-camera-button { min-width: 168px; }
.photo-secondary-actions { display: flex; justify-content: center; gap: 28px; margin: 22px 0 0; }
.photo-image-panel { position: relative; height: 176px; margin-bottom: 28px; overflow: hidden; border-radius: 4px; background: var(--surface-low); }
.photo-image-panel.expanded { height: auto; }
.photo-image-toggle { display: block; width: 100%; height: 100%; padding: 0; background: none; }
.photo-image-toggle img { display: block; width: 100%; height: 176px; object-fit: contain; }
.photo-image-panel.expanded img { height: auto; }
.photo-image-replace { position: absolute; right: 10px; bottom: 10px; min-height: 36px; padding: 8px 12px; border-radius: 4px; background: rgba(255,255,255,.94); color: var(--primary); font-size: 12px; }
.photo-image-replace:disabled { opacity: .5; }
.photo-list-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.photo-list-heading h2 { margin: 0; font-size: 14px; font-weight: 500; }
.photo-candidates { display: grid; gap: 10px; }
.photo-candidate { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 48px; }
.photo-candidate input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; margin: 0; }
.photo-word-input { width: 100%; min-width: 0; min-height: 44px; padding: 9px 4px; border: 0; border-radius: 2px; color: var(--primary); background: transparent; font-size: 20px; line-height: 1.4; }
.photo-word-input:focus { outline: 1px solid var(--surface-highest); outline-offset: 2px; }
.photo-word-input[aria-invalid=true] { outline: 1px solid var(--error); }
.photo-candidate.unselected .photo-word-input { color: var(--secondary); }
.photo-existing { color: var(--secondary); font-size: 11px; white-space: nowrap; }
.photo-add-expression { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; margin-top: 16px; padding: 0; background: none; color: var(--secondary); font-size: 13px; }
.photo-add-expression .app-icon { width: 17px; height: 17px; }
.photo-add-expression:disabled { opacity: .4; }
.photo-manual { display: flex; align-items: stretch; flex-direction: column; gap: 16px; margin-top: 28px; }
.photo-manual label { font-size: 14px; font-weight: 500; }
.photo-manual textarea { width: 100%; min-height: 180px; resize: vertical; padding: 16px; border: 0; border-radius: 4px; background: var(--surface-low); color: var(--primary); font: 18px/1.7 Helvetica, Arial, sans-serif; }
.photo-manual textarea::placeholder { font-size: 14px; color: var(--secondary); }
.photo-manual .btn { align-self: flex-end; min-width: 96px; }
.photo-error { margin: 0 0 20px; color: var(--error); font-size: 13px; line-height: 1.5; }
.photo-loading { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 32px 0; color: var(--secondary); font-size: 13px; }
.photo-spinner { width: 16px; height: 16px; border: 1.5px solid var(--surface-high); border-top-color: var(--primary); border-radius: 50%; animation: photo-spin 1s linear infinite; }
.photo-footer { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%,600px); display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 20px 28px max(20px,env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); backdrop-filter: blur(8px); z-index: 25; }
.photo-footer > .btn:only-child { width: 100%; }
.photo-footer .btn { min-height: 48px; border-radius: 4px; font-size: 14px; }
.photo-resume { display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px; background: var(--surface-low); border-radius: 4px; color: var(--primary); text-align: left; font-size: 13px; }
.photo-resume > :nth-child(2) { margin-left: auto; color: var(--secondary); }
.photo-resume .app-icon { width: 15px; height: 15px; }
.photo-batch-heading { margin: 14px 0 36px; }
.photo-batch-heading h2 { margin: 0 0 14px; font-size: 28px; font-weight: 500; letter-spacing: -.5px; }
.photo-counts { display: flex; flex-wrap: wrap; gap: 16px; color: var(--secondary); font-size: 13px; }
.photo-counts .photo-failure-count { color: var(--error); }
.photo-batch-heading progress { display: block; width: 100%; height: 3px; margin-top: 26px; appearance: none; accent-color: var(--primary); border: 0; background: var(--surface-container); }
.photo-batch-heading progress::-webkit-progress-bar { background: var(--surface-container); }
.photo-batch-heading progress::-webkit-progress-value { background: var(--primary); }
.photo-batch-heading progress::-moz-progress-bar { background: var(--primary); }
.photo-progress-count { display: block; margin-top: 10px; text-align: right; font-size: 12px; color: var(--secondary); }
.photo-batch-list { display: grid; gap: 22px; }
.photo-batch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 42px; }
.photo-batch-row > div { min-width: 0; }
.photo-result-word { font-size: 20px; line-height: 1.45; overflow-wrap: anywhere; }
.photo-item-status { flex-shrink: 0; color: var(--secondary); font-size: 12px; }
.photo-item-error { display: block; margin-top: 3px; color: var(--error); font-size: 12px; }
.photo-batch-row.failed .photo-text-button { color: var(--error); }
.photo-main button:focus-visible, .photo-footer button:focus-visible, .photo-header button:focus-visible, .photo-entry:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
@keyframes photo-spin { to { transform: rotate(360deg); } }
@media (max-width: 420px) {
  .photo-main { padding: 12px 22px 110px; }
  .photo-footer { padding-left: 22px; padding-right: 22px; }
  .photo-picker { min-height: 360px; }
  .photo-word-input { font-size: 18px; }
  .photo-candidate { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .photo-spinner { animation: none; } }
