/* The composer: one rounded surface, floating over the foot of the
   conversation, with a hairline and the one soft shadow of what floats. */

.composer {
  position: relative;
  width: 100%;
  max-width: var(--composer-w, 820px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 10px 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  /* Not frosted glass: Qt WebEngine on Windows flickers whenever something
     with a backdrop blur is redrawn. Just clear enough that the words under
     it show faintly as they fade out (chat.css). */
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 1px 2px var(--shadow-soft), 0 10px 28px -10px var(--shadow-cast);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    transform var(--dur-slow) var(--ease-out), opacity var(--dur) var(--ease);
}
html.light .composer { border-color: var(--border); }
.composer:focus-within {
  border-color: color-mix(in srgb, var(--border-strong) 55%, var(--text3));
  box-shadow: 0 1px 2px var(--shadow-soft), 0 10px 28px -10px var(--shadow-cast);
}
.composer.disabled { opacity: 0.7; }
/* A file over it (attach.js): its ring is drawn just outside it (.drop-glow). */
.composer.dropping, html.light .composer.dropping {
  border-color: var(--accent);
  box-shadow: 0 14px 40px -12px var(--shadow-cast);
}

.composer .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.composer .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 3px 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--soft);
  font-size: 12.5px;
  color: var(--text2);
  max-width: 260px;
  animation: settle-in var(--dur) var(--ease-out) both;
}
.composer .chip .icon { width: 14px; height: 14px; }
.composer .chip .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer .chip .ibtn { width: 20px; height: 20px; border-radius: 50%; }
.composer .chip .ibtn .icon { width: 12px; height: 12px; }
.composer .chip.mention { color: var(--accent-ink); background: var(--accent-wash); border-color: transparent; }
.composer .chip.mention.model { color: var(--text2); background: var(--soft); }
.composer .chip.mention.chat { color: var(--chart-3); background: color-mix(in srgb, var(--chart-3) 12%, transparent); }

.composer .line { display: flex; align-items: flex-end; gap: 10px; }
.composer .line > .ibtn { margin-bottom: 2px; }

.composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 26px;
  max-height: 260px;
  margin: 0;
  padding: 4px 0 5px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans, var(--ui));
  font-size: 15.5px;
  line-height: 1.5;
  overflow-y: auto;
}
.composer textarea::placeholder { color: var(--text3); }
/* A suggested reply waits as the placeholder (chat/suggest.py), with the key
   that takes it beside the field. */
.suggest-take {
  flex: none; align-self: flex-start; margin-top: 5px; padding: 0; border: 0;
  background: transparent; cursor: pointer; opacity: 0.75;
  transition: opacity 0.12s ease;
}
.suggest-take:hover { opacity: 1; }
.suggest-take kbd { height: 18px; padding: 0 5px; font-size: 10.5px; }
.composer textarea:disabled { cursor: not-allowed; }

.send {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--soft-pressed);
  color: var(--text3);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    transform 180ms var(--ease-spring);
}
.send .icon { width: 16px; height: 16px; }
/* Something to send: the accent's flat fill, and one pop as it fills. */
.send.ready { background: var(--primary, var(--accent)); color: var(--primary-text, var(--accent-text)); }
.send.ready:hover { background: var(--primary-hover, var(--accent-hover)); }
.send.ready:active { transform: scale(0.92); transition-duration: 90ms; }
.send.pop { animation: send-pop 260ms var(--ease-spring); }
@keyframes send-pop { 0% { transform: scale(0.86); } 60% { transform: scale(1.06); } 100% { transform: none; } }
.send.stop { background: var(--text); color: var(--bg); }
.send.stop:hover { background: var(--text2); }
.send.stop .icon { width: 14px; height: 14px; }
.send.stop .icon svg rect, .send.stop .icon svg path { fill: currentColor; }

/* The send button's arrow: as small as a mark beside it, and as bright as
   the send button once there is something to send. It sits against Send,
   whose options it opens, well away from the microphone. */
.send-more {
  display: grid;
  place-items: center;
  width: 16px;
  height: 32px;
  flex: none;
  margin: 0 -8px 0 4px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text3);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.send-more .icon { width: 14px; height: 14px; }
.send-more.ready { color: var(--text2); }
.send-more:hover, .send-more.open { color: var(--text); background: var(--soft); }
.send-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.composer .tools {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  margin-left: -6px;
  /* How wide the row is, for Smart's capsule in a narrow window (below). */
  container: tools / inline-size;
}
.composer .tools .grow { flex: 1; min-width: 8px; }
.composer .tools .estimate { font-size: 11.5px; color: var(--text3); padding: 0 8px; white-space: nowrap; }
.composer .tools .estimate.over { color: var(--danger); font-weight: 560; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.composer .tools .pill.off .label { text-decoration: line-through; text-decoration-color: var(--text3); }
.composer .tools .model-pill { max-width: 260px; }
.composer .tools .model-pill .mark { width: 15px; height: 15px; color: var(--text2); display: inline-flex; }
.composer .tools .model-pill .mark svg { width: 100%; height: 100%; }
/* Manual mode, several models picked: how many more beside the one named. */
.composer .tools .model-pill .more { flex: none; font-size: 11.5px; font-weight: 600; color: var(--text3); }
/* Smart tunes this chat: its sparkle, in the accent's ink, before whatever answers. */
.composer .tools .model-pill.tuned .spark { color: var(--accent-ink); }

/* Smart's capsule, against Send (js/composer.js): in Smart mode the Manual
   button and the model; in Manual mode Smart's hollow sparkle, Search,
   Thinking and the model; thin lines between them and no frame round them. */
.composer .tools .tune {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  flex: 0 1 auto;
  min-width: 0;
  height: 28px;
  margin-left: 4px;
  border-radius: 999px;
  /* Clips a segment sliding in or out at the far end. */
  overflow: hidden;
}
.composer .tools .tune-seg {
  position: relative;
  flex: none;
  height: 28px;
  border: 0;
  border-radius: 999px;
}
.composer .tools .tune-seg:focus-visible { outline-offset: -2px; }
.composer .tools .tune-search,
.composer .tools .tune-think { padding: 0 10px; }
/* While the capsule slides they are only being seen to come or go: a click goes through them. */
.composer .tools .tune.sliding :is(.tune-search, .tune-think) { pointer-events: none; }
/* The thin lines between segments, short of the frame so it reads as one piece. */
.composer .tools .tune-seg:not(.tune-lead)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 1px;
  background: var(--border-strong);
  pointer-events: none;
}
/* The first segment, the button that switches the mode: unlit, its glyph
   Manual's in Smart mode and Smart's sparkle, hollow, in Manual mode. No
   frame is drawn round the capsule: each segment fills under the pointer,
   with thin lines between them. */
.composer .tools .tune-lead {
  display: grid;
  place-items: center;
  width: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text3);
  z-index: 1;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.composer .tools .tune-lead .lead-glyph { grid-area: 1 / 1; width: 15px; height: 15px; }
.composer .tools .tune.manual .lead-manual,
.composer .tools .tune:not(.manual) .lead-smart { opacity: 0; }
.composer .tools .tune-lead:hover { background: var(--soft); color: var(--text2); }
.composer .tools .tune-lead:active { background: var(--soft-hover); color: var(--text2); }
.composer .tools .tune-model {
  flex: 0 1 auto;
  min-width: 0;
  padding: 0 9px 0 10px;
}
/* The model's glyph, words and chevron, one row that can give way to a narrow capsule. */
.composer .tools .tune-model .face { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
/* A narrow row (the narrowest window): Search and Thinking keep their glyphs,
   lit as before, and their tips and names still say what they are, before
   the model's name is cut. */
@container tools (max-width: 600px) {
  .composer .tools .tune :is(.tune-search, .tune-think) { padding: 0 9px; }
  .composer .tools .tune :is(.tune-search, .tune-think) .label { display: none; }
}
.composer .tools .tag { margin: 0 4px; }
.composer .tools .tier { cursor: pointer; }
.composer .tools .tier:hover { filter: brightness(1.08); }
.composer .readonly .label { color: var(--accent-ink); }
/* How the agent works. Auto is the quiet default; the others say they are on. */
.composer .tools .mode-pill .label { transition: color var(--dur) var(--ease); }
.composer .tools .mode-pill.mode-own .icon { color: var(--accent-ink); }
.composer .tools .mode-pill.changed { animation: mode-changed 360ms var(--ease-spring); }
@keyframes mode-changed { 0% { transform: scale(0.94); } 60% { transform: scale(1.04); } 100% { transform: none; } }

/* The @ and / completions, rising out of the capsule's top edge. */
.completion {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(100% + 8px);
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--raised);
  box-shadow: var(--shadow-menu);
  animation: pop-in var(--dur) var(--ease-out) both;
  --pop-y: 4px;
}
.completion.below { top: calc(100% + 8px); bottom: auto; --pop-y: -4px; }
.completion .items { min-height: 0; overflow-y: auto; padding: 5px; }
.completion .item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.completion .item .value { font-family: var(--font-mono); font-size: 12.5px; color: var(--text); white-space: nowrap; }
.completion .item .desc { color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.completion .item.hot { background: var(--soft); }
.completion .item mark { background: transparent; color: var(--accent-ink); font-weight: 650; }
/* Chat's @: an assistant, a model or a chat, by name, with what it is on the right. */
.completion .item.mention { align-items: center; gap: 10px; }
.completion .item.mention .value { font-family: inherit; font-size: 13px; font-weight: 550; }
.completion .item.mention .desc { margin-left: auto; font-size: 12px; }

/* The one line beneath the capsule on an empty page: what the model is. */
.composer-note {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--text3);
}

/* An attached file under the message box (chat/tray.py). */
.composer .chip.file { cursor: pointer; transition: background var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out); }
.composer .chip.file:hover, .composer .chip.file:focus-visible { background: var(--soft-hover); color: var(--text); outline: none; }
.composer .chip.file:focus-visible { border-color: var(--accent); }
.composer .chip.file .thumb {
  width: 18px; height: 18px; margin-left: -3px; flex: none;
  border-radius: 5px; object-fit: cover; background: var(--surface);
}
.composer .chip.file .mark { width: 12px; height: 12px; flex: none; }
.composer .chip.file.convert .mark { color: var(--accent-ink); }
.composer .chip.file.danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.composer .chip.file.danger .mark { color: var(--danger); }

/* A file carried over the window (attach.js): the whole chat area lights up,
   and the message box with it, under a note that says a drop on the box puts
   the file into the text. Over the box the note sinks into it and goes, the
   box lights up fully, and a caret shows where the file will go. Each part is
   drawn once and only fades, grows and moves (transform and opacity); the
   breathing and the arrow's bob run only while a file is carried. */
.drop-outline {
  position: absolute; inset: 10px; z-index: 900;
  border: 2px solid color-mix(in srgb, var(--accent) 85%, transparent); border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--accent) 10%, transparent),
    inset 0 0 90px color-mix(in srgb, var(--accent) 14%, transparent);
  opacity: 0; visibility: hidden; pointer-events: none; transform: scale(0.985);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur-slow) var(--ease-out), visibility var(--dur);
}
body.dragging-files .drop-outline { opacity: 1; visibility: visible; transform: none; }
body.dragging-files iframe { pointer-events: none; }
/* The message box stays above the outline, so a drop on it lands in the text. */
body.dragging-files #dock { z-index: 901; }
/* What takes no file (the sidebar, the bar along the top, and the editor,
   design and panels beside the chat) is softened and dimmed while one is
   carried, and a drop there does nothing (attach.js). The blur goes on and
   off at once, as under a dialog, and only the veil over it fades. */
:is(#sidebar, #header, #editor, #design, #workbench)::after {
  content: ""; position: absolute; inset: 0; z-index: 950;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--dur) var(--ease-out), visibility var(--dur);
}
body.dragging-files :is(#sidebar, #header, #editor, #design, #workbench)::after { opacity: 1; visibility: visible; }
html:not(.no-window-blur) body.dragging-files :is(#sidebar, #header, #editor, #design, #workbench) { filter: blur(2px); }

/* The box's own light: a ring 6px outside it on every side, that breathes
   while a file is carried and holds still, full, once the file is over the
   box. It breathes by opacity alone: a scale of a box this wide and this
   short would move its sides several times further out than its top. */
.drop-glow {
  position: absolute; inset: -6px; z-index: 3;
  border: 2px solid var(--accent); border-radius: calc(var(--radius-xl) + 6px);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent), 0 0 28px color-mix(in srgb, var(--accent) 30%, transparent);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--dur) var(--ease-out), visibility var(--dur);
}
body.dragging-files .drop-glow { opacity: 0.7; visibility: visible; animation: drop-breathe 1.2s var(--ease) infinite alternate; }
body.dragging-files .composer.dropping .drop-glow { opacity: 1; animation: none; }
@keyframes drop-breathe { from { opacity: 0.45; } to { opacity: 0.9; } }

/* The note over the box, with an arrow down to it. */
.drop-hint {
  position: absolute; left: 50%; bottom: calc(100% + 16px); z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: max-content; max-width: 100%;
  opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, 12px) scale(0.96);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur-slow) var(--ease-out), visibility var(--dur);
}
body.dragging-files .drop-hint { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 60ms; }
body.dragging-files .composer.dropping:not(.drop-anywhere) .drop-hint {
  opacity: 0; visibility: hidden; transform: translate(-50%, 18px) scale(0.92); transition-delay: 0ms;
}
.drop-hint .dh-card {
  display: flex; align-items: center; gap: 11px; padding: 10px 18px 10px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border)); border-radius: 14px;
  background: var(--card); color: var(--text);
  box-shadow: 0 1px 2px var(--shadow-soft), 0 14px 36px -12px var(--shadow-cast);
}
.drop-hint .dh-icon {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px;
  border-radius: 10px; background: var(--accent-wash); color: var(--accent-ink);
}
.drop-hint .dh-icon .icon { width: 18px; height: 18px; }
.drop-hint .dh-words { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.drop-hint .dh-title { font-size: 13.5px; font-weight: 600; }
.drop-hint .dh-text { font-size: 12.5px; color: var(--text2); }
.drop-hint .dh-arrow { display: grid; place-items: center; color: var(--accent); }
.drop-hint .dh-arrow .icon { width: 18px; height: 18px; }
body.dragging-files .drop-hint .dh-arrow { animation: drop-bob 0.8s var(--ease) infinite alternate; }
.composer.drop-anywhere .drop-hint .dh-arrow { display: none; }
/* On the New Chat page the box stands in the middle, under the greeting: the
   note sits under the box instead, its arrow pointing up to it. */
#app:is(.fresh, .blank)[data-view="chat"] .drop-hint { bottom: auto; top: calc(100% + 16px); flex-direction: column-reverse; }
#app:is(.fresh, .blank)[data-view="chat"] .drop-hint .dh-arrow .icon { transform: rotate(180deg); }
body.dragging-files #app:is(.fresh, .blank)[data-view="chat"] .composer.dropping:not(.drop-anywhere) .drop-hint {
  transform: translate(-50%, -18px) scale(0.92);
}
@keyframes drop-bob { from { transform: translateY(-2px); } to { transform: translateY(4px); } }
html.reduced-motion body.dragging-files :is(.drop-glow, .drop-hint .dh-arrow) { animation: none; }

/* Dictation: the microphone beside Send. Listening, it turns red and a ring
   swells with the voice it hears; writing out, it spins quietly. */
.composer .line > .ibtn.mic { position: relative; margin-right: -4px; }
.composer .ibtn.mic .mic-ring {
  position: absolute; inset: 3px; border-radius: 50%; pointer-events: none;
  background: color-mix(in srgb, var(--danger) 22%, transparent);
  transform: scale(calc(0.7 + var(--level, 0) * 0.7)); opacity: 0;
  transition: transform 180ms var(--ease-out), opacity var(--dur-fast) var(--ease);
}
.composer .ibtn.mic.recording { color: var(--danger); }
.composer .ibtn.mic.recording .mic-ring { opacity: 1; }
.composer .ibtn.mic.recording .icon { position: relative; animation: mic-breathe 1.6s ease-in-out infinite; }
.composer .ibtn.mic.writing .icon { animation: mic-think 1.1s ease-in-out infinite; }
@keyframes mic-breathe { 50% { transform: scale(1.08); } }
@keyframes mic-think { 50% { opacity: 0.35; } }
.composer .mic-clock {
  align-self: center; margin-bottom: 2px; font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--danger); animation: fade-in var(--dur) var(--ease-out);
}
.composer.listening { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
/* A draft being read to plan its reply: a small dot beside the microphone
   that fades in and out, hidden (and still) the rest of the time. */
.composer .read-mark {
  align-self: center; flex: none; width: 6px; height: 6px; margin: 0 8px 2px 4px; border-radius: 50%;
  background: var(--accent); animation: read-pulse 1.4s ease-in-out infinite;
}
.composer .read-mark[hidden] { display: none; }
@keyframes read-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

.drop-caret {
  position: absolute; left: 0; top: 0; z-index: 2; width: 2px; height: 22px;
  border-radius: 1px; background: var(--accent); pointer-events: none;
  opacity: 0; transition: opacity var(--dur-fast, 120ms) var(--ease);
}
.drop-caret.on { opacity: 1; animation: drop-caret 1s steps(1) infinite; }
@keyframes drop-caret { 50% { opacity: 0.25; } }
.drop-mirror {
  position: fixed; z-index: 2147483647; opacity: 0; pointer-events: none;
  white-space: pre-wrap; overflow-wrap: break-word; overflow: hidden;
}

/* Files dropped into the text (attach.js): while the text holds one, the
   textarea's own letters are clear and the copy behind it draws them, each
   file as its icon and name. Nothing here may change a letter's width. */
.composer .composer-field { position: relative; display: flex; flex: 1; min-width: 0; }
.composer .composer-field textarea { position: relative; z-index: 1; }
.refs-backdrop {
  position: absolute; left: 0; top: 0; bottom: 0; right: 0;
  display: none; overflow: hidden; pointer-events: none;
  padding: 4px 0 5px; color: var(--text);
  font-family: var(--font-sans, var(--ui)); font-size: 15.5px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: break-word;
}
.composer.with-refs .refs-backdrop { display: block; }
.composer.with-refs textarea { color: transparent; caret-color: var(--text); }
.composer.with-refs textarea::selection { color: transparent; background: color-mix(in srgb, var(--accent) 30%, transparent); }
/* A little box: the shadows draw its padding and border without taking any
   room, so the letters stay where the textarea has them. */
.refs-backdrop .ref {
  border-radius: 5px; background: var(--card); color: var(--text2);
  box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--border-strong);
}
.refs-backdrop .ref.missing {
  background: transparent; box-shadow: 0 0 0 2px transparent, 0 0 0 3px var(--border); color: var(--text3);
  text-decoration: line-through;
}
.refs-backdrop .ref-icon { position: relative; }
.refs-backdrop .ref-icon .icon {
  position: absolute; left: 50%; top: 50%; width: 14px; height: 14px;
  transform: translate(-55%, -50%);
}
.refs-backdrop .ref-icon .icon svg { display: block; width: 100%; height: 100%; }

/* Preview of an attached file (dialogs.js file_preview): the file, how the
   model gets it, and the words it reads. */
.preview-dialog .dialog-body { gap: 14px; }
.preview-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.preview-thumb, .preview-kind {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.preview-thumb { object-fit: cover; background: var(--surface); }
.preview-kind { display: grid; place-items: center; background: var(--surface); color: var(--text2); }
.preview-kind svg { width: 22px; height: 22px; }
.preview-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.preview-name .title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 560;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-name .sub { color: var(--text3); font-size: var(--ui-small); }
.preview-how {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-wash);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
.preview-how svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--accent-ink); }
.preview-how.failed { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.preview-how.failed svg { color: var(--danger); }
.preview-label { margin-bottom: -6px; color: var(--text3); font-size: var(--ui-meta); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.preview-text {
  max-height: 300px;
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text2);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.preview-text.empty { color: var(--text3); font-style: italic; }
.preview-picture {
  display: block;
  max-width: 100%;
  max-height: 320px;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
