:root {
  --bg-0: #050614;
  --bg-1: #0a1030;
  --surface: rgba(15, 22, 58, 0.58);
  --surface-border: rgba(149, 187, 255, 0.25);
  --text-main: #f6f8ff;
  --text-muted: #98a3c4;
  --accent-a: #5a8dff;
  --accent-b: #9f73ff;
  --accent-c: #44d8ff;
  --danger: #ff5f8f;
  --shadow: 0 22px 70px rgba(11, 18, 45, 0.75);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Manrope", sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at 30% 10%, #1a2a7b 0%, var(--bg-0) 45%, #03030f 100%);
}

body {
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.app-shell {
  position: relative;
  z-index: 2;
  width: min(1320px, 94vw);
  margin: 28px auto 60px;
}

.glass {
  background: linear-gradient(165deg, rgba(24, 32, 78, 0.64), var(--surface));
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--accent-a), var(--accent-b));
  box-shadow: 0 0 16px var(--accent-b);
}

.brand-name {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.9rem;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--text-main);
}

.pill-btn {
  border: 0;
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent-a), var(--accent-b));
  font-weight: 700;
  cursor: pointer;
}

.hero {
  text-align: center;
  margin: 64px auto 36px;
  max-width: 860px;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-c);
  margin-bottom: 8px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 4rem);
  line-height: 1.08;
  font-family: "Sora", sans-serif;
}

.hero-subtitle {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
}

.planner {
  margin-top: 18px;
  border-radius: 22px;
  padding: 24px;
}

.planner-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.planner-reset-btn {
  border: 1px solid rgba(142, 179, 255, 0.45);
  color: #eaf2ff;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(26, 38, 88, 0.65);
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.planner-reset-btn:hover {
  background: rgba(42, 58, 122, 0.8);
  border-color: rgba(168, 197, 255, 0.72);
}

.required-panel {
  margin-top: 18px;
  border-radius: 22px;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  background: linear-gradient(160deg, rgba(34, 48, 110, 0.84), rgba(14, 23, 60, 0.88));
  border: 1px solid rgba(123, 180, 255, 0.4);
}

.required-panel-value {
  font-size: clamp(2.2rem, 4vw, 3.25rem);
}

.planner-head h2,
.examples-head h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.planner-head h2 {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
}

.planner-head p,
.examples-head p {
  margin: 8px 0 0;
  color: var(--text-muted);
}

.usage-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.usage-item {
  --brand-color: #5a8dff;
  --brand-accent: #9f73ff;
  --usage-bg-image: none;
  border: 1px solid rgba(150, 184, 255, 0.28);
  border-radius: 16px;
  padding: 16px 16px 14px;
  background: rgba(15, 20, 48, 0.66);
  min-height: 146px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto auto;
  row-gap: 10px;
  padding-top: 30px;
  transform: translateY(0) scale(1);
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms ease,
    border-color 220ms ease;
  will-change: transform, box-shadow;
}

.usage-item:hover {
  transform: translateY(-3px) scale(1.008);
  border-color: color-mix(in srgb, var(--brand-color) 46%, rgba(171, 202, 255, 0.3));
  box-shadow:
    0 16px 34px rgba(9, 14, 34, 0.34),
    0 0 0 1px color-mix(in srgb, var(--brand-accent) 26%, rgba(255, 255, 255, 0));
}

.usage-item:has(input[type="range"]:focus-visible) {
  transform: translateY(-2px) scale(1.006);
  border-color: color-mix(in srgb, var(--brand-color) 56%, rgba(186, 212, 255, 0.4));
  box-shadow:
    0 16px 36px rgba(10, 16, 42, 0.38),
    0 0 0 1px color-mix(in srgb, var(--brand-color) 28%, rgba(255, 255, 255, 0));
}

.usage-item--active {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--brand-color) 14%, rgba(20, 33, 80, 0.86)),
    rgba(9, 18, 52, 0.78)
  );
  border-color: color-mix(in srgb, var(--brand-color) 38%, rgba(146, 183, 255, 0.22));
}

.usage-item--muted {
  background: linear-gradient(180deg, rgba(42, 47, 79, 0.4), rgba(25, 31, 63, 0.56));
  border-color: rgba(133, 145, 184, 0.23);
  opacity: 0.82;
}

.usage-item--total {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: linear-gradient(160deg, rgba(30, 40, 94, 0.72), rgba(13, 22, 58, 0.82));
  border-color: rgba(122, 175, 255, 0.34);
  min-height: 122px;
}

.usage-card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: none;
  background-image: var(--usage-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.26;
  pointer-events: none;
}

.usage-item--with-background .usage-card-bg {
  display: block;
}

.usage-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  align-self: center;
}

.usage-category-corner {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 2;
  max-width: calc(100% - 24px);
  color: color-mix(in srgb, var(--text-main) 82%, #c2d8ff);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  opacity: 0.85;
  text-shadow: 0 0 8px rgba(55, 91, 183, 0.26);
}

.usage-hours {
  min-width: 54px;
  text-align: right;
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
  padding-top: 2px;
}

.usage-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.service-icon-wrap {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--brand-color) 32%, rgba(91, 138, 255, 0.25)),
    color-mix(in srgb, var(--brand-accent) 36%, rgba(151, 115, 255, 0.22))
  );
  border: 1px solid color-mix(in srgb, var(--brand-color) 35%, rgba(145, 180, 255, 0.25));
  overflow: hidden;
}

.service-icon-fallback,
.service-logo {
  width: 100%;
  height: 100%;
  border-radius: 7px;
}

.service-icon-fallback {
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.service-logo {
  display: none;
  object-fit: cover;
}

.usage-label > div {
  min-width: 0;
  overflow: hidden;
}

.usage-title {
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.15;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.usage-item--logo-ready .service-logo {
  display: block;
  object-fit: contain;
  border-radius: 0;
}

.usage-item--logo-ready .service-icon-wrap {
  background: transparent;
  border: 0;
  border-radius: 0;
}

.usage-item--logo-ready .service-icon-fallback {
  display: none;
}

.service-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(91, 138, 255, 0.35), rgba(151, 115, 255, 0.35));
  border: 1px solid rgba(145, 180, 255, 0.28);
  font-size: 0.82rem;
}

.usage-metric {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.usage-foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  color: #c0d1fa;
  font-size: 0.84rem;
  font-weight: 640;
  text-shadow: 0 0 8px rgba(66, 110, 219, 0.18);
}

.usage-item input[type="range"] {
  --progress: 0%;
  width: 100%;
  margin-top: 12px;
  appearance: none;
  height: 7px;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--brand-color) 88%, #ffffff 0%) 0%,
    color-mix(in srgb, var(--brand-accent) 84%, #ffffff 0%) var(--progress),
    rgba(71, 82, 129, 0.72) var(--progress),
    rgba(71, 82, 129, 0.72) 100%
  );
  position: relative;
  z-index: 2;
}

.usage-item input[type="range"][data-muted="true"] {
  background: linear-gradient(
    90deg,
    rgba(121, 132, 169, 0.82) 0%,
    rgba(141, 147, 177, 0.82) var(--progress),
    rgba(70, 76, 100, 0.68) var(--progress),
    rgba(70, 76, 100, 0.68) 100%
  );
}

.usage-item input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(213, 226, 255, 0.95);
  background: color-mix(in srgb, var(--brand-color) 54%, #324ebf);
  box-shadow: 0 0 16px color-mix(in srgb, var(--brand-color) 52%, rgba(131, 162, 255, 0.52));
}

.usage-item::before {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  right: -44px;
  top: -48px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--brand-color) 28%, rgba(95, 131, 255, 0.2)) 0%,
    rgba(16, 24, 62, 0) 70%
  );
  pointer-events: none;
  z-index: 1;
}

.usage-item::after {
  content: attr(data-motif);
  position: absolute;
  right: -8px;
  bottom: -14px;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--brand-accent) 30%, rgba(225, 233, 255, 0.1));
  opacity: 0.16;
  pointer-events: none;
  z-index: 1;
}

.live-total {
  margin-top: 22px;
  border: 1px solid rgba(147, 183, 255, 0.26);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.total-label {
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.total-value {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 800;
  color: #f8fbff;
  text-shadow: 0 0 28px rgba(112, 160, 255, 0.5);
}

.insights-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.insight-card {
  border-radius: 18px;
  padding: 18px;
}

.insight-card h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.insight-main {
  margin-top: 14px;
}

#plan-gb-label {
  font-size: 2rem;
  font-weight: 800;
}

#plan-gb-slider {
  --progress: 20%;
  width: 100%;
  margin-top: 12px;
  appearance: none;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    rgba(94, 153, 255, 0.95) 0%,
    rgba(163, 116, 255, 0.94) var(--progress),
    rgba(93, 103, 145, 0.74) var(--progress),
    rgba(93, 103, 145, 0.74) 100%
  );
}

#plan-gb-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(215, 230, 255, 0.95);
  background: #4d63ce;
  box-shadow: 0 0 18px rgba(129, 172, 255, 0.85);
}

.insight-caption {
  color: var(--text-muted);
  margin: 12px 0 0;
}

.scenario-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.scenario-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(141, 179, 255, 0.24);
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--text-muted);
  background: linear-gradient(165deg, rgba(22, 34, 83, 0.42), rgba(13, 22, 56, 0.3));
  backdrop-filter: blur(6px);
  transform-origin: center top;
}

.scenario-total {
  margin-top: 10px;
  border-top: 1px solid rgba(137, 173, 241, 0.26);
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}

#scenario-total-value {
  color: #e8f0ff;
}

.examples {
  margin-top: 18px;
  border-radius: 22px;
  padding: 22px;
}

.example-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.example-card {
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(146, 183, 255, 0.24);
  background: rgba(12, 18, 44, 0.74);
}

.example-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.example-icon-wrap {
  width: 28px;
  height: 28px;
  position: relative;
  flex-shrink: 0;
}

.example-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.example-card--logo-ready .example-logo {
  display: block;
}

.example-card--logo-ready .example-icon-wrap .service-icon {
  display: none;
}

.example-hours {
  margin-top: 10px;
  font-size: 1.7rem;
  font-weight: 800;
}

.example-days {
  color: var(--text-muted);
  margin-top: 2px;
}

@media (max-width: 1100px) {
  .usage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .usage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .usage-item--total {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: 94vw;
    margin-top: 14px;
  }

  .hero {
    margin-top: 34px;
  }

  .planner,
  .examples,
  .insight-card,
  .required-panel {
    padding: 14px;
  }

  .total-value {
    font-size: 2.1rem;
  }

  .usage-grid {
    grid-template-columns: 1fr;
  }

  .usage-item--total {
    grid-column: auto;
  }

  .planner-reset-btn {
    width: 100%;
  }
}
