:root {
  color-scheme: light;
  --ink: #182230;
  --muted: #6b7787;
  --line: #dbe2ea;
  --surface: #ffffff;
  --background: #f3f6f9;
  --accent: #1d6df2;
  --accent-dark: #1254bf;
  --soft-accent: #eaf2ff;
  --success: #16825f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--background); color: var(--ink); }
button, input { font: inherit; }
.shell { width: min(1060px, calc(100% - 40px)); margin: 0 auto; padding: 46px 0 56px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 9px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1, h2, p { margin: 0; }
h1 { font-size: 42px; line-height: 1.08; letter-spacing: 0; }
h2 { font-size: 17px; line-height: 1.2; }
.mode { padding: 8px 11px; border: 1px solid #c8d8f5; border-radius: 6px; color: #22579f; background: var(--soft-accent); font-size: 12px; font-weight: 700; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; }
.upload-panel, .review-panel, .status-panel { border: 1px solid var(--line); background: var(--surface); }
.upload-panel { padding: 22px; }
.dropzone { display: flex; min-height: 265px; flex-direction: column; align-items: center; justify-content: center; gap: 9px; border: 1px dashed #aebccc; border-radius: 8px; color: var(--muted); cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: #f7faff; }
.dropzone.disabled { cursor: not-allowed; opacity: .65; }
.dropzone.disabled:hover { border-color: #aebccc; background: transparent; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--soft-accent); color: var(--accent); font-size: 28px; font-weight: 300; line-height: 1; }
.dropzone strong { color: var(--ink); font-size: 16px; }
.dropzone span:last-child { font-size: 13px; }
.actions, .result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions { margin-top: 17px; }
.button { min-height: 40px; padding: 0 15px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 750; transition: background .18s ease, border-color .18s ease, color .18s ease, opacity .18s ease; }
.button.primary { background: var(--accent); color: white; }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); }
.button.secondary { border-color: var(--line); background: white; color: var(--ink); }
.button.secondary:hover:not(:disabled) { border-color: #9eb2cb; background: #f8fafc; }
.button:disabled, .button.disabled { cursor: not-allowed; opacity: .45; }
.review-panel { min-height: 352px; padding: 22px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel-heading p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.text-button { padding: 2px 0; border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 700; }
.text-button:disabled { cursor: not-allowed; opacity: .35; }
.preview-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 12px; padding-top: 16px; }
.empty { grid-column: 1 / -1; display: grid; min-height: 238px; place-items: center; color: #9aa5b3; font-size: 13px; }
.preview { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; }
.preview img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #e9eef4; }
.preview figcaption { overflow: hidden; padding: 8px 9px 9px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.status-panel { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 16px 18px; }
.status-mark { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--soft-accent); color: var(--accent); font-size: 13px; font-weight: 800; }
.status-mark.success { background: #e5f6ef; color: var(--success); }
.status-mark.error { background: #fdeceb; color: #b42318; }
.status-mark.running { background: var(--soft-accent); color: var(--accent); }
.status-copy { display: grid; flex: 1 1 auto; min-width: 0; gap: 4px; }
.status-copy strong { font-size: 13px; }
.status-copy span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.progress-track { width: 100%; height: 5px; overflow: hidden; border-radius: 3px; background: #e8edf3; }
.progress-bar { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .28s ease; }
.progress-track.is-active .progress-bar { background: linear-gradient(90deg, var(--accent), #4a90f7); }
.result-actions { margin-left: auto; justify-content: flex-end; }
@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 560px); padding-top: 24px; }
  h1 { font-size: 32px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .workspace { grid-template-columns: 1fr; }
  .upload-panel { order: 1; }
  .review-panel { order: 2; }
  .status-panel { align-items: flex-start; flex-wrap: wrap; }
  .result-actions { width: 100%; margin-left: 44px; justify-content: flex-start; }
}
