body {
  font-family: -apple-system, "Segoe UI", sans-serif;
  background: #f0f1f3;
  color: #222;
  margin: 0;
  padding: 32px 24px;
}
a { color: #1a5fb4; }
h1 { font-size: 20px; margin: 0 0 16px; }
.card {
  background: #fff;
  border: 1px solid #e2e4e8;
  border-radius: 10px;
  padding: 28px;
  max-width: 900px;
  margin: 0 auto 16px;
}

/* ---- Buttons / links ---- */
button, .btn {
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #1a5fb4;
  background: #fff;
  color: #1a5fb4;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:disabled, .btn.disabled {
  background: #eee;
  border-color: #ddd;
  cursor: not-allowed;
  color: #aaa;
}
button.secondary, .btn.secondary { background: #fff; color: #1a5fb4; }
.btn-primary, button.btn-primary {
  background: #1a5fb4;
  color: #fff;
  font-weight: 600;
  padding: 12px 24px;
  font-size: 15px;
}
.btn-primary:disabled { background: #eee; color: #aaa; border-color: #ddd; }
.btn-small { font-size: 13px; padding: 5px 12px; }
.link-minor {
  font-size: 13px;
  color: #888;
  text-decoration: underline;
  margin-left: 8px;
}
.actions { margin-top: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---- Status banners ---- */
.banner {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 15px;
}
.banner-success { background: #e3f5e6; color: #1e7a34; border: 1px solid #b7e4c0; }
.banner-warning { background: #fff3cd; color: #8a6100; border: 1px solid #e8c766; }
.banner-error { background: #fde3e3; color: #a3231e; border: 1px solid #f0a8a4; }

/* ---- Page list ---- */
.page-list { margin-top: 8px; }
.page-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fafbfc;
}
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.badge-ok { background: #e3f5e6; color: #1e7a34; }
.badge-review { background: #fff3cd; color: #8a6100; }
.badge-error { background: #fde3e3; color: #a3231e; }
.badge-neutral { background: #eee; color: #666; }
.progress-text { font-weight: 600; margin-bottom: 12px; font-size: 16px; }
.status-text { color: #666; font-size: 13px; margin-top: 8px; }

/* ---- Processing ---- */
.processing-block { text-align: center; padding: 24px 0; }
.spinner {
  width: 32px; height: 32px;
  margin: 0 auto 16px;
  border: 3px solid #dde3ee;
  border-top-color: #1a5fb4;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Human Review ---- */
.review-progress { font-weight: 700; font-size: 16px; color: #a3231e; margin-bottom: 8px; }
.review-instructions { color: #444; margin-bottom: 12px; }
.review-canvas {
  position: relative;
  display: inline-block;
  max-width: 100%;
  user-select: none;
}
.review-canvas img { display: block; max-width: 100%; height: auto; }
.review-shade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(163, 35, 30, 0.35);
  pointer-events: none;
}
.review-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  margin-top: -4px;
  background: #a3231e;
  cursor: ns-resize;
  box-shadow: 0 0 0 2px rgba(163, 35, 30, 0.25);
}
.review-line:hover, .review-line.dragging { background: #c92c26; }
.review-handle {
  position: absolute;
  left: 50%;
  top: -14px;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 4px 12px;
  background: #a3231e;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 5px;
  pointer-events: none;
}

/* ---- Upload ---- */
.dropzone {
  border: 2px dashed #b7c0cf;
  border-radius: 10px;
  padding: 56px 24px;
  text-align: center;
  color: #666;
  background: #fafbfc;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.dragover { border-color: #1a5fb4; background: #eef4fc; }
.dropzone-title { font-size: 17px; font-weight: 600; color: #333; margin-bottom: 12px; }
.dropzone-or { color: #999; font-size: 13px; margin-bottom: 10px; }
.dropzone-formats { color: #999; font-size: 12px; margin-top: 14px; }
.dropzone-filename { margin-top: 10px; font-size: 13px; color: #1a5fb4; font-weight: 600; }

/* ---- Export ---- */
.export-option { margin-bottom: 20px; }

/* ---- Preview / post-crop result ---- */
.preview-result { margin-top: 16px; }
.preview-result-image {
  max-width: 100%;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-top: 6px;
}

/* ---- Inline confirm box (e.g. "切り取り不可") -- deliberately NOT a
   full-screen modal, just a small inline block, per the Phase 4 revision. */
.inline-confirm {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #e8c766;
  background: #fff3cd;
  border-radius: 8px;
}
.inline-confirm p { margin: 0 0 10px; color: #8a6100; }

/* ---- Preview Viewer ---- */
.preview-viewer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
  font-weight: 600;
}

/* ---- Error page ---- */
