.plot-block { margin-top: 28px; }
.plot-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.plot-header p { max-width: 700px; margin: 5px 0 0; color: var(--muted); }
.alpha-control { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; min-width: 190px; color: var(--muted-strong); font-size: 12px; }
.alpha-control output { color: var(--foreground); font-family: var(--font-mono); }
.alpha-control input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.alpha-control input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rail-alpha-control { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.plot-toolbar { display: flex; gap: 6px; }
.plot-action { min-height: 31px; padding: 5px 9px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--foreground); cursor: pointer; }
.plot-action:hover,
.plot-action[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-strong); }
.plot-action:focus-visible,
.legend-item:focus-visible,
.condition-slider:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.plot-workbench { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 20px; align-items: start; }
.plot-main { min-width: 0; }
.plot-shell { position: relative; overflow: hidden; border: 1px solid var(--border); background: #141412; }
.plot-controls { position: sticky; top: 78px; padding: 16px; border-left: 1px solid var(--border); }
.control-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--muted-strong); font-size: 13px; }
.control-value { color: var(--foreground); font-family: var(--font-mono); }
.condition-slider { width: 100%; accent-color: var(--accent); }
.slider-range { display: flex; justify-content: space-between; color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.plot-legend { display: grid; gap: 6px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.legend-item { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: center; padding: 6px 0; border: 0; background: transparent; color: var(--muted-strong); text-align: left; cursor: pointer; }
.legend-item[aria-pressed="false"] { opacity: 0.42; }
.legend-line { height: 0; border-top: 3px solid currentColor; }
.legend-line.is-dashed { border-top-style: dashed; }
.plot-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.time-control { width: 100%; margin-top: 14px; }
.time-control-label { display: flex; justify-content: space-between; gap: 20px; color: var(--muted-strong); font-size: 13px; }
.time-control output { color: var(--foreground); font-family: var(--font-mono); }
.time-slider { position: relative; height: 22px; margin-top: 5px; }
.time-slider-track { position: absolute; top: 50%; right: 0; left: 0; height: 4px; transform: translateY(-50%); border-radius: 2px; background: var(--border); }
.time-slider-track span { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: inherit; background: var(--accent); }
.time-slider input { position: absolute; inset: 0; width: 100%; height: 22px; margin: 0; pointer-events: none; appearance: none; background: transparent; }
.time-slider input::-webkit-slider-runnable-track { height: 4px; background: transparent; }
.time-slider input::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -7px; border: 0; border-radius: 50%; background: var(--accent); pointer-events: auto; appearance: none; cursor: ew-resize; }
.time-slider input::-moz-range-track { height: 4px; background: transparent; }
.time-slider input::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--accent); pointer-events: auto; cursor: ew-resize; }
.time-slider input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.time-slider input:disabled::-webkit-slider-thumb { background: var(--muted); cursor: default; }
.time-slider input:disabled::-moz-range-thumb { background: var(--muted); cursor: default; }
.time-range { display: flex; justify-content: space-between; margin-top: 3px; color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.plot-grid-line { stroke: #30322d; stroke-width: 1; }
.plot-zero-line { stroke: #777a70; stroke-width: 1.25; }
.plot-axis-line { stroke: #686b63; stroke-width: 1; }
.plot-tick-label,
.plot-axis-label { fill: #d6d4cb; font-family: var(--font-sans); }
.plot-tick-label { font-size: 12px; }
.plot-axis-label { font-size: 13px; font-weight: 500; }
.plot-series { fill: none; stroke-width: 3; vector-effect: non-scaling-stroke; }
.zoom-selection { fill: color-mix(in srgb, var(--accent) 16%, transparent); stroke: var(--accent); stroke-width: 1.25; stroke-dasharray: 4 3; pointer-events: none; }
.zoom-selection[hidden] { display: none; }
.plot-hit-area { fill: transparent; }

.plot-section { padding-top: 32px; }
.file-rail { justify-self: stretch; width: 100%; max-height: calc(100vh - 78px); overflow: hidden; padding-right: 18px; padding-left: 22px; }
.file-browser-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.selection-count { color: var(--muted); font-family: var(--font-mono); font-size: 11px; white-space: nowrap; }
.tree-actions { display: flex; gap: 6px; margin: 9px 0 12px; }
.metadata-status { margin: 0 0 10px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.metadata-status.is-error { color: var(--danger); }
.file-lists { max-height: calc(100vh - 260px); overflow: auto; padding: 0 4px 24px 0; scrollbar-color: var(--border) transparent; }
.file-list-section { padding: 0; border: 0; }
.file-list-heading { position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 7px 0 6px; border-bottom: 1px solid var(--border-soft); background: var(--background); }
.file-list-heading h3 { color: var(--muted-strong); font-size: 12px; font-weight: 500; }
.file-list-heading span { color: #77736b; font-family: var(--font-mono); font-size: 10px; }
.tree-section-controls { display: flex; align-items: center; gap: 7px; }
.tree-section-toggle { min-height: 24px; padding: 2px 5px; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.tree-section-toggle:hover { background: var(--surface); color: var(--foreground); }
.tree-section-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tree-section-toggle:disabled { opacity: 0.45; cursor: default; }
.file-tree { padding: 4px 0 10px; }
.file-tree[hidden] { display: none; }
.archived-files { margin-top: 8px; padding-top: 4px; border-top: 1px solid var(--border); }
.archived-files .tree-file { opacity: 0.72; }
.tree-empty { margin: 7px 0 12px; color: var(--muted); font-size: 11px; }
.file-menu-hint { margin: 8px 0 0; color: #77736b; font-size: 10px; }
.tree-folder summary {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 31px;
  color: var(--muted-strong);
  font-size: 13px;
  cursor: pointer;
  list-style: none;
}
.tree-folder summary::-webkit-details-marker { display: none; }
.tree-folder > div { margin-left: 8px; padding-left: 9px; border-left: 1px solid var(--border-soft); }
.folder-mark::before { content: "›"; display: block; color: var(--muted); transition: transform 140ms ease; }
.tree-folder[open] > summary .folder-mark::before { transform: rotate(90deg); }
.folder-count { color: #77736b; font-family: var(--font-mono); font-size: 10px; }
.tree-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 31px;
  color: var(--muted);
  font-size: 12px;
}
.tree-file:hover { color: var(--foreground); }
.tree-file:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tree-file[hidden] { display: none; }
.tree-file-select { display: grid; grid-template-columns: 16px minmax(0, 1fr) 10px; gap: 6px; align-items: center; min-width: 0; cursor: pointer; }
.tree-file-select input { accent-color: var(--accent); }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-error { color: var(--danger); font-weight: 600; }
.tree-file.is-loading .file-name { opacity: 0.5; }
.file-download { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 0 5px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted-strong); font-family: var(--font-mono); font-size: 9px; line-height: 1; text-decoration: none; }
.file-download:hover { border-color: var(--accent); color: var(--foreground); }
.file-download.is-disabled { opacity: 0.42; pointer-events: none; }
.skeleton-line { height: 12px; margin: 10px 0; background: var(--border-soft); }
.skeleton-line.short { width: 68%; }
.hysteresis-shell { min-height: 560px; }
.plotly-host { width: 100%; min-height: 560px; }
.plotly-host .modebar { right: 8px !important; top: 8px !important; }
.plotly-host .modebar-btn path { fill: var(--muted-strong) !important; }
.plotly-host .modebar-btn:hover path { fill: var(--foreground) !important; }
.plotly-host .ytitle { pointer-events: all; cursor: pointer; }
.plotly-host .ytitle:hover,
.plotly-host .ytitle:focus { fill: var(--accent-strong) !important; text-decoration: underline; outline: none; }
.empty-state { position: absolute; inset: 0; display: grid; place-content: center; padding: 28px; text-align: center; pointer-events: none; }
.empty-state[hidden] { display: none; }
.empty-state strong { font-size: 17px; }
.empty-state p { max-width: 330px; margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.selected-details { display: grid; gap: 14px; }
.selected-file { position: relative; padding-left: 14px; }
.series-color-picker { position: absolute; inset: 0 auto 0 0; width: 7px; background: var(--series); cursor: pointer; }
.series-color-picker:hover { width: 9px; }
.series-color-picker input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.series-color-picker:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.selected-file > strong,
.selected-file > span { display: block; overflow-wrap: anywhere; }
.selected-file > strong { font-size: 13px; }
.selected-file > span { margin-top: 2px; color: var(--muted); font-family: var(--font-mono); font-size: 10px; line-height: 1.45; }
.selected-file dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 8px 0 0; }
.selected-file dl div { min-width: 0; }
.selected-file dt { color: var(--muted); font-size: 10px; }
.selected-file dd { margin: 0; overflow: hidden; color: var(--muted-strong); font-family: var(--font-mono); font-size: 10px; text-overflow: ellipsis; }
.context-menu {
  position: fixed;
  z-index: 100;
  min-width: 168px;
  max-width: min(280px, calc(100vw - 16px));
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--foreground);
  box-shadow: 0 8px 24px rgb(0 0 0 / 35%);
}
.context-menu-label { overflow: hidden; padding: 6px 8px; color: var(--muted); font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.context-menu-separator { height: 1px; margin: 4px -4px; background: var(--border); }
.context-menu-item { display: flex; align-items: center; width: 100%; min-height: 30px; padding: 5px 8px; border: 0; border-radius: var(--radius); background: transparent; color: var(--foreground); font-size: 13px; text-align: left; cursor: default; }
.context-menu-item:hover,
.context-menu-item:focus-visible { outline: 0; background: color-mix(in srgb, var(--accent) 18%, var(--surface-strong)); }

.rename-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--foreground); }
.rename-dialog::backdrop { background: rgb(0 0 0 / 62%); }
.rename-dialog form { padding: 20px; }
.rename-dialog header { margin-bottom: 18px; }
.rename-dialog h2 { font-size: 19px; }
.rename-dialog header p { margin: 7px 0 0; overflow-wrap: anywhere; color: var(--muted); font-family: var(--font-mono); font-size: 10px; line-height: 1.45; }
.rename-dialog footer { display: flex; justify-content: flex-end; gap: 7px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
