.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.recorded, .wecom-ai-log article header b.sent { background: #eeeeee; color: #5e5e5e; }
.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 header b.missed { background: #f1f2f4; color: #737b87; }
.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: #5e5e5e; }
.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-nutrition-save { min-height: 30px; padding: 0 11px; border: 1px solid #9fc5f4; border-radius: 6px; background: #edf5ff; color: #1677ff; font-size: 11px; font-weight: 650; cursor: pointer; }
.wecom-nutrition-save:hover { border-color: #75acef; background: #e4f0ff; }
.wecom-nutrition-save:disabled { cursor: wait; opacity: .55; }
.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-meal-readonly { display: grid; gap: 8px; padding: 12px; }
.wecom-meal-readonly article { padding: 9px 10px; border: 1px solid #e7ebf0; border-radius: 7px; background: #f8fafc; }
.wecom-meal-readonly time { display: block; margin-bottom: 4px; color: #1677ff; font-size: 12px; }
.wecom-meal-readonly p { margin: 0; color: #334155; font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.wecom-meal-readonly small { display: block; margin-top: 5px; color: #64748b; font-size: 12px; }
.intervention-view { display: grid; gap: 13px; }
.intervention-view .wecom-feature-card { margin-bottom: 0; }
.intervention-view .wecom-phase-list article { align-items: flex-start; }
.intervention-view .wecom-phase-list article p { margin: 5px 0 0; color: #475569; font-size: 13px; line-height: 1.55; }
.wecom-plan-values { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; margin: 0 0 12px; }
.wecom-plan-values div { padding: 9px; border-radius: 7px; background: #f5f7fa; }
.wecom-plan-values dt { color: #64748b; font-size: 12px; }
.wecom-plan-values dd { margin: 5px 0 0; color: #1f2937; font-size: 14px; font-weight: 600; }
.wecom-plan-table, .wecom-plan-list { display: grid; gap: 8px; }
.wecom-plan-table article, .wecom-plan-list article { display: grid; grid-template-columns: minmax(70px,.55fr) minmax(80px,.65fr) minmax(180px,2fr) minmax(120px,1fr); gap: 10px; padding: 10px; border: 1px solid #e7ebf0; border-radius: 7px; align-items: start; }
.wecom-plan-table article p, .wecom-plan-table article small, .wecom-plan-list article p { margin: 0; line-height: 1.55; white-space: pre-wrap; }
.wecom-plan-table article time, .wecom-plan-table article small { color: #64748b; font-size: 12px; }
.wecom-plan-list article { display: block; }
.wecom-plan-list article p { margin-top: 6px; color: #475569; font-size: 13px; }
@media (max-width:1100px) { .wecom-plan-values { grid-template-columns: repeat(2,minmax(0,1fr)); }.wecom-plan-table article { grid-template-columns: 80px 1fr; } }
.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: #f8f8f8; }
.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 #dadada; 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: #eeeeee; color: #5e5e5e; 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 #dadada; border-radius: 6px; background: #eeeeee; 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: #dadada; }
.wecom-stage-phases article.done > span, .wecom-stage-phases button.done > span { background: #848484; }
.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: #f8f8f8; }
.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: #848484; background: #eeeeee; }
.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 #dadada; border-radius: 14px; background: #eeeeee; }
.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: #5e5e5e; }
.wecom-stage-kpis p.warn, .wecom-stage-table em.warn { color: #d46b08; }
.wecom-stage-card { margin-bottom: 18px; padding: 18px 20px; border: 1px solid #dadada; 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: #eeeeee; }
.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 #eeeeee; }
.wecom-stage-card dl div { display: flex; justify-content: space-between; gap: 15px; padding: 10px 1px; border-bottom: 1px solid #eeeeee; }
.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 #eeeeee; 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 #dadada; 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; }
}

/* 群聊患者 CGM 报告 */
.wecom-feature-page.glucose { padding: 22px 24px 36px; background: #f6f8fb; }
.wecom-glucose-title { align-items: flex-start; }
.wecom-glucose-title .wecom-period-tabs { gap: 5px; padding: 4px; border-radius: 9px; }
.wecom-glucose-title .wecom-period-tabs button { min-width: 54px; height: 32px; font-size: 12px; cursor: pointer; }
.wecom-cgm-status { display: grid; gap: 10px; margin-bottom: 14px; grid-template-columns: repeat(4,minmax(0,1fr)); }
.wecom-cgm-status > div { display: flex; min-width: 0; min-height: 58px; padding: 11px 14px; align-items: center; gap: 10px; border: 1px solid #dfe6ef; border-radius: 10px; background: #fff; box-sizing: border-box; }
.wecom-cgm-status > div:first-child > i { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: #bbc4d0; box-shadow: 0 0 0 4px #f0f2f5; }
.wecom-cgm-status > div:first-child > i.online { background: #848484; box-shadow: 0 0 0 4px #eeeeee; }
.wecom-cgm-status span { display: flex; min-width: 0; flex-direction: column; }
.wecom-cgm-status small { display: block; margin-bottom: 5px; color: #8490a0; font-size: 11px; }
.wecom-cgm-status strong { display: block; overflow: hidden; color: #263247; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.wecom-cgm-sync-banner { display: flex; align-items: center; gap: 10px; margin: -3px 0 14px; padding: 10px 13px; border: 1px solid #dfe6ef; border-radius: 9px; background: #fff; color: #667285; font-size: 12px; }
.wecom-cgm-sync-banner::before { width: 8px; height: 8px; border-radius: 50%; background: #a8b1bd; content: ''; }
.wecom-cgm-sync-banner.live { border-color: #dadada; background: #f8f8f8; color: #5e5e5e; }.wecom-cgm-sync-banner.live::before { background: #848484; }
.wecom-cgm-sync-banner.delayed { border-color: #f0dfb8; background: #fffaf0; color: #a66d10; }.wecom-cgm-sync-banner.delayed::before { background: #e2a126; }
.wecom-cgm-sync-banner.offline { border-color: #f1cecb; background: #fff6f5; color: #bf4f49; }.wecom-cgm-sync-banner.offline::before { background: #e05c54; }
.wecom-glucose-date-controls { display: flex; min-height: 38px; margin-bottom: 14px; padding: 9px 12px; align-items: center; justify-content: flex-end; gap: 10px; border: 1px solid #e1e7ef; border-radius: 9px; background: #fff; color: #6d7888; font-size: 12px; }
.wecom-glucose-date-controls label { display: flex; align-items: center; gap: 8px; }
.wecom-glucose-date-controls input { height: 32px; padding: 0 9px; border: 1px solid #d8e0ea; border-radius: 7px; background: #fff; color: #344054; font: inherit; }
.wecom-glucose-date-controls button { height: 32px; padding: 0 14px; border: 0; border-radius: 7px; background: #1677ff; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.wecom-feature-metrics.glucose { grid-template-columns: repeat(3,minmax(0,1fr)); }
.wecom-feature-metrics.glucose > article { padding: 15px 16px; border-radius: 11px; }
.wecom-feature-metrics.glucose article > span { font-size: 12px; }
.wecom-feature-metrics.glucose article > strong { font-size: 23px; }
.wecom-feature-metrics.glucose article > p { font-size: 11px; }
.wecom-feature-metrics article > strong.warn { color: #e07b16; }
.wecom-feature-metrics article > strong.danger { color: #df4b55; }
.wecom-glucose-chart-card, .wecom-agp-card, .wecom-time-analysis { min-width: 0; margin-bottom: 14px; padding: 16px 17px; }
.wecom-glucose-chart-card > header strong, .wecom-agp-card > header strong, .wecom-time-analysis > header strong { font-size: 16px; }
.wecom-chart-frame.glucose { height: 300px; min-height: 300px; max-height: 300px; }
.wecom-chart-frame.agp { position: relative; width: 100%; height: 280px; min-height: 280px; max-height: 280px; overflow: hidden; }
.wecom-chart-frame.agp > canvas { position: absolute !important; inset: 0; display: block; width: 100% !important; height: 100% !important; max-height: 100% !important; }
.wecom-glucose-day-picker { display: flex; max-height: 108px; margin-top: 13px; padding-top: 11px; overflow-y: auto; flex-wrap: wrap; gap: 7px; border-top: 1px solid #edf1f5; }
.wecom-glucose-day-picker button { min-width: 72px; height: 30px; padding: 0 10px; border: 1px solid #dbe3ec; border-radius: 16px; background: #fff; color: #667285; font: inherit; font-size: 11px; cursor: pointer; }
.wecom-glucose-day-picker button.active { border-color: #1677ff; background: #eaf3ff; color: #1269d8; font-weight: 700; }
.wecom-time-analysis > nav { display: grid; gap: 10px; margin: 4px 0 16px; grid-template-columns: repeat(3,minmax(0,1fr)); }
.wecom-time-analysis > nav button { height: 42px; border: 1px solid #e1e6ed; border-radius: 22px; background: #f5f7fa; color: #697484; font: inherit; font-size: 14px; cursor: pointer; }
.wecom-time-analysis > nav button.active { border-color: #ffd3d6; background: #fff0f1; color: #d93a45; font-weight: 700; }
.wecom-time-legend { display: flex; gap: 28px; margin-bottom: 15px; color: #667182; font-size: 12px; }
.wecom-time-legend span::before { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #848484; content: ''; }
.wecom-time-legend span.high::before { background: #ffad20; }
.wecom-time-legend span.low::before { background: #e4404c; }
.wecom-time-analysis > p { margin: 0 0 8px; color: #798494; font-size: 12px; }
.wecom-time-bars { display: grid; height: 225px; padding: 9px 5px 0; align-items: end; gap: 8px; border-bottom: 1px solid #dfe5ec; background: repeating-linear-gradient(to bottom,#edf1f5 0,#edf1f5 1px,transparent 1px,transparent 25%); grid-template-columns: repeat(9,minmax(18px,1fr)); }
.wecom-time-column { display: flex; height: 216px; min-width: 0; align-items: center; flex-direction: column; justify-content: flex-end; gap: 7px; }
.wecom-time-column > span { color: #7e8998; font-size: 11px; }
.wecom-time-bar { display: flex; width: min(34px,70%); height: 184px; overflow: hidden; flex-direction: column-reverse; border-radius: 15px 15px 2px 2px; background: #eef2f5; }
.wecom-time-bar i { display: block; width: 100%; min-height: 0; }
.wecom-time-bar i.target { background: #848484; }
.wecom-time-bar i.high { background: #ffad20; }
.wecom-time-bar i.low { background: #e4404c; }
.wecom-time-bar.empty::after { width: 100%; height: 100%; background: #eef2f5; content: ''; }

@media (max-width: 1250px) {
  .wecom-cgm-status { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .wecom-feature-metrics.glucose { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .wecom-feature-page.glucose { padding: 16px; }
  .wecom-glucose-title { gap: 12px; flex-direction: column; }
  .wecom-cgm-status, .wecom-feature-metrics.glucose { grid-template-columns: 1fr; }
  .wecom-glucose-date-controls { align-items: stretch; justify-content: flex-start; flex-wrap: wrap; }
  .wecom-time-legend { gap: 10px; flex-wrap: wrap; }
  .wecom-time-bars { overflow-x: auto; grid-template-columns: repeat(9,42px); }
}
