:root { --chat-width: 460px; }
#patient-view { max-width: 1580px; padding-right: calc(var(--chat-width) + 64px); }
#patient-view .intro { padding-top: 30px; }
#patient-view .intro h1 { font-size: 30px; }
.product-reference { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 10px; line-height: 1.8; color: #768273; }
.product-reference a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.workspace { display: block; }
.scenario-panel { width: 100%; padding: 0; }
.scenario-panel > h2 { margin-bottom: 16px; }
#scenarios { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.scenario { margin: 0; min-height: 111px; }
.scenario small, .scenario b { word-break: keep-all; overflow-wrap: break-word; }
.scenario.selected { box-shadow: inset 0 0 0 1px #14684f; }
.scenario-guide { margin-top: 24px; background: white; border: 1px solid var(--line); border-radius: 16px; padding: 26px; }
.scenario-guide h2 { margin-bottom: 10px; }
.guide-value { font-size: 13px; color: var(--muted); line-height: 1.8; margin-bottom: 18px; word-break: keep-all; }
.guide-start { border: 0; border-radius: 8px; background: var(--green); color: white; padding: 12px 16px; margin-bottom: 22px; text-align: left; font-size: 13px; line-height: 1.6; }
.guide-step { display: flex; gap: 16px; border-top: 1px solid var(--line); padding: 20px 0; }
.step-number { color: #85a392; font-size: 20px; font-family: Georgia; }
.step-content { min-width: 0; flex: 1; }
.step-content > small { color: var(--muted); font-size: 10px; display: block; margin-bottom: 8px; }
.guide-question { border: 0; border-radius: 8px; background: #eaf3ec; color: #14684f; padding: 12px; text-align: left; line-height: 1.6; font-weight: 600; font-size: 14px; width: 100%; word-break: keep-all; }
.step-instruction { margin: 0; font-size: 14px; line-height: 1.8; word-break: keep-all; }
.step-expect { font-size: 12px; line-height: 1.8; color: var(--muted); word-break: keep-all; }
.step-check { font-size: 11px; display: flex; align-items: center; gap: 6px; color: #57755d; }
.step-check input { width: 16px; height: 16px; accent-color: var(--green); }
.guide-note { font-size: 11px; line-height: 1.8; color: #7c8e80; }
.guide-advanced { border-top: 1px solid var(--line); padding: 18px 0; }
.guide-advanced > summary { font-size: 13px; line-height: 1.8; color: var(--green); cursor: pointer; word-break: keep-all; }
.guide-extension { margin-top: 16px; }
.guide-variants { border-top: 1px solid var(--line); padding: 18px 0; }
.guide-variants summary { color: var(--green); font-size: 13px; cursor: pointer; }
.guide-variant-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.guide-variant-question { width: auto; font-size: 12px; border: 1px solid #dce7dc; border-radius: 16px; background: #f6faf4; padding: 8px 12px; }
.source-item { margin: 12px 0; }
.source-item a, .source-item small, .source-title, .retrieval-path { overflow-wrap: anywhere; word-break: normal; }
.source-item small { line-height: 1.7; }
.retrieval-path { color: var(--green); font-size: 11px; line-height: 1.7; padding: 8px; background: #f2f7f3; border-radius: 6px; }
/* Structured chat cards: public hospital information and synthetic workflow state stay distinct. */
.chat-card { margin-top: 14px; border: 1px solid #dce6de; border-radius: 13px; padding: 14px; background: #fcfdfb; min-width: 0; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.card-heading h3 { margin: 0; font-size: 13px; line-height: 1.6; color: #284f3e; word-break: keep-all; }
.card-badge { padding: 4px 7px; border-radius: 5px; background: #f2ead7; color: #796024; font-size: 9px; line-height: 1.5; flex-shrink: 0; }
.physician-card .card-badge { color: #46634f; background: #eaf2ea; }
.appointment-summary { display: flex; gap: 14px; align-items: center; }
.appointment-date { flex: 0 0 70px; border-radius: 10px; padding: 11px 8px; text-align: center; background: #e9f2eb; color: var(--green); }
.appointment-date strong { display: block; font-size: 25px; letter-spacing: -1px; }
.appointment-date span { display: block; font-size: 10px; margin-top: 5px; }
.appointment-info { min-width: 0; display: grid; gap: 5px; font-size: 12px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
.appointment-time { font-size: 21px; color: #294f3b; }
.appointment-place { color: #607965; font-size: 11px; }
.card-notice { margin: 13px 0 0; font-size: 10px; line-height: 1.8; color: #64776d; word-break: keep-all; overflow-wrap: anywhere; }
.physician-intro { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; gap: 14px; }
.physician-portrait { display: block; width: 82px; height: 99px; object-fit: contain; background: #f0f3ef; border-radius: 9px; }
.portrait-unavailable { font-size: 10px; line-height: 1.6; color: #6c7c70; }
.physician-info { min-width: 0; display: grid; gap: 7px; }
.physician-name { font-size: 20px; font-weight: 600; color: #294f3b; }
.physician-department { font-size: 11px; line-height: 1.6; color: #637467; overflow-wrap: anywhere; }
.card-source-link { display: inline-block; font-size: 10px; color: var(--green); line-height: 1.7; text-decoration: underline; text-underline-offset: 3px; }
.physician-specialty { margin-top: 13px; }
.physician-specialty h4 { font-size: 11px; color: #4e6b57; margin: 0 0 6px; }
.physician-specialty p { font-size: 11px; line-height: 1.8; margin: 0; color: #506c59; word-break: keep-all; overflow-wrap: anywhere; }
.physician-location { margin-top: 14px; padding: 12px; display: grid; gap: 5px; background: #f0f5ee; border-radius: 8px; line-height: 1.7; }
.location-label { font-size: 10px; color: #70816f; }
.physician-location strong { font-size: 12px; color: #355b3e; }
.physician-location > span:not(.location-label) { font-size: 10px; }
.physician-location small { color: #667768; font-size: 10px; word-break: keep-all; }
.physician-schedule { border-collapse: collapse; table-layout: fixed; width: 100%; margin-top: 15px; font-size: 10px; color: #4a6653; }
.physician-schedule caption { text-align: left; font-weight: 600; font-size: 11px; margin-bottom: 8px; }
.physician-schedule th, .physician-schedule td { padding: 7px 3px; border: 1px solid #dfe7dd; text-align: center; line-height: 1.6; overflow-wrap: anywhere; font-weight: 400; }
.physician-schedule th { background: #f0f4ed; }
.physician-schedule .schedule-outpatient { background: #edf5ec; color: #31603d; }
.physician-schedule .schedule-surgery { background: #fbefdf; color: #87581a; }
.physician-schedule .schedule-unlisted { color: #788178; background: #f5f6f3; }
.physician-schedule .schedule-selected { box-shadow: inset 0 0 0 1px #497c53; font-weight: 600; }
.card-captured { display: block; margin-top: 12px; font-size: 9px; line-height: 1.7; color: #758272; }
.slot-options { display: flex; flex-wrap: wrap; gap: 9px; }
.card-action { cursor: pointer; border: 1px solid #c8dbcd; border-radius: 8px; background: #f0f6ef; color: #2c603e; padding: 11px 13px; font-size: 12px; line-height: 1.6; word-break: keep-all; }
.card-action:hover { background: #e3f0e4; }
.slot-option { text-align: left; width: 100%; display: grid; gap: 5px; }
.slot-option strong { font-size: 13px; }
.slot-option small { font-size: 10px; color: #60785e; }
.excluded-slot { padding: 10px; margin: 0 0 12px; font-size: 11px; line-height: 1.8; color: #805b2d; background: #fcf2e5; border-radius: 8px; word-break: keep-all; overflow-wrap: anywhere; }
.change-comparison { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.change-column { min-width: 0; padding: 10px; background: #f2f5ef; border-radius: 8px; }
.change-column:last-child { background: #e8f3e9; }
.change-label { font-size: 10px; color: #6e8070; display: block; margin-bottom: 10px; }
.change-column .appointment-summary { display: block; }
.change-column .appointment-date { display: block; text-align: left; padding: 0; background: none; }
.change-column .appointment-date strong { font-size: 20px; }
.change-column .appointment-date span { font-size: 9px; }
.change-column .appointment-info { margin-top: 12px; font-size: 10px; }
.change-column .appointment-time { font-size: 17px; }
.card-actions { display: grid; gap: 8px; margin-top: 14px; }
.card-actions .confirm-action { background: var(--green); border-color: var(--green); color: #fff; }
.change-completed .card-badge { background: #e4f1e6; color: #326342; }
.supporting-card { margin-top: 14px; }
.supporting-card > summary { font-size: 11px; line-height: 1.8; color: #506e54; cursor: pointer; word-break: keep-all; }
.handoff-summary { display: block; width: 100%; min-height: 110px; padding: 10px; border: 1px solid #d7e2d7; border-radius: 8px; margin-bottom: 12px; background: #fff; font-size: 12px; }
.copy-status { display: block; font-size: 11px; line-height: 1.8; margin-top: 10px; color: #526d58; }
.chat-panel { position: fixed; right: max(28px, calc((100vw - 1524px) / 2)); top: 108px; bottom: 24px; width: var(--chat-width); display: flex; flex-direction: column; z-index: 10; }
.chat-header { flex-shrink: 0; padding: 18px; }
.messages { flex: 1; min-height: 0; height: auto; padding: 22px 18px; overscroll-behavior: contain; }
.chat-header h2 { font-size: 14px; }
.chat-toggle { display: none; }
.chat-footer, #chat-form { flex-shrink: 0; }
.chat-footer { font-size: 10px; color: var(--muted); line-height: 1.6; }
.evidence-panel { display: block; margin: 28px 0; }
.evidence-panel > .eyebrow, .evidence-panel > h2, .value-item { display: none; }
.live-context { margin-top: 0; }
.compare { margin-top: 22px; }
.site-footer { padding-right: calc(var(--chat-width) + 64px); gap: 20px; line-height: 1.8; }
.topbar { gap: 24px; }
.welcome h3 { font-size: 20px; }
.welcome p { font-size: 12px; }
@media (max-width: 1280px) {
  #scenarios { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  :root { --chat-width: 410px; }
  #patient-view { padding-left: 3%; padding-right: calc(var(--chat-width) + 45px); }
  .chat-panel { right: 18px; }
  #scenarios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scenario { min-height: 78px; }
  .scenario small { display: none; }
  .scenario-guide { padding: 20px; }
  .topbar { padding: 0 3%; }
}
@media (max-width: 760px) {
  #patient-view { padding: 0 5% calc(54dvh + 35px); }
  #patient-view .intro h1 { font-size: 25px; }
  .chat-panel { left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; height: 52dvh; box-shadow: 0 0 0 8px #f6f8f5, 0 -8px 30px #19352f18; }
  .chat-header { height: 56px; padding: 10px 14px; }
  .chat-header p { display: none; }
  .chat-header h2 { font-size: 12px; }
  .chat-header { gap: 6px; }
  .chat-header .text-button { font-size: 10px; white-space: nowrap; padding: 7px 2px; }
  .chat-toggle { display: block; margin-left: 0; color: var(--green); }
  .chat-panel.is-collapsed { height: 56px; }
  .chat-panel.is-collapsed .messages, .chat-panel.is-collapsed #chat-form, .chat-panel.is-collapsed .chat-footer, .chat-panel.is-collapsed #error { display: none; }
  .messages { padding: 16px; }
  .welcome { padding-top: 12px; }
  .welcome-icon { display: none; }
  .welcome h3 { font-size: 17px; }
  .welcome p { font-size: 11px; }
  .chat-footer { padding: 8px 12px; }
  .scenario-panel > h2 { display: block; font-size: 16px; }
  .scenario-panel > .eyebrow { display: block; }
  #scenarios { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scenario { padding: 12px 6px; min-height: 44px; text-align: center; }
  .scenario b { font-size: 11px; margin: 0; }
  .scenario .scenario-no { display: none; }
  .scenario-guide { padding: 18px; }
  .scenario-guide h2 { font-size: 17px; }
  .guide-question, .step-instruction { font-size: 13px; }
  .step-number { font-size: 17px; }
  .guide-step { gap: 10px; }
  .site-footer { display: none; }
  .topbar { padding: 12px 5% 0; gap: 4px; }
  .evidence-panel { display: block; }
  .privacy-note { display: block; margin-top: 18px; }
  .compare { display: block; }
}
@media (max-height: 600px) and (min-width: 761px) {
  .chat-panel { top: 98px; bottom: 12px; }
  .chat-header { height: 60px; padding: 10px 18px; }
  .chat-footer { padding: 8px 18px; }
}
