/* Right column: upload_result.json and manifest.json split the old
   upload_result card height evenly. */
.input-stack {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}
.input-card.compact { min-height: 0; }
.input-card.compact .input-head { padding: 8px 12px; }
.input-card.compact textarea.json-input {
  flex: 1;
  min-height: 92px;
  resize: none;
}
.input-card.compact .input-name { padding: 5px 12px 7px; min-height: 0; }
.head-optional {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
}

.summary-details {
  border-top: 1px solid var(--border);
  padding: 4px 12px 6px;
  font-size: 11px;
  color: var(--muted);
}
.summary-details summary { cursor: pointer; user-select: none; }
.summary-list { margin: 6px 0 0; padding-left: 18px; max-height: 96px; overflow: auto; color: var(--text); }
.summary-list li { margin-bottom: 3px; }

.mode-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  font-size: 12px;
}
.mode-default { margin: 0; color: var(--muted); line-height: 1.6; }
.mode-default b { color: var(--text); font-weight: 600; margin-right: 4px; }
.advanced-options { color: var(--muted); }
.advanced-options summary { cursor: pointer; user-select: none; font-size: 12px; }
.advanced-options[open] summary { margin-bottom: 8px; }
.mode-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mode-row > strong { font-size: 12px; white-space: nowrap; }
.mode-option { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.mode-option span { color: var(--muted); }
.mode-option b { color: var(--text); font-weight: 600; }
.mode-help { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }
.review-option { display: flex; align-items: flex-start; gap: 6px; color: var(--muted); cursor: pointer; margin-top: 8px; }

.replace-actions .step-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.replace-actions .step-hint.ready { color: var(--accent); }

.consistency { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

.upload-table td { vertical-align: top; }
.result-actions .quick-btn {
  margin-left: 0;
  padding: 6px 12px;
  font-size: 12px;
}
.context-marker {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  word-break: break-all;
}
.upload-table .status-badge.success { background: var(--accent-soft); border-color: #bfe8d6; color: var(--accent); }
.upload-table .status-badge.failed { background: var(--error-soft); border-color: #f1c0bd; color: var(--error); }
.upload-table .status-badge.pending { background: var(--warn-soft); border-color: #f5d6b4; color: var(--warn); }
.upload-table .status-badge.review { background: var(--warn-soft); border-color: #f5d6b4; color: var(--warn); }

.result-cell { max-width: 260px; }
.result-cell strong { display: block; font-weight: 600; }
.result-cell span { display: block; color: var(--muted); font-size: 11px; word-break: break-all; }
.result-url { font-family: var(--mono); font-size: 11px; word-break: break-all; }
.result-reason { color: var(--error); font-size: 11px; }
.context-cell { max-width: 300px; }
.context-cell .section { color: var(--text); font-weight: 600; }
.context-cell .context { color: var(--muted); font-size: 11px; line-height: 1.5; word-break: break-word; }
.text-cell { max-width: 240px; }
.text-cell strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-cell span { display: block; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mapping-thumb {
  width: 52px;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: 6px;
  object-fit: contain;
  background: #fbfdfc;
  display: block;
}
.mapping-thumb-empty {
  width: 52px;
  height: 52px;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

@media (max-width: 980px) {
  .input-stack { grid-template-rows: auto; }
  .input-card.compact textarea.json-input { min-height: 120px; }
}

@media (max-width: 860px) {
  .mode-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .upload-table .context-cell { display: none; }
  .replace-actions .step-hint { flex-basis: 100%; }
}
