/* Redesign preview: chat. Every rule scoped under .kairos-redesign.
   redesignChat.js (desktop only, switch on) moves the model picker into the
   composer and dresses the conversations button; phones and the switch-off
   state keep the layout in interface.css untouched. */

@media (min-width: 769px) {
  .rd-conversation-menu {
    position: fixed; z-index: 10010; box-sizing: border-box; width: 240px; max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px); overflow-y: auto; padding: 6px;
    border: 1px solid var(--rd-line, var(--border)); border-radius: 16px;
    background: var(--rd-surface-solid, var(--bg-panel-solid)); color: var(--rd-ink, var(--text));
    box-shadow: var(--rd-shadow, var(--shadow-elevated));
  }
  .rd-conversation-menu-item {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px;
    border: 0; border-radius: 10px; background: transparent; color: inherit; text-align: left;
    font: 13px var(--rd-font-ui, sans-serif); cursor: pointer;
  }
  .rd-conversation-menu-item:is(:hover, :focus-visible) { background: var(--rd-surface-2, var(--bg-hover)); outline: 2px solid var(--rd-focus, var(--accent)); outline-offset: -2px; }
  .rd-conversation-menu-item.danger { color: var(--danger); }
  .rd-conversation-menu-icon { display: inline-flex; justify-content: center; width: 18px; font-size: 18px; }
  /* -- Conversations button ------------------------------------------------- */
  .kairos-redesign .chat-mobile-header.rd-chat-header { align-items: center; gap: 14px; }
  .kairos-redesign .rd-chat-header #chat-history-toggle {
    flex: none; width: auto; max-width: 260px; height: 44px; padding: 0 14px 0 14px; gap: 9px;
    border: 1px solid var(--rd-line-strong); border-radius: var(--rd-radius-pill);
    background: var(--rd-surface-solid); box-shadow: var(--rd-shadow);
    color: var(--rd-ink); font-family: var(--rd-font-ui); font-size: 13.5px; font-weight: 500;
    cursor: pointer; transition: background .16s ease, color .16s ease, border-color .16s ease;
  }
  .kairos-redesign .rd-chat-header #chat-history-toggle:hover { background: var(--rd-surface-2); border-color: var(--rd-ink-faint); }
  .kairos-redesign .rd-chat-header #chat-history-toggle:focus-visible { outline: 2px solid var(--rd-focus); outline-offset: 2px; }
  .kairos-redesign .rd-chat-header #chat-history-toggle :is(.conversation-mark, .conversation-copy) { display: none; }
  .kairos-redesign .rd-conv-icon { display: inline-flex; flex: none; color: currentColor; }
  .kairos-redesign .rd-conv-label { flex: none; white-space: nowrap; }
  .kairos-redesign .rd-conv-count {
    flex: none; min-width: 22px; height: 22px; padding: 0 7px; display: inline-grid; place-items: center;
    border-radius: var(--rd-radius-pill); font-size: 11px; font-weight: 600; line-height: 1;
    background: color-mix(in srgb, var(--rd-ink) 10%, transparent); color: var(--rd-ink-dim);
  }
  .kairos-redesign .rd-conv-count[hidden] { display: none; }
  .kairos-redesign .rd-chat-header #chat-history-toggle > svg:last-child {
    width: 10px; height: 10px; color: var(--rd-ink-faint); transition: transform .2s ease;
  }
  /* Open: the pill turns to the dark primary, and the chevron flips. */
  .kairos-redesign .rd-chat-header #chat-history-toggle[aria-expanded="true"] {
    background: var(--rd-primary-bg); color: var(--rd-primary-fg); border-color: transparent;
  }
  .kairos-redesign .rd-chat-header #chat-history-toggle[aria-expanded="true"]:hover { background: var(--rd-primary-hover); }
  .kairos-redesign .rd-chat-header #chat-history-toggle[aria-expanded="true"] .rd-conv-count {
    background: color-mix(in srgb, var(--rd-primary-fg) 22%, transparent); color: var(--rd-primary-fg);
  }
  .kairos-redesign .rd-chat-header #chat-history-toggle[aria-expanded="true"] > svg:last-child {
    transform: rotate(90deg); color: var(--rd-primary-fg);
  }
  .kairos-redesign .rd-chat-header #chat-history-toggle[aria-expanded="false"] > svg:last-child { transform: rotate(-90deg); }
  /* The chat's own title, now beside the button instead of inside it. */
  .kairos-redesign .rd-chat-title {
    flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    font-family: var(--rd-font-title); font-style: italic; font-size: 24px; line-height: 1.2; color: var(--rd-ink);
  }
  /* The goo morph clones the button; give the clone the same shape. */
  .kairos-redesign .chat-history-goo-title {
    height: 44px; padding: 0 14px; gap: 9px; font-family: var(--rd-font-ui); font-size: 13.5px; font-weight: 500;
  }
  .kairos-redesign .chat-history-goo-title :is(.conversation-mark, .conversation-copy) { display: none; }
  .kairos-redesign .chat-history-goo-title .rd-conv-count { background: color-mix(in srgb, var(--rd-ink) 10%, transparent); }

  /* -- Model picker in the prompt bar --------------------------------------- */
  .kairos-redesign .chat-input-right { align-items: center; gap: 8px; }
  .kairos-redesign .chat-header-model.model-pill.rd-in-composer {
    flex: 0 1 auto; height: 40px; max-width: 250px; min-width: 0;
    border: 1px solid var(--rd-line-strong); border-radius: var(--rd-radius-pill);
    background: color-mix(in srgb, var(--rd-ink) 5%, transparent); box-shadow: none;
  }
  .kairos-redesign .rd-in-composer .model-picker-wrap { height: 100%; }
  .kairos-redesign .rd-in-composer .model-picker-btn {
    height: 100%; min-height: 0; padding: 0 12px; font-family: var(--rd-font-ui); font-size: 12.5px; font-weight: 500; color: var(--rd-ink);
    border-radius: var(--rd-radius-pill); background: transparent;
  }
  .kairos-redesign .rd-in-composer .model-picker-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--rd-ink) 8%, transparent); }
  .kairos-redesign .rd-in-composer .model-picker-btn:focus-visible { outline: 2px solid var(--rd-focus); outline-offset: 2px; }
  .kairos-redesign .rd-in-composer .model-picker-btn:disabled { opacity: .55; }
  .kairos-redesign .rd-in-composer .model-picker-menu {
    z-index: 90; border: 1px solid var(--rd-line-strong);
    background: var(--rd-surface-solid); box-shadow: var(--rd-shadow);
  }
}

/* -- Phone polish: a 44px floor for the controls under a message and in the drawer ------------ */
@media (max-width: 768px) {
  .kairos-redesign .msg-actions .msg-action-btn { min-height: 44px; min-width: 44px; }
  .kairos-redesign .chat-code-header button { min-height: 44px; padding-inline: 10px; }
  .kairos-redesign .model-picker-btn { min-height: 44px; }
  .kairos-redesign :is(#chat-main, #model-picker-menu) summary { padding-block: 11px; }
}

/* -- Page and slide thumbnails (PDF, PPTX): a page is a rectangle ------------------------------
   The thumbnails are .btn buttons, and the redesign's pill radius on .btn out-ranks
   .artifact-thumbnail, so the selected-page outline (which follows the border radius)
   turned into an oval around a portrait or landscape page. Keep the small radius. */
.kairos-redesign .btn.artifact-thumbnail { border-radius: 8px; }
.kairos-redesign .btn.artifact-thumbnail.active { outline-offset: -2px; }
.kairos-redesign .btn.artifact-thumbnail:focus-visible { outline-offset: -2px; }

/* Round two. These surfaces sit above the existing figure/sky backdrop. */
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) :is(.rd-chat-panel-title, .rd-chat-recent, .rd-chat-working h2) {
  font-family: var(--rd-font-title); font-style: italic; font-weight: 500; color: var(--rd-ink); line-height: 1.1;
}
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .rd-chat-panel-title { font-size: 30px; margin: 4px 0 16px; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) :is(.rd-chat-recent, .rd-chat-working h2) { font-size: 26px; margin: 16px 0 12px; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .rd-chat-search {
  width: 100%; min-height: 48px; padding-inline: 18px; border-radius: var(--rd-radius-pill); background: var(--rd-surface-solid); border: 1px solid var(--rd-line-strong);
}
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) #sessions-list { padding: 2px 12px; border: 1px solid var(--rd-line); border-radius: var(--rd-radius-card); background: var(--rd-surface-solid); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) #sessions-list .session-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 70px; margin: 0; padding: 12px 0;
  border: 0; border-bottom: 1px solid var(--rd-line); border-radius: 0; background: transparent; color: var(--rd-ink); text-align: left;
}
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) #sessions-list .session-item[hidden] { display: none; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) #sessions-list .session-item:last-child { border-bottom: 0; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) #sessions-list .session-item:is(:hover, .active) { background: var(--rd-surface-2); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .rd-chat-initial {
  flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--rd-radius-field);
  background: var(--rd-surface-2); color: var(--rd-ink); font: italic 600 22px var(--rd-font-title);
}
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .rd-chat-row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 14px var(--rd-font-ui); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .rd-chat-row-age { flex: none; color: var(--rd-ink-dim); font-size: 12px; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .rd-chat-working-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .rd-chat-working-row button {
  display: flex; flex: 0 0 64px; flex-direction: column; align-items: center; gap: 6px; min-height: 44px; width: 64px; padding: 4px;
  border: 0; background: transparent; color: var(--rd-ink-dim); font: 12px var(--rd-font-ui); cursor: pointer;
}
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .rd-chat-working-row button span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .rd-chat-working-row button:focus-visible { outline: 2px solid var(--rd-focus); outline-offset: 2px; border-radius: var(--rd-radius-field); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .rd-chat-working-row kairos-mascot { border: 1px solid var(--rd-line); border-radius: var(--rd-radius-pill); background: var(--rd-surface-solid); padding: 6px; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .rd-chat-idle[hidden] { display: none; }
.rd-chat-idle-layout { display: contents; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .rd-chat-idle { flex: 0 0 auto; margin: auto auto 0; padding: 24px; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .rd-chat-idle h2 { font-size: 32px; margin-top: 14px; margin-bottom: 8px; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) #chat-main.is-empty .chat-composer-dock { margin-block: 18px auto; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]):not([data-chat-style=terminal]) .chat-input-bar {
  border-color: var(--rd-line-strong); border-radius: var(--rd-radius-card); background: var(--rd-surface-solid); box-shadow: var(--rd-shadow);
}
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]):not([data-chat-style=terminal]) #chat-input { background: transparent; border: 0; border-radius: 0; box-shadow: none; color: var(--rd-ink); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]):not([data-chat-style=terminal]) #overflow-plus-btn { background: var(--rd-surface-2); color: var(--rd-ink); border-color: var(--rd-line); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]):not([data-chat-style=terminal]) .chat-header-model { background: var(--rd-surface-2); border-color: var(--rd-line); border-radius: var(--rd-radius-pill); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]):not([data-chat-style=terminal]) #chat-messages .msg.user .msg-body {
  background: var(--rd-primary-bg); color: var(--rd-primary-fg); border-color: var(--rd-primary-bg); border-radius: 22px 22px 6px 22px; padding: 13px 16px;
}
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]):not([data-chat-style=terminal]) #chat-messages .msg.user .msg-body :is(a, code) { color: inherit; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]):not([data-chat-style=terminal]) #chat-messages .chat-prose { font: 15px/1.65 var(--rd-font-ui); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]):not([data-chat-style=terminal]) .chat-activity { border: 1px solid var(--rd-line); border-radius: var(--rd-radius-pill); background: var(--rd-surface); color: var(--rd-ink-dim); }
/* A pill radius on the tall open card bends it into a circle; open, it is a card. */
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]):not([data-chat-style=terminal]) .chat-activity[open] { border-radius: var(--rd-radius-card); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) :is(.bg-tasks-pill, .bg-tasks-panel, .bg-task-row, .question-card) { background: var(--rd-surface-solid); border-color: var(--rd-line-strong); box-shadow: var(--rd-shadow); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .bg-tasks-pill { margin: 0 auto 8px; border-radius: var(--rd-radius-pill); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) :is(.bg-tasks-panel, .question-card) { border-radius: var(--rd-radius-card); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) :is(.bg-task-row, .question-option) { border-radius: 18px; border-color: var(--rd-line); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) :is(.bg-tasks-heading, .question-head h2) { font: italic 500 26px/1.15 var(--rd-font-title); }
/* The existing document pane owns its geometry, focus and scroll restoration. */
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-panel { background: var(--rd-surface-solid); border-color: var(--rd-line); box-shadow: var(--rd-shadow); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) :is(.artifact-header, .artifact-toolbar, .artifact-pane-top) { border-color: var(--rd-line); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-header h2 { font: italic 500 24px/1.15 var(--rd-font-title); color: var(--rd-ink); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-tabs { gap: 6px; padding: 10px 12px; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-tab { border: 1px solid var(--rd-line); border-radius: var(--rd-radius-pill); background: var(--rd-surface-2); overflow: hidden; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-tab.active { background: var(--rd-primary-bg); box-shadow: none; }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-tab.active :is(.artifact-tab-label, .artifact-tab-close) { color: var(--rd-primary-fg); }
.kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-preview { background: var(--rd-surface-2); color: var(--rd-ink); }
@media (min-width: 769px) {
  /* Only the composer contributes height to the centered desktop layout. */
  .kairos-redesign[data-view=chat] #chat-main.is-empty .rd-chat-idle-layout {
    display: block; position: relative; z-index: 4; width: 100%; margin-block: auto;
  }
  .kairos-redesign[data-view=chat] #chat-main.is-empty .rd-chat-idle {
    position: absolute; bottom: calc(100% + 18px); left: 0; width: 100%; margin: 0; box-sizing: border-box;
  }
  .kairos-redesign[data-view=chat] #chat-main.is-empty .chat-composer-dock { margin-block: 0; }
  .kairos-redesign[data-view=chat] #chat-sessions { position: relative; }
  .kairos-redesign[data-view=chat] .rd-chat-panel-title { padding-right: 54px; }
  .kairos-redesign[data-view=chat] #chat-sessions > .chat-new-btn {
    position: absolute; top: 12px; right: 12px; min-width: 46px; width: 46px; height: 46px; padding: 0; gap: 0;
    border-radius: var(--rd-radius-pill); font-size: 0; background: var(--rd-surface-solid); border-color: var(--rd-line-strong);
  }
  .kairos-redesign[data-view=chat] #chat-sessions > .chat-new-btn svg { width: 20px; height: 20px; }
}
@media (max-width: 768px) {
  .kairos-redesign[data-view=mobileLaunch] .rd-chats-header { padding-inline: 20px; padding-bottom: 16px; }
  .kairos-redesign[data-view=mobileLaunch] .rd-chats-header .ms-header-row { display: flex; justify-content: space-between; height: auto; margin-bottom: 18px; }
  .kairos-redesign[data-view=mobileLaunch] .rd-chats-header h1 { margin: 0; font: italic 600 40px/1 var(--rd-font-title); }
  .kairos-redesign[data-view=mobileLaunch] .rd-chat-header-actions { display: flex; gap: 8px; }
  .kairos-redesign[data-view=mobileLaunch] .rd-chat-round { width: 46px; height: 46px; padding: 0; border: 1px solid var(--rd-line-strong); border-radius: var(--rd-radius-pill); background: var(--rd-surface-solid); color: var(--rd-ink); font-size: 22px; }
  .kairos-redesign[data-view=mobileLaunch] .rd-chats-header > .ms-switch {
    display: flex; width: 100%; height: 52px; box-sizing: border-box; padding: 4px;
    border: 0; border-radius: var(--rd-radius-pill); background: var(--rd-surface-2);
    box-shadow: inset 0 1px 3px color-mix(in srgb, var(--rd-ink) 10%, transparent);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .kairos-redesign[data-view=mobileLaunch] .rd-chats-header .ms-switch-thumb {
    inset: 4px auto 4px 4px; width: calc(50% - 4px); background: var(--rd-surface-solid);
    box-shadow: var(--rd-shadow); transition: transform var(--rd-dur-tab) var(--rd-ease);
  }
  .kairos-redesign[data-view=mobileLaunch] .rd-chats-header .ms-segment {
    min-height: 44px; margin: 0; border-radius: var(--rd-radius-pill);
    color: var(--rd-ink-dim); font: 500 15px var(--rd-font-ui);
  }
  .kairos-redesign[data-view=mobileLaunch] .rd-chats-header .ms-segment[aria-selected=true] { color: var(--rd-ink); }
  .kairos-redesign[data-view=mobileLaunch] .rd-chats-header .ms-segment:focus-visible { outline: 2px solid var(--rd-focus); outline-offset: -2px; }
  .kairos-redesign[data-view=mobileLaunch] .ms-dragging .ms-switch-thumb { transition: none; }
  @media (prefers-reduced-motion: reduce) {
    .kairos-redesign[data-view=mobileLaunch] .rd-chats-header .ms-switch-thumb { transition: none; }
  }
  .kairos-redesign[data-view=mobileLaunch] .ms-intro { min-height: 0; overflow-y: auto; gap: 14px; padding: 20px 20px 24px; }
  .kairos-redesign[data-view=mobileLaunch] .ms-launch-bottom { flex-shrink: 0; }
  /* The board has no blur band: it painted a hard-edged rectangle behind the rounded prompt. */
  .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-bottom > .ms-blur-bottom { display: none; }
  @media (max-height: 480px) {
    .kairos-redesign[data-view=mobileLaunch] .ms-intro { flex-basis: 0; padding-block: 0; overflow: hidden; }
  }
  .kairos-redesign[data-view=mobileLaunch] .ms-intro h2 { font-size: 32px; margin: 0; }
  .kairos-redesign[data-view=mobileLaunch] .ms-intro p { font-size: 14px; margin: 0; }
  .kairos-redesign[data-view=mobileLaunch] .ms-context { display: none; }
  .kairos-redesign[data-view=mobileLaunch] .ms-context:has(select:not([hidden])) { display: block; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-dragging) .ms-page-track { transition: transform var(--rd-dur-tab) var(--rd-ease); }
  .kairos-redesign[data-view=mobileLaunch] .ms-history-search { order: -1; flex-shrink: 0; margin: 4px 0 0; border-radius: var(--rd-radius-pill); background: var(--rd-surface-solid); }
  .kairos-redesign[data-view=mobileLaunch] .ms-history-filters { bottom: auto; top: calc(100% + 8px); z-index: 5; }
  .kairos-redesign[data-view=mobileLaunch] .ms-history-list { flex: 1; min-height: 0; border-radius: var(--rd-radius-card); }
  .kairos-redesign[data-view=mobileLaunch] .ms-history-main { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px 12px; min-height: 80px; padding: 13px 48px 13px 16px; }
  .kairos-redesign[data-view=mobileLaunch] .ms-history-main .rd-chat-initial { grid-column: 1; grid-row: 1 / 3; }
  .kairos-redesign[data-view=mobileLaunch] .ms-history-main strong { grid-column: 2; font-size: 15px; font-weight: 500; }
  .kairos-redesign[data-view=mobileLaunch] .ms-history-main small { grid-column: 2; grid-row: 2; }
  .kairos-redesign[data-view=mobileLaunch] .ms-history-age { grid-column: 3; grid-row: 1; font-size: 12px; }
  /* Phone composers retain the shared resting pill and expand on focus. */
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-chat-heading strong { font: italic 500 24px/1.1 var(--rd-font-title); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-panel { border-radius: 32px 32px 0 0; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .chat-question-host .question-card { border-radius: 32px 32px 0 0; padding: 16px; }
}
/* Desktop conversation history. The controller retains row and project actions. */
@media (min-width: 769px) {
  .kairos-redesign[data-view="chat"] #chat-sessions {
    position: relative; display: flex; flex-direction: column; gap: 12px; box-sizing: border-box;
    width: 320px; padding: 20px 14px 16px; overflow: hidden;
    background: color-mix(in srgb, var(--rd-surface-2) 55%, var(--rd-surface-solid));
    border-right: 1px solid var(--rd-line); border-radius: 0;
  }
  .kairos-redesign[data-view="chat"] .chat-history-collapsed #chat-sessions {
    width: 0; padding-inline: 0; border-right-width: 0;
  }
  .kairos-redesign[data-view="chat"] #chat-sessions > * { min-width: 0; }
  .kairos-redesign[data-view="chat"] .rd-conversations-header { display: flex; align-items: center; gap: 8px; flex: none; padding-inline: 4px; }
  .kairos-redesign[data-view="chat"] .rd-conversations-header h2 { flex: 1; min-width: 0; margin: 0; font: italic 600 28px/1 var(--rd-font-title); color: var(--rd-ink); }
  .kairos-redesign[data-view="chat"] .rd-conversations-header :is(.chat-new-btn, .rd-conversations-close) {
    position: static; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 38px;
    width: 38px; min-width: 38px; height: 38px; min-height: 38px; margin: 0; padding: 0; gap: 0;
    border: 1px solid var(--rd-line-strong); border-radius: var(--rd-radius-pill);
    background: var(--rd-surface-solid); color: var(--rd-ink); cursor: pointer; font-size: 24px;
  }
  .kairos-redesign[data-view="chat"] .rd-conversations-header .chat-new-btn { font-size: 0; }
  .kairos-redesign[data-view="chat"] .rd-conversations-header .chat-new-btn svg { width: 16px; height: 16px; }
  .kairos-redesign[data-view="chat"] .rd-conversations-search { display: flex; align-items: center; gap: 8px; flex: none; height: 40px; padding: 0 12px; border-radius: var(--rd-radius-pill); background: var(--rd-surface-solid); border: 1px solid var(--rd-line-strong); }
  .kairos-redesign[data-view="chat"] .rd-conversations-search .rd-chat-search { flex: 1; min-width: 0; width: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--rd-ink); font: 13px var(--rd-font-ui); }
  .kairos-redesign[data-view="chat"] .rd-conversations-search kbd { flex: none; padding: 2px 6px; border: 1px solid var(--rd-line); border-radius: 6px; color: var(--rd-ink-dim); font: 10px var(--rd-font-ui); }
  .kairos-redesign[data-view="chat"] .rd-conversations-filters { display: flex; flex: none; gap: 2px; overflow-x: auto; padding: 3px; border-radius: var(--rd-radius-pill); background: var(--rd-surface-2); }
  .kairos-redesign[data-view="chat"] .rd-conversations-filters button { flex: 1 0 auto; min-height: 30px; padding: 0 10px; border: 0; border-radius: var(--rd-radius-pill); background: transparent; color: var(--rd-ink-dim); font: 12px var(--rd-font-ui); cursor: pointer; }
  .kairos-redesign[data-view="chat"] .rd-conversations-filters button[aria-pressed="true"] { background: var(--rd-surface-solid); color: var(--rd-ink); box-shadow: var(--rd-shadow); }
  .kairos-redesign[data-view="chat"] #chat-sessions .project-picker-wrap { order: 3; flex: none; min-height: 28px; margin: 0; padding: 0; border: 0; font-size: 12px; }
  .kairos-redesign[data-view="chat"] #chat-sessions .project-picker-wrap .overflow-menu.below { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; min-width: 0; max-height: min(360px, 50vh); overflow-y: auto; }
  .kairos-redesign[data-view="chat"] #chat-sessions #project-picker-btn { font-size: 12px; min-height: 28px; }
  .kairos-redesign[data-view="chat"] #sessions-list { flex: 1; min-height: 0; overflow-y: auto; padding: 2px; border: 0; border-radius: 0; background: transparent; }
  .kairos-redesign[data-view="chat"] .rd-conversations-group { margin: 0; padding: 10px 10px 4px; font: 500 10px var(--rd-font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--rd-ink-dim); }
  .kairos-redesign[data-view="chat"] #sessions-list .session-item {
    position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin: 2px 0; padding: 9px 10px;
    border: 1px solid transparent; border-radius: 14px; background: transparent; color: var(--rd-ink); text-align: left;
  }
  .kairos-redesign[data-view="chat"] #sessions-list .session-item:hover { background: var(--rd-surface); }
  .kairos-redesign[data-view="chat"] #sessions-list .session-item:last-child { border-bottom: 1px solid transparent; }
  .kairos-redesign[data-view="chat"] #sessions-list .session-item.active { background: var(--rd-surface-solid); border-color: var(--rd-line-strong); box-shadow: var(--rd-shadow); }
  .kairos-redesign[data-view="chat"] .rd-conversation-state { display: grid; place-items: center; flex: 0 0 8px; width: 8px; height: 8px; border-radius: var(--rd-radius-pill); background: var(--rd-line-strong); }
  .kairos-redesign[data-view="chat"] .rd-conversation-state.is-finished { background: var(--success); }
  .kairos-redesign[data-view="chat"] .session-item.active .rd-conversation-state { background: var(--rd-ink); }
  .kairos-redesign[data-view="chat"] .rd-conversation-state:has(kairos-mascot) { flex-basis: 28px; width: 28px; height: 28px; background: transparent; }
  .kairos-redesign[data-view="chat"] .rd-conversation-copy { flex: 1; min-width: 0; }
  .kairos-redesign[data-view="chat"] .rd-chat-row-title { display: block; font: 500 14px var(--rd-font-ui); }
  .kairos-redesign[data-view="chat"] .rd-conversation-detail { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 2px; color: var(--rd-ink-dim); font: 12px var(--rd-font-ui); }
  .kairos-redesign[data-view="chat"] .rd-conversation-detail > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kairos-redesign[data-view="chat"] .rd-conversation-tag { flex: none; padding: 1px 7px; border: 1px solid var(--rd-line-strong); border-radius: var(--rd-radius-pill); font-size: 10px; }
  .kairos-redesign[data-view="chat"] .rd-chat-row-age { align-self: flex-start; margin-top: 2px; font: 11px var(--rd-font-ui); color: var(--rd-ink-dim); }
  .kairos-redesign[data-view="chat"] .rd-conversation-actions { position: absolute; right: 6px; bottom: 2px; display: grid; place-items: center; width: 26px; height: 22px; border-radius: var(--rd-radius-pill); opacity: 0; background: var(--rd-surface-solid); color: var(--rd-ink); }
  .kairos-redesign[data-view="chat"] .session-item:is(:hover, :focus-within) .rd-conversation-actions { opacity: 1; }
  .kairos-redesign[data-view="chat"] .rd-conversations-footer { order: 4; flex: none; padding: 8px 6px 0; border-top: 1px solid var(--rd-line); font: 12px var(--rd-font-ui); color: var(--rd-ink-dim); }
  .kairos-redesign[data-view="chat"] #chat-sessions :is(button, [role="button"]):focus-visible { outline: 2px solid var(--rd-focus); outline-offset: -2px; }
}

/* Shared desktop pane area. Phone sheets and the classic skin keep their layout. */
@media (min-width: 1101px) {
  .kairos-redesign[data-view="chat"] .chat-pane-toolbar { display: flex; flex: none; gap: 2px; padding: 3px; border: 1px solid var(--rd-line); border-radius: var(--rd-radius-pill); background: var(--rd-surface-solid); }
  .kairos-redesign[data-view="chat"] .chat-pane-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; min-width: 30px; min-height: 30px; padding: 0; border: 0; border-radius: var(--rd-radius-pill); background: transparent; color: var(--rd-ink); font: 18px var(--rd-font-ui); cursor: pointer; }
  .kairos-redesign[data-view="chat"] .chat-pane-icon[hidden] { display: none; }
  .kairos-redesign[data-view="chat"] .chat-pane-icon:is(:hover, [aria-pressed="true"]) { background: var(--rd-surface-2); }
  .kairos-redesign[data-view="chat"] .chat-pane-icon:focus-visible { outline: 2px solid var(--rd-focus); outline-offset: 2px; }
  .kairos-redesign[data-view="chat"] .chat-pane-icon svg { width: 16px; height: 16px; }
  .kairos-redesign[data-view="chat"] .chat-pane-icon.has-running::after { content: ''; position: absolute; top: 2px; right: 2px; width: 6px; height: 6px; border-radius: var(--rd-radius-pill); background: var(--rd-focus); }
  .kairos-redesign[data-view="chat"] .chat-new-window { display: inline-flex; border: 1px solid var(--rd-line); background: var(--rd-surface-solid); }
  .kairos-redesign[data-view="chat"] .chat-window-menu-item:not([hidden]) { display: flex; }
  .kairos-redesign[data-view="chat"] .chat-mobile-header .chat-phone-tools { display: block; }
  .kairos-redesign[data-view="chat"] .chat-mobile-header { flex-wrap: wrap; gap: 6px; }
  .kairos-redesign[data-view="chat"] .chat-mobile-header .rd-chat-title { flex-basis: 60px; }
  .kairos-redesign[data-view="chat"] .chat-mobile-header > :is(.chat-documents-toggle, .chat-files-toggle) { display: none; }
  .kairos-redesign[data-view="chat"] .chat-layout > .chat-pane-stack { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 0; padding: 16px 16px 16px 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; animation: none; overflow: hidden; }
  .kairos-redesign[data-view="chat"] .chat-stacked-pane { display: flex; flex-direction: column; position: relative; min-height: 0; min-width: 0; overflow: hidden; border: 1px solid var(--rd-line); border-radius: 20px; background: var(--rd-surface-solid); box-shadow: var(--rd-shadow); animation: chat-side-enter var(--rd-dur-push) var(--rd-ease); transform: none; }
  .kairos-redesign[data-view="chat"] .chat-stacked-pane[hidden] { display: none; }
  .kairos-redesign[data-view="chat"] :is(.chat-side-pane-header, .chat-stacked-pane > .artifact-header) { display: flex; align-items: center; flex: 0 0 44px; height: 44px; min-height: 44px; gap: 6px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--rd-line); }
  .kairos-redesign[data-view="chat"] .chat-pane-heading { display: flex; align-items: baseline; gap: 6px; flex: 1; min-width: 0; overflow: hidden; font: 500 13px var(--rd-font-ui); }
  .kairos-redesign[data-view="chat"] .chat-pane-heading strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kairos-redesign[data-view="chat"] .chat-pane-heading small { color: var(--rd-ink-dim); font: 11px var(--rd-font-ui); white-space: nowrap; }
  .kairos-redesign[data-view="chat"] .chat-design-canvas { flex: 1; display: flex; min-height: 0; min-width: 0; overflow: hidden; }
  .kairos-redesign[data-view="chat"] .chat-design-canvas > .design-canvas { flex: 1; min-height: 0; }
  .kairos-redesign[data-view="chat"] .chat-design-pane > .design-model-host { flex: none; padding: 2px 10px; border-bottom: 1px solid var(--rd-line); }
  .kairos-redesign[data-view="chat"] .chat-background-pane > .bg-tasks-panel { position: static; flex: 1; min-height: 0; max-height: none; padding: 12px; border: 0; border-radius: 0; box-shadow: none; background: transparent; overflow: auto; }
  .kairos-redesign[data-view="chat"] .bg-task-group { margin: 4px; color: var(--rd-ink-dim); font: 500 10px var(--rd-font-ui); text-transform: uppercase; letter-spacing: .16em; }
  .kairos-redesign[data-view="chat"] .chat-background-pane .bg-task-row { border-color: var(--rd-line); border-radius: 14px; background: var(--rd-surface-solid); color: var(--rd-ink); }
  .kairos-redesign[data-view="chat"] .chat-pane-resizer::after { inset: 50% auto auto 50%; width: 4px; height: 40px; transform: translate(-50%, -50%); border-radius: var(--rd-radius-pill); background: var(--rd-line-strong); }
  .kairos-redesign[data-view="chat"] .chat-pane-stack-resizer { position: relative; flex: 0 0 10px; cursor: row-resize; touch-action: none; }
  .kairos-redesign[data-view="chat"] .chat-pane-stack-resizer::after { content: ''; position: absolute; left: 50%; top: 3px; width: 40px; height: 4px; transform: translateX(-50%); border-radius: var(--rd-radius-pill); background: var(--rd-line-strong); }
  .kairos-redesign[data-view="chat"] .chat-pane-stack-resizer:focus-visible { outline: 2px solid var(--rd-focus); }
  .kairos-redesign[data-view="chat"] .stack-dragging iframe { pointer-events: none; }
  .kairos-redesign[data-view="chat"] .stack-dragging { user-select: none; }
}
@keyframes chat-side-enter { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@media (min-width: 1101px) and (prefers-reduced-motion: reduce) {
  .kairos-redesign[data-view="chat"] .chat-stacked-pane { animation: chat-side-fade var(--rd-dur-fade) var(--rd-ease); }
}
@keyframes chat-side-fade { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 1101px) {
  .kairos-redesign[data-view="chat"] .chat-stacked-pane .artifact-header { display: flex; align-items: center; flex: 0 0 44px; min-height: 44px; height: 44px; gap: 6px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--rd-line); }
  .kairos-redesign[data-view="chat"] .chat-stacked-pane .artifact-header h2 { font: 500 14px var(--rd-font-ui); }
  .kairos-redesign[data-view="chat"] .chat-stacked-pane .artifact-header :is(.artifact-maximize, [aria-label^="Close"]) { display: inline-grid; place-items: center; width: 30px; min-width: 30px; height: 30px; min-height: 30px; padding: 0; border: 0; border-radius: var(--rd-radius-pill); background: transparent; }
  .kairos-redesign[data-view="chat"] .chat-stacked-pane .artifact-maximize { font-size: 0; }
  .kairos-redesign[data-view="chat"] .chat-stacked-pane .artifact-maximize::before { content: '\26f6'; font: 18px var(--rd-font-ui); }
}
@media (max-width: 768px) {
  .chat-pane-stack > .chat-stacked-pane > .artifact-header { min-height: 62px; padding: 12px 16px 12px 62px; }
}

/* Chats phone fidelity: Chats, ChatsIdle, Conversation and ChatDocument.
   Higher view specificity keeps the shared mobile shell and other tabs intact. */
.rd-chat-author-kip, .rd-chat-author-time, .rd-chat-dictation-action { display: none; }
@media (max-width: 768px) {
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .rd-chats-header { padding: calc(14px + var(--mobile-safe-top, env(safe-area-inset-top, 0px))) 20px 18px; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-switch { height: 54px; padding: 5px; box-shadow: none; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-switch-thumb { inset: 5px auto 5px 5px; width: calc(50% - 5px); }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-segment { margin: 0; font-weight: 400; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-segment[aria-selected=true] { font-weight: 500; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-intro { flex: 0 1 auto; min-height: 0; padding: 26px 20px 6px; gap: 14px; overflow-y: auto; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-launch:has(.ms-activity:not([hidden])) .rd-chat-prompts { display: none; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-intro .rd-empty-mascot { height: 120px; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-intro kairos-mascot { width: 120px; height: 120px; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-intro h2 { font: italic 600 32px/1.1 var(--rd-font-title); }
  .kairos-redesign[data-view=mobileLaunch] .rd-chat-prompts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 12px 20px 18px; }
  .kairos-redesign[data-view=mobileLaunch] .rd-chat-prompts .rd-chat-prompt { min-height: 40px; padding: 10px 14px; border: 1px solid var(--rd-line); border-radius: var(--rd-radius-pill); background: var(--rd-surface-solid); font: 13px var(--rd-font-ui); }
  .kairos-redesign[data-view=mobileLaunch] .ms-live-chat .rd-chat-prompts { display: none; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-bottom { margin-top: auto; padding-inline: 20px; } /* The composer meets the bottom edge; spare height sits above it. */
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-history { padding: 0 20px 0; gap: 18px; overflow-y: auto; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-history-search { display: grid; grid-template-columns: 18px minmax(0, 1fr) 44px; align-items: center; gap: 10px; min-height: 54px; margin: 0; padding: 4px 5px 4px 18px; box-shadow: none; backdrop-filter: none; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-history-search input { height: 44px; padding: 0; font: 15px var(--rd-font-ui); }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-history-search > button { width: 44px; height: 44px; padding: 0; border: 1px solid var(--rd-line); border-radius: var(--rd-radius-pill); font-size: 0; background: var(--rd-surface-solid); }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-history-search > button::before { content: ''; display: block; width: 18px; height: 18px; margin: auto; background: currentColor; clip-path: polygon(5% 10%,95% 10%,62% 52%,62% 95%,38% 80%,38% 52%); }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-history-search > button[aria-expanded=true] { background: var(--rd-surface-2); }
  .kairos-redesign[data-view=mobileLaunch] .rd-chat-search-icon { display: grid; place-items: center; color: var(--rd-ink-dim); }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell :is(.rd-chat-recent, .rd-chat-working h2) { margin: 0; font: italic 600 26px/1.2 var(--rd-font-title); }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .rd-chat-working-row { padding-top: 12px; gap: 14px; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .rd-chat-working-row button { width: 58px; min-width: 58px; gap: 6px; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .rd-chat-working-row kairos-mascot { box-sizing: border-box; width: 58px; height: 58px; padding: 7px; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-history-list { flex: 0 0 auto; overflow: visible; padding: 2px 16px; border: 1px solid var(--rd-line); border-radius: 26px; background: var(--rd-surface-solid); }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-history-row { border: 0; border-bottom: 1px solid var(--rd-line); border-radius: 0; background: transparent; overflow: hidden; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-history-row + .ms-history-row::before { display: none; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-history-row:last-child { border-bottom: 0; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-history-main { width: 100%; min-height: 78px; border-radius: 0; padding: 13px 0; gap: 4px 12px; background: transparent; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .rd-chat-initial { width: 44px; height: 44px; border-radius: 14px; font: italic 600 20px var(--rd-font-title); }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-row-more { width: 44px; height: 44px; top: auto; bottom: 0; opacity: 0; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-history-row:is(:hover, :focus-within) .ms-row-more { opacity: 1; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-actions-open .ms-history-main { transform: translateX(-136px); }

  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .chat-mobile-header { flex-wrap: nowrap; gap: 12px; padding: calc(8px + var(--mobile-safe-top, env(safe-area-inset-top, 0px))) 20px 14px; background: color-mix(in srgb, var(--rd-ground) 92%, transparent); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-chat-heading small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-chat-heading { text-align: center; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-chat-heading strong { font: italic 600 24px/1.1 var(--rd-font-title); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation :is(.ms-chat-back, .chat-phone-tools > button) { display: grid; place-items: center; width: 46px; min-width: 46px; height: 46px; border: 1px solid var(--rd-line); border-radius: var(--rd-radius-pill); background: var(--rd-surface-solid); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-chat-capsule { border: 0; background: transparent; box-shadow: none; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-chat-capsule::before { display: none; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-chat-capsule > :is(.chat-files-toggle, .context-pill) { display: none; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation #chat-messages { padding: 18px 20px; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]):not([data-chat-style=terminal]) .ms-conversation .msg.user { max-width: 78%; margin-left: auto; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]):not([data-chat-style=terminal]) .ms-conversation .chat-prose { font: 15px/1.55 var(--rd-font-ui); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .chat-author { position: relative; padding-left: 44px; min-height: 34px; margin-bottom: 10px; font: 12px var(--rd-font-ui); color: var(--rd-ink-dim); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]):not([data-mascot=off]) .ms-conversation .rd-chat-author-kip { display: inline-flex; position: absolute; left: 0; top: 0; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]):not([data-mascot=off]) .ms-conversation .chat-author-mark { display: none; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .rd-chat-author-time { display: inline; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]):not([data-chat-style=terminal]) .ms-conversation .msg.assistant > :not(.chat-author) { margin-left: 44px; max-width: calc(100% - 44px); min-width: 0; }
  /* Files, cards and code fit the message column; long names ellipsize instead of pushing the page sideways. */
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .msg { min-width: 0; max-width: 100%; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .msg :is(.msg-body, .chat-prose, .msg-images, .chat-reference-chips) { min-width: 0; max-width: 100%; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .msg :is(.artifact-card, .chat-code-block, .chat-table-wrap, .msg-generated-image, .chat-prose img) { box-sizing: border-box; min-width: 0; max-width: 100%; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .msg .msg-generated-file { box-sizing: border-box; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .msg .msg-images img { max-width: min(100%, 320px); height: auto; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .msg .chat-prose pre { max-width: 100%; box-sizing: border-box; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .msg .artifact-info { flex: 1 1 auto; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .msg :is(.artifact-icon, .artifact-arrow) { flex-shrink: 0; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .chat-composer-dock { padding-inline: 20px; }

  /* Idle is a two-row card; an open conversation keeps one compact row.
     The original controls, textarea and menus remain mounted. */
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .chat-input-bar.ms-composer { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(64px, 100px) 44px; align-items: center; gap: 0 6px; margin: 0; padding: 8px; border-radius: 30px; background: var(--rd-surface-solid); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-composer :is(.chat-input-top, .chat-input-bottom, .chat-input-left, .chat-input-right) { display: contents; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-composer .ms-composer-context { display: none; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-composer #chat-input { grid-column: 2; grid-row: 1; min-height: 44px; padding: 10px 0; font: 15px/24px var(--rd-font-ui); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-composer .overflow-wrapper:has(#overflow-plus-btn) { position: relative; inset: auto; transform: none; grid-column: 1; grid-row: 1; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-composer .chat-header-model { display: flex; align-items: center; align-self: center; height: 44px; grid-column: 3; grid-row: 1; width: 100%; max-width: 100%; margin: 0; border: 0; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-composer .model-picker-btn { width: 100%; max-width: 100%; padding-inline: 8px; font: 13px var(--rd-font-ui); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-composer #chat-send { display: grid; place-items: center; transform: none; grid-column: 4; grid-row: 1; width: 44px; height: 44px; padding: 0; border-radius: var(--rd-radius-pill); background: var(--rd-primary-bg); color: var(--rd-primary-fg); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-composer #chat-mic { display: none; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .rd-chat-dictation-action:not([hidden]) { display: flex; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-composer :is(.attach-strip, .chat-reference-chips, .voice-row) { grid-column: 1 / -1; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-composer #workspace-pill-slot { display: none; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .ms-conversation .ms-composer.ms-dictating .chat-input-bottom { display: none; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer { grid-template-columns: 44px minmax(0, 1fr) auto 44px; gap: 10px 8px; padding: 14px; border-radius: 28px; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer #chat-input { grid-column: 1 / -1; grid-row: 1; padding-inline: 4px; font-size: 16px; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer .overflow-wrapper:has(#overflow-plus-btn) { grid-column: 1; grid-row: 2; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer .chat-header-model { grid-column: 2; grid-row: 2; justify-self: start; width: auto; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer #workspace-pill-slot { display: block; grid-column: 3; grid-row: 2; max-width: 80px; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer #chat-mic { display: grid; position: static; inset: auto; transform: none; grid-column: 4; grid-row: 2; width: 44px; height: 44px; padding: 0; border-radius: var(--rd-radius-pill); background: var(--rd-primary-bg); color: var(--rd-primary-fg); }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer #chat-send { display: none; grid-column: 4; grid-row: 2; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer-expanded #chat-send { display: grid; }
  .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer-expanded #chat-mic { display: none; }

  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-viewer { top: max(48px, var(--mobile-safe-top, env(safe-area-inset-top, 0px))); padding: 24px 0 0; border-radius: 32px 32px 0 0; animation: rd-sheet var(--rd-dur-sheet) var(--rd-spring); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-viewer::before { content: ''; position: absolute; top: 12px; left: calc(50% - 21px); width: 42px; height: 5px; border-radius: var(--rd-radius-pill); background: var(--rd-line-strong); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-viewer .artifact-pane-top { padding: 0; border: 0; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-viewer .artifact-tabs { padding: 0 16px 12px; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-viewer .artifact-header { padding: 12px 16px; gap: 10px; border: 0; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-viewer .artifact-header h2 { font: italic 600 24px/1.1 var(--rd-font-title); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-viewer .artifact-header-controls .btn { width: 44px; height: 44px; padding: 0; border: 1px solid var(--rd-line); border-radius: var(--rd-radius-pill); background: var(--rd-surface-2); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-viewer .artifact-preview { margin: 14px 16px 0; padding: 16px; border-radius: 18px; background: var(--rd-surface-2); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-viewer .artifact-toolbar { padding: 0 16px 12px; gap: 6px; border: 0; }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-viewer .artifact-toolbar .btn { border-radius: var(--rd-radius-pill); font: 13px var(--rd-font-ui); }
  .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-viewer .artifact-comment-box { margin: 12px 16px 30px; padding: 8px; border: 1px solid var(--rd-line); border-radius: 30px; background: var(--rd-ground); }
  @media (prefers-reduced-motion: reduce) {
    .kairos-redesign:is([data-view=chat], [data-view=mobileLaunch]) .artifact-viewer { animation: rd-opacity var(--rd-dur-fade) var(--rd-ease); }
  }
  @media (max-height: 600px) {
    .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-launch { overflow: hidden; }
    .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-intro { flex: 1 1 auto; min-height: 0; overflow: hidden; padding-block: 8px; }
    .kairos-redesign[data-view=mobileLaunch] .ms-shell .rd-chat-prompts { display: none; }
    /* When the screen is short, running work scrolls inside its slot so the composer always stays visible. */
    .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-bottom { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; }
    .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-bottom > .ms-activity-slot { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
    .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-bottom > .ms-launch-chat, .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-bottom > .ms-launch-composer { flex: none; }
    /* Short screens keep the one-row pill instead of ChatsIdle's two-row card. */
    .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer { grid-template-columns: 44px minmax(0, 1fr) auto 44px; gap: 0 6px; padding: 8px; border-radius: 30px; }
    .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer #chat-input { grid-column: 2; grid-row: 1; font-size: 15px; }
    .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer .overflow-wrapper:has(#overflow-plus-btn) { grid-column: 1; grid-row: 1; }
    .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer .chat-header-model { grid-column: 3; grid-row: 1; justify-self: end; }
    .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer #workspace-pill-slot { display: none; }
    .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer #chat-mic { grid-column: 4; grid-row: 1; }
    .kairos-redesign[data-view=mobileLaunch] .ms-shell:not(.ms-live-chat) .ms-launch-chat .ms-composer #chat-send { grid-column: 4; grid-row: 1; }
    .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-intro kairos-mascot { width: 72px !important; height: 72px !important; }
    .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-intro .rd-empty-mascot { height: 72px; }
  }
  @media (max-height: 480px) {
    .kairos-redesign[data-view=mobileLaunch] .ms-shell .ms-intro { flex-basis: 0; padding-block: 0; }
  }
}

/* Desktop Chats: every Kairos message carries Kip beside the word Kairos (David,
   2026-10-25). The phone draws Kip larger in its own card above; with the mascot
   off the Kairos mark stays, so the row never loses its logo. */
@media (min-width: 769px) {
  .kairos-redesign:not([data-mascot=off]) .chat-author .rd-chat-author-kip { display: inline-flex; flex: none; width: 22px; height: 22px; }
  .kairos-redesign:not([data-mascot=off]) .chat-author .rd-chat-author-kip kairos-mascot { width: 22px !important; height: 22px !important; }
  .kairos-redesign:not([data-mascot=off]) .chat-author .chat-author-mark { display: none; }
}

/* -- Desktop redesign (2026-10-28, canvas boards Main and Popups) ------------------------------
   Plain messages by default: the user's turn right-aligned with a thin gold rule, the reply
   straight on the backdrop with a soft halo of the backdrop colour so it stays legible.
   Appearance > Chat messages > Cards keeps the bubble look above. The prompt: + / model /
   permissions on the left, a square send on the right, sharp edges. */
@media (min-width: 769px) {
  .kairos-redesign[data-view=chat][data-chat-messages=plain]:not([data-chat-style=terminal]) #chat-messages .msg.user { align-items: flex-end; }
  .kairos-redesign[data-view=chat][data-chat-messages=plain]:not([data-chat-style=terminal]) #chat-messages .msg.user .msg-body {
    max-width: min(78%, 640px); padding: 12px 16px; border: 1px solid var(--rd-line); border-radius: 12px;
    background: color-mix(in srgb, var(--rd-surface-solid) 82%, transparent); color: var(--rd-ink); box-shadow: none; text-align: left;
  }
  .kairos-redesign[data-view=chat][data-chat-messages=plain]:not([data-chat-style=terminal]) #chat-messages .msg.user .msg-body :is(a, code) { color: inherit; }
  .kairos-redesign[data-view=chat][data-chat-messages=plain]:not([data-chat-style=terminal]) #chat-messages .msg.assistant :is(.msg-body, .chat-author) {
    text-shadow: 0 0 2px var(--rd-ground), 0 0 10px var(--rd-ground), 0 0 18px var(--rd-ground);
  }
  .kairos-redesign[data-view=chat][data-chat-messages=plain]:not([data-chat-style=terminal]) #chat-messages .msg :is(.chat-code-block, .chat-table-wrap, .artifact-card) { text-shadow: none; }

  /* The prompt. */
  .kairos-redesign[data-view=chat]:not([data-chat-style=terminal]) .chat-input-bar { border-radius: 14px; border: 1px solid var(--rd-line-strong); background: var(--rd-surface-solid); box-shadow: var(--rd-shadow); }
  /* Two rows: the text on top, then + / model / permissions on the left and send on the right. */
  .kairos-redesign[data-view=chat]:not([data-chat-style=terminal]) .chat-input-bar:not(.forge-composer) { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; padding: 10px 10px 8px; }
  .kairos-redesign[data-view=chat]:not([data-chat-style=terminal]) .chat-input-bar:not(.forge-composer) .chat-input-top { grid-column: 1 / -1; grid-row: 1; }
  .kairos-redesign[data-view=chat]:not([data-chat-style=terminal]) .chat-input-bar:not(.forge-composer) .chat-input-left { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; grid-column: 1; grid-row: 2; }
  .kairos-redesign[data-view=chat]:not([data-chat-style=terminal]) .chat-input-bar:not(.forge-composer) .chat-input-left > * { margin: 0; }
  .kairos-redesign[data-view=chat]:not([data-chat-style=terminal]) .chat-input-bar:not(.forge-composer) .chat-input-right { grid-column: 2; grid-row: 2; align-self: end; }
  .kairos-redesign[data-view=chat]:not([data-chat-style=terminal]) #overflow-plus-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; }
  .kairos-redesign[data-view=chat] .chat-header-model.model-pill.rd-in-composer { height: 32px; border: 0; border-radius: 8px; max-width: 300px; background: transparent; }
  .kairos-redesign[data-view=chat] .rd-in-composer .model-picker-btn { border-radius: 8px; gap: 6px; }
  .kairos-redesign[data-view=chat] .rd-in-composer .model-label-version { color: var(--rd-ink-dim); }
  .kairos-redesign[data-view=chat] #chat-send { width: 34px; height: 34px; min-width: 34px; min-height: 34px; padding: 0; border-radius: 10px; display: grid; place-items: center; background: var(--rd-primary-bg); color: var(--rd-primary-fg); border: 0; }
  .kairos-redesign[data-view=chat] #chat-send:hover { background: var(--rd-primary-hover); }
  /* No mic on the desktop prompt: Dictate is in the + menu, and the button shows while it records. */
  .kairos-redesign[data-view=chat] #chat-mic:not(.recording, .busy) { display: none; }
  .kairos-redesign[data-view=chat] #chat-mic:is(.recording, .busy) { border-radius: 10px; }

  /* The permission pill and its menu. */
  .chat-permission-wrap { position: relative; }
  .chat-permission-wrap .composer-menu-options { display: none; }
  .chat-permission-pill {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px;
    background: transparent; color: var(--rd-ink); font: 500 12.5px var(--rd-font-ui); cursor: pointer; white-space: nowrap;
  }
  .chat-permission-pill:hover { background: color-mix(in srgb, var(--rd-ink) 6%, transparent); }
  .chat-permission-pill:focus-visible { outline: 2px solid var(--rd-focus); outline-offset: 2px; }
  .chat-permission-pill[data-mode=auto] { border-color: var(--danger); color: var(--danger); }
  .chat-permission-pill > svg:last-child { width: 9px; height: 9px; opacity: .7; }
  .chat-permission-menu { width: 280px; padding: 6px; }
  .chat-permission-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; height: auto; padding: 8px 10px; text-align: left; white-space: normal; }
  .chat-permission-choice small { color: var(--rd-ink-dim); font-size: 11.5px; line-height: 1.35; }
  .chat-permission-choice[aria-checked=true] { box-shadow: inset 2px 0 0 var(--point); background: var(--rd-surface-2); }
  .chat-permission-choice:disabled { opacity: .5; cursor: not-allowed; }
  .chat-permission-menu .chat-permission-notice { margin: 6px 10px 4px; font-size: 11.5px; color: var(--danger); }

  /* The + menu's groups; Open Mic sits in it as an ordinary row. */
  .overflow-menu-heading { padding: 8px 10px 3px; font: 500 10px var(--rd-font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--rd-ink-dim); }
  .overflow-menu-heading:first-child { padding-top: 4px; }
  #overflow-menu > .chat-openmic-btn { display: flex; align-items: center; gap: 10px; width: 100%; height: auto; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; justify-content: flex-start; }
  #overflow-menu > .chat-openmic-btn:hover { background: var(--rd-surface-2); }
  .kairos-redesign #overflow-menu, .kairos-redesign #model-picker-menu, .kairos-redesign .chat-permission-menu { border-radius: 0; }
  .kairos-redesign #overflow-menu .overflow-menu-item { border-radius: 0; }
}
/* Sharp chrome around a desktop chat: the header's controls and the stacked side panes. */
@media (min-width: 769px) {
  .kairos-redesign[data-view=chat] :is(.rd-chat-header #chat-history-toggle, .chat-pane-toolbar, .chat-pane-icon, .chat-new-window, .chat-phone-tools > button,
    .chat-jump, .chat-stacked-pane, .artifact-header-controls .btn, .chat-question-host .question-card, .bg-tasks-pill, .chat-queue) { border-radius: 0; }
  .kairos-redesign[data-view=chat] .chat-stacked-pane { box-shadow: none; border-color: var(--rd-line-strong); }
  .kairos-redesign[data-view=chat] .chat-pane-icon[aria-pressed="true"] { background: var(--rd-primary-bg); color: var(--rd-primary-fg); }
}

/* -- Chats like the reference David chose (2026-10-28) --------------------------------------------------
   The chat's name on the left of a quiet header with icon buttons on the right; the prompt as a rounded
   card with a tab above it naming where the chat runs, and the hint and context meter beneath it. */
@media (min-width: 769px) {
  .kairos-redesign[data-view=chat] .chat-mobile-header.rd-chat-header { gap: 4px; padding-block: 10px; }
  .kairos-redesign[data-view=chat] .rd-chat-header #chat-history-toggle {
    width: 32px; height: 32px; padding: 0; justify-content: center; border: 0; border-radius: 8px; background: transparent; box-shadow: none; color: var(--rd-ink-dim);
  }
  .kairos-redesign[data-view=chat] .rd-chat-header #chat-history-toggle :is(.rd-conv-label, .rd-conv-count),
  .kairos-redesign[data-view=chat] .rd-chat-header #chat-history-toggle > svg:last-child { display: none; }
  .kairos-redesign[data-view=chat] .rd-chat-header #chat-history-toggle:hover,
  .kairos-redesign[data-view=chat] .rd-chat-header #chat-history-toggle[aria-expanded="true"] { background: color-mix(in srgb, var(--rd-ink) 8%, transparent); color: var(--rd-ink); }
  .kairos-redesign[data-view=chat] .rd-chat-title { flex: 1 1 auto; font: 500 14px/1.3 var(--rd-font-ui); font-style: normal; color: var(--rd-ink); }
  .kairos-redesign[data-view=chat] .chat-pane-toolbar { gap: 2px; padding: 0; border: 0; background: transparent; }
  .kairos-redesign[data-view=chat] :is(.chat-pane-icon, .chat-new-window, .chat-phone-tools > button) {
    width: 32px; min-width: 32px; height: 32px; min-height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--rd-ink-dim);
  }
  .kairos-redesign[data-view=chat] :is(.chat-pane-icon, .chat-new-window, .chat-phone-tools > button):hover { background: color-mix(in srgb, var(--rd-ink) 8%, transparent); color: var(--rd-ink); }
  .kairos-redesign[data-view=chat] .chat-pane-icon[aria-pressed="true"] { background: color-mix(in srgb, var(--rd-ink) 12%, transparent); color: var(--rd-ink); }

  .chat-prompt-context {
    display: flex; align-items: center; gap: 16px; min-width: 0; margin: 0 16px -1px; padding: 7px 14px 8px;
    border: 1px solid var(--rd-line); border-bottom: 0; border-radius: 12px 12px 0 0;
    background: color-mix(in srgb, var(--rd-surface-solid) 70%, transparent); color: var(--rd-ink-dim); font: 12.5px var(--rd-font-ui);
  }
  .chat-prompt-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
  .chat-prompt-chip svg { flex: none; }
  .chat-prompt-project-name { overflow: hidden; text-overflow: ellipsis; color: var(--rd-ink); font-weight: 500; }
  .chat-prompt-context #workspace-pill-slot .workspace-pill { margin: 0; padding: 0 2px 0 8px; border-radius: 6px; font-size: 12px; }
  .chat-prompt-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 6px 0; min-height: 22px; }
  .chat-prompt-foot .composer-hint { margin: 0; text-align: left; }
  .chat-prompt-foot .context-pill { flex: none; margin: 0; padding: 0 4px; height: 22px; border: 0; background: transparent; color: var(--rd-ink-dim); font-size: 11.5px; }
}
/* The document pane's own buttons follow the chat's quieter controls (desktop). */
@media (min-width: 769px) {
  .kairos-redesign[data-view=chat] .chat-stacked-pane .artifact-toolbar .btn { height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--rd-ink-dim); }
  .kairos-redesign[data-view=chat] .chat-stacked-pane .artifact-toolbar .btn:is(:hover, [aria-pressed=true], .active) { background: color-mix(in srgb, var(--rd-ink) 10%, transparent); color: var(--rd-ink); }
  .kairos-redesign[data-view=chat] .chat-stacked-pane .artifact-tab { border-radius: 8px; }
}
/* Panes keep every control on its own line at any size: the document toolbar scrolls sideways
   instead of wrapping over the preview (David, 2026-10-28). */
@media (min-width: 769px) {
  .kairos-redesign .chat-stacked-pane .artifact-toolbar { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; flex: none; }
  .kairos-redesign .chat-stacked-pane .artifact-toolbar > * { flex: none; }
  .kairos-redesign .chat-stacked-pane .artifact-header > div { min-width: 0; overflow: hidden; }
  .kairos-redesign .chat-stacked-pane .artifact-header :is(h2, .artifact-detail) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
