:root {
  --ink: #18232f;
  --muted: #617083;
  --page: #f3f6f8;
  --panel: #ffffff;
  --line: #d9e1e8;
  --green: #2b9f68;
  --blue: #276ed8;
  --orange: #d9822b;
  --red: #ce4a61;
  --cyan: #108f9b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffffff 0, #ffffff 230px, var(--page) 230px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  padding: 32px clamp(18px, 4vw, 56px) 26px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

h1 {
  max-width: 900px;
  margin: 8px 0 0;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1.03;
  letter-spacing: 0;
}

.device {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fbfdff;
  white-space: nowrap;
}

.led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(43, 159, 104, 0.14);
}

.dashboard {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 44px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.control-panel,
.chart-panel,
.insights article,
.tiles article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 24px rgba(40, 52, 72, 0.08);
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

label {
  color: #35445a;
  font-size: 13px;
  font-weight: 800;
}

select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: #fbfdff;
  font: inherit;
}

input[type="range"] {
  width: 100%;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 750;
}

.toggle {
  position: relative;
  width: 54px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #b6c0cc;
  cursor: pointer;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 160ms ease;
}

.toggle.on {
  background: var(--green);
}

.toggle.on::after {
  transform: translateX(24px);
}

.primary {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
}

.chart-panel {
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-title h2,
.insights h2 {
  margin: 8px 0 0;
  font-size: 25px;
}

#score {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--green);
  font-size: 28px;
}

canvas {
  width: 100%;
  height: 320px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.insights {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.insights article {
  padding: 18px;
}

.insights p,
.insights li {
  color: var(--muted);
  line-height: 1.6;
}

ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.tiles {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.tiles article {
  padding: 16px;
}

.tiles span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tiles strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

@media (max-width: 920px) {
  .header,
  .dashboard,
  .insights,
  .tiles {
    grid-template-columns: 1fr;
  }

  .header {
    display: grid;
  }
}
