Newer
Older
navi-1 / webclient / src / styles / partials / _chat.scss
@use 'kit-deps' as *;
@use 'tokens' as *;

// ─── Chat area (ChatArea.vue root) ─────────────────────────────────────────
.chat-area {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: $surface-page;
}

// ─── Chat header ───────────────────────────────────────────────────────────
.chat-header {
  display: flex;
  align-items: center;
  gap: $space-sm;
  padding: $space-sm $space-md;
  border-bottom: $border-width-base $border-style-base $border-color-muted;
  background: $surface-panel;
  flex-shrink: 0;
  min-height: 54px;
}

.chat-header-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: $space-sm;
  overflow: hidden;
  min-width: 0;

  @media (max-width: $bp-mobile) {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}

.chat-header-title {
  font-size: 14px;
  font-weight: 600;
  color: $color-text-light;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  cursor: text;
}

// Rename: replaces the title, stretches across the header-info width
.chat-header-rename {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: $color-text-light;
  background: $surface-panel-strong;
  border: 1px solid $color-secondary;
  border-radius: $border-radius-sm;
  outline: none;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-sidebar-toggle {
  display: none;
  @media (max-width: $bp-sidebar-drawer) {
    display: flex;
  }
}

// ─── Context bar (token indicator) ─────────────────────────────────────────
.context-bar {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  cursor: default;
}

// ─── Profile badge ─────────────────────────────────────────────────────────
// ─── Message list ──────────────────────────────────────────────────────────
// Message list: the virtual scroller (MessageList.vue) carries its own
// scoped layout; nothing global left here.

// ─── Messages ──────────────────────────────────────────────────────────────
.msg-user {
  display: flex;
  justify-content: flex-end;
  gap: $space-sm;
}

.msg-user-bubble {
  background: $color-secondary;
  color: $color-black;
  padding: $space-sm $space-md;
  border-radius: $border-radius-md;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  width: 100%;

  .msg-user-quote {
    margin: 0 0 $space-xs 0;
    padding: 2px 0 2px $space-sm;
    border-left: 3px solid rgba($color-black, 0.35);
    opacity: 0.7;
    font-size: 13px;
  }
}

.msg-user--recall .msg-user-bubble {
  background: color-mix(in srgb, var(--gn-color-secondary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--gn-color-secondary) 25%, transparent);

  .msg-user-text {
    color: $color-text-light;
  }
}

.msg-recall-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--gn-color-secondary);
  margin-bottom: 4px;
  opacity: 0.85;
}

// Sent while a turn was running: shown at once, executed when that turn ends.
// Muted rather than highlighted — it is the user's own message, not news.
.msg-user--queued .msg-user-bubble {
  opacity: 0.75;
}

// Neutral, not accented. The badge sits on the user's blue bubble, which is
// itself faded to 0.75 for a queued message; the accent orange it used to take
// (#FF9E64) measured ~1.9:1 there and read as a warning sign rather than as
// "this message is waiting". The palette's own grey stays readable against that
// blue and reads as secondary text, where the darker neutrals (#1F2335, the
// bubble's own near-black text) look like the message itself.
.msg-queued-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: $color-grey;
  margin-bottom: 4px;
}

// The socket refused the message (queue full): it was not kept, so the bubble
// must not keep looking sent. Same slot as the queued badge, warning colour.
.msg-failed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: $color-error;
  margin-bottom: 4px;
}

.msg-user-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: $space-xs;
  margin-top: $space-xs;
}

.msg-user-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: $border-radius-md;
  cursor: pointer;
  transition: opacity 0.15s;

  &:hover {
    opacity: 0.75;
  }
}

.msg-user-file-pill {
  display: inline-flex;
  align-items: center;
  gap: $space-xs;
  padding: 2px $space-sm;
  background: rgba($color-black, 0.3);
  border-radius: $border-radius-pill;
  font-size: 12px;
}

.msg-time {
  font-size: 11px;
  color: $color-text-dark;
  line-height: 1;
  margin-top: 4px;
}

// Assistant message metadata row (elapsed · tools · tokens · time)
.msg-meta-row {
  display: flex;
  align-items: center;
  gap: $space-sm;
  margin-top: 2px;
  min-width: 0;
}

.msg-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: $color-text-dark;
  white-space: nowrap;

  i { font-size: 12px; opacity: 0.7; }
}

.msg-meta-time {
  // grouped with other meta items — no special positioning
}

.msg-user-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 70%;

  @media (max-width: $bp-mobile) {
    max-width: 90%;
  }
}

.msg-time--user {
}

.msg-user-footer {
  display: flex;
  align-items: center;
  gap: $space-xs;
  align-self: flex-end;
}

.msg-copy-btn {
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  font-size: 12px;
  opacity: 0.5;
  transition: opacity 0.15s;

  &:hover { opacity: 1; }
}

.msg-meta-row > .msg-copy-btn {
  margin-left: auto;
}

.msg-meta-row .msg-rate-btn {
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  font-size: 13px;
}

.msg-assistant {
  display: flex;
  flex-direction: column;
  gap: $space-sm;
  max-width: 100%;
}

.planning-indicator {
  display: flex;
  align-items: center;
  gap: $space-sm;
  font-size: 13px;
  font-style: italic;
  color: $color-text-dark;
  padding: $space-xs 0;
}

.planning-indicator.is-executing {
  color: $color-text-medium;
  font-style: normal;
}

.planning-label {
  opacity: 0.75;
  transition: opacity 0.2s;
}

.msg-assistant-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.msg-assistant-content {
  font-size: 14px;
  line-height: 1.7;
  color: $color-text-light;

  // Flex container so image paragraphs can form a grid
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  // Markdown block elements take full width by default
  & > p, & > ul, & > ol, & > blockquote, & > pre, & > .table-wrap,
  & > .code-block, & > h1, & > h2, & > h3, & > h4, & > hr {
    flex: 1 1 100%;
    margin: 0;
  }

  // Paragraphs that contain only a markdown image link → 3 per row
  & > p:has(> .msg-md-image-link:only-child) {
    flex: 0 0 calc((100% - 2 * 8px) / 3);
  }

  h1, h2, h3, h4 { color: $color-text-light; }
  ul, ol { padding-left: $space-lg; }
  li { margin-bottom: $space-sm; }
  blockquote {
    padding-left: $space-md;
    border-left: $border-width-accent $border-style-base $color-secondary;
    color: $color-text-medium;
  }
  a { color: $color-secondary; }
  strong { color: $color-text-light; }
  hr { border: none; border-top: 1px solid $border-color-muted; }

  // Markdown images: adaptive square grid, click opens lightbox
  .msg-md-image-link {
    display: block;
    width: 100%;
    text-decoration: none;
    border: 2px solid rgba($color-text-light, 0.12);
    border-radius: $border-radius-sm;
    overflow: hidden;
    transition: border-color 0.2s ease;
    cursor: zoom-in;

    &:hover {
      border-color: $color-secondary;
    }
  }

  .msg-md-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 2px;
  }

  .msg-md-image-link.is-broken {
    cursor: default;
    border-color: rgba($color-error, 0.4);
    background: rgba($color-error, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;

    &::before {
      content: '🖼️';
      font-size: 32px;
      opacity: 0.4;
    }

    &:hover {
      border-color: rgba($color-error, 0.4);
    }

    .msg-md-image {
      display: none;
    }
  }

  // Markdown tables: scrollable wrapper for mobile
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: $space-md 0;
  }

  // Markdown tables live as bare <table> inside .table-wrap (the pipe
  // sanitizer never adds a class) — target that shape, not .table.
  .table-wrap table {
    margin: 0;
    border: $border-width-base $border-style-base $border-color-muted;
    border-radius: $border-radius-sm;

    th,
    td {
      padding: $space-sm $space-md;
      font-size: 13px;
      vertical-align: middle;
      text-align: left;
      border-bottom: $border-width-base $border-style-base $border-color-muted;
    }

    th {
      font-weight: 600;
      color: $color-text-medium;
      background: $surface-panel-muted;
    }

    tr:last-child th,
    tr:last-child td {
      border-bottom: none;
    }
  }

  // Code inline
  :not(pre) > code {
    font-family: "IBM Plex Mono", monospace;
    font-size: 13px;
    background: $surface-panel-strong;
    padding: 1px 5px;
    color: $color-cyan;
  }

  // Code blocks — .code-block wraps header + pre
  .code-block {
    margin: $space-md 0;
    background: $surface-panel;
    border: $border-width-base $border-style-base $border-color-muted;
    border-radius: $border-radius-sm;
    overflow: hidden;

    .code-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: $space-xs $space-md;
      background: $surface-panel-strong;
      border-bottom: $border-width-base $border-style-base $border-color-muted;
      font-size: 12px;
      color: $color-text-dark;
      font-family: "IBM Plex Mono", monospace;
    }

    pre {
      margin: 0;
      background: $surface-panel !important;

      code {
        font-family: "IBM Plex Mono", monospace;
        font-size: 13px;
        display: block;
        padding: $space-md;
        overflow-x: auto;
      }
    }
  }
}

// ─── Thinking card ─────────────────────────────────────────────────────────
.thinking-card {
  summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: $space-sm;
    padding: $space-xs $space-md;
    cursor: pointer;
    color: $color-text-dark;
    font-size: 12px;
    font-style: italic;
    background: $surface-panel-muted;
    border: $border-width-base $border-style-base $border-color-muted;
    border-radius: $border-radius-md;
    transition: background $motion-fast $motion-ease;
    user-select: none;

    &::-webkit-details-marker { display: none; }
    &:hover { background: $surface-panel-strong; }
  }

  &[open] summary {
    border-bottom-color: transparent;
    /* Keep only the top corners rounded — the full rounding let the page
       background peek through the two corners where the summary meets the
       straight-topped body (the "gap" when the card is expanded). */
    border-radius: $border-radius-md $border-radius-md 0 0;
  }

  .thinking-chevron {
    margin-left: auto;
    font-size: $icon-size-sm;
    color: $color-text-dark;
    flex-shrink: 0;
    transition: transform $motion-fast $motion-ease;
  }

  &[open] .thinking-chevron {
    transform: rotate(180deg);
  }

  .thinking-body {
    padding: $space-sm $space-md;
    font-size: 12px;
    font-style: italic;
    color: $color-text-medium;
    line-height: 1.5;
    background: $surface-panel-muted;
    border: $border-width-base $border-style-base $border-color-muted;
    border-top: none;
    border-radius: 0 0 $border-radius-md $border-radius-md;
    white-space: pre-wrap;
    word-break: break-word;
    /* Long reasoning chains don't grow the whole chat — scroll inside */
    max-height: 800px;
    overflow-y: auto;
  }
}

// ─── Plan card ─────────────────────────────────────────────────────────────
.plan-card {
  border: $border-width-base $border-style-base $color-secondary;
  border-left-width: $border-width-accent;
  border-left-color: $color-secondary;
  border-radius: $border-radius-md;
  overflow: hidden;
  font-size: 12px;
  margin-bottom: 8px;

  summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: $space-sm;
    padding: $space-xs $space-md;
    cursor: pointer;
    background: rgba($color-secondary, 0.08);
    color: $color-secondary;
    font-size: 12px;
    user-select: none;

    &::-webkit-details-marker { display: none; }
    &:hover { background: rgba($color-secondary, 0.14); }

    .plan-chevron {
      margin-left: auto;
      font-size: $icon-size-sm;
      color: rgba($color-secondary, 0.6);
      transition: transform $motion-fast $motion-ease;
      flex-shrink: 0;
    }
  }

  &[open] .plan-chevron {
    transform: rotate(180deg);
  }

  .plan-body {
    padding: $space-sm $space-md;
    font-size: 12px;
    color: $color-text-medium;
    line-height: 1.5;
    background: rgba($color-secondary, 0.04);
    border-top: $border-width-base $border-style-base rgba($color-secondary, 0.3);

    p { margin: 0 0 $space-sm; &:last-child { margin-bottom: 0; } }
    ul, ol { padding-left: $space-lg; margin-bottom: $space-sm; }
    li { margin-bottom: $space-xs; }
    strong { color: $color-text-light; }
  }
}

// ─── Tool card ─────────────────────────────────────────────────────────────
.tool-card {
  border: $border-width-base $border-style-base $border-color-muted;
  border-left-width: $border-width-accent;
  border-radius: $border-radius-md;
  margin-bottom: 8px;
  border-left-color: $color-secondary;
  overflow: hidden;
  font-size: 13px;

  &.is-success { border-left-color: $color-success; }
  &.is-error   { border-left-color: $color-error; }

  > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: $space-sm;
    padding: $space-xs $space-md;
    cursor: pointer;
    background: $surface-panel-muted;
    color: $color-text-medium;
    user-select: none;

    &::-webkit-details-marker { display: none; }
    &:hover { background: $surface-panel-strong; }

    .tool-chevron {
      font-size: $icon-size-sm;
      color: $color-text-dark;
      flex-shrink: 0;
      transition: transform $motion-fast $motion-ease;
    }
  }

  &[open] > summary .tool-chevron {
    transform: rotate(180deg);
  }

  .tool-name {
    flex: 1;
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tool-running-time {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: $color-text-dark;
    white-space: nowrap;
  }

  .tool-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: $icon-size-sm;
    height: $icon-size-sm;
    font-size: $icon-size-sm;
    flex-shrink: 0;
  }
}

.tool-card-body {
  background: $surface-panel-muted;
  border-top: $border-width-base $border-style-base $border-color-muted;
}

.tool-running-banner {
  display: flex;
  align-items: center;
  gap: $space-sm;
  padding: $space-sm $space-md;
  color: $color-text-medium;
  background: rgba($color-secondary, 0.08);
  border-bottom: 1px solid $border-color-muted;
  font-size: 12px;
}

.tool-section {
  padding: $space-sm $space-md;

  & + & {
    border-top: 1px solid $border-color-muted;
  }
}

.tool-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: $color-text-dark;
  margin-bottom: $space-xs;
}

.tool-code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: $color-text-medium;
  white-space: pre-wrap;
  word-break: break-word;
}

.tool-args {
  summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: $space-sm;
    padding: $space-xs $space-md;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    color: $color-text-medium;
    background: $surface-panel-muted;

    &::-webkit-details-marker { display: none; }
    &:hover { background: $surface-panel-strong; }

    .tool-chevron {
      margin-left: auto;
      font-size: $icon-size-sm;
      color: $color-text-dark;
      transition: transform $motion-fast $motion-ease;
    }
  }

  &[open] > summary .tool-chevron {
    transform: rotate(180deg);
  }
}

.tool-cards-summary {
  display: inline-flex;
  align-items: center;
  gap: $space-sm;
  padding: $space-xs 0;
}

// A new tool card has to grow the list, not displace it: without the height the
// card below lands a full card lower in the space of one frame. The height comes
// from a grid row, not from a max-height or a measured pixel value — `0fr → 1fr`
// interpolates in every engine and resolves to whatever the card turns out to
// measure, so a live tool card, a plan block and the one-line "N tools" badge all
// grow by the right amount, and a card dropped off the front shrinks away again.
.tool-fade-item {
  display: grid;
  grid-template-rows: 1fr;
  transition: none;

  // A grid item's automatic minimum size would hold the row at the content
  // height and leave 0fr nothing to shrink; the overflow does the clipping.
  > * {
    min-height: 0;
    overflow: hidden;
  }
}

.tool-fade-enter-active,
.tool-fade-leave-active {
  transition:
    opacity $motion-base $motion-ease,
    transform $motion-base $motion-ease,
    grid-template-rows $motion-slow $motion-ease;
}

.tool-fade-enter-from,
.tool-fade-leave-to {
  opacity: 0;
  transform: translateY(-4px);
  grid-template-rows: 0fr;
}

.tool-result {
  font-size: 12px;
  line-height: 1.5;
  color: $color-text-medium;

  // Markdown content inside tool results uses normal font
  h1, h2, h3, h4 { color: $color-text-light; margin: $space-sm 0; }
  p { margin: $space-xs 0; }
  ul, ol { padding-left: $space-lg; margin: $space-xs 0; }
  li { margin-bottom: 2px; }
  blockquote {
    padding-left: $space-sm;
    border-left: $border-width-accent $border-style-base $color-secondary;
    color: $color-text-medium;
    margin: $space-xs 0;
  }
  code {
    font-family: "IBM Plex Mono", monospace;
    background: $surface-panel-strong;
    padding: 1px 4px;
    color: $color-cyan;
    font-size: 11px;
  }
  pre {
    margin: $space-xs 0;
    background: $surface-panel;
    border: $border-width-base $border-style-base $border-color-muted;
    overflow: hidden;
    code {
      display: block;
      padding: $space-sm;
      overflow-x: auto;
    }
  }
}

.result-line {
  font-family: "IBM Plex Mono", monospace;
  padding: 1px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

// Diff output (filesystem diff/edit_lines/smart_edit) — rendered line-by-line
// with a tight line-height so consecutive diff lines don't show the wide
// vertical gaps the generic result-line divs (line-height:1.5 + padding:1px 0)
// produce.
.result-line.diff-summary,
.result-line.diff-hunk,
.result-line.diff-add,
.result-line.diff-del,
.result-line.diff-ctx {
  padding: 0;
  line-height: 1.3;
}
// Fallback colouring for whole lines without a server-prefixed number
// (hunk/file headers, or older callers).
.result-line.diff-summary { color: $color-text-medium; }
.result-line.diff-hunk { color: $color-text-medium; }
.result-line.diff-add { color: $color-success; }
.result-line.diff-del { color: $color-error; }
.result-line.diff-ctx { color: inherit; }

// Numbered diff lines (the common case — the server prefixes "{marker} {num}│
// {content}"): only the {num} {marker} anchor takes the marker colour; the
// content reads neutral. Matches the TUI renderer (renderers/diff.py).
.diff-num-marker.diff-add { color: $color-success; }
.diff-num-marker.diff-del { color: $color-error; }
.diff-num-marker.diff-ctx { color: inherit; }
.diff-content { color: inherit; }

// Filesystem `read` output: header plaque (path accent, tail dim), optional
// ⚠ warning, then numbered body — the line number is the accent colour
// (navigation anchor), the content neutral. Matches the TUI _render_read.
.read-header-path { color: $color-accent; }
.read-header-rest { color: $color-text-medium; }
.read-warning { color: $color-warning; }
.read-num { color: $color-accent; }
.read-content { color: inherit; }

.json-object,
.json-array {
  font-family: "IBM Plex Mono", monospace;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: $space-xs 0;
}

.json-item {
  display: flex;
  align-items: baseline;
  gap: $space-xs;
  padding: 1px 0;
}

.json-key {
  color: $color-text-light;
  font-weight: 500;
  flex-shrink: 0;
}

.json-sep {
  color: $color-text-dark;
}

.json-value {
  color: $color-text-medium;
  word-break: break-word;
  white-space: pre-wrap;
}

.json-string { color: $color-success; }
.json-number { color: $color-warning; }
.json-bool   { color: $color-primary; }
.json-null   { color: $color-text-dark; font-style: italic; }
.json-empty  { color: $color-text-dark; font-style: italic; }

// ─── Subagent steps ────────────────────────────────────────────────────────
.subagent-steps {
  display: flex;
  flex-direction: column;
  gap: $space-xs;
  padding: $space-xs $space-md $space-md;
  background: $surface-panel-muted;
}

.subagent-planning-indicator {
  display: flex;
  align-items: center;
  gap: $space-sm;
  padding: $space-xs $space-md;
  font-size: 12px;
  font-style: italic;
  color: $color-text-dark;
  background: $surface-panel-muted;
}

// Background-task progress line inside a tool card (task_update events)
.task-update-step {
  display: flex;
  align-items: baseline;
  gap: $space-sm;
  padding: $space-xs $space-md;
  font-size: 12px;
  color: $color-text-medium;
  background: $surface-panel-muted;

  i { font-size: 14px; color: $color-warning; flex: none; }
  .task-step-tool { color: $color-text-light; font-weight: 500; }
  .task-step-status { color: $color-text-dark; font-style: italic; }
  .task-step-preview {
    color: $color-text-medium;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &.completed i { color: $color-success; }
  &.completed .task-step-status { color: $color-success; font-style: normal; }
  &.failed i, &.cancelled i { color: $color-error; }
  &.failed .task-step-status, &.cancelled .task-step-status { color: $color-error; font-style: normal; }

  .task-spin { animation: task-spin 1s linear infinite; }
}

@keyframes task-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.subagent-step {
  border: $border-width-base $border-style-base $border-color-muted;
  border-left-width: $border-width-accent;
  border-left-color: $color-secondary;
  border-radius: $border-radius-md;
  overflow: hidden;
  margin-bottom: 8px;
  font-size: 12px;

  &.is-success { border-left-color: $color-success; }
  &.is-error   { border-left-color: $color-error; }

  summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: $space-sm;
    padding: $space-xs $space-md;
    cursor: pointer;
    background: $surface-panel-muted;
    color: $color-text-medium;
    user-select: none;

    &::-webkit-details-marker { display: none; }
    &:hover { background: $surface-panel-strong; }
  }

  .tool-name {
    flex: 1;
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tool-running-time {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: $color-text-dark;
    white-space: nowrap;
  }

  .tool-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: $icon-size-sm;
    height: $icon-size-sm;
    font-size: $icon-size-sm;
    flex-shrink: 0;
  }

  .tool-chevron {
    font-size: $icon-size-sm;
    color: $color-text-dark;
    flex-shrink: 0;
    transition: transform $motion-fast $motion-ease;
  }

  &[open] > summary .tool-chevron {
    transform: rotate(180deg);
  }
}

// ─── Summary / compression notice ──────────────────────────────────────────
.summary-card {
  border: $border-width-base $border-style-base $border-color-muted;
  border-left-width: $border-width-accent;
  border-left-color: $color-info;
  border-radius: $border-radius-md;
  overflow: hidden;
  font-size: 13px;

  summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: $space-sm;
    padding: $space-sm $space-md;
    cursor: pointer;
    background: rgba($color-info, 0.08);
    color: $color-info;
    user-select: none;
    &::-webkit-details-marker { display: none; }
  }
}

.compression-notice {
  font-size: 12px;

  summary {
    list-style: none;
    text-align: center;
    padding: $space-sm;
    color: $color-text-dark;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: $space-sm;
    cursor: pointer;
    user-select: none;
    &::-webkit-details-marker { display: none; }

    &::before, &::after {
      content: '';
      flex: 1;
      height: 1px;
      background: $border-color-muted;
    }
  }

  .compression-counts {
    opacity: 0.7;
  }

  .compression-chevron {
    font-size: $icon-size-sm;
    transition: transform $motion-fast $motion-ease;
  }

  &[open] .compression-chevron {
    transform: rotate(180deg);
  }

  .compression-body {
    padding: $space-md;
    font-size: 13px;
    color: $color-text-medium;
    line-height: 1.6;
    background: $surface-panel-muted;
    border: $border-width-base $border-style-base $border-color-muted;
  }
}