.doc-page [hidden] { display: none !important; }
.doc-page main { min-width: 0; }
.doc-page main > section { width: min(1360px, 100%); margin-inline: auto; }
.doc-hero { padding: 32px 0 30px; }
.doc-hero .eyebrow { margin-bottom: 7px; }
.doc-hero h1 { max-width: 1040px; margin: 0 0 13px; color: #13223e; font-size: clamp(34px, 3.5vw, 50px); line-height: 1.12; letter-spacing: -.035em; }
.doc-hero .hero-lead { max-width: 850px; margin: 0; color: #5b6c83; font-size: 17px; line-height: 1.6; }
.doc-hero .trust-row { margin-top: 18px; }
.doc-workspace, .doc-about, .doc-faq { margin-bottom: 62px; }
.doc-workspace .section-heading { margin-bottom: 18px; }
.doc-workspace .section-heading h2 { margin: 3px 0 0; font-size: clamp(24px, 2.4vw, 30px); }
.doc-grid { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(400px, 1.1fr); gap: 20px; align-items: stretch; }
.doc-panel { min-width: 0; padding: 24px; border: 1px solid #dce4ee; border-radius: 14px; background: #fff; box-shadow: 0 10px 28px rgba(23,38,64,.045); }
.doc-input-panel { display: flex; flex-direction: column; gap: 15px; }
.doc-dropzone { position: relative; display: grid; place-items: center; align-content: center; gap: 7px; min-height: 160px; padding: 22px; border: 2px dashed #a8bbd1; border-radius: 12px; background: #f7faff; text-align: center; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.doc-dropzone:hover, .doc-dropzone:focus-within, .doc-dropzone.is-dragover { border-color: #f66a0a; background: #fff6ef; }
.doc-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.doc-dropzone:focus-within { outline: 3px solid #f66a0a; outline-offset: 2px; }
.doc-upload-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #fff; color: #e65f00; font-size: 26px; font-weight: 800; }
.doc-dropzone strong { color: #13223e; font-size: 18px; }
.doc-dropzone small, .doc-file-row, .doc-sample-row, .doc-hint, .doc-timing { color: #607188; font-size: 13px; }
.doc-file-row, .doc-sample-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.doc-file-row button, .doc-sample-row button { padding: 2px 0; border: 0; background: transparent; color: #d55c00; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.doc-preview { position: relative; display: grid; place-items: center; min-height: 210px; max-height: 320px; overflow: hidden; border: 1px solid #dce4ee; border-radius: 10px; background: #f7f9fc; color: #708096; text-align: center; }
.doc-preview img { display: block; max-width: 100%; max-height: 320px; object-fit: contain; }
.doc-preview.is-selecting { cursor: crosshair; touch-action: none; outline: 3px solid #f66a0a; outline-offset: 2px; }
.doc-preview.is-selecting img { pointer-events: none; }
.doc-region-box { position: absolute; z-index: 1; border: 2px solid #f66a0a; border-radius: 3px; background: rgba(246,106,10,.16); box-shadow: 0 0 0 9999px rgba(17,31,51,.12); pointer-events: none; }
.doc-region-controls { display: grid; gap: 7px; }
.doc-region-buttons { display: flex; flex-wrap: wrap; gap: 9px; }
.doc-region-buttons button { padding: 7px 11px; border: 1px solid #d3deeb; border-radius: 8px; background: #fff; color: #172640; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.doc-region-buttons button:hover, .doc-region-buttons button:focus-visible { border-color: #f66a0a; color: #d55c00; }
.doc-region-buttons button.is-active { border-color: #f66a0a; background: #fff6ef; color: #d55c00; }
.doc-field { display: grid; gap: 8px; color: #172640; font-size: 14px; font-weight: 700; }
.doc-field select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #d3deeb; border-radius: 8px; background: #fff; color: #172640; font: inherit; }
.doc-hint { margin: 0; line-height: 1.6; }
.doc-input-panel .doc-primary, .doc-input-panel .doc-cancel { width: 100%; }
.doc-input-panel .privacy-note { margin: 0; font-size: 12px; line-height: 1.55; }
.doc-result-panel { display: flex; flex-direction: column; gap: 14px; }
.doc-result-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.doc-step { margin: 0 0 5px; color: #e65f00; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.doc-result-head h3 { margin: 0; color: #13223e; font-size: 22px; }
.doc-output-badge { padding: 6px 9px; border-radius: 6px; background: #edf3fb; color: #31547b; font-size: 12px; font-weight: 800; }
.doc-status { min-height: 25px; margin: 0; color: #556b85; font-size: 14px; line-height: 1.5; }
.doc-status.is-error { color: #ba3d15; }
.doc-status.is-warning { color: #9a5300; }
.doc-confirm { padding: 13px; border: 1px solid #f2c494; border-radius: 8px; background: #fff7eb; }
.doc-confirm p { margin: 0 0 10px; color: #7b400d; font-size: 14px; }
.doc-confirm div { display: flex; gap: 10px; }
.doc-confirm button { padding: 8px 12px; border: 1px solid #ddb584; border-radius: 6px; background: #fff; color: #743e0f; font-weight: 700; cursor: pointer; }
.doc-field-label { color: #172640; font-size: 14px; font-weight: 700; }
.doc-result-panel textarea { flex: 1; width: 100%; min-height: 310px; padding: 15px; border: 1px solid #d3deeb; border-radius: 9px; background: #fff; color: #172640; font: 15px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; resize: vertical; }
.doc-result-panel textarea:disabled { background: #f7f9fc; color: #77869a; }
.doc-result-panel textarea:focus-visible, .doc-field select:focus-visible, .doc-confirm button:focus-visible { outline: 3px solid #f66a0a; outline-offset: 2px; }
.doc-timing { min-height: 19px; margin: 0; }
.doc-actions { display: flex; gap: 10px; }
.doc-actions > button { width: auto; min-width: 0; }
.doc-actions #docCopy { flex: 0 1 34%; }
.doc-actions #docDownload { flex: 1 1 66%; }
.doc-about .section-heading { margin-bottom: 18px; }
.doc-about h2 { margin: 0; font-size: clamp(25px, 2.6vw, 34px); }
.doc-about-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.doc-about-grid article { padding: 22px; border: 1px solid #dce4ee; border-radius: 12px; background: #fff; }
.doc-about-grid strong { color: #e65f00; font-size: 12px; letter-spacing: .1em; }
.doc-about-grid h3 { margin: 10px 0 8px; color: #13223e; font-size: 18px; }
.doc-about-grid p { margin: 0; color: #607188; font-size: 14px; line-height: 1.6; }
.doc-faq { padding-bottom: 12px; }
@media (max-width: 920px) { .doc-grid { grid-template-columns: 1fr; } .doc-result-panel textarea { min-height: 250px; } }
@media (max-width: 620px) { .doc-hero { padding-top: 24px; } .doc-panel { padding: 17px; } .doc-actions { flex-direction: column; } .doc-actions > button { width: 100%; } .doc-about-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .doc-dropzone { transition: none; } }
