.center-head.center-head-ai-coach,
#aiCoachCenter {
  display: none;
}

body[data-agent="ai-coach"] .workspace-main {
  grid-template-columns: minmax(0, 1fr);
}

body[data-agent="ai-coach"] .rail,
body[data-agent="ai-coach"] #beoordelaarCenter,
body[data-agent="ai-coach"] #beoordelaarHistory,
body[data-agent="ai-coach"] #calcCenter,
body[data-agent="ai-coach"] .center-head-beoordelaar,
body[data-agent="ai-coach"] .center-head-calc,
body[data-agent="ai-coach"] .center-head-geschiedenis,
body[data-agent="ai-coach"] .center-head-products,
body[data-agent="ai-coach"] .center-head-product,
body[data-agent="ai-coach"] .center-head-webshop,
body[data-agent="ai-coach"] .center-head-onderzoeker,
body[data-agent="ai-coach"] .center-head-dashboard,
body[data-agent="ai-coach"] #productsCenter,
body[data-agent="ai-coach"] #productDetailCenter,
body[data-agent="ai-coach"] #webshopCenter,
body[data-agent="ai-coach"] #onderzoekerCenter,
body[data-agent="ai-coach"] #dashboardCenter {
  display: none !important;
}

body[data-agent="ai-coach"] #aiCoachCenter {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 0 12px 8px 0;
}

body[data-agent="ai-coach"] .center-head.center-head-ai-coach {
  display: flex;
  position: static;
  flex: 0 0 auto;
  width: min(100%, 920px);
  max-width: 920px;
  box-sizing: border-box;
  margin: 0 auto 10px;
  padding: 0 12px 0 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
}

body[data-agent="ai-coach"] .center-head-ai-coach .title {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

body[data-agent="ai-coach"] .center-head-ai-coach .subtitle {
  margin: 3px 0 0;
  max-width: 42em;
  font-size: 13px;
}

.coach-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
}

.coach-shell {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  align-self: center;
  min-width: 0;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  width: min(100%, 920px);
  max-width: 920px;
  box-sizing: border-box;
  gap: 14px;
}

.coach-shell.is-empty {
  justify-content: flex-start;
  gap: 0;
  padding-top: 30px;
  padding-bottom: 64px;
  overflow: visible;
}

.coach-shell.has-thread {
  padding-top: 0;
}

.coach-shell.is-empty .coach-thread {
  display: none;
}

.coach-shell.has-thread .coach-thread {
  display: flex;
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  overflow: visible;
}

.coach-shell.has-thread .coach-empty,
.coach-shell.has-thread .coach-examples {
  display: none;
}

.coach-history-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 8px;
  padding: 0;
  flex: 0 0 auto;
}

.coach-history-bar.is-blank {
  display: none;
}

.coach-history-new {
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--ice), var(--violet));
  color: #061018;
  border-radius: 18px;
  padding: 8px 14px;
  min-height: 36px;
  width: auto;
  margin-top: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: none;
}

.coach-history-new:hover,
.coach-history-new:focus-visible {
  filter: brightness(1.08);
  outline: 2px solid var(--ice);
  outline-offset: 2px;
}

.coach-history-new:disabled {
  opacity: 0.55;
  cursor: wait;
  filter: none;
}

.coach-history-insights {
  display: none;
}

.coach-history-menu {
  position: relative;
}

.coach-history-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.coach-history-menu summary::-webkit-details-marker {
  display: none;
}

.coach-history-menu summary:hover,
.coach-history-menu summary:focus-visible {
  border-color: color-mix(in srgb, var(--ice) 45%, var(--line));
  outline: 2px solid var(--ice);
  outline-offset: 2px;
}

.coach-history-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 8;
  min-width: 260px;
  max-width: min(92vw, 360px);
  max-height: min(52vh, 320px);
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 12px 28px color-mix(in srgb, #000 42%, transparent);
}

.coach-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.coach-history-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.coach-history-item:hover,
.coach-history-item:focus-visible,
.coach-history-item.is-on {
  background: color-mix(in srgb, var(--ice) 10%, var(--raise));
  outline: none;
}

.coach-history-item:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 0;
}

.coach-history-item strong {
  font-size: 13px;
  font-weight: 650;
}

.coach-history-item span {
  color: var(--muted);
  font-size: 12px;
}

.coach-insights-card {
  max-height: min(82vh, 720px);
  overflow: auto;
}

.coach-insights-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.coach-insights-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.coach-insights-stat {
  border: 1px solid var(--line);
  background: var(--raise);
  border-radius: 12px;
  padding: 10px 12px;
}

.coach-insights-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.coach-insights-feedback-empty {
  grid-column: 1 / -1;
  margin: 4px 0 0;
}

.coach-insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.coach-insights-grid h4,
.coach-insights-detail h4 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.coach-insights-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.coach-insights-list li,
.coach-insights-neg {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.coach-insights-neg {
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.coach-insights-neg:hover,
.coach-insights-neg:focus-visible {
  color: var(--text);
  outline: none;
}

.coach-insights-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.coach-insights-detail {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.coach-insights-detail p {
  margin: 0 0 10px;
}

.coach-compose {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
}

.coach-shell.is-empty .coach-compose {
  gap: 0;
}

.coach-shell.is-empty .coach-product-chip:not([hidden]),
.coach-shell.is-empty .coach-context-chips:not(:empty) {
  margin-bottom: 8px;
}

.coach-empty {
  margin: 0;
  padding: 0 12px;
  text-align: center;
}

.coach-shell.is-empty .coach-empty {
  margin-bottom: 40px;
}

.coach-empty-title {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 650;
  letter-spacing: -0.04em;
  margin: 0;
  line-height: 1.2;
  color: var(--text);
}

.coach-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.coach-product-chip,
.coach-extra-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 32px;
  padding: 4px 6px 4px 12px;
  border: 1px solid color-mix(in srgb, var(--ice) 34%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--ice) 8%, var(--panel));
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
  box-sizing: border-box;
}

.coach-extra-chip {
  padding: 6px 12px;
}

.coach-product-chip span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.coach-product-chip strong {
  font-weight: 650;
}

.coach-product-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.coach-product-clear:hover,
.coach-product-clear:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--ice) 14%, transparent);
  outline: 2px solid var(--ice);
  outline-offset: 1px;
}

.coach-thread {
  flex: 0 0 auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 4px 8px 0;
  box-sizing: border-box;
}

.coach-msg {
  max-width: min(92%, 720px);
  box-sizing: border-box;
  overflow-wrap: break-word;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

.coach-msg-text {
  white-space: pre-wrap;
}

.coach-answer-h {
  margin: 0.7em 0 0.2em;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.coach-answer-h:first-child {
  margin-top: 0;
}

.coach-md-list {
  margin: 0.55em 0 0.15em;
  padding-left: 1.15em;
  white-space: normal;
}

.coach-md-list li {
  margin: 0.28em 0;
  line-height: 1.5;
}

.coach-msg.is-user {
  align-self: flex-end;
  max-width: min(78%, 520px);
  margin-left: auto;
  padding: 8px 12px;
  font-size: 13.5px;
  line-height: 1.45;
  background: color-mix(in srgb, var(--ice) 11%, var(--raise));
  border-color: color-mix(in srgb, var(--ice) 22%, var(--line));
}

.coach-msg.is-coach {
  align-self: flex-start;
  margin-right: auto;
  background: color-mix(in srgb, var(--panel) 82%, var(--raise));
}

.coach-msg.is-thinking {
  display: flex;
  width: fit-content;
  max-width: min(92%, 720px);
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.coach-thinking {
  font-weight: 500;
}

.coach-msg.is-error {
  border-color: color-mix(in srgb, var(--afwijzen) 40%, var(--line));
  color: var(--copy);
}

.coach-sources {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.coach-sources summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  color: var(--muted);
}

.coach-sources summary:hover,
.coach-sources summary:focus-visible {
  color: var(--text);
  outline: 2px solid var(--ice);
  outline-offset: 2px;
}

.coach-sources summary::-webkit-details-marker {
  display: none;
}

.coach-sources-panel {
  margin-top: 6px;
}

.coach-sources-panel p {
  margin: 0;
}

.coach-sources-list {
  margin: 4px 0 0;
  padding-left: 18px;
}

.coach-feedback {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.coach-feedback-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 18px;
  padding: 3px 8px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.coach-feedback-btn:hover,
.coach-feedback-btn:focus-visible {
  color: var(--text);
  outline: 2px solid var(--ice);
  outline-offset: 2px;
}

.coach-feedback-btn.is-on {
  color: var(--text);
  border-color: color-mix(in srgb, var(--ice) 40%, var(--line));
  background: color-mix(in srgb, var(--ice) 10%, transparent);
}

.coach-retry {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 18px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.coach-retry:hover,
.coach-retry:focus-visible {
  border-color: color-mix(in srgb, var(--ice) 42%, var(--line));
  outline: 2px solid var(--ice);
  outline-offset: 2px;
}

.coach-open-product {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 18px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.coach-open-product:hover,
.coach-open-product:focus-visible {
  color: var(--text);
  outline: 2px solid var(--ice);
  outline-offset: 2px;
}

.coach-sources-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.coach-composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 8px 8px 8px 14px;
  border: 1px solid color-mix(in srgb, var(--ice) 32%, color-mix(in srgb, var(--violet) 22%, var(--line)));
  border-radius: 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ice) 7%, var(--panel)), color-mix(in srgb, var(--violet) 5%, var(--panel)));
  margin: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ice) 7%, transparent);
}

.coach-composer:focus-within {
  border-color: color-mix(in srgb, var(--ice) 58%, var(--violet));
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--ice) 18%, transparent),
    0 8px 24px color-mix(in srgb, var(--violet) 12%, transparent);
}

.coach-composer.is-sending {
  opacity: 0.86;
}

.coach-composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 140px;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  padding: 8px 4px;
}

.coach-composer textarea:focus {
  outline: none;
}

.coach-composer textarea:disabled {
  opacity: 0.7;
}

.coach-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  margin-top: 0;
  padding: 8px 14px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 650;
  color: #061018;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--ice), var(--violet));
  box-shadow: none;
}

.coach-send:hover:not(:disabled) {
  filter: brightness(1.08);
}

.coach-send:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 2px;
}

.coach-send:disabled {
  opacity: 0.55;
  cursor: wait;
}

.coach-examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 12px;
}

.coach-shell.is-empty .coach-examples {
  margin-top: 32px;
}

.coach-example {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  max-width: 100%;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  cursor: pointer;
}

.coach-example:hover,
.coach-example:focus-visible {
  border-color: color-mix(in srgb, var(--ice) 48%, var(--violet));
  background: color-mix(in srgb, var(--ice) 10%, var(--panel));
  outline: none;
}

.coach-example:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 2px;
}

.ask-ai-coach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 18px;
  padding: 7px 12px;
  min-height: 36px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.ask-ai-coach-btn:hover,
.ask-ai-coach-btn:focus-visible {
  border-color: color-mix(in srgb, var(--ice) 42%, var(--line));
  color: var(--text);
  outline: 2px solid var(--ice);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  body[data-agent="ai-coach"] .center-head.center-head-ai-coach {
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
  }

  body[data-agent="ai-coach"] #aiCoachCenter,
  body[data-agent="ai-coach"] .center-head.center-head-ai-coach {
    padding-right: 8px;
  }

  .coach-head-actions,
  .coach-history-bar {
    width: 100%;
    justify-content: flex-end;
  }

  .coach-shell {
    width: 100%;
    max-width: 100%;
    gap: 12px;
  }

  .coach-empty-title {
    font-size: 22px;
    text-align: left;
  }

  .coach-shell.is-empty {
    gap: 0;
    padding-top: 14px;
    padding-bottom: 40px;
  }

  .coach-shell.is-empty .coach-empty {
    margin-bottom: 24px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .coach-context {
    justify-content: flex-start;
  }

  .coach-examples {
    justify-content: flex-start;
    gap: 10px;
    padding: 0 4px;
  }

  .coach-shell.is-empty .coach-examples {
    margin-top: 20px;
  }

  .coach-insights-stats,
  .coach-insights-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .coach-composer {
    padding: 8px;
  }

  .coach-send {
    min-height: 40px;
  }

  .coach-msg,
  .coach-msg.is-user {
    max-width: 100%;
  }

  .coach-insights-stats,
  .coach-insights-grid {
    grid-template-columns: 1fr;
  }
}
