:root {
  color-scheme: light;
  --ink: #231d19;
  --muted: #6d6762;
  --paper: #f5f1eb;
  --surface: #fffefa;
  --line: #ddd5ca;
  --brand: #4b2e21;
  --brand-dark: #2b1a13;
  --brand-soft: #eee2d8;
  --accent: #b98045;
  --danger: #a52720;
  --success: #1f6a43;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
s-app-nav:not(:defined) { display: none; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.hero { background: linear-gradient(125deg, var(--brand-dark), var(--brand)); color: #fff; padding: 28px max(24px, calc((100vw - 1180px) / 2)); display: flex; justify-content: space-between; gap: 20px; align-items: end; }
.hero h1 { font: 700 clamp(2rem, 5vw, 3.2rem)/1.05 Georgia, serif; margin: 6px 0; }
.hero p { margin: 8px 0 0; color: #eadfd8; max-width: 720px; }
.eyebrow { display: inline-block; letter-spacing: .13em; font-size: .72rem; font-weight: 850; }
.version { color: #eadfd8; font-size: .82rem; white-space: nowrap; }
main { max-width: 1180px; margin: 0 auto; padding: 24px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: clamp(18px, 3vw, 28px); margin-bottom: 18px; box-shadow: 0 8px 28px rgba(53, 36, 24, .05); }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 20px; }
.section-heading h2, .action-panel h2 { margin: 0 0 6px; font: 700 1.45rem/1.2 Georgia, serif; }
.section-heading p, .action-panel p { margin: 0; color: var(--muted); }
.step { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-bottom: 10px; border-radius: 50%; background: var(--brand); color: white; font-weight: 850; }
.upload-grid, .field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.drop-zone { min-height: 145px; border: 2px dashed #c5b6a8; border-radius: 12px; padding: 22px; display: flex; flex-direction: column; justify-content: center; gap: 7px; background: #fcf8f3; }
.drop-zone:hover { border-color: var(--brand); background: var(--brand-soft); }
.drop-title { font-weight: 800; font-size: 1.08rem; }
.drop-zone input { margin-top: 10px; }
.muted { color: var(--muted); }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.button { border: 1px solid var(--brand); border-radius: 9px; padding: 10px 15px; font-weight: 800; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; }
.button.primary { background: var(--brand); color: white; }
.button.primary:hover { background: var(--brand-dark); }
.button.secondary { background: white; color: var(--brand); }
.button:disabled { opacity: .48; cursor: not-allowed; }
.progress-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.progress-head h2 { margin: 5px 0 15px; }
.progress-track { height: 13px; border-radius: 999px; overflow: hidden; background: #e6dfd7; }
.progress-bar { width: 0; height: 100%; background: linear-gradient(90deg, var(--accent), var(--brand)); transition: width .25s ease; }
.notice { border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.notice.warning { border: 1px solid #dc8c85; background: #fff5f4; color: #7e1b15; }
.notice.success { border: 1px solid #8cc3a5; background: #f1fbf5; color: #165637; }
.field-shell { display: flex; flex-direction: column; gap: 7px; }
.field-shell.full { grid-column: 1 / -1; margin-bottom: 16px; }
.field-shell label { font-weight: 800; }
.field-shell input, .field-shell select, .field-shell textarea { width: 100%; border: 1px solid #bdb4a9; border-radius: 8px; background: white; padding: 10px 11px; color: var(--ink); }
.field-shell input:focus, .field-shell select:focus, .field-shell textarea:focus { outline: 3px solid #dfcdbd; border-color: var(--brand); }
.weight-pair { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.field-warning details { margin-top: 2px; padding: 9px 10px; border-radius: 7px; border-left: 4px solid var(--danger); background: #fff5f4; color: var(--danger); }
.field-warning summary { cursor: pointer; font-weight: 850; }
.preview-details { margin-top: 2px; border: 1px solid var(--line); border-radius: 8px; }
.preview-details summary { padding: 10px; cursor: pointer; font-weight: 800; }
.description-preview { padding: 16px; border-top: 1px solid var(--line); background: white; }
.calculation-note { border-radius: 9px; padding: 12px; background: var(--brand-soft); display: flex; gap: 18px; align-items: center; }
.count { color: var(--muted); font-weight: 500; }
.check-row { display: flex; align-items: center; gap: 9px; margin-top: 18px; font-weight: 700; }
.check-row input { width: 18px; height: 18px; }
.enable-write { padding: 13px; border-radius: 9px; background: #fff7dd; border: 1px solid #dcb965; }
.photo-order { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.photo-card { border: 1px solid var(--line); border-radius: 10px; padding: 9px; background: white; }
.photo-card img { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; display: block; }
.photo-card strong { display: block; margin: 7px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-controls { display: flex; gap: 5px; }
.photo-controls button { flex: 1; border: 1px solid var(--line); background: #faf8f5; border-radius: 6px; padding: 5px; }
.action-panel { border-top: 4px solid var(--brand); }
#openProductLink { margin-top: 14px; }
@media (max-width: 760px) {
  .hero { align-items: start; flex-direction: column; }
  .upload-grid, .field-grid { grid-template-columns: 1fr; }
  .field-shell.full { grid-column: auto; }
  .section-heading { flex-direction: column; }
}
