/*
Arachne Interactive Dashboard
All theme decisions are isolated as CSS variables so this can inherit your live site later.
*/
.arachne-demo {
  --arachne-bg: #f7f7f4;
  --arachne-panel: #ffffff;
  --arachne-ink: #171816;
  --arachne-muted: #74776f;
  --arachne-line: #e6e7e1;
  --arachne-line-strong: #d8dad3;
  --arachne-accent: #7556ff;
  --arachne-accent-soft: #efecff;
  --arachne-green: #16845b;
  --arachne-green-soft: #e8f5ef;
  --arachne-series-a: #7a7f89;
  --arachne-series-b: #b6bac2;
  --arachne-radius: 18px;
  --arachne-shadow: 0 24px 70px rgba(25, 26, 23, .08);

  color: var(--arachne-ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  width: min(1200px, calc(100% - 40px));
  margin: 72px auto;
}

.arachne-demo *,
.arachne-demo *::before,
.arachne-demo *::after { box-sizing: border-box; }

.arachne-demo button { font: inherit; }

.arachne-demo__topline {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin: 0 0 24px;
}

.arachne-demo__eyebrow,
.arachne-chart-card__eyebrow,
.arachne-toolbar__label {
  margin: 0 0 7px;
  color: var(--arachne-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.arachne-demo__title {
  margin: 0;
  max-width: 760px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.03;
  letter-spacing: -.045em;
}

.arachne-demo__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--arachne-muted);
  font-size: 13px;
}

.arachne-demo__pulse {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--arachne-green);
  box-shadow: 0 0 0 5px var(--arachne-green-soft);
}

.arachne-shell {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 710px;
  overflow: hidden;
  background: var(--arachne-bg);
  border: 1px solid var(--arachne-line-strong);
  border-radius: 24px;
  box-shadow: var(--arachne-shadow);
}

.arachne-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px 14px 18px;
  background: #f1f2ee;
  border-right: 1px solid var(--arachne-line);
}

.arachne-wordmark {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 2px 8px 25px;
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -.02em;
}

.arachne-mark {
  display: block;
  flex: none;
  width: 23px;
  height: 23px;
}

.arachne-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.arachne-nav {
  display: grid;
  gap: 4px;
}

.arachne-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--arachne-muted);
  font-size: 13px;
  font-weight: 570;
  text-align: left;
  cursor: default;
}

.arachne-nav__item.is-active {
  background: var(--arachne-panel);
  color: var(--arachne-ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.arachne-nav__icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
}

.arachne-sidebar__bottom {
  margin-top: auto;
  padding: 18px 8px 0;
}

.arachne-sidebar__label {
  display: block;
  margin-bottom: 10px;
  color: var(--arachne-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.arachne-workspace {
  display: flex;
  gap: 9px;
  align-items: center;
}

.arachne-workspace > div,
.arachne-rank > div { min-width: 0; }

.arachne-workspace strong,
.arachne-rank strong {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arachne-workspace small,
.arachne-rank small {
  display: block;
  margin-top: 2px;
  color: var(--arachne-muted);
  font-size: 10px;
}

.arachne-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--arachne-accent);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.arachne-avatar--tiny {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  font-size: 10px;
}

.arachne-avatar--muted {
  background: #eceee9;
  color: var(--arachne-muted);
  border: 1px solid var(--arachne-line);
}

.arachne-main {
  min-width: 0;
  padding: 24px;
}

.arachne-toolbar,
.arachne-summary,
.arachne-chart-card__head,
.arachne-chart-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.arachne-toolbar {
  margin-bottom: 25px;
}

.arachne-toolbar__brand {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.03em;
}

.arachne-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.arachne-filter {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--arachne-line-strong);
  border-radius: 8px;
  background: var(--arachne-panel);
  color: var(--arachne-muted);
  font-size: 11px;
  font-weight: 650;
}

.arachne-filter--icon {
  width: 34px;
  padding: 0;
}

.arachne-summary {
  align-items: flex-start;
  margin: 0 0 18px;
}

.arachne-summary__copy { max-width: 650px; }

.arachne-summary__date {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--arachne-muted);
  font-size: 11px;
  font-weight: 650;
}

.arachne-summary h4 {
  margin: 0;
  font-size: clamp(20px, 2vw, 28px);
  letter-spacing: -.035em;
}

.arachne-summary p {
  margin: 8px 0 0;
  color: var(--arachne-muted);
  font-size: 12px;
  line-height: 1.5;
}

.arachne-summary__good { color: var(--arachne-green); }

.arachne-summary__journey {
  width: 185px;
  padding: 12px 13px;
  border: 1px solid var(--arachne-line);
  border-radius: 12px;
  background: rgba(255,255,255,.58);
}

.arachne-summary__journey > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.arachne-summary__journey span {
  color: var(--arachne-muted);
  font-size: 10px;
  font-weight: 700;
}

.arachne-summary__journey strong {
  font-size: 14px;
}

.arachne-journey-track {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-top: 10px;
}

.arachne-journey-track span {
  height: 4px;
  border-radius: 99px;
  background: #dadcd6;
  transition: background 180ms ease, transform 180ms ease;
}

.arachne-journey-track span.is-healthy {
  background: var(--arachne-accent);
}

.arachne-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 15px;
  background: var(--arachne-panel);
  border: 1px solid var(--arachne-line);
  border-radius: 14px;
  overflow: hidden;
}

.arachne-metric {
  position: relative;
  min-width: 0;
  padding: 15px 16px 13px;
}

.arachne-metric + .arachne-metric {
  border-left: 1px solid var(--arachne-line);
}

.arachne-metric__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--arachne-muted);
  font-size: 10px;
  font-weight: 650;
}

.arachne-metric__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--arachne-accent);
}

.arachne-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.arachne-metric small {
  display: block;
  margin-top: 3px;
  color: var(--arachne-green);
  font-size: 9px;
  font-weight: 650;
}

.arachne-chart-card {
  background: var(--arachne-panel);
  border: 1px solid var(--arachne-line);
  border-radius: 14px;
  overflow: hidden;
}

.arachne-chart-card__head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--arachne-line);
}

.arachne-chart-card__eyebrow {
  margin-bottom: 4px;
  font-size: 9px;
}

.arachne-chart-card__head h4 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -.02em;
}

.arachne-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  overflow-x: auto;
  border-radius: 9px;
  background: var(--arachne-bg);
}

.arachne-tabs button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--arachne-muted);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.arachne-tabs button.is-active {
  background: var(--arachne-panel);
  color: var(--arachne-ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

.arachne-chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  min-height: 328px;
}

.arachne-chart-wrap {
  position: relative;
  min-width: 0;
  padding: 9px 10px 3px 4px;
  border-right: 1px solid var(--arachne-line);
}

.arachne-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 300px;
  overflow: visible;
  color: var(--arachne-accent);
}

.arachne-grid-line {
  stroke: var(--arachne-line);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.arachne-grid-label,
.arachne-x-label {
  fill: #989c94;
  font-size: 10px;
  font-weight: 550;
  user-select: none;
}

.arachne-area {
  fill: url(#arachne-fill);
  stroke: none;
  pointer-events: none;
  transition: d 200ms ease;
}

.arachne-line {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: d 200ms ease;
}

.arachne-line--primary {
  stroke: var(--arachne-accent);
  stroke-width: 2.5;
}

.arachne-line--secondary {
  stroke: var(--arachne-series-a);
  stroke-width: 1.6;
}

.arachne-line--tertiary {
  stroke: var(--arachne-series-b);
  stroke-width: 1.6;
  stroke-dasharray: 4 5;
}

.arachne-crosshair line {
  stroke: var(--arachne-line-strong);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
}

.arachne-crosshair circle {
  fill: var(--arachne-panel);
  vector-effect: non-scaling-stroke;
}

.arachne-crosshair [data-point="brand"] {
  stroke: var(--arachne-accent);
  stroke-width: 2.5;
}
.arachne-crosshair [data-point="competitorA"] {
  stroke: var(--arachne-series-a);
  stroke-width: 2;
}
.arachne-crosshair [data-point="competitorB"] {
  stroke: var(--arachne-series-b);
  stroke-width: 2;
}

.arachne-hitarea {
  fill: transparent;
  cursor: crosshair;
  outline: none;
  touch-action: pan-y;
}

.arachne-hitarea:focus {
  stroke: var(--arachne-accent);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.arachne-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 148px;
  padding: 9px 10px;
  transform: translate(8px, -50%);
  border: 1px solid var(--arachne-line-strong);
  border-radius: 10px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 10px 30px rgba(20,20,18,.08);
  pointer-events: none;
  transition: left 120ms ease, top 120ms ease;
}

.arachne-tooltip__date {
  padding-bottom: 6px;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--arachne-line);
  color: var(--arachne-muted);
  font-size: 9px;
  font-weight: 700;
}

.arachne-tooltip__row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  min-height: 22px;
  font-size: 9px;
}

.arachne-tooltip__row span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--arachne-muted);
}

.arachne-tooltip__row strong { font-variant-numeric: tabular-nums; }

.arachne-legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--arachne-accent);
}
.arachne-legend-dot--a { background: var(--arachne-series-a); }
.arachne-legend-dot--b { background: var(--arachne-series-b); }

.arachne-ranking {
  min-width: 0;
  padding: 13px 12px;
}

.arachne-ranking__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 4px;
}

.arachne-ranking__head span {
  font-size: 10px;
  font-weight: 750;
}

.arachne-ranking__head small {
  color: var(--arachne-muted);
  font-size: 9px;
}

.arachne-rank {
  display: grid;
  grid-template-columns: 18px 27px minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 7px 6px;
  border-bottom: 1px solid var(--arachne-line);
}

.arachne-rank.is-you {
  margin-bottom: 2px;
  border: 1px solid #dfd9ff;
  border-radius: 10px;
  background: var(--arachne-accent-soft);
}

.arachne-rank__number {
  color: var(--arachne-muted);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.arachne-rank b {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.arachne-ranking__callout {
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  background: var(--arachne-bg);
}

.arachne-ranking__callout span {
  color: var(--arachne-muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.arachne-ranking__callout p {
  margin: 5px 0 0;
  font-size: 10px;
  line-height: 1.45;
}

.arachne-chart-card__foot {
  min-height: 44px;
  padding: 0 16px;
  border-top: 1px solid var(--arachne-line);
  color: var(--arachne-muted);
  font-size: 9px;
}

.arachne-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
}

.arachne-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

@media (max-width: 980px) {
  .arachne-shell { grid-template-columns: 1fr; }
  .arachne-sidebar { display: none; }
  .arachne-main { padding: 18px; }
}

@media (max-width: 760px) {
  .arachne-demo {
    width: min(100% - 24px, 1200px);
    margin: 48px auto;
  }

  .arachne-demo__topline,
  .arachne-toolbar,
  .arachne-summary,
  .arachne-chart-card__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .arachne-demo__status { display: none; }

  .arachne-toolbar__filters { justify-content: flex-start; }

  .arachne-summary__journey { width: 100%; }

  .arachne-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .arachne-metric:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--arachne-line);
  }
  .arachne-metric:nth-child(4) {
    border-top: 1px solid var(--arachne-line);
  }

  .arachne-chart-layout { grid-template-columns: 1fr; }
  .arachne-chart-wrap { border-right: 0; border-bottom: 1px solid var(--arachne-line); }
  .arachne-ranking { display: none; }
  .arachne-chart-card__foot { align-items: flex-start; flex-direction: column; padding: 10px 14px; }
}

@media (max-width: 480px) {
  .arachne-main { padding: 13px; }
  .arachne-metrics { grid-template-columns: 1fr; }
  .arachne-metric + .arachne-metric {
    border-left: 0;
    border-top: 1px solid var(--arachne-line);
  }
  .arachne-tabs { width: 100%; }
  .arachne-chart { min-height: 250px; }
  .arachne-tooltip { min-width: 138px; }
}

@media (prefers-reduced-motion: reduce) {
  .arachne-demo *,
  .arachne-demo *::before,
  .arachne-demo *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}