:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18212f;
  background: #f5f7f9;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar { max-width: 1180px; margin: 0 auto; padding: 42px 24px 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
h1 { margin: 5px 0 6px; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.02; letter-spacing: -0.04em; }
h2 { margin: 4px 0 0; font-size: 1.45rem; }
h3 { margin: 2px 0 0; }
.subtitle { margin: 0; color: #5d6877; max-width: 720px; }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: .72rem; font-weight: 750; color: #586574; }
.privacy-badge { border: 1px solid #b8d8c6; background: #edf8f1; padding: 9px 13px; border-radius: 999px; font-size: .86rem; font-weight: 650; white-space: nowrap; }
main { max-width: 1180px; margin: 0 auto; padding: 0 24px 70px; }
.steps { display: flex; gap: 8px; margin: 6px 0 18px; overflow-x: auto; }
.step { border: 1px solid #d4d9df; background: white; color: #66717e; padding: 9px 14px; border-radius: 999px; }
.step.active { color: #111827; border-color: #777f89; font-weight: 700; }
.panel { background: white; border: 1px solid #dde2e7; border-radius: 18px; padding: 24px; margin: 16px 0; box-shadow: 0 8px 26px rgba(15, 23, 42, .035); }
.disabled-section { opacity: .52; pointer-events: none; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.info-box { background: #f4f7fa; border-left: 3px solid #8090a1; padding: 12px 14px; border-radius: 9px; margin: 14px 0 18px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: grid; gap: 6px; font-weight: 650; font-size: .9rem; }
input, select { width: 100%; border: 1px solid #cfd6dd; border-radius: 9px; background: white; padding: 10px 11px; color: #17202b; }
input:focus, select:focus { outline: 2px solid #aab5c0; outline-offset: 1px; }
.upload-zone { position: relative; margin-top: 18px; border: 1.5px dashed #b7c0ca; border-radius: 14px; padding: 30px 22px; text-align: center; background: #fbfcfd; }
.upload-zone.dragging { border-style: solid; background: #f0f4f7; }
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone button { position: relative; z-index: 2; }
.muted { color: #697583; font-size: .88rem; }
.primary, .secondary, .icon-button { border-radius: 9px; padding: 9px 13px; border: 1px solid #c8d0d8; }
.primary { background: #18212f; color: white; border-color: #18212f; font-weight: 700; }
.secondary { background: white; color: #243041; }
.icon-button { background: #fff; color: #7b3340; }
.link-button { border: 0; background: transparent; color: #3d5f7d; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.message { padding: 12px 14px; border-radius: 9px; margin-top: 14px; }
.error { background: #fff1f2; border: 1px solid #fecdd3; color: #881337; }
.success { background: #effaf3; border: 1px solid #bbefca; color: #14532d; }
.warning { background: #fff8e8; border: 1px solid #f5dda0; color: #68450a; }
.hidden { display: none !important; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.summary-tile { background: #f7f8fa; border-radius: 12px; padding: 13px; }
.summary-tile strong { display: block; font-size: 1.45rem; }
.technical-details { margin-top: 18px; }
pre { overflow: auto; background: #111827; color: #e5edf7; padding: 15px; border-radius: 10px; font-size: .78rem; }
.profile-card { border: 1px solid #dce2e8; border-radius: 14px; padding: 17px; margin: 12px 0; }
.profile-header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.profile-status { font-size: .8rem; font-weight: 700; color: #6b7280; }
.component-row { display: grid; grid-template-columns: 1.1fr 1.25fr .7fr 1.4fr; gap: 10px; padding: 13px 0; border-top: 1px solid #edf0f3; align-items: end; }
.component-row .checkbox-label { grid-column: span 2; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.component-row .checkbox-label input { width: auto; }
.component-why { justify-self: start; align-self: center; }
.preview-card { position: relative; border: 2px solid #c8ced6; border-radius: 14px; padding: 24px; overflow: hidden; min-height: 220px; }
.preview-card::after { content: attr(data-watermark); position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(1.2rem, 4vw, 2.7rem); font-weight: 850; color: rgba(88, 98, 110, .14); transform: rotate(-18deg); pointer-events: none; white-space: nowrap; }
.preview-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.preview-metric { background: #f6f8fa; border-radius: 10px; padding: 12px; }
.preview-metric strong { display: block; font-size: 1.3rem; }
.actions { margin-top: 16px; display: flex; align-items: center; gap: 12px; }
.final-report { margin-top: 18px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid #e3e7eb; text-align: left; }
th:last-child, td:last-child { text-align: right; }
dialog { width: min(540px, calc(100% - 32px)); border: 1px solid #d8dee5; border-radius: 16px; padding: 0; box-shadow: 0 25px 70px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(13, 20, 31, .5); }
dialog form { padding: 24px; position: relative; }
.dialog-close { position: absolute; right: 14px; top: 12px; border: 0; background: transparent; font-size: 1.6rem; }
@media (max-width: 800px) {
  .topbar { display: block; }
  .privacy-badge { display: inline-block; margin-top: 18px; }
  .form-grid.three, .summary-grid, .preview-metrics { grid-template-columns: 1fr 1fr; }
  .component-row { grid-template-columns: 1fr 1fr; }
  .section-heading { display: block; }
  .why-button { margin-top: 8px; }
}
@media (max-width: 520px) {
  .form-grid.three, .summary-grid, .preview-metrics, .component-row { grid-template-columns: 1fr; }
  .component-row .checkbox-label { grid-column: auto; }
}

/* MVP usability refinements: template-first import, profile-level legal status,
   and a result-oriented step 3 instead of repeating import metrics. */
.onboarding-card { border: 1px solid #dce2e8; border-radius: 14px; padding: 16px; margin: 14px 0 18px; background: #fbfcfd; }
.onboarding-card > div:first-child { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.onboarding-card > div:first-child span { color: #697583; font-size: .88rem; }
.onboarding-card details { margin-top: 13px; }
.button-link { display: inline-block; text-decoration: none; }
.column-table-wrap { overflow-x: auto; margin-top: 10px; }
.column-table th:last-child, .column-table td:last-child { text-align: left; white-space: nowrap; }
code { background: #f0f3f6; padding: 2px 5px; border-radius: 5px; }
.participation-block { margin: 0 0 12px; }
.participation-control, .participation-fixed { border: 1px solid #e1e6eb; background: #f8fafb; border-radius: 11px; padding: 13px; }
.participation-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: end; }
.participation-help { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; font-size: .86rem; }
.participation-help a, .info-box a { color: #3d5f7d; }
.participation-fixed { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.participation-fixed div { display: flex; flex-direction: column; gap: 3px; }
.participation-fixed span { color: #697583; font-size: .86rem; }
.checklist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 18px; }
.checklist-grid > div { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: start; border: 1px solid #e1e6eb; border-radius: 11px; padding: 12px; }
.checklist-grid > div > span { grid-row: span 2; font-weight: 800; }
.checklist-grid small { color: #697583; }
.locked-report { margin: 16px 0; }
.locked-value { display: inline-block; filter: blur(3.5px); user-select: none; letter-spacing: .08em; }
.report-includes { display: grid; gap: 5px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #e3e7eb; }
.report-includes strong { margin-bottom: 2px; }
@media (max-width: 800px) {
  .participation-control { grid-template-columns: 1fr; }
  .checklist-grid { grid-template-columns: 1fr; }
}
.excluded-profile-note { background: #f5f7f9; border: 1px solid #e0e5ea; border-radius: 10px; padding: 12px; color: #596574; font-size: .9rem; }

/* Shopify-native import and one-time shipping setup. */
.source-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px 12px; align-items: center; }
.source-card > div:first-child { margin-bottom: 0; }
.source-card details { grid-column: 1 / -1; }
.source-summary { margin: 14px 0; border: 1px solid #d9e3ea; border-radius: 12px; padding: 12px 14px; background: #f7fafc; }
.source-summary strong { display: block; margin-bottom: 3px; }
.source-summary span { color: #697583; font-size: .9rem; }
.shipping-setup { margin: 18px 0 24px; }
.shipping-setup > h3 { margin-bottom: 4px; }
.shipping-method-card { border: 1px solid #dce2e8; border-radius: 12px; padding: 14px; margin-top: 10px; background: #fbfcfd; }
.shipping-method-card h4 { margin: 0 0 4px; }
.shipping-method-card .method-question { margin: 12px 0; }
.shipping-method-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .7fr); gap: 12px; }
.shipping-method-note { margin-top: 9px; color: #697583; font-size: .88rem; }
.product-title-meta { display: block; color: #697583; font-size: .82rem; margin-top: 2px; font-weight: 500; }
.import-warning-list { margin: 8px 0 0; padding-left: 20px; }
@media (max-width: 800px) {
  .source-card { grid-template-columns: 1fr; }
  .source-card details { grid-column: auto; }
  .shipping-method-controls { grid-template-columns: 1fr; }
}
.header-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.language-control { display: flex; grid-template-columns: auto auto; align-items: center; gap: 8px; font-size: .8rem; }
.language-control select { width: auto; padding: 8px 10px; }
.report-context-card, .responsibility-card { border: 1px solid #dfe5ea; border-radius: 14px; padding: 16px; margin: 18px 0; background: #fbfcfd; }
.section-heading.compact { margin-bottom: 10px; }
.inline-help { border: 1px solid #ccd5de; background: white; border-radius: 999px; width: 22px; height: 22px; padding: 0; font-size: .75rem; }
.confirm-row { grid-template-columns: 22px 1fr; align-items: start; font-weight: 500; margin: 10px 0; }
.confirm-row input { width: 18px; height: 18px; margin-top: 3px; }
.message.subtle { margin-top: 14px; }
.final-report-header { display:flex; justify-content:space-between; gap:20px; align-items:flex-start; flex-wrap:wrap; }
.final-report-actions { display:flex; flex-wrap:wrap; gap:8px; margin: 16px 0; }
.report-meta { display:grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap:10px; margin:14px 0; }
.report-meta > div { padding:10px; border:1px solid #e1e6eb; border-radius:10px; }
.report-meta span { display:block; color:#687382; font-size:.78rem; }
.report-notice { font-size:.86rem; color:#505b68; border-top:1px solid #e1e6eb; padding-top:14px; margin-top:18px; }
@media (max-width: 760px) { .header-actions { justify-content:flex-start; } .report-meta { grid-template-columns: 1fr; } }
@media print { .topbar, .steps, #import, #profiles, .actions, .final-report-actions, #readiness, #preview-card, .report-context-card, .responsibility-card { display:none !important; } body { background:white; } main { max-width:none; padding:0; } #preview { border:0; box-shadow:none; padding:0; } #final-report { display:block !important; } }
.profile-copy-control { margin-top: 14px; border-top: 1px solid #e5e9ed; padding-top: 12px; }
.profile-copy-control summary { cursor: pointer; font-weight: 700; }
.profile-copy-list { display:grid; gap:6px; max-height:220px; overflow:auto; margin:10px 0; }
.copy-option { grid-template-columns:20px 1fr; align-items:start; font-weight:500; }
.copy-option input { width:16px; height:16px; margin-top:3px; }

.runtime-badge { border:1px solid #c8d0d8; background:#fff; border-radius:999px; padding:7px 10px; font-size:.72rem; font-weight:800; letter-spacing:.06em; }

/* Dedicated test harness. It is exposed only by APP_MODE=testing. */
.test-harness-panel { border: 2px dashed #8796a8; background: #f8fafc; }
.test-harness-controls { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 12px; align-items: end; }
.test-expected { margin-top: 14px; padding: 14px; border: 1px solid #dce2e8; border-radius: 12px; background: #fff; }
.test-expected-grid { display:grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap:10px; margin-top:10px; }
.test-expected-grid > div { border:1px solid #e1e6eb; border-radius:10px; padding:10px; }
.test-expected-grid span { display:block; color:#687382; font-size:.78rem; }
.demo-notice-panel { background:#eef6ff; border-color:#bfdbfe; }
@media (max-width: 760px) { .test-harness-controls, .test-expected-grid { grid-template-columns: 1fr; } }

/* Production UI direction ---------------------------------------------------
   Editable controls use a deliberately neutral surface. Read-only status,
   audit and summary areas use a calm blue/teal tint so users can distinguish
   "input" from "system result" without relying on disabled styling alone. */
:root {
  --page-bg: #f4f7f8;
  --surface: #ffffff;
  --surface-editable: #ffffff;
  --surface-readonly: #edf6f5;
  --surface-readonly-strong: #e5f0f2;
  --surface-accent: #eaf1f8;
  --ink: #17212b;
  --muted-ink: #627080;
  --border: #d7e0e3;
  --brand: #214f55;
  --brand-hover: #183f44;
  --focus: #7ca7ad;
}
:root { color: var(--ink); background: var(--page-bg); }
body { background: var(--page-bg); }
.topbar {
  max-width: 1180px;
  margin-top: 18px;
  border: 1px solid #d7e5e4;
  border-radius: 24px;
  background: linear-gradient(135deg, #e9f4f1 0%, #edf3f9 100%);
  padding: 34px 30px;
  box-shadow: 0 18px 48px rgba(34, 66, 72, .07);
}
main { padding-top: 16px; }
.panel { border-color: var(--border); box-shadow: 0 10px 30px rgba(35, 58, 64, .045); }
.primary { background: var(--brand); border-color: var(--brand); }
.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
input, select, textarea { background: var(--surface-editable); border-color: #cbd5d9; }
input:focus, select:focus, textarea:focus { outline-color: var(--focus); }
.editable-surface {
  background: var(--surface-editable) !important;
  border: 1px solid #d7dee1 !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}
.read-only-surface,
.summary-tile,
.source-summary,
.checklist-grid > div,
.report-meta > div,
.test-expected-grid > div {
  background: var(--surface-readonly);
  border-color: #cfe0df;
}
.info-box { background: var(--surface-accent); border-left-color: #698da5; }
.runtime-badge { background: rgba(255,255,255,.72); border-color: #c8d7da; }
.privacy-badge { background: #e1f1e9; border-color: #bad7c7; }
.step.active { background: var(--surface-readonly-strong); border-color: #9ebabc; color: #173b40; }

.quantity-control { border: 1px solid #cfe0df; border-radius: 12px; padding: 13px; margin: 0 0 14px; }
.quantity-summary { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)) auto; gap: 10px; align-items: center; }
.quantity-summary > div span { display:block; color: var(--muted-ink); font-size:.76rem; }
.quantity-summary > div strong { display:block; margin-top:2px; font-size:1.05rem; }
.quantity-badge { justify-self:end; padding:5px 9px; border-radius:999px; border:1px solid #cbdad9; background:rgba(255,255,255,.72); font-size:.74rem; font-weight:750; }
.quantity-badge.adjusted { background:#fff5df; border-color:#eed29a; color:#6d4b0d; }
.quantity-adjustment { margin-top:10px; }
.quantity-adjustment summary { cursor:pointer; font-weight:700; color:#315b61; }
.quantity-adjustment-form { display:grid; grid-template-columns: minmax(130px,.65fr) minmax(220px,1fr); gap:12px; margin-top:10px; border-radius:11px; padding:12px; }
.quantity-note-label { grid-column:1 / -1; }
.quantity-adjustment-actions { grid-column:1 / -1; display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.quantity-adjustment-form .muted { grid-column:1 / -1; margin:0; }
.adjustment-summary-card { display:flex; flex-direction:column; gap:4px; padding:14px 16px; border:1px solid #cfe0df; border-radius:13px; margin:18px 0; }
.adjustment-summary-card ul, .report-adjustments ul { margin:8px 0 0; padding-left:20px; }
.report-adjustments { margin:16px 0; padding:14px; border:1px solid #cfe0df; border-radius:12px; }

/* Editable packaging cards stay neutral while their system-generated quantity
   and status elements use the tinted read-only surface. */
.profile-card { background: var(--surface-editable); }
.shipping-method-card, .participation-control { background: var(--surface-editable); }
.participation-fixed, .excluded-profile-note { background: var(--surface-readonly); }

@media (max-width: 800px) {
  .topbar { margin: 10px 12px 0; padding: 26px 20px; }
  .quantity-summary { grid-template-columns: 1fr 1fr; }
  .quantity-badge { grid-column:1 / -1; justify-self:start; }
  .quantity-adjustment-form { grid-template-columns:1fr; }
  .quantity-note-label, .quantity-adjustment-actions, .quantity-adjustment-form .muted { grid-column:auto; }
}

/* Production source import / generic CSV mapper */
.source-options-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:16px 0; }
.source-options-grid .source-card { min-height:148px; align-content:start; }
.csv-mapper { margin:18px 0; border:1px solid #d6dce5; border-radius:16px; padding:18px; background:#fff; }
.mapping-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.mapping-field { display:grid; gap:5px; }
.mapping-field small { color:#687386; }
.mapping-preview { overflow:auto; margin-top:14px; border:1px solid #dde3ea; border-radius:12px; background:#f7f9fb; }
.mapping-preview table { min-width:720px; width:100%; border-collapse:collapse; }
.mapping-preview th,.mapping-preview td { padding:8px 10px; border-bottom:1px solid #e6ebf0; text-align:left; font-size:.84rem; white-space:nowrap; }
.mapper-defaults { margin-top:12px; max-width:420px; }
@media (max-width: 900px) { .source-options-grid,.mapping-grid { grid-template-columns:1fr; } }
.account-box{display:flex;align-items:center;gap:8px;font-size:.85rem}.site-footer{max-width:1180px;margin:28px auto;padding:20px;display:flex;justify-content:space-between;gap:20px;border-top:1px solid #d9e0e8}.site-footer nav{display:flex;gap:16px}.legal-page{max-width:760px;margin:48px auto;padding:0 20px;line-height:1.65}.legal-page p{margin:16px 0}

/* Final production workflow additions */
.source-options-grid-two { grid-template-columns:repeat(2,minmax(0,1fr)); }
.workspace-card { margin-top:18px; padding:16px; border:1px solid var(--border); border-radius:16px; }
.workspace-files { display:grid; gap:8px; }
.workspace-file { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:10px 12px; border:1px solid #cfe0df; border-radius:11px; background:rgba(255,255,255,.62); }
.workspace-file span { display:block; color:var(--muted-ink); font-size:.78rem; margin-top:3px; }
.exception-review { margin-top:22px; }
.bulk-resolution { padding:14px; border-radius:14px; margin-bottom:12px; }
.exception-row { display:grid; grid-template-columns:minmax(220px,1fr) minmax(180px,.75fr) minmax(180px,.7fr) auto; gap:12px; align-items:end; border:1px solid var(--border); border-radius:13px; padding:12px; margin:8px 0; }
.exception-row > div span,.exception-row > div small { display:block; color:var(--muted-ink); margin-top:3px; }
.shipping-strategy-card { margin-top:20px; padding:18px; border:1px solid var(--border); border-radius:16px; }
.inset-box { margin:12px 0; padding:12px; border:1px solid #cfe0df; border-radius:12px; }
#shipping-method-map { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px; }
.usage-row { display:grid; grid-template-columns:minmax(180px,1fr) minmax(110px,.4fr) minmax(170px,.7fr) auto; gap:10px; align-items:end; margin:8px 0; }
.operator-reconciliation { margin-top:22px; padding-top:18px; border-top:1px solid var(--border); }
.operator-card { padding:16px; margin:12px 0; border:1px solid var(--border); border-radius:14px; }
.operator-head { display:flex; justify-content:space-between; align-items:end; gap:12px; }
.operator-head > label { flex:1; }
.allocation-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:14px; }
.hash-text { overflow-wrap:anywhere; font-size:.76rem; }
.zero-report-row { margin:14px 0; padding:13px; border:1px solid var(--border); border-radius:13px; }
.confirmation-list { display:grid; gap:8px; }
.table-scroll { overflow:auto; }
@media (max-width:900px){ .source-options-grid-two,.exception-row,#shipping-method-map,.usage-row,.allocation-grid{grid-template-columns:1fr;} .operator-head{align-items:stretch;flex-direction:column;} }

.upload-zone.drag-active { outline: 2px solid currentColor; outline-offset: 2px; }

/* Product-to-packaging-profile mapping -------------------------------------
   Source product identifiers remain immutable. The merchant explicitly maps
   them to reusable packaging profiles; several products may share one profile. */
.product-mapping-list { display:grid; gap:12px; margin:14px 0 22px; }
.product-mapping-row { padding:16px; border-radius:14px; }
.product-mapping-head { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; margin-bottom:12px; }
.product-mapping-head h4 { margin:0 0 3px; }
.product-mapping-controls { display:grid; grid-template-columns:minmax(240px,1fr) auto; gap:12px; align-items:end; }
.mapping-confirm-row { margin-top:12px; }
.profile-library-heading { margin-top:26px; }
@media (max-width:800px) {
  .product-mapping-head { flex-direction:column; }
  .product-mapping-controls { grid-template-columns:1fr; }
}
