/* The home hero and conversation use the same components. Scope this layout to a live conversation. */
.workspace-tabs { display:none }
.has-chat .landing { padding-block:clamp(27px,3vw,45px) 48px }
.has-chat .session-head { align-items:center; margin-bottom:clamp(20px,2.2vw,33px); gap:16px }
.has-chat .session-head h1 {
  font-size:clamp(29px,3.1vw,46px);
  line-height:1.16;
  letter-spacing:-.048em;
  margin:8px 0 0;
  text-wrap:balance;
}
.has-chat .session-head .category { color:var(--muted); font-weight:590; font-size:13px }
.has-chat .session-actions { display:flex; align-items:center; gap:8px; flex:none }
.has-chat #new-chat { min-height:44px; padding:6px 12px; color:var(--paper); background:var(--ink); border-color:var(--ink); font-size:14px; font-weight:650; white-space:nowrap }
.has-chat #new-chat:hover:not(:disabled) { background:var(--link); border-color:var(--link) }
.has-chat #clear { display:inline-flex; align-items:center; min-height:44px; gap:7px; border-color:transparent; padding:5px 8px; flex:none }
.has-chat #clear:hover { background:var(--mist) }
.has-chat #clear .ui-icon,.has-chat .history-action .ui-icon { width:16px; height:16px }
.has-chat .workarea { gap:clamp(24px,3vw,44px) }
.has-chat.has-materials .workarea { grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) }
.has-chat .chat {
  min-width:0;
  align-self:start;
  padding:0;
  border:0;
  border-block-start:2px solid var(--ink);
  border-bottom:1px solid var(--line);
  border-radius:0;
}
.has-chat .conversation-label {
  align-items:center;
  min-height:69px;
  padding:10px 1px;
  border-bottom:1px solid var(--line);
  gap:10px;
}
.has-chat .conversation-label .avatar { width:44px; height:44px }
.has-chat .conversation-label h2 { font-size:clamp(19px,1.55vw,23px) }
.has-chat .history-action {
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:40px;
  margin-inline-start:auto;
  padding:5px 4px;
  color:var(--muted);
  border:0;
  font-size:13px;
}
.has-chat .history-action:hover { text-decoration:underline }
.has-chat .history-action[aria-expanded="true"] .ui-icon { transform:rotate(180deg) }
.has-chat .conversation {
  margin:19px 0 15px;
  max-height:none;
  padding:1px 1px 3px;
  overflow:visible;
}
.has-chat .conversation:not(.show-history) .turn:not(:nth-last-child(-n + 2)) { display:none }
.has-chat .conversation.show-history { max-height:min(55vh,510px); overflow-y:auto; padding-inline-end:10px; scrollbar-width:thin }
.has-chat .turn+.turn { margin-top:0 }
.has-chat .show-history .turn+.turn,
.has-chat .conversation:not(.show-history) .turn:last-child:not(:first-child) { border-top:1px solid var(--line); padding-top:20px; margin-top:18px }
.has-chat .question {
  padding:10px 15px;
  margin:0 0 17px auto;
  max-width:88%;
  overflow-wrap:anywhere;
  white-space:pre-wrap;
  border-radius:17px 17px 3px 17px;
  line-height:1.6;
  background:#eff2f4;
}
[dir="rtl"] .has-chat .question { margin:0 auto 17px 0; border-radius:17px 17px 17px 3px }
.has-chat .answer { max-width:67ch; scroll-margin-top:68px }
.has-chat .speaker {
  display:inline-flex;
  align-items:center;
  gap:7px;
  color:var(--ink);
  font-weight:680;
  font-size:13px;
  line-height:1.4;
}
.has-chat .speaker::before {
  content:"";
  width:12px;
  height:7px;
  background:var(--clay);
  clip-path:polygon(0 85%,100% 0,77% 85%,39% 100%);
}
.has-chat .reply { margin-top:6px; line-height:1.72 }
.has-chat .delta {
  display:block;
  margin-top:12px;
  border:0;
  border-inline-start:2px solid var(--clay);
  padding:1px 10px;
  color:var(--muted);
  line-height:1.55;
}
.has-chat .turn>.small { margin:0 2px 9px }
.has-chat .followups { gap:6px; margin:0 0 15px; align-items:stretch }
.has-chat .followups button { font-size:13px; font-weight:540; min-height:44px; line-height:1.42 }
.has-chat .followups button:hover { color:var(--ink); border-color:var(--link) }
.has-chat #phrase { margin:0 0 16px; padding:14px 16px; background:#fffcf8; border-color:#e7dacd }
.has-chat #phrase h3 { font-size:14px; margin-bottom:7px }
.has-chat #phrase-zh { font-size:16px; line-height:1.65 }
.has-chat #phrase-en { color:var(--muted); line-height:1.6 }
.has-chat #ask { padding-top:14px; border-top:1px solid var(--line) }
.has-chat .composer { align-items:flex-end; padding:7px 8px 7px 13px; border:1px solid var(--control-edge); border-radius:12px }
.has-chat .composer textarea { min-height:57px; padding-block:8px; line-height:1.55 }
.has-chat #settings { border-top:0; margin-top:3px }
.has-chat #settings summary { padding:9px 0 8px; min-height:44px }
.has-chat #settings[open] { padding-bottom:13px }

.has-chat .results {
  align-self:start;
  padding:clamp(19px,2.1vw,30px);
  border:1px solid var(--line);
  border-radius:15px 5px 15px 15px;
  box-shadow:0 5px 18px #1e304507;
}
.has-chat[data-guide=xiaozhe] .results::after {
  width:26px;
  height:26px;
  background:linear-gradient(45deg,#efd0bb 0%,var(--clay) 47%,var(--paper) 51%);
  box-shadow:none;
  border-end-start-radius:4px;
}
[dir="rtl"] .has-chat .results { border-radius:5px 15px 15px 15px }
.has-chat .result-heading { gap:9px; align-items:flex-start }
.has-chat .result-heading .ui-icon { height:25px; width:25px; color:var(--clay); margin-block-start:2px; stroke-width:1.55 }
.has-chat .result-heading h2 { font-size:clamp(20px,1.7vw,26px); line-height:1.28; letter-spacing:-.035em; scroll-margin-top:70px }
.has-chat .workspace-scope { display:flex;align-items:baseline;gap:5px;margin:10px 0 14px;color:var(--muted) }
.has-chat .workspace-scope .ui-icon { width:15px; height:15px; align-self:flex-start; margin-top:3px }
.has-chat .workspace-scope .scope { margin:0; font-size:14px; line-height:1.5; color:inherit }
.has-chat .results .note { font-size:13px; margin:0 }
.has-chat .review-progress { display:flex; align-items:center; gap:10px; margin-top:4px; color:var(--muted);font-size:12px }
.has-chat .review-progress progress {
  appearance:none;
  border:0;
  border-radius:5px;
  overflow:hidden;
  flex:1;
  min-width:18px;
  height:3px;
  color:var(--ink);
  background-color:var(--line);
}
.has-chat .review-progress progress::-webkit-progress-bar {background:var(--line)}
.has-chat .review-progress progress::-webkit-progress-value {background:var(--ink)}
.has-chat .review-progress progress::-moz-progress-bar {background:var(--ink)}
.has-chat .results ul { margin-top:13px }
.has-chat .item { padding-block:13px }
.has-chat .item label { align-items:start; flex-wrap:wrap; column-gap:8px; row-gap:4px; line-height:1.5 }
.has-chat .item input { width:16px;height:16px; margin:4px 0 0; min-width:16px; accent-color:var(--ink);cursor:pointer }
.has-chat .item label .item-title { flex:1 1 100px; font-weight:620; font-size:15px }
.has-chat .item label .kind {
  display:inline-flex; align-items:center; min-height:22px; padding:2px 7px;
  background:var(--mist); color:var(--muted);
  border-radius:4px;
  font-size:11px; font-weight:600;
}
.has-chat .item .kind.check { background:#fcf1e9; color:#794022 }
.has-chat .item .kind.verified { background:#eaf0f4; color:#29465b }
.has-chat .item:has(input:checked) .item-title { color:var(--muted) }
.has-chat .item p { margin-inline-start:24px;margin-top:5px;font-size:14px;line-height:1.6 }
.has-chat .item-citation,.has-chat .item-question { font-size:13px; line-height:1.4; color:var(--link); }
.has-chat .item-citation { border-color:transparent;background:transparent;padding:2px 5px;min-height:28px;text-decoration:underline; text-underline-offset:2px }
.has-chat .item-question { min-height:44px;margin-inline-start:23px;padding:3px 7px;border:0;background:transparent;text-decoration:underline;text-underline-offset:3px }
.has-chat .evidence { background:var(--mist); border:0; border-radius:9px; padding:12px 14px; margin:6px 0 14px }
.has-chat .evidence h3 { font-size:14px;line-height:1.5 }
.has-chat .evidence p { color:var(--muted);font-size:13px;line-height:1.6 }
.has-chat .evidence .source-record { margin:0; border:0; scroll-margin:65px }
.has-chat .source-record summary { padding-block:5px 3px; min-height:44px; color:var(--ink);font-size:14px;font-weight:600 }
.has-chat .source-record[open] summary { margin-bottom:4px }
.has-chat .source-record a { overflow-wrap:anywhere; font-size:13px; min-height:44px }
.has-chat .source-record summary:focus-visible,.has-chat .source-record:focus-visible {outline:2px solid var(--clay);outline-offset:3px}
.has-chat .results .actions { gap:8px; margin-top:14px }
.has-chat .results .actions button { display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;font-weight:600;padding-inline:13px }
.has-chat #copy { background:var(--ink);color:var(--paper);border-color:var(--ink) }
.has-chat #copy:hover { background:var(--link) }

@media(max-width:800px) {
  .has-chat .landing { padding-block:20px 32px }
  .has-chat .session-head { margin-bottom:13px }
  .has-chat .session-head h1 { font-size:clamp(25px,5.2vw,34px); margin-top:6px }
  .has-chat #clear { font-size:13px; gap:5px; padding-inline:1px }
  .has-chat .workarea, .has-chat.has-materials .workarea { display:block }
  .has-chat .workspace-tabs {
    display:flex;
    align-items:stretch;
    width:100%;
    position:sticky;
    top:0;
    z-index:3;
    margin:0 0 14px;
    padding-block:3px;
    border-bottom:1px solid var(--line);
    background:var(--paper);
  }
  .has-chat .workspace-tabs button {
    position:relative;
    display:flex;align-items:center;justify-content:center;gap:6px;
    flex:1;
    padding:6px;
    min-height:44px;
    border:0;
    border-radius:5px;
    background:var(--paper);
    font-size:14px;font-weight:570;line-height:1.4;color:var(--muted)
  }
  .has-chat .workspace-tabs .ui-icon { width:17px;height:17px }
  .has-chat .workspace-tabs [aria-selected="true"] { color:var(--ink);font-weight:680 }
  .has-chat .workspace-tabs [aria-selected="true"]::after {
    content:"";position:absolute;inset-inline:12%;bottom:-4px;height:3px;border-radius:4px;background:var(--ink)
  }
  .has-chat .workspace-count { padding:0 6px; min-width:20px; border-radius:8px;background:var(--mist);color:var(--ink);font-size:12px }
  .has-chat.has-materials[data-workspace-view="chat"] #workspace-checklist,
  .has-chat.has-materials[data-workspace-view="checklist"] #workspace-chat { display:none }
  .has-chat .chat { border-block-start:0 }
  .has-chat .conversation-label { min-height:53px;padding-block:3px 9px }
  .has-chat .conversation-label .avatar { width:36px;height:36px }
  .has-chat .conversation-label h2 { font-size:18px }
  .has-chat .conversation { margin-block:12px }
  .has-chat .conversation.show-history { max-height:min(53vh,440px) }
  .has-chat .conversation:not(.show-history) .turn:not(:last-child) { display:none }
  .has-chat .conversation:not(.show-history) .turn:last-child:not(:first-child) { margin:0; padding:0; border:0 }
  .has-chat .followups { margin-bottom:11px }
  .has-chat .results { padding:17px 16px }
  .has-chat .result-heading h2 { font-size:21px }
  .has-chat .result-heading .ui-icon { width:22px;height:22px }
}
@media(max-width:420px) {
  .has-chat .session-head { align-items:flex-start;flex-direction:column;gap:8px }
  .has-chat .session-actions { align-self:flex-end }
  .has-chat .session-head .category { font-size:12px }
  .has-chat .session-head h1 { font-size:25px }
  .has-chat #clear { white-space:nowrap;line-height:1.35 }
  .has-chat .history-action { font-size:12px }
  .has-chat .question { max-width:92% }
  .has-chat .item p { margin-inline-start:0 }
  .has-chat .item-question { margin-inline-start:0 }
}

.has-chat .reply-citation { min-height:44px; padding:4px 0; border:0; background:transparent; color:var(--link); text-decoration:underline; text-underline-offset:3px; font-size:14px }

.live-controls { margin-block:8px 2px; color:var(--muted); line-height:1.5 }
.live-controls small { font-size:12px }
.live-case-picker { margin-inline-start:12px; max-width:100%; min-height:36px; color:var(--ink); background:transparent; border:1px solid var(--line); border-radius:6px; font:inherit; font-size:13px; padding:4px 8px }
.handoff-draft { margin-top:10px; border-block-start:1px solid var(--line); font-size:14px }
.handoff-draft summary { cursor:pointer; padding-block:9px; color:var(--ink); font-weight:600 }
.handoff-draft p { margin:0 0 8px; line-height:1.55; overflow-wrap:anywhere }
.provider-card {
  margin:14px 0;
  padding:13px 16px;
  border:1px solid var(--line);
  border-inline-start:3px solid var(--clay);
  border-radius:6px;
  overflow-wrap:anywhere;
}
.provider-level { display:flex; align-items:baseline; flex-wrap:wrap; gap:2px 8px; margin:4px 0; line-height:1.5 }
h3.provider-level { font-size:1.04rem; margin-top:0 }
.provider-label, .provider-pending { color:var(--muted) }
.provider-label, .provider-refs { font-size:.88rem }
.provider-reason, .provider-pending { margin:8px 0 0; font-size:.94rem; line-height:1.55 }
.live-controls .status:not(:empty) { margin-block:4px; color:var(--ink) }
.live-actions button { min-height:44px }
.live-followup { font-weight:550 }
.reply-next-actions { display:flex; flex-wrap:wrap; align-items:center; gap:0 14px; margin-block:4px }
.reply-next-actions :is(a, button.quiet) {
  display:inline-flex; align-items:center; min-height:44px; max-width:100%; padding:4px 0; border:0;
  background:transparent; color:var(--link); font:inherit; font-size:13px; text-decoration:underline;
  text-underline-offset:3px; text-align:start; overflow-wrap:anywhere;
}
.reply-next-actions .cost-copy-status { margin:0 }
.reply-next-actions .reply-copy-text {
  flex-basis:100%; min-width:0; margin:0 0 8px; white-space:pre-wrap; overflow-wrap:anywhere;
}
.source-detail .source-return { display:block; margin-top:6px }

.claim-card { margin-block:15px; padding:13px 15px; border:1px solid var(--line); border-radius:8px; overflow-wrap:anywhere; color:var(--ink) }
.claim-card h3 { margin:0 0 6px; line-height:1.45; font-size:1.04rem }
.claim-card p, .claim-input-note { margin:5px 0; line-height:1.55; overflow-wrap:anywhere }
.claim-statement, .claim-scope, .claim-qualifier, .claim-locator, .claim-input-note, .claim-source-status { font-size:.88rem; color:var(--muted) }
.claim-status { display:inline-block; margin-block-start:6px; padding:2px 8px; border-radius:4px; background:var(--mist); font-size:.88rem }
.claim-card[data-status="contradicted"] .claim-status { border-inline-start:3px solid var(--clay) }
.claim-evidence { margin-block-start:9px; border-block-start:1px solid var(--line) }
.claim-evidence summary { padding-block:11px; min-height:44px; cursor:pointer; color:var(--link); font-size:.93rem }
.claim-source { margin-block-end:10px }
.claim-source a { display:inline-block; padding-block:8px; color:var(--link); text-decoration:underline; text-underline-offset:3px }
.claim-source blockquote { margin:6px 0; border-inline-start:2px solid var(--line); padding-inline-start:10px; line-height:1.6 }
.claim-card h4 { margin:11px 0 4px; font-size:.93rem }
.claim-questions { margin:0; padding-inline-start:1.25rem; line-height:1.55 }

.cost-panel { margin-block:12px; line-height:1.58; overflow-wrap:anywhere }
.cost-panel h3 { margin:14px 0 5px; font-size:1rem }
.cost-facts { display:grid; grid-template-columns:minmax(0,auto) minmax(0,1fr); gap:2px 12px; margin:4px 0 15px; font-size:.94rem }
.cost-facts dt { color:var(--muted) }
.cost-facts dd { margin:0 }
.cost-findings, .cost-actions { padding-inline-start:1.25rem; margin:4px 0 12px }
.cost-findings li, .cost-actions li { margin-block:5px }
.cost-owner { border-block-start:1px solid var(--line) }
.cost-owner summary { cursor:pointer; padding-block:11px; min-height:44px; font-weight:650 }
.cost-actions li p, .cost-card p { margin:3px 0 }
.cost-card p[lang="en"] { color:var(--muted) }
.cost-card button { min-height:44px; margin-block-start:6px }
.cost-copy-status { margin-inline-start:8px; color:var(--muted); font-size:.85rem }

.visit-panel { margin-block:14px; border-block-end:1px solid var(--line); color:var(--ink) }
.visit-panel details { border-block-start:1px solid var(--line) }
.visit-panel summary { cursor:pointer; padding-block:12px; font-size:1rem; font-weight:650; line-height:1.5 }
.visit-basis { display:inline-block; margin-inline-start:9px; color:var(--muted); font-size:.78rem; font-weight:400 }
.visit-diagram { display:block; width:100%; max-width:352px; height:auto; margin-block:4px 9px }
.visit-diagram [role="button"] { cursor:pointer }
.visit-diagram [role="button"]:focus-visible rect { stroke:var(--link); stroke-width:3 }
.visit-map-save { margin-block-end:12px }
.visit-stage p { margin:0 0 8px; line-height:1.6; overflow-wrap:anywhere }
.visit-note, .visit-source { color:var(--muted); font-size:.9rem }
.visit-next { margin:7px 0 11px; padding-inline-start:20px; font-size:.9rem; line-height:1.55; color:var(--ink) }
.visit-card { margin:12px 0 16px; border-inline-start:3px solid var(--clay); padding:9px 12px; background:var(--mist); border-radius:2px 6px 6px 2px }
.visit-card h4 { margin:0 0 7px; font-size:.93rem }
.visit-card p[lang="en"] { color:var(--muted) }
.visit-phrase-dialog { box-sizing:border-box; padding:clamp(20px,5vw,38px); width:min(560px,calc(100vw - 24px)); max-height:calc(100dvh - 28px); overflow:auto; color:var(--ink); background:var(--paper); border:1px solid var(--line); border-radius:14px }
.visit-phrase-dialog::backdrop { background:rgb(18 34 50 / .65) }
.visit-phrase-dialog h2 { margin-block:0 18px; font-size:1.1rem }
.visit-phrase-dialog p { overflow-wrap:anywhere }
.visit-card-scope { margin:0 0 7px; color:var(--muted); font-size:.9rem }
.shown-zh { margin-block:0 14px; font-weight:650; line-height:1.45; font-size:clamp(1.6rem,6vw,2.35rem) }
.shown-en { margin-block:0 22px; color:var(--muted); font-size:1.08rem; line-height:1.55 }
.visit-map-save, .visit-card-open, .visit-phrase-dialog button { min-height:44px }

.record-tools { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px 14px; padding:12px 0; border-top:1px solid var(--line); color:var(--ink) }
.record-tools[hidden], .record-entry[hidden], .record-workspace #workspace-count { display:none }
.record-tools label { display:grid; min-width:0; gap:4px; font-size:.88rem; font-weight:600 }
.record-tools .record-cloud-ocr { display:flex; flex:0 0 100%; gap:8px; align-items:baseline; font-weight:400 }
.record-tools .record-cloud-ocr[hidden] { display:none }
.record-tools small { color:var(--muted); font-weight:400 }
.record-tools input[type="file"], .record-tools select { max-width:100%; font:inherit; font-weight:400; color:var(--ink) }
.record-tools input::file-selector-button { min-height:36px; padding:6px 12px; margin-inline-end:8px; color:var(--ink);
  background:var(--mist); border:1px solid var(--line); border-radius:6px; cursor:pointer }
.record-tools button, .record-tools select, .record-entry { min-height:40px }
.record-report { margin:16px 0; color:var(--ink) }
.record-report h3 { font-size:1.02rem; margin:0 0 10px }
.record-line, .record-summary-item { padding:12px 0; border-block-start:1px solid var(--line); min-width:0; overflow-wrap:anywhere }
.record-line h4, .record-summary-item h3 { display:flex; gap:5px 9px; align-items:center; flex-wrap:wrap; margin:0 0 7px; font-size:.88rem; color:var(--ink) }
.record-line h4 { font-weight:550; color:var(--muted) }
.record-kind { font-weight:650; color:var(--ink) }
.record-line:focus-visible { outline:2px solid var(--link); outline-offset:3px }
.record-pair { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:6px 16px }
.record-language { min-width:0 }
.record-language small, .record-missing { font-size:.8rem; color:var(--muted) }
.record-language p, .record-original, .record-summary p { white-space:pre-wrap; overflow-wrap:anywhere; word-break:normal; margin:3px 0; line-height:1.55 }
.record-summary .record-pair { grid-template-columns:minmax(0,1fr) }
.record-line[data-status="review"] { border-inline-start:3px solid var(--clay); padding-inline-start:10px }
.record-flag { color:#834214; background:#fff0df; border-radius:4px; padding:1px 6px; font-size:.78rem; font-weight:650 }
.record-issues { padding-inline-start:1.2rem; margin:8px 0; font-size:.9rem; overflow-wrap:anywhere; color:#754223 }
.record-issues li { margin:4px 0 }
.record-locator { min-height:32px; border:0; padding:1px 6px; color:var(--link); background:var(--mist); text-decoration:underline; cursor:pointer }
.record-summary { color:var(--ink) }
.record-summary h3 { font-size:.94rem; margin:6px 0 }
.record-workspace .evidence { border-top:0 }
.record-download-summary { min-height:44px }
@media(max-width:540px) {
  .record-pair { grid-template-columns:minmax(0,1fr) }
  .record-tools label:first-child { width:100% }
  .record-tools input[type="file"] { width:100% }
}

/* The preview conversation has one reading surface. Supporting material opens on demand. */
.carefold-reading.has-chat .landing {
  width:min(760px, calc(100% - 42px));
  padding-block:clamp(22px, 4vw, 50px) 48px;
}
.carefold-reading.has-chat .session-head {
  align-items:center;
  justify-content:space-between;
  width:100%;
  margin-bottom:14px;
}
.carefold-reading.has-chat .session-head .category { display:none }
.carefold-reading.has-chat .session-head h1 {
  margin:0;
  font-size:clamp(23px, 3vw, 34px);
  line-height:1.22;
  letter-spacing:-.035em;
  text-wrap:pretty;
}
.carefold-reading.has-chat .workarea { display:block }
.carefold-reading.has-chat .chat { border:0 }
.carefold-reading.has-chat .conversation-label { display:none }
.carefold-reading.has-chat .workspace-tabs {
  display:flex;
  gap:20px;
  width:100%;
  margin:0 0 14px;
  padding:0;
  position:sticky;
  inset-block-start:0;
  z-index:3;
  border-bottom:1px solid var(--line);
  background:var(--paper);
}
.carefold-reading.has-chat .workspace-tabs button {
  position:relative;
  flex:none;
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:0 1px;
  border:0;
  background:transparent;
  color:var(--muted);
  font-size:14px;
  font-weight:560;
}
.carefold-reading.has-chat .workspace-tabs [aria-selected="true"] { color:var(--ink); font-weight:690 }
.carefold-reading.has-chat .workspace-tabs [aria-selected="true"]::after {
  content:"";
  position:absolute;
  inset-inline:0;
  inset-block-end:-1px;
  block-size:2px;
  border-radius:2px;
  background:var(--ink);
}
.carefold-reading.has-chat .workspace-tabs .ui-icon { width:16px; height:16px }
.carefold-reading.has-chat .workspace-count { padding:0; min-width:0; border-radius:0; background:none; font-size:12px; color:var(--muted) }
.carefold-reading.has-chat.has-materials[data-workspace-view="chat"] #workspace-checklist,
.carefold-reading.has-chat.has-materials[data-workspace-view="checklist"] #workspace-chat { display:none }

.carefold-reading.has-chat #conversation {
  margin:16px 0 21px;
  max-height:none;
  padding:0;
  overflow:visible;
  overscroll-behavior:auto;
}
.carefold-reading.has-chat #conversation .turn {
  display:block;
  margin:0;
  padding:0;
  border:0;
}
.carefold-reading.has-chat #conversation .turn + .turn { margin-top:clamp(30px,5vw,54px) }
.carefold-reading.has-chat .question {
  max-width:min(88%, 55ch);
  padding:9px 14px;
  margin-block-end:18px;
  border-radius:14px;
  background:var(--mist);
  font-size:clamp(15px, 1.2vw, 16px);
}
.carefold-reading.has-chat .answer { max-width:73ch; scroll-margin-top:56px }
.carefold-reading.has-chat .speaker { color:var(--muted); font-size:12px; font-weight:610; margin-bottom:3px }
.carefold-reading.has-chat .speaker::before { display:none }
.carefold-reading.has-chat .reply-mode { margin-inline-start:7px; font-weight:470 }
.carefold-reading.has-chat .reply {
  margin:9px 0;
  font-size:clamp(16px, 1.3vw, 17px);
  line-height:1.75;
}
.carefold-reading.has-chat .reply-topic { margin-top:20px; color:var(--ink); font-weight:680 }
.carefold-reading.has-chat .reply-topic:first-of-type { margin-top:8px }
.carefold-reading.has-chat .reply a,
.carefold-reading.has-chat .reply .item-citation {
  display:inline;
  min-height:0;
  padding:0 .16em;
  color:var(--link);
  background:none;
  text-decoration:underline;
  font-size:.84em;
  font-variant-numeric:tabular-nums;
}
.carefold-reading.has-chat .reply.live-followup {
  padding-inline-start:12px;
  border-inline-start:2px solid var(--fold-light);
  margin-top:14px;
  font-weight:560;
}
.carefold-reading.has-chat .reply-utilities { display:flex; flex-wrap:wrap; align-items:baseline; gap:0 15px; margin-top:7px }
.carefold-reading.has-chat .handoff-draft {
  margin:1px 0 0;
  border:0;
}
.carefold-reading.has-chat .handoff-draft[open] { flex-basis:100% }
.carefold-reading.has-chat .handoff-draft summary {
  min-height:40px;
  padding:8px 0;
  color:var(--link);
  font-size:13px;
}
.carefold-reading.has-chat .handoff-draft > :not(summary) { margin-inline-start:13px }
.carefold-reading.has-chat :is(.reply-source-line, .reply-draft-line, .reply-feedback-line) {
  padding-block:8px;
  border-block-start:1px solid var(--line);
}
.carefold-reading.has-chat .reply-source-line > a { display:inline-block; margin-block-end:5px; font-weight:640 }
.carefold-reading.has-chat .reply-source-line p { margin-block:2px 3px; color:var(--muted); font-size:13px }
.carefold-reading.has-chat .reply-draft-line h4 { margin:0 0 6px; color:var(--ink); font-size:14px }
.carefold-reading.has-chat .reply-feedback-line p { margin:0; font-weight:610 }
.carefold-reading.has-chat .answer :is(.visit-card, .provider-card, .claim-card) {
  margin:6px 0 10px;
  padding:10px 0;
  border:0;
  border-block-start:1px solid var(--line);
  border-radius:0;
  background:none;
  box-shadow:none;
}
.carefold-reading.has-chat .answer details .visit-card {
  margin-inline-start:13px;
  padding-block:7px;
}
.carefold-reading.has-chat .claim-status,
.carefold-reading.has-chat .item label .kind {
  padding:0;
  background:none;
  border:0;
  border-radius:0;
}
.carefold-reading.has-chat .claim-card[data-status="contradicted"] .claim-status { color:#8a381b; font-weight:620 }
.carefold-reading.has-chat .answer .handoff-draft .quiet {
  padding-inline:0;
  margin-inline-end:10px;
  border:0;
  background:none;
  font-size:13px;
  text-decoration:underline;
}
.carefold-reading.has-chat .reply-reveal-skip {
  min-height:44px;
  padding:3px 0;
  margin:2px 0;
  border:0;
  background:none;
  color:var(--link);
  text-decoration:underline;
  font-size:13px;
}
.carefold-reading.has-chat .reply-pending { color:var(--muted); font-size:14px; margin-block:7px 12px }
.carefold-reading.has-chat .reply-is-revealing .reply:empty { margin:0 }
.carefold-reading .reply-progress {
  display:flex;
  align-items:center;
  gap:9px;
  min-height:24px;
  margin-block:5px 12px;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}
.carefold-reading .reply-progress-label { min-width:0; overflow-wrap:anywhere }
.carefold-reading .reply-progress-dots { display:inline-flex; flex:none; align-items:center; gap:3px }
.carefold-reading .reply-progress-dots span {
  inline-size:4px;
  block-size:4px;
  border-radius:50%;
  background:var(--clay);
  opacity:.72;
}
.carefold-reading .reply-stream-section.is-unrevealed { display:none }
.carefold-reading .reply-stream-caret::after {
  content:"";
  display:inline-block;
  inline-size:1px;
  block-size:.9em;
  margin-inline-start:.18em;
  vertical-align:-.1em;
  background:var(--clay);
}
.carefold-reading .send.is-sending { background:var(--link); cursor:progress }

/* Only new content moves. Restoring a conversation or viewing urgent guidance is immediate. */
@media(prefers-reduced-motion:no-preference) {
  .carefold-reading.chat-opening :is(.session-head, .workspace-tabs) {
    animation:chat-arrive 250ms ease-out both;
  }
  .carefold-reading .chat-turn-new {
    animation:chat-arrive 260ms cubic-bezier(.2,.7,.3,1) both;
  }
  .carefold-reading .reply-progress-dots span {
    animation:chat-progress-dot 1.2s ease-in-out infinite;
  }
  .carefold-reading .reply-progress-dots span:nth-child(2) { animation-delay:140ms }
  .carefold-reading .reply-progress-dots span:nth-child(3) { animation-delay:280ms }
  .carefold-reading .reply-stream-section.is-current:not(.is-complete, .is-unrevealed) {
    animation:chat-section-appear 180ms ease-out both;
  }
  .carefold-reading .reply-stream-caret::after {
    animation:chat-caret 1.05s step-end infinite;
  }
  .carefold-reading .send.is-sending .ui-icon {
    animation:chat-send-busy 1s ease-in-out infinite;
  }
}
@keyframes chat-arrive {
  from { opacity:.78; transform:translateY(5px) }
  to { opacity:1; transform:none }
}
@keyframes chat-progress-dot {
  0%, 80%, 100% { opacity:.43; transform:none }
  40% { opacity:1; transform:translateY(-2px) }
}
@keyframes chat-section-appear {
  from { opacity:.85 }
  to { opacity:1 }
}
@keyframes chat-caret {
  0%, 100% { opacity:.8 }
  50% { opacity:.2 }
}
@keyframes chat-send-busy {
  0%, 100% { opacity:1; transform:none }
  50% { opacity:.67; transform:translateY(-1px) }
}

.carefold-reading.has-chat #ask {
  position:sticky;
  z-index:2;
  inset-block-end:0;
  padding:10px 0 max(8px, env(safe-area-inset-bottom));
  border:0;
  background:var(--paper);
}
.carefold-reading.has-chat #ask:has(.record-tools:not([hidden])) { position:static }
.carefold-reading.has-chat .composer {
  padding:5px 6px 5px 13px;
  border-radius:16px;
  box-shadow:0 2px 9px #26394f0c;
}
.carefold-reading.has-chat .composer textarea { min-height:42px; font-size:16px }
.carefold-reading.has-chat .send { border-radius:12px }
.carefold-reading.has-chat #ask .privacy { font-size:11px; margin-top:5px }
.carefold-reading .chat-composer-tools { display:flex; flex-wrap:wrap; align-items:center; gap:0 16px }
.carefold-reading .chat-composer-tools :is(.record-entry, .case-packet-open) { margin-block:0; min-height:36px }
.carefold-reading .record-entry,
.carefold-reading .case-packet-open {
  padding-inline:0;
  border:0;
  background:none;
  color:var(--link);
  font-size:13px;
  font-weight:580;
  text-decoration:underline;
}
.carefold-reading .case-packet-open:hover { background:none; color:var(--ink) }
.carefold-reading.has-chat .results {
  padding:13px 0;
  border:0;
  border-radius:0;
  box-shadow:none;
}
.carefold-reading.has-chat[data-guide=xiaozhe] .results::after { display:none }
.carefold-reading.has-chat .evidence {
  margin:9px 0;
  padding:10px 0;
  border-top:1px solid var(--line);
  border-radius:0;
  background:none;
}
.carefold-reading.has-chat .results .actions button {
  padding:5px 0;
  margin-inline-end:10px;
  border:0;
  background:none;
  color:var(--link);
  text-decoration:underline;
}
.carefold-reading .case-packet-dialog .case-packet-group {
  padding:5px 6px 7px 0;
  border:0;
  border-block-start:1px solid var(--line);
  border-radius:0;
}

/* A single history dialog keeps case management out of the reading layout. */
.carefold-reading .chat-history-trigger {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  flex:none;
  border:0;
  padding:3px 0;
  background:none;
  color:var(--ink);
}
.carefold-reading .chat-history-trigger .ui-icon { width:17px; height:17px }
.carefold-reading .chat-history-short { display:none }
.carefold-reading .chat-history-dialog {
  width:min(600px, calc(100% - 24px));
  max-height:min(730px, calc(100dvh - 24px));
  padding:clamp(14px,4vw,24px);
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:0 16px 46px #26394f22;
}
.carefold-reading .chat-history-dialog::backdrop { background:rgb(25 40 57 / .38) }
.carefold-reading .chat-history-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px 13px;
  flex-wrap:wrap;
  margin-block-end:8px;
}
.carefold-reading .chat-history-head h2 { margin:0; font-size:clamp(19px, 5vw, 24px); line-height:1.25 }
.carefold-reading .chat-history-list { list-style:none; padding:0; margin:0 }
.carefold-reading .chat-history-row {
  display:flex;
  align-items:center;
  gap:3px 14px;
  padding-block:2px;
  border-block-start:1px solid var(--line);
}
.carefold-reading .chat-history-select {
  flex:1;
  min-width:0;
  display:grid;
  justify-items:start;
  align-content:center;
  gap:2px;
  padding:9px 0;
  border:0;
  background:none;
  text-align:start;
}
.carefold-reading .chat-history-select:hover .chat-history-title { text-decoration:underline }
.carefold-reading .chat-history-title { font-weight:640; white-space:normal; overflow-wrap:anywhere }
.carefold-reading .chat-history-date,
.carefold-reading .chat-history-status { font-size:12px; color:var(--muted) }
.carefold-reading .chat-history-actions { display:flex; align-items:center; flex-wrap:wrap; gap:0 9px }
.carefold-reading .chat-history-actions button { padding-inline:0; border:0; background:none; color:var(--link); font-size:13px }
.carefold-reading .chat-history-actions button:hover { text-decoration:underline }
.carefold-reading .chat-history-edit { flex:1; min-width:0; display:flex; flex-wrap:wrap; align-items:center; gap:6px }
.carefold-reading .chat-history-edit input { flex:1; min-width:10ch; border:1px solid var(--control-edge); border-radius:6px; padding:5px 7px }
@media(max-width:520px) {
  .carefold-reading.has-chat .landing { width:calc(100% - 32px); padding-block-start:17px }
  .carefold-reading.has-chat .session-head { margin-bottom:10px }
  .carefold-reading.has-chat .workspace-tabs { margin-bottom:9px }
  .carefold-reading.has-chat .question { max-width:90% }
  .carefold-reading .chat-history-trigger:has(.ui-icon) { min-width:44px }
  .carefold-reading .chat-history-trigger .chat-history-label {
    position:absolute;
    width:1px;
    height:1px;
    clip-path:inset(50%);
    overflow:hidden;
    white-space:nowrap;
  }
}
@media (min-width:372px) and (max-width:520px) {
  .carefold-reading .chat-history-trigger .ui-icon { display:none }
  .carefold-reading .chat-history-short { display:inline }
}
@media(max-width:460px) {
  .carefold-reading .mast .wordmark { width:clamp(106px, 33vw, 154px) }
  .carefold-reading .mast-inner:has(.nav-account:not([hidden])) .wordmark {
    width:clamp(106px, calc(100vw - 278px), 154px);
  }
}
@media(max-width:370px) {
  .carefold-reading.has-chat .landing { width:calc(100% - 24px) }
  .carefold-reading .chat-history-row { gap:3px 9px }
}
