.dl-shell {
  position: relative;
  z-index: 1;
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 70px;
}

.dl-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 32px;
}

.dl-hero h1 {
  margin: 0;
  font: 700 clamp(28px, 4vw, 48px)/1.06 "Space Grotesk", sans-serif;
  letter-spacing: -.035em;
}

.dl-hero h1 span {
  color: var(--accent);
}

.dl-hero p:not(.eyebrow) {
  max-width: 660px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.dl-badge {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.dl-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.dl-panel,
.dl-viewer {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(16,21,29,.9);
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
}

.dl-panel {
  padding: 24px;
}

.dl-dropzone {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed #3a4655;
  border-radius: 12px;
  background: #0c1118;
  cursor: pointer;
  text-align: center;
  transition: border-color .2s, background .2s;
}

.dl-dropzone:hover,
.dl-dropzone.drag {
  border-color: var(--accent);
  background: #0d1421;
}

.dl-dropzone strong {
  font-size: 16px;
}

.dl-dropzone span:not(.dl-upload-icon) {
  color: var(--muted);
  font-size: 12px;
}

.dl-upload-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 50%;
  color: var(--accent);
  background: rgba(79,127,255,.09);
}

.dl-upload-icon svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

#fileInput {
  display: none;
}

.dl-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.dl-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.dl-mode label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.dl-mode input {
  accent-color: var(--accent);
}

.dl-btn-primary,
.dl-btn-secondary,
.dl-download {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.dl-btn-primary {
  border: 0;
  color: #fff;
  background: var(--accent);
}

.dl-btn-secondary,
.dl-download {
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
}

.dl-btn-primary:disabled,
.dl-btn-secondary:disabled {
  opacity: .4;
  cursor: default;
}

.dl-status {
  min-height: 20px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dl-status.ok {
  color: var(--green);
}

.dl-status.bad {
  color: #ef5350;
}

.dl-results table,
.dl-data-table {
  width: 100%;
  border-collapse: collapse;
}

.dl-results th,
.dl-results td,
.dl-data-table th,
.dl-data-table td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
}

.dl-results th,
.dl-data-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.dl-results td {
  color: #d8dee8;
}

.dl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dl-small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.dl-bad {
  color: #ef5350;
  font-weight: 800;
}

.dl-side {
  position: sticky;
  top: 96px;
}

.dl-side-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dl-side-title span {
  font: 700 15px "Space Grotesk", sans-serif;
}

.dl-side-title small {
  color: var(--muted);
  font-size: 10px;
}

.dl-side select {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: #0c1016;
  font-size: 12px;
}

.dl-side select:disabled {
  color: #566172;
}

.dl-series-toolbar {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.dl-mini-btn {
  flex: 1;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--panel);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.dl-mini-btn:disabled {
  opacity: .4;
  cursor: default;
}

.dl-zoom-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.dl-series-list {
  max-height: 360px;
  margin-top: 12px;
  padding-right: 4px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #2a3344 transparent;
}

.dl-series-list p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.dl-series-item {
  display: grid;
  grid-template-columns: 16px 14px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 4px;
  border-bottom: 1px solid #202733;
  color: #d8dee8;
  font-size: 11px;
  line-height: 1.4;
  cursor: pointer;
}

.dl-series-item input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

.dl-series-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--series-color);
  box-shadow: 0 0 14px color-mix(in srgb, var(--series-color) 42%, transparent);
}

.dl-series-item span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dl-viewer {
  margin-top: 22px;
  overflow: hidden;
}

.dl-viewer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.dl-viewer-head h2 {
  margin: 0;
  font: 700 20px "Space Grotesk", sans-serif;
}

.dl-viewer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.dl-chart-wrap {
  height: 560px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #090d13;
}

.dl-chart-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  user-select: none;
}

.dl-chart-wrap canvas.is-panning {
  cursor: grabbing;
}

.dl-table-wrap {
  max-height: 520px;
  overflow: auto;
  background: #090d13;
}

.dl-data-table {
  min-width: 900px;
}

.dl-data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #111823;
}

.dl-data-table td {
  color: #c8d0dc;
  font-family: Consolas, "Courier New", monospace;
}

@media (max-width: 900px) {
  .dl-workspace {
    grid-template-columns: 1fr;
  }

  .dl-side {
    position: static;
  }
}

@media (max-width: 680px) {
  .dl-shell {
    width: min(100% - 24px, 1400px);
    padding-top: 32px;
  }

  .dl-hero,
  .dl-viewer-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .dl-badge {
    white-space: normal;
  }

  .dl-panel {
    padding: 17px;
  }
}
