.rx-workspace{display:grid!important;grid-template-columns:minmax(0,1.55fr) minmax(340px,1fr)!important;gap:20px!important;align-items:start!important}
.rx-workspace[hidden],.rx-history[hidden],.rx-workspace [hidden]{display:none!important}
.rx-workspace.rx-library-open{grid-template-columns:minmax(0,1fr)!important}.rx-library-open .rx-chat{display:none}
.rx-memed{margin:16px 0!important;padding:18px 22px!important;border:1px solid #b9d7ee!important;border-radius:14px!important;background:#edf5fd!important;display:flex;align-items:center;justify-content:space-between;gap:18px}
.rx-tabs,.rx-library-tabs,.rx-toolbar{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}
.rx-tabs button,.rx-library-tabs button{background:#fff!important;color:#214e75!important;border:1px solid #b9cfe3!important;border-radius:10px!important;padding:12px 20px!important;box-shadow:none!important}
.rx-tabs button.is-active,.rx-library-tabs button.is-active{background:#1e5b8b!important;color:white!important;border-color:#1e5b8b!important}
.rx-workspace .care-editor{min-width:0;padding:22px!important}.rx-current>header{margin-bottom:18px}.rx-current textarea[data-prescription-raw]{min-height:240px!important;max-height:600px;line-height:1.65;resize:vertical}
.rx-structured{border:1px solid #c9dceb;border-radius:12px;padding:14px;margin:16px 0;background:#f8fbfe}.rx-structured>summary{font-weight:700;cursor:pointer}.rx-structured[open]>summary{margin-bottom:16px}
.rx-workspace .care-medication-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.rx-workspace .care-finalize>div{display:flex;flex-wrap:wrap;gap:8px}
.rx-chat{background:white;border:1px solid #cbdfee;border-radius:16px;padding:22px;min-width:0;position:sticky;top:90px;box-shadow:0 6px 20px #17395508}
.rx-chat header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.rx-chat h2{font-size:21px;margin:0}.rx-chat label{display:block;font-weight:600;margin:12px 0}.rx-chat small{display:block;color:#607b91;line-height:1.5}
.rx-workspace select{appearance:none!important;min-height:42px!important;border:1px solid #bbd0e2!important;border-radius:10px!important;background:#f7fbff!important;color:#214567!important;padding:10px 34px 10px 12px!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23214567' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:right 10px center!important}
.rx-chat select,.rx-chat textarea{width:100%;box-sizing:border-box}.rx-workspace select:focus-visible{outline:2px solid #3180bf!important;outline-offset:2px}
.rx-chat [data-cc-messages]{max-height:440px;overflow:auto;min-height:100px;margin:18px 0}.rx-message{background:#f2f7fc;border-radius:12px;padding:14px;margin:10px 0;line-height:1.6;overflow-wrap:anywhere;white-space:pre-line}.rx-user{background:#e0effa;margin-left:20px}.rx-message p{margin:0 0 10px}.rx-message details{font-size:13px;white-space:normal}.rx-chat-actions{display:flex;justify-content:space-between;gap:10px}.rx-chat [data-cc-status]{font-size:13px;color:#4c6e89}.rx-chat [data-cc-history-list] button{width:100%;margin-top:8px;background:#e8f2fd!important;color:#224e7b!important}
.rx-library-search{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}.rx-library-search input{flex:1;min-width:200px}.rx-med-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}.rx-med-card{padding:18px;border:1px solid #ccdeed;border-radius:12px;margin:12px 0;background:#f7fbff}.rx-med-card button{margin:12px 8px 0 0}.rx-med-card small{display:block;margin:8px 0}.rx-history{margin-top:0!important}.rx-history .care-history-list{display:grid;gap:14px}.rx-history article{min-width:0}.rx-workspace .care-save-template,.rx-workspace .confirm-check{display:flex!important;align-items:center!important;gap:8px!important}.rx-workspace input[type=checkbox]{width:16px!important;height:16px!important;flex:0 0 16px!important;margin:0!important}
@media(max-width:1100px){.rx-workspace{grid-template-columns:minmax(0,1fr)!important}.rx-chat{position:static}.rx-memed{align-items:flex-start;flex-direction:column}}
@media(max-width:600px){.rx-med-fields,.rx-workspace .care-medication-grid{grid-template-columns:1fr}.rx-tabs button{flex:1;padding:10px!important}.rx-chat header{align-items:flex-start;flex-direction:column}.rx-workspace .care-editor,.rx-chat{padding:16px!important}}
/* Keep help in normal flow, separate from the resizable editor. */
.rx-current>.care-prescription-free{display:block!important;height:auto!important;margin:0!important;position:static!important}
.rx-current>.care-prescription-free textarea{display:block!important;margin:8px 0 0!important}
.rx-current>.care-prescription-free+.care-helper{position:static!important;margin:10px 0 16px!important;padding:0!important;line-height:1.5!important;transform:none!important;clear:both}
.rx-history .rx-compact-record{padding:14px 16px!important;min-height:0!important;height:auto!important}
.rx-history .rx-compact-record>header{padding:0!important;margin:0!important;min-height:0!important}
.rx-history .rx-compact-record>header h3{margin:5px 0 0!important}
.rx-history .rx-compact-record>.care-history-preview{display:flex!important;align-items:center!important;gap:12px!important;flex-wrap:wrap!important;padding:10px 0!important;margin:10px 0 0!important;min-height:0!important}
.rx-history .rx-compact-record .rx-saved-prescription{flex:1 1 220px;margin:0!important;padding:0!important}
.rx-history .rx-compact-record .rx-saved-prescription>summary{cursor:pointer;line-height:1.5}
.rx-history .rx-compact-record .care-history-preview>footer{display:flex!important;align-items:center!important;padding:0!important;margin:0!important;min-height:0!important;position:static!important}
.rx-history .rx-compact-record .care-history-preview>footer>div{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.rx-history .rx-compact-record .rx-saved-prescription[open]{flex-basis:100%;order:2}
.rx-history .rx-compact-record .rx-saved-prescription[open]+footer{margin-left:auto!important}
.rx-history .rx-compact-record .rx-saved-prescription>div>span{display:block;margin-top:14px;color:#708792;font-size:11px}

.rx-context-preview{padding:10px 12px;border:1px solid #cadcec;border-radius:10px;margin:12px 0;background:#f7fbff}.rx-context-preview summary{cursor:pointer;font-weight:600}.rx-context-preview>div{max-height:240px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;font-size:13px;margin-top:10px}.rx-message>small:first-child{margin-bottom:8px;color:#285b83}

/* Taller question composer; no empty conversation spacer. */
.rx-chat textarea:is(#anw-question,[data-cc-question]){min-height:200px!important}
.rx-chat [data-cc-messages]:empty{display:none;margin:0;min-height:0}
@media(max-width:600px){.rx-chat textarea:is(#anw-question,[data-cc-question]){min-height:160px!important}}
