main { max-width: 1180px; }

body[data-document-open="true"] main { padding-top: 24px; }
body[data-document-open="true"] .intro { margin-bottom: 14px; }
body[data-document-open="true"] h1 { font-size: clamp(1.8rem, 5vw, 2.65rem); }
body[data-document-open="true"] .intro p,
body[data-document-open="true"] .drop h2,
body[data-document-open="true"] .file-icon { display: none; }
body[data-document-open="true"] .upload { padding: 12px; }
body[data-document-open="true"] .model { margin-bottom: 10px; }
body[data-document-open="true"] .drop { min-height: 0; padding: 7px; }
body[data-document-open="true"] .conversion { margin-top: 8px; font-size: .9rem; }

.results { padding: 0; overflow: hidden; }
.result-header { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.result-header button:disabled { cursor: default; opacity: 1; color: #486176; background: #e7eef2; }
.review { display: grid; grid-template-columns: 190px minmax(0, 1fr); }
.page-nav { min-width: 0; background: #f5f8fa; border-right: 1px solid var(--line); padding: 13px 8px 8px; }
.page-nav h3 { margin: 0 6px 8px; font-size: .93rem; }
.page-list { display: grid; align-content: start; gap: 6px; max-height: min(65vh, 620px); overflow: auto; padding: 3px; }
.page-button {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  min-height: 74px;
  text-align: left;
  padding: 6px;
  color: var(--ink);
  background: white;
  border-color: #d6e1e7;
}
.page-button:hover { border-color: #8ebdb1; }
.page-button[aria-current="page"] { background: #dceee9; border-color: var(--accent); }
.page-thumb {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 48px;
  height: 62px;
  overflow: hidden;
  border-radius: 3px;
  background: #e7eef2;
  border: 1px solid #d0dce4;
}
.page-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.page-number { align-self: end; font-size: .89rem; }
.page-meta { align-self: start; color: var(--muted); font-weight: 500; font-size: .78rem; }
.page-button[data-state="complete"] .page-meta { color: #235d51; }

.page-review { min-width: 0; min-height: 270px; padding: 14px 18px 18px; }
.page-review h3 { font-size: 1.05rem; margin: 0 0 11px; }
.table-picker { margin: 0 0 12px; }
.page-message { padding: 12px; border-radius: 7px; color: var(--muted); background: #f5f8fa; }
.preview { overflow: visible; }
.table-scroll {
  overflow: auto;
  max-height: min(63vh, 600px);
  overscroll-behavior-x: contain;
  border: 1px solid #ccd9e1;
  border-radius: 7px;
}
.table-scroll:focus-visible, .editable-cell:focus-visible, .editable-cell:focus-within { outline: 2px solid #317ac5; outline-offset: -2px; }
.table-scroll table { font-size: .91rem; }
.table-scroll td, .table-scroll th { min-width: 88px; }
.table-scroll tr:nth-child(even) td { background: #f5f9fb; }
.editable-cell { cursor: text; }
.table-scroll .editable-cell:focus-within { background: #e2f3ee; }
.cell-editor {
  display: block;
  width: 100%;
  min-width: 0;
  resize: vertical;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
}
.table-scroll + .caption { margin-top: 8px; }
.image-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 8px; }
.image-note p { color: #355468; font-size: .87rem; }
.image-note button { min-height: 36px; padding: 4px 9px; font-size: .86rem; }
.table-image { display: block; max-width: 100%; height: auto; }
.full-image .table-image { max-width: none; }

@media (max-width: 690px) {
  .result-header { padding: 12px; }
  .review { grid-template-columns: minmax(0, 1fr); }
  .page-nav { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 7px 6px; }
  .page-nav h3 { margin-bottom: 3px; }
  .page-list {
    grid-auto-flow: column;
    grid-auto-columns: 78px;
    justify-content: start;
    max-height: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .page-button { grid-template-columns: 1fr; grid-template-rows: auto auto auto; text-align: center; gap: 0; padding: 4px 3px; }
  .page-thumb { grid-row: auto; justify-self: center; width: 40px; height: 51px; margin-bottom: 3px; }
  .page-review { min-height: 160px; padding: 12px; }
  .table-scroll { max-height: none; }
  .table-scroll td, .table-scroll th { min-width: 80px; padding: 7px 9px; }
  .table-scroll .editable-cell { font-size: 16px; }
  .image-note button, .table-picker button { min-height: 42px; }
}
