.container--icd { max-width: 1120px; }
.icd-upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.icd-upload-card { min-width: 0; }
.icd-file-label { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; cursor: pointer; }
.icd-file-label span:last-child { color: var(--color-muted); font-size: .92rem; }
.icd-file-info, .icd-metrics { display: grid; gap: .65rem; margin: 1rem 0 0; }
.icd-file-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.icd-file-info div, .icd-metrics div { min-width: 0; padding: .75rem; border: 1px solid var(--color-border); border-radius: .75rem; background: var(--color-surface-soft); }
.icd-file-info dt, .icd-metrics dt { color: var(--color-muted); font-size: .82rem; font-weight: 700; }
.icd-file-info dd, .icd-metrics dd { margin: .25rem 0 0; font-weight: 700; overflow-wrap: anywhere; }
.icd-actions { display: flex; justify-content: flex-end; margin-top: 1rem; }
.icd-long-message { overflow-wrap: anywhere; }
.icd-mismatch { margin-top: 1rem; padding: 1rem; border: 1px solid #d89d29; border-radius: .85rem; background: #fff8e8; color: #684700; }
.icd-mismatch p { margin: 0 0 .5rem; }
.icd-compare { display: grid; gap: 1rem; margin-top: 1rem; }
.icd-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.icd-heading h2 { margin-bottom: .25rem; }
.icd-heading p { margin: 0; color: var(--color-muted); }
.icd-canvas-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--color-border); border-radius: .85rem; background-color: #20262b; background-image: linear-gradient(45deg, #2c343a 25%, transparent 25%), linear-gradient(-45deg, #2c343a 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #2c343a 75%), linear-gradient(-45deg, transparent 75%, #2c343a 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.icd-canvas-wrap canvas { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.icd-comparison-stage { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; }
.icd-comparison-stage canvas { width: auto; }
.icd-divider { position: absolute; top: 0; bottom: 0; width: 3px; transform: translateX(-1px); background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .55); pointer-events: none; }
.icd-side-label { position: absolute; top: .6rem; z-index: 1; padding: .22rem .45rem; border-radius: .4rem; color: #fff; background: rgba(0, 0, 0, .7); font-size: .78rem; font-weight: 800; pointer-events: none; }
.icd-side-label--before { left: .6rem; }
.icd-side-label--after { right: .6rem; }
.icd-control { display: grid; gap: .5rem; margin-top: 1rem; }
.icd-control input[type="range"] { width: 100%; min-height: 2.75rem; }
.icd-control input[type="number"] { width: min(100%, 12rem); }
.icd-control output { font-weight: 800; }
.icd-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.icd-result-message { margin: 1rem 0 0; font-weight: 800; }
.icd-progress { min-height: 1.5em; }
.icd-diff-note { color: var(--color-muted); }
.icd-diff-preview { min-height: 7rem; }
.icd-file-label:focus-within, .icd-control input:focus-visible, .icd-actions button:focus-visible { outline: 3px solid rgba(20, 107, 99, .34); outline-offset: 3px; }

@media (max-width: 760px) {
  .icd-upload-grid { grid-template-columns: 1fr; }
  .icd-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .icd-file-info, .icd-metrics { grid-template-columns: 1fr; }
  .icd-heading { display: block; }
  .icd-actions .button { width: 100%; }
  .icd-file-label { align-items: stretch; }
  .icd-file-label .button { width: 100%; text-align: center; }
}
