.chemical-workspace { padding-block: 48px 88px; color: #24404d; }
.chemical-workspace[hidden] { display: none; }
.chemical-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.chemical-header h1 { margin: 4px 0 10px; color: #163648; font-size: clamp(30px,3vw,42px); }
.chemical-header p { margin: 0; color: #637982; line-height: 1.6; }
.chemical-header > div > p:first-child { color: #168876; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.chemical-header-actions { display: flex; align-items: end; gap: 12px; }
.chemical-header-actions label,.chemical-filters label,.chemical-form-grid label { display: grid; gap: 7px; color: #516973; font-size: 12px; font-weight: 700; }
.chemical-workspace input,.chemical-workspace select,.chemical-workspace textarea { max-width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #cbdadd; border-radius: 7px; color: #24404d; background: #fff; font: inherit; }
.chemical-workspace textarea { min-height: 75px; }
.chemical-workspace button { cursor: pointer; }
.chemical-workspace button:disabled { cursor: not-allowed; }
.chemical-workspace .primary-button,.chemical-workspace .secondary-button { min-height: 40px; }
#chemical-message { min-height: 1.5em; color: #a14c34; font-size: 13px; }
.chemical-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.chemical-summary button,.chemical-panel { border: 1px solid #dce6e9; border-radius: 13px; background: #fff; box-shadow: 0 7px 22px rgba(24,57,68,.05); }
.chemical-summary button { display: grid; gap: 12px; padding: 20px; color: #526c75; text-align: left; }
.chemical-summary strong { color: #153a4a; font-size: 28px; }
.chemical-summary button:hover,.chemical-product-row:hover,.chemical-departments button:hover { border-color: #8ebeb5; background: #f7fbfa; }
.chemical-panel { margin-bottom: 18px; padding: 24px; }
.chemical-panel h2 { margin: 0; color: #183b4a; font-size: 23px; }
.chemical-panel-heading { margin-bottom: 18px; }
.chemical-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chemical-list-heading > button { flex: 0 0 auto; width: auto; }
.chemical-panel-heading p,.chemical-panel > p { margin: 7px 0 0; color: #6c8087; font-size: 13px; }
.chemical-departments { display: grid; gap: 8px; }
.chemical-departments button { display: grid; grid-template-columns: minmax(110px,1fr) minmax(80px,3fr) 65px minmax(170px,1.3fr); align-items: center; gap: 14px; width: 100%; padding: 10px 12px; border: 1px solid #e1e9ea; border-radius: 8px; color: #34515e; background: #fff; text-align: left; }
.chemical-dept-name { font-weight: 750; }
.chemical-bar { height: 8px; border-radius: 6px; background: #e8f0ef; }
.chemical-bar i { display: block; height: 100%; border-radius: inherit; background: #2ca188; }
.chemical-departments small { color: #72878b; }
.chemical-management-status { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.chemical-management-status > * { display: flex; justify-content: space-between; gap: 8px; padding: 13px; border: 1px solid #e0e8e9; border-radius: 8px; color: #45626b; background: #fafcfc; font: inherit; text-align: left; }
.chemical-management-status strong { color: #1d5361; }
.chemical-filters { display: grid; grid-template-columns: minmax(190px,2fr) minmax(170px,1.2fr) minmax(130px,1fr) auto; align-items: end; gap: 12px; margin-bottom: 18px; }
.chemical-list { border-top: 1px solid #e4ebec; }
.chemical-product-row { display: grid; grid-template-columns: minmax(150px,2fr) minmax(120px,1.3fr) minmax(95px,1fr) minmax(80px,.8fr) minmax(90px,.8fr); align-items: center; gap: 12px; width: 100%; padding: 15px 8px; border: 0; border-bottom: 1px solid #e4ebec; color: #36525e; background: #fff; text-align: left; font: inherit; }
.chemical-product-row > span { min-width: 0; overflow-wrap: anywhere; }
.chemical-product-row small { display: block; margin-bottom: 4px; color: #84959a; font-size: 11px; }
.chemical-product-main strong { display: block; color: #153b4b; font-size: 15px; }
.chemical-positive { color: #087b68; font-weight: 750; }.chemical-empty { color: #80636a; font-weight: 750; }.chemical-caution { color: #825c18; font-weight: 750; }
.chemical-no-results { padding: 24px 0; color: #687d84; }
.chemical-back { margin-bottom: 18px; padding: 0; border: 0; color: #087b68; background: none; font-weight: 750; }
.chemical-workspace fieldset { margin: 22px 0; padding: 18px; border: 1px solid #e0e8e9; border-radius: 9px; }
.chemical-workspace legend { padding-inline: 6px; color: #214b58; font-size: 17px; font-weight: 800; }
.chemical-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.chemical-wide { grid-column: 1 / -1; }
.chemical-candidates { margin-top: 18px; padding: 14px; border: 1px solid #a9ceca; border-radius: 8px; background: #f5fbf9; }
.chemical-candidates > strong { display: block; margin-bottom: 8px; }
.chemical-candidates > div { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; }
.chemical-candidates button { padding: 8px 10px; border: 1px solid #91bdb4; border-radius: 6px; color: #087969; background: #fff; }
.chemical-detail-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.chemical-detail-head p { margin: 7px 0 0; color: #6b7f86; }
.chemical-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.chemical-quick a { padding: 8px 11px; border: 1px solid #c9dad9; border-radius: 6px; color: #087969; text-decoration: none; }
.chemical-tabs { display: flex; gap: 6px; margin: 23px 0; overflow-x: auto; border-bottom: 1px solid #dce6e8; }
.chemical-tabs button { flex: 0 0 auto; padding: 10px 15px; border: 0; border-bottom: 2px solid transparent; color: #6d8188; background: none; font-weight: 700; }
.chemical-tabs button[aria-current] { border-color: #168876; color: #087969; }
.chemical-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 22px; }
.chemical-facts > div { display: grid; grid-template-columns: minmax(90px,35%) 1fr; gap: 10px; padding: 12px 2px; border-bottom: 1px solid #edf1f1; }
.chemical-facts dt { color: #758a91; }.chemical-facts dd { margin: 0; color: #294b58; overflow-wrap: anywhere; }
.chemical-usage-list { display: grid; gap: 13px; }
.chemical-usage-list article { padding: 16px; border: 1px solid #e0e8e9; border-radius: 9px; }
.chemical-usage-list h3 { margin: 0 0 8px; color: #22505b; }
.chemical-usage-form { margin-top: 18px; }.chemical-usage-form button { margin-top: 16px; }
.chemical-workspace details { margin-top: 20px; padding: 14px; border: 1px solid #e0e8e9; border-radius: 8px; }
.chemical-workspace summary { cursor: pointer; color: #087969; font-weight: 750; }
.chemical-workspace details form { margin-top: 16px; }
.chemical-msds-status { display: flex; gap: 18px; align-items: center; padding: 20px; border-radius: 9px; background: #f0f6f5; font-size: 18px; }
.chemical-upload-control { margin: 20px 0; }
.chemical-msds-upload { margin-top: 14px; padding: 18px; border: 1px solid #d7e4e5; border-radius: 9px; background: #f9fbfb; }
.chemical-msds-upload > button { margin-top: 16px; }
.chemical-upload-status { min-height: 1.5em; color: #526b74; font-size: 13px; }
.chemical-file-label { grid-column: 1 / -1; min-width: 0; }
.chemical-file-label input { width: 100%; }
.chemical-file-state { max-width: 100%; color: #607981; font-weight: 500; overflow-wrap: anywhere; }
.chemical-analysis-status { display: block; margin-top: 5px; color: #316a69; font-weight: 650; overflow-wrap: anywhere; }
.chemical-auto-state { color: #468078; font-size: 11px; font-weight: 650; }
.chemical-analysis-comparison { margin-top: 18px; padding-top: 16px; border-top: 1px solid #dce7e7; }
.chemical-analysis-comparison h3 { margin: 0 0 5px; color: #28535e; font-size: 16px; }
.chemical-analysis-comparison > p { margin: 0 0 12px; color: #647b82; }
.chemical-analysis-row { display: grid; grid-template-columns: minmax(90px,.6fr) minmax(130px,1fr) minmax(180px,1.5fr); gap: 10px 16px; align-items: end; padding: 13px 0; border-top: 1px solid #e4ecec; }
.chemical-analysis-row > div { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 16px; }
.chemical-analysis-row > span { color: #687f86; overflow-wrap: anywhere; }
.chemical-composition-editor { grid-column: 1 / -1; margin-top: 18px; padding-top: 18px; border-top: 1px solid #dce7e7; }
.chemical-composition-editor[hidden] { display: none; }
.chemical-composition-heading { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 12px; }
.chemical-composition-heading h3 { margin: 0; color: #28535e; font-size: 17px; }
.chemical-composition-heading h3 span { color: #087969; }
.chemical-composition-heading p { margin: 5px 0 0; color: #647b82; font-size: 12px; }
.chemical-composition-heading em { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; color: #23675e; background: #e9f5f2; font-size: 11px; font-style: normal; font-weight: 750; }
.chemical-composition-heading em[data-status="PARTIAL"],.chemical-composition-heading em[data-status="UNRESOLVED"] { color: #825c18; background: #fff4d9; }
.chemical-composition-warning { padding: 10px 12px; border: 1px solid #ecd9a8; border-radius: 7px; color: #765619; background: #fffaf0; font-size: 12px; }
.chemical-composition-list { display: grid; gap: 10px; margin-bottom: 12px; }
.chemical-composition-row { padding: 13px; border: 1px solid #dce7e7; border-radius: 8px; background: #fff; }
.chemical-composition-row[data-confidence="low"] { border-color: #e5c677; background: #fffaf0; }
.chemical-composition-row header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.chemical-composition-row header strong { color: #244d59; }
.chemical-composition-row header span { margin-right: auto; color: #5c7a7b; font-size: 11px; }
.chemical-composition-row header button { padding: 4px 7px; border: 0; color: #9b4b41; background: transparent; }
.chemical-composition-row > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.chemical-composition-row label { display: grid; gap: 5px; color: #566f77; font-size: 11px; font-weight: 700; }
.chemical-composition-row .chemical-secret-check { display: flex; align-items: center; align-self: end; min-height: 40px; }
.chemical-composition-row .chemical-secret-check input { min-height: 0; }
.chemical-saved-composition { margin: 24px 0; padding-top: 18px; border-top: 1px solid #dce7e3; }
.chemical-saved-composition .chemical-panel-heading { margin-bottom: 12px; }
.chemical-saved-ingredient-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 11px; }
.chemical-saved-ingredient-list article { display: grid; gap: 5px; padding: 13px; border: 1px solid #dce7e3; border-radius: 10px; background: #f8fbfa; }
.chemical-saved-ingredient-list article strong { color: #173d35; }
.chemical-saved-ingredient-list article small,.chemical-saved-ingredient-list article span { overflow-wrap: anywhere; color: #526a64; }
.chemical-saved-ingredient-list article em { display: inline-flex; align-items: center; justify-content: center; justify-self: start; width: fit-content; min-width: 0; min-height: 0; padding: 3px 8px; border-radius: 999px; color: #176148; background: #e6f4ee; font-size: 11px; font-style: normal; line-height: 1.2; white-space: nowrap; }
.chemical-regulatory { display: grid; gap: 12px; }
.chemical-regulatory-category { padding: 16px; border: 1px solid #dce7e3; border-radius: 10px; background: #f9fbfa; }
.chemical-regulatory-category h4 { margin: 0 0 7px; color: #214b58; }
.chemical-regulatory-category[data-state="MATCH"] > strong { color: #087b68; }
.chemical-regulatory-category[data-state="REVIEW_REQUIRED"] > strong,.chemical-regulatory-evidence em { color: #825c18; }
.chemical-regulatory-evidence { display: grid; gap: 4px; margin-top: 10px; padding: 11px; border-top: 1px solid #e1e9e7; color: #526a64; }
.chemical-regulatory-evidence b { color: #173d35; }
.chemical-regulatory-evidence em { font-style: normal; font-weight: 700; }
.chemical-legal-notice { margin: 12px 0 0; padding: 10px; border-radius: 7px; color: #5f552d; background: #fff9e8; font-size: 12px; }
.chemical-danger-zone { margin-top: 24px; padding: 18px; border: 1px solid #e6b8b1; border-radius: 9px; background: #fff8f7; }
.chemical-danger-zone h3 { margin: 0; color: #8b362d; }
.chemical-danger-zone button { margin-top: 12px; padding: 9px 13px; border: 1px solid #b54b3d; border-radius: 6px; color: #fff; background: #a33f34; font-weight: 750; }
.chemical-usage-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chemical-department-management-list { display: grid; gap: 9px; margin-bottom: 14px; }
.chemical-department-form,.chemical-department-add { display: grid; grid-template-columns: minmax(180px,1fr) minmax(110px,180px) auto; align-items: end; gap: 10px; }
.chemical-department-form label,.chemical-department-add label { display: grid; gap: 5px; }
.chemical-department-add { grid-template-columns: minmax(180px,1fr) auto; max-width: 620px; }
.chemical-file-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 15px; }
.chemical-file-actions a { padding: 7px 10px; border: 1px solid #bcd4d1; border-radius: 6px; color: #087969; text-decoration: none; }
.chemical-version-row { display: grid; grid-template-columns: 100px 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #e8eeee; }
.chemical-version-row em { padding: 3px 6px; border-radius: 10px; color: #087564; background: #e3f3ef; font-size: 10px; font-style: normal; }
.chemical-version-row .chemical-file-actions { margin: 0; }
.chemical-history-row { display: grid; grid-template-columns: 90px minmax(120px,1fr) 120px 90px auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #e8eeee; }
.chemical-history-row .chemical-file-actions { margin: 0; }
.chemical-empty-panel,.chemical-loading { padding: 36px; border: 1px solid #e1e9ea; border-radius: 12px; background: #fff; }
@media (max-width:900px) {
  .chemical-header { align-items: start; flex-direction: column; }
  .chemical-summary,.chemical-management-status { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .chemical-departments button { grid-template-columns: minmax(100px,1fr) minmax(80px,2fr) 60px; }
  .chemical-departments small { grid-column: 1 / -1; }
  .chemical-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:600px) {
  .chemical-workspace { padding-block: 24px 60px; }
  .chemical-panel { padding: 16px; }
  .chemical-header-actions { width: 100%; flex-wrap: wrap; }
  .chemical-header-actions label { flex: 1; }
  .chemical-summary { gap: 8px; }
  .chemical-summary button { padding: 13px; }.chemical-summary strong { font-size: 23px; }
  .chemical-management-status,.chemical-form-grid,.chemical-filters,.chemical-facts { grid-template-columns: 1fr; }
  .chemical-list-heading { align-items: stretch; flex-direction: column; }
  .chemical-product-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .chemical-product-main { grid-column: 1 / -1; }
  .chemical-product-row > span:last-child { grid-column: 1 / -1; }
  .chemical-detail-head { flex-direction: column; }
  .chemical-departments button { grid-template-columns: minmax(85px,1fr) minmax(65px,1.5fr) 50px; gap: 8px; }
  .chemical-candidates > div { align-items: start; flex-direction: column; }
  .chemical-history-row { grid-template-columns: 1fr 1fr; }
  .chemical-version-row { grid-template-columns: 1fr auto; }
  .chemical-version-row .chemical-file-actions { grid-column: 1 / -1; }
  .chemical-analysis-row { grid-template-columns: 1fr; }
  .chemical-analysis-row > div { grid-column: 1; }
  .chemical-composition-heading { flex-direction: column; }
  .chemical-composition-row > div { grid-template-columns: 1fr; }
  .chemical-department-form,.chemical-department-add { grid-template-columns: 1fr; }
}
