/* edash-chart-kit.css -- the Traya chart standard in eDash's colours
   (js/edash-chart-kit.js). Only existing tokens: --primary, --accent,
   --ink, --muted, --border, --surface; type and radii from the roles. */

/* ---------- toolbar (card head) ---------- */
.ck-on .pd-performance-card-head { flex-wrap: wrap; padding-right: 64px; }
.ck-on > .opd-card-download { display: none; }
.ck-on > .opd-card-range { display: none; }
.ck-tools { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.ck-tool {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border: 0; background: transparent;
  color: var(--muted); border-radius: var(--r-ctl); cursor: pointer;
  font-size: var(--type-label-size);
  transition: background-color .15s ease, color .15s ease;
}
.ck-tool:hover, .ck-tool:focus-visible, .ck-tool[aria-expanded="true"] {
  color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.ck-tool:focus-visible, .ck-title:focus-visible, .ck-handle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ck-more { display: none; }
.ck-title { cursor: pointer; text-decoration: underline dotted color-mix(in srgb, var(--primary) 45%, transparent); text-underline-offset: 3px; }
.ck-title:hover { color: var(--primary); }

/* ---------- stats header ---------- */
.ck-stats { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 18px; margin: 0 0 8px; min-height: 34px; }
.ck-stat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ck-stat span {
  font-size: var(--type-axis-tick-size); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.ck-stat b { font-size: var(--type-card-title-size); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ck-stat b small { font-size: var(--type-axis-tick-size); font-weight: 600; color: var(--muted); margin-left: 3px; }
.ck-stat-series { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--type-axis-tick-size); color: var(--muted); }
.ck-stat-series i { width: 10px; height: 3px; border-radius: var(--r-chip); flex: none; }

/* ---------- caption + notes ---------- */
.ck-caption { margin: 8px 0 0; font-size: var(--type-caption-size); line-height: 1.5; color: var(--ink); }
.ck-note { margin: 4px 0 0; font-size: var(--type-axis-tick-size); line-height: 1.45; color: var(--muted); }

/* ---------- context scrubber ---------- */
.ck-scrub { margin-top: 10px; }
.ck-track {
  --ck-trace: var(--primary);
  position: relative; height: 40px; border: 1px solid var(--border); border-radius: var(--r-ctl);
  background: var(--surface); overflow: hidden; touch-action: none; cursor: crosshair; user-select: none;
}
.ck-track canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ck-mask { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--muted) 22%, transparent); pointer-events: none; }
.ck-mask-l { left: 0; } .ck-mask-r { right: 0; }
.ck-win { position: absolute; top: 0; bottom: 0; border-top: 2px solid var(--primary); border-bottom: 2px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 7%, transparent); cursor: grab; pointer-events: none; }
.ck-track.is-panning .ck-win { cursor: grabbing; background: color-mix(in srgb, var(--primary) 13%, transparent); }
.ck-handle { position: absolute; top: 0; bottom: 0; width: 14px; margin-left: -7px; cursor: ew-resize; }
.ck-handle::after { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 4px; border-radius: var(--r-chip); background: var(--primary); box-shadow: 0 0 0 2px var(--surface); }
.ck-scrub-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; }
.ck-rnote { font-size: var(--type-axis-tick-size); color: var(--muted); font-variant-numeric: tabular-nums; }
.ck-link { border: 0; padding: 0; background: none; color: var(--primary); font: inherit; font-size: var(--type-axis-tick-size); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.ck-link[hidden] { display: none; }

/* ---------- popovers, menus, sheets ---------- */
.ck-pop {
  position: fixed; z-index: 3000; max-width: min(420px, calc(100vw - 16px)); max-height: min(78vh, 640px); overflow: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: 0 18px 48px rgba(17, 33, 43, .22); padding: 12px;
}
.ck-pop.is-sheet { left: 8px !important; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); top: auto !important; max-width: none; max-height: 72vh; }
.ck-pop-title { margin: 0 0 8px; font-size: var(--type-label-size); font-weight: 700; color: var(--ink); }
.ck-row { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px solid var(--border); }
.ck-row-label { font-size: var(--type-axis-tick-size); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 5px; }
.ck-toggles { grid-template-columns: 1fr; }
.ck-series { display: flex; flex-direction: column; gap: 4px; }
.ck-check { display: flex; align-items: center; gap: 6px; font-size: var(--type-caption-size); color: var(--ink); cursor: pointer; }
.ck-check.is-off { color: var(--muted); cursor: default; }
.ck-check input { accent-color: var(--primary); }
.ck-swatch { width: 12px; height: 3px; border-radius: var(--r-chip); flex: none; }
.ck-seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 2px; border: 1px solid var(--border); border-radius: var(--r-ctl); }
.ck-seg button { border: 0; background: transparent; color: var(--ink); padding: 4px 8px; border-radius: var(--r-ctl); font: inherit; font-size: var(--type-axis-tick-size); font-weight: 600; cursor: pointer; }
.ck-seg button:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.ck-seg button.is-on { background: var(--primary); color: var(--surface); }
.ck-range-opts { display: flex; flex-direction: column; gap: 6px; }
.ck-custom, .ck-manual { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: var(--type-axis-tick-size); color: var(--muted); }
.ck-manual.is-hidden { display: none; }
.ck-custom input, .ck-manual input { font: inherit; font-size: var(--type-axis-tick-size); color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 4px 6px; min-width: 0; }
.ck-manual input { width: 84px; }
.ck-btn { border: 1px solid var(--primary); background: var(--primary); color: var(--surface); border-radius: var(--r-ctl); padding: 4px 10px; font: inherit; font-size: var(--type-axis-tick-size); font-weight: 700; cursor: pointer; }
.ck-settings > .ck-link { margin-top: 8px; }
.ck-menu { display: flex; flex-direction: column; min-width: 200px; }
.ck-menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: var(--r-ctl);
  color: var(--ink); font: inherit; font-size: var(--type-caption-size); cursor: pointer; }
.ck-menu button i { width: 16px; color: var(--primary); text-align: center; }
.ck-menu button:hover, .ck-menu button:focus-visible { background: color-mix(in srgb, var(--primary) 10%, transparent); }

/* ---------- deep-link arrival ---------- */
.ck-linked { outline: 2px solid var(--accent); outline-offset: 3px; transition: outline-color .4s ease; }

/* ---------- full screen analysis ---------- */
.ck-fs {
  position: fixed; inset: 0; z-index: 2500; display: flex; flex-direction: column; background: var(--surface); color: var(--ink);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 18px calc(12px + env(safe-area-inset-bottom, 0px));
}
.ck-fs-bar { flex: none; }
body.ck-fs-open { overflow: hidden; }
.ck-fs .ck-fs-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: auto; margin: 0; width: auto; max-width: none; height: auto; }
.ck-fs .ck-fs-card .pd-performance-chart, .ck-fs .ck-fs-card .pd-preset-chart { flex: 1 1 auto; min-height: 50vh; height: auto; }
.ck-fs .ck-fs-card .inc-chart { overflow: visible; }
.inc-evidence li.ck-on > div { flex: 1 1 auto; min-width: 0; }
.inc-evidence .ck-tools { display: inline-flex; margin-left: 8px; vertical-align: middle; }
.ck-fs .ck-fs-card .pd-preset-body { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.ck-fs .ck-fs-card .ck-track { height: 56px; }
.ck-fs .ck-fs-card .opd-card-remove, .ck-fs .ck-fs-card .opd-card-resize, .ck-fs .ck-fs-card .opd-card-drag-handle, .ck-fs .ck-tool-duplicate { display: none; }
.ck-fs .ck-fs-card .pd-performance-card-head { padding-right: 0; }

/* ---------- phones: the toolbar folds into one "more" button ---------- */
@media (max-width: 700px) {
  .ck-tools .ck-tool { display: none; }
  .ck-tools .ck-more { display: inline-flex; width: 36px; height: 36px; }
  .ck-on .pd-performance-card-head { padding-right: 56px; flex-wrap: nowrap; }
  .ck-on .pd-performance-title-wrap { flex: 1 1 auto; min-width: 0; }
  .ck-tools { flex: none; }
  .ck-stat-series { max-width: 100%; margin-left: 0; flex-basis: 100%; }
  .ck-track { height: 48px; }
  .ck-handle { width: 28px; margin-left: -14px; }
  .ck-handle::after { left: 12px; }
  .ck-fs { padding-left: 8px; padding-right: 8px; }
  .ck-fs .ck-fs-card .pd-performance-chart, .ck-fs .ck-fs-card .pd-preset-chart { min-height: 42vh; }
}
@media (max-height: 520px) {
  .ck-fs .ck-fs-card .pd-performance-chart, .ck-fs .ck-fs-card .pd-preset-chart { min-height: 0; }
}
