.wecom-ai-scroll { padding-bottom: 28px; }
.wecom-ai-head { display: flex; align-items: center; justify-content: space-between; padding: 3px 2px 15px; }
.wecom-ai-head > div { display: flex; min-width: 0; flex-direction: column; }
.wecom-ai-head strong { color: #202a3c; font-size: 17px; }
.wecom-ai-head small { margin-top: 5px; overflow: hidden; color: #8792a3; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.wecom-ai-head > span { color: #1677ff; font-size: 12px; white-space: nowrap; }
.wecom-ai-card > header { justify-content: space-between; }
.wecom-switch { display: inline-flex; cursor: pointer; }
.wecom-switch input { position: absolute; opacity: 0; pointer-events: none; }
.wecom-switch i { position: relative; width: 38px; height: 22px; border-radius: 12px; background: #cbd3dd; transition: .18s; }
.wecom-switch i::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(31,42,58,.25); content: ''; transition: .18s; }
.wecom-switch input:checked + i { background: #1677ff; }
.wecom-switch input:checked + i::after { transform: translateX(16px); }
.wecom-ai-fields { display: grid; gap: 11px; padding: 12px; }
.wecom-ai-fields label { display: grid; gap: 6px; color: #657185; font-size: 12px; }
.wecom-ai-fields select, .wecom-ai-fields input, .wecom-ai-fields textarea { width: 100%; padding: 0 10px; border: 1px solid #dfe5ed; border-radius: 6px; outline: 0; background: #fff; color: #273247; font-size: 13px; }
.wecom-ai-fields select, .wecom-ai-fields input { height: 36px; }
.wecom-ai-fields textarea { min-height: 100px; padding-top: 9px; resize: vertical; line-height: 1.55; }
.wecom-ai-fields select:focus, .wecom-ai-fields input:focus, .wecom-ai-fields textarea:focus { border-color: #78acf1; box-shadow: 0 0 0 3px rgba(22,119,255,.08); }
.wecom-ai-fields > p { margin: -1px 0 0; color: #929baa; font-size: 11px; line-height: 1.55; }
.wecom-ai-save { width: 100%; margin-bottom: 12px; background: #1677ff; }
.wecom-ai-log { padding: 2px 12px 10px; }
.wecom-ai-log article { padding: 10px 0; border-bottom: 1px solid #edf0f4; }
.wecom-ai-log article:last-child { border-bottom: 0; }
.wecom-ai-log article header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wecom-ai-log article header strong { overflow: hidden; color: #344054; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.wecom-ai-log article header b { flex: 0 0 auto; padding: 3px 6px; border-radius: 8px; background: #eef1f5; color: #788496; font-size: 10px; }
.wecom-ai-log article header b.replied, .wecom-ai-log article header b.sent { background: #e5f7ed; color: #139b64; }
.wecom-ai-log article header b.queued, .wecom-ai-log article header b.accepted { background: #edf4ff; color: #3576c8; }
.wecom-ai-log article header b.failed { background: #ffebea; color: #d44f4f; }
.wecom-ai-log article p { margin: 6px 0 0; color: #59667a; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.wecom-ai-log article small { display: block; margin-top: 6px; color: #1677ff; font-size: 11px; line-height: 1.5; }
.wecom-ai-log article small.error { color: #d44f4f; }
.wecom-delivery-state { font-size: 11px; color: #7c8798; white-space: nowrap; }
.wecom-delivery-state.sent { color: #159b65; }
.wecom-delivery-state.failed, .wecom-message-error { color: #d44f4f; }
.wecom-message-error { display: block; max-width: 460px; margin-top: 6px; font-size: 11px; line-height: 1.45; text-align: right; }

.wecom-nutrition-scroll { padding-bottom: 28px; }
.wecom-meal-card > header { align-items: flex-start; flex-direction: column; gap: 3px; padding-top: 10px; padding-bottom: 9px; }
.wecom-meal-card > header span { margin-left: 0; font-size: 11px; }
.wecom-meal-card textarea { display: block; width: calc(100% - 24px); min-height: 108px; margin: 12px; padding: 10px 11px; resize: vertical; border: 1px solid #dfe5ed; border-radius: 7px; outline: 0; color: #344054; font: inherit; font-size: 13px; line-height: 1.65; box-sizing: border-box; }
.wecom-meal-card textarea:focus { border-color: #78acf1; box-shadow: 0 0 0 3px rgba(22,119,255,.08); }
.wecom-nutrition-tip { margin: 0 2px 13px; color: #7b8798; font-size: 12px; line-height: 1.65; }

.wecom-feature-page.sop { padding-bottom: 32px; }
.wecom-sop-master { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid #dce5f0; border-radius: 8px; background: #fff; color: #4d5b70; font-size: 13px; }
.wecom-sop-days { display: grid; align-items: start; gap: 13px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.wecom-sop-day { overflow: hidden; border: 1px solid #dfe6ef; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(34,55,84,.03); }
.wecom-sop-day > header { display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 0 14px; border-bottom: 1px solid #edf1f5; background: #fbfcfe; }
.wecom-sop-day > header div { display: flex; align-items: baseline; gap: 8px; }
.wecom-sop-day > header b { color: #263247; font-size: 15px; }
.wecom-sop-day > header span { color: #8b96a6; font-size: 11px; }
.wecom-sop-day > header button { width: 30px; height: 30px; border: 1px solid #b9d5fa; border-radius: 7px; background: #edf5ff; color: #1677ff; font-size: 21px; line-height: 1; cursor: pointer; }
.wecom-sop-day-items { padding: 7px 13px; }
.wecom-sop-day-items > p { margin: 18px 0; color: #9aa4b2; font-size: 12px; text-align: center; }
.wecom-sop-day-items article { display: grid; align-items: start; gap: 8px; padding: 9px 0; border-bottom: 1px solid #edf0f4; grid-template-columns: 20px 86px minmax(0,1fr) 26px; }
.wecom-sop-day-items article:last-child { border-bottom: 0; }
.wecom-sop-item-enabled { padding-top: 7px; }
.wecom-sop-item-enabled input { width: 16px; height: 16px; accent-color: #1677ff; }
.wecom-sop-day-items input[type="time"], .wecom-sop-day-items textarea { width: 100%; border: 1px solid #dce3ec; border-radius: 6px; outline: 0; background: #fff; color: #344054; font: inherit; font-size: 12px; box-sizing: border-box; }
.wecom-sop-day-items input[type="time"] { height: 36px; padding: 0 6px; }
.wecom-sop-day-items textarea { min-height: 52px; padding: 7px 9px; resize: vertical; line-height: 1.5; }
.wecom-sop-day-items input:focus, .wecom-sop-day-items textarea:focus { border-color: #78acf1; box-shadow: 0 0 0 2px rgba(22,119,255,.08); }
.wecom-sop-day-items article > button { margin-top: 4px; border: 0; background: transparent; color: #9ca6b4; font-size: 22px; cursor: pointer; }
.wecom-sop-day-items article > button:hover { color: #e04c4c; }
.wecom-sop-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; padding: 14px; border: 1px solid #dfe6ef; border-radius: 9px; background: #fff; }
.wecom-sop-footer span { color: #7b8798; font-size: 12px; line-height: 1.5; }
.wecom-sop-footer button { flex: 0 0 auto; background: #1677ff; }

.wecom-stage-summary { padding: 0 22px 32px; background: #f5f7f7; }
.wecom-stage-patient { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 -22px 22px; padding: 14px 22px; border-bottom: 1px solid #dde4e1; background: #fff; }
.wecom-stage-person, .wecom-stage-person span { display: flex; min-width: 0; }
.wecom-stage-person { align-items: center; gap: 12px; }
.wecom-stage-person > i { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; border-radius: 50%; background: #dff3e8; color: #17805b; font-size: 18px; font-style: normal; font-weight: 700; }
.wecom-stage-person span { flex-direction: column; gap: 4px; }
.wecom-stage-person strong { color: #202a37; font-size: 17px; }
.wecom-stage-person small { overflow: hidden; color: #687487; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.wecom-stage-patient > div:last-child { display: flex; align-items: center; gap: 15px; }
.wecom-stage-patient > div:last-child b { padding: 6px 11px; border-radius: 16px; background: #e9f3ff; color: #1677ff; font-size: 13px; }
.wecom-stage-patient button, .wecom-stage-heading button, .wecom-stage-editor button { min-height: 36px; padding: 0 14px; border: 1px solid #d8dfe6; border-radius: 9px; background: #fff; color: #344054; font: inherit; font-size: 13px; cursor: pointer; }
.wecom-stage-patient button { border: 0; color: #526071; }
.wecom-stage-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.wecom-stage-heading h3 { margin: 0 0 8px; color: #171d28; font-size: 27px; font-weight: 700; }
.wecom-stage-heading label { display: flex; align-items: center; gap: 7px; color: #657185; font-size: 14px; }
.wecom-stage-heading input { width: 126px; height: 32px; padding: 0 7px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #4e5a6d; font: inherit; }
.wecom-stage-heading input:hover, .wecom-stage-heading input:focus { border-color: #cbd7e5; background: #fff; outline: 0; }
.wecom-stage-heading nav, .wecom-stage-editor footer div { display: flex; flex: 0 0 auto; gap: 9px; }
.wecom-stage-heading button.primary, .wecom-stage-editor button.primary { border-color: #1677ff; background: #1677ff; color: #fff; font-weight: 600; }
.wecom-stage-phases { display: grid; gap: 10px; margin-bottom: 17px; grid-template-columns: repeat(4,minmax(0,1fr)); }
.wecom-stage-phases.dynamic { grid-template-columns: repeat(auto-fit,minmax(175px,1fr)); }
.wecom-stage-phases article, .wecom-stage-phases button { position: relative; display: flex; min-height: 70px; padding: 17px 16px 13px; overflow: hidden; flex-direction: column; border: 1px solid #e0e6e3; border-radius: 6px; background: #ebf0ed; color: inherit; text-align: left; font: inherit; }
.wecom-stage-phases button { cursor: pointer; transition: border-color .16s ease,box-shadow .16s ease,background .16s ease; }
.wecom-stage-phases button:hover { border-color: #85b8f8; box-shadow: 0 3px 10px rgba(22,119,255,.08); }
.wecom-stage-phases article > span, .wecom-stage-phases button > span { position: absolute; inset: 0 0 auto; height: 4px; background: #c9d3ce; }
.wecom-stage-phases article.done > span, .wecom-stage-phases button.done > span { background: #35b87f; }
.wecom-stage-phases article.active > span, .wecom-stage-phases button.active > span, .wecom-stage-phases button.current > span { background: #ff883d; }
.wecom-stage-phases article strong, .wecom-stage-phases button strong { color: #28323f; font-size: 15px; }
.wecom-stage-phases article small, .wecom-stage-phases button small { margin-top: 5px; color: #7c8794; font-size: 12px; line-height: 1.35; }
.wecom-stage-phases article.active, .wecom-stage-phases button.active { border-color: #1677ff; background: #eef6ff; box-shadow: inset 0 0 0 1px #1677ff; }
.wecom-stage-plan-form { min-width: min(680px,78vw); }
.wecom-stage-plan-form > p { margin: 10px 0 18px; color: #748092; line-height: 1.65; }
.wecom-stage-plan-start { display: flex; align-items: center; gap: 14px; color: #28323f; font-weight: 700; }
.wecom-stage-plan-start input { width: 180px; padding: 9px 11px; border: 1px solid #dce3ea; border-radius: 7px; font: inherit; }
.wecom-stage-plan-head, .wecom-stage-plan-row { display: grid; grid-template-columns: 48px minmax(180px,1fr) 126px 64px; align-items: center; gap: 10px; }
.wecom-stage-plan-head { padding: 0 8px 8px; color: #7b8795; font-size: 13px; }
.wecom-stage-plan-row { margin-bottom: 9px; padding: 9px 8px; border: 1px solid #e6ebef; border-radius: 8px; background: #f8fafb; }
.wecom-stage-plan-row > b { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #e7f1ff; color: #1677ff; }
.wecom-stage-plan-row input { min-width: 0; width: 100%; box-sizing: border-box; padding: 9px 10px; border: 1px solid #dce3ea; border-radius: 6px; background: #fff; font: inherit; }
.wecom-stage-plan-row label { position: relative; }
.wecom-stage-plan-row label input { padding-right: 35px; }
.wecom-stage-plan-row label span { position: absolute; right: 11px; top: 10px; color: #7b8795; }
.wecom-stage-plan-row button, .wecom-stage-plan-add { border: 0; background: transparent; color: #1677ff; cursor: pointer; font: inherit; }
.wecom-stage-plan-row button { color: #dd4f4f; }
.wecom-stage-plan-row button:disabled { color: #c3cbd2; cursor: default; }
.wecom-stage-plan-add { margin-top: 4px; padding: 8px; font-weight: 700; }
.wecom-stage-diagnosis { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 15px 18px; border-left: 5px solid #ef70ae; background: #fff5da; }
.wecom-stage-diagnosis.stable { border-left-color: #35b77c; background: #eaf8f1; }
.wecom-stage-diagnosis strong { color: #313541; font-size: 15px; }
.wecom-stage-diagnosis p { margin: 6px 0 0; color: #687282; font-size: 13px; line-height: 1.55; }
.wecom-stage-diagnosis > b { flex: 0 0 auto; padding: 6px 11px; border-radius: 14px; background: #eaf4ff; color: #1677ff; font-size: 12px; }
.wecom-stage-kpis { display: grid; gap: 12px; margin-bottom: 18px; grid-template-columns: repeat(5,minmax(0,1fr)); }
.wecom-stage-kpis article { min-width: 0; padding: 16px 17px; border: 1px solid #dce2df; border-radius: 14px; background: #f0f1f1; }
.wecom-stage-kpis span { color: #626d7d; font-size: 14px; }
.wecom-stage-kpis strong { display: block; margin-top: 12px; color: #111827; font-size: 25px; font-weight: 600; white-space: nowrap; }
.wecom-stage-kpis strong small { font-size: 14px; font-weight: 500; }
.wecom-stage-kpis p { margin: 7px 0 0; color: #687486; font-size: 12px; }
.wecom-stage-kpis p.good, .wecom-stage-table em.good { color: #07965e; }
.wecom-stage-kpis p.warn, .wecom-stage-table em.warn { color: #d46b08; }
.wecom-stage-card { margin-bottom: 18px; padding: 18px 20px; border: 1px solid #dce3e0; border-radius: 14px; background: #fff; }
.wecom-stage-card > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.wecom-stage-card > header strong { color: #171d28; font-size: 19px; }
.wecom-stage-card > header span { color: #7c8796; font-size: 12px; }
.wecom-stage-chart { position: relative; height: 285px; }
.wecom-stage-chart canvas { display: block; width: 100%; height: 100%; }
.wecom-stage-chart img { width: 100%; max-height: 285px; object-fit: contain; }
.wecom-stage-legend { position: absolute; top: 0; right: 8px; display: flex; gap: 18px; padding: 5px 7px; background: rgba(255,255,255,.9); }
.wecom-stage-legend span { color: #4f5a69; font-size: 12px; }
.wecom-stage-legend span::before { display: inline-block; width: 22px; height: 3px; margin-right: 7px; vertical-align: middle; background: #f58637; content: ''; }
.wecom-stage-legend span.target::before { height: 0; border-top: 2px dashed #8f79ee; background: transparent; }
.wecom-stage-execution { display: grid; align-items: stretch; gap: 18px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.wecom-stage-execution > section { min-width: 0; }
.wecom-stage-bar { display: grid; align-items: center; gap: 12px; margin: 13px 0; grid-template-columns: 110px minmax(80px,1fr) 62px; }
.wecom-stage-bar > span { color: #445064; font-size: 13px; }
.wecom-stage-bar > i { height: 10px; overflow: hidden; border-radius: 6px; background: #e6ebe8; }
.wecom-stage-bar > i > b { display: block; height: 100%; border-radius: inherit; background: #ff873d; }
.wecom-stage-bar > i > b.pink { background: #e971b2; }
.wecom-stage-bar > strong { color: #222c3a; font-size: 13px; text-align: right; }
.wecom-stage-card dl { margin: 17px 0 0; border-top: 1px solid #e7ebe9; }
.wecom-stage-card dl div { display: flex; justify-content: space-between; gap: 15px; padding: 10px 1px; border-bottom: 1px solid #edf0ef; }
.wecom-stage-card dt, .wecom-stage-card dd { margin: 0; color: #4c5869; font-size: 13px; }
.wecom-stage-card dd { color: #17202d; font-weight: 600; }
.wecom-stage-table { overflow-x: auto; }
.wecom-stage-table > div { display: grid; min-width: 650px; padding: 12px 3px; border-bottom: 1px solid #e4e8e6; grid-template-columns: 1.2fr repeat(4,1fr); }
.wecom-stage-table > div:last-child { border-bottom: 0; }
.wecom-stage-table .head { padding-top: 3px; color: #253044; }
.wecom-stage-table b, .wecom-stage-table span, .wecom-stage-table em { font-size: 13px; font-style: normal; }
.wecom-stage-table span { color: #394557; }
.wecom-stage-table em.muted { color: #8a94a3; }
.wecom-stage-editor { padding: 2px 0 0; }
.wecom-stage-editor > label { display: block; margin: 0 0 10px; color: #182130; font-size: 20px; font-weight: 600; }
.wecom-stage-editor textarea { width: 100%; min-height: 150px; padding: 14px 15px; resize: vertical; border: 1px solid #d6ddda; border-radius: 12px; outline: 0; background: #fff; color: #293445; font: inherit; font-size: 14px; line-height: 1.8; box-sizing: border-box; }
.wecom-stage-editor textarea:focus { border-color: #78acf1; box-shadow: 0 0 0 3px rgba(22,119,255,.08); }
.wecom-stage-editor footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.wecom-stage-editor footer > span { color: #7c8795; font-size: 12px; }

@media (max-width: 1480px) {
  .wecom-sop-days { grid-template-columns: 1fr; }
  .wecom-stage-kpis { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .wecom-stage-bar { grid-template-columns: 92px minmax(70px,1fr) 58px; }
}

@media (max-width: 1050px) {
  .wecom-stage-patient, .wecom-stage-heading, .wecom-stage-editor footer { align-items: stretch; flex-direction: column; }
  .wecom-stage-patient > div:last-child { justify-content: space-between; }
  .wecom-stage-heading nav { align-self: flex-end; }
  .wecom-stage-phases { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .wecom-stage-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .wecom-stage-execution { grid-template-columns: 1fr; }
  .wecom-stage-plan-form { min-width: 0; }
  .wecom-stage-plan-head { display: none; }
  .wecom-stage-plan-row { grid-template-columns: 38px minmax(130px,1fr) 105px 48px; gap: 7px; }
}
