:root {
  --ink: #273250;
  --muted: #68728b;
  --line: #dfe4ef;
  --line-strong: #c4ccdc;
  --paper: #ffffff;
  --canvas: #f6f8fc;
  --soft: #eef1f8;
  --blue: #4268fa;
  --blue-dark: #3154d6;
  --teal: #167c69;
  --teal-soft: #edf7f3;
  --amber: #9b651b;
  --amber-soft: #fff7e8;
  --red: #9b4037;
  --red-soft: #fff2f0;
  --focus: #8fa6ff;
  --shadow: 0 20px 52px rgba(39, 50, 80, 0.1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body[data-audience="customer"] .internal-only { display: none !important; }
body[data-audience="internal"] .customer-only { display: none !important; }

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "DM Sans", Aptos, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, .drop-zone:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 78%, white);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  left: 14px;
  top: -60px;
  z-index: 40;
  padding: 10px 14px;
  color: white;
  background: var(--blue);
  white-space: nowrap;
}
.skip-link:focus { top: 10px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  padding: 0 clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e6e9f2;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.brand-mark {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--blue);
  box-shadow: 0 5px 12px rgba(66, 104, 250, 0.22);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid white;
  border-left-color: transparent;
  transform: rotate(-45deg);
}
.customer-brand-lockup {
  min-width: 0;
  align-items: center;
}
body[data-audience="customer"] .customer-brand-lockup { display: inline-flex; }
.brand-logo {
  display: block;
  width: auto;
  height: 28px;
  flex: 0 0 auto;
}
.brand-product {
  margin-left: 7px;
  padding-left: 9px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-weight: 650;
}

.header-actions { display: flex; align-items: center; gap: 16px; }
.header-actions form { margin: 0; }
.header-link {
  min-height: 32px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: var(--soft);
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
}
.header-link:hover { color: var(--blue); border-color: #cdd7ff; background: #f4f6ff; }
.internal-label { color: var(--muted); font-size: 12px; }
.logout-button {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #445861;
  background: white;
  cursor: pointer;
}
.logout-button:hover { border-color: var(--blue); color: var(--blue); }

.page-shell {
  width: min(1180px, 100%);
  min-height: calc(100vh - 104px);
  margin: 0 auto;
  padding: 38px clamp(18px, 4vw, 48px) 56px;
}

.page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
  gap: 40px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

h1, h2, h3, p { overflow-wrap: anywhere; }
.page-heading h1 {
  grid-column: 1;
  margin: 0;
  max-width: 760px;
  font-size: 31px;
  line-height: 1.25;
  font-weight: 760;
  letter-spacing: 0;
}
.page-heading > p:last-child {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
body[data-audience="customer"] .page-heading {
  display: block;
  margin-bottom: 24px;
}
body[data-audience="customer"] .page-heading h1 {
  max-width: none;
  font-size: 38px;
  line-height: 1.18;
}
body[data-audience="customer"] .page-heading > p:last-child {
  max-width: 680px;
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.55;
}

.tool-surface {
  min-height: 480px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.workflow-active .page-heading { display: none; }
.workflow-active .page-shell { padding-top: 26px; }

.state-panel { display: none; min-height: 480px; padding: 32px; }
.state-panel.is-active { display: block; }
body[data-audience="customer"]:not(.workflow-active):not(.package-selected) .tool-surface {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
body[data-audience="customer"]:not(.workflow-active):not(.package-selected) #upload-state {
  min-height: 0;
  padding: 0;
}

.drop-zone {
  min-height: 260px;
  padding: 34px 28px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed #9eabc5;
  border-radius: 8px;
  background: #f9faff;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.drop-zone:hover, .drop-zone.is-dragging {
  border-color: var(--blue);
  background: #f5f7ff;
  box-shadow: inset 0 0 0 1px rgba(66, 104, 250, 0.08);
}
.drop-zone.has-error { border-color: var(--red); background: var(--red-soft); }
.drop-zone h2 { margin: 17px 0 6px; font-size: 25px; line-height: 1.25; text-wrap: balance; }
.drop-zone .file-badge + h2 { margin-top: 16px; }
.drop-zone p { max-width: 590px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.drop-zone .drop-instruction { color: #68758c; }
.drop-zone .package-rule { margin-top: 12px; color: #758197; font-size: 12px; font-weight: 650; }
.drop-zone .file-limit { margin-top: 13px; font-size: 11px; color: #89979d; }

.upload-symbol {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid #d9e0fb;
  border-radius: 8px;
  color: var(--blue);
  background: #eef2ff;
}
.upload-symbol svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.upload-guidance {
  width: 100%;
  padding: 22px 4px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr);
  gap: 20px 36px;
  color: var(--muted);
}
.guidance-main strong,
.partial-guidance strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}
.guidance-main p,
.partial-guidance p,
.proprietary-guidance,
.internal-upload-guidance {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}
.guidance-main small {
  display: block;
  margin-top: 5px;
  color: #7a8598;
  font-size: 12px;
  line-height: 1.5;
}
.partial-guidance {
  padding-left: 16px;
  border-left: 3px solid var(--teal);
}
.partial-guidance strong { color: #176f62; }
.proprietary-guidance {
  grid-column: 1 / -1;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: #7a8598;
  font-size: 12px;
}
.proprietary-guidance strong {
  color: #59667b;
  font-weight: 700;
}

.file-badge {
  padding: 6px 9px;
  color: var(--blue);
  border: 1px solid #c5d0ff;
  border-radius: 6px;
  background: #f1f4ff;
  font-size: 10px;
  font-weight: 800;
}

.upload-button {
  min-width: 174px;
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(49, 84, 214, 0.18);
}
.upload-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.selected-file {
  padding: 17px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
}
.selected-file:not([hidden]) { display: flex; }
.selected-file div { display: grid; gap: 3px; min-width: 0; }
.selected-file strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.selected-file span:last-child { color: var(--muted); font-size: 12px; }
.field-kicker { color: var(--teal) !important; font-size: 10px !important; font-weight: 800; }

.submission-form {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(240px, 1fr);
  gap: 14px;
  align-items: start;
}
.required-fields-note {
  grid-column: 1 / -1;
  margin: 0 0 -2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  text-align: right;
}
.required-fields-note span, .required-mark { color: var(--red); font-weight: 850; }
.required-mark { margin-left: 1px; }
.quantity-field, .submission-field {
  display: grid;
  grid-template-rows: auto minmax(44px, auto) auto;
  gap: 7px;
  color: #344b55;
  font-size: 12px;
  font-weight: 750;
}
.quantity-field { grid-template-rows: auto minmax(44px, auto) auto auto; }
.quantity-field .field-help {
  min-height: 15px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.45;
}
.field-label { display: flex; align-items: baseline; justify-content: flex-start; gap: 4px; }
.optional-label { color: var(--muted); font-size: 9px; font-weight: 550; }
.field-error {
  min-height: 0;
  color: var(--red);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.4;
}
.field-error:not([hidden]) { display: block; }
.customer-contact-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.legal-consent-block {
  grid-column: 1 / -1;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfe;
}
.legal-consent {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: #4f626b;
  font-size: 11px;
  line-height: 1.55;
}
.legal-consent input { width: 18px; min-height: 18px; margin: 1px 0 0; accent-color: var(--blue); }
.legal-consent a { color: var(--blue); }
.legal-consent-block .field-error { margin: 7px 0 0 28px; }
.legal-consent-block.has-error { border-color: #d99088; background: var(--red-soft); }
.cost-boundary {
  grid-column: 1 / -1;
  margin: 0;
  padding: 11px 13px;
  border-left: 3px solid var(--amber);
  color: #6e532d;
  background: var(--amber-soft);
  font-size: 11px;
  line-height: 1.55;
}
body[data-audience="customer"] .submission-form {
  grid-template-columns: 1fr;
}
body[data-audience="customer"] .quantity-field { width: calc((100% - 14px) / 2); }
body[data-audience="customer"] .submission-form > .primary-button { justify-self: start; }
input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid #adb7ca;
  border-radius: 10px;
  background: #fff;
}
input:hover { border-color: #7e8ba7; }
input[aria-invalid="true"] {
  border-color: #c45f54;
  background: #fffafa;
  box-shadow: 0 0 0 1px rgba(155, 64, 55, 0.08);
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 9999s ease-out 0s;
}
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 34px 10px 12px;
  color: var(--ink);
  border: 1px solid #adb7ca;
  border-radius: 10px;
  background: #fff;
}
select:hover { border-color: #7e8ba7; }
textarea {
  width: 100%;
  min-height: 126px;
  padding: 12px;
  resize: vertical;
  color: var(--ink);
  border: 1px solid #adb7ca;
  border-radius: 8px;
  background: #fff;
  line-height: 1.55;
}
textarea:hover { border-color: #7e8ba7; }
.retention-note {
  grid-column: 1 / -1;
  margin: 0;
  color: #7a8b92;
  font-size: 11px;
}

.primary-button, .secondary-button, .quiet-button {
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 760;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.primary-button { color: #fff; background: var(--blue); border-color: var(--blue); }
.primary-button:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.secondary-button { color: var(--blue); background: #fff; border-color: #b7c3e2; }
.secondary-button:hover { background: #f3f5ff; border-color: var(--blue); }
.quiet-button { min-height: 34px; padding: 6px 10px; color: #536970; background: #fff; border-color: #c1cdd2; }
button:active { transform: translateY(1px); }
button:disabled { cursor: wait; opacity: 0.58; }

.inline-error {
  grid-column: 1 / -1;
  padding: 11px 13px;
  border-left: 3px solid var(--red);
  color: #7f302b;
  background: var(--red-soft);
  font-size: 13px;
  line-height: 1.5;
}

.processing-panel { padding: 42px; }
.processing-head {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
}
.live-indicator { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.75); } }
.processing-panel h2 { margin: 62px 0 12px; font-size: 30px; line-height: 1.2; }
#processing-stage { min-height: 44px; margin: 0; color: var(--muted); line-height: 1.6; }
.progress-track { height: 8px; margin-top: 28px; overflow: hidden; border-radius: 99px; background: #e6eafb; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); box-shadow: 0 0 12px rgba(66, 104, 250, 0.28); transition: width 400ms ease; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 9px; color: var(--muted); font-size: 12px; }
.processing-time {
  margin-top: 24px;
  padding: 17px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfe;
}
.processing-time-primary { display: grid; gap: 5px; }
.processing-time-primary > span, #processing-elapsed { color: var(--muted); font-size: 11px; }
.processing-time-primary strong { color: var(--ink); font-size: 18px; }
#processing-elapsed { white-space: nowrap; }
.processing-note { margin-top: 22px; color: #7c879f; font-size: 12px; }

.confirmation-panel { padding: 32px 36px 38px; }
.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.section-heading h2 { margin: 4px 0 0; font-size: 24px; }
.count-badge {
  padding: 6px 9px;
  color: var(--blue);
  border: 1px solid #ccd6ff;
  border-radius: 7px;
  background: #f3f5ff;
  font-size: 11px;
  font-weight: 780;
}
.state-copy { margin: 16px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.parameter-section, .parsed-section { margin-top: 26px; }
.parameter-section h3, .parsed-section h3 { margin: 0 0 10px; color: #50666f; font-size: 12px; }
.parameter-grid, .parsed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.parameter-field, .parsed-item {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfe;
}
.parameter-field.is-required { border-left: 3px solid var(--amber); }
.parameter-field.has-error {
  border-color: #c45f54;
  border-left-color: #c45f54;
  background: #fffafa;
  box-shadow: 0 0 0 2px rgba(155, 64, 55, 0.07);
}
.parameter-field.has-error .parameter-menu-trigger,
.parameter-field.has-error .parameter-choice-grid,
.parameter-field.has-error .parameter-input { border-color: #c45f54; }
.parameter-field:focus-within { border-color: #afbbe0; background: #fcfcff; box-shadow: 0 0 0 2px rgba(66, 104, 250, 0.07); }
.parameter-field.has-open-menu { position: relative; z-index: 8; border-color: #94a7ef; }
.parameter-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 760; }
.source-tag { padding: 3px 6px; border-radius: 5px; color: var(--muted); background: var(--soft); font-size: 9px; font-weight: 650; }
.parameter-controls { margin-top: 10px; display: grid; gap: 8px; }
.parameter-controls .parameter-input,
.parameter-controls .parameter-select {
  min-height: 46px;
  border-color: #aeb8cc;
  background: var(--paper);
  font-size: 13px;
}
.parameter-menu { position: relative; min-width: 0; }
.parameter-menu-trigger {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #aeb8cc;
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.parameter-menu-trigger:hover { border-color: #7e8ba7; background: #fbfcff; }
.parameter-menu.is-open .parameter-menu-trigger {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(66, 104, 250, 0.1);
}
.parameter-menu-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.parameter-menu-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid #74809a;
  border-bottom: 2px solid #74809a;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 150ms ease;
}
.parameter-menu.is-open .parameter-menu-chevron { transform: translateY(2px) rotate(225deg); }
.parameter-menu-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 12;
  max-height: 248px;
  padding: 5px;
  overflow-y: auto;
  border: 1px solid #aeb8cc;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 14px 30px rgba(39, 50, 80, 0.16);
}
.parameter-menu-option {
  width: 100%;
  min-height: 38px;
  padding: 8px 34px 8px 10px;
  position: relative;
  border: 0;
  border-radius: 5px;
  color: #46526d;
  background: transparent;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}
.parameter-menu-option:hover,
.parameter-menu-option:focus-visible { color: var(--blue-dark); background: #f2f5ff; outline: 0; }
.parameter-menu-option.is-selected { color: var(--blue-dark); background: #edf1ff; font-weight: 760; }
.parameter-menu-option.is-selected::after {
  content: "\2713";
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--blue);
  transform: translateY(-50%);
}
.parameter-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid #d5dbea;
  border-radius: 10px;
  background: var(--soft);
}
.parameter-choice-grid[data-choice-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.parameter-choice-grid[data-choice-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.parameter-choice-grid[data-choice-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.parameter-choice { position: relative; min-width: 0; cursor: pointer; }
.parameter-choice input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
}
.parameter-choice span {
  min-height: 38px;
  padding: 8px 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #53607c;
  background: transparent;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.parameter-choice:hover span { color: var(--blue); background: rgba(255, 255, 255, 0.72); }
.parameter-choice input:checked + span { color: white; background: var(--blue); box-shadow: 0 4px 10px rgba(66, 104, 250, 0.22); }
.parameter-choice input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--focus) 78%, white); outline-offset: 2px; }
.parameter-field > small { display: block; margin-top: 9px; }
.parameter-field small, .parsed-item small { color: #74809a; font-size: 10px; line-height: 1.45; }
.parsed-item { min-height: 78px; display: grid; align-content: start; gap: 5px; }
.parsed-item > span { color: var(--muted); font-size: 10px; }
.parsed-item > strong { font-size: 13px; }
.action-row { margin-top: 24px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.result-panel { padding: 30px 34px 36px; }
body[data-audience="customer"] .result-panel { padding-bottom: 112px; }
.result-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 24px 32px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.result-summary { min-width: 0; }
.estimate-scope-label { margin-top: 20px !important; }
.estimate-value-row {
  margin-top: 6px;
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 18px 28px;
}
.result-heading .eyebrow { margin: 0; color: var(--muted); }
.result-status { margin: 0; color: var(--ink); font-size: 13px; font-weight: 760; }
.result-status.is-ready { color: var(--teal); }
.result-status.is-review,
.result-status.is-partial { color: var(--amber); }
.result-actions { display: flex; align-items: center; gap: 9px; }
.result-actions .secondary-button {
  min-height: 38px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 11px;
  white-space: nowrap;
}
.currency-control {
  min-width: 0;
  margin: 0 0 4px;
  padding: 0;
  border: 0;
}
.currency-control legend {
  margin: 0 0 6px;
  padding: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 760;
}
.currency-options {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper);
}
.currency-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}
.currency-option + .currency-option { border-left: 1px solid var(--line-strong); }
.currency-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.currency-option span {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #52666f;
  background: var(--paper);
  font-size: 11px;
  font-weight: 780;
  transition: color 140ms ease, background-color 140ms ease;
}
.currency-option:hover span { color: var(--blue); background: #f3f7f8; }
.currency-option input:checked + span { color: white; background: var(--blue); }
.currency-option input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--focus) 78%, white);
  outline-offset: -3px;
}
.quote-request-status {
  margin: 12px 0 0;
  padding: 10px 12px;
  color: #195b49;
  border-left: 3px solid var(--teal);
  background: var(--teal-soft);
  font-size: 12px;
  line-height: 1.5;
}
.estimate-range {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: 46px;
  line-height: 1.05;
  font-weight: 770;
}
.estimate-range-detail {
  margin: 9px 0 0;
  color: #4f5e7b;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.estimate-meta {
  margin: 11px 0 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}
.estimate-meta strong { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.estimate-context { margin: 5px 0 0; color: #7a898f; font-size: 10px; }

.quantity-simulator {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(160px, 190px) auto;
  align-items: end;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.quantity-reference, .simulation-quantity-field { display: grid; gap: 7px; min-width: 0; }
.quantity-reference span, .simulation-quantity-field span { color: var(--muted); font-size: 10px; font-weight: 720; }
.quantity-reference strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.simulation-quantity-field input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: white;
  font-variant-numeric: tabular-nums;
}
.compact-action { min-height: 40px; padding: 8px 16px; white-space: nowrap; }
.quantity-update-message { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.quantity-update-message.is-error { color: var(--red); }

.cost-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cost-module-card {
  min-height: 118px;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 6px;
  border-right: 1px solid var(--line);
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  color: var(--ink);
  background: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}
.cost-module-card:hover { background: #f4f8f9; }
.cost-module-card:hover .module-card-arrow { transform: translateX(3px); }
.cost-module-card-static,
.cost-module-card-static:hover {
  background: var(--paper);
  cursor: default;
  transition: none;
}
.module-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}
.module-card-arrow {
  color: var(--blue);
  font-size: 16px;
  transition: transform 180ms ease;
}
.cost-module-card > strong { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.module-unit-cost { display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 9px; }
.module-unit-cost b { color: #425861; font-size: 11px; font-variant-numeric: tabular-nums; }
.module-card-meta { display: grid; gap: 3px; }
.cost-summary small { display: block; color: #71828a; font-size: 10px; }
.cost-summary .module-status { font-weight: 700; }
.cost-summary .module-status.is-complete { color: var(--teal); }
.cost-summary .module-status.is-partial { color: #8a5a13; }
.cost-summary .module-status.is-unavailable { color: var(--amber); }
.cost-summary .module-status.is-failed { color: var(--red); }

.estimate-warning {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--amber);
  color: #6e4e19;
  background: var(--amber-soft);
  font-size: 12px;
  line-height: 1.55;
}

.detail-section { border-bottom: 1px solid var(--line); }
.detail-section summary {
  min-height: 74px;
  padding: 17px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  list-style: none;
  cursor: pointer;
}
.detail-section summary::-webkit-details-marker { display: none; }
.detail-section summary > span:first-child { display: grid; gap: 4px; }
.detail-section summary strong { font-size: 15px; }
.detail-section summary small { color: var(--muted); font-size: 11px; font-weight: 400; }
.summary-action { color: var(--blue); font-size: 10px; }
.detail-content { padding: 0 0 26px; }
.detail-content h3, .issue-block h3 {
  margin: 22px 0 10px;
  color: #50666f;
  font-size: 12px;
  font-weight: 760;
}

.file-state-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.file-state {
  min-height: 72px;
  padding: 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.file-state span { display: block; color: var(--muted); font-size: 10px; }
.file-state strong { display: block; margin-top: 7px; font-size: 12px; }
.file-state small {
  display: block;
  margin-top: 8px;
  color: #7a8990;
  font-size: 9px;
  line-height: 1.45;
}
.file-state.is-good strong { color: var(--teal); }
.file-state.is-review strong { color: var(--amber); }
.file-state.is-missing strong { color: var(--amber); }
.ready-note { margin: 14px 0 0; padding: 11px 13px; color: #225e4f; background: var(--teal-soft); font-size: 12px; }

.issue-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.issue-list li {
  position: relative;
  padding: 11px 4px 11px 24px;
  border-bottom: 1px solid var(--line);
  color: #425861;
  font-size: 12px;
  line-height: 1.55;
}
.issue-list li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 17px;
  width: 7px;
  height: 7px;
  background: var(--amber);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
}
.wide-table-wrap { max-height: 520px; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.data-table th, .data-table td {
  padding: 10px 11px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e4eaec;
}
.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #52666f;
  background: #edf2f4;
  font-weight: 760;
  white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #f7fafb; }
.compact-table th:first-child, .compact-table td:first-child { width: 44%; }
.data-table .total-row td { color: var(--ink); background: #f2f6f7; font-weight: 800; }
.data-table .needs-attention td { background: #fffbf3; }
.data-table td strong { display: block; font-size: 11px; }
.data-table td small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.45; }
.bom-table { min-width: 1080px; }
body[data-audience="customer"] .bom-table { min-width: 760px; }
.bom-table th:first-child { width: 170px; }
.bom-table th:nth-child(2) { width: 260px; }
body[data-audience="customer"] .bom-table th:nth-child(5),
body[data-audience="customer"] .bom-table th:nth-child(6),
body[data-audience="customer"] .bom-table th:nth-child(7) { display: none; }
.component-list-note {
  margin: -3px 0 11px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.empty-cell { padding: 28px !important; text-align: center !important; color: var(--muted); }

.inline-tag {
  display: inline-block;
  margin: 5px 5px 0 0;
  padding: 3px 5px;
  border: 1px solid var(--line-strong);
  color: #566970;
  background: #f4f7f8;
  font-size: 9px;
  line-height: 1;
}
.inline-tag.is-good { color: var(--teal); border-color: #9bc7b9; background: var(--teal-soft); }
.inline-tag.is-warn { color: var(--amber); border-color: #d7bb85; background: var(--amber-soft); }

.bom-summary, .metric-grid {
  display: grid;
  margin-bottom: 14px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.bom-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bom-summary > div, .metric-grid > div {
  min-height: 66px;
  padding: 11px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.bom-summary span, .metric-grid span { display: block; color: var(--muted); font-size: 10px; }
.bom-summary strong, .metric-grid strong { display: block; margin-top: 6px; font-size: 14px; }
.metric-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.smt-curve-section { margin: 20px 0; }
.pcba-curve-section {
  padding: 34px 0 28px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pcba-curve-section .curve-heading h2 { margin: 0; font-size: 19px; }
.curve-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.curve-heading h3 { margin: 0; }
.curve-heading span { color: var(--muted); font-size: 10px; }
.curve-heading .eyebrow { margin: 0 0 5px; color: var(--muted); }
.curve-context { max-width: 720px; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.curve-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.curve-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.curve-legend i { display: inline-block; width: 18px; height: 8px; }
.legend-band { background: #dbe7ea; }
.legend-line { height: 2px !important; background: var(--blue); }
.legend-current { width: 2px !important; height: 12px !important; border-left: 2px dashed var(--amber); }
.smt-cost-curve {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 10px 0 12px;
}
.unified-cost-curve { grid-template-columns: minmax(0, 1fr); }
.unified-cost-curve figure { padding: 16px; }
.smt-cost-curve figure { margin: 0; padding: 12px; border: 1px solid var(--line); background: #f9fbfb; }
.smt-cost-curve figcaption { color: #40565f; font-size: 11px; font-weight: 760; }
.smt-cost-curve svg { display: block; width: 100%; height: auto; margin-top: 5px; }
.cost-analyzer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.46fr);
  gap: 16px;
  align-items: start;
  margin: 18px 0;
}
.cost-curve-stack { display: grid; gap: 12px; min-width: 0; }
.cost-curve-figure {
  margin: 0;
  padding: 17px 18px 12px;
  border: 1px solid var(--line);
  background: #fbfcfc;
}
.cost-curve-figure.is-primary { border-top: 3px solid var(--blue); }
.cost-curve-figure.is-secondary { background: #f7fafb; }
.cost-curve-figure svg { display: block; width: 100%; height: auto; margin-top: 8px; }
.curve-caption { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.curve-caption > span { display: grid; gap: 4px; }
.curve-caption strong { color: var(--ink); font-size: 13px; font-weight: 760; }
.curve-caption small { color: var(--muted); font-size: 10px; font-weight: 400; }
.curve-caption .curve-current-value { color: var(--blue); font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.curve-grid { stroke: #e2e8ea; stroke-width: 1; vector-effect: non-scaling-stroke; }
.curve-band { fill: #dbe7ea; opacity: 0.82; }
.curve-midline { fill: none; stroke: var(--blue); stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.curve-whisker { stroke: #71909b; stroke-width: 1; opacity: 0.7; vector-effect: non-scaling-stroke; }
.curve-point-dot { fill: var(--paper); stroke: var(--blue); stroke-width: 2; vector-effect: non-scaling-stroke; }
.curve-point.is-current .curve-point-dot { fill: var(--amber); stroke: white; }
.curve-hit-target { fill: transparent; cursor: pointer; }
.curve-linked-crosshair {
  opacity: 0;
  stroke: var(--teal);
  stroke-width: 1.25;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.curve-point.is-selected .curve-linked-crosshair { opacity: 0.86; }
.curve-point.is-selected:not(.is-current) .curve-point-dot { fill: var(--teal); stroke: white; r: 5px; }
.curve-point.is-preview .curve-linked-crosshair { opacity: 0.62; }
.curve-point:focus { outline: none; }
.curve-point:focus .curve-point-dot { stroke: var(--focus); stroke-width: 3; }
.curve-tick { stroke: #aebdc3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.curve-label, .curve-x-label, .curve-y-label, .curve-current-label { fill: #71838b; font-size: 10px; }
.curve-current-label { fill: var(--amber); font-size: 10px; font-weight: 760; }
.curve-current-line { stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.curve-current-point { fill: var(--amber); stroke: white; stroke-width: 2; vector-effect: non-scaling-stroke; }
.curve-current-line, .curve-current-point, .curve-current-label { pointer-events: none; }
.curve-selection-panel {
  position: sticky;
  top: 76px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  background: var(--paper);
}
.curve-selection-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.curve-selection-heading .eyebrow { margin: 0 0 5px; color: var(--muted); }
.curve-selection-heading h3 { margin: 0; font-size: 22px; font-variant-numeric: tabular-nums; }
.curve-selection-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.curve-selection-values div { min-width: 0; }
.curve-selection-values span, .curve-module-breakdown span, .curve-neighbor-metrics span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}
.curve-selection-values strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.curve-panel-section { padding: 15px 0; border-bottom: 1px solid var(--line); }
.curve-panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.curve-panel-title h4 { margin: 0; font-size: 11px; }
.curve-panel-title span { color: var(--muted); font-size: 8px; }
.curve-composition-bar {
  height: 9px;
  display: flex;
  gap: 2px;
  margin: 11px 0 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--soft);
}
.curve-composition-segment { min-width: 2px; }
.curve-composition-segment.is-pcb, .curve-module-dot.is-pcb { background: var(--blue); }
.curve-composition-segment.is-bom, .curve-module-dot.is-bom { background: var(--teal); }
.curve-composition-segment.is-smt, .curve-module-dot.is-smt { background: var(--amber); }
.curve-module-breakdown { display: grid; gap: 8px; }
.curve-module-breakdown > div {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-areas:
    "name amount"
    "name detail";
  gap: 3px 8px;
  align-items: start;
}
.curve-module-breakdown span { grid-area: name; display: inline-flex; align-items: center; gap: 6px; padding-top: 2px; }
.curve-module-breakdown strong { grid-area: amount; font-size: 10px; line-height: 1.35; text-align: right; font-variant-numeric: tabular-nums; }
.curve-module-breakdown small { grid-area: detail; color: var(--muted); font-size: 9px; line-height: 1.35; text-align: right; font-variant-numeric: tabular-nums; }
.curve-module-dot { width: 7px; height: 7px; flex: 0 0 auto; }
.curve-neighbor-label { margin: 8px 0 10px; color: var(--ink); font-size: 11px; font-weight: 720; }
.curve-neighbor-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.curve-neighbor-metrics > div { min-width: 0; padding: 9px; background: #f4f7f8; }
.curve-neighbor-metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.curve-neighbor-metrics small { display: block; margin-top: 4px; color: var(--teal); font-size: 9px; }
.curve-selection-notes { display: grid; gap: 5px; margin-top: 13px; }
.curve-selection-notes p { margin: 0; padding-left: 9px; border-left: 2px solid var(--amber); color: #695333; font-size: 9px; line-height: 1.5; }
.curve-apply-button { width: 100%; margin-top: 15px; }
.curve-hover-tooltip {
  position: fixed;
  z-index: 40;
  width: min(292px, calc(100vw - 24px));
  padding: 13px 14px;
  border: 1px solid #36525f;
  color: white;
  background: #18313d;
  box-shadow: 0 12px 28px rgba(31, 60, 72, 0.2);
  pointer-events: none;
}
.curve-tooltip-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid #49616b; }
.curve-tooltip-heading strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.curve-tooltip-heading span { color: #b9c9cf; font-size: 9px; }
.curve-hover-tooltip dl { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; margin: 10px 0 0; font-size: 9px; }
.curve-hover-tooltip dt { color: #b9c9cf; }
.curve-hover-tooltip dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.curve-hover-tooltip p { margin: 9px 0 0; padding-top: 8px; border-top: 1px solid #49616b; color: #f1c988; font-size: 9px; line-height: 1.45; }
.curve-table-wrap { max-height: none; }
.quantity-curve-table { min-width: 920px; }
.quantity-curve-table tr[data-curve-quantity] { cursor: pointer; }
.quantity-curve-table tr[data-curve-quantity]:focus { outline: 2px solid var(--focus); outline-offset: -2px; }
.data-table tr.is-target-quantity td {
  color: var(--ink);
  background: var(--teal-soft);
  font-weight: 700;
}
.data-table tr[data-curve-quantity].is-selected:not(.is-target-quantity) td { background: var(--amber-soft); }

.drawer-open { overflow: hidden; }
.drawer-open .floating-quote-action { display: none !important; }
.cost-drawer-shell { position: fixed; inset: 0; z-index: 50; }
.cost-drawer-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(21, 38, 47, 0.34);
  cursor: default;
}
.cost-detail-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(760px, 92vw);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--paper);
  box-shadow: -18px 0 42px rgba(31, 60, 72, 0.16);
  transform: translateX(20px);
  opacity: 0;
  transition: transform 220ms ease, opacity 180ms ease;
}
.cost-detail-drawer.is-open { transform: translateX(0); opacity: 1; }
.cost-drawer-header {
  min-height: 110px;
  padding: 24px 26px 20px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}
.cost-drawer-header h2 { margin: 0; font-size: 22px; }
.cost-drawer-header > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.drawer-close {
  width: 38px;
  height: 38px;
  padding: 0;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: white;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.drawer-close:hover { border-color: var(--blue); color: var(--blue); }
.cost-drawer-scroll { min-height: 0; padding: 24px 26px 40px; overflow: auto; }
.cost-drawer-cta {
  min-height: 72px;
  padding: 12px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.cost-drawer-cta > span { color: var(--muted); font-size: 11px; }
.cost-drawer-cta .primary-button { flex: 0 0 auto; }
.cost-drawer-scroll > section > h3 {
  margin: 24px 0 10px;
  color: #50666f;
  font-size: 12px;
  font-weight: 760;
}
.drawer-value-row {
  min-height: 72px;
  padding: 14px 0 17px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-value-row span { color: var(--muted); font-size: 11px; }
.drawer-value-row strong { font-size: 23px; font-variant-numeric: tabular-nums; text-align: right; }
.drawer-value-row > div { display: grid; justify-items: end; gap: 5px; }
.drawer-value-row small { color: var(--muted); font-size: 10px; }
.drawer-value-row small b { color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.cost-detail-drawer .bom-summary { margin-top: 18px; }
.cost-detail-drawer .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
.drawer-subsection { margin-top: 22px; }
.drawer-subsection > h3 { margin: 0 0 10px; font-size: 13px; }

.help-drawer-shell { position: fixed; inset: 0; z-index: 60; }
.help-drawer-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(21, 38, 47, 0.34);
  cursor: default;
}
.help-request-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 94vw);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--paper);
  box-shadow: -18px 0 42px rgba(31, 60, 72, 0.16);
  transform: translateX(24px);
  opacity: 0;
  transition: transform 220ms ease, opacity 180ms ease;
}
.help-request-drawer.is-open { transform: translateX(0); opacity: 1; }
.help-drawer-header {
  min-height: 142px;
  padding: 25px 26px 21px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}
.help-drawer-header h2 { margin: 3px 0 0; font-size: 22px; }
.help-drawer-header > div > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.help-request-form {
  min-height: 0;
  padding: 28px 26px 36px;
  display: grid;
  align-content: start;
  gap: 24px;
  overflow: auto;
}
.quote-review-scope {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.quote-review-scope h3 { margin: 0 0 9px; color: var(--ink); font-size: 13px; }
.quote-review-scope ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.quote-review-scope li + li { margin-top: 5px; }
.help-request-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.help-request-form legend { margin-bottom: 11px; color: #344b55; font-size: 12px; font-weight: 780; }
.help-choice {
  min-height: 54px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: white;
  cursor: pointer;
}
.help-choice + .help-choice { margin-top: 8px; }
.help-choice:has(input:checked) { border-color: var(--blue); background: #f3f5ff; }
.help-choice input { width: 17px; min-height: 17px; margin: 0; accent-color: var(--blue); }
.help-choice span { font-size: 12px; font-weight: 700; }
.help-details-field { display: grid; gap: 8px; color: #344b55; font-size: 12px; font-weight: 750; }
.help-details-field > span { display: flex; justify-content: space-between; gap: 8px; }
.help-details-field small { color: var(--muted); font-size: 9px; font-weight: 550; }
.help-request-form .inline-error { grid-column: auto; }
.help-request-form > .primary-button { justify-self: start; min-width: 128px; }
.help-request-success {
  min-height: 0;
  padding: 52px 34px;
  align-content: start;
  justify-items: start;
  overflow: auto;
}
.help-request-success:not([hidden]) { display: grid; }
.help-request-success > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--teal);
  font-size: 20px;
  font-weight: 800;
}
.help-request-success h3 { margin: 22px 0 7px; font-size: 23px; }
.help-request-success p { margin: 0 0 24px; color: var(--muted); font-size: 12px; }

.section-notes {
  margin-top: 12px;
  padding: 10px 13px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: #684c1d;
  font-size: 11px;
  line-height: 1.55;
}
.section-notes p { margin: 0; }
.section-notes p + p { margin-top: 6px; }

.omissions-section {
  margin-top: 24px;
  padding: 17px 19px;
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
}
.omissions-section h2 { margin: 0 0 8px; font-size: 14px; }
.omissions-section ul { margin: 0; padding-left: 19px; color: #674c20; font-size: 12px; line-height: 1.7; }
body[data-audience="customer"] .omissions-section {
  border-left-color: var(--blue);
  background: #f4f6ff;
}
body[data-audience="customer"] .omissions-section h2 { color: var(--ink); }
body[data-audience="customer"] .omissions-section ul { color: #53607c; }
.estimate-disclaimer { margin: 22px 0 0; color: #77878e; font-size: 11px; line-height: 1.6; }
.floating-quote-action {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 35;
  width: min(650px, calc(100vw - 48px));
  padding: 10px 10px 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #9fb0b7;
  background: var(--paper);
  box-shadow: 0 12px 30px rgba(31, 60, 72, 0.18);
}
.floating-quote-action > span { min-width: 0; color: #52666f; font-size: 11px; font-weight: 700; }
.floating-quote-action .primary-button { min-height: 40px; padding: 8px 14px; white-space: nowrap; }

.manual-panel { max-width: 760px; padding: 42px; }
.manual-marker {
  display: inline-block;
  margin: 0 0 28px;
  padding: 6px 8px;
  color: #fff;
  background: var(--amber);
  font-size: 10px;
  font-weight: 800;
}
.manual-marker.is-error { background: var(--red); }
.manual-panel h2 { margin: 0 0 12px; max-width: 620px; font-size: 26px; line-height: 1.3; }
.manual-panel > p:not(.manual-marker) { color: var(--muted); line-height: 1.6; }
.manual-panel .issue-list { margin: 22px 0 26px; }
.manual-panel .file-state-grid { margin-bottom: 26px; }

footer {
  min-height: 44px;
  padding: 12px clamp(18px, 4vw, 56px);
  color: #72838a;
  border-top: 1px solid var(--line);
  background: #fff;
  font-size: 11px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.history-shell {
  width: min(1380px, 100%);
  min-height: calc(100vh - 60px);
  margin: 0 auto;
  padding: 42px clamp(18px, 4vw, 52px) 64px;
}

.history-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 25px;
}
.history-heading h1 { margin: 0; font-size: 32px; line-height: 1.18; }
.history-count { margin: 0; color: var(--muted); font-size: 12px; }

.history-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 520px) 180px;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line-strong);
}
.history-search input,
.history-filter select {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--paper);
}
.history-search input::placeholder { color: #87969c; }

.history-table-section { position: relative; border-top: 1px solid var(--line); }
.history-table-wrap { overflow-x: auto; background: var(--paper); }
.history-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  table-layout: fixed;
}
.history-table th,
.history-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.history-table th {
  color: #53666e;
  background: var(--soft);
  font-size: 10px;
  font-weight: 800;
}
.history-table th:nth-child(1) { width: 150px; }
.history-table th:nth-child(2) { width: 270px; }
.history-table th:nth-child(3) { width: 80px; }
.history-table th:nth-child(4) { width: 140px; }
.history-table th:nth-child(5) { width: 145px; }
.history-table th:nth-child(6) { width: 180px; }
.history-table th:nth-child(7) { width: 150px; }
.history-table tbody tr:hover td { background: #f8fafb; }
.history-time,
.history-quantity,
.history-cost,
.history-feedback { color: #4e626b; font-size: 11px; }
.history-cost { color: var(--ink); font-weight: 750; }
.history-file strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.history-file span { display: block; margin-top: 5px; color: #829198; font: 9px/1.3 monospace; }

.history-status {
  display: inline-block;
  min-height: 24px;
  padding: 5px 7px;
  border: 1px solid var(--line-strong);
  color: #566a72;
  background: #f5f7f8;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.history-status.is-active { color: var(--blue); border-color: #9ebdc8; background: #eef6f8; }
.history-status.is-complete { color: var(--teal); border-color: #9bc7b9; background: var(--teal-soft); }
.history-status.is-attention { color: var(--amber); border-color: #d7bb85; background: var(--amber-soft); }
.history-status.is-failed { color: var(--red); border-color: #d5a39e; background: var(--red-soft); }

.history-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.history-actions a { color: var(--blue); text-decoration: none; font-size: 10px; font-weight: 700; }
.history-actions a:hover { text-decoration: underline; text-underline-offset: 2px; }
.history-primary-action { min-width: 48px; }
.history-expired { color: #89979d; font-size: 10px; }

.history-empty {
  padding: 58px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  text-align: center;
}
.history-empty strong { display: block; font-size: 14px; }
.history-empty span { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.history-pagination {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  color: var(--muted);
  font-size: 11px;
}
.history-pagination .quiet-button { min-width: 76px; }
.history-pagination button:disabled { opacity: 0.38; cursor: default; }
.history-loading .history-table { opacity: 0.58; }

@media (max-width: 820px) {
  .page-heading { grid-template-columns: 1fr; gap: 12px; }
  .page-heading > p:last-child { grid-column: 1; grid-row: auto; }
  .file-state-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bom-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smt-cost-curve { grid-template-columns: 1fr; }
  .result-heading { grid-template-columns: 1fr; }
  .result-actions { justify-self: start; }
  .curve-heading { align-items: start; }
  .cost-analyzer-layout { grid-template-columns: 1fr; }
  .curve-selection-panel { position: static; }
  .history-heading { align-items: start; }
  .upload-guidance { grid-template-columns: 1fr; gap: 17px; }
  .proprietary-guidance { grid-column: 1; }
}

@media (max-width: 620px) {
  .site-header { height: 56px; padding: 0 13px; }
  .brand { font-size: 12px; }
  .brand-logo { height: 24px; }
  .brand-product { display: none; }
  .internal-label { display: none; }
  .header-actions { gap: 10px; }
  .header-link { font-size: 11px; }
  .page-shell { padding: 24px 12px 38px; }
  .page-heading h1 { font-size: 26px; }
  body[data-audience="customer"] .page-heading h1 { font-size: 30px; }
  body[data-audience="customer"] .page-heading > p:last-child { margin-top: 8px; font-size: 14px; }
  .state-panel, .processing-panel, .result-panel, .manual-panel { min-height: 0; padding: 22px 16px; }
  .drop-zone { min-height: 260px; padding: 28px 16px 26px; }
  .drop-zone h2 { font-size: 22px; }
  .upload-guidance { padding: 20px 2px 0; }
  .upload-button { width: min(100%, 230px); }
  .submission-form { grid-template-columns: 1fr; }
  .customer-contact-grid { grid-template-columns: 1fr; }
  .required-fields-note { text-align: left; }
  .retention-note, .inline-error, .legal-consent, .cost-boundary { grid-column: 1; }
  body[data-audience="customer"] .submission-form { grid-template-columns: 1fr; }
  body[data-audience="customer"] .quantity-field { width: 100%; }
  body[data-audience="customer"] .submission-form > .primary-button { width: 100%; justify-self: stretch; }
  .result-heading { gap: 18px; }
  .estimate-value-row { display: grid; align-items: start; gap: 14px; }
  .currency-control { margin: 0; justify-self: start; }
  .result-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .result-heading .secondary-button { width: 100%; }
  .estimate-range { font-size: 35px; }
  .quantity-simulator { grid-template-columns: 1fr; align-items: stretch; }
  .compact-action { width: 100%; }
  .curve-heading { display: grid; gap: 13px; }
  .curve-legend { gap: 10px; }
  .cost-summary { grid-template-columns: 1fr; border-left: 0; }
  .cost-module-card { min-height: 78px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .cost-module-card:last-child { border-bottom: 0; }
  .cost-curve-figure { padding: 14px 8px 8px; overflow: hidden; }
  .curve-caption { align-items: start; }
  .curve-caption small { max-width: 180px; }
  .curve-caption .curve-current-value { font-size: 14px; }
  .curve-selection-panel { padding: 16px; }
  .curve-selection-values { grid-template-columns: 1fr; gap: 10px; }
  .curve-neighbor-metrics { grid-template-columns: 1fr; }
  .curve-hover-tooltip { display: none !important; }
  .file-state-grid { grid-template-columns: 1fr; border-left: 0; }
  .file-state { min-height: 58px; border-left: 1px solid var(--line); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-section summary { min-height: 68px; }
  .confirmation-panel { padding: 22px 16px; }
  .parameter-grid, .parsed-grid { grid-template-columns: 1fr; }
  .processing-panel h2 { margin-top: 40px; font-size: 25px; }
  .processing-time { align-items: flex-start; flex-direction: column; gap: 8px; }
  .processing-time-primary strong { font-size: 17px; }
  .parameter-choice-grid[data-choice-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-action { display: none; }
  .cost-detail-drawer { width: 100%; }
  .help-request-drawer { width: 100%; }
  .cost-drawer-header { min-height: 92px; padding: 18px 16px 15px; }
  .help-drawer-header { min-height: 118px; padding: 19px 16px 16px; }
  .help-drawer-header h2 { font-size: 19px; }
  .help-request-form { padding: 22px 16px 32px; }
  .help-request-form > .primary-button { width: 100%; }
  .help-request-success { padding: 38px 22px; }
  .cost-drawer-header h2 { font-size: 19px; }
  .cost-drawer-scroll { padding: 18px 16px 32px; }
  .cost-drawer-cta { min-height: 68px; padding: 10px 16px; }
  .cost-drawer-cta > span { display: none; }
  .cost-drawer-cta .primary-button { width: 100%; }
  .drawer-value-row { align-items: start; }
  .drawer-value-row strong { font-size: 19px; }
  .cost-detail-drawer .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-shell { padding: 27px 12px 42px; }
  .history-heading { display: grid; gap: 9px; margin-bottom: 18px; }
  .history-heading h1 { font-size: 26px; }
  .history-toolbar { grid-template-columns: 1fr; }
  .history-table-wrap { margin: 0 -12px; }
  .history-pagination { justify-content: space-between; }
  body[data-audience="customer"] .result-panel { padding-bottom: 104px; }
  .floating-quote-action {
    right: 12px;
    bottom: 12px;
    left: 12px;
    min-width: 0;
    padding: 9px;
  }
  .floating-quote-action > span { display: none; }
  .floating-quote-action .primary-button { width: 100%; }
}

@media (max-width: 380px) {
  body[data-audience="customer"] .header-actions { gap: 6px; }
  body[data-audience="customer"] .header-link { padding-inline: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
