:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #18343a;
  background: #f1f7f5;
  font-synthesis: none;
  --ink: #18343a;
  --muted: #60747a;
  --line: #d5e4e0;
  --surface: #ffffff;
  --surface-alt: #f6faf8;
  --navy: #0d4549;
  --navy-2: #126b70;
  --teal: #087f73;
  --teal-soft: #e2f5ee;
  --gold: #b46b18;
  --gold-soft: #fff2da;
  --red: #b33b36;
  --red-soft: #fff0ed;
  --blue-soft: #e2f0f1;
  --coral: #cf6945;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: #f1f7f5; color: var(--ink); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(35, 89, 125, 0.25); outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.topbar { min-height: 72px; padding: 10px 22px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 20px; box-shadow: 0 2px 0 rgba(9, 61, 61, .2); }
.brand-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.35); display: grid; place-items: center; font-size: 20px; font-weight: 500; background: rgba(255,255,255,.08); border-radius: 6px; flex: 0 0 auto; }
.brand-mark-dcy { width: 48px; font-size: 14px; font-weight: 800; color: #0d4549; background: #f3d68a; border-color: #f7e5b4; }
.brand-block h1 { margin: 0; font-size: 18px; line-height: 1.35; font-weight: 500; letter-spacing: 0; }
.brand-block p { margin: 2px 0 0; color: rgba(230, 250, 244, .78); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.sync-state { display: flex; align-items: center; gap: 7px; font-size: 12px; color: rgba(255,255,255,.82); white-space: nowrap; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #53d6a6; box-shadow: 0 0 0 3px rgba(83,214,166,.16); }

.icon-button { width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.28); background: transparent; color: inherit; display: inline-grid; place-items: center; border-radius: 6px; text-decoration: none; }
.icon-button:hover { background: rgba(255,255,255,.1); }
.icon-button.subtle { color: var(--muted); border-color: transparent; }
.icon-button.subtle:hover { color: var(--ink); background: var(--surface-alt); }
.icon-button svg, button svg, a svg { width: 17px; height: 17px; flex: 0 0 auto; }
.top-actions .icon-button[data-tooltip] { position: relative; }
.top-actions .icon-button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  max-width: 190px;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 5px;
  background: #102e45;
  color: #fff;
  box-shadow: 0 8px 18px rgba(8, 30, 46, .22);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  white-space: normal;
  text-align: left;
  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.top-actions .icon-button[data-tooltip]:hover::after,
.top-actions .icon-button[data-tooltip]:focus-visible::after { opacity: 1; transform: translateY(0); }

.dcy-provenance-strip { height: 44px; padding: 0 22px; background: #0b5d5e; color: #f1fffa; display: flex; align-items: stretch; justify-content: space-between; border-bottom: 1px solid rgba(4, 60, 61, .48); }
.provenance-items { display: flex; align-items: center; min-width: 0; }
.provenance-items span { min-height: 28px; padding: 0 15px; display: inline-flex; align-items: center; gap: 7px; border-right: 1px solid rgba(226, 248, 240, .2); font-size: 12px; white-space: nowrap; }
.provenance-items span:first-child { padding-left: 0; }
.provenance-items svg { width: 15px; height: 15px; color: #f3d68a; }
.provenance-visual { width: 92px; height: 43px; margin-left: 20px; overflow: hidden; border-left: 1px solid rgba(226, 248, 240, .24); border-right: 1px solid rgba(226, 248, 240, .24); background: #103d48; }
.provenance-visual img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center top; opacity: .78; }

.customer-search-band { background: #fbfefd; border-bottom: 1px solid var(--line); padding: 14px 22px; display: grid; grid-template-columns: 210px minmax(280px, 650px) auto; align-items: center; gap: 16px; }
.search-label { display: flex; flex-direction: column; gap: 2px; }
.search-label span { font-weight: 500; }
.search-label small { color: var(--muted); font-size: 12px; }
.search-control { position: relative; height: 42px; display: flex; align-items: center; border: 1px solid #aebbc5; background: #fff; border-radius: 6px; }
.search-control > svg { margin-left: 12px; color: var(--muted); width: 18px; }
.search-control input { border: 0; outline: 0; width: 100%; min-width: 0; height: 100%; padding: 0 8px; color: var(--ink); background: transparent; }
.search-results { position: absolute; z-index: 20; left: -1px; right: -1px; top: 46px; background: #fff; border: 1px solid #aebbc5; box-shadow: 0 12px 28px rgba(22,59,88,.16); border-radius: 6px; overflow: hidden; }
.search-result { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 11px 12px; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; color: var(--ink); }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--blue-soft); }
.search-result strong { font-weight: 500; }
.search-result span, .search-result small { color: var(--muted); font-size: 12px; }
.search-result small { grid-column: 1 / -1; }

.primary-button, .secondary-button { min-height: 38px; border-radius: 6px; padding: 8px 13px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 500; border: 1px solid transparent; }
.primary-button { background: var(--navy); color: #fff; }
.primary-button:hover { background: #0f3049; }
.secondary-button { background: #fff; color: var(--navy); border-color: #9fb0bd; }
.secondary-button:hover { background: var(--blue-soft); }
.full-width { width: 100%; }

.customer-context { background: #f5fbf8; border-bottom: 1px solid var(--line); min-height: 86px; padding: 14px 22px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.customer-identity { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.customer-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-weight: 500; flex: 0 0 auto; }
.identity-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.identity-line strong { font-size: 17px; font-weight: 500; }
.identity-line span { color: var(--muted); font-size: 12px; }
.customer-identity p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.context-metrics { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(108px, 1fr)); gap: 24px; }
.context-metrics div { min-width: 0; }
.context-metrics dt { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.context-metrics dd { margin: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer-supplement { background: #fbfefd; border-bottom: 1px solid var(--line); padding: 14px 22px 18px; }
.supplement-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.supplement-heading > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.supplement-heading h2 { margin: 0; font-size: 15px; font-weight: 500; color: var(--navy); }
.small-step { width: 22px; height: 22px; font-size: 11px; background: var(--gold); }
.supplement-source-badge { min-height: 26px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; background: var(--blue-soft); color: var(--navy-2); font-size: 11px; font-weight: 600; white-space: nowrap; }
.supplement-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.supplement-grid article { min-height: 90px; background: #fbfcfd; padding: 12px; display: flex; flex-direction: column; }
.supplement-grid .lead-time-card { background: #f1f8fa; }
.supplement-grid .lead-time-card strong { color: var(--teal); }
.supplement-grid span, .supplement-grid small { color: var(--muted); font-size: 11px; line-height: 1.55; }
.supplement-grid strong { display: block; margin: 7px 0 5px; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.supplement-note { margin: 12px 0 0; padding: 10px 12px; background: var(--gold-soft); border-left: 3px solid var(--gold); color: #665122; font-size: 11px; line-height: 1.65; }

.workspace-grid { display: grid; grid-template-columns: minmax(360px, 420px) minmax(520px, 1fr); align-items: start; max-width: 1600px; margin: 0 auto; background: var(--surface); }
.parameter-pane, .recommendation-pane, .feedback-pane { min-width: 0; padding: 20px 22px 26px; }
.parameter-pane { border-right: 1px solid var(--line); background: #f5faf8; padding: 24px 26px 30px; }
.recommendation-pane { background: var(--surface); padding: 24px 30px 30px; }
.feedback-pane { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); background: #fbfcfd; padding: 24px 30px 30px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-heading > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.section-heading h2 { margin: 0; font-size: 16px; font-weight: 500; }
.step-number { width: 24px; height: 24px; display: inline-grid; place-items: center; color: #fff; background: var(--navy-2); border-radius: 50%; font-size: 12px; flex: 0 0 auto; }
.change-hint, .strength-label { color: var(--muted); font-size: 11px; text-align: right; }
.strength-label { color: var(--teal); background: var(--teal-soft); padding: 4px 7px; border-radius: 4px; white-space: nowrap; }
.parameter-pane > .section-heading { margin: -4px -8px 20px; padding: 12px 14px; border: 1px solid #cbdde7; border-left: 4px solid var(--navy-2); background: var(--blue-soft); }
.parameter-pane > .section-heading h2 { font-size: 17px; color: var(--navy); }
.parameter-pane > .section-heading .change-hint { color: var(--navy-2); }

.field-label { display: block; color: #3c4a57; font-size: 12px; margin: 0 0 6px; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field-control { display: block; width: 100%; min-height: 39px; border: 1px solid #b7c3cc; border-radius: 5px; background: #fff; color: var(--ink); padding: 8px 10px; margin-bottom: 14px; }
textarea.field-control { resize: vertical; line-height: 1.55; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.text-link-button { border: 0; background: transparent; color: var(--navy-2); padding: 0; font-size: 12px; }
.text-link-button:hover { color: var(--navy); text-decoration: underline; }
.field-helper { margin: 8px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.need-chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.need-chip { position: relative; }
.need-chip input { position: absolute; opacity: 0; pointer-events: none; }
.need-chip span { min-height: 34px; padding: 6px 10px; border: 1px solid #b7c3cc; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: #3c4a57; font-size: 12px; line-height: 1.4; }
.need-chip input:checked + span { border-color: var(--navy-2); background: var(--blue-soft); color: var(--navy); }
.basic-profile-panel { margin: 0 0 16px; padding: 14px; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--gold); }
.basic-profile-panel .field-control { margin-bottom: 12px; }
.questionnaire-panel { margin: 0 0 16px; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--teal); }
.questionnaire-details > summary, .discovery-details > summary { list-style: none; cursor: pointer; }
.questionnaire-details > summary::-webkit-details-marker, .discovery-details > summary::-webkit-details-marker { display: none; }
.questionnaire-details > summary { padding: 13px 14px; }
.questionnaire-details[open] > summary { border-bottom: 1px solid var(--line); background: #f8fcfc; }
.questionnaire-details > summary::after, .discovery-details > summary::after { content: "展开"; display: block; color: var(--teal); font-size: 11px; text-align: right; }
.questionnaire-details[open] > summary::after, .discovery-details[open] > summary::after { content: "收起"; }
.questionnaire-details .compact-heading { margin: 0; }
.questionnaire-details .panel-mini-heading { display: flex; align-items: center; }
.questionnaire-details .questionnaire-title-wrap, .discovery-details .discovery-title-wrap { display: inline-flex; align-items: center; gap: 7px; color: var(--navy); font-size: 14px; font-weight: 500; text-align: left; }
.questionnaire-title-wrap svg, .discovery-title-wrap svg { width: 16px; height: 16px; }
.questionnaire-body { padding: 14px; }
.questionnaire-body .field-control { margin-bottom: 12px; }
.questionnaire-group { border: 0; padding: 0; margin: 2px 0 13px; display: flex; flex-wrap: wrap; gap: 7px; }
.questionnaire-group legend { width: 100%; color: #3c4a57; font-size: 12px; margin: 0 0 2px; }
.questionnaire-group label { position: relative; }
.questionnaire-group input { position: absolute; opacity: 0; pointer-events: none; }
.questionnaire-group span { min-height: 30px; padding: 5px 9px; border: 1px solid #b7c3cc; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: #3c4a57; font-size: 11px; line-height: 1.35; }
.questionnaire-group input:checked + span { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.questionnaire-insights { margin-top: 2px; padding: 12px; border: 1px solid var(--line); background: #fbfcfd; }
.questionnaire-insights strong { display: block; color: var(--navy); font-size: 13px; line-height: 1.55; font-weight: 600; }
.questionnaire-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 0; }
.questionnaire-tags span { min-height: 24px; padding: 4px 8px; border-radius: 999px; background: var(--blue-soft); color: var(--navy-2); font-size: 11px; line-height: 1.35; }
.questionnaire-tags span.risk { background: var(--red-soft); color: var(--red); }
.questionnaire-insights ul { margin: 9px 0 0 18px; padding: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.questionnaire-insights li + li { margin-top: 4px; }
.compact-heading { margin-bottom: 10px; }
.discovery-panel { margin: 4px 0 16px; background: #fbfcfd; border: 1px solid var(--line); }
.discovery-details > summary { padding: 13px 14px; }
.discovery-details[open] > summary { border-bottom: 1px solid var(--line); background: #f5f9fb; }
.discovery-details .panel-mini-heading { margin: 0; align-items: center; }
.discovery-details .discovery-list { padding: 14px; }
.panel-mini-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-mini-heading h3 { margin: 0; display: flex; align-items: center; gap: 7px; color: var(--navy); font-size: 14px; font-weight: 500; }
.panel-mini-heading span { color: var(--muted); font-size: 11px; text-align: right; line-height: 1.6; }
.discovery-list { display: grid; gap: 10px; }
.discovery-card { padding: 12px; border: 1px solid var(--line); background: #fff; }
.discovery-card span { display: block; color: var(--teal); font-size: 11px; font-weight: 600; margin-bottom: 6px; }
.discovery-card strong { display: block; color: var(--ink); font-size: 13px; line-height: 1.55; }
.discovery-card ul { margin: 8px 0 0 18px; padding: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.discovery-card li + li { margin-top: 4px; }
.safety-fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.safety-fieldset legend { color: #3c4a57; font-size: 12px; margin-bottom: 7px; }
.safety-fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.safety-fieldset legend { grid-column: 1 / -1; }
.safety-fieldset label { position: relative; }
.safety-fieldset input { position: absolute; opacity: 0; pointer-events: none; }
.safety-fieldset span { min-height: 38px; border: 1px solid #b7c3cc; border-radius: 5px; display: flex; align-items: center; justify-content: center; gap: 6px; background: #fff; color: var(--muted); font-size: 12px; }
.safety-fieldset input:checked + span { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.safety-fieldset label:last-child input:checked + span { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.advanced-fields { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 11px 0 2px; margin: 4px 0 14px; }
.advanced-fields summary { list-style: none; color: var(--navy-2); font-size: 12px; display: flex; align-items: center; gap: 7px; cursor: pointer; margin-bottom: 11px; }
.advanced-fields summary::-webkit-details-marker { display: none; }

.safety-banner { border-left: 4px solid var(--red); background: var(--red-soft); color: var(--red); padding: 12px 14px; margin-bottom: 15px; display: flex; gap: 10px; align-items: flex-start; }
.safety-banner strong, .safety-banner span { display: block; }
.safety-banner span { margin-top: 3px; font-size: 12px; }
.product-result { border-bottom: 1px solid var(--line); padding: 4px 2px 18px; margin-bottom: 18px; }
.result-label { display: flex; align-items: center; gap: 7px; color: var(--teal); font-size: 12px; font-weight: 500; margin-bottom: 8px; }
.secondary-result .result-label { color: var(--gold); }
.product-result h3 { margin: 0; font-size: 20px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.product-result p { margin: 7px 0 0; color: var(--muted); line-height: 1.6; font-size: 13px; }
.product-result .reference-price { display: grid; gap: 7px; margin-top: 11px; color: var(--ink); }
.reference-price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; }
.reference-price-label { color: var(--teal); font-size: 12px; font-weight: 600; }
.secondary-result .reference-price-label { color: var(--gold); }
.reference-price strong { color: var(--ink); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.reference-price-detail { color: var(--muted); font-size: 12px; }
.reference-price.is-unavailable strong { color: var(--muted); font-size: 14px; font-weight: 500; }
.price-reference-note { margin: -5px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.product-safety-card { margin: -2px 0 18px; padding: 14px 15px; border: 1px solid var(--line); border-left: 3px solid var(--gold); background: #fffdfa; }
.product-safety-card.warn { border-left-color: var(--gold); background: var(--gold-soft); }
.product-safety-card.danger { border-left-color: var(--red); background: var(--red-soft); }
.product-safety-card .result-label { color: var(--gold); }
.product-safety-card.danger .result-label { color: var(--red); }
.product-safety-card strong { display: block; color: var(--navy); font-size: 14px; font-weight: 600; line-height: 1.55; }
.product-safety-card.danger strong { color: var(--red); }
.product-safety-card ul { margin: 9px 0 0 18px; padding: 0; color: #52616d; font-size: 12px; line-height: 1.7; }
.product-safety-card li + li { margin-top: 5px; }
.product-safety-card li.danger { color: var(--red); font-weight: 600; }
.product-safety-card li.warn { color: #7a5310; }
.selling-point-card { margin: -2px 0 18px; padding: 14px 15px; border: 1px solid var(--line); border-left: 3px solid var(--teal); background: #fbfcfd; }
.selling-point-card strong { display: block; color: var(--navy); font-size: 15px; font-weight: 600; line-height: 1.55; overflow-wrap: anywhere; }
.selling-point-card p { margin: 7px 0 0; color: #52616d; font-size: 12px; line-height: 1.65; }
.action-strip { display: grid; grid-template-columns: 1fr 1fr 1.3fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 2px 0 20px; }
.action-strip div { padding: 13px 12px; border-right: 1px solid var(--line); min-width: 0; }
.action-strip div:last-child { border-right: 0; }
.action-strip span, .evidence-row span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.action-strip strong { display: block; font-size: 13px; font-weight: 500; line-height: 1.55; overflow-wrap: anywhere; }
.talk-track { background: var(--blue-soft); border-left: 3px solid var(--navy-2); padding: 14px 15px; margin-bottom: 18px; }
.talk-track-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.talk-track h3, .history-section h3 { margin: 0; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.talk-track p { margin: 8px 0 0; color: #334655; line-height: 1.7; font-size: 13px; }
.talk-library { margin-bottom: 18px; }
.talk-library-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.talk-library-card { border: 1px solid var(--line); background: #fbfcfd; padding: 12px; }
.talk-library-card span { display: block; color: var(--gold); font-size: 11px; font-weight: 600; margin-bottom: 7px; }
.talk-library-card ul { margin: 0 0 0 18px; padding: 0; color: #334655; font-size: 12px; line-height: 1.65; }
.talk-library-card li + li { margin-top: 4px; }
.knowledge-hints { margin-bottom: 18px; padding: 13px 14px; border: 1px solid var(--line); background: #fbfcfd; }
.knowledge-hints h3 { margin: 0; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 7px; color: var(--navy); }
.knowledge-hint-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 11px; }
.knowledge-hint-card { min-width: 0; border: 1px solid var(--line); background: #fff; padding: 11px 12px; }
.knowledge-hint-card span { display: block; color: var(--teal); font-size: 11px; font-weight: 600; margin-bottom: 5px; }
.knowledge-hint-card strong { display: block; color: var(--ink); font-size: 13px; line-height: 1.45; }
.knowledge-hint-card p, .knowledge-hint-card small { display: block; margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.evidence-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 12px; }
.evidence-row div { background: var(--surface); padding: 10px; min-width: 0; }
.evidence-row strong { font-size: 15px; font-weight: 500; white-space: nowrap; }
.boundary-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; display: flex; gap: 7px; align-items: flex-start; }
.boundary-note svg { flex: 0 0 auto; margin-top: 1px; }

.history-section { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 16px; }
.history-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.history-heading span { color: var(--muted); font-size: 12px; }
.feedback-item { padding: 11px 0; border-bottom: 1px solid var(--line); }
.feedback-item:last-child { border-bottom: 0; }
.feedback-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.feedback-item strong { font-size: 13px; font-weight: 500; }
.feedback-item time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.feedback-item p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.feedback-next { color: var(--teal) !important; }
.empty-state { color: var(--muted); font-size: 12px; padding: 12px 0; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1d2733; color: #fff; padding: 10px 14px; border-radius: 6px; box-shadow: 0 10px 25px rgba(0,0,0,.2); font-size: 13px; }
.toast.error { background: var(--red); }

@media (max-width: 1180px) {
  .workspace-grid { grid-template-columns: minmax(320px, 38%) minmax(0, 1fr); }
  .feedback-pane { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .feedback-pane form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: end; }
  .feedback-pane form > .full-width, .feedback-pane form > textarea, .feedback-pane form > label[for="customer-feedback"] { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .topbar { display: block; padding: 10px 14px 12px; }
  .brand-mark-dcy { width: 44px; }
  .brand-block h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-block p { display: none; }
  .top-actions { width: 100%; justify-content: space-between; gap: 6px; margin-top: 10px; }
  .top-actions .icon-button { width: 34px; height: 34px; }
  .sync-state { display: none; }
  .dcy-provenance-strip { height: 40px; padding: 0 14px; }
  .provenance-items { width: 100%; justify-content: space-between; }
  .provenance-items span { padding: 0 8px; font-size: 11px; }
  .provenance-items span:first-child { padding-left: 0; }
  .provenance-items span:last-child { border-right: 0; padding-right: 0; }
  .provenance-visual { display: none; }
  .customer-search-band { grid-template-columns: 1fr auto; padding: 12px 14px; }
  .search-label { grid-column: 1 / -1; }
  .customer-context { padding: 13px 14px; align-items: flex-start; flex-direction: column; gap: 12px; }
  .customer-supplement { padding: 14px; }
  .context-metrics { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
  .supplement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-mini-heading { display: block; }
  .panel-mini-heading span { display: block; margin-top: 8px; text-align: left; }
  .talk-library-grid { grid-template-columns: 1fr; }
  .knowledge-hint-list { grid-template-columns: 1fr; }
  .workspace-grid { display: block; }
  .parameter-pane, .recommendation-pane, .feedback-pane { padding: 18px 14px 22px; border-left: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .feedback-pane { border-top: 1px solid var(--line); }
  .action-strip { grid-template-columns: 1fr; }
  .action-strip div { border-right: 0; border-bottom: 1px solid var(--line); }
  .action-strip div:last-child { border-bottom: 0; }
  .evidence-row { grid-template-columns: 1fr 1fr; }
  .feedback-pane form { display: block; }
}

@media (max-width: 430px) {
  .customer-search-band { grid-template-columns: 1fr; }
  .customer-search-band .secondary-button { width: 100%; }
  .two-fields { grid-template-columns: 1fr; gap: 0; }
  .safety-fieldset { grid-template-columns: 1fr; }
  .field-label-row { display: block; }
  .text-link-button { margin-bottom: 10px; }
  .section-heading { align-items: flex-start; }
  .product-result h3 { font-size: 18px; }
  .supplement-heading { display: block; }
  .supplement-source-badge { margin-top: 10px; }
  .supplement-grid { grid-template-columns: 1fr; }
}

.page-body { min-height: 100vh; background: #f1f7f5; }
.page-shell { max-width: 1440px; margin: 0 auto; padding: 22px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.page-heading h2 { margin: 0; color: var(--navy); font-size: 23px; font-weight: 600; line-height: 1.35; }
.page-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; max-width: 760px; }
.page-heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.page-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); margin-bottom: 18px; }
.page-summary article { background: var(--surface); min-height: 102px; padding: 15px 17px; display: flex; flex-direction: column; }
.page-summary span, .page-summary small { color: var(--muted); font-size: 12px; }
.page-summary strong { margin: 8px 0 6px; color: var(--navy); font-size: 24px; font-weight: 600; line-height: 1.15; }

.directory-card, .material-card { background: var(--surface); border: 1px solid var(--line); }
.directory-card { padding: 16px 18px; margin-bottom: 18px; }
.directory-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.directory-card h3 { margin: 4px 0 0; color: var(--navy); font-size: 17px; font-weight: 600; }
.directory-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.directory-status { min-height: 28px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; background: var(--teal-soft); color: var(--teal); font-size: 12px; font-weight: 600; white-space: nowrap; }
.directory-status.warning { background: var(--gold-soft); color: var(--gold); }

.material-grid { display: grid; gap: 18px; margin-bottom: 18px; }
.material-card { padding: 18px; }
.material-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.material-card-head h3 { margin: 4px 0 0; color: var(--navy); font-size: 18px; font-weight: 600; line-height: 1.35; }
.material-card-head p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; max-width: 760px; }
.material-eyebrow { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 999px; background: rgba(22,59,88,.08); color: var(--navy); font-size: 11px; font-weight: 600; }
.material-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.material-badge { min-height: 26px; padding: 0 9px; border-radius: 999px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; white-space: nowrap; }
.material-badge.info { background: var(--blue-soft); color: var(--navy-2); }
.material-badge.positive { background: var(--teal-soft); color: var(--teal); }
.material-badge.warning { background: var(--gold-soft); color: var(--gold); }
.material-badge.muted { background: #f0f3f5; color: var(--muted); }

.material-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.material-meta div { min-width: 0; padding: 12px 13px; border: 1px solid var(--line); background: #fbfcfd; }
.material-meta span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.material-meta strong { display: block; color: var(--ink); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.material-meta small { display: block; color: var(--muted); font-size: 11px; margin-top: 6px; line-height: 1.55; }
.path-code { display: block; margin-top: 10px; padding: 10px 12px; border-radius: 6px; background: #f6f8fa; border: 1px solid var(--line); color: #334655; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.material-note { margin: 0; color: #334655; font-size: 12px; line-height: 1.65; }
.usage-list { display: grid; gap: 12px; margin-top: 12px; }
.usage-list div { padding-top: 12px; border-top: 1px solid var(--line); }
.usage-list div:first-child { padding-top: 0; border-top: 0; }
.usage-list strong { display: block; margin-bottom: 4px; color: var(--navy); font-size: 13px; }
.usage-list span { color: var(--muted); font-size: 12px; line-height: 1.65; }
.empty-material-card strong { display: block; color: var(--navy); font-size: 15px; margin-bottom: 8px; }
.empty-material-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

.knowledge-toolbar { display: grid; grid-template-columns: minmax(280px, 1fr) 190px 220px; gap: 12px; margin-bottom: 18px; align-items: start; }
.knowledge-toolbar .field-control { margin: 0; }
.knowledge-search { position: relative; min-height: 42px; display: flex; align-items: center; border: 1px solid #aebbc5; background: #fff; border-radius: 6px; }
.knowledge-search svg { margin-left: 12px; color: var(--muted); width: 18px; flex: 0 0 auto; }
.knowledge-search input { border: 0; outline: 0; width: 100%; min-width: 0; height: 40px; padding: 0 12px 0 8px; color: var(--ink); background: transparent; }
.knowledge-notice { border-left: 3px solid var(--teal); }
.knowledge-entry-grid { display: grid; gap: 16px; margin-bottom: 18px; }
.knowledge-card { background: var(--surface); border: 1px solid var(--line); padding: 18px; }
.knowledge-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.knowledge-card-head h3 { margin: 6px 0 0; color: var(--navy); font-size: 18px; line-height: 1.35; font-weight: 600; }
.knowledge-card-head p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; max-width: 900px; }
.knowledge-card-head .material-badge { flex: 0 0 auto; margin-top: 2px; }
.knowledge-relations { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 13px; }
.knowledge-relations > div { min-width: 0; padding: 12px; border: 1px solid var(--line); background: #fbfcfd; }
.knowledge-relations span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.knowledge-relations .material-badges { justify-content: flex-start; }
.knowledge-detail-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; border: 1px solid var(--line); background: var(--line); margin-bottom: 12px; }
.knowledge-detail-grid section { background: #fff; padding: 13px 14px; min-width: 0; }
.knowledge-detail-grid strong { display: block; margin-bottom: 8px; color: var(--navy); font-size: 13px; }
.knowledge-detail-grid ul { margin: 0 0 0 18px; padding: 0; color: #334655; font-size: 12px; line-height: 1.7; }
.knowledge-detail-grid li + li { margin-top: 5px; }
.knowledge-detail-grid .safety-section { background: #fffafa; }
.knowledge-sources { display: flex; flex-wrap: wrap; gap: 8px; }
.source-link { min-height: 28px; padding: 5px 9px; border-radius: 999px; display: inline-flex; align-items: center; background: var(--blue-soft); color: var(--navy-2); font-size: 11px; text-decoration: none; }
.source-link:hover { text-decoration: underline; }
.source-link.muted { background: #f0f3f5; color: var(--muted); }
.source-path { min-height: 28px; max-width: 100%; padding: 5px 9px; border-radius: 999px; display: inline-flex; align-items: center; background: #f6f8fa; border: 1px solid var(--line); color: #52616d; font-size: 11px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.source-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); margin-top: 12px; }
.source-grid article { min-width: 0; background: #fbfcfd; padding: 13px; }
.source-grid span { color: var(--gold); font-size: 11px; font-weight: 600; }
.source-grid strong { display: block; margin: 6px 0 5px; color: var(--navy); font-size: 13px; }
.source-grid p, .source-grid a { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.source-grid a { display: block; margin-top: 8px; color: var(--navy-2); text-decoration: none; }
.source-grid a:hover { text-decoration: underline; }

.preference-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; align-items: start; }
.preference-form { display: grid; gap: 18px; }
.preference-section { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.preference-section:last-of-type { border-bottom: 0; padding-bottom: 0; }
.checkbox-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.checkbox-card-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check-card { min-height: 78px; padding: 12px; border: 1px solid var(--line); background: #fbfcfd; display: flex; flex-direction: column; gap: 5px; cursor: pointer; }
.check-card input { position: absolute; opacity: 0; pointer-events: none; }
.check-card span { color: var(--navy); font-size: 13px; font-weight: 600; line-height: 1.4; }
.check-card small { color: var(--muted); font-size: 11px; line-height: 1.55; }
.check-card:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 3px 0 0 var(--teal); }
.preference-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.preference-preview { position: sticky; top: 18px; display: grid; gap: 14px; }
.preference-summary-block { padding: 12px 13px; border: 1px solid var(--line); background: #fbfcfd; }
.preference-summary-block strong { display: block; color: var(--navy); font-size: 13px; margin-bottom: 6px; }
.preference-summary-block p { margin: 0; color: #334655; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.preference-next-card { padding: 14px; border: 1px solid var(--line); background: #fffdfa; }
.preference-next-card h4 { margin: 8px 0 8px; color: var(--navy); font-size: 14px; }
.preference-next-card ul, .guide-card ul { margin: 10px 0 0 18px; padding: 0; color: #334655; font-size: 12px; line-height: 1.7; }
.preference-next-card li + li, .guide-card li + li { margin-top: 5px; }
.preference-boundary { border-left: 3px solid var(--gold); }

.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.guide-card h3 { margin: 8px 0 8px; color: var(--navy); font-size: 18px; line-height: 1.35; }
.guide-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.guide-card .secondary-button { margin-top: 14px; }
.pain-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 12px; border: 1px solid var(--line); background: var(--line); }
.pain-grid article { background: #fbfcfd; padding: 14px; min-height: 118px; }
.pain-grid strong { display: block; margin-bottom: 7px; color: var(--navy); font-size: 13px; }
.pain-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.guide-steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; margin-top: 12px; border: 1px solid var(--line); background: var(--line); }
.guide-steps article { min-width: 0; background: #fbfcfd; padding: 13px; }
.guide-steps span { width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--navy-2); color: #fff; font-size: 12px; font-weight: 600; }
.guide-steps strong { display: block; margin: 10px 0 6px; color: var(--navy); font-size: 13px; line-height: 1.4; }
.guide-steps p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

@media (max-width: 980px) {
  .page-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .material-meta { grid-template-columns: 1fr; }
  .knowledge-toolbar { grid-template-columns: 1fr 1fr; }
  .knowledge-search { grid-column: 1 / -1; }
  .knowledge-detail-grid { grid-template-columns: 1fr; }
  .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preference-layout { grid-template-columns: 1fr; }
  .preference-preview { position: static; }
  .pain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .page-shell { padding: 14px; }
  .page-heading { display: block; }
  .page-heading-actions { margin-top: 12px; }
  .knowledge-toolbar { grid-template-columns: 1fr; }
  .knowledge-card-head { display: block; }
  .knowledge-card-head .material-badge { margin-top: 10px; }
  .knowledge-relations { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .checkbox-card-grid, .checkbox-card-grid.compact { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .page-summary { grid-template-columns: 1fr; }
  .directory-card, .material-card { padding: 14px; }
  .material-card-head { display: block; }
  .material-badges { justify-content: flex-start; margin-top: 10px; }
  .knowledge-card { padding: 14px; }
  .source-grid { grid-template-columns: 1fr; }
  .pain-grid, .guide-steps { grid-template-columns: 1fr; }
}
