/* The Assistant panel (guide 9b, "Conversation layout"). Every value is a semantic token or a
   step of the scale, so it is correct in both themes. */

.ds-assistant { z-index: 30; width: var(--ds-assistant-width, 25rem); overflow: hidden; border-inline-start: 1px solid var(--rw-divider); }
/* Pushed: a column of the shell's grid, under the top bar. */
.ds-app-pushed > .ds-assistant { position: relative; inset: auto; grid-row: 3; grid-column: 2; width: auto; min-width: 0; max-width: none; z-index: auto; box-shadow: none; }
.ds-assistant-overlay { max-width: 90vw; }

.ds-resizer { position: absolute; inset-block: 0; inset-inline-start: 0; z-index: 2; width: var(--rw-space-2x); cursor: col-resize; touch-action: none; }
.ds-resizer:hover, .ds-resizer:focus-visible { background-image: linear-gradient(var(--rw-bg-active), var(--rw-bg-active)); }
.ds-resizer:focus-visible { outline: 2px solid var(--rw-focus-ring); outline-offset: -2px; }
.ds-resizing { cursor: col-resize; user-select: none; }

.ds-assistant-head { display: flex; align-items: center; justify-content: space-between; gap: var(--rw-space-2x); padding: var(--rw-space-3x) var(--rw-space-3x) var(--rw-space-3x) var(--rw-space-4x); border-bottom: 1px solid var(--rw-divider); }
.ds-assistant-head > h2 { font-size: var(--rw-heading-xs-size); line-height: var(--rw-heading-xs-lh); }
.ds-assistant-head > .rw-toolbar { gap: var(--rw-space-1x); flex-wrap: nowrap; }

.ds-transcript { display: flex; flex-direction: column; gap: var(--rw-space-6x); flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--rw-space-4x); }
.ds-transcript:focus-visible { outline-offset: -2px; }
.ds-transcript > .rw-empty { margin: auto 0; padding-inline: 0; }
.ds-transcript > .rw-empty > p { line-height: var(--rw-body-lg-lh); }

.ds-turn { display: grid; gap: var(--rw-space-2x); min-width: 0; }
.ds-turn-label { color: var(--rw-text-secondary); font-size: var(--rw-body-xs-size); line-height: var(--rw-body-xs-lh); }
.ds-turn-user { justify-items: end; }
.ds-bubble { max-width: 85%; padding: var(--rw-space-2x) var(--rw-space-3x); border-radius: var(--rw-radius-lg); background: var(--rw-bg-hover); overflow-wrap: anywhere; white-space: pre-wrap; line-height: var(--rw-body-lg-lh); }
.ds-turn-note { font-size: var(--rw-body-sm-size); }
.ds-turn-actions { display: flex; gap: var(--rw-space-1x); margin-inline-start: calc(-1 * var(--rw-space-2x)); opacity: 0; }
.ds-turn-latest > .ds-turn-actions, .ds-turn:hover > .ds-turn-actions, .ds-turn:focus-within > .ds-turn-actions { opacity: 1; }
.ds-turn-sources { display: grid; gap: var(--rw-space-2x); }
.ds-turn > .ds-skeleton { padding: 0; }

.ds-tools { display: grid; gap: var(--rw-space-1x); font-size: var(--rw-body-sm-size); line-height: var(--rw-body-md-lh); }
.ds-tool { display: flex; justify-content: space-between; gap: var(--rw-space-3x); padding-inline-start: var(--rw-space-3x); border-inline-start: 2px solid var(--rw-divider); }
.ds-tool > :first-child { min-width: 0; overflow-wrap: anywhere; }
.ds-tool-running { border-inline-start-color: var(--rw-text-primary); }
.ds-tool-failed > .ds-secondary, .ds-tool-refused > .ds-secondary { color: var(--rw-text-danger); }

/* Reply markdown on the type scale: body-md paragraphs, headings at body-md in the heading
   weight, code in mono on the subtle ground. */
.ds-md { display: grid; gap: var(--rw-space-2x); min-width: 0; line-height: var(--rw-body-lg-lh); overflow-wrap: anywhere; }
.ds-md h4 { font-size: var(--rw-body-md-size); line-height: var(--rw-body-md-lh); }
.ds-md ul, .ds-md ol { display: grid; gap: var(--rw-space-1x); padding-inline-start: var(--rw-space-5x); }
.ds-md ul { list-style: disc; }
.ds-md ol { list-style: decimal; }
.ds-code { padding: 0 var(--rw-space-1x); border-radius: var(--rw-radius-sm); background: var(--rw-bg-muted); }
.ds-code-block { margin: 0; padding: var(--rw-space-2x) var(--rw-space-3x); border-radius: var(--rw-radius-md); background: var(--rw-bg-muted); overflow-x: auto; font-size: var(--rw-body-sm-size); line-height: var(--rw-body-md-lh); }
.ds-drawer .ds-code, .ds-drawer .ds-code-block, .ds-assistant .ds-code, .ds-assistant .ds-code-block { background: var(--rw-bg-muted); }

.ds-proposal-card { display: grid; gap: var(--rw-space-2x); padding: var(--rw-space-3x); }

/* A2UI surfaces: catalogue components drawn with the console's own parts. */
.ds-surface { min-width: 0; }
.ds-a2-column { display: grid; gap: var(--rw-space-3x); min-width: 0; }
.ds-a2-list { display: grid; border: 1px solid var(--rw-divider); border-radius: var(--rw-radius-lg); background: var(--rw-bg-content); overflow: hidden; }
.ds-a2-list > li + li { border-top: 1px solid var(--rw-divider); }
.ds-a2-open { display: flex; align-items: center; gap: var(--rw-space-3x); min-width: 0; padding: var(--rw-space-2x) var(--rw-space-3x); color: var(--rw-text-primary); font-weight: 400; text-decoration: none; }
a.ds-a2-open:hover { background-image: linear-gradient(var(--rw-bg-hover), var(--rw-bg-hover)); text-decoration: none; }
a.ds-a2-open:focus-visible { outline: dotted 1px var(--rw-focus-ring); outline-offset: -2px; }
.ds-a2-column > .ds-a2-open { border: 1px solid var(--rw-divider); border-radius: var(--rw-radius-lg); background: var(--rw-bg-content); }
.ds-a2-sub { color: var(--rw-text-secondary); font-size: var(--rw-body-xs-size); line-height: var(--rw-body-xs-lh); overflow-wrap: anywhere; }
.ds-a2-caption { color: var(--rw-text-secondary); font-size: var(--rw-body-xs-size); line-height: var(--rw-body-xs-lh); }
.ds-a2-facts { display: grid; gap: var(--rw-space-2x); }
.ds-a2-facts > h4 { font-size: var(--rw-body-md-size); line-height: var(--rw-body-md-lh); }
.ds-a2-table { display: grid; gap: var(--rw-space-2x); min-width: 0; }
.ds-a2-table .rw-table { font-size: var(--rw-body-sm-size); }
.ds-a2-table .rw-table th, .ds-a2-table .rw-table td { padding-inline: var(--rw-space-3x); }

/* Composer: pinned to the bottom, a rule above. */
.ds-composer { position: relative; display: grid; gap: var(--rw-space-2x); padding: var(--rw-space-4x); border-top: 1px solid var(--rw-divider); }
.ds-composer-row { display: flex; align-items: flex-end; gap: var(--rw-space-2x); }
.ds-composer-input { flex: 1; min-width: 0; min-height: var(--rw-space-11x); padding-block: var(--rw-space-3x); resize: none; line-height: var(--rw-body-md-lh); }
textarea.ds-composer-input { min-height: var(--rw-space-11x); }
.ds-context { display: flex; align-items: center; gap: var(--rw-space-1x); min-width: 0; }
.ds-context > .rw-badge { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; justify-content: flex-start; }
.ds-suggestions { display: grid; justify-items: start; margin-inline-start: calc(-1 * var(--rw-space-2x)); }
.ds-suggestions:empty { display: none; }
.ds-suggestions > .rw-btn { justify-content: flex-start; padding-inline: var(--rw-space-2x); color: var(--rw-text-brand); font-weight: 400; text-align: start; }
.ds-jump { position: absolute; inset-block-end: calc(100% + var(--rw-space-2x)); inset-inline: 0; display: flex; justify-content: center; pointer-events: none; }
.ds-jump > .rw-btn { pointer-events: auto; background-color: var(--rw-bg-content); box-shadow: var(--rw-shadow-sm); }

.ds-history { gap: var(--rw-space-3x); padding-inline: 0; }
.ds-history-title { padding-inline: var(--rw-space-4x); font-size: var(--rw-body-md-size); line-height: var(--rw-body-md-lh); }
.ds-history > .rw-banner, .ds-history > .ds-skeleton { margin-inline: var(--rw-space-4x); }
.ds-history-item { display: flex; align-items: center; }
.ds-history-item > .rw-nav-item { flex: 1; min-width: 0; height: auto; padding-block: var(--rw-space-2x); }
.ds-history-item > .rw-btn { margin-inline-end: var(--rw-space-2x); }
.ds-history-text { display: grid; gap: var(--rw-space-1x); min-width: 0; }
.ds-history-name { color: var(--rw-text-primary); overflow-wrap: anywhere; }
.ds-history-text > time { font-size: var(--rw-body-xs-size); }
