/* ONAC Data Analyser - builds on the site stylesheet (assets/css/style.css)
   and its tokens: light theme, purple accent, Inter. */

.da-page {
  --da-plot: #ffffff;
  --da-grid: #eef0f6;
  --da-axis: #d6d9e6;
  --da-cursor: #12172a;
  --da-marker: #a3a9c0;
  --da-side-w: 300px;
  --mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

/* ------------------------------------------------------------ shell */
.da-app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 62px);
  height: calc(100dvh - 62px);
  min-height: 560px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.da-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.da-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.da-title h1 { font-size: 19px; margin: 0; letter-spacing: -0.01em; max-width: none; line-height: 1.2; }
.da-breadcrumb { font-size: 13px; color: var(--text-muted); }
.da-breadcrumb a { color: var(--text-muted); }
.da-breadcrumb a:hover { color: var(--accent); }

.da-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-sm { padding: 7px 14px; font-size: 13.5px; }
.btn-xs { padding: 4px 10px; font-size: 12.5px; }
.btn:disabled, .da-tool:disabled, .da-seg button:disabled { opacity: 0.45; cursor: default; pointer-events: none; }

.da-seg {
  display: inline-flex; background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px; gap: 2px;
}
.da-seg button {
  background: transparent; border: 0; padding: 5px 13px; border-radius: 999px;
  font: 600 12.5px/1.2 inherit; font-family: inherit; color: var(--text-muted); cursor: pointer;
}
.da-seg button.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(18, 23, 42, 0.1); }

.da-btn-group { display: inline-flex; gap: 2px; }
.da-tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; min-width: 32px; padding: 0 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font: 600 12.5px/1 inherit; font-family: inherit; cursor: pointer;
}
.da-tool:hover { border-color: var(--accent); color: var(--accent); }
.da-tool.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-dark); }
.da-tool-text { padding: 0 11px; }

.da-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--da-side-w) minmax(0, 1fr);
}

/* ------------------------------------------------------------ side panel */
.da-side {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border-right: 1px solid var(--border);
}
.da-panel { padding: 12px 12px 8px; border-bottom: 1px solid var(--border); }
.da-panel:first-child { max-height: 46%; overflow-y: auto; overflow-x: hidden; }
.da-panel-grow { flex: 1; min-height: 0; display: flex; flex-direction: column; border-bottom: 0; }
.da-panel-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 8px; display: flex; align-items: center; gap: 8px;
}
.da-count { font-weight: 600; letter-spacing: 0; text-transform: none; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; font-size: 11.5px; }
.da-muted { color: var(--text-muted); }
.da-small { font-size: 12px; }
.da-pad { padding: 6px 2px; margin: 0; font-size: 13.5px; }

.da-sessions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.da-session {
  min-width: 0;
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; background: var(--surface);
  font-size: 13px;
}
.da-session.is-main { border-color: var(--accent-line); box-shadow: 0 0 0 2px var(--accent-soft); }
.da-session.is-error { border-color: #f0c6c2; background: #fdf3f2; }
.da-session-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.da-session-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.da-session-sub { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.da-role { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 5px; flex-shrink: 0; }
.da-role.main { background: var(--accent); color: #fff; }
.da-role.overlay { background: var(--bg-alt); color: var(--text-muted); border: 1px solid var(--border); }
.da-icon-btn {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: var(--text-muted); font-size: 16px; line-height: 1; cursor: pointer;
}
.da-icon-btn:hover { border-color: var(--border); color: var(--text); }
.da-session-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 7px; }
.da-session-controls:empty { display: none; }
.da-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; cursor: pointer; }
.da-check input { accent-color: var(--accent); margin: 0; }
.da-select-sm {
  flex: 1 1 140px; min-width: 0;
  font: inherit; font-size: 12.5px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 7px;
  background: #fff; color: var(--text); max-width: 100%;
}
.da-select-sm:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
.da-callout {
  margin-top: 7px; padding: 7px 9px; border-radius: 8px; background: var(--accent-soft);
  border: 1px solid var(--accent-line); color: var(--accent-dark); font-size: 12.5px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
}
.da-warnings { margin: 7px 0 0; padding: 0 0 0 16px; color: var(--warning); font-size: 12px; }
.da-warnings li { margin: 2px 0; }
.da-error { margin: 6px 0 0; color: var(--error); font-size: 12.5px; }
.da-details { margin-top: 6px; }
.da-details summary { cursor: pointer; font-size: 12px; color: var(--text-muted); }
.da-details summary:hover { color: var(--accent); }
.da-details table { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 12px; }
.da-details th { text-align: left; font-weight: 600; color: var(--text-muted); padding: 2px 8px 2px 0; vertical-align: top; white-space: nowrap; }
.da-details td { padding: 2px 0; word-break: break-word; }
.da-progress { height: 5px; border-radius: 99px; background: var(--bg-alt); overflow: hidden; margin: 8px 0 4px; }
.da-progress span { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.2s ease; }

.da-search {
  width: 100%; height: 34px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px;
  font: inherit; font-size: 13.5px; color: var(--text); background: #fff; margin-bottom: 6px;
}
.da-search:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
.da-channels { flex: 1; min-height: 80px; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.da-ch-group {
  position: sticky; top: 0; z-index: 1; background: var(--surface);
  font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
  padding: 6px 4px 3px; border-bottom: 1px solid var(--border);
}
.da-ch {
  position: relative; display: flex; align-items: baseline; gap: 8px; padding: 4px 26px 4px 8px; border-radius: 6px;
  font-size: 13px; cursor: grab; user-select: none;
}
.da-ch:hover { background: var(--bg-alt); }
.da-ch:focus { outline: 2px solid var(--accent-line); outline-offset: -2px; }
.da-ch.is-plotted .da-ch-name { color: var(--accent-dark); font-weight: 600; }
.da-ch.is-plotted::before { content: ""; position: absolute; left: 1px; top: 50%; width: 3px; height: 14px; margin-top: -7px; border-radius: 2px; background: var(--accent); }
.da-ch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.da-ch-meta { flex-shrink: 0; color: var(--text-muted); font-size: 11.5px; }
.da-ch-add {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--border); background: #fff;
  color: var(--accent-dark); font-weight: 700; line-height: 1; cursor: pointer; opacity: 0;
}
.da-ch:hover .da-ch-add, .da-ch:focus .da-ch-add { opacity: 1; }
.da-hint { margin: 6px 0 0; font-size: 12px; color: var(--text-muted); }

/* ------------------------------------------------------------ work area */
.da-work { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.da-sheets { position: relative; flex: 1; min-height: 0; padding: 0 10px; }
.da-sheet { position: absolute; inset: 0 10px; display: flex; flex-direction: column; min-height: 0; padding: 0; }
.da-sheet[hidden] { display: none; }
.da-graph {
  position: relative; width: 100%; height: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden; outline: none;
}
.da-graph:focus-visible { box-shadow: 0 0 0 3px var(--accent-line), var(--shadow); }
.da-statusbar {
  display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap;
  padding: 7px 14px 8px; font-size: 12.5px; min-height: 34px;
}
.da-readout { font-variant-numeric: tabular-nums; flex: 1; min-width: 0; }
.da-transport { display: inline-flex; align-items: center; gap: 6px; }
.da-transport[hidden] { display: none; }
.da-play {
  width: 30px; height: 26px; border-radius: 7px; border: 1px solid var(--accent-line); background: var(--surface); color: var(--accent-dark);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.da-play:hover { background: var(--accent-soft); }
.da-play .i-pause, .da-play[aria-pressed="true"] .i-play { display: none; }
.da-play[aria-pressed="true"] .i-pause { display: block; }
.da-play[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.da-readout b { font-weight: 700; }
.da-readout-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-right: 4px; }
.da-sep { color: var(--border); margin: 0 3px; }
.da-keys { color: var(--text-muted); font-size: 12px; }

.da-empty { position: absolute; inset: 10px 10px 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 16px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--accent-line); }
.da-empty[hidden] { display: none; }
.da-empty-card { max-width: 520px; text-align: center; }
.da-empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; }
.da-empty h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.01em; }
.da-empty p { color: var(--text-muted); font-size: 14.5px; margin: 0 0 20px; }
.da-empty code { background: var(--accent-soft); color: var(--accent-dark); padding: 1px 5px; border-radius: 4px; font-size: 0.88em; font-family: var(--mono); }
.da-privacy { display: inline-flex; align-items: center; gap: 6px; margin: 18px 0 0 !important; font-size: 13px !important; }

.da-dropzone {
  position: absolute; inset: 0; z-index: 30; display: none; align-items: center; justify-content: center;
  background: rgba(120, 88, 195, 0.1); border: 2px dashed var(--accent); border-radius: 4px; pointer-events: none;
}
.da-dropzone span { background: var(--accent); color: #fff; font-weight: 700; padding: 10px 20px; border-radius: 999px; }
.da-app.is-dropping .da-dropzone { display: flex; }

.da-toast {
  position: absolute; z-index: 40; left: 50%; bottom: 52px; transform: translateX(-50%);
  max-width: min(560px, calc(100% - 32px)); background: var(--code-bg); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow);
}
.da-toast[hidden] { display: none; }

/* ------------------------------------------------------------ graph internals */
.tg-scroll { position: absolute; left: 0; right: 0; top: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.tg-content { position: relative; }
.tg-stage { position: sticky; top: 0; z-index: 0; }
.tg-stage canvas { position: absolute; left: 0; top: 0; }
.tg-foot { position: absolute; left: 0; right: 0; bottom: 0; border-top: 1px solid var(--border); background: var(--surface); }
.tg-foot canvas { display: block; cursor: pointer; }
.tg-over { touch-action: none; cursor: crosshair; }
.tg-legends, .tg-dividers { position: absolute; left: 0; right: 0; top: 0; height: 0; pointer-events: none; z-index: 1; }
.tg-legend {
  position: absolute; pointer-events: auto; overflow: auto;
  background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(2px);
  border: 1px solid var(--border); border-radius: 8px; padding: 3px 4px;
  font-size: 12.5px; line-height: 1.35; box-shadow: 0 1px 2px rgba(18, 23, 42, 0.05);
}
.tg-legend:empty { display: none; }
.tg-li { display: flex; align-items: baseline; gap: 6px; padding: 1px 2px; }
.tg-li.is-hidden .tg-name, .tg-li.is-hidden .tg-val { opacity: 0.45; text-decoration: line-through; }
.tg-sw { align-self: center; width: 14px; height: 4px; border-radius: 2px; background: var(--c); border: 0; padding: 0; cursor: pointer; flex-shrink: 0; box-sizing: content-box; border-top: 5px solid transparent; border-bottom: 5px solid transparent; background-clip: padding-box; }
.tg-li.is-hidden .tg-sw { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.tg-name { flex-shrink: 0; font-weight: 600; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-val { flex: 1 1 auto; min-width: 0; font-variant-numeric: tabular-nums; color: var(--text); }
.tg-ov { white-space: nowrap; }
.tg-val b { font-weight: 600; }
.tg-ov { color: var(--text-muted); }
.tg-ov i { display: inline-block; width: 10px; height: 0; border-top: 2px dashed var(--c); vertical-align: middle; margin-right: 3px; }
.tg-ov small { font-size: 11px; }
.tg-unit { color: var(--text-muted); font-size: 11.5px; }
.tg-x { align-self: center; flex-shrink: 0; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 3px; opacity: 0; }
.tg-li:hover .tg-x, .tg-x:focus { opacity: 1; }
.tg-x:hover { color: var(--error); }
.tg-divider { position: absolute; pointer-events: auto; cursor: row-resize; }
.tg-divider::after { content: ""; position: absolute; left: 50%; top: 50%; width: 36px; height: 3px; margin: -1.5px 0 0 -18px; border-radius: 3px; background: var(--axis, #d6d9e6); opacity: 0; transition: opacity 0.15s; }
.tg-divider:hover::after { opacity: 1; background: var(--accent-line); }
.tg-drop { position: absolute; pointer-events: none; border: 2px dashed var(--accent); background: rgba(120, 88, 195, 0.08); border-radius: 4px; }

/* ------------------------------------------------------------ below the app */
.da-about { padding: 48px 0; }
.da-about .card h3 { font-size: 17px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .da-page { --da-side-w: 260px; }
  .da-keys { display: none; }
}
@media (max-width: 820px) {
  .da-app { height: auto; min-height: 0; }
  .da-body { grid-template-columns: 1fr; }
  .da-side { border-right: 0; border-bottom: 1px solid var(--border); max-height: none; }
  .da-panel:first-child { max-height: none; }
  .da-channels { max-height: 240px; }
  .da-work { order: -1; height: 80vh; min-height: 460px; }
  .da-sheets { padding: 0 8px; }
  .da-sheet { inset: 0 8px; }
  .da-empty { inset: 8px 8px 0; }
}
@media (max-width: 560px) {
  .da-topbar { padding: 10px 16px; }
  .da-tools { gap: 6px; }
  .da-tool-text { padding: 0 8px; }
  #da-reset { display: none; }
  .da-breadcrumb { display: none; }
}

/* ------------------------------------------------------------ worksheet tabs */
.da-tabs {
  display: flex; align-items: flex-end; gap: 2px; padding: 8px 10px 0; margin-bottom: 0; overflow-x: auto; scrollbar-width: thin;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.da-tab {
  display: inline-flex; align-items: center; gap: 6px; max-width: 240px; flex-shrink: 0;
  padding: 7px 8px 7px 12px; border: 1px solid transparent; border-bottom: 0; border-radius: 9px 9px 0 0;
  background: transparent; color: var(--text-muted); font: 600 13px/1.2 inherit; font-family: inherit; cursor: pointer;
  position: relative; top: 1px;
}
.da-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.6); }
.da-tab.is-active { background: var(--surface); color: var(--text); border-color: var(--border); }
.da-tab.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; top: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.da-tab:focus-visible { outline: 2px solid var(--accent-line); outline-offset: -2px; }
.da-tab-icon { display: inline-flex; color: var(--accent-dark); opacity: 0.85; }
.da-tab-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.da-tab-x { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; border-radius: 5px; font-size: 14px; color: var(--text-muted); opacity: 0; }
.da-tab:hover .da-tab-x, .da-tab.is-active .da-tab-x { opacity: 1; }
.da-tab-x:hover { background: var(--bg-alt); color: var(--error); }
.da-tab-input { font: 600 13px inherit; font-family: inherit; width: 160px; padding: 2px 6px; border: 1px solid var(--accent); border-radius: 5px; }
.da-tab-add {
  flex-shrink: 0; width: 30px; height: 30px; margin: 0 0 3px 4px; border-radius: 8px; border: 1px dashed var(--accent-line);
  background: transparent; color: var(--accent-dark); font-size: 18px; line-height: 1; cursor: pointer;
}
.da-tab-add:hover { background: var(--accent-soft); border-style: solid; }

.da-menu {
  position: fixed; z-index: 60; min-width: 220px; padding: 5px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(18, 23, 42, 0.16);
}
.da-menu[hidden] { display: none; }
.da-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text); font: 500 13.5px/1.3 inherit; font-family: inherit; text-align: left; cursor: pointer;
}
.da-menu button:hover, .da-menu button:focus { background: var(--accent-soft); color: var(--accent-dark); outline: none; }
.da-menu small { margin-left: auto; color: var(--text-muted); font-size: 11.5px; }
.da-menu-icon { display: inline-flex; color: var(--accent-dark); }
.da-menu-sep { height: 1px; background: var(--border); margin: 4px 6px; }

/* ------------------------------------------------------------ worksheets */
.sh-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 9px 0 8px; flex-shrink: 0; }
.sh-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.sh-field select {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--text); padding: 5px 8px; height: 32px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; max-width: 260px;
}
.sh-field select:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
.sh-spacer { flex: 1; }
.sh-subbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; padding: 0 0 6px; min-height: 22px; flex-shrink: 0; }
.sh-leg { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; }
.sh-leg i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; }
.sh-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.sh-ramp { display: inline-flex; align-items: center; gap: 6px; }
.sh-ramp-bar { display: inline-block; width: 110px; height: 8px; border-radius: 4px; }
.sh-status { margin-left: auto; }
.sh-body {
  position: relative; flex: 1; min-height: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
}
.sh-body > .da-graph { border: 0; border-radius: 0; box-shadow: none; }
.sh-body.sh-split { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.sh-body.sh-scroll { overflow: auto; }
.sh-plot { position: relative; width: 100%; height: 100%; min-height: 200px; }
.sh-stats { border-top: 1px solid var(--border); padding: 6px 12px 8px; overflow-x: auto; }
.sh-table { border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sh-table th, .sh-table td { padding: 4px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
.sh-table thead th { color: var(--text-muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; }
.sh-table tbody th, .sh-table td:first-child { text-align: left; }
.sh-report { padding: 8px 12px 16px; }
.sh-report-table { min-width: 100%; }
.sh-report-table .sh-grp { text-align: center; border-bottom: 0; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.sh-report-table td:nth-child(-n+3) { text-align: left; }
.sh-report-table tr.sh-new-file td { border-top: 2px solid var(--border); }
.sh-report-table tr.is-best td { background: var(--accent-soft); }
.sh-best { color: var(--accent-dark); }
.sh-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.sh-chip { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-dark); font-size: 12.5px; font-weight: 600; }
.sh-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; }
.sh-chip button:hover { color: var(--error); }

.p2 canvas { position: absolute; left: 0; top: 0; }
.p2-over { cursor: crosshair; touch-action: none; }
.p2-tip {
  position: absolute; z-index: 3; pointer-events: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 9px; font-size: 12.5px; line-height: 1.45; box-shadow: 0 6px 18px rgba(18, 23, 42, 0.12);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.p2-tip[hidden], .p2-empty[hidden] { display: none; }
.p2-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ------------------------------------------------------------ topbar extras */
.da-fx { font-family: var(--mono); font-weight: 700; font-size: 0.85em; color: var(--accent-dark); }
.da-side-toggle { width: 32px; padding: 0; align-self: center; }
.da-window-tag { font-size: 11px; font-weight: 700; color: var(--success); background: #e3f6ec; border-radius: 999px; padding: 2px 8px; align-self: center; }
.da-window-tag[hidden] { display: none; }
.da-app.side-collapsed .da-body { grid-template-columns: 0 minmax(0, 1fr); }
.da-app.side-collapsed .da-side { visibility: hidden; overflow: hidden; border: 0; }

/* Pop-out windows: the analyser fills the window, without the site chrome. */
.da-popout > .site-header, .da-popout > .da-about, .da-popout > .site-footer { display: none; }
.da-popout .da-app { height: 100vh; height: 100dvh; border-bottom: 0; }
.da-popout .da-breadcrumb { display: none; }

/* ------------------------------------------------------------ maths dialog */
.da-dialog {
  width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 24px 60px rgba(18, 23, 42, 0.25); color: var(--text);
}
.da-dialog::backdrop { background: rgba(18, 23, 42, 0.35); }
.da-dialog-inner { display: flex; flex-direction: column; max-height: calc(100vh - 50px); }
.da-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.da-dialog-head h2 { margin: 0; font-size: 18px; }
.da-maths { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 0; overflow: auto; }
.da-maths-list { border-right: 1px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 4px; background: var(--bg-alt); }
.da-maths-item { text-align: left; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 6px 8px; font: 500 13px inherit; font-family: inherit; cursor: pointer; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.da-maths-item:hover { background: var(--surface); }
.da-maths-item.is-sel { background: var(--surface); border-color: var(--accent-line); color: var(--accent-dark); font-weight: 600; }
.da-maths-list .btn { margin-top: 6px; align-self: flex-start; }
.da-maths-edit { padding: 16px 18px; min-width: 0; }
.da-maths-edit textarea { width: 100%; font-family: var(--mono); font-size: 13.5px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; resize: vertical; }
.da-maths-edit textarea:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
.da-maths-edit code { background: var(--accent-soft); color: var(--accent-dark); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; font-family: var(--mono); }
.da-maths-insert { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.da-maths-preview { padding: 9px 12px; border-radius: 8px; background: var(--bg-alt); border: 1px solid var(--border); font-size: 13px; min-height: 38px; }
.da-maths-preview.is-ok { background: #e9f8f0; border-color: #bfe8d2; color: #076c3e; }
.da-maths-preview.is-error { background: #fdf3f2; border-color: #f0c6c2; color: var(--error); }
.da-maths-examples { margin: 12px 0 0; font-size: 13px; }
.da-maths-examples summary { cursor: pointer; color: var(--text-muted); font-weight: 600; }
.da-maths-examples ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-muted); }
.da-maths-examples li { margin: 4px 0; }
.da-dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.da-danger:hover { border-color: var(--error); color: var(--error); }

@media (max-width: 720px) {
  .da-maths { grid-template-columns: 1fr; }
  .da-maths-list { border-right: 0; border-bottom: 1px solid var(--border); }
  .sh-field select { max-width: 180px; }
}
.da-about code { font-family: var(--mono); font-size: 0.85em; background: var(--accent-soft); color: var(--accent-dark); padding: 1px 4px; border-radius: 4px; }

/* ------------------------------------------------------------ quick add, dragging */
.da-tab-add { width: auto; padding: 0 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.da-quick { display: inline-flex; gap: 4px; margin: 0 0 4px 8px; align-items: center; flex-shrink: 0; }
.da-quick-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font: 600 12px/1.2 inherit; font-family: inherit; cursor: pointer;
}
.da-quick-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.da-quick-btn svg { color: var(--accent-dark); }
.tg-grip { cursor: grab; color: var(--text-muted); font-size: 10px; letter-spacing: -2px; opacity: 0; user-select: none; }
.tg-li:hover .tg-grip { opacity: 0.8; }
.tg-li[draggable="true"] { cursor: grab; }
.tg-moving .tg-legend { opacity: 0.6; }
.tg-dragging .tg-over { cursor: ew-resize; }
.da-dialog { background: var(--surface); }
.da-ico-moon { display: none; }
[data-theme="dark"] .da-ico-sun { display: none; }
[data-theme="dark"] .da-ico-moon { display: inline; }

/* ------------------------------------------------------------ dark theme (analyser only)
   Matches ONAC Network Studio's dark theme: black background, near-black
   panels, cyan accent. The site header and footer stay light. */
[data-da-themed][data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-alt: #000000;
  --surface: #0d0e11;
  --border: #26292f;
  --text: #e8eaed;
  --text-muted: #8b919c;
  --accent: #4cc9f0;
  --accent-dark: #86def7;
  --accent-soft: rgba(76, 201, 240, 0.12);
  --accent-line: rgba(76, 201, 240, 0.38);
  --success: #3ddc97;
  --warning: #f5c84b;
  --error: #ff6b61;
  --code-bg: #1b1d22;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  --da-plot: #000000;
  --da-grid: #17191e;
  --da-axis: #2c3038;
  --da-cursor: #f2f4f7;
  --da-marker: #5c626d;
  color: var(--text);
}
[data-theme="dark"] select, [data-theme="dark"] input[type="text"], [data-theme="dark"] input[type="search"], [data-theme="dark"] textarea,
[data-theme="dark"] .sh-field select, [data-theme="dark"] .da-select-sm, [data-theme="dark"] .da-search,
[data-theme="dark"] .field input, [data-theme="dark"] .field textarea {
  background: #15171b; color: var(--text); border-color: var(--border);
}
[data-theme="dark"] .da-seg button.active { background: #24272d; color: var(--text); box-shadow: none; }
[data-theme="dark"] .tg-legend { background: rgba(13, 14, 17, 0.88); }
[data-theme="dark"] .da-tab:hover { background: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .da-ch-add { background: #15171b; }
[data-theme="dark"] .btn-primary, [data-theme="dark"] .da-role.main { background: var(--accent); color: #000; }
[data-theme="dark"] .btn-primary:hover { background: var(--accent-dark); color: #000; }
[data-theme="dark"] .btn-ghost { color: var(--text); border-color: var(--border); }
[data-theme="dark"] .da-session.is-error { background: rgba(255, 107, 97, 0.08); border-color: rgba(255, 107, 97, 0.35); }
[data-theme="dark"] .da-maths-preview.is-ok { background: rgba(61, 220, 151, 0.1); border-color: rgba(61, 220, 151, 0.35); color: var(--success); }
[data-theme="dark"] .da-maths-preview.is-error { background: rgba(255, 107, 97, 0.08); border-color: rgba(255, 107, 97, 0.35); color: var(--error); }
[data-theme="dark"] .da-window-tag { background: rgba(61, 220, 151, 0.12); color: var(--success); }
[data-theme="dark"] .da-empty { background: var(--surface); }
[data-theme="dark"] .p2-tip, [data-theme="dark"] .da-menu { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); }
[data-theme="dark"] .sh-report-table tr.is-best td { background: rgba(76, 201, 240, 0.08); }
body.da-popout.da-dark { background: #000000; }

/* ------------------------------------------------------------ worksheet panels (components) */
.da-tool[hidden] { display: none; }
.da-tabrow { display: flex; align-items: flex-end; gap: 8px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.da-tabrow .da-tabs { flex: 1; min-width: 0; border-bottom: 0; }
.da-addbar { display: flex; align-items: center; gap: 4px; padding: 6px 10px 5px 0; flex-shrink: 0; overflow-x: auto; scrollbar-width: none; }
.da-addbar-label { font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-right: 2px; }
.da-addbar .da-quick-btn { padding: 4px 8px; }
@media (max-width: 1250px) { .da-addbar .da-quick-btn span { display: none; } .da-addbar .da-quick-btn { padding: 5px 7px; } }

.da-sheet.ws { padding-top: 8px; padding-bottom: 2px; }
/* isolation keeps panel stacking (which climbs as panels are clicked) inside
   the worksheet, so menus and dialogs always sit above the plots. */
.ws-area { position: relative; flex: 1; min-height: 0; isolation: isolate; }
.dp { position: absolute; padding: 3px; min-width: 0; min-height: 0; }
.dp-frame {
  position: relative; display: flex; flex-direction: column; width: 100%; height: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden;
}
.dp.is-active .dp-frame { border-color: var(--accent-line); box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.dp-head {
  display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 4px 0 10px; flex-shrink: 0;
  border-bottom: 1px solid var(--border); cursor: grab; user-select: none; touch-action: none; background: var(--bg-alt);
}
.dp.is-active .dp-head { background: var(--accent-soft); }
.dp.is-dragging .dp-head { cursor: grabbing; }
.dp-icon { display: inline-flex; color: var(--accent-dark); }
.dp-title { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-title-input { flex: 1; min-width: 0; font: 700 12.5px inherit; font-family: inherit; padding: 2px 6px; border: 1px solid var(--accent); border-radius: 5px; }
.dp-actions { display: inline-flex; gap: 1px; }
.dp-btn {
  width: 24px; height: 22px; border: 0; border-radius: 5px; background: transparent; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; cursor: pointer;
}
.dp-btn:hover { background: var(--surface); color: var(--text); }
.dp-btn[data-act="close"]:hover { color: var(--error); }
.dp-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 6px 6px; }
.dp .sh-toolbar { padding: 6px 0 5px; gap: 6px 8px; }
.dp .sh-subbar { padding-bottom: 4px; }
.dp .sh-body { border: 0; border-radius: 0; box-shadow: none; }
/* Each component's controls open over it from the ⚙ button (in line when
   the worksheet has a single component), so small panels stay clean. */
.ws:not(.is-single) .dp .sh-toolbar {
  display: none; position: absolute; z-index: 6; left: 6px; right: 6px; top: 4px; max-height: calc(100% - 8px); overflow: auto;
  padding: 8px 10px; background: var(--surface); border: 1px solid var(--accent-line); border-radius: 9px;
  box-shadow: 0 8px 24px rgba(18, 23, 42, 0.16);
}
.ws:not(.is-single) .dp.show-settings .sh-toolbar { display: flex; }
/* A report is mostly reading: its settings sit above the table instead of
   over it, so a small report stays readable with them open. */
.ws:not(.is-single) .dp[data-type="report"].show-settings .sh-toolbar {
  position: static; flex: none; max-height: 45%; margin-bottom: 6px; box-shadow: none;
}
.ws:not(.is-single) .dp-body { padding-top: 4px; }
.ws.is-single .dp-btn[data-act="settings"] { display: none; }
.dp-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-dark); }
.dp .sh-subbar { font-size: 12px; gap: 4px 12px; }
.dp-rs { position: absolute; z-index: 5; }
.dp-rs-n, .dp-rs-s { left: 10px; right: 10px; height: 8px; cursor: ns-resize; }
.dp-rs-n { top: -1px; } .dp-rs-s { bottom: -1px; }
.dp-rs-e, .dp-rs-w { top: 10px; bottom: 10px; width: 8px; cursor: ew-resize; }
.dp-rs-e { right: -1px; } .dp-rs-w { left: -1px; }
.dp-rs-ne, .dp-rs-nw, .dp-rs-se, .dp-rs-sw { width: 14px; height: 14px; }
.dp-rs-ne { top: -1px; right: -1px; cursor: nesw-resize; } .dp-rs-sw { bottom: -1px; left: -1px; cursor: nesw-resize; }
.dp-rs-nw { top: -1px; left: -1px; cursor: nwse-resize; } .dp-rs-se { bottom: -1px; right: -1px; cursor: nwse-resize; }
.dp-rs-se::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 7px; height: 7px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); opacity: 0.45; border-radius: 0 0 2px 0; }
.ws.is-arranging .dp { transition: none; }
.ws.is-arranging .dp-body { pointer-events: none; }
.ws.has-max .dp:not(.is-max) { visibility: hidden; }
.dp.is-max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; z-index: 50 !important; }
.dp.is-max .dp-rs { display: none; }
.ws-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--text); border: 1px dashed var(--accent-line); border-radius: 12px; }
.ws-empty p { margin: 4px 0; }

/* ------------------------------------------------------------ pop-out logo */
.da-popout-logo { display: none; align-self: center; margin-right: 6px; }
.da-popout-logo img { height: 22px; width: auto; display: block; }
.da-popout .da-popout-logo { display: inline-flex; }
.da-logo-dark { display: none !important; }
[data-theme="dark"] .da-logo-light { display: none !important; }
[data-theme="dark"] .da-logo-dark { display: block !important; }

/* Drop strip on a graph's lower edge: start a new graph there. */
.tg-drop { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--accent-dark); }
.tg-drop.is-new { background: var(--accent-soft); border-style: solid; }
.tg-drop[hidden] { display: none; }

/* ------------------------------------------------------------ time & distance */
.da-td-line {
  display: block; width: 100%; margin-top: 7px; padding: 5px 8px; text-align: left; border-radius: 7px;
  border: 1px dashed var(--border); background: transparent; color: var(--text); font: 12px/1.4 inherit; font-family: inherit; cursor: pointer;
}
.da-td-line:hover { border-color: var(--accent); }
.da-td-k { font-weight: 700; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.da-td-edit { color: var(--accent-dark); font-weight: 600; margin-left: 4px; }
.da-dialog-sm { width: min(560px, calc(100vw - 32px)); }
.da-td { padding: 12px 18px 16px; overflow: auto; }
.da-td-group { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px 10px; margin: 10px 0 0; min-width: 0; } /* fieldsets otherwise grow to their widest option */
.da-td-group legend { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 0 4px; }
.da-radio { display: flex; align-items: baseline; gap: 7px; font-size: 14px; margin: 6px 0; cursor: pointer; }
.da-radio input { accent-color: var(--accent); }
.da-td-row { display: flex; gap: 8px; margin: 2px 0 6px 22px; }
.da-td-row[hidden] { display: none; }
.da-td-row select:first-child { flex: 1; }
.da-td-row select + select { flex: 0 0 auto; width: auto; }

/* ------------------------------------------------------------ overlay shift */
.da-shift { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 7px; font-size: 12px; }
.da-shift-grp { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; background: var(--surface); }
.da-shift-btn { width: 22px; height: 24px; border: 0; background: var(--bg-alt); color: var(--text); font-weight: 700; cursor: pointer; }
.da-shift-btn:hover { background: var(--accent-soft); color: var(--accent-dark); }
.da-shift-in { width: 58px; height: 24px; border: 0; border-left: 1px solid var(--border); padding: 0 4px; font: 12px var(--mono); text-align: right; background: var(--surface); color: var(--text); -moz-appearance: textfield; }
.da-shift-in::-webkit-inner-spin-button { -webkit-appearance: none; }
.da-shift-u { padding: 0 5px 0 2px; color: var(--text-muted); border-right: 1px solid var(--border); height: 24px; line-height: 24px; background: var(--surface); }
.da-shift-reset { border: 0; background: none; color: var(--accent-dark); font: 600 12px inherit; font-family: inherit; cursor: pointer; padding: 0 2px; }

/* ------------------------------------------------------------ video */
.sh-video { display: flex; align-items: center; justify-content: center; background: #000; }
.sh-video video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.sh-video video[hidden] { display: none; }
.sh-video-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 16px; text-align: center; background: var(--surface); color: var(--text); font-size: 13.5px; }
.sh-video-empty[hidden] { display: none; }
.sh-video-empty p { margin: 2px 0; max-width: 46ch; }
.sh-video-empty .btn { margin-top: 8px; }
.sh-video.is-drop::after { content: "Drop the video"; position: absolute; inset: 6px; border: 2px dashed var(--accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; background: rgba(120, 88, 195, 0.15); color: #fff; font-weight: 700; }
.sh-num { width: 84px; height: 32px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; font: 13px var(--mono); background: #fff; color: var(--text); }
[data-theme="dark"] .sh-num { background: #15171b; }
.sh-vstatus { font-variant-numeric: tabular-nums; }
.da-warn-text { color: var(--warning); }
.sh-syncbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 10px; margin-bottom: 6px; border-radius: 8px; background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: 12.5px; color: var(--text); }
.sh-syncbar[hidden] { display: none; }
.dp.is-syncing .dp-frame { border-color: var(--accent); }
/* Legends never scroll: they clip, and values wrap under the name. */
.tg-legend { overflow: hidden; }
.tg-legend .tg-li { flex-wrap: wrap; }

/* ------------------------------------------------------------ align overlay, video bar */
.sh-alignbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 10px; margin-bottom: 6px; border-radius: 8px; background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: 12.5px; }
.sh-alignbar[hidden] { display: none; }
.sh-align-val { min-width: 74px; text-align: center; font: 600 12px var(--mono); padding: 0 6px; }
.tg-aligning .tg-over { cursor: ew-resize; }
.da-overlay-hint { margin: 2px 2px 0; }
.sh-vbar { align-items: center; }
.sh-voff { font: 12px var(--mono); color: var(--text-muted); }
/* Pop-outs hide the file/channel panel by default; label its button. */
.da-side-label { display: none; }
/* (Channels are added with "+ Channel" on each panel, so the side panel
   button in pop-outs is just the icon again.) */
.da-popout .da-side-toggle[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-dark); }
/* Long names (DBC files, CAN signals) wrap instead of running off the card. */
.da-warnings li, .da-td-line, .da-session-sub, .da-callout, .da-error, .da-details td { overflow-wrap: anywhere; word-break: break-word; }
.da-td-line { line-height: 1.45; }
.da-window-tag.is-loading { color: var(--accent-dark); background: var(--accent-soft); max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ loading card */
.da-loading { position: absolute; inset: 0 10px; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(245, 246, 251, 0.55); backdrop-filter: blur(1px); border-radius: 12px; }
[data-theme="dark"] .da-loading { background: rgba(0, 0, 0, 0.55); }
.da-loading[hidden] { display: none; }
.da-loading-card { width: min(420px, calc(100% - 32px)); padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(18, 23, 42, 0.16); }
.da-loading-title { font-weight: 700; font-size: 14.5px; margin-bottom: 10px; overflow-wrap: anywhere; }
.da-loading-bar { position: relative; height: 8px; border-radius: 99px; background: var(--bg-alt); border: 1px solid var(--border); overflow: hidden; }
.da-loading-bar span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); border-radius: 99px; transition: width 0.25s ease; }
.da-loading-bar.is-busy span { width: 35%; animation: da-sweep 1.2s ease-in-out infinite; }
@keyframes da-sweep { 0% { left: -35%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .da-loading-bar.is-busy span { animation: none; width: 100%; opacity: 0.5; } }
.da-loading-text { margin-top: 8px; font-size: 12.5px; }

/* ------------------------------------------------------------ add-channel picker */
.dp-btn-add { width: auto; padding: 0 7px 0 5px; gap: 3px; color: var(--accent-dark); font: 600 11.5px/1 inherit; font-family: inherit; }
.dp-btn-add:hover { background: var(--accent-soft); color: var(--accent-dark); }
.da-picker {
  position: fixed; z-index: 70; width: 340px; display: flex; flex-direction: column; gap: 6px; padding: 10px;
  background: var(--surface, #fff); color: var(--text); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 36px rgba(18, 23, 42, 0.2); font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}
.da-picker .da-search { margin: 0; }
.da-picker-where { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.da-picker-where select { flex: 1; min-width: 0; }
.da-picker-list { flex: 1; min-height: 120px; overflow: auto; display: flex; flex-direction: column; }
.da-picker-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; padding: 5px 8px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text); font: 13px/1.3 inherit; font-family: inherit; text-align: left; cursor: pointer;
}
.da-picker-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.da-picker-row small { flex-shrink: 0; color: var(--text-muted); font-size: 11px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.da-picker-row:hover, .da-picker-row.is-hi { background: var(--accent-soft); color: var(--accent-dark); }
.da-picker-row.is-plotted span { font-weight: 700; }
.da-picker .da-hint { margin: 0; }
@media (max-width: 1100px) { .dp-btn-add span { display: none; } }

/* Track map: picking the start/finish line */
.da-tool.is-on { background: var(--accent); color: #fff; border-color: var(--accent); }
.sh-picking .sh-plot { cursor: crosshair; outline: 2px dashed var(--accent); outline-offset: -2px; border-radius: 8px; }
