/* console shell: global patient bar, page tabs (loaded after the glass layer; only new classes) */
.page-tabs { margin: 0 0 18px; width: fit-content; max-width: 100%; }
.main:has(#agent.on) .page-tabs, .main:has(#search.on) .page-tabs { display: none; }
#ipatient { display: none; }
.pt-head { margin-bottom: 14px; } .pt-head .patient { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pt-head h2 { margin: 0 0 2px; font-size: 20px; letter-spacing: -.02em; } .pt-head .chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.pt-actions { display: flex; gap: 8px; margin-left: auto; } .pt-bar { margin-bottom: 12px; align-items: center; }
.chip.link { cursor: pointer; border: 0; font: inherit; }
.side-provider { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 8px 10px; border: 1px solid var(--edge, var(--border)); border-radius: var(--r-md, 10px); background: var(--glass-lo, var(--surface-2)); color: var(--text); font: inherit; text-align: left; cursor: default; }
.side-provider .sp-name { font-weight: 600; font-size: 13px; } .side-provider .sp-sub { font-size: 11px; color: var(--muted); } .side-provider a { color: var(--amber); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.ag-gate { display: grid; place-items: start center; padding: 56px 24px; overflow: auto; height: 100%; } .ag-gate[hidden] { display: none; }
.gt-card { width: min(560px, 100%); display: flex; flex-direction: column; gap: 14px; } .gt-card h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; } .gt-card p { margin: 0; }
.gt-personas { display: flex; flex-direction: column; gap: 8px; }
.gt-persona { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border: 1px solid var(--edge, var(--border)); border-radius: var(--r-md, 10px); background: var(--glass-lo, var(--surface-2)); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.gt-persona:hover { border-color: var(--amber); } .gt-persona small { color: var(--muted); }
.gt-custom summary { cursor: pointer; color: var(--muted); } .gt-custom .su-grid { margin: 10px 0; }
/* product view hides everything marked dev-only and gives the conversation the whole width */
body:not(.dev) .dev-only { display: none !important; }
body:not(.dev) .ag { grid-template-columns: minmax(0, 1fr) !important; }

.gn-cats { align-items: center; gap: 6px; } .gn-cats .chip.on { background: var(--primary-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--primary); }
/* the human-in-the-loop pull cards: phase 1 (documents) and phase 2 (HIE network) share one look; only the step tag differs */
.ag-hint .hph { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--amber) 55%, transparent); color: var(--amber); font: 600 10.5px var(--sans); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; vertical-align: 1px; }
.ag-hint.ph-2 { border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: var(--amber-soft); }   /* the HIE network: amber (secondary) */
.ag-hint.ph-1 { border-color: color-mix(in srgb, var(--primary) 45%, transparent); background: var(--primary-soft); } .ag-hint.ph-1 .hph { border-color: color-mix(in srgb, var(--primary) 55%, transparent); color: var(--green); }   /* chart documents: primary */

/* ---- billing code suggestions: panel under the answer, accept modal (same tokens as the chat; no new colours) ---- */
.cd-panel { margin: 10px 0 4px; padding: 12px 14px; border: 1px solid var(--edge); border-radius: 14px; background: var(--glass); animation: fade .35s both; }
.cd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 6px; } .cd-head b { font: 500 14px var(--display); margin-right: 4px; }
.cd-sec { font: 500 11px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 8px 0 2px; }
.cd-row { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--edge); } .cd-row:first-of-type { border-top: 0; } .cd-row.off { opacity: .6; }
.cd-pick { padding-top: 3px; } .cd-main { min-width: 0; flex: 1; } .cd-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; } .cd-desc { font-size: 13.5px; line-height: 1.45; }
.cd-why { font-size: 12.5px; line-height: 1.45; } .cd-ev { display: flex; gap: 4px; margin-top: 3px; }
.cd-more { margin-top: 6px; } .cd-more > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0; } .cd-q { padding: 4px 0; font-size: 13px; border-top: 1px solid var(--edge); }
.cd-warn { font-size: 12.5px; color: var(--amber); margin: 2px 0 4px; } .cd-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.cd-modal-list { max-height: 46vh; overflow: auto; margin: 8px 0; }

.cd-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 8px 0 2px; animation: fade .35s both; }
.cd-lbtn { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; border: 1px solid var(--edge); background: var(--glass); border-radius: 999px; padding: 4px 12px; font: 500 13px var(--sans); color: var(--text); cursor: pointer; }
.cd-lbtn:hover { background: var(--glass-hi); } .cd-bill { color: var(--primary); font-weight: 600; } .cd-car { color: var(--faint); } .cd-more2 { display: flex; justify-content: flex-end; margin: 4px 0; }
.cd-hcc { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 4px 0 2px; font-size: 12px; }
.pc-hcc { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font: 500 11px var(--sans); line-height: 18px; white-space: nowrap; }

/* ---- activity bar: everything the agent does in the background, pinned under the top row ---- */
.ag-act { width: 100%; max-width: 780px; margin: 0 auto 8px; }
.act-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; animation: fade .3s both; }
.act-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--edge); } .act-row:first-child { border-top: 0; }
.act-main { min-width: 0; flex: 1; } .act-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 13.5px; } .act-line b { font-weight: 600; }
.act-d { color: var(--muted); font-size: 13px; } .act-n { margin-left: auto; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.act-bar { height: 4px; border-radius: 99px; background: var(--surface-3); margin-top: 6px; overflow: hidden; } .act-bar i { display: block; height: 100%; border-radius: 99px; background: var(--primary); transition: width .6s ease; }
.act-bar.ind i { width: 40% !important; animation: act-slide 1.3s ease-in-out infinite; }
@keyframes act-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
.act-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--primary); animation: act-rot .8s linear infinite; flex: none; } @keyframes act-rot { to { transform: rotate(360deg); } }
.act-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); flex: none; }
.act-ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; background: var(--green-soft); color: var(--green); } .act-row.failed .act-ic { background: var(--red-soft); color: var(--red); }
.act-x { border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: 12px; padding: 4px 6px; border-radius: 6px; } .act-x:hover { background: var(--surface-3); color: var(--text); }
.act-rep { padding: 4px 14px 10px 40px; border-top: 1px solid var(--edge); background: var(--surface-2); }
.act-rr { display: flex; gap: 12px; padding: 5px 0; font-size: 13px; line-height: 1.45; } .act-rl { flex: none; width: 150px; color: var(--muted); } .act-rt { min-width: 0; overflow-wrap: anywhere; } .act-rr.warn .act-rl { color: var(--amber); }
@media (max-width: 640px) { .act-rr { flex-direction: column; gap: 0; } .act-rl { width: auto; } .act-rep { padding-left: 14px; } }

/* ---- billing review (side drawer): what the codes are about first, then the code and what it means ---- */
.bill { max-width: 640px; } .bl-h { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; } .bl-h h2 { margin: 0; font-size: 22px; }
.bl-lead { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 4px 0 12px; }
.bl-sec { font: 600 11.5px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 16px 0 6px; }
.bl-card { border: 1px solid var(--edge); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: var(--glass); }
.bl-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; } .bl-top b { font-size: 15px; font-weight: 600; } .bl-from { color: var(--muted); font-size: 12.5px; }
.bl-note { color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 3px; }
.bl-codes { margin-top: 6px; } .bl-code { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; cursor: pointer; font-size: 13.5px; } .bl-code.off { opacity: .55; cursor: default; }
.bl-code input { margin-top: 2px; } .bl-cn { font-weight: 600; flex: none; } .bl-cd { color: var(--text); }
.bl-ev { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.bl-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--edge); position: sticky; bottom: -20px; background: var(--bg); padding-bottom: 8px; }
.cd-lbtn .cd-txt { color: var(--text); }

/* ---- activity pill + popover (top row), one action row under an answer, the corrected tag ---- */

.act-pill { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; border: 1px solid var(--border); background: var(--surface); } .act-pill.run { color: var(--text); } .act-pill.wait { border-color: color-mix(in srgb, var(--amber) 55%, transparent); background: var(--amber-soft); color: var(--text); }
.act-pill.done .act-ic, .act-pill .act-ic { width: 16px; height: 16px; font-size: 10px; } .act-pill.idle { color: var(--muted); }
.pulloff { cursor: pointer; border: 1px dashed color-mix(in srgb, var(--amber) 55%, transparent); background: transparent; color: var(--amber); } .pulloff:hover { background: var(--amber-soft); }
.act-pop { position: fixed; z-index: 60; width: min(440px, calc(100vw - 24px)); max-height: 60vh; overflow: auto; filter: drop-shadow(0 12px 28px rgba(0,0,0,.18)); } .act-pop .act-card { background: var(--surface); }
.ag-m.summsg { position: static !important; background: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }   /* the summary scrolls with the conversation; only the toolbar stays pinned */
.nx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 2px; } .nx-row .cd-line { margin: 0; }
.nx-menu { position: relative; } .nx-menu > summary { list-style: none; cursor: pointer; user-select: none; } .nx-menu > summary::-webkit-details-marker { display: none; }
.nx-menu > summary::after { content: '▾'; margin-left: 6px; font-size: 10px; color: var(--faint); } .nx-menu > summary small { margin-left: 6px; color: var(--faint); font-size: 11px; }
.nx-pop { position: absolute; z-index: 20; left: 0; bottom: calc(100% + 6px); min-width: 240px; max-width: 420px; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); } .nx-pop .pill-btn { text-align: left; white-space: normal; }
.ag-corr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; font-size: 13px; color: var(--muted); } .ag-corr .ok { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 700; }
.ag-corr-d { display: inline; } .ag-corr-d > summary { display: inline; cursor: pointer; color: var(--text); text-decoration: underline dotted; text-underline-offset: 3px; } .ag-corr-d .cc { margin: 6px 0 0 26px; font-size: 12.5px; line-height: 1.45; } .ag-corr-d .cc s { color: var(--faint); display: block; }
.nx-pop .pill-btn { height: auto; min-height: 30px; overflow: visible; text-overflow: clip; line-height: 1.35; padding-top: 6px; padding-bottom: 6px; }

/* ---- chat size: Classic 365 px x 90vh, Large 800 px x 90vh, Full screen = the original layout (pages/demo/chatsize.js sets .ag[data-size]) ---- */

 

@media (min-width: 1101px) {
  .ag[data-size="classic"], .ag[data-size="large"] { --ag-w: 800px; grid-template-rows: minmax(0, 1fr); align-items: center; justify-content: center; }
  .ag[data-size="classic"] { --ag-w: 365px; }
  body:not(.dev) .ag[data-size="classic"], body:not(.dev) .ag[data-size="large"] { grid-template-columns: var(--ag-w) !important; }
  body.dev .ag[data-size="classic"], body.dev .ag[data-size="large"] { grid-template-columns: var(--ag-w) minmax(0, 1fr) !important; justify-content: stretch; }
  .ag[data-size="classic"] > .ag-main, .ag[data-size="large"] > .ag-main { height: calc(90dvh / var(--z, 1)); border: 1px solid var(--edge-2, var(--border)); border-radius: 18px; overflow: hidden; background: var(--bg); box-shadow: var(--lift, none); }
  .ag[data-size="classic"] > .ag-side, .ag[data-size="large"] > .ag-side { align-self: stretch; }
}
/* inside a fixed-width chat the reading column is the box itself, not the wide-screen clamp */
.ag[data-size="classic"] .ag-msgs > .ag-m, .ag[data-size="large"] .ag-msgs > .ag-m { max-width: none; }
.ag[data-size="classic"] .ag-composer, .ag[data-size="large"] .ag-composer { max-width: none; width: calc(100% - 28px); } .ag[data-size="large"] .ag-composer { width: calc(100% - 40px); }   /* the edges of the message column (its side padding below) */
.ag[data-size="classic"] .ag-opts, .ag[data-size="large"] .ag-opts { max-width: none; width: calc(100% - 32px); }

.ag[data-size="classic"] .ag-msgs { padding: 8px 14px 22px; } .ag[data-size="large"] .ag-msgs { padding: 8px 20px 24px; }
.ag[data-size="classic"] .pc-grid { grid-template-columns: 1fr; }
  
 
.ag[data-size="classic"] .pc-h h2 { font-size: 20px; }
.ag[data-size="classic"] .ag-drawer { max-width: 100%; }
/* "Full screen" is the page as it was before the size modes existed (no rule here on purpose): the chat uses the whole page, the side pane follows Developer view */
/* Classic is narrow: an action item's buttons go under its text instead of squeezing it */
.ag[data-size="classic"] .ai-more { margin-left: 12px; }   /* an item's actions are icons now: they stay on the row, even in the narrow window */

/* Composer drawer: an active condition's row has two small actions at its right (Why active, Generate care plan: both questions to the agent) */
.dr-btns { flex: none; display: flex; gap: 4px; } .dr-btns .dr-open { white-space: nowrap; }
.ag[data-size="classic"] .dr-wrap:has(.dr-btns) { flex-wrap: wrap; row-gap: 2px; } .ag[data-size="classic"] .dr-wrap:has(.dr-btns) .dr-row { flex-basis: 100%; } .ag[data-size="classic"] .dr-wrap:has(.dr-btns) .dr-btns { margin-left: 10px; }
