/* A single reply toolbar, with secondary actions disclosed on demand. */
.chat-actionbar {
  position: relative;
  display: flex;
  align-items: center;
  flex: none;
  gap: 8px;
  padding: 10px 14px 4px;
  border-top: 1px solid var(--line);
  background: var(--panel, #202323);
}
.chat-actionbar > button,
.reply-tools > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--soft);
  color: var(--text);
  cursor: pointer;
}
.chat-actionbar #coach-open {
  background: var(--green);
  border-color: transparent;
  color: #09271d;
  font-weight: 700;
}
.chat-actionbar #coach-open:disabled { opacity: .5; }
.chat-actionbar #coach-open svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
#workspace .chat-actionbar > .send-mode-status {
  position: static;
  flex: 1;
  min-width: 0;
  padding: 0 4px;
  background: none;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Keep attachments beside the draft on wide screens. */
@media (min-width: 1101px) {
  #workspace div.composer { grid-template-columns: auto minmax(0, 1fr) auto; }
  #workspace .composer > #composer-tools { grid-column: 1; grid-row: 1; height: 44px; gap: 2px; }
  #workspace .composer > #composer, #workspace .composer > #expression-toggle { grid-column: 2; grid-row: 1; }
  #workspace .composer #send-button { grid-column: 3; grid-row: 1; }
  #workspace .composer #composer-hint.important-hint { grid-row: 2; }
  #workspace .composer .tool { width: 36px; min-width: 36px; min-height: 44px; }
}
@media (max-width: 760px) {
  .chat-actionbar { padding: 6px 8px 2px; gap: 6px; background: var(--panel, #101e27); }
  .chat-actionbar > button { min-height: 44px; padding: 7px 10px; font-size: 12px; }
  .reply-tools > summary { width: 44px; min-height: 44px; padding: 7px; }
  .reply-tools-label { display: none; }
  #workspace .chat-actionbar > .send-mode-status { font-size: 10px; padding-inline: 0; }
  .chat-overview-full { display: none; }
  .chat-overview-short { display: inline; }
  .chat-overview { right: 8px; width: calc(100% - 16px); max-height: calc(100% - 150px); }
  .chat-overview-heading { padding: 12px; }
  #workspace .chat-header .header-actions { gap: 4px; }
  #workspace .chat-header .header-actions > button { padding-inline: 8px; min-width: 40px; }
  #workspace .composer.tools-open .composer-toolbar { bottom: calc(100% + 58px); }
}

/* Bounded inline suggestions keep messages and the composer available. */
#workspace #coach-panel { flex:none; min-height:0; max-height:min(36dvh,330px); padding:0; overflow:hidden; border-top:1px solid var(--line); background:var(--panel,#14212b); }
#workspace #coach-panel:not(.hidden) { display:flex; flex-direction:column; }
#workspace #coach-panel .coach-status { flex:none; display:flex; flex-wrap:nowrap; align-items:center; gap:8px; padding:7px 12px; border-bottom:1px solid var(--line); background:var(--panel,#14212b); }
#workspace #coach-panel .coach-status > span { flex:1; min-width:0; white-space:nowrap; overflow:hidden; }
#workspace #coach-panel .coach-status strong,#workspace #coach-panel .coach-status small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#workspace #coach-panel .coach-status strong { max-width:none; font-size:12px; line-height:1.4; }
#workspace #coach-panel .coach-status small { font-size:11px; color:var(--muted); line-height:1.4; }
#workspace #coach-panel .coach-controls { flex:none; order:initial; gap:3px; }
#workspace #coach-panel .coach-controls button { min-height:32px; height:32px; padding:4px 7px; font-size:11px; }
#workspace #coach-panel #coach-close { width:34px; min-width:34px; padding:0; font-size:24px; line-height:1; border-radius:8px; }
#workspace #coach-panel #coach-close:hover { background:var(--soft); }
#workspace #coach-panel .coach-content { min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; padding:8px 12px; }
#workspace .coach-choice-workspace { display:grid; gap:7px; padding:0; }
#workspace .coach-choice-workspace h3 { margin:0; font-size:12px; color:var(--green); }
#workspace .coach-choice-workspace p { margin:0; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
#workspace .coach-choice-workspace small { font-size:11px; color:var(--muted); font-weight:400; }
.coach-choice-intent { display:flex; align-items:baseline; gap:8px; min-width:0; }
.coach-choice-intent h3 { flex:none; }
#workspace .coach-choice-intent p { min-width:0; font-size:12px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.coach-choice-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:5px; }
.coach-choice-tabs { display:flex; gap:4px; padding:3px; border-radius:8px; background:var(--soft); margin-bottom:6px; }
.coach-choice-tabs button { flex:1; min-width:0; min-height:32px; padding:5px 7px; border:1px solid transparent; border-radius:6px; color:var(--muted); background:transparent; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.coach-choice-tabs button[aria-selected=true] { color:var(--green); border-color:var(--line); background:var(--panel,#14212b); font-weight:650; }
.coach-choice-grid { display:block; }
.coach-choice-card { min-width:0; display:flex; flex-direction:column; gap:7px; padding:9px 10px; border:1px solid var(--line); border-radius:8px; background:var(--soft); }
.coach-choice-card[hidden] { display:none!important; }
.coach-choice-card[data-selected=true] { border-color:var(--green); }
#workspace .coach-choice-card .coach-choice-text { max-height:min(14dvh,128px); overflow:auto; overscroll-behavior:contain; white-space:pre-wrap; scrollbar-width:thin; }
.coach-choice-card > button { align-self:flex-end; min-height:34px; padding:6px 13px; font-size:12px; }
#workspace .coach-choice-card .coach-choice-warning { color:var(--warning); font-size:11px; }
.coach-choice-reasoning summary,#workspace #coach-panel .coach-details > summary { font-size:11px; color:var(--muted); cursor:pointer; }
.coach-choice-logic { margin-top:6px; padding:8px 10px; border-left:2px solid var(--green); border-radius:0 6px 6px 0; background:var(--soft); }
.coach-choice-logic h3 { margin-bottom:4px!important; }
#workspace #coach-panel .coach-details { max-height:none; overflow:visible; margin:4px 0 0; padding:0; }
#workspace #coach-panel .coach-product-reference { margin-top:8px; }
@media(max-width:760px) {
  #workspace #coach-panel { max-height:min(38dvh,300px); }
  #workspace #coach-panel .coach-status { padding:6px 8px; gap:4px; }
  #workspace #coach-panel .coach-content { padding:7px 8px; }
  #workspace #coach-panel .coach-controls button { min-height:36px; height:36px; padding-inline:5px; }
  #workspace #coach-panel #coach-close { width:36px; min-width:36px; }
  .coach-choice-tabs button { min-height:36px; padding-inline:4px; font-size:11px; }
  .coach-choice-card > button { min-height:40px; }
  .chat-actionbar #coach-open svg { display:none; }
}
