/* Self-contained document workspace. The outer accordion follows the Copito site. */
#ia-local-demo { --ld-ink: #b4cff5; --ld-tint: #1c293c; --ld-line: #6785af; margin-top: 28px; min-width: 0; }
:root[data-theme="light"] #ia-local-demo { --ld-ink: #24558b; --ld-tint: #eaf2fc; --ld-line: #7397c1; }
.ld-scenarios { display: flex; flex-wrap: wrap; gap: 9px; }
.ld-scenario { display: inline-flex; align-items: center; gap: 9px; min-height: 46px; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text-secondary); text-align: left; font-size: .86rem; font-weight: 600; transition: background .16s, border-color .16s; }
.ld-scenario svg { width: 19px; height: 19px; flex: 0 0 auto; }
.ld-scenario:hover { color: var(--text); background: var(--surface-soft); }
.ld-scenario[aria-pressed="true"] { color: var(--ld-ink); background: var(--ld-tint); border-color: var(--ld-line); }
.ld-simulation { margin: 19px 0 11px; font-size: .78rem; color: var(--text-secondary); }
.ld-workspace { overflow: hidden; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; }
.ld-workspace-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 18px; background: var(--surface-soft); border-bottom: 1px solid var(--border); color: var(--text-secondary); font-size: .78rem; }
.ld-workspace-bar > span:first-child { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.ld-workspace-bar svg { width: 17px; height: 17px; flex-shrink: 0; }
.ld-fiction-label { white-space: nowrap; color: var(--text-tertiary); }
.ld-desktop { display: grid; grid-template-columns: minmax(245px,.85fr) minmax(0,2fr); }
.ld-documents { display: flex; flex-direction: column; min-width: 0; padding: 25px 16px 22px; background: var(--surface-soft); border-right: 1px solid var(--border); }
.ld-sidebar-title { padding-inline: 8px; margin-bottom: 16px; font-size: .83rem; color: var(--text); font-weight: 650; }
.ld-document-list { display: grid; gap: 7px; }
.ld-document { display: flex; align-items: flex-start; gap: 9px; width: 100%; padding: 12px 10px; border: 1px solid transparent; border-radius: 9px; color: var(--text-secondary); background: transparent; text-align: left; transition: border-color .2s, background .2s; }
.ld-document > svg { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.ld-document > span:nth-child(2) { min-width: 0; }
.ld-document strong { display: block; font-size: .8rem; line-height: 1.5; font-weight: 600; }
.ld-document small { display: block; margin-top: 5px; font-size: .7rem; line-height: 1.4; color: var(--text-tertiary); }
.ld-document:hover { color: var(--text); background: var(--surface); }
.ld-document[aria-pressed="true"] { color: var(--ld-ink); border-color: var(--ld-line); background: var(--ld-tint); }
.ld-document-check { width: 15px; margin: 3px 0 0 auto; opacity: 0; flex-shrink: 0; transition: opacity .2s; }
.ld-document-check svg { width: 15px; height: 15px; }
.ld-document-active .ld-document[aria-pressed="true"] .ld-document-check { opacity: 1; }
.ld-source-hint { display: flex; align-items: flex-start; gap: 8px; margin: 23px 8px 27px; color: var(--text-secondary); }
.ld-source-hint p { font-size: .74rem; line-height: 1.65; }
.ld-source-marker { width: 6px; height: 6px; margin-top: 6px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.ld-document-active .ld-source-marker { background: var(--ld-ink); }
.ld-installation { margin-top: auto; padding-inline: 8px; color: var(--text-tertiary); font-size: .73rem; line-height: 1.7; }
.ld-conversation { min-width: 0; }
.ld-assistant-header { display: flex; align-items: center; gap: 12px; padding: 19px 24px; border-bottom: 1px solid var(--border); }
.ld-assistant-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--ld-tint); color: var(--ld-ink); flex-shrink: 0; }
.ld-assistant-avatar svg { width: 24px; height: 24px; }
.ld-assistant-header h4 { margin: 0; color: var(--text); font-size: .87rem; line-height: 1.5; font-weight: 650; }
.ld-assistant-header p { color: var(--text-secondary); font-size: .74rem; line-height: 1.6; }
.ld-messages { padding: 24px; }
.ld-question { width: fit-content; max-width: 91%; margin: 0 0 24px auto; padding: 13px 16px; background: var(--ld-tint); border: 1px solid var(--ld-line); border-radius: 12px 12px 3px 12px; color: var(--text); }
.ld-question p { font-size: .88rem; line-height: 1.65; }
.ld-message-label { display: block; margin-bottom: 6px; color: var(--text-secondary); font-size: .68rem; font-weight: 600; }
.ld-question .ld-message-label { color: var(--ld-ink); }
.ld-answer-area { min-height: 250px; }
.ld-ready { display: flex; align-items: flex-start; gap: 13px; max-width: 390px; padding: 15px 4px; color: var(--text-secondary); }
.ld-ready > svg { width: 25px; height: 25px; margin-top: 4px; flex-shrink: 0; color: var(--ld-ink); }
.ld-ready p { font-size: .85rem; line-height: 1.8; }
.ld-ready strong { color: var(--text); font-weight: 600; }
.ld-reading { padding: 19px 2px; }
.ld-reading p { margin-top: 12px; font-size: .82rem; color: var(--text-secondary); }
.ld-reading-dots { display: flex; gap: 5px; }
.ld-reading-dots i { width: 6px; height: 6px; background: var(--ld-ink); border-radius: 50%; animation: ld-thinking 1.25s ease-in-out infinite; }
.ld-reading-dots i:nth-child(2) { animation-delay: .18s; }
.ld-reading-dots i:nth-child(3) { animation-delay: .36s; }
.ld-answer { padding: 0 3px; animation: ld-appear .28s ease-out both; }
.ld-answer-text { color: var(--text); font-size: .85rem; line-height: 1.75; }
.ld-answer-text p { margin: 0 0 11px; line-height: 1.75; }
.ld-answer-text p:last-child { margin-bottom: 0; }
.ld-answer-text ol { padding-left: 22px; margin: 8px 0 13px; }
.ld-answer-text li { padding-left: 3px; margin-bottom: 5px; }
.ld-answer-text strong { font-weight: 650; }
.ld-answer-text .ld-draft-label { display: inline-block; padding: 4px 8px; border-radius: 5px; background: var(--surface-soft); color: var(--text-secondary); font-size: .7rem; }
.ld-source-button { display: flex; align-items: center; gap: 8px; max-width: 100%; min-height: 44px; margin-top: 19px; padding: 8px 10px; border: 1px solid var(--ld-line); border-radius: 8px; background: var(--ld-tint); color: var(--ld-ink); font-size: .73rem; line-height: 1.5; font-weight: 600; text-align: left; }
.ld-source-button svg { width: 17px; height: 17px; flex-shrink: 0; }
.ld-source-button svg:last-child { margin-left: auto; transition: transform .16s; }
.ld-source-button[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
.ld-source-button:hover { filter: brightness(1.08); }
.ld-source-extract { margin-top: 12px; padding: 14px 16px; border-left: 3px solid var(--ld-line); background: var(--surface-soft); color: var(--text-secondary); font-size: .77rem; line-height: 1.75; }
.ld-source-extract > strong { display: block; margin-bottom: 7px; color: var(--text); font-size: .72rem; font-weight: 650; }
.ld-source-extract p { line-height: 1.8; }
.ld-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 17px; margin-top: 24px; }
.ld-run, .ld-stop { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 12px 16px; border: 1px solid transparent; border-radius: 10px; font-size: .82rem; font-weight: 650; line-height: 1.4; }
.ld-run { color: var(--on-accent); background: var(--accent); box-shadow: 0 3px 10px rgba(0,0,0,.12); transition: background .16s, transform .16s; }
.ld-run:hover { background: var(--accent-hover); transform: translateY(-1px); }
.ld-run[aria-disabled="true"] { color: var(--disabled-text); background: var(--disabled); box-shadow: none; cursor: default; transform: none; }
.ld-stop { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.ld-stop:hover { background: var(--surface-soft); }
.ld-run svg, .ld-stop svg { width: 17px; height: 17px; flex-shrink: 0; }
.ld-result { flex: 1 1 260px; color: var(--text-secondary); font-size: .78rem; line-height: 1.7; min-height: 1.7em; }
.ld-benefit { margin-top: 19px; color: var(--text-secondary); font-size: .89rem; line-height: 1.8; }
@keyframes ld-thinking { 0%,80%,100% { opacity: .3; } 40% { opacity: 1; } }
@keyframes ld-appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 900px) {
  .ld-desktop { grid-template-columns: minmax(210px,.9fr) minmax(0,1.7fr); }
  .ld-documents { padding-inline: 10px; }
  .ld-messages { padding: 21px 18px; }
  .ld-assistant-header { padding-inline: 18px; }
}
@media (max-width: 650px) {
  .ld-scenarios { display: grid; grid-template-columns: 1fr; gap: 7px; }
  .ld-scenario { min-height: 44px; padding: 10px 12px; font-size: .8rem; }
  .ld-simulation { font-size: .72rem; }
  .ld-workspace { border-radius: 12px; }
  .ld-workspace-bar { padding: 11px 12px; gap: 8px; font-size: .68rem; }
  .ld-workspace-bar > span:first-child { gap: 6px; }
  .ld-workspace-bar svg { width: 15px; height: 15px; }
  .ld-desktop { grid-template-columns: 1fr; }
  .ld-documents { padding: 17px 12px 14px; border-right: 0; border-bottom: 1px solid var(--border); }
  .ld-sidebar-title { margin-bottom: 11px; padding-inline: 0; font-size: .78rem; }
  .ld-document-list { display: grid; grid-template-columns: 1fr; gap: 5px; }
  .ld-document { padding: 9px; align-items: center; }
  .ld-document strong { font-size: .76rem; }
  .ld-document small { display: none; }
  .ld-document > svg { width: 17px; height: 17px; margin-top: 0; }
  .ld-document-check { margin-top: 0; }
  .ld-source-hint { margin: 11px 0 0; }
  .ld-source-hint p { font-size: .7rem; }
  .ld-installation { margin-top: 11px; padding-inline: 0; font-size: .7rem; }
  .ld-assistant-header { padding: 15px 12px; gap: 9px; }
  .ld-assistant-header h4 { font-size: .8rem; }
  .ld-assistant-header p { font-size: .69rem; }
  .ld-assistant-avatar { width: 34px; height: 34px; }
  .ld-assistant-avatar svg { width: 21px; height: 21px; }
  .ld-messages { padding: 17px 12px 20px; }
  .ld-question { padding: 11px 12px; max-width: 96%; margin-bottom: 20px; }
  .ld-question p { font-size: .81rem; }
  .ld-answer-area { min-height: 205px; }
  .ld-ready { gap: 9px; padding: 10px 2px; }
  .ld-ready p, .ld-answer-text { font-size: .79rem; }
  .ld-source-button { padding-inline: 8px; gap: 6px; font-size: .7rem; }
  .ld-source-extract { padding: 11px; font-size: .73rem; }
  .ld-controls { gap: 10px; margin-top: 21px; }
  .ld-result { flex-basis: 100%; font-size: .75rem; }
  .ld-benefit { font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ld-answer, .ld-reading-dots i { animation: none; }
  .ld-scenario, .ld-document, .ld-document-check, .ld-source-button svg, .ld-run { transition: none; }
  .ld-run:hover { transform: none; }
}
