/* Scoped component studies; the live pages retain their existing styling. */
.style-preview__component-link { padding: 11px 32px; border-bottom: 1px solid #e0e6ed; background: #f2f6fc; text-align: center; font-size: 12px; }
.style-preview__component-link a { color: #315a9d; text-decoration: none; }
.clean-preview-label { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 600; }
.clean-preview-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; padding: 12px 20px; border-bottom: 1px solid #e0e6ed; background: #fafbfc; }
.clean-preview-nav a { padding: 9px 16px; border-radius: 6px; color: #6b7585; font-size: 12px; text-decoration: none; }
.clean-preview-nav a:hover { background: #edf1f7; color: #202d42; }
.clean-preview-nav a[aria-current] { background: #eaf0fa; color: #315a9d; font-weight: 600; }
.clean-components { --brand: #315a9d; min-height: calc(100svh - 130px); }
.clean-components button, .clean-components input, .clean-components textarea, .clean-components select { font-family: inherit; }
.clean-components button { cursor: pointer; }
.clean-components a { color: var(--accent); }
.clean-components .style-demo__brand { color: var(--ink); }
.clean-components [hidden] { display: none !important; }
.clean-components .cp-main { width: min(1160px, 90%); margin: 0 auto; padding: 44px 0 64px; }
.clean-components .cp-page-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.clean-components .cp-eyebrow { margin: 0 0 13px; color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: .13em; }
.clean-components .cp-page-head h1 { margin: 0; font-size: clamp(26px, 2.5vw, 34px); font-weight: 550; line-height: 1.2; letter-spacing: -.045em; }
.clean-components .cp-page-head .cp-muted { margin-bottom: 0; }
.clean-components .cp-muted { color: var(--muted); font-size: 12px; line-height: 1.7; }
.clean-components .cp-panel { min-width: 0; padding: 26px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.clean-components h2 { margin: 0 0 14px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; line-height: 1.4; }
.clean-components h3 { font-size: 14px; font-weight: 600; }
.clean-components .cp-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.clean-components .cp-section-head h2 { margin: 0; }
.clean-components .cp-badge { display: inline-block; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: #f8fafd; color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.clean-components .cp-badge--success { color: #327058; background: #f0f8f4; border-color: #d0e5da; }
.clean-components .cp-count { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: #eaf0fa; color: var(--accent); font-size: 11px; }
.clean-components .cp-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 9px 16px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 550; text-decoration: none; }
.clean-components .cp-button:hover { background: #244980; border-color: #244980; }
.clean-components .cp-button--secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.clean-components .cp-button--secondary:hover { background: var(--tint); border-color: #b7c8e3; }
.clean-components .cp-button--full { width: 100%; }
.clean-components .cp-button:disabled { background: #e7edf6; color: #7586a1; border-color: #e7edf6; cursor: not-allowed; }
.clean-components .cp-text-button { padding: 4px 0; border: 0; background: none; color: var(--accent); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.clean-components .cp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.clean-components .cp-field { display: flex; flex-direction: column; gap: 8px; margin: 20px 0; color: var(--ink); font-size: 11px; font-weight: 550; line-height: 1.5; }
.clean-components .cp-field input, .clean-components .cp-field select, .clean-components .cp-field textarea { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 400; }
.clean-components .cp-field textarea { resize: vertical; }
.clean-components input::placeholder, .clean-components textarea::placeholder { color: #7a8596; opacity: 1; }
.clean-components input:focus-visible, .clean-components textarea:focus-visible, .clean-components select:focus-visible, .clean-components summary:focus-visible, .clean-components .cp-table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.clean-components .cp-field [aria-invalid] { border-color: #bd625e; }
.clean-components .cp-field small { font-size: 10px; font-weight: 400; }
.clean-components .cp-feedback { padding: 12px; border-radius: 6px; background: var(--tint); color: var(--accent); font-size: 12px; }
.clean-components .cp-note-caption { color: var(--muted); font-size: 10px; line-height: 1.7; }

/* Conversation and the resource sidebar. */
.clean-components .cp-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 36px; align-items: start; }
.clean-components .cp-conversation { min-width: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.clean-components .cp-conversation__bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 11px; }
.clean-components .cp-question { width: fit-content; max-width: calc(100% - 48px); margin: 24px 24px 8px auto; padding: 14px 18px; border-radius: 10px 10px 2px 10px; background: #edf3fc; font-size: 13px; line-height: 1.6; }
.clean-components .cp-answer { padding: 24px 30px 8px; font-size: 13px; line-height: 1.8; }
.clean-components .cp-answer__label { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; color: var(--muted); font-size: 11px; }
.clean-components .cp-answer__label .cp-badge { margin-left: auto; }
.clean-components .cp-ai-mark { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--tint); color: var(--accent); font-size: 20px; }
.clean-components .cp-answer h2 { font-size: 22px; }
.clean-components .cp-answer h3 { margin: 23px 0 8px; }
.clean-components .cp-answer-list { padding-left: 19px; }
.clean-components .cp-answer-list li { padding-left: 3px; margin: 6px 0; }
.clean-components .cp-citation { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; background: #eaf0fa; font-size: 10px; text-decoration: none; }
.clean-components .cp-callout { margin: 24px 0; padding: 16px 18px; border: 1px solid #dce6f5; border-left: 3px solid #7696c5; border-radius: 5px; background: #f7faff; font-size: 12px; line-height: 1.7; }
.clean-components .cp-callout p { margin: 5px 0 0; }
.clean-components .cp-callout--danger { border-color: #f0dad8; border-left-color: #c77972; background: #fdf8f7; color: #814841; }
.clean-components .cp-disclosure { margin: 20px 0; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.7; }
.clean-components .cp-disclosure summary { cursor: pointer; font-weight: 550; }
.clean-components .cp-disclosure p:last-child { margin-bottom: 0; }
.clean-components .cp-answer__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 16px 0; }
.clean-components .cp-answer__foot .cp-muted { font-size: 10px; }
.clean-components .cp-reply { margin: 14px 20px 20px; padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.clean-components .cp-reply:focus-within { border-color: var(--accent); }
.clean-components .cp-reply textarea { display: block; width: 100%; padding: 0; border: 0; resize: vertical; color: var(--ink); font-size: 13px; line-height: 1.6; }
.clean-components .cp-reply .cp-section-head { margin-top: 12px; }
.clean-components .cp-resources { position: sticky; top: 24px; padding-top: 6px; }
.clean-components .cp-resources h2 { font-size: 14px; }
.clean-components .cp-resource { display: block; padding: 21px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.clean-components .cp-resource:hover strong { color: var(--accent); text-decoration: underline; }
.clean-components .cp-resource__source { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--muted); font-size: 9px; letter-spacing: .075em; }
.clean-components .cp-resource strong { font-size: 13px; font-weight: 600; }
.clean-components .cp-resource p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.clean-components .cp-search-state { padding: 12px; background: var(--tint); border-radius: 6px; font-size: 11px; }
.clean-components .cp-loading { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border: 2px solid #c5d2e7; border-top-color: var(--accent); border-radius: 50%; }
.clean-components .cp-error { color: #a04843; }

/* The real shared quick-note components, with Clean's styling. */
.clean-components .cp-form-library { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; margin-bottom: 34px; }
.clean-components .cp-library-card { display: flex; align-items: center; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.clean-components .cp-library-card:hover { border-color: #a9bedf; background: var(--tint); }
.clean-components .cp-library-card > span:last-child { margin-left: auto; }
.clean-components .cp-library-card strong, .clean-components .cp-download strong { display: block; font-size: 13px; font-weight: 600; }
.clean-components .cp-library-card small, .clean-components .cp-download small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.clean-components .cp-library-card__icon { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 38px; border-radius: 7px; background: var(--tint); color: var(--accent); font-size: 23px; }
.clean-components .cp-note-builder { scroll-margin-top: 24px; }
.clean-components .qt-widget { --brand: #315a9d; --ink: #202d42; --muted: #6b7585; --line: #e0e6ed; }
.clean-components .qtA { grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); gap: 28px; }
.clean-components .qt-card { min-width: 0; padding: 25px; border-radius: 12px; box-shadow: none; }
.clean-components .qt-widget__head { margin-bottom: 25px; }
.clean-components .qt-widget__title { margin: 0; font-size: 17px; font-weight: 600; }
.clean-components .qt-widget__status { font-size: 10px; font-weight: 500; }
.clean-components .qt-sec { margin-bottom: 28px; }
.clean-components .qt-sec__label { gap: 9px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.clean-components .qt-sec__key { padding: 4px 6px; border-radius: 4px; background: var(--tint); font-size: 10px; font-weight: 600; }
.clean-components .qt-sec__name { color: var(--ink); font-size: 12px; font-weight: 550; }
.clean-components .qt-q { padding: 10px; margin-bottom: 12px; border-radius: 6px; }
.clean-components .qt-q.is-current { background: #f2f6fc; }
.clean-components .qt-q__head { flex-wrap: wrap; margin-bottom: 10px; }
.clean-components .qt-q__prompt { font-size: 12px; font-weight: 550; }
.clean-components .qt-q__multi { border-color: #dbe4f2; background: #f2f6fc; font-size: 8px; font-weight: 500; }
.clean-components .qt-q__text-label, .clean-components .qt-patient__label { font-size: 9px; font-weight: 550; }
.clean-components .qt-q__text-input, .clean-components .qt-opt__text, .clean-components .qt-patient__input { padding: 7px 9px; border-radius: 5px; font-size: 12px; }
.clean-components .qt-opt { padding: 8px 11px; border-radius: 6px; font-size: 11px; line-height: 1.4; }
.clean-components .qt-opt:hover { background: #f2f6fc; border-color: #9eb7dc; }
.clean-components .qt-opt.is-selected { background: #e9f0fc; color: #254d8a; border-color: #86a5d4; box-shadow: none; }
.clean-components .qt-opt.is-negated { background: #fbefed; color: #964e48; border-color: #e0aaa4; }
.clean-components .qt-hud { background: #263b5c; border-color: #263b5c; box-shadow: 0 4px 12px #202d4215; }
.clean-components .qt-keys { gap: 12px; color: var(--muted); border-color: var(--line); font-size: 10px; }
.clean-components .qt-keys__kbd { border-color: #d2ddec; background: #f8fafd; color: var(--muted); }
.clean-components .qtA__side { min-width: 0; top: 24px; }
.clean-components .qt-notebox { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafd; box-shadow: none; }
.clean-components .qt-notebox__label { color: var(--ink); font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.clean-components .qt-notebox__hint { color: var(--muted); font-size: 9px; }
.clean-components .qt-note { min-height: 250px; margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 12px; line-height: 1.8; }
.clean-components .qt-note.is-empty::before { color: var(--muted); font-style: normal; }
.clean-components .qt-notebox__foot { flex-wrap: wrap; }
.clean-components .qt-copy { padding: 10px 15px; border-radius: 6px; background: var(--accent); font-size: 11px; font-weight: 550; }
.clean-components .qt-copy:hover { background: #244980; }
.clean-components .cp-empty { padding: 30px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }
.clean-components .cp-empty p { color: var(--muted); font-size: 12px; }

/* Tables, medication reference, and calculator. */
.clean-components .cp-medication-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.clean-components .cp-table-title { margin: 29px 0 12px; }
.clean-components .cp-table-scroll { max-width: 100%; overflow-x: auto; }
.clean-components .cp-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; line-height: 1.7; }
.clean-components .cp-table th { padding: 11px 13px; border-bottom: 1px solid var(--line); background: #f8fafd; color: var(--muted); font-size: 10px; font-weight: 550; white-space: nowrap; }
.clean-components .cp-table td { padding: 17px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
.clean-components .cp-table td small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.clean-components .cp-table-note { margin: 0; padding: 12px 13px; background: #fcfdff; color: var(--muted); font-size: 11px; line-height: 1.7; }
.clean-components .cp-calculator { position: sticky; top: 24px; }
.clean-components .cp-input-unit { position: relative; }
.clean-components .cp-input-unit input { padding-right: 40px; }
.clean-components .cp-input-unit > span { position: absolute; right: 13px; top: 13px; color: var(--muted); }
.clean-components .cp-field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.clean-components .cp-field-pair .cp-field { margin-top: 0; }
.clean-components .cp-calc-result { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid #d8e4f5; border-radius: 8px; background: var(--tint); color: var(--accent); }
.clean-components .cp-calc-result > span { font-size: 10px; }
.clean-components .cp-calc-result > strong { font-size: 26px; font-weight: 500; }
.clean-components .cp-calc-result small { font-size: 12px; font-weight: 400; }
.clean-components .cp-calc-result hr { width: 100%; margin: 8px 0; border: 0; border-top: 1px solid #d8e4f5; }

/* Reading page. */
.clean-components .cp-main--content { max-width: 1020px; }
.clean-components .cp-content-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 65px; margin-top: 45px; }
.clean-components .cp-contents { position: sticky; top: 30px; align-self: start; display: flex; flex-direction: column; gap: 18px; }
.clean-components .cp-contents > span { margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 550; letter-spacing: .1em; }
.clean-components .cp-contents a { font-size: 12px; text-decoration: none; color: var(--muted); }
.clean-components .cp-contents a:hover { color: var(--accent); text-decoration: underline; }
.clean-components .cp-article { min-width: 0; font-size: 14px; line-height: 1.9; }
.clean-components .cp-article > section { margin-bottom: 35px; scroll-margin-top: 30px; }
.clean-components .cp-article h2 { font-size: 21px; }
.clean-components .cp-article-lede { font-size: 17px; line-height: 1.7; color: #53627a; }
.clean-components .cp-article li { margin-bottom: 7px; }
.clean-components .cp-download { display: flex; align-items: center; gap: 16px; padding: 19px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); text-decoration: none; }
.clean-components .cp-download:hover { background: var(--tint); }
.clean-components .cp-download > span:last-child { margin-left: auto; }

/* Account, shared states, and a small admin-table sample. */
.clean-components .cp-account-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 36px; align-items: start; }
.clean-components .cp-signin { padding: 30px; }
.clean-components .cp-signin > h2 { margin: 23px 0 0; font-size: 27px; letter-spacing: -.04em; }
.clean-components .cp-signin > .cp-muted { margin-bottom: 28px; }
.clean-components .cp-divider { display: flex; align-items: center; gap: 14px; margin: 24px 0; color: var(--muted); font-size: 10px; }
.clean-components .cp-divider::before, .clean-components .cp-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.clean-components .cp-signin-link summary { width: 100%; cursor: pointer; list-style: none; }
.clean-components .cp-signin-link summary::-webkit-details-marker { display: none; }
.clean-components .cp-controls { display: grid; gap: 22px; }
.clean-components .cp-token-row { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); }
.clean-components .cp-token-row > span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.clean-components .cp-token-row i { width: 13px; height: 13px; border: 1px solid #202d4215; border-radius: 4px; }
.clean-components .cp-account-menu { position: relative; }
.clean-components .cp-account-menu > summary { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: var(--tint); color: var(--accent); cursor: pointer; font-size: 10px; font-weight: 600; list-style: none; }
.clean-components .cp-account-menu > summary::-webkit-details-marker { display: none; }
.clean-components .cp-account-menu > div { position: absolute; z-index: 3; top: 42px; right: 0; display: flex; flex-direction: column; align-items: start; gap: 11px; min-width: 215px; padding: 20px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 10px 24px #202d4212; font-size: 12px; }
.clean-components .cp-state { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; padding: 13px 16px; border: 1px solid; border-radius: 7px; font-size: 11px; line-height: 1.7; }
.clean-components .cp-state--success { background: #f4faf6; border-color: #d5e9dc; color: #3a7052; }
.clean-components .cp-state--warning { background: #fffbf2; border-color: #efe2bd; color: #886b30; }
.clean-components .cp-state--error { background: #fff8f7; border-color: #eed5d2; color: #9b514a; }
.clean-components .cp-controls .cp-table-scroll { margin-top: 18px; }
.clean-components .cp-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100svh - 40px); padding: 28px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px #202d4230; }
.clean-components .cp-dialog::backdrop { background: #202d4255; }
.clean-components .cp-icon-button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 5px; background: var(--tint); color: var(--muted); font-size: 22px; }

@media (max-width: 1000px) {
  .clean-components .cp-workspace { grid-template-columns: minmax(0, 1fr) 235px; gap: 24px; }
  .clean-components .cp-medication-grid { grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; }
  .clean-components .cp-panel { padding: 21px; }
  .clean-components .cp-account-grid { grid-template-columns: 320px minmax(0, 1fr); gap: 24px; }
  .clean-components .cp-content-grid { grid-template-columns: 140px minmax(0, 1fr); gap: 35px; }
}
@media (max-width: 760px) {
  .clean-preview-label { font-size: 11px; }
  .clean-preview-nav { gap: 3px; padding: 10px; }
  .clean-preview-nav a { padding: 8px 10px; font-size: 11px; }
  .clean-components .cp-main { padding-top: 32px; }
  .clean-components .cp-page-head { align-items: start; flex-direction: column; gap: 15px; }
  .clean-components .cp-workspace, .clean-components .cp-medication-grid, .clean-components .cp-account-grid, .clean-components .cp-content-grid, .clean-components .qtA { grid-template-columns: 1fr; }
  .clean-components .cp-resources, .clean-components .cp-calculator, .clean-components .qtA__side, .clean-components .cp-contents { position: static; }
  .clean-components .cp-answer { padding: 22px 20px 8px; }
  .clean-components .cp-question { margin: 20px 16px 0 auto; }
  .clean-components .cp-reply { margin: 12px 14px 16px; }
  .clean-components .cp-answer__label { flex-wrap: wrap; }
  .clean-components .cp-field input, .clean-components .cp-field select, .clean-components .cp-field textarea, .clean-components .cp-reply textarea { font-size: 16px; }
  .clean-components .cp-table { min-width: 420px; }
  .clean-components .cp-content-grid { margin-top: 25px; gap: 30px; }
  .clean-components .cp-contents { flex-direction: row; flex-wrap: wrap; gap: 15px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
  .clean-components .cp-contents > span { width: 100%; }
  .clean-components .qt-card { padding: 18px 14px; }
  .clean-components .qt-widget__head { flex-wrap: wrap; gap: 8px; }
  .clean-components .qt-opt { padding: 10px 12px; }
  .clean-components .qt-q__text-input, .clean-components .qt-opt__text, .clean-components .qt-patient__input { font-size: 16px; }
  .clean-components .cp-signin { max-width: 440px; width: 100%; margin: auto; }
  .clean-components .cp-dialog { padding: 22px; }
}
