.excel-main { --maxw: 1240px; }
.excel-hero { padding-block: 48px 28px; max-width: 840px; }
.excel-hero h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
.excel-hero .lead { font-size: 1.12rem; color: var(--muted); max-width: 680px; }
.excel-hero .eyebrow { margin-bottom: 12px; color: var(--accent-deep); font-weight: 650; }
.excel-steps { display: flex; gap: 20px; padding: 0; list-style: none; font-size: .9rem; color: var(--muted); }
.excel-steps li { display: flex; gap: 8px; align-items: center; }
.excel-steps span { width: 25px; height: 25px; border: 1px solid var(--border); border-radius: 50%; display: grid; place-items: center; font: 13px var(--font-mono); background: #fff; color: var(--fg); }
.excel-workspace { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.excel-input { min-width: 0; }
.drop-zone { border: 1.5px dashed #b9b19f; border-radius: var(--radius); padding: 28px 24px; background: var(--surface); text-align: center; }
.drop-zone.is-dragging { background: var(--accent-soft); border-color: var(--accent-deep); }
.drop-zone h2 { font-family: var(--font); font-size: 1.25rem; }
.drop-zone p { color: var(--muted); font-size: .9rem; margin: 8px 0; }
.drop-icon { width: 38px; height: 38px; color: var(--accent-deep); margin-bottom: 8px; }
.upload-actions, .example-actions, .run-actions, .export-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.upload-actions { margin-top: 18px; }
.example-actions { margin-top: 16px; }
.text-button { background: transparent; border: 0; padding: 8px 4px; color: var(--accent-deep); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
.local-note { color: var(--muted); font-size: .85rem; margin: 12px 0 24px; }
.notice { padding: 12px 16px; background: #eaf2e7; border: 1px solid #b7cbb0; border-radius: 8px; margin-block: 16px; font-size: .9rem; overflow-wrap: anywhere; }
.notice.is-error { background: #fff2e5; border-color: #d3aa73; }
.ocr-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 22px 0; border-block: 1px solid var(--border); margin-block: 18px; }
.ocr-options label { display: block; font-size: .87rem; font-weight: 600; margin-bottom: 6px; }
.ocr-options select, .ocr-options input[type="number"] { display: block; width: 100%; min-height: 44px; border: 1px solid #b9b19f; border-radius: 8px; padding: 9px 11px; background: #fff; color: var(--fg); font: inherit; }
.option-help { font-size: .8rem; color: var(--muted); margin: 5px 0 0; }
.check-option { align-self: center; }
.check-option label { display: flex; gap: 9px; align-items: flex-start; font-weight: 500; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent-deep); flex: none; }
.run-actions { justify-content: start; }
.settings-note { font-size: .85rem; color: var(--muted); margin-top: 12px; }
.job { border-left: 3px solid var(--accent); padding: 12px 16px; margin-top: 20px; background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.job strong { font-size: .95rem; }
.job-meter { height: 6px; border-radius: 3px; background: #e5d7b7; overflow: hidden; margin-top: 10px; }
.job-meter span { display: block; height: 100%; background: var(--accent-deep); }
.job-meter.is-indeterminate span { width: 30%; animation: ocr-activity 1.5s ease-in-out infinite alternate; }
@keyframes ocr-activity { from { transform: translateX(0); } to { transform: translateX(230%); } }
.job-percent { font: .8rem var(--font-mono); }
.queue-section { margin-top: 24px; }
.queue-section h2 { font: 600 1.05rem var(--font); }
.image-queue { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.image-item { display: grid; grid-template-columns: 68px minmax(0,1fr); gap: 12px; padding: 12px; border: 1px solid var(--border); background: #fff; border-radius: 10px; }
.image-item.is-selected { border-color: var(--accent-deep); }
.image-select { position: relative; padding: 0; border: 1px solid var(--border); background: var(--bg); border-radius: 5px; cursor: pointer; height: 68px; overflow: hidden; }
.image-select img { width: 100%; height: 100%; object-fit: contain; display: block; }
.image-order { position: absolute; left: 2px; top: 2px; background: var(--fg); color: white; padding: 0 5px; font: 12px/20px var(--font-mono); border-radius: 3px; }
.image-info { display: grid; align-content: center; font-size: .8rem; color: var(--muted); min-width: 0; }
.image-info strong { color: var(--fg); font-size: .9rem; overflow-wrap: anywhere; }
.image-status { color: #3e6736; }
.image-status.is-error { color: #934821; }
.image-actions { grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 6px; }
.image-actions button { font: inherit; font-size: .8rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); padding: 6px 10px; min-height: 34px; }
.excel-side { position: sticky; top: 90px; min-width: 0; }
.source-preview { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.source-preview h2, .tips h2 { font: 600 1rem var(--font); }
.preview-name { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.source-stage { position: relative; background: #f1efe8; border: 1px solid var(--border); }
.source-stage img { width: 100%; display: block; }
.source-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.source-stage rect { fill: rgba(232,163,23,.22); stroke: #ab5000; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.preview-location { font-size: .85rem; color: var(--muted); margin: 10px 0 0; }
.tips { margin-top: 24px; font-size: .88rem; color: var(--muted); }
.tips ul { padding-left: 20px; display: grid; gap: 8px; }
.tips h2 { color: var(--fg); }
.excel-results { margin-top: 36px; border-top: 1px solid var(--border); padding-top: 28px; min-width: 0; }
.result-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; flex-wrap: wrap; }
.result-head h2 { font-size: 1.8rem; }
.result-count { margin: 0; color: var(--muted); }
.export-actions { justify-content: start; }
.export-actions .btn { padding-inline: 16px; }
.review-count, .export-note { color: var(--muted); font-size: .85rem; margin: 12px 0; }
.global-warnings { border-left: 3px solid #a36a0b; padding: 8px 12px; background: var(--accent-soft); font-size: .9rem; }
.grid-wrap { overflow: auto; max-height: 650px; border: 1px solid #c9c1af; border-radius: 10px; background: #fff; }
.result-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .86rem; }
.result-grid td, .result-grid th { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); vertical-align: top; text-align: left; }
.result-grid thead th { position: sticky; top: 0; background: #f4f1e8; z-index: 1; padding: 12px; }
.result-grid tbody th { font-weight: 400; }
.result-grid td textarea { width: 100%; min-width: 150px; display: block; border: 0; resize: vertical; background: transparent; color: var(--fg); font: inherit; padding: 12px; min-height: 44px; line-height: 1.5; }
.result-grid .header-edit { min-width: 140px; width: 100%; border: 1px solid #b9b19f; border-radius: 4px; padding: 7px; background: #fff; font: inherit; font-weight: 600; }
.result-grid .include-cell { min-width: 70px; padding: 12px; text-align: center; }
.source-cell { min-width: 155px; max-width: 210px; padding: 10px; }
.source-cell button { border: 0; padding: 0; background: none; color: var(--accent-deep); font: inherit; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.source-cell small { display: block; color: var(--muted); }
.review-flag { display: block; font-size: .73rem; font-weight: 500; color: #8a4c00; line-height: 1.4; margin-top: 5px; }
.uncertain-cell { background: #fff3d8; }
.result-grid .is-excluded { opacity: .55; background: #f3f2ef; }
.pagination { display: flex; justify-content: end; gap: 16px; align-items: center; margin-top: 12px; font-size: .85rem; }
.pagination button { font: inherit; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 8px 14px; min-height: 40px; }
.excel-explainer { margin-top: 54px; max-width: 820px; }
.excel-explainer h2 { font-size: 1.5rem; }
.excel-explainer p { color: var(--muted); }
[hidden] { display: none !important; }
@media (max-width: 900px) { .excel-workspace { grid-template-columns: minmax(0,1fr); } .excel-side { position: static; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; } .tips { margin-top: 0; } }
@media (max-width: 520px) {
  .excel-main .container { padding-inline: 16px; }
  .excel-hero { padding-top: 32px; }
  .excel-steps { gap: 9px; font-size: .77rem; flex-wrap: wrap; }
  .excel-side, .ocr-options { grid-template-columns: minmax(0,1fr); }
  .drop-zone { padding: 22px 14px; }
  .upload-actions .btn { width: 100%; }
  .run-actions .btn { flex: 1; padding-inline: 12px; white-space: nowrap; }
  .export-actions { width: 100%; }
  .export-actions .btn-primary { width: 100%; }
  .export-actions .btn-ghost { flex: 1; }
  .site-header .container { gap: 0; padding-block: 8px; }
  .site-header nav a { font-size: .83rem; padding: 8px; }
  .tips { margin-top: 0; }
}
