/* Strategy conversation. Loaded after the builder's inline styles so these
   rules own the transcript, the question answer, and the saved-step sheet.
   A customer turn is a quiet card. Replies and the live phase line are text. */

@media (min-width:701px){
  .builder-grid.builder-stage-create .chat-card.has-strategy-sheet .chat-work{
    flex-direction:row;align-items:stretch;
    width:min(100%,1080px);margin-left:auto;margin-right:auto;
  }
  .builder-grid.builder-stage-create .chat-card.has-strategy-sheet .chat-messages-list{
    width:auto;margin-left:0;margin-right:0;
  }
  .builder-grid.builder-stage-create .chat-card.has-strategy-sheet .chat-form,
  .builder-grid.builder-stage-create .chat-card.has-strategy-sheet .chat-bottom-bar,
  .builder-grid.builder-stage-create .chat-card.has-strategy-sheet .chat-starters{
    width:min(100%,1080px);padding-right:328px;
  }
  .builder-grid.builder-stage-create .chat-card.has-strategy-sheet .strategy-sheet{
    flex:0 0 300px;margin:14px 14px 14px 0;overflow:auto;
  }
}
.strategy-sheet{
  display:flex;flex-direction:column;gap:8px;min-width:0;box-sizing:border-box;
  padding:14px;background:var(--bg);border:1px solid var(--border);border-radius:12px;
}
.strategy-sheet[hidden]{display:none}
.strategy-sheet-label{font-size:.75rem;line-height:1.3;color:var(--text-dim)}
.strategy-sheet-steps{
  margin:0;white-space:pre-wrap;overflow-wrap:anywhere;
  font:inherit;font-size:.84rem;line-height:1.45;color:var(--text);
}

.chat-messages-list::before{display:none}
.chat-work{
  flex:1 1 0;min-height:0;min-width:0;overflow:hidden;
  display:flex;flex-direction:column;
}
.chat-work > .chat-messages{min-width:0;min-height:0}
.chat-card.has-strategy-sheet .chat-work > .chat-messages{
  height:auto;align-self:stretch;overflow-y:auto;
}
.chat-msg{display:flex;flex-direction:column;gap:6px;max-width:100%;align-self:stretch}
.chat-msg.user,.chat-msg.assistant,.chat-msg.system{align-self:stretch;align-items:stretch}
.chat-msg.user{padding:2px 0 18px}
.chat-msg.assistant{padding:0 2px 18px}
.chat-bubble{
  padding:0;border:0;border-radius:0;background:transparent;
  font-size:.95rem;line-height:1.5;color:var(--text);
  white-space:pre-wrap;overflow-wrap:anywhere;
}
.chat-msg.user .chat-bubble{
  padding:10px 14px;border:1px solid var(--border-strong, #bfc6cc);
  border-radius:12px;background:var(--surface2, #f0f2f3);color:var(--text);
}
.chat-msg.assistant .chat-bubble{color:var(--text)}
.chat-msg.system{padding:0 0 12px}
.chat-msg.system .chat-bubble{
  color:var(--text-dim);font-size:.8rem;font-style:italic;
}
.chat-msg.chat-operational-notice{
  margin:4px 0 12px;padding:10px 12px;
  background:color-mix(in srgb,#A1372D 6%,var(--bg));
  border:1px solid color-mix(in srgb,#A1372D 24%,var(--border));
  border-radius:8px;
}
.chat-msg.chat-operational-notice .chat-bubble{
  color:var(--text);font-style:normal;font-size:.86rem;
}
.chat-msg.assistant.thinking{padding:0 2px 8px}
.chat-msg.assistant.thinking .chat-bubble{
  font-weight:400;font-size:.84rem;color:var(--text-dim, #596675);
}
.chat-msg.assistant.thinking [data-turn-step]{color:var(--text-dim, #596675)}
.turn-phase-clock{color:var(--text-dim);font-variant-numeric:tabular-nums;white-space:nowrap}
.builder-turn-progress{margin-top:4px;font-size:.84rem;color:var(--text-dim, #596675)}
.chat-thinking-cancel{
  border:0;background:transparent;color:#53489B;padding:2px 3px;
  font:700 .72rem/1.2 inherit;cursor:pointer;text-decoration:underline;
  text-underline-offset:2px;
}
.chat-thinking-cancel:hover{color:#372F73}
.chat-thinking-cancel:focus-visible{
  outline:2px solid var(--accent);outline-offset:2px;border-radius:3px;
}
.builder-turn-new-bot{
  border:0;border-radius:7px;background:var(--accent);color:#fff;
  padding:7px 11px;font:700 .75rem/1.2 inherit;cursor:pointer;
}
.builder-turn-new-bot:hover{filter:brightness(.94)}
.builder-turn-new-bot:focus-visible{
  outline:2px solid var(--accent);outline-offset:2px;
}

.chat-question-chips{
  display:flex;flex-direction:column;gap:6px;
  margin-top:8px;width:100%;
}
.chat-question-heading{
  font-size:.86rem;color:var(--text);line-height:1.4;
  margin-bottom:4px;font-weight:500;
}
.chat-question-chip{
  background:color-mix(in srgb,var(--accent) 6%,var(--surface));
  border:1px solid color-mix(in srgb,var(--accent) 25%,var(--border));
  color:var(--text);
  border-radius:10px;padding:10px 13px;
  font-size:.86rem;font-family:inherit;text-align:left;
  cursor:pointer;
  transition:background .12s,border-color .12s,transform .08s;
}
.chat-question-chip:hover{
  background:color-mix(in srgb,var(--accent) 14%,var(--surface));
  border-color:var(--accent);
}
.chat-question-chip:active{transform:scale(.985)}
.chat-question-chip.is-picked{
  background:color-mix(in srgb,var(--accent) 22%,var(--surface));
  border-color:var(--accent);font-weight:600;
}
.chat-question-chip.is-send{
  background:var(--accent);color:#fff;border-color:var(--accent);
  text-align:center;font-weight:600;margin-top:2px;
}
.chat-question-chip:disabled{
  opacity:.55;cursor:default;pointer-events:none;
}
.chat-question-chips.is-replied{gap:5px}
.chat-question-chips.is-replied .chat-question-heading{margin-bottom:1px}
.chat-question-answer{
  display:flex;justify-content:space-between;align-items:baseline;gap:12px;
  margin-top:10px;padding:10px 0 0;border-radius:0;background:transparent;
  border-top:1px solid var(--border);color:var(--text-dim);
  font-size:.84rem;line-height:1.35;font-weight:400;
}
.chat-question-answer .cqa-text{color:var(--text);font-weight:500}

.chat-usage-badge{
  margin-top:6px;font-size:.66rem;color:var(--text-dim);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  letter-spacing:.01em;opacity:.75;
  align-self:flex-end;
}
.chat-tool-calls{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;margin-top:8px}
.chat-tool-call{
  display:inline-flex;align-items:baseline;gap:8px;max-width:100%;
  background:transparent;border:0;border-radius:0;padding:3px 0;
  font-size:.84rem;color:var(--text);
}
.chat-tool-call .tc-icon{width:14px;height:14px;color:var(--text-dim);flex-shrink:0}
.chat-tool-call .tc-icon svg{width:100%;height:100%}
.chat-tool-call .tc-text{flex:1;min-width:0;overflow-wrap:anywhere}
.chat-tool-call.propose{background:transparent}
.chat-tool-call.propose .tc-icon{color:var(--accent)}
.chat-tool-call.propose.is-action{cursor:pointer}
.chat-tool-call.propose.is-action:hover .tc-text{color:var(--accent)}
.chat-tool-call.propose.is-action:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.chat-tool-call.propose.is-action::after{content:'View flow';font-size:.75rem;font-weight:600;color:var(--accent);white-space:nowrap}
.chat-tool-call.delete{background:transparent}
.chat-tool-call.delete .tc-icon{color:#B3261E}
