:root {
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: #252a31;
  background: #fff;
  font-synthesis: none;
  --border: #dcdfe4;
  --accent: #3f6fa8;
  --workspace-height: calc(100dvh - 90px);
  --collapsed-panel-size: 38px;
  --card-motion-duration: 280ms;
  --card-motion-easing: cubic-bezier(.22, .61, .36, 1);
}
* { box-sizing: border-box; font-family: Arial, sans-serif; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, select { background: #fff; border: 1px solid var(--border); border-radius: 3px; }
button { cursor: pointer; padding: 6px 10px; }
select:not(:disabled), input[type="range"]:not(:disabled), input[type="color"]:not(:disabled), input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled), input[type="file"]:not(:disabled), a[href] { cursor: pointer; }
button:hover:not(:disabled) { border-color: #8f9ba8; }
button:disabled, select:disabled, input:disabled { cursor: default; color: #a4a9af; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid #4275ba; outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.5px; font-weight: 600; white-space: nowrap; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; }
.app-header { min-height: 60px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.header-guidance { position: relative; flex: 1 1 320px; min-width: 320px; max-width: 600px; height: 34px; margin-left: auto; display: flex; align-items: center; justify-content: flex-end; text-align: right; font-size: 14px; line-height: 17px; color: #707782; }
.header-guidance:has(.notice:not(:empty)) > p { visibility: hidden; }
.dataset-controls { display: flex; align-items: center; gap: 7px; }
.dataset-controls select { padding: 6px 24px 6px 8px; max-width: 170px; font-size: 12px; }
.dataset-controls button { font-size: 12px; white-space: nowrap; }
main { padding: 14px 16px 16px; }
.notice { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; font: inherit; color: inherit; }
.notice:empty { display: none; }
.notice.error { color: #a13333; }
.workspace { height: var(--workspace-height); min-height: 600px; display: grid; grid-template-columns: minmax(0, 2.384fr) minmax(209.44px, .616fr); gap: 14px; }
.workspace.code-collapsed { grid-template-columns: minmax(0, 1fr) var(--collapsed-panel-size); }
.authoring-area { --history-height: clamp(120px, 18dvh, 158px); --history-row-height: var(--history-height); --history-reclaimed: 0px; min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(190px, calc((100% - 14px) * .342 + var(--history-reclaimed) / 2)) minmax(220px, 1fr) var(--history-row-height); gap: 12px; }
.history-collapsed .authoring-area { --history-row-height: var(--collapsed-panel-size); --history-reclaimed: calc(var(--history-height) - var(--history-row-height)); }
.visualizations { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.panel { min-width: 0; min-height: 0; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.visualizations > .panel { display: flex; flex-direction: column; padding: 9px 10px 5px; }
.panel-heading { min-height: 26px; display: flex; align-items: center; justify-content: space-between; gap: 7px; flex: none; }
.panel-heading button { padding: 3px 6px; font-size: 10px; color: #7b8189; }
.quiet { font-size: 10px; color: #91969d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-view { min-height: 0; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0; }
.chart-view.data-view { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 0; }
.current-panel-heading { justify-content: flex-start; flex-wrap: wrap; gap: 8px 12px; padding-bottom: 8px; }
.current-panel-heading h2 { flex: none; white-space: nowrap; }
.current-chart-toolbar { display:flex; flex:1 1 560px; min-width:0; flex-wrap:wrap; align-items:center; gap:6px 8px; }
.current-chart-toolbar:not(:has(#chart-typography:not([hidden]), .chart-zoom-tools:not([hidden]), #chart-exports:not([hidden]))) { display:none; }
.current-view-tools { display:flex; flex:none; align-items:center; gap:6px; margin-left:auto; }
.typography-toolbar { display:flex; align-items:center; gap:4px; flex:1 1 310px; min-width:310px; max-width:410px; font-size:11px; position:relative; z-index:7; }
.typography-toolbar select, .typography-toolbar summary, .typography-toolbar button, .typography-toolbar input[type="number"] { height:25px; font-size:11px; border:1px solid var(--border); border-radius:3px; background:#fff; color:#364152; }
.typography-toolbar select { flex:1 1 110px; min-width:0; width:110px; padding:2px 5px; }
/* Render the popup in the page so macOS system menus cannot flatten the font samples. */
@supports (appearance: base-select) {
  #chart-font, #chart-font::picker(select) { appearance:base-select; }
  #chart-font { align-items:center; overflow:hidden; white-space:nowrap; }
  #chart-font::picker(select) { min-width:180px; max-height:300px; overflow:auto; padding:4px; background:#fff; border:1px solid var(--border); border-radius:4px; box-shadow:0 3px 12px #00000014; }
  #chart-font option { padding:6px 8px; font-size:13px; border-radius:2px; white-space:nowrap; }
  #chart-font option:hover, #chart-font option:focus { background:#eef4fa; }
  #chart-font option:checked { background:#eaf3fd; }
}
.text-group-menu { position:relative; flex:1 1 110px; min-width:0; }
.text-group-menu summary { cursor:pointer; padding:4px 5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.text-group-list { position:absolute; top:29px; left:0; width:180px; padding:5px; border:1px solid var(--border); border-radius:4px; background:#fff; box-shadow:0 3px 12px #00000014; z-index:20; }
.text-group-list label { display:flex; align-items:center; gap:7px; padding:6px; margin:0; cursor:pointer; font-size:11px; }
.text-group-list label:hover, .text-group-list label:focus-within { background:#eef4fa; }
.text-group-list label:has(input:disabled) { color:#a5a9b0; cursor:default; }
.text-group-list input { margin:0; cursor:inherit; accent-color:#3377b4; }
.legend-selection-scopes { display:grid; grid-template-columns:1fr 1fr; gap:4px; padding:3px 0 6px; border-bottom:1px solid var(--border); margin-bottom:4px; }
.legend-selection-scopes button { padding:2px 5px; cursor:pointer; }
.legend-selection-scopes button[aria-pressed="true"] { color:#096bc2; border-color:#096bc2; background:#eaf3fd; }
.clear-element-selection { width:100%; margin-bottom:4px; cursor:pointer; }
.chart-font-size { display:flex; flex:none; align-items:center; gap:2px; }
.chart-font-size button { width:24px; padding:0; }
.chart-font-size input { width:46px; text-align:center; padding:0 2px; appearance:textfield; -moz-appearance:textfield; }
.chart-font-size input::-webkit-inner-spin-button { appearance:none; }
.typography-toolbar :disabled { opacity:.55; cursor:default; }
.text-underlines { position:absolute; inset:0; pointer-events:none; z-index:8; }
.text-underlines span { position:absolute; height:0; border-bottom:1.5px solid #3276b6; }
.chart-exports { display: flex; align-items: center; gap: 3px; }
.chart-exports button { height: 25px; padding: 0 5px; white-space: nowrap; }
.chart-exports button:hover:not(:disabled) { background: #f3f5f7; border-color: #b6bcc5; color: #303944; }
#selection-controls { flex: 1 1 320px; min-width: 0; max-width: 420px; }
.selection-controls { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; gap: 8px; padding: 0; }
.selection-controls label { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0; font-size: 11px; line-height: 16px; font-weight: 600; color: #555; }
.selection-caption { flex: none; white-space: nowrap; }
.selection-controls select, .selection-empty { flex: 1; min-width: 0; height: 26px; margin: 0; border: 1px solid var(--border); border-radius: 3px; background: #fff; font-size: 11px; line-height: 16px; font-weight: 400; }
.selection-controls select { width: 0; padding: 0 6px; }
.selection-empty { display: block; padding: 4px 6px; color: #9299a2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-selection .selection-empty { border-color: #9db5d2; background: #f8faff; color: #4679b8; }
.data-table-scroll { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--border); border-radius: 3px; scrollbar-width: thin; cursor: pointer; }
.data-table-scroll .dataset-table, .data-table-scroll .dataset-table * { cursor: inherit; }
.dataset-table { --data-column-width: 58px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 9px; text-align: left; white-space: nowrap; width: max(100%, calc(var(--data-column-width) * var(--data-column-count))); }
.dataset-table col { width: var(--data-column-width); }
.dataset-table th, .dataset-table td { width: var(--data-column-width); max-width: var(--data-column-width); overflow: hidden; text-overflow: ellipsis; padding: 4px 5px; border-right: 1px solid #eceef0; border-bottom: 1px solid #eceef0; cursor: pointer; }
.dataset-table th { position: sticky; top: 0; z-index: 1; background: #f8f8f8; font-weight: 600; }
.dataset-table col, .dataset-table th { transition: background-color 120ms ease; }
.dataset-table .encoded-column { background-color: #e8eef5; }
.dataset-table th.encoded-column { background-color: #dce6f1; box-shadow: inset 0 -2px #7193ba; }
.dataset-table .column-hover, .dataset-table .column-focus { background-color: #edf3fa; }
.dataset-table th.column-hover, .dataset-table th.column-focus { background-color: #dce9f7; box-shadow: inset 0 -2px #7193ba; }
.dataset-table .encoded-column.column-hover, .dataset-table .encoded-column.column-focus { background-color: #dce7f4; }
.dataset-table .column-pressed { background-color: #c9dbee; }
.dataset-table th.column-pressed { background-color: #bfd4eb; box-shadow: inset 0 -2px #4679b8; }
.dataset-table .column-confirmed { animation: column-confirmed 420ms ease-out; }
@keyframes column-confirmed { from { background-color: #bad1eb; } }
.column-select { display: flex; align-items: center; width: 100%; min-width: 0; padding: 0; border: 0; border-radius: 0; font: inherit; font-weight: 600; background: transparent; text-align: left; }
.column-select:disabled { color: inherit; }
.column-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.column-full-label { position: absolute; top: 0; left: 0; display: flex; align-items: center; width: var(--column-label-width, max-content); min-width: 100%; max-width: var(--column-label-max-width, none); min-height: 100%; padding: 4px 5px; background: inherit; box-shadow: inset 0 -2px #7193ba; border-right: 1px solid #bdcde0; visibility: hidden; pointer-events: none; transform: translateX(var(--column-label-shift, 0px)); }
.column-full-name { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.dataset-table th.column-hover, .dataset-table th.column-focus { overflow: visible; z-index: 3; }
.dataset-table th.column-hover .column-full-label, .dataset-table th.column-focus .column-full-label { visibility: visible; }
.column-roles { flex: none; margin-left: 3px; font-size: 8px; color: #4679b8; }
.column-roles:not(:empty) { padding: 1px 3px; border-radius: 2px; background: #c7d8eb; color: #2f547e; }
.chart-transfer { position: fixed; z-index: 20; margin: 0; background: #fff; pointer-events: none; transform-origin: top left; will-change: transform; }
.chart-transfer-source > * { visibility: hidden; }
.empty-state { max-width: 290px; padding: 20px; color: #9299a2; text-align: center; font-size: 12px; line-height: 1.6; }
.options-section { container-type: inline-size; min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 10px; border: 1px solid var(--border); border-radius: 6px; }
.options-heading { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-bottom: 9px; }
.options-title-block { min-width: 0; }
.options-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.options-title-row h2 { white-space: nowrap; }
.action-search { flex: 0 1 160px; min-width: 105px; }
.action-search input { display: block; width: 100%; height: 30px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 3px; background: #fff; font-size: 12px; }
.action-search input::placeholder { color: #91969d; }
.options-tools, .cards-navigation { display: flex; align-items: center; gap: 7px; }
.options-tools { min-height: 32px; }
.history-controls { display: flex; gap: 4px; flex: none; }
.history-controls button { padding: 4px 7px; font-size: 11px; white-space: nowrap; }
.cards-navigation button { width: 24px; height: 23px; padding: 0; font-size: 18px; line-height: 1; }
.cards-navigation[hidden] { display: none; }
.option-groups { display: flex; gap: 10px; flex: none; }
.option-groups button { min-width: 90px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #2e4f69; border-color: rgba(var(--group-rgb), .34); background: rgba(var(--group-rgb), .1); transition: background 130ms ease, border-color 130ms ease; }
.option-groups button[aria-selected="true"] { color: #fff; border-color: var(--group-accent); background: var(--group-accent); box-shadow: 0 0 0 2px rgba(var(--group-rgb), .2); }
.options-section[data-option-group] { --accent: var(--group-accent); }
.options-section[data-option-group] .card { border-color: rgba(var(--group-rgb), .25); }
.options-section[data-option-group] .card.primary { border-color: var(--group-accent); background: linear-gradient(180deg, rgba(var(--group-rgb), .16), #fff 62%); }
.options-section[data-option-group] .card.secondary { border-color: rgba(var(--group-rgb), .42); background: linear-gradient(180deg, rgba(var(--group-rgb), .08), #fff 65%); }
.options-section[data-option-group] .card.selected,
.options-section[data-option-group] .card.expanded,
.options-section[data-option-group] .card:not(.disabled):hover,
.options-section[data-option-group] .card:not(.disabled):focus-within { border-color: var(--group-accent); }
.options-section[data-option-group] .control { border-color: rgba(var(--group-rgb), .42); }
.options-section[data-option-group] .parameter-choice[aria-pressed="true"] { border-color: rgba(var(--group-rgb), .55); background: rgba(var(--group-rgb), .1); color: var(--group-accent); }
.options-section[data-option-group] .parameter-choice:hover:not(:disabled),
.options-section[data-option-group] .parameter-choice.previewing { border-color: var(--group-accent); background: rgba(var(--group-rgb), .18); color: var(--group-accent); }
.cards { min-height: 0; min-width: 0; flex: 1; display: flex; flex-direction: row; gap: 10px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 5px; overscroll-behavior-x: contain; scrollbar-width: thin; scroll-snap-type: x proximity; }
.card-row { display: flex; align-items: flex-start; flex: 0 0 100%; width: 100%; gap: 8px; min-height: 150px; height: 100%; scroll-snap-align: start; }
.card-row[aria-busy="true"]:empty { background: #fff; border-radius: 4px; }
.card-row[aria-busy="true"] { pointer-events: none; }
.card-row[aria-busy="true"]:empty::before { content: "Preparing options…"; color: var(--muted); padding: 16px; font-size: 12px; }
.card-row[aria-busy="false"] { animation: cards-appear 280ms ease-out both; }
@keyframes cards-appear { from { opacity: 0; } to { opacity: 1; } }
.card { position: relative; flex: 1 1 0; min-width: 0; height: 150px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.card-space { flex: 1 1 0; min-width: 0; border: 1px solid transparent; visibility: hidden; pointer-events: none; }
.card.primary, .card.secondary, .card-space.primary, .card-space.secondary { flex-grow: 1.5; }
.card.primary { border-color: #7d7d7d; background: linear-gradient(155deg, #e6e6e6 0%, #f4f4f4 46%, #fff 100%); }
.card.secondary { border-color: #a3a3a3; background: linear-gradient(155deg, #eeeeee 0%, #f8f8f8 46%, #fff 100%); }
.card.selected { border-color: #91a6c1; }
.card.expanded { flex-grow: 2.4; height: 100%; border-color: #4679b8; }
.card:not(.disabled):hover, .card:not(.disabled):focus-within { border-color: #4679b8; }
.card.primary.selected { border-color: #7d7d7d; }
.card.secondary.selected { border-color: #a3a3a3; }
.card.primary.expanded, .card.primary:not(.disabled):hover, .card.primary:not(.disabled):focus-within { border-color: #606060; }
.card.secondary.expanded, .card.secondary:not(.disabled):hover, .card.secondary:not(.disabled):focus-within { border-color: #808080; }
.card.disabled { border-color: #e7e9ec; }
.card-top { display: block; width: 100%; flex: none; text-align: left; padding: 8px 8px 0; border: 0; border-radius: 0; background: transparent; }
.card-top:hover:not(:disabled) { border: 0; }
.card-title { display: flex; align-items: center; gap: 5px; min-height: 17px; min-width: 0; padding-right: 0; }
.card-title h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.expanded .card-title { padding-right: 46px; }
.rank { flex: none; font-size: 9px; font-weight: 400; color: #969da6; }
.method-name { height: 11px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; line-height: 11px; color: #a0a6ad; }
.thumbnail { position: relative; height: 86px; padding: 4px 0 2px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
body[data-phase="initial"] .card[data-control-count="0"].expanded .card-top { display: flex; flex-direction: column; flex: 1; min-height: 0; }
body[data-phase="initial"] .card[data-control-count="0"].expanded .method-name { flex: none; }
body[data-phase="initial"] .card[data-control-count="0"].expanded .thumbnail { height: auto; flex: 1; min-height: 0; width: 100%; }
body[data-phase="initial"] .card[data-control-count="0"] .card-controls { display: none; }
.card.disabled .card-title { color: #a8afb7; }
.unavailable { min-height: 110px; padding: 10px 0; display: flex; align-items: center; font-size: 10px; color: #a1a8b0; line-height: 1.4; }
.card-controls { min-height: 0; flex: 1; overflow: auto; padding: 0 8px 6px; border-top: 1px solid #f0f1f3; scrollbar-width: thin; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 160ms ease, visibility 0s var(--card-motion-duration); }
.card.expanded .card-controls { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 45ms, 0s; }
.control { display: block; margin-top: 6px; padding: 6px; border: 1px solid #bcbcbc; border-radius: 4px; background: #fff; transition: border-color 140ms ease; }
.card[data-control-count="4"] .control { margin-top: 4px; padding: 4px; }
.control:hover, .control:focus-within { border-color: #808080; }
.control > span { display: block; margin-bottom: 5px; font-size: 11px; line-height: 1.2; font-weight: 600; color: #444; }
.parameter-options { display: flex; flex-wrap: wrap; gap: 3px; padding: 0; }
.parameter-choice { max-width: 100%; padding: 2px 5px; border-radius: 3px; font-size: 12px; line-height: 1.1; text-align: left; overflow-wrap: anywhere; }
.parameter-choice[aria-pressed="true"] { border-color: #9db5d2; background: #edf3fb; color: #305f99; }
.parameter-choice:hover:not(:disabled), .parameter-choice.previewing { border-color: #4679b8; background: #dfeafa; color: #234c80; }
.control input { width: 100%; min-width: 0; padding: 4px 5px; font-size: 11px; border: 1px solid var(--border); border-radius: 3px; background: #fff; }
.number-control { --slider-thumb-size: 12px; position: relative; display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.number-control::after { content: ""; position: absolute; pointer-events: none; box-sizing: border-box; width: var(--slider-thumb-size); height: var(--slider-thumb-size); top: 50%; left: calc((100% - var(--slider-thumb-size)) * var(--slider-position, 0)); transform: translateY(-50%); border: 2px solid #4679b8; border-radius: 50%; background: #fff; }
.number-control[data-locked="true"]::after { background: #4679b8; }
.slider-control { cursor: pointer; user-select: none; }
.control > .slider-label { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.slider-value { flex: none; color: #4679b8; font-size: 10px; font-weight: 400; font-variant-numeric: tabular-nums; }
.number-control input[type="range"] { appearance: none; min-width: 24px; flex: 1; padding: 0; margin: 0; height: 16px; border: 0; background: transparent; }
.number-control input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: #d5dfe9; }
.number-control input[type="range"]::-webkit-slider-thumb { appearance: none; width: var(--slider-thumb-size); height: var(--slider-thumb-size); margin-top: -4.5px; opacity: 0; }
.number-control input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: #d5dfe9; }
.number-control input[type="range"]::-moz-range-thumb { box-sizing: border-box; width: var(--slider-thumb-size); height: var(--slider-thumb-size); opacity: 0; }
.options-section[data-option-group] .slider-value { color: var(--group-accent); }
.options-section[data-option-group] .number-control::after { border-color: var(--group-accent); }
.options-section[data-option-group] .number-control[data-locked="true"]::after { background: var(--group-accent); }
.apply-button { position: absolute; top: 8px; right: 7px; z-index: 1; width: auto; margin: 0; padding: 3px 7px; border-radius: 3px; border-color: var(--accent); background: var(--accent); color: #fff; font-size: 11px; line-height: 1.1; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 140ms ease, visibility 0s 140ms; }
.card.expanded .apply-button, .card:focus-within .apply-button { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.apply-button:hover:not(:disabled) { background: #325e92; border-color: #325e92; }
.apply-button:disabled { background: #f4f4f4; border-color: #ddd; color: #aaa; }
.card-error { color: #a13333; font-size: 10px; line-height: 1.4; margin-top: 5px; }
.card-error:empty { display: none; }
.history-section { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; padding-top: 10px; }
.history-heading { display: flex; align-items: center; gap: 14px; min-height: 26px; flex: none; padding: 0 10px; }
.history-section[data-collapsed="true"] { padding-top: 0; }
.history-section[data-collapsed="true"] .history-heading { flex: 1; padding-right: 6px; }
.history-section[data-collapsed="true"] h2 { font-size: 12px; color: #707782; }
.panel-toggle { flex: none; display: grid; place-items: center; width: 24px; height: 23px; padding: 0; font-size: 18px; line-height: 1; color: #707782; }
.panel-toggle svg { display: block; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.panel-toggle[aria-expanded="false"] svg { transform: rotate(180deg); }
.panel-toggle:hover:not(:disabled) { background: #f3f5f7; color: #303944; }
.history-heading .panel-toggle { margin-left: auto; }
.history-list { position: relative; display: flex; flex: 1; min-height: 0; min-width: 0; align-items: stretch; overflow-x: auto; overflow-y: hidden; padding: 6px 10px 8px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.history-item { --history-accent: #0a6fc2; --history-rgb: 10, 111, 194; flex: 0 0 150px; width: 150px; min-height: 0; display: flex; flex-direction: column; gap: 4px; padding: 5px; text-align: left; border: 1px solid rgba(var(--history-rgb), .4); border-radius: 3px; background: #fff; transition: border-color 140ms ease, box-shadow 140ms ease; }
.history-item + .history-item { margin-left: -1px; }
.history-thumbnail { display: flex; align-items: center; justify-content: center; min-height: 0; flex: 1; width: 100%; overflow: hidden; border: 1px solid rgba(var(--history-rgb), .45); border-radius: 2px; background: #fff; }
.history-caption { flex: none; font-size: 10px; line-height: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #53616f; }
.history-item[aria-current="step"] { border-color: var(--history-accent); box-shadow: inset 0 0 0 2px rgba(var(--history-rgb), .3); }
.history-item.future { background: #fafbfc; }
.history-item:hover:not(:disabled), .history-item.inspecting { border-color: var(--history-accent); box-shadow: inset 0 0 0 1px rgba(var(--history-rgb), .5); }
.history-scrub-bar { position: absolute; top: 6px; bottom: 8px; width: 2px; background: #65778a; pointer-events: none; opacity: 0; }
.history-list.is-scrubbing .history-scrub-bar, .history-list.has-pinned-history .history-scrub-bar { opacity: 1; }
.code-panel { container-type: inline-size; height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 10px 0 0; }
.code-panel .panel-heading { padding: 0 10px; }
.code-panel .code-panel-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 6px; }
.code-panel-heading .panel-toggle { padding: 0; font-size: 18px; }
.code-collapsed .code-panel .code-panel-heading { display: flex; flex-direction: column; gap: 12px; padding: 0 6px; }
.code-collapsed #toggle-code { order: -1; }
.code-collapsed #code-heading { writing-mode: vertical-rl; font-size: 12px; color: #707782; }
.code-panel-heading h2 { white-space: nowrap; }
.code-panel-heading .quiet { text-align: right; }
.code-tools { display: flex; align-items: center; gap: 3px; }
.code-tools button { flex: none; height: 23px; padding: 0; line-height: 21px; white-space: nowrap; }
.code-tools :is(#code-font-decrease, #code-font-increase) { width: 22px; font-size: 14px; }
.code-tools #code-export { width: 35px; font-size: 10px; }
.code-tools #code-copy { width: 65px; font-size: 10px; }
.code-tools button:hover:not(:disabled) { background: #f3f5f7; border-color: #b6bcc5; color: #303944; }
@container (max-width: 360px) {
  .code-panel:not([data-collapsed="true"]) .code-panel-heading { grid-template-columns: minmax(0, 1fr) auto; }
  .code-panel-heading h2 { grid-area: 1 / 1 / 2 / -1; padding-right: 30px; }
  .code-panel-heading .quiet { grid-area: 2 / 1; text-align: left; }
  .code-panel-heading .code-tools { grid-area: 2 / 2; }
  .code-panel-heading .panel-toggle { grid-area: 1 / 2; justify-self: end; }
  .code-collapsed #code-heading { padding-right: 0; }
}
.code-panel pre { min-height: 0; flex: 1; overflow: auto; white-space: pre; margin: 0; padding: 10px 0; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: var(--code-font-size, 11px); line-height: 1.7; tab-size: 2; }
.code-panel pre * { font-family: inherit; }
.code-line { display: flex; min-width: max-content; padding: 0 10px 0 8px; }
.line-number { flex: none; width: 24px; margin-right: 8px; text-align: right; color: #aaa; user-select: none; }
.diff-sign { display: inline-block; width: 12px; flex: none; color: #438252; user-select: none; }
.code-text { color: #555; }
.code-line.added { background: #edf7ef; }
.code-line.added .code-text { color: #286139; }
.code-call { display: block; }
.code-call-summary { display: flex; align-items: baseline; cursor: pointer; list-style: none; min-width: max-content; }
.code-call-summary::-webkit-details-marker { display: none; }
.code-call-summary::before { content: '\25B8'; width: 12px; flex: none; color: #999; text-align: center; }
.code-call[open] > .code-call-summary::before, .code-setup[open] > .code-call-summary::before { content: '\25BE'; }
.code-call[data-settling] > .code-call-summary::before { transition: transform 260ms cubic-bezier(.22, .61, .36, 1); }
.code-call[data-settling="folding"] > .code-call-summary::before { transform: rotate(-90deg); }
.code-call-summary .code-line { flex: 1; padding-left: 0; }
.code-call-summary:hover { background: #f5f7fa; }
.code-call-summary:focus-visible { outline: 2px solid #4275ba; outline-offset: -2px; }
.code-setup-summary .code-text { color: #9299a2; }
.code-setup-body { padding-left: 8px; }
.code-call[data-change="added"] > .code-call-summary { background: #edf7ef; }
.code-arguments .code-line { padding-left: 12px; }
.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; }
[hidden] { display: none !important; }
@media (max-width: 1000px) {
  .app-header { flex-wrap: wrap; gap: 9px 14px; }
  h1 { font-size: 22px; }
  .workspace, .workspace.code-collapsed { height: auto; min-height: 0; grid-template-columns: minmax(0, 1fr); }
  .authoring-area { --history-height: 130px; grid-template-rows: calc(228px + var(--history-reclaimed) / 2) calc(280px + var(--history-reclaimed) / 2) var(--history-row-height); }
  .code-panel { height: 350px; }
  .code-collapsed .code-panel { height: var(--collapsed-panel-size); padding-top: 0; }
  .code-collapsed .code-panel .code-panel-heading { flex: 1; flex-direction: row; justify-content: space-between; padding: 0 6px 0 10px; }
  .code-collapsed #toggle-code { order: 0; }
  .code-collapsed #code-heading { writing-mode: horizontal-tb; }
  #toggle-code svg { transform: rotate(90deg); }
  #toggle-code[aria-expanded="false"] svg { transform: rotate(270deg); }
  .card-row { min-width: 0; }
}
@media (max-width: 800px) {
  .options-heading, .options-title-row { flex-wrap: wrap; }
  .options-title-row { gap: 8px 12px; }
}
@media (max-width: 650px) {
  h1 { font-size: 21px; }
  .app-header { padding: 12px 14px; }
  .header-guidance { min-width: 0; flex-basis: 100%; max-width: none; font-size: 13px; }
  main { padding: 12px; }
  .authoring-area { grid-template-rows: auto calc(272px + var(--history-reclaimed) / 2) var(--history-row-height); }
  .visualizations { grid-template-columns: minmax(0, 1fr); }
  .visualizations > .panel { height: calc(186.2px + var(--history-reclaimed) / 4); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* A range is one parameter group with two compact continuous controls. */
.control > .control { border: 0; padding: 3px 0 0; margin: 0; background: transparent; }
.control input[type="color"] { width: 100%; height: 28px; padding: 2px; border: 1px solid #c9cdd1; border-radius: 3px; background: white; }

.parameter-choice.color-swatch { width: 22px; height: 22px; padding: 0; color: transparent; font-size: 0; border: 2px solid white; box-shadow: 0 0 0 1px #ccd0d4; }
.parameter-choice.color-swatch[aria-pressed="true"], .parameter-choice.color-swatch.previewing { box-shadow: 0 0 0 2px #333; }

.action-search { position: relative; }
.action-search input { padding-right: 25px; }
#clear-search { position: absolute; right: 3px; top: 4px; width: 22px; height: 22px; padding: 0; border: 0; font-size: 16px; background: transparent; }
.thumbnail.needs-adjustment { font-size: 10px; line-height: 1.4; color: #826551; text-align: center; }
.chart-dialog { width: min(1100px, 95vw); max-height: 95dvh; padding: 18px; border: 1px solid var(--border); border-radius: 6px; }
.chart-dialog::backdrop { background: #10182066; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
#enlarged-chart { height: min(75dvh, 780px); display: flex; }
@media (pointer: coarse) {
  button, select, .column-select { min-height: 40px; }
  .parameter-choice { padding: 8px; }
  .number-control input[type="range"] { height: 40px; }
  .number-control { --slider-thumb-size: 24px; }
  .number-control input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -10px; }
  .code-tools button { min-width: 40px; height: 40px; }
}
.card-notice{font:11px/1.35 Arial,sans-serif;color:#626b78;margin:5px 0 0}
.parameter-help{font:10px/1.35 Arial,sans-serif;color:#737b85;margin:4px 0 0}
.card-error.unchanged{color:#6b7280}

.palette-more { flex-basis: 100%; min-width: 0; }
.palette-more > summary { width: fit-content; cursor: pointer; font-size: 11px; line-height: 1.4; padding: 3px 6px; border: 1px solid var(--border); border-radius: 3px; background: #fff; }
.palette-more > summary:hover, .palette-more > summary:focus-visible { background: #f0f1f3; }
.palette-more-options { width: min(100%, 360px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; max-height: 142px; overflow-y: auto; margin-top: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 3px; background: #fff; scrollbar-width: thin; }
.palette-more-options .parameter-choice { text-align: left; overflow-wrap: anywhere; }

/* Native canvas and plot boundaries are separate direct-manipulation targets.
   Overlay controls never enter the exported SVG or change panel dimensions. */
.chart-view.canvas-editor { display: block; overflow: hidden; }
.canvas-stage { position: relative; flex: none; transform-origin: 0 0; }
.canvas-resize-overlay { position: absolute; inset: 0; pointer-events: none; }
.resize-boundary { position: absolute; box-sizing: border-box; border: 1px dashed #9ca3af; pointer-events: none; opacity: 0; }
.canvas-editor[data-resize-focus="canvas"]:not([data-guide-hover]) .canvas-boundary,
.canvas-editor[data-resize-focus="plot"]:not([data-guide-hover]) .plot-boundary,
.resize-boundary:focus-within { opacity: 1; }
.plot-boundary { border-color: #5884ab; }
.resize-label { position: absolute; top: 2px; left: 4px; background: #fffffff2; color: #626a74; padding: 1px 4px; font: 10px Arial, sans-serif; white-space: nowrap; }
.plot-boundary .resize-label { color: #40698d; top: -18px; }
.resize-handle { position: absolute; pointer-events: auto; touch-action: none; border: 0; padding: 0; min-width: 0; min-height: 0; background: transparent; border-radius: 0; }
.resize-e { right: -6px; top: 12px; width: 12px; height: calc(100% - 24px); cursor: ew-resize; }
.resize-w { left: -6px; top: 12px; width: 12px; height: calc(100% - 24px); cursor: ew-resize; }
.resize-s { left: 12px; bottom: -6px; height: 12px; width: calc(100% - 24px); cursor: ns-resize; }
.resize-se { right: -5px; bottom: -5px; width: 10px; height: 10px; border: 1px solid #7d8794; background: white; cursor: nwse-resize; }
.resize-handle:hover, .resize-handle:focus-visible { background: #5884ab25; outline: 1px solid #5884ab; }
.canvas-editor.resizing, .canvas-editor.resizing * { cursor: var(--resize-cursor) !important; user-select: none; }
@media (prefers-reduced-motion: reduce) { .canvas-resize-overlay { transition: none; } }

.view-mode { display:flex; flex:none; gap:0; }
.view-mode button { font-size:11px; padding:6px 8px; white-space:nowrap; border-radius:0; }
.view-mode button:first-child { border-radius:3px 0 0 3px; }
.view-mode button:last-child { border-radius:0 3px 3px 0; margin-left:-1px; }
:where(html[data-view-mode="preview"]) #view-mode [data-mode="preview"],
:where(html[data-view-mode="transition"]) #view-mode [data-mode="transition"],
:where(html[data-workspace-layout="horizontal"]) #workspace-layout [data-layout="horizontal"],
:where(html[data-workspace-layout="vertical"]) #workspace-layout [data-layout="vertical"] { background:#edf1f5; color:#283d53; border-color:#9daab8; z-index:1; }
:where(html[data-view-mode="transition"]) .visualizations { grid-template-columns:minmax(0,1fr); }
:where(html[data-view-mode="transition"]) .visualizations > section[aria-labelledby="preview-heading"] { display:none; }
:where(html[data-view-mode="transition"]) .visualizations #current-heading { display:none; }
#current { position:relative; }
.transition-surface { position:absolute; inset:0; padding:12px; background:white; pointer-events:none; z-index:2; contain:strict; }
.transition-active .guide-editor { display: none; }
.transition-active .canvas-resize-overlay { visibility:hidden; pointer-events:none; }
.transition-active > :not(.transition-surface) { visibility:hidden; }
@media(max-width:1200px) { .app-header { flex-wrap:wrap; } .header-guidance { min-width:180px; } }

/* Native Canvas charts keep logical sizing separate from display fitting. */
.chart-view canvas, .thumbnail canvas, .history-thumbnail canvas, #enlarged-chart canvas { display:block; width:100%; height:100%; object-fit:contain; min-width:0; min-height:0; }
.chart-view .canvas-stage > canvas { width:100%; height:100%; max-width:none; max-height:none; }

/* Vertical authoring has two independent, equal-height bands. Neither band's
   boundary moves on hover. Fixed columns also preserve slots on short pages. */
:where(html[data-workspace-layout="vertical"]) .workspace .authoring-area {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(430px, 1fr) var(--history-row-height);
}
:where(html[data-workspace-layout="vertical"]) .workspace .visualizations { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); }
:where(html[data-workspace-layout="vertical"][data-view-mode="transition"]) .workspace .visualizations { grid-template-rows: minmax(0, 1fr); }
:where(html[data-workspace-layout="vertical"]) .workspace .history-section { grid-column: 1 / -1; }
:where(html[data-workspace-layout="vertical"]) .workspace .options-heading { flex-wrap: wrap; gap: 5px; }
:where(html[data-workspace-layout="vertical"]) .workspace .options-title-block { flex: 1 1 100%; }
:where(html[data-workspace-layout="vertical"]) .workspace .options-title-row { flex-wrap: wrap; gap: 8px; }
:where(html[data-workspace-layout="vertical"]) .workspace .option-groups { gap: 5px; }
:where(html[data-workspace-layout="vertical"]) .workspace .option-groups button { min-width: 64px; padding: 0 9px; }
:where(html[data-workspace-layout="vertical"]) .workspace .action-search { flex: 1 1 130px; }
:where(html[data-workspace-layout="vertical"]) .workspace .options-tools { margin-left: auto; min-height: 26px; }
:where(html[data-workspace-layout="vertical"]) .workspace .card-row { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(150px, 1fr)); row-gap: 16px; }
:where(html[data-workspace-layout="vertical"]) .workspace .card-row::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid #eceef1; pointer-events: none; }
:where(html[data-workspace-layout="vertical"]) .workspace .card-row[aria-busy="true"]:empty::before { grid-column: 1 / -1; }
:where(html[data-workspace-layout="vertical"]) .workspace .card-row > :nth-child(1) { grid-area: 1 / 1 / 2 / 4; }
:where(html[data-workspace-layout="vertical"]) .workspace .card-row > :nth-child(2) { grid-area: 1 / 4 / 2 / 7; }
:where(html[data-workspace-layout="vertical"]) .workspace .card-row > :nth-child(3) { grid-area: 2 / 1 / 3 / 3; }
:where(html[data-workspace-layout="vertical"]) .workspace .card-row > :nth-child(4) { grid-area: 2 / 3 / 3 / 5; }
:where(html[data-workspace-layout="vertical"]) .workspace .card-row > :nth-child(5) { grid-area: 2 / 5 / 3 / 7; }
:where(html[data-workspace-layout="vertical"]) .workspace .card.expanded { height: 100%; }
@media (max-width: 1000px) {
  /* Keep both authoring columns usable on laptops and narrow windows. Code
     remains available below, or as its existing narrow collapsed rail. */
  :where(html[data-workspace-layout="vertical"]) .workspace:not(.code-collapsed) { grid-template-columns: minmax(0, 1fr); height: auto; }
  :where(html[data-workspace-layout="vertical"]) .workspace:not(.code-collapsed) .authoring-area { height: max(660px, var(--workspace-height)); }
  :where(html[data-workspace-layout="vertical"]) .workspace:not(.code-collapsed) .code-panel { height: 280px; }
}

/* Dividers occupy only existing panel gaps; charts and cards stay mounted. */
.workspace { position: relative; }
.workspace-divider { position: absolute; z-index: 25; touch-action: none; outline: none; border-radius: 3px; }
.workspace-divider::after { content: ''; position: absolute; background: #c3cad2; border-radius: 2px; opacity: .45; transition: opacity 120ms; }
.workspace-divider[data-axis="x"] { cursor: col-resize; }
.workspace-divider[data-axis="y"] { cursor: row-resize; }
.workspace-divider[data-axis="x"]::after { width: 2px; height: 28px; left: 4px; top: calc(50% - 14px); }
.workspace-divider[data-axis="y"]::after { height: 2px; width: 28px; top: 4px; left: calc(50% - 14px); }
.workspace-divider:hover, .workspace-divider:focus-visible { background: #edf0f4; }
.workspace-divider:hover::after, .workspace-divider:focus-visible::after { opacity: 1; background: #7d8997; }
.workspace.resizing-panels, .workspace.resizing-panels * { user-select: none !important; }
.workspace.resizing-panels[data-resize-axis="x"], .workspace.resizing-panels[data-resize-axis="x"] * { cursor: col-resize !important; }
.workspace.resizing-panels[data-resize-axis="y"], .workspace.resizing-panels[data-resize-axis="y"] * { cursor: row-resize !important; }
#reset-view-sizes { white-space: nowrap; }

.guide-editor { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.guide-control { position: absolute; border: 1px solid transparent; box-sizing: border-box; pointer-events: none; }
.guide-control.active { border-color: #5884ab; }
.guide-control.selected { border-color:#096bc2; box-shadow:0 0 0 1px #096bc233; }
.guide-control.selected .guide-hit { background:#096bc208; }
.guide-control.owner-active .guide-size, .guide-control.owner-active .guide-edge { visibility:visible; }
.guide-hit { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; border-radius: 0; pointer-events: auto; touch-action: none; }
.guide-hit:hover { background: transparent; }
.guide-delete, .guide-together, .guide-size { visibility: hidden; }
.guide-control.active .guide-delete, .guide-control.active .guide-together, .guide-control.active .guide-size { visibility: visible; }
.guide-control.owner-items-active > .guide-delete { visibility:visible; }
.guide-delete { position: absolute; right: -18px; top: -18px; z-index: 4; width: 18px; height: 18px; min-width: 0; padding: 0; border: 1px solid #5884ab; background: white; color: #315b7e; font: 16px/16px Arial; pointer-events: auto; cursor: pointer; }
.guide-delete:hover { color: #a12828; border-color: #a12828; background: #fff4f4; }
.panel-control.active { border-style: dashed; }
.guide-together { position: absolute; bottom: 100%; right: 0; padding: 0 3px; font: 9px Arial; background: white; pointer-events: auto; }
.guide-size { position: absolute; right: -5px; bottom: -5px; width: 10px; height: 10px; min-width: 0; min-height: 0; padding: 0; border: 1px solid #5884ab; border-radius: 0; background: white; pointer-events: auto; touch-action: none; cursor: nwse-resize; }
.guide-edge { position: absolute; visibility: hidden; pointer-events: auto; touch-action: none; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.guide-control.active .guide-edge { visibility: visible; }
.guide-edge-n, .guide-edge-s { left: 7px; right: 7px; height: 12px; cursor: ns-resize; }
.guide-edge-n { top: -9px; }
.guide-edge-s { bottom: -9px; }
.guide-edge-e, .guide-edge-w { top: 7px; bottom: 7px; width: 12px; cursor: ew-resize; }
.guide-edge-e { right: -9px; }
.guide-edge-w { left: -9px; }
.guide-edge-ne, .guide-edge-nw, .guide-edge-sw { width: 14px; height: 14px; }
.guide-edge-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.guide-edge-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.guide-edge-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.guide-edge:hover { background: #5884ab25; }
.guide-size::after { content: ''; position: absolute; inset: -4px; }
.compact-guide .guide-size { right: -9px; bottom: -9px; }
.compact-guide .guide-size::after { inset: 0; }
/* Legend containers do not create a stacking context: only their controls
   rise above neighboring hit areas. Subparts remain above whole-legend bodies. */
.legend-container > .guide-hit { z-index:2; }
.legend-container > .guide-size, .legend-container > .guide-edge { z-index:4; }
.legend-container > .guide-delete { z-index:5; }
.legend-container > .guide-size { right:-10px; bottom:-10px; }
.legend-container > .guide-size::after { inset:0; }
.legend-container > .guide-edge-n { top:-12px; }
.legend-container > .guide-edge-s { bottom:-12px; }
.legend-container > .guide-edge-e { right:-12px; }
.legend-container > .guide-edge-w { left:-12px; }
.legend-container > .guide-edge-ne { top:-14px; right:0; }
.legend-container > .guide-edge-nw { top:-14px; left:0; }
.legend-container > .guide-edge-sw { bottom:-14px; left:0; }
.editing-guide, .editing-guide * { user-select: none !important; }

/* Composition controls occupy the existing toolbar; edge controls never resize the canvas. */
.current-shell { position: relative; min-height: 0; flex: 1; display: flex; }
.add-adjacent { position: absolute; z-index: 14; width: 26px; height: 26px; padding: 0; font-size: 22px; line-height: 24px; background: #fff; border: 1px solid #cbd5e1; border-radius: 4px; opacity: 0; transition: opacity 120ms; cursor: pointer; }
.add-adjacent { pointer-events: none; }
.add-adjacent.nearby, .add-adjacent:focus-visible { opacity: 1; pointer-events: auto; }
.adjacent-placement-highlight { position: absolute; z-index: 13; pointer-events: none; outline: 2px solid #287cbd; background: #287cbd0c; border-radius: 2px; }
.add-adjacent:hover, .add-adjacent:focus-visible, .add-adjacent[aria-pressed="true"] { color: #086bb9; border-color: #5991c7; background: #edf5ff; }
.editing-target, .adjacent-controls, .adjacent-controls label { display: flex; align-items: center; gap: 6px; }
#editing-target { display: flex; align-items: stretch; gap: 8px; max-width: 420px; overflow-x: auto; padding: 2px; }
#editing-target .target-chart-group { display: flex; flex: none; border: 1px solid #d8dce4; border-radius: 4px; overflow: hidden; }
#editing-target .target-chart-group:has(button[aria-pressed="true"]) { border-color: #9cbce0; }
#editing-target .target-all { border: 1px solid #d8dce4; border-radius: 4px; }
#editing-target button { flex: none; border: 0; border-right: 1px solid #d8dce4; border-radius: 0; white-space: nowrap; font-size: 12px; padding: 5px 8px; }
#editing-target .target-chart-group button:last-child { border-right: 0; }
#editing-target button[aria-pressed="true"] { color: #086bb9; background: #eaf3fb; }
.options-tools { flex-wrap: nowrap; min-width: 0; margin-left: 0; }
.options-tools .cards-navigation, .options-tools .history-controls { flex: none; }
.options-tools .editing-target { min-width: 0; }
#editing-target { min-width: 0; }
#add-overlay { white-space: nowrap; }
.editing-target, .adjacent-controls { font-size: 12px; }
.adjacent-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 10px; padding-top: 8px; border-top: 1px solid #eceef1; gap: 8px 12px; }
.adjacent-controls > span { grid-row: 1; grid-column: 1 / -2; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.adjacent-controls .adjacent-source { font-weight: normal; }
.adjacent-controls > button { grid-row: 1; grid-column: -2; justify-self: end; height: 27px; padding: 3px 9px; font-size: 12px; }
.adjacent-controls label { min-width: 0; white-space: nowrap; }
.adjacent-controls select { min-width: 0; width: 100%; max-width: none; height: 28px; padding: 3px 5px; font-size: 12px; }
.adjacent-fields { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.adjacent-controls:has(.adjacent-fields) { display: flex; flex-wrap: wrap; gap: 8px; }
.adjacent-controls:has(.adjacent-fields) > span { flex-basis: 100%; }
.adjacent-controls:has(.adjacent-fields) > button { flex: none; margin-left: auto; }
.adjacent-controls > .adjacent-fields { flex: 1; min-width: min(200px, 100%); }
.adjacent-field { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 28px; padding-left: 8px; border: 1px solid #ccd9e6; border-radius: 4px; background: #f4f8fc; color: #314b67; }
.adjacent-field > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.adjacent-field > button { flex: none; width: 24px; height: 26px; padding: 0; border: 0; background: transparent; color: inherit; font-size: 17px; }
.adjacent-field > button:hover { background: #dfeaf5; }
.adjacent-field-picker { position: relative; }
.adjacent-field-picker > summary { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid #ccd9e6; border-radius: 4px; background: #fff; font-size: 19px; cursor: pointer; list-style: none; }
.adjacent-field-picker > summary::-webkit-details-marker { display: none; }
.adjacent-field-picker[open] > summary, .adjacent-field-picker > summary:hover { background: #eaf3fb; color: #086bb9; border-color: #9cbce0; }
.adjacent-field-menu { position: absolute; z-index: 30; top: calc(100% + 5px); left: 0; width: 220px; max-height: 240px; overflow: auto; padding: 6px; display: flex; flex-direction: column; gap: 3px; border: 1px solid #ccd9e6; border-radius: 4px; background: #fff; box-shadow: 0 3px 12px #1e293b18; }
.adjacent-field-menu button { flex: none; padding: 5px 6px; border: 0; text-align: left; overflow-wrap: anywhere; font-size: 12px; }
.adjacent-field-menu button:hover { background: #eaf3fb; }
.adjacent-field-menu > span { padding: 6px; color: #687587; }
@container (max-width: 1050px) {
  .options-heading { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  .workspace .options-tools { margin-left: 0; width: 100%; }
  .options-tools .editing-target { flex: 1; }
  #editing-target { max-width: 100%; }
  .option-groups { gap: 6px; }
  .option-groups button { min-width: 68px; padding: 0 9px; }
}
@container (max-width: 520px) {
  .adjacent-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.editing-target[hidden], .adjacent-controls[hidden], .add-adjacent[hidden] { display: none; }

.overlay-modes { display: inline-flex; gap: 4px; }
.overlay-modes button[aria-pressed="true"] { color: #086bb9; border-color: #9cbce0; background: #eaf3fb; }

/* The camera clips only the visualization, leaving panel headers and adjacent
   chart controls at their normal size. It never changes native chart geometry. */
.chart-viewport-clip { position: relative; display: flex; flex: 1; min-width: 0; min-height: 0; overflow: hidden; }
.chart-viewport-clip > .chart-view { width: 100%; flex: 1; min-width: 0; }
.chart-zoom-tools { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.chart-zoom-tools[hidden] { display: none; }
.chart-zoom-tools button { height: 25px; min-width: 23px; padding: 3px 5px; font: 11px Arial, sans-serif; }
.chart-zoom-value { min-width: 33px; text-align: center; font: 10px Arial, sans-serif; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-pannable .chart-view { cursor: grab; }
.chart-panning, .chart-panning * { cursor: grabbing !important; user-select: none; }
.chart-panning .guide-editor, .chart-panning .canvas-resize-overlay { pointer-events: none; visibility: hidden; }
.chart-viewport-clip:focus-visible { outline: 1px solid #7ca5d3; outline-offset: -1px; }

/* Keep each visibility switch directly beside its owning heading. */
.control > .control-caption {display:flex;align-items:center;justify-content:flex-start;gap:6px;flex-wrap:nowrap}
.parameter-toggles {display:inline-flex;align-items:center;gap:4px;flex:none}
.parameter-toggle {display:inline-flex;align-items:center;justify-content:center;min-width:30px;padding:2px 5px;font-size:10px;line-height:1.2;text-align:center;white-space:nowrap}
.parameter-toggle[aria-checked="true"] {background:rgba(var(--group-rgb,48,95,153),.12);border-color:var(--group-accent,#305f99);color:var(--group-accent,#305f99)}
.parameter-toggle[aria-checked="false"] {background:#f4f5f7;color:#737b87;border-color:#d7dce3}
.control-caption .slider-value {margin-left:auto}

.canvas-text-editor { position:absolute; z-index:20; height:1px; padding:0; margin:0;
  border:0; transform-origin:0 0; overflow:visible; }
.canvas-text-editor textarea { position:absolute; box-sizing:border-box; min-width:0; max-width:none;
  min-height:0; padding:0; border:0; border-radius:0; margin:0; resize:none; overflow:hidden;
  background:transparent; outline:1px solid #1976d2; outline-offset:3px; box-shadow:none; }
.canvas-text-editor small { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.text-edit-error:empty { display:none; }
.text-edit-error { position:absolute; top:24px; width:220px; font:12px/1.4 Arial,sans-serif; color:#b42318; background:white; }
.text-editing .guide-editor, .text-editing .canvas-resize-overlay { display:none; }


.chart-text-alignment { display:flex; flex:none; gap:1px; }
.chart-text-alignment button { width:24px; padding:3px; display:grid; place-items:center; }
.chart-text-alignment svg { width:16px; height:16px; stroke:currentColor; stroke-width:1.3; fill:none; }
.chart-text-alignment button[aria-pressed="true"] { background:#eaf3fc; color:#0870be; border-color:#88bce6; }

/* History uses the same action colors in both views. Graph geometry is exactly
   half the Linear card at 100%; labels remain readable rather than scaling text. */
.history-views { flex: 1; min-width: 0; min-height: 0; display: flex; position: relative; }
.history-views > .history-list { width: 100%; }
.history-tools, .history-view-toggle, .history-graph-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.history-tools { gap: 10px; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.history-heading { gap: 10px; }
.history-heading h2 { flex: none; }
#history-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: 10px; }
.history-tools button { padding: 3px 6px; font-size: 10px; line-height: 14px; white-space: nowrap; }
.history-view-toggle { gap: 0; }
.history-view-toggle button { border-radius: 0; }
.history-view-toggle button:first-child { border-radius: 4px 0 0 4px; }
.history-view-toggle button:last-child { border-radius: 0 4px 4px 0; margin-left: -1px; }
.history-view-toggle button[aria-pressed="true"] { background: #eaf3fc; color: #0769b5; border-color: #92b9de; position: relative; }
.history-graph { position: relative; flex: 1; min-height: 0; min-width: 0; overflow: scroll; padding: 0; overscroll-behavior: contain; scrollbar-width: thin; cursor: grab; background: #fcfdfe; }
.history-graph.is-panning { cursor: grabbing; user-select: none; }
.history-graph-stage { pointer-events: none; }
.history-graph-edges { position: absolute; pointer-events: none; }
.history-graph-nodes { position: absolute; left: 0; top: 0; }
.history-item.history-graph-node { position: absolute; box-sizing: border-box; flex: none; margin: 0; padding: 2px; gap: 2px; transform-origin: top left; cursor: pointer; overflow: hidden; }
.history-graph-node .history-caption { font-size: 9px; line-height: 11px; }
.history-graph-node:not(.on-path):not([aria-current]) { border-color: #c6d0da; background: #f8fafc; }
.history-graph-node[aria-current="step"] { box-shadow: 0 0 0 2px var(--history-accent); }
.history-graph-node:focus-visible { outline: 2px solid #394a5a; outline-offset: 3px; }

/* Direct mark selection is explicit; ordinary guide editing stays unchanged. */
.panel:has(.mark-selection-panel:not([hidden])) { position: relative; }
.mark-selection-panel { position: fixed; z-index: 35; width: min(420px, 85%); max-height: 70%; overflow: auto; padding: 12px; border: 1px solid #9fb3ca; border-radius: 8px; background: white; box-shadow: 0 4px 20px #172b4d22; }
.mark-selection-panel[hidden] { display: none; }
.mark-selection-panel > * { margin: 3px; }
.mark-selection-panel > strong { display: block; }
.mark-selection-panel p { font-size: 12px; color: #556575; }
.mark-selection-rows { max-height: 210px; overflow: auto; }
.mark-selection-rows label { display: flex; gap: 8px; font-size: 12px; padding: 4px; }
.mark-selection-rows span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selecting-marks { cursor: crosshair; }
.selecting-marks .guide-editor, .selecting-marks .canvas-resize-overlay, .selecting-marks .add-adjacent { pointer-events: none; visibility: hidden; }

.mark-selection-panel { font-size: 13px; user-select: none; }
.mark-selection-panel button, .mark-selection-panel select, .mark-selection-panel input[type="search"] { font: inherit; padding: 5px 7px; border: 1px solid #ccd4df; border-radius: 4px; background: white; color: #27313e; }
.mark-selection-panel button:disabled { opacity: .45; }
