.message.assistant:has(.chat-graph) { flex: 1 1 0; min-width: 0; }
.chat-graph { position: relative; box-sizing: border-box; width: min(100%, 1050px); margin: 18px 0 12px; border: 1px solid #e0e0e0; border-radius: 11px; background: #fff; color: #111; font-family: Arial, Helvetica, sans-serif; overflow: hidden; }
.chat-graph-shell { position: relative; display: grid; grid-template-columns: minmax(190px, 44%) minmax(0, 1fr); width: 100%; aspect-ratio: 1.66 / 1; background: #fff; }
.chat-graph-expression-panel { position: relative; z-index: 2; min-width: 0; overflow: hidden; border-right: 1px solid #cfcfcf; background: #fff; }
.chat-graph-panel-toolbar { position: relative; display: flex; align-items: center; height: 37px; padding: 0 5px; border-bottom: 1px solid #d9d9d9; gap: 1px; }
.chat-graph-panel-toolbar > button { display: grid; place-items: center; flex: 0 0 31px; height: 30px; padding: 5px; border: 0; border-radius: 4px; color: #666; background: transparent; cursor: pointer; }
.chat-graph-panel-toolbar > button:hover:not(:disabled) { background: #f0f0f0; color: #222; }
.chat-graph-panel-toolbar > button:disabled, .chat-graph-panel-toolbar > button[aria-disabled="true"] { opacity: .35; cursor: default; }
.chat-graph-panel-toolbar svg, .chat-graph-expression-row svg, .chat-graph-view-controls svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-graph-toolbar-spacer { flex: 1; }
.chat-graph-add-menu { position: absolute; z-index: 8; top: 34px; left: 4px; width: 130px; padding: 4px 0; border: 1px solid #ccc; background: #fff; box-shadow: 0 2px 5px rgb(0 0 0 / 20%); }
.chat-graph-add-menu[hidden] { display: none; }
.chat-graph-add-menu button { display: block; width: 100%; padding: 7px 12px; border: 0; background: #fff; color: #444; text-align: left; cursor: pointer; }
.chat-graph-add-menu button:hover { background: #eee; }
.chat-graph-expression-row.chat-graph-table-row { grid-template-columns: 17px 21px minmax(0, 1fr) 27px; align-items: start; }
.chat-graph-table { padding: 8px 8px 10px; overflow-x: auto; }
.chat-graph-table table { border-collapse: collapse; font: italic 15px Georgia, serif; }
.chat-graph-table th, .chat-graph-table td { min-width: 60px; height: 25px; border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; text-align: center; }
.chat-graph-table th { font-weight: normal; border-bottom-color: #666; }
.chat-graph-table input { box-sizing: border-box; width: 60px; height: 28px; border: 0; background: transparent; font: inherit; text-align: center; }
.chat-graph-table-row > .chat-graph-expression-remove { margin-top: 3px; }
.chat-graph-table-color { align-self: start; margin-top: 7px; }
.chat-graph-add-regression { margin-top: 10px; padding: 4px 6px; border: 1px solid #ccc; border-radius: 3px; background: #fff; color: #555; cursor: pointer; font: 12px Arial, sans-serif; }
.chat-graph-table-regression { margin-top: 12px; color: #333; font: 13px Arial, sans-serif; }
.chat-graph-table-regression > select { display: block; max-width: 100%; padding: 5px; border: 1px solid #ccc; border-radius: 3px; background: #fff; color: #333; font: inherit; }
.chat-graph-table-regression > div { padding: 8px 2px; line-height: 1.6; overflow-wrap: anywhere; }
.chat-graph-residuals { font-size: 11px; color: #666; }
.chat-graph-residuals button { margin-left: 8px; padding: 2px 7px; border: 1px solid #bbb; border-radius: 3px; background: #fff; color: #444; cursor: pointer; }
.chat-graph-expression-list { height: calc(100% - 38px); overflow: auto; }
.chat-graph-expression-error { position: absolute; right: 0; bottom: 0; left: 0; padding: 8px 10px; border-top: 1px solid #e3e3e3; background: #fff; color: #a33; font-size: 12px; overflow-wrap: anywhere; }
.chat-graph-expression-row { position: relative; display: grid; grid-template-columns: 17px 21px minmax(0, 1fr) 27px; align-items: center; min-height: 39px; border-bottom: 1px solid #e3e3e3; background: #fff; }
.chat-graph-expression-result { grid-column: 3 / 5; padding: 0 10px 7px; color: #555; font: 13px Georgia, serif; text-align: right; overflow-wrap: anywhere; }
.chat-graph-expression-result.is-regression-result { padding: 2px 14px 12px; color: #555; font: 12px Georgia, 'Times New Roman', serif; text-align: left; }
.chat-graph-regression-details { display: grid; gap: 7px; max-width: 330px; }
.chat-graph-regression-heading { margin-bottom: 3px; color: #777; font: 9px Arial, Helvetica, sans-serif; letter-spacing: .02em; }
.chat-graph-regression-heading span { color: #888; }
.chat-graph-regression-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.chat-graph-regression-grid > span:nth-child(2) { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.chat-graph-regression-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 2px; }
.chat-graph-regression-bottom > div { min-width: 0; }
.chat-graph-regression-bottom button { margin-left: 7px; padding: 1px 5px; border: 1px solid #ccc; border-radius: 2px; color: #555; background: #fff; font: 10px Arial, sans-serif; cursor: pointer; }
.chat-graph-regression-residual-values { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; margin-top: 4px; }
.chat-graph-regression-residual-values[hidden] { display: none; }
.chat-graph-expression-result[hidden] { display: none; }
.chat-graph-slider-prompt { grid-column: 3 / 5; padding: 0 8px 7px; color: #777; font: 12px Arial, sans-serif; }
.chat-graph-slider-prompt[hidden] { display: none; }
.chat-graph-slider-prompt button { margin: 0 3px 0 0; padding: 2px 5px; border: 1px solid #ddd; border-radius: 3px; background: #f6f6f6; color: #555; cursor: pointer; }
.chat-graph-slider-controls { grid-column: 3 / 5; display: flex; align-items: center; gap: 5px; padding: 0 8px 8px; }
.chat-graph-slider-controls[hidden] { display: none; }
.chat-graph-slider-controls input[type="number"] { width: 39px; min-width: 0; padding: 2px; border: 0; border-bottom: 1px solid #ccc; background: transparent; color: #666; font: 12px Arial, sans-serif; text-align: center; }
.chat-graph-slider-controls input[type="range"] { flex: 1; width: 0; min-width: 25px; accent-color: #777; }
.chat-graph-parameter-bounds { grid-column: 3 / 5; display: flex; align-items: center; gap: 5px; padding: 0 8px 7px; color: #555; font: 13px Georgia, serif; }
.chat-graph-parameter-bounds[hidden] { display: none; }
.chat-graph-parameter-bounds input { width: 42px; min-width: 0; padding: 2px 3px; border: 1px solid #ddd; background: #fff; color: #222; font: inherit; text-align: center; }
.chat-graph-expression-number { align-self: start; padding-top: 3px; color: #888; font-size: 9px; text-align: center; }
.chat-graph-expression-color { display: grid; place-items: center; width: 19px; height: 19px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--expression-color); cursor: pointer; }
.chat-graph-expression-color:focus { outline: 0; box-shadow: none; }
.chat-graph-expression-row.is-expression-hidden .chat-graph-expression-color { color: #8a8a8a; background: #e5e5e5; }
.chat-graph-expression-row.is-expression-hidden .chat-graph-expression-input { opacity: .48; }
.chat-graph-expression-color svg { width: 17px; height: 17px; stroke-width: 2; }
.chat-graph-expression-input { display: block; box-sizing: border-box; width: 100%; min-width: 0; height: 37px; padding: 0 8px; border: 0; border-radius: 0; outline: 0; color: #222; background: transparent; font-family: Georgia, 'Times New Roman', serif; font-size: 15px; font-style: italic; caret-color: #222; }
.chat-graph-expression-input:focus { border: 0; outline: 0; box-shadow: none; background: transparent; }
.chat-graph-expression-input::placeholder { color: #777; opacity: 1; }
.chat-graph-expression-input[aria-invalid="true"] { color: #b3261e; }
.chat-graph-expression-math { display: block; box-sizing: border-box; width: 100%; min-width: 0; min-height: 37px; margin: 0; padding: 0 8px; border: 0; border-radius: 0; outline: 0; color: #222; background: transparent; font-size: 15px; font-style: normal; --caret-color: #222; --selection-background-color: rgb(120 120 120 / 24%); --contains-highlight-background-color: transparent; --placeholder-color: #777; --placeholder-opacity: 1; }
.chat-graph-expression-math:focus-within { outline: 0; box-shadow: none; background: transparent; }
.chat-graph-expression-math::part(container), .chat-graph-expression-math::part(content) { min-height: 37px; padding: 0; border: 0; background: transparent; }
.chat-graph-expression-math::part(menu-toggle), .chat-graph-expression-math::part(virtual-keyboard-toggle) { display: none; }
.chat-graph-style-menu { position: absolute; z-index: 7; display: grid; gap: 8px; box-sizing: border-box; width: 198px; padding: 8px; border: 1px solid #ccc; border-radius: 4px; background: #fff; box-shadow: 0 2px 5px rgb(0 0 0 / 20%); color: #333; font: 12px Arial, sans-serif; }
.chat-graph-style-menu[hidden] { display: none; }
.chat-graph-style-colors { display: grid; grid-template-columns: repeat(6, 24px); justify-content: space-between; gap: 4px; padding-bottom: 7px; border-bottom: 1px solid #e0e0e0; }
.chat-graph-style-colors button { width: 22px; height: 22px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: var(--style-color); box-shadow: 0 0 0 1px #ccc; cursor: pointer; }
.chat-graph-style-colors button[aria-pressed="true"] { box-shadow: 0 0 0 2px #555; }
.chat-graph-style-lines, .chat-graph-style-points { display: flex; align-items: center; gap: 4px; }
.chat-graph-style-lines button, .chat-graph-style-points button { display: grid; place-items: center; width: 32px; height: 27px; padding: 4px; border: 1px solid #ddd; border-radius: 3px; background: #fff; cursor: pointer; }
.chat-graph-style-lines button[aria-pressed="true"], .chat-graph-style-points button[aria-pressed="true"] { border-color: #7c9fbd; background: #edf4fa; }
.chat-graph-style-lines span { display: block; width: 22px; height: 0; border-top: 2px solid #444; }
.chat-graph-style-lines .is-dashed { border-top-style: dashed; }
.chat-graph-style-lines .is-dotted { border-top-style: dotted; }
.chat-graph-style-points span { width: 9px; height: 9px; border: 2px solid #444; border-radius: 50%; background: #444; }
.chat-graph-style-points .is-open { background: #fff; }
.chat-graph-style-width, .chat-graph-style-point-size { display: grid !important; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 6px !important; }
.chat-graph-style-menu input[type="range"] { width: 100%; margin: 0; accent-color: #555; }
.chat-graph-expression-remove { display: grid; place-items: center; width: 26px; height: 30px; padding: 5px; border: 0; border-radius: 4px; color: #c2c2c2; background: transparent; opacity: 1; cursor: pointer; }
.chat-graph-expression-row:hover .chat-graph-expression-remove, .chat-graph-expression-remove:focus-visible { color: #777; }
.chat-graph-expression-remove:hover { color: #555; }
.chat-graph-expression-remove svg { width: 17px; height: 17px; }
.chat-graph-settings-menu { position: absolute; top: 41px; right: 34px; z-index: 5; display: grid; gap: 5px; box-sizing: border-box; width: min(282px, calc(100% - 42px)); max-height: calc(100% - 48px); overflow: auto; padding: 9px 11px; border: 1px solid #d0d0d0; border-radius: 5px; background: #fff; box-shadow: 0 2px 7px rgb(0 0 0 / 18%); color: #333; font: 12px Arial, sans-serif; }
.chat-graph-settings-menu[hidden], .chat-graph-panel-expand[hidden] { display: none; }
.chat-graph-settings-menu label { display: flex; align-items: center; gap: 7px; min-height: 22px; cursor: pointer; }
.chat-graph-display-size { display: flex; gap: 8px; align-items: center; padding-bottom: 5px; border-bottom: 1px solid #e1e1e1; }
.chat-graph-display-size button { display: grid; place-items: center; width: 29px; height: 25px; border: 1px solid #ddd; border-radius: 3px; background: #fff; color: #555; cursor: pointer; }
.chat-graph-display-size button:last-child { font-size: 17px; }
.chat-graph-display-size button[aria-pressed="true"] { border-color: #7f9db9; background: #edf4fa; }
.chat-graph-setting-check input, .chat-graph-angle-settings input { margin: 0; accent-color: #2d70b3; }
.chat-graph-axis-settings { display: grid; gap: 4px; padding-top: 5px; border-top: 1px solid #e1e1e1; }
.chat-graph-axis-label { display: grid !important; grid-template-columns: 38px minmax(0, 1fr); }
.chat-graph-axis-bounds { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 5px; }
.chat-graph-axis-bounds input, .chat-graph-axis-label input, .chat-graph-axis-step input { box-sizing: border-box; width: 100%; min-width: 0; height: 23px; padding: 2px 5px; border: 1px solid #ccc; border-radius: 3px; background: #fff; color: #333; font: 12px Arial, sans-serif; }
.chat-graph-axis-step { display: grid !important; grid-template-columns: 38px minmax(0, 1fr); }
.chat-graph-angle-settings { display: flex; align-items: center; gap: 12px; padding-top: 6px; border-top: 1px solid #e1e1e1; }
.chat-graph-angle-settings label { min-height: 22px; }
.chat-graph-plot-area { position: relative; min-width: 0; min-height: 0; background: #fff; }
.chat-graph-canvas { position: absolute; inset: 0; box-sizing: border-box; width: 100%; height: 100%; overflow: hidden; border: 0 !important; border-radius: 0; background: #fff; }
.chat-graph-status, .chat-graph-warning { display: block; padding: 16px; color: #666; font-size: 13px; }
.chat-graph-warning { position: absolute; inset: auto 0 0; padding: 5px 8px; background: rgb(255 248 232 / 94%); color: #715617; font-size: 11px; }
.chat-graph-view-controls { position: absolute; top: 3px; right: 4px; z-index: 3; display: flex; flex-direction: column; gap: 2px; }
.chat-graph-view-controls button { display: grid; place-items: center; width: 26px; height: 26px; padding: 3px; border: 1px solid #dedede; border-radius: 3px; color: #555; background: #f5f5f5; box-shadow: 0 1px 2px rgb(0 0 0 / 8%); cursor: pointer; }
.chat-graph-view-controls button:hover { color: #222; background: #fff; }
.chat-graph-view-controls svg { width: 16px; height: 16px; stroke-width: 1.7; }
.chat-graph-panel-expand { position: absolute; top: 5px; left: 4px; z-index: 4; display: grid; place-items: center; width: 28px; height: 28px; padding: 4px; border: 1px solid #ddd; border-radius: 4px; color: #666; background: rgb(255 255 255 / 94%); cursor: pointer; }
.chat-graph-panel-expand svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chat-graph-step-controls { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 7px 10px; border-top: 1px solid #e0e0e0; }
.chat-graph-step-controls button { padding: 4px 9px; border: 1px solid #ddd; border-radius: 4px; background: #fff; color: #444; font: 12px Arial, sans-serif; cursor: pointer; }
.chat-graph-step-controls button:disabled { opacity: .4; cursor: default; }
.chat-graph-step-controls small { color: #777; font-size: 11px; }
.chat-graph:fullscreen { width: 100%; max-width: none; height: 100%; margin: 0; border: 0; border-radius: 0; }
.chat-graph:fullscreen .chat-graph-shell { height: calc(100vh - 38px); }
.chat-graph.is-panel-collapsed .chat-graph-shell { grid-template-columns: 0 minmax(0, 1fr); }
.chat-graph.is-panel-collapsed .chat-graph-expression-panel { visibility: hidden; border: 0; }
.chat-graph.is-large-display .chat-graph-expression-input { font-size: 18px; }
.chat-graph.is-large-display .chat-graph-expression-row { min-height: 45px; }
.chat-graph.is-reverse-contrast .chat-graph-canvas { filter: invert(1) hue-rotate(180deg); }
@media (max-width: 600px) {
    .chat-graph { width: min(100%, 525px); }
    .chat-graph-shell { grid-template-columns: minmax(145px, 44%) minmax(0, 1fr); }
    .chat-graph-expression-row { grid-template-columns: 17px 21px minmax(0, 1fr) 24px; }
    .chat-graph-expression-input { padding-inline: 4px; font-size: 13px; }
    .chat-graph-panel-toolbar { padding-inline: 2px; }
    .chat-graph-panel-toolbar > button { flex-basis: 27px; }
    .chat-graph-view-controls button { width: 24px; height: 24px; }
    .chat-graph-settings-menu { right: 31px; width: min(270px, calc(100% - 38px)); }
}
