.transaction-ocr-shell { max-width: 1180px; }
.transaction-ocr-heading { align-items: center; }
.transaction-ocr-heading > div:first-child { max-width: 720px; }
.ocr-privacy-note {
  display: grid;
  gap: 4px;
  max-width: 260px;
  padding: 14px 16px;
  border: 1px solid #b8d8cd;
  border-radius: 10px;
  background: #f3faf7;
  color: #315f51;
}
.ocr-privacy-note span { font-size: 12px; line-height: 1.55; }
.transaction-ocr-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
.ocr-upload-panel, .ocr-result-panel, .ocr-rule-panel { padding: 22px; }
.ocr-bank-field {
  display: grid;
  grid-template-columns: max-content minmax(180px, 280px) minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 16px;
}
.ocr-bank-field label { color: var(--ink); font-size: 13px; font-weight: 800; }
.ocr-bank-field select {
  width: 100%;
  min-height: 38px;
  padding: 7px 34px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.ocr-bank-field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ocr-bank-field select:disabled { cursor: wait; opacity: .68; }
.ocr-bank-field span { color: var(--muted); font-size: 12px; }
.ocr-slot-grid {
  display: flex;
  gap: 12px;
  padding: 2px 2px 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-color: #a8cfc1 transparent;
}
.ocr-slot {
  position: relative;
  flex: 1 0 min(190px, 72vw);
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfc;
  scroll-snap-align: start;
}
.ocr-slot.is-success { border-color: #9bcabb; background: #f7fbf9; }
.ocr-slot.is-error { border-color: #d9867e; background: #fff8f7; }
.ocr-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.ocr-slot-header > strong { font-size: 14px; }
.ocr-slot-header .status-chip { padding: 4px 7px; font-size: 11px; }
.ocr-slot-header .status-chip.danger { background: #ffe0dc; color: #932f27; }
.ocr-slot-picker {
  display: grid;
  place-items: center;
  min-height: 180px;
  overflow: hidden;
  border: 2px dashed #b8c8c3;
  border-radius: 8px;
  background: #f8faf9;
  color: #61706b;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.ocr-slot-picker:hover, .ocr-slot-picker:focus-within, .ocr-slot-picker.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.ocr-slot-picker.is-busy { cursor: wait; opacity: .68; }
.ocr-slot-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ocr-slot-empty { display: grid; justify-items: center; gap: 8px; font-size: 13px; }
.ocr-slot-empty[hidden], .ocr-slot-picker img[hidden] { display: none; }
.ocr-drop-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: #dbeee7;
  color: #246955;
  font-size: 18px;
  font-weight: 900;
}
.ocr-slot-picker img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  object-position: center;
}
.ocr-slot-detail {
  min-height: 34px;
  margin: 8px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
}
.ocr-slot-clear {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 2px 0 2px 8px;
  border: 0;
  background: transparent;
  color: #8b4d47;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.ocr-slot-clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ocr-slot-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.ocr-add-button { flex: 0 0 auto; }
.ocr-slot-actions > span { color: var(--muted); font-size: 12px; }
.ocr-status, .ocr-signature { color: var(--muted); font-size: 12px; }
.ocr-status { min-height: 20px; margin: 14px 0 8px; }
.ocr-status.is-error { color: #a33a32; font-weight: 700; }
.ocr-run-button { width: 100%; }
.ocr-result-panel { align-self: start; border-color: #a8cfc1; }
.ocr-result-panel.is-warning { border-color: #d9867e; background: #fff8f7; }
.ocr-result-panel .status-chip.danger { background: #ffe0dc; color: #932f27; }
.ocr-output {
  min-height: 150px;
  margin: 8px 0 14px;
  padding: 18px;
  overflow-wrap: anywhere;
  border-radius: 10px;
  background: #18211f;
  color: #f4faf7;
  font: 700 17px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}
.ocr-rate-check { display: grid; gap: 5px; padding: 13px 0; border-top: 1px solid var(--line); }
.ocr-rate-check span { color: var(--muted); font-size: 12px; }
.ocr-warning { padding: 11px 12px; border-radius: 8px; background: #ffe0dc; color: #932f27; font-weight: 800; }
.ocr-signature { margin: 13px 0; }
.ocr-rule-panel ol { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.ocr-rule-panel li { padding: 7px 10px; border-radius: 7px; background: #edf3f1; color: #3d5c53; font-size: 12px; font-weight: 800; }
.ocr-rule-panel > p:last-child { margin-bottom: 0; color: var(--muted); }

@media (max-width: 900px) {
  .ocr-privacy-note { max-width: none; margin-top: 16px; }
}

@media (max-width: 600px) {
  .ocr-upload-panel, .ocr-result-panel, .ocr-rule-panel { padding: 17px; }
  .ocr-bank-field { grid-template-columns: 1fr; }
  .ocr-slot-picker { min-height: 160px; }
  .ocr-slot-picker img { height: 160px; }
  .ocr-slot-actions { align-items: flex-start; flex-direction: column; }
  .ocr-output { font-size: 15px; }
}
