/* Copilot shares the Wide Analytics rail, palette and controls. */
.copilot-root { --copilot-width: 390px; color: var(--ink, #14251e); font-size: 13px; line-height: 1.55; }
.copilot-root *, .copilot-root *::before, .copilot-root *::after { box-sizing: border-box; }
.copilot-panel {
  position: fixed; z-index: 40; top: var(--workspace-header-height, 64px); bottom: 0; right: 0;
  display: flex; flex-direction: column; width: var(--copilot-width); min-width: 0;
  padding: 16px; border-left: 1px solid var(--line, #dfe7e1); background: #fff;
  box-shadow: -8px 0 32px rgba(20, 37, 30, .025);
}
.copilot-root[data-side="left"] .copilot-panel { left: 0; right: auto; border-left: 0; border-right: 1px solid var(--line, #dfe7e1); box-shadow: 8px 0 32px rgba(20, 37, 30, .025); }
.copilot-header, .copilot-brand, .copilot-header-actions, .copilot-settings, .copilot-context, .copilot-composer-footer { display: flex; align-items: center; }
.copilot-header { flex: 0 0 auto; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.copilot-brand { gap: 10px; }
.copilot-brand img { display: block; }
.copilot-brand h2 { margin: 0; font-size: 19px; font-weight: 750; letter-spacing: -.04em; line-height: 28px; }
.copilot-header-actions { gap: 4px; }
.copilot-icon-button {
  display: inline-grid; place-items: center; flex: 0 0 40px; width: 40px; min-height: 40px; padding: 0;
  border: 1px solid var(--line, #dfe7e1); border-radius: 8px; background: white; color: #52645b; font-size: 20px; line-height: 1;
}
.copilot-icon-button img { display: block; opacity: .78; }
#copilot-send img { filter: invert(1); }
.copilot-icon-button:hover { background: #f3f7f2; color: var(--green, #176b4d); }
.copilot-icon-button[aria-pressed="true"] { background: #edf5ef; border-color: #c5ddcd; color: #176b4d; }
.copilot-settings { gap: 8px; flex: 0 0 auto; }
.copilot-settings label { display: block; min-width: 0; margin: 0; }
.copilot-model { flex: 1 1 auto; }
.copilot-reasoning { flex: 0 1 112px; }
.copilot-settings select, .copilot-history select {
  width: 100%; min-height: 40px; margin: 0; padding: 8px 26px 8px 10px; border: 1px solid var(--line, #dfe7e1);
  border-radius: 8px; background-color: white; color: var(--ink, #14251e); font-size: 12px; text-overflow: ellipsis;
}
.copilot-context { justify-content: space-between; gap: 8px; margin: 8px 0; min-height: 36px; font-size: 11px; color: var(--muted, #64736c); }
.copilot-context-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copilot-context-label::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #176b4d; vertical-align: middle; }
#copilot-history-toggle { min-height: 36px; padding: 4px 8px; border: 0; border-radius: 6px; background: transparent; color: #176b4d; font-size: 11px; font-weight: 650; }
#copilot-history-toggle:hover { background: #edf5ef; }
.copilot-history { flex: 0 0 auto; margin: 0 0 12px; padding: 12px; border: 1px solid var(--line, #dfe7e1); border-radius: 8px; background: #f8faf6; }
.copilot-history-selection { display: flex; gap: 8px; align-items: center; }
.copilot-history-selection select { min-width: 0; flex: 1 1 auto; }
.copilot-history-button { flex: 0 0 auto; min-height: 40px; padding: 8px 10px; border: 1px solid #cddcd2; border-radius: 6px; background: white; color: #52645b; font-size: 11px; line-height: 1.4; }
.copilot-history-button:hover { background: #f3f7f2; }
.copilot-delete-review { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line, #dfe7e1); font-size: 11px; }
.copilot-delete-review p { margin: 0 0 6px; overflow-wrap: anywhere; }
#copilot-delete-title { font-weight: 650; }
.copilot-delete-review > p:not(:first-child) { color: var(--muted, #64736c); }
.copilot-delete-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.copilot-delete-confirm { border-color: #e7c9c2; color: #8c3e34; }
.copilot-delete-confirm:hover { background: #fcf0ed; }
#copilot-delete-error { margin-top: 8px; color: #8c3e34; }
.copilot-history label { display: block; margin-bottom: 6px; color: var(--muted, #64736c); font-size: 11px; }
.copilot-messages { flex: 1 1 auto; min-height: 0; margin: 0 -4px 12px; padding: 4px 4px 12px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.copilot-welcome { padding: 32px 0 20px; }
.copilot-eyebrow { font-size: 9px; letter-spacing: .12em; font-weight: 700; color: #176b4d; }
.copilot-welcome h3 { margin: 8px 0 10px; max-width: 240px; font-size: 25px; line-height: 1.25; letter-spacing: -.04em; font-weight: 680; }
.copilot-welcome p { margin: 0; max-width: 280px; color: var(--muted, #64736c); font-size: 13px; line-height: 1.65; }
.copilot-prompts { display: grid; gap: 8px; margin-top: 24px; }
.copilot-prompts button { min-height: 40px; padding: 10px 12px; border: 1px solid var(--line, #dfe7e1); border-radius: 8px; background: white; color: #43584d; text-align: left; font-size: 12px; line-height: 1.5; }
.copilot-prompts button:hover { background: #f3f8f3; border-color: #bfd7c7; }
.copilot-message { margin: 0 0 24px; min-width: 0; overflow-wrap: anywhere; }
.copilot-message-label { margin-bottom: 6px; font-size: 10px; font-weight: 700; color: var(--muted, #64736c); }
.copilot-message-user { margin-left: 28px; }
.copilot-message-user .copilot-message-label { text-align: right; }
.copilot-message-user .copilot-message-body { padding: 12px; border-radius: 12px 12px 2px 12px; background: #e5f2e9; white-space: pre-wrap; }
.copilot-message-assistant .copilot-message-label { color: #176b4d; }
.copilot-message-body { font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.copilot-message-body p { margin: 0 0 10px; }
.copilot-message-body p:last-child { margin-bottom: 0; }
.copilot-message-body h3 { margin: 14px 0 8px; font-size: 14px; line-height: 1.45; font-weight: 700; }
.copilot-message-body ul { padding-left: 20px; margin: 8px 0 12px; }
.copilot-message-body li { padding-left: 2px; margin-bottom: 5px; }
.copilot-message-body pre { max-width: 100%; padding: 10px; overflow: auto; background: #f3f6f2; border-radius: 6px; font-size: 11px; line-height: 1.6; }
.copilot-message-body code { padding: 1px 3px; border-radius: 3px; background: #f0f5ef; font-size: 11px; }
.copilot-message a, .copilot-setup-link { color: #176b4d; text-underline-offset: 3px; }
.copilot-sources { display: grid; gap: 5px; margin-top: 12px; font-size: 11px; }
.copilot-sources-label { color: var(--muted, #64736c); font-size: 10px; font-weight: 650; }
.copilot-action { margin-top: 12px; padding: 12px; border: 1px solid #d5e5da; border-radius: 8px; background: #f7faf6; }
.copilot-action-button { display: inline-flex; align-items: center; max-width: 100%; text-decoration: none; min-height: 40px; padding: 8px 12px; border: 1px solid #c5d9cc; border-radius: 6px; color: #176b4d; background: white; font-size: 12px; font-weight: 650; line-height: 1.4; text-align: left; }
.copilot-action-status { display: block; margin-top: 6px; color: var(--muted, #64736c); font-size: 10px; line-height: 1.5; }
.copilot-undo { min-height: 40px; padding: 4px 0; border: 0; background: none; color: #176b4d; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.copilot-mapping-title { margin: 0 0 8px; font-size: 12px; font-weight: 700; }
.copilot-mapping-diff { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0 0 10px; font-size: 11px; }
.copilot-mapping-diff dt { color: #64736c; }
.copilot-mapping-diff dd { margin: 0; overflow-wrap: anywhere; }
.copilot-mapping-note { margin: 0 0 12px; font-size: 10px; line-height: 1.55; color: #64736c; }
.copilot-notice { flex: 0 0 auto; margin: 0 0 10px; padding: 8px 10px; border-radius: 6px; background: #edf5ef; color: #4c6355; font-size: 11px; line-height: 1.5; }
.copilot-retry { display: block; min-height: 40px; margin-top: 4px; padding: 4px 0; border: 0; background: transparent; color: inherit; text-decoration: underline; text-underline-offset: 3px; font-size: 11px; }
.copilot-notice.is-error { color: #8c3e34; background: #fcf0ed; }
.copilot-composer { flex: 0 0 auto; padding: 10px 10px 8px; border: 1px solid #cddcd2; border-radius: 10px; background: white; box-shadow: 0 2px 8px rgba(20, 37, 30, .025); }
.copilot-composer:focus-within { border-color: #6eaa83; box-shadow: 0 0 0 2px #e3f0e7; }
.copilot-composer textarea { display: block; width: 100%; min-height: 55px; max-height: 180px; resize: vertical; padding: 2px; border: 0; outline: none; background: white; color: #14251e; font-family: inherit; font-size: 13px; line-height: 1.6; }
.copilot-composer textarea::placeholder { color: #7b8982; }
.copilot-composer textarea:focus-visible { outline: none; }
.copilot-composer-footer { justify-content: space-between; gap: 8px; }
#copilot-shortcut { color: #8a968f; font-size: 9px; }
#copilot-send { width: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 8px; background: #176b4d; color: white; font-size: 24px; line-height: 1; }
#copilot-send:hover { background: #0e5139; }
.copilot-stop { min-height: 40px; padding: 0 10px; border: 1px solid #cddcd2; border-radius: 8px; background: white; color: #176b4d; font-size: 12px; }
.copilot-footnote { flex: 0 0 auto; margin: 8px 0 0; text-align: center; color: #8a968f; font-size: 9px; line-height: 1.4; }
.copilot-launcher { position: fixed; z-index: 35; top: calc(var(--workspace-header-height, 64px) + 16px); right: 0; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 14px; border: 1px solid #ccddcf; border-right: 0; border-radius: 10px 0 0 10px; background: white; box-shadow: 0 3px 12px rgba(20, 37, 30, .08); color: #176b4d; font-size: 12px; font-weight: 650; }
.copilot-root[data-side="left"] .copilot-launcher { left: 0; right: auto; border-left: 0; border-right: 1px solid #ccddcf; border-radius: 0 10px 10px 0; }
.copilot-resize { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; touch-action: none; }
.copilot-root[data-side="left"] .copilot-resize { left: auto; right: -4px; }
.copilot-resize:hover, .copilot-resize:focus-visible { background: rgba(23, 107, 77, .1); }
.copilot-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.copilot-backdrop { position: fixed; z-index: 39; inset: var(--workspace-header-height, 64px) 0 0; border: 0; padding: 0; background: rgba(20, 37, 30, .28); }
@media (min-width: 1001px) {
  .workspace-page[data-copilot-open][data-copilot-side="right"] .app-shell { padding-right: var(--copilot-width); }
  .workspace-page[data-copilot-open][data-copilot-side="right"] .workspace-topbar { margin-right: calc(-1 * var(--copilot-width)); }
  .workspace-page[data-copilot-open][data-copilot-side="left"] .app-shell { padding-left: var(--copilot-width); }
  .workspace-page[data-copilot-open][data-copilot-side="left"] .workspace-topbar { margin-left: calc(-1 * var(--copilot-width)); }
  .workspace-page[data-copilot-open] .page-heading { grid-template-columns: minmax(0, 1fr); }
  .workspace-page[data-copilot-open] .page-heading-actions { justify-content: flex-start; }
  .workspace-page[data-copilot-open] .report-filter-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); }
  .workspace-page[data-copilot-open] .report-action-buttons { flex-wrap: wrap; }
}
@media (max-width: 1000px) {
  .workspace-page[data-copilot-open] { overflow: hidden; }
  .copilot-panel { z-index: 45; width: min(var(--copilot-width), 100%); box-shadow: -12px 0 40px rgba(20, 37, 30, .13); }
  .copilot-resize { display: none; }
  .copilot-history-button, .copilot-icon-button, .copilot-settings select, .copilot-history select, .copilot-action-button, .copilot-prompts button, #copilot-history-toggle, .copilot-undo, #copilot-send, .copilot-stop { min-height: 44px; }
  .copilot-icon-button { width: 44px; flex-basis: 44px; }
  .copilot-composer textarea { font-size: 16px; }
  .copilot-root[data-side="left"] .copilot-panel { box-shadow: 12px 0 40px rgba(20, 37, 30, .13); }
}
@media (max-width: 380px) {
  .copilot-panel { padding: 12px; }
  .copilot-header-actions { gap: 2px; }
  .copilot-brand { gap: 7px; }
  .copilot-brand h2 { font-size: 17px; }
  .copilot-settings { gap: 6px; }
  .copilot-reasoning { flex-basis: 94px; }
}

/* One shared review surface for Manage and Copilot on every workspace page. */
.management-review { min-width: 0; color: #14251e; }
.management-review-notice { padding: 12px 16px; border: 1px solid #c6dfd0; border-radius: 8px; background: #dceee4; color: #0e5139; font-weight: 600; line-height: 1.5; }
.management-review-status { color: #64736c; overflow-wrap: anywhere; }
.management-review-error { padding: 12px; border: 1px solid #dfb9ad; border-radius: 8px; color: #8c3529; background: #fff4ee; overflow-wrap: anywhere; }
.management-review-operations { max-height: 520px; overflow: auto; overscroll-behavior: contain; min-width: 0; border: 1px solid #dfe7e1; border-radius: 8px; }
.management-review-operation { padding: 16px; border-bottom: 1px solid #dfe7e1; }
.management-review-operation:last-child { border-bottom: 0; }
.management-review-operation h4 { margin: 0 0 8px; line-height: 1.5; overflow-wrap: anywhere; }
.management-review-entity { color: #64736c; font-size: 12px; overflow-wrap: anywhere; }
.management-review-diff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.management-review-diff > div { min-width: 0; }
.management-review-diff pre { margin: 8px 0 0; max-height: 240px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.management-review-actions, .management-review-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.management-review button { min-height: 40px; padding: 8px 14px; border: 1px solid #dfe7e1; border-radius: 8px; background: #fff; color: #14251e; font: inherit; cursor: pointer; }
.management-review button.primary-button { border-color: #176b4d; background: #176b4d; color: #fff; }
.management-review button:disabled { cursor: default; opacity: .55; }
.management-review :focus-visible { outline: 3px solid #176b4d; outline-offset: 3px; }
.copilot-management-review .management-review-diff { grid-template-columns: minmax(0, 1fr); }
.copilot-management-review .management-review-operation { padding: 12px; }
.copilot-management-review .management-review-operations { max-height: 400px; }
@media (max-width: 640px) {
  .management-review-diff { grid-template-columns: minmax(0, 1fr); }
  .management-review button { min-height: 44px; }
  .management-review-actions > button { flex: 1 1 130px; }
}
