/* Bash toolview: same geometry/tokens as ToolRow (figma Bash · description),
   plus the expand-gated terminal card under the summary line. */

/* Summary line over the terminal card; the summary row keeps its own 24px
   height, so the card is a column around it rather than a change to it. */
.card {
  display: flex;
  flex-direction: column;
}

/* Expanded terminal card, matching ToolRow's terminalBody: 4px indent, l1
   hairline, and the max-height scroll on the card's own OUTPUT (banner stays
   pinned; 224px = the 260px card cap minus the ~36px banner); the margin
   replaces the primitive's standalone vertical margin with the flow's. */
.terminal {
  --dsl-terminal-font: var(--dsw-font-markdown-code-block-small);
  --dsl-terminal-line-height: 18px;
  --dsl-terminal-output-max-height: 224px;
  margin: 4px 0 4px 4px;
  border: 1px solid var(--dsw-alias-border-l1);
}

/* A bash execution error can settle without terminal-card material (for
   example, command cancellation). Preserve ToolRow's bounded IN/OUT fallback
   so the original command and full error remain available from this keyed row. */
.ioCard {
  display: flex;
  flex-direction: column;
  margin: 4px 0 4px 4px;
  border: 1px solid var(--dsw-alias-border-l1);
  border-radius: 12px;
  background: var(--dsw-alias-markdown-code-block);
  font: var(--dsw-font-markdown-code-block-small);
}

.ioSection {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 14px;
  align-items: baseline;
  padding: 12px 16px;
  max-height: 150px;
  overflow-y: auto;
}

.ioSection::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 6px;
}

.ioSection::-webkit-scrollbar-track {
  margin: 6px 0;
}

.ioLabel {
  position: sticky;
  top: 0;
  align-self: start;
  color: var(--dsw-alias-label-caption);
}

.ioDivider {
  flex: none;
  height: 1px;
  background: var(--dsw-alias-border-l2);
}

.ioText {
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--dsw-alias-label-secondary);
}

.ioText[data-error] {
  color: var(--dsw-alias-state-error-primary);
}

/* ToolRow's unified expand interaction, replicated per the registrant
   posture: pointer on the expandable row (the icon→chevron hover preview is
   the affordance, no row fill). */
.root[data-expandable] {
  cursor: pointer;
}

.root {
  position: relative; /* sweep-glare overlay anchor */
  overflow: hidden;
  display: flex;
  align-items: center;
  height: 24px;
  min-width: 0;
}

/* Running sweep glare — same deepsuite ShimmerText pattern as ToolRow. */
.root[data-state='running']::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 300px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--dsw-alias-bg-base) 60%, transparent) 55%,
    transparent 100%
  );
  animation: dsh-bash-row-sweep 2.6s ease-out infinite;
  pointer-events: none;
}

@keyframes dsh-bash-row-sweep {
  0% { left: -300px; }
  90%, 100% { left: 100%; }
}

.leading {
  position: relative; /* .chevronHover overlay anchor */
  flex: none;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  color: var(--dsw-alias-label-tertiary);
}

.chevron {
  color: var(--dsw-alias-label-secondary);
}

/* Hover preview on the expandable row: the idle icon crossfades (100ms) into
   a down chevron before the row is opened — same overlay as ToolRow. */
.iconIdle {
  display: inline-flex;
  opacity: 1;
  transition: opacity 100ms ease;
}

.chevronHover {
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0;
  transition: opacity 100ms ease;
}

.root:hover .iconIdle {
  opacity: 0;
}

.root:hover .chevronHover {
  opacity: 1;
}

.title {
  flex: none;
  font-size: 14px;
  line-height: 24px;
  color: var(--dsw-alias-label-secondary);
}

.sep {
  flex: none;
  width: 2px;
  height: 2px;
  border-radius: 1px;
  margin: 0 8px;
  background: var(--dsw-alias-label-caption);
}

.summary {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 24px;
  color: var(--dsw-alias-label-tertiary);
}

/* Error row's collapsed summary: the failure's first line in the error color. */
.errorSummary {
  color: var(--dsw-alias-state-error-primary);
}

/* Hover-revealed Inspect pill under the expanded terminal's bottom-left —
   ToolRow's .bodyWrap/.inspectButton treatment, replicated per the registrant
   posture: real flow (it reserves its line), revealed by hovering anywhere on
   the tool call — title row included — or by keyboard focus. */
.bodyWrap {
  display: flex;
  flex-direction: column;
}

.inspectButton {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 4px;
  margin: 4px 0 2px 4px;
  padding: 2px 8px;
  border: 1px solid var(--dsw-alias-border-l2);
  border-radius: 999px;
  /* Base background, not bg-overlay: the overlay token reads too heavy. */
  background: var(--dsw-alias-bg-base);
  color: var(--dsw-alias-label-secondary);
  font-size: 11px;
  line-height: 16px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 100ms ease;
}

.card:hover .inspectButton,
.inspectButton:focus-visible {
  opacity: 1;
}

/* Solid hover fill: the pill floats over terminal output, so a translucent
   hover token would let the text underneath bleed through. */
.inspectButton:hover {
  background: var(--dsw-alias-interactive-bg-hover-solid);
  color: var(--dsw-alias-label-primary);
}


.visuallyHidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
