/* Scoped to the workbench; shared shell and navigation keep their existing styles. */
.wb-page { color: var(--text-900, #19243a); --wb-blue: var(--primary-600, #1769d2); }
.wb-page button { font-family: inherit; cursor: pointer; }
.wb-page button:disabled { cursor: wait; opacity: .55; }
.wb-page button:focus-visible { outline: 3px solid #8fb7fa; outline-offset: 3px; }
.wb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: 16px; align-items: start; }
.wb-main { min-width: 0; container-type: inline-size; }
.wb-aside { display: grid; gap: 12px; min-width: 0; margin-top: -10px; }
.wb-welcome { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 62px; margin-bottom: 11px; }
.wb-welcome h1 { margin: 0 0 7px; font-size: 26px; line-height: 1.3; font-weight: 700; letter-spacing: .01em; }
.wb-welcome p { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--text-600, #616b80); }
.wb-welcome p i { width: 1px; height: 12px; background: #c5cbd6; }
.wb-advice-banner { display: flex; align-items: center; gap: 10px; padding: 9px 13px; min-height: 46px; flex: 0 1 52%; max-width: 560px; border: 1px solid var(--ai-border); border-radius: 17px; background: linear-gradient(105deg, #fbfaff, #f8f6ff); color: var(--ai-600); text-align: left; }
.wb-advice-banner > span:nth-child(2) { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; line-height: 1.6; }
.wb-advice-banner > span:nth-child(2) > span { color: #434a5b; }
.wb-advice-banner > svg { margin-left: auto; flex-shrink: 0; }
.wb-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.wb-metric { border: 1px solid #edf0f5; border-radius: 12px; padding: 13px 12px 10px; min-height: 114px; background: #fff; box-shadow: 0 2px 4px #1e36500d, 0 5px 16px #1e365005; text-align: left; min-width: 0; transition: transform .15s, box-shadow .15s; }
.wb-metric:hover { transform: translateY(-2px); box-shadow: 0 5px 15px #1e365016; }
.wb-tone-blue { --wb-tone: #347fe8; --wb-tint: #eef5ff; --wb-line: #d8e6fa; }
.wb-tone-red { --wb-tone: #e52b30; --wb-tint: #fdf0f1; --wb-line: #f8d8da; }
.wb-tone-orange { --wb-tone: #f47b22; --wb-tint: #fff5eb; --wb-line: #f9dfc9; }
.wb-tone-green { --wb-tone: #279b78; --wb-tint: #f0f8f5; --wb-line: #dbeee6; }
.wb-tone-purple { --wb-tone: var(--ai-600); --wb-tint: #f6f1ff; --wb-line: #e6dcfa; }
.wb-metric-main { display: flex; align-items: center; gap: 10px; }
.wb-metric-icon { width: 48px; height: 48px; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; color: #fff; background: var(--wb-tone); box-shadow: inset 5px 1px 0 #ffffff1f, inset -5px -5px 9px #17397018; }
.wb-metric-main > div { min-width: 0; }
.wb-metric-main > div > span { display: block; white-space: nowrap; font-size: 12px; color: #525d70; }
.wb-metric strong { display: block; margin-top: 2px; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; color: #19243a; }
.wb-metric.wb-tone-red strong { color: var(--wb-tone); }
.wb-metric-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; color: var(--wb-tone); }
.wb-metric-change { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; color: #596273; font-size: 11px; white-space: nowrap; }
.wb-metric-change b { color: var(--wb-tone); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wb-metric-change.is-flat b { color: #758096; }
.wb-metric-foot svg { display: block; flex: 1 1 68px; min-width: 36px; max-width: 46%; height: 26px; overflow: visible; }
.wb-metric-history-note { margin: -6px 0 12px; color: #758096; font-size: 11px; }
.wb-card { border: 1px solid #edf0f5; border-radius: 13px; background: #fff; box-shadow: 0 2px 5px #26395709, 0 4px 18px #26395704; overflow: hidden; }
.wb-card h2 { margin: 0; font-size: 17px; font-weight: 700; }
.wb-task-heading { padding: 13px 17px 12px; min-height: 54px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.wb-task-heading > div:first-child { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px 12px; }
.wb-task-heading h2 { font-size: 19px; line-height: 26px; }
.wb-task-heading p { margin: 0; font-size: 12px; color: #8790a3; }
.wb-task-tools { display: flex; gap: 10px; }
.wb-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 29px; line-height: 1.35; border: 1px solid #d7dfec; border-radius: 5px; color: #465065; background: linear-gradient(#fff, #fcfdff); padding: 4px 12px; font-size: 13px; white-space: nowrap; }
.wb-button:hover { color: var(--wb-blue); border-color: #89b5ef; background: #f7faff; }
.wb-button.is-selected { color: #bd252b; border-color: #ef9ba0; background: #fff3f3; }
.wb-button.wb-primary { color: white; border-color: var(--wb-blue); background: linear-gradient(130deg, var(--primary-700), var(--primary-600)); box-shadow: 0 2px 4px #1c63b713; }
.wb-button.wb-primary:hover { filter: brightness(1.07); }
.wb-button.wb-purple { border-color: var(--ai-600); background: linear-gradient(110deg, var(--ai-600), #7538ce); }
.wb-wide { display: flex; width: 100%; min-height: 35px; font-weight: 600 !important; }
.wb-task-groups { padding: 0 17px; display: grid; gap: 8px; }
.wb-task-group { overflow: hidden; border: 1px solid var(--wb-line); border-radius: 8px; }
.wb-group-title { display: flex; align-items: center; gap: 8px; padding: 6px 12px; min-height: 34px; line-height: 20px; color: var(--wb-tone); background: linear-gradient(100deg, var(--wb-tint), color-mix(in srgb, var(--wb-tint) 60%, white)); }
.wb-group-title h3 { margin: 0; font-size: 13px; font-weight: 650; }
.wb-group-title > strong { margin-left: 8px; font-size: 12px; }
.wb-dot { width: 13px; height: 13px; background: var(--wb-tone); border-radius: 50%; box-shadow: inset 2px 1px 0 #ffffff25; }
.wb-task-row { position: relative; display: grid; grid-template-columns: minmax(172px, 1fr) 82px 118px minmax(180px, 1.35fr) 198px; align-items: center; gap: 10px; min-height: 64px; padding: 6px 12px 6px 15px; border-top: 1px solid #edf0f5; }
.wb-task-row::before { content: ''; position: absolute; left: 0; top: 5px; bottom: 5px; width: 4px; border-radius: 4px; background: var(--wb-tone); }
.wb-task-row:hover { background: #fcfdff; }
.wb-patient { min-width: 0; display: flex; gap: 11px; align-items: center; padding: 0; border: 0; text-align: left; background: none; color: inherit; }
.wb-patient > span:last-child { min-width: 0; }
.wb-avatar { display: inline-block; flex-shrink: 0; width: 37px; height: 37px; overflow: hidden; border-radius: 50%; }
.wb-avatar svg { display: block; width: 100%; height: 100%; }
.wb-patient-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 9px; font-size: 14px; line-height: 20px; }
.wb-patient-name strong { font-weight: 650; }
.wb-patient-name small { color: #6b7588; font-size: 12px; font-weight: 400; }
.wb-diagnosis { display: block; margin-top: 3px; color: #465169; font-size: 13px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-task-type { min-width: 0; }
.wb-task-type > span { display: inline-block; padding: 2px 9px; line-height: 19px; border-radius: 4px; color: var(--wb-tone); background: var(--wb-tint); font-size: 12px; white-space: nowrap; }
.wb-task-type > small { display: block; margin-top: 4px; font-size: 10px; color: #8b93a2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-task-date { font-size: 12px; line-height: 1.6; }
.wb-task-date > strong { display: block; font-size: 14px; font-weight: 650; }
.wb-task-date small { display: block; color: #647087; font-size: 12px; }
.wb-task-date.is-urgent > strong { color: #e52b30; }
.wb-task-advice { align-self: stretch; display: flex; align-items: center; border: 0; border-left: 1px solid #edf0f5; padding: 0 0 0 13px; color: #535d70; font-size: 12px; line-height: 1.7; text-align: left; background: transparent; }
.wb-task-advice > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wb-task-advice b { color: var(--ai-600); font-weight: 500; }
.wb-task-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; }
.wb-task-actions .wb-button { min-height: 23px; padding: 2px 7px; color: var(--wb-blue); font-size: 12px; line-height: 16px; }
.wb-task-actions .wb-complete { border-color: #c5e2d7; color: #249b79; grid-column: 1; }
.wb-task-actions .wb-muted-button { color: #747f91; }
.wb-group-empty { padding: 23px 16px; color: #9099aa; text-align: center; font-size: 12px; }
.wb-group-more { display: flex; border: 0; margin: 5px auto; color: var(--wb-blue); }
.wb-all-tasks { width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 7px; min-height: 32px; line-height: 18px; color: var(--wb-blue); font-size: 13px; border: 0; background: transparent; }
.wb-risk-card, .wb-message-card, .wb-quick-card { padding: 15px 13px 13px; }
.wb-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.wb-card-heading h2 { display: flex; align-items: center; gap: 6px; font-size: 16px; line-height: 24px; }
.wb-tiny { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: #8791a4; }
.wb-risk-rings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 22px 3px 12px; justify-items: center; }
.wb-risk-ring { position: relative; width: 82px; max-width: 100%; aspect-ratio: 1; color: var(--wb-tone); text-align: center; }
.wb-risk-ring svg { display: block; width: 100%; }
.wb-risk-ring > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.wb-risk-ring strong { font-size: 23px; font-weight: 700; line-height: 1.3; }
.wb-risk-ring small { color: #697080; font-size: 10px; line-height: 1.4; }
.wb-section-label { display: flex; align-items: center; justify-content: space-between; background: #f8f9fc; margin: 0 -4px; padding: 5px 7px; line-height: 18px; font-size: 12px; }
.wb-section-label strong span { margin-left: 6px; }
.wb-text-link { display: inline-flex; align-items: center; gap: 2px; color: var(--wb-blue); border: 0; padding: 0; background: none; font-size: 11px; line-height: 18px; white-space: nowrap; }
.wb-risk-list { margin-bottom: 10px; }
.wb-risk-person, .wb-waiting-person { display: flex; align-items: center; width: 100%; gap: 9px; padding: 7px 2px; min-height: 58px; line-height: 20px; background: none; border: 0; border-bottom: 1px solid #eff1f5; text-align: left; color: inherit; }
.wb-risk-person:hover, .wb-waiting-person:hover { background: #f8faff; }
.wb-risk-person:last-child, .wb-waiting-person:last-child { border-bottom: 0; }
.wb-risk-person > span:last-child { min-width: 0; flex: 1; }
.wb-risk-person .wb-avatar, .wb-waiting-person .wb-avatar { width: 33px; height: 33px; }
.wb-risk-person .wb-patient-name { gap: 6px; font-size: 13px; }
.wb-risk-tag { font-size: 11px; line-height: 17px; font-style: normal; background: #fff0e6; color: #eb782c; padding: 1px 5px; border-radius: 3px; }
.wb-risk-tag.is-high { background: #feebed; color: #d72c36; }
.wb-risk-reason { display: block; font-size: 12px; line-height: 20px; color: #505d74; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wb-empty-small { text-align: center; color: #8f98a8; font-size: 12px; padding: 25px 4px; }
.wb-count-badge { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 20px; background: #db3039; color: white; font-size: 11px; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; }
.wb-waiting-list { margin: 8px -1px 7px; border-top: 1px solid #f0f2f6; }
.wb-waiting-person { position: relative; padding-right: 12px; }
.wb-waiting-person > span:nth-child(2) { flex: 1; min-width: 0; }
.wb-waiting-person .wb-patient-name { font-size: 13px; gap: 5px; flex-wrap: nowrap; }
.wb-waiting-person time { margin-left: auto; flex-shrink: 0; color: #8993a7; font-size: 11px; }
.wb-message-excerpt { display: block; margin-top: 3px; font-size: 12px; line-height: 20px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; color: #5e687c; }
.wb-waiting-person > i { position: absolute; right: 1px; bottom: 17px; width: 8px; height: 8px; background: #dc303b; border-radius: 50%; }
.wb-quick-card h2 { margin-bottom: 17px; }
.wb-quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.wb-quick-grid button { border: 0; border-radius: 10px; min-height: 87px; padding: 10px 2px; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; color: #fff; background: linear-gradient(125deg, #1456b9, var(--primary-600)); box-shadow: inset 0 1px 3px #ffffff22; }
.wb-quick-grid button:last-child { background: linear-gradient(130deg, var(--ai-600), #7436d5); }
.wb-quick-grid button:hover { filter: brightness(1.08); }
.wb-quick-grid span { font-size: 11px; line-height: 18px; font-weight: 550; max-width: 100%; overflow-wrap: anywhere; }
.wb-ai-dialog { position: fixed; inset: 0 0 0 auto; margin: 0; height: 100dvh; max-height: 100dvh; width: min(570px, 100vw); max-width: 100vw; border: 0; border-left: 1px solid var(--ai-border); padding: 0; background: #fff; color: var(--text-900); box-shadow: -12px 0 60px #17294f20; }
.wb-ai-dialog::backdrop { background: #132b493b; }
.wb-ai-dialog > header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 21px; border-bottom: 1px solid #e9e2f2; background: #fcfaff; }
.wb-ai-dialog > header h2 { font-size: 18px; margin: 0 0 5px; }
.wb-ai-dialog > header p { font-size: 12px; color: #798294; margin: 0; }
.wb-dialog-close { border: 0; border-radius: 5px; background: transparent; color: #647087; padding: 5px; }
.wb-ai-dialog .app-run-panel { border: 0; border-radius: 0; box-shadow: none; width: 100%; }
.wb-batch-patients { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.wb-form-status { font-size: 12px; color: #c63742; }
.wb-task-tools .wb-button { padding-inline: 16px; }
.wb-task-tools .wb-button:first-child { min-width: 120px; }
.wb-task-tools .wb-button:nth-child(2) { min-width: 94px; }
.wb-task-tools .wb-primary { min-width: 134px; }
.wb-due-weekday { font-size: 12px; color: #6a758b; font-weight: 400; white-space: nowrap; }
.wb-task-group:not(.wb-tone-red) .wb-task-row { min-height: 58px; padding-block: 3px; }
.wb-task-group.wb-tone-green .wb-group-title { min-height: 30px; padding-block: 4px; }
.wb-task-type > small { display: none; }
.wb-risk-subline { display: flex; align-items: baseline; gap: 6px; margin-top: 3px; }
.wb-risk-overdue { margin-left: auto; flex-shrink: 0; font-size: 12px; color: #e52b30; }
.wb-message-diagnosis { min-width: 0; flex: 1; color: #8c95a7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.wb-message-card .wb-card-heading { min-height: 24px; }
.wb-risk-person .wb-patient-name { flex-wrap: nowrap; }
.wb-risk-person .wb-patient-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-task-type { white-space: nowrap; }
@container (max-width: 960px) {
  .wb-task-heading > div:first-child { gap: 6px 10px; }
  .wb-task-heading p { font-size: 11px; }
  .wb-task-tools { gap: 8px; }
  .wb-task-tools .wb-button { min-width: auto; padding-inline: 12px; }
  .wb-task-row { grid-template-columns: 168px 76px 112px minmax(150px, 1fr) 190px; gap: 8px; }
  .wb-patient { gap: 10px; }
  .wb-task-advice { padding-left: 12px; }
  .wb-metric { padding-inline: 10px; }
  .wb-metric-main { gap: 8px; }
  .wb-metric-icon { width: 44px; height: 44px; }
}
@container (max-width: 900px) {
  .wb-metric-icon { width: 34px; height: 34px; }
  .wb-metric-icon svg { width: 24px; height: 24px; }
  .wb-metric-main { gap: 6px; }
  .wb-metric-main > div > span { font-size: 11px; }
  .wb-metric-change { font-size: 10px; gap: 3px; }
  .wb-task-row { grid-template-columns: 154px 76px 94px minmax(120px, 1fr) 170px; gap: 8px; }
  .wb-due-weekday { display: block; font-size: 11px; }
  .wb-task-actions { gap: 5px 7px; }
  .wb-welcome p { font-size: 12px; gap: 7px; }
}
@container (max-width: 820px) {
  .wb-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wb-metric-main { gap: 12px; }
  .wb-metric-icon { width: 44px; height: 44px; }
  .wb-metric-icon svg { width: 28px; height: 28px; }
  .wb-metric-main > div > span { font-size: 12px; }
  .wb-welcome { align-items: flex-start; flex-direction: column; gap: 12px; }
  .wb-advice-banner { flex: auto; max-width: none; width: 100%; }
  .wb-task-row { grid-template-columns: minmax(140px, 1fr) 85px 110px 175px; }
  .wb-task-advice { grid-column: 1 / 4; grid-row: 2; padding-left: 0; border: 0; }
  .wb-task-actions { grid-column: 4; grid-row: 1 / 3; }
  .wb-task-type small { display: none; }
}
@media (max-width: 1200px) {
  .wb-layout { grid-template-columns: minmax(0, 1fr); }
  .wb-aside { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; margin-top: 0; }
}
@container (max-width: 560px) {
  .wb-welcome h1 { font-size: 24px; }
  .wb-task-heading, .wb-task-groups { padding-left: 10px; padding-right: 10px; }
  .wb-task-heading { gap: 12px; }
  .wb-task-tools { flex-wrap: wrap; gap: 5px; }
  .wb-task-tools .wb-button { padding: 5px 8px; min-height: 32px; font-size: 12px; }
  .wb-task-row { grid-template-columns: minmax(0, 1fr) 100px; gap: 8px; padding: 12px; }
  .wb-task-group:not(.wb-tone-red) .wb-task-row { padding-block: 12px; }
  .wb-task-type { grid-column: 2; grid-row: 1; text-align: right; }
  .wb-task-date { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: baseline; gap: 10px; }
  .wb-due-weekday { display: inline; }
  .wb-task-advice { grid-column: 1 / -1; grid-row: 3; }
  .wb-task-actions { grid-column: 1 / -1; grid-row: 4; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .wb-task-actions .wb-button { padding: 4px; min-height: 32px; gap: 4px; }
  .wb-task-actions .wb-complete { grid-column: auto; }
  .wb-metric { min-height: 105px; padding: 11px 8px; }
  .wb-metric-main { gap: 6px; }
  .wb-metric-icon { width: 28px; height: 28px; }
  .wb-metric-icon svg { width: 20px; height: 20px; }
  .wb-metric-main > div > span { font-size: 10px; }
  .wb-metric strong { font-size: 23px; }
  .wb-metric-foot { margin-top: 8px; }
  .wb-metric-foot { flex-wrap: wrap; gap: 4px; }
  .wb-metric-foot svg { display: block; max-width: 100%; }
  .wb-metrics { gap: 6px; }
}
@media (max-width: 780px) {
  .wb-aside { grid-template-columns: 1fr; }
  .wb-risk-rings { max-width: 330px; margin-left: auto; margin-right: auto; }
}
@container (max-width: 360px) {
  .wb-metric-main { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 4px; }
  .wb-metric-icon { width: 24px; height: 24px; }
  .wb-metric-icon svg { width: 18px; height: 18px; }
  .wb-metric-main > div > span { white-space: normal; line-height: 14px; min-height: 28px; }
  .wb-metric-foot span { white-space: normal; line-height: 14px; }
}
@media (prefers-reduced-motion: reduce) { .wb-metric { transition: none; } }

.wb-risk-info { display: inline-flex; align-items: center; margin-left: 2px; color: #a5adbb; cursor: help; }
.wb-risk-info:focus-visible { outline: 2px solid var(--ai-600); outline-offset: 3px; border-radius: 50%; }
.wb-risk-card .wb-card-heading { flex-wrap: wrap; row-gap: 6px; }
.wb-risk-updated { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; color: #8791a4; font-size: 10px; white-space: nowrap; }
.wb-risk-updated time { font-variant-numeric: tabular-nums; }
.wb-risk-refresh { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: inherit; }
.wb-risk-refresh:hover { color: var(--ai-600); background: #f6f1ff; }
.wb-risk-refresh:disabled { opacity: .5; }
