.rc-dialog {
  width: min(1180px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 20px;
  color: #3a2915;
  background: #fffdf4;
  box-shadow: 0 25px 80px rgba(65, 42, 14, .28);
}
.rc-dialog::backdrop { background: rgba(42, 32, 22, .58); backdrop-filter: blur(3px); }
.rc-shell { padding: 24px; }
.rc-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.rc-heading h2 { margin: 0; font-size: 23px; }
.rc-heading p { margin: 7px 0 0; color: #7b6241; font-size: 7mm; line-height: 1.55; }
.rc-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f4dfad; cursor: pointer; font-size: 22px; }
.rc-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.rc-flow span { padding: 9px; border: 1px solid #f0c77a; border-radius: 10px; color: #7b6241; background: #fffaf0; font-size: 7mm; font-weight: 900; text-align: center; }
.rc-section { margin-top: 14px; padding: 17px; border: 1px solid #f0c77a; border-radius: 16px; background: #fffaf0; }
.rc-section h3 { margin: 0 0 5px; font-size: 17px; }
.rc-section > p { margin: 0 0 13px; color: #7b6241; font-size: 7mm; line-height: 1.55; }
.rc-file-grid, .rc-canvas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.rc-file { display: grid; gap: 6px; min-width: 0; padding: 13px; border: 1px dashed #e5ad55; border-radius: 12px; background: #fffdf4; font-size: 12px; font-weight: 900; }
.rc-file small { color: #7b6241; font-size: 7mm; font-weight: 400; line-height: 1.55; }
.rc-file input { width: 100%; }
.rc-size-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) auto; align-items: end; gap: 10px; margin-top: 13px; }
.rc-size-row label { color: #5b3a16; font-size: 11px; font-weight: 900; }
.rc-size-row input { width: 100%; min-height: 39px; margin-top: 5px; padding: 7px 9px; border: 1px solid #e5ad55; border-radius: 9px; background: white; }
.rc-button { min-height: 40px; padding: 8px 14px; border: 1px solid #d98b2b; border-radius: 10px; color: #3a2915; background: #fffaf0; cursor: pointer; font-weight: 900; }
.rc-button:hover { background: #ffe8ad; }
.rc-button.primary { color: white; background: #f28c28; }
.rc-button.primary:hover { background: #bd6419; }
.rc-button:disabled { cursor: not-allowed; opacity: .45; }
.rc-canvas-card { min-width: 0; overflow: hidden; border: 1px solid #f0c77a; border-radius: 12px; background: white; }
.rc-canvas-title { padding: 8px 10px; color: #5b3a16; background: #fff1c9; font-size: 12px; font-weight: 900; }
.rc-canvas-card canvas { display: block; width: 100%; height: auto; background: #eeeae4; touch-action: none; }
.rc-canvas-card small { display: block; padding: 8px 10px; color: #7b6241; font-size: 7mm; line-height: 1.55; }
.rc-result-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(220px, .6fr); gap: 13px; }
.rc-result-meta { align-self: start; padding: 14px; border: 1px solid #f0c77a; border-radius: 12px; background: white; }
.rc-result-meta b, .rc-result-meta span { display: block; }
.rc-result-meta b { font-size: 15px; }
.rc-result-meta span { margin-top: 6px; color: #7b6241; font-size: 7mm; line-height: 1.55; }
.rc-message { min-height: 20px; margin: 12px 0 0; color: #597043; font-size: 7mm; line-height: 1.55; }
.rc-message.error { color: #ad3d32; }
.rc-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.reference-capture-intro { margin-top: 18px; padding: 15px; border: 1px solid #f0c77a; border-radius: 14px; background: #fffaf0; }
.reference-capture-intro p { margin: 0 0 11px; color: #7b6241; font-size: 7mm; line-height: 1.55; }
.reference-capture-intro .button { width: 100%; }
@media (max-width: 760px) {
  .rc-shell { padding: 17px; }
  .rc-flow { grid-template-columns: 1fr; }
  .rc-file-grid, .rc-canvas-grid, .rc-result-grid { grid-template-columns: 1fr; }
  .rc-size-row { grid-template-columns: 1fr 1fr; }
  .rc-size-row .rc-button { grid-column: 1 / -1; }
  .rc-heading h2 { font-size: 19px; }
}
@media (max-width: 430px) {
  .rc-size-row { grid-template-columns: 1fr; }
  .rc-size-row .rc-button { grid-column: auto; }
}
