:root {
  --bg: #f5f5f7;
  --ink: #111216;
  --muted: #6b6f7a;
  --accent: #0f6fff;
  --accent-2: #6ee7ff;
  --card: rgba(255, 255, 255, 0.78);
  --stroke: rgba(17, 18, 22, 0.08);
  --shadow: 0 30px 60px rgba(15, 23, 42, 0.12);
  --color1: #00b894;
  --color2: #74b9ff;
  --color3: #0984e3;
  --color4: #a29bfe;
  --color5: #fdcb6e;
  --color6: #f19066;
  --color7: #f78fb3;
  --color8: #d63031;
  --color9: #dfe6e9;
  --color10: #b2bec3;
  --color11: #636e72;
  --color12: #2d3436;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", "SF Pro Display", "PingFang SC", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top right, #dfe8ff 0%, transparent 55%),
    radial-gradient(circle at 30% 20%, #e5fff5 0%, transparent 50%),
    linear-gradient(160deg, #fafbff 0%, #f3f5f9 45%, #f5f5f7 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 8px;
}

.site-title {
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
}

.hero__content h1 {
  font-size: clamp(2.3rem, 3vw, 3.4rem);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.hero__desc {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.upload {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.upload--primary {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

.upload input {
  display: none;
}

.ghost {
  border-radius: 999px;
  padding: 12px 20px;
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ghost:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.hero__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.meta__label {
  display: block;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.hero__visual {
  position: relative;
  display: grid;
  place-items: center;
}

.glass {
  backdrop-filter: blur(16px);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 24px 28px;
  border-radius: 24px;
  width: min(320px, 90%);
  box-shadow: var(--shadow);
  z-index: 1;
}

.glass__title {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.glass__value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.glow {
  position: absolute;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(15, 111, 255, 0.35), transparent 70%);
  filter: blur(12px);
}

.workspace {
  display: grid;
  gap: 24px;
}

.panel {
  background: #fff;
  border-radius: 24px;
  padding: 24px 28px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.chart-panel {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-radius: 0;
  padding-left: clamp(24px, 5vw, 72px);
  padding-right: clamp(24px, 5vw, 72px);
}

.panel__header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel__header h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.panel__header p {
  color: var(--muted);
  font-size: 0.95rem;
}


.button {
  border-radius: 999px;
  padding: 10px 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}

.chart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 100%;
  margin-top: 8px;
}

.data-source {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--stroke);
}

.data-source__info h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.data-source__info p {
  color: var(--muted);
  font-size: 0.85rem;
}

.data-source__control {
  display: grid;
  gap: 10px;
}

.data-source__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.data-source__status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.status-label {
  font-weight: 600;
  color: var(--ink);
}

.data-source__control > label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.data-source__control select {
  appearance: none;
  border-radius: 14px;
  padding: 12px 44px 12px 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  font-family: inherit;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
  background-image: linear-gradient(45deg, transparent 50%, #6b6f7a 50%),
    linear-gradient(135deg, #6b6f7a 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.settings-block {
  background: #f7f8fb;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--stroke);
}

.settings-head h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.settings-head p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.control label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.control select {
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid var(--stroke);
  background: #fff;
  font-weight: 600;
}

.axis-summary {
  display: grid;
  gap: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.axis-control {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.axis-info {
  display: grid;
  gap: 4px;
}

.axis-title {
  font-weight: 700;
  color: var(--ink);
}

.axis-series {
  font-size: 0.85rem;
  color: var(--muted);
}

.axis-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.axis-inputs label {
  display: grid;
  gap: 4px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.axis-inputs input {
  border-radius: 10px;
  border: 1px solid var(--stroke);
  padding: 6px 10px;
  font-weight: 600;
  width: 120px;
}

.series-controls {
  display: grid;
  gap: 12px;
}

.series-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.series-row--hidden {
  opacity: 0.45;
  filter: grayscale(1);
}

.series-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
  flex: 1 1 100%;
}

.series-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.series-options select {
  border-radius: 10px;
  border: 1px solid var(--stroke);
  padding: 6px 10px;
  font-weight: 600;
  background: #fff;
}

.color-input {
  border-radius: 10px;
  border: 1px solid var(--stroke);
  padding: 6px 10px;
  font-weight: 600;
  width: 120px;
}

.color-dropdown {
  position: relative;
}

.color-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  padding: 6px 10px;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
}

.color-trigger__swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--stroke);
}

.color-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4, 20px);
  gap: 8px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
}

.color-dropdown.is-open .color-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid var(--stroke);
  cursor: pointer;
  padding: 0;
  background: transparent;
}

.color-swatch.is-selected {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.series-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.axis-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f7f8fb;
  color: var(--ink);
  font-weight: 600;
}

.chart-panel .panel__header {
  align-items: flex-start;
  position: relative;
  padding-right: 160px;
}

.chart-wrap {
  background: linear-gradient(180deg, #ffffff 0%, #f7f8fb 100%);
  border-radius: 20px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

#chart {
  width: 100%;
  height: 420px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
}

.legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5f6fa;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.legend__item--hidden {
  opacity: 0.45;
  filter: grayscale(1);
}

.legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

svg text {
  font-family: "Manrope", "SF Pro Display", "PingFang SC", sans-serif;
  fill: #5b606b;
  font-size: 12px;
}

.axis-line {
  stroke: rgba(17, 18, 22, 0.2);
  stroke-width: 1;
}

.grid-line {
  stroke: rgba(17, 18, 22, 0.08);
  stroke-width: 1;
}

.series-line {
  fill: none;
  stroke-width: 1.25;
}

.series-area {
  opacity: 0.2;
}

.series-bar {
  opacity: 0.75;
}

.hover-line {
  stroke: rgba(15, 23, 42, 0.45);
  stroke-width: 1;
  stroke-dasharray: 6 6;
  pointer-events: none;
}

.hover-dot {
  fill: #fff;
  stroke-width: 2;
  pointer-events: none;
}

.hover-dots {
  pointer-events: none;
}

.hover-x-bubble rect {
  fill: #fff;
  stroke: rgba(15, 23, 42, 0.18);
  stroke-width: 1;
}

.hover-x-bubble text {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.reference-line {
  stroke-width: 1;
  stroke-dasharray: 5 5;
  opacity: 0.6;
}

.value-bubble rect {
  fill: #fff;
  stroke-width: 1;
  opacity: 0.95;
}

.value-bubble text {
  font-weight: 600;
}

.range-slider {
  position: relative;
  height: 32px;
  margin-top: 18px;
}

.range-slider.is-hidden {
  display: none;
}

.range-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  transform: translateY(-50%);
  overflow: visible;
}

.range-selection {
  position: absolute;
  top: 50%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(15, 111, 255, 0.7), rgba(110, 231, 255, 0.9));
  transform: translateY(-50%);
  cursor: grab;
  touch-action: none;
  z-index: 1;
}

.range-selection:active {
  cursor: grabbing;
}

.range-handle {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
  touch-action: none;
  z-index: 2;
}

.range-handle[data-handle="left"] {
  left: 0;
  transform: translate(-50%, -50%);
  cursor: ew-resize;
}

.range-handle[data-handle="right"] {
  left: 100%;
  transform: translate(-50%, -50%);
  cursor: ew-resize;
}

@media (max-width: 720px) {
  .page {
    padding: 32px 18px 56px;
  }

  .panel {
    padding: 20px;
  }

  .chart-panel {
    padding-left: 18px;
    padding-right: 18px;
  }

  #chart {
    height: 320px;
  }

  .axis-inputs input {
    width: 100%;
  }

  .data-source {
    align-items: flex-start;
  }

  .data-source__control {
    width: 100%;
  }

  .data-source__control select {
    width: 100%;
  }
}

.chart-panel .panel__header .button {
  position: absolute;
  top: 0;
  right: 0;
}

.chart-actions .legend {
  margin-top: 36px;
}
