:root {
  --mist: #f4f6fb;
  --paper: #ffffff;
  --ink: #1e2440;
  --muted: #5c647f;
  --line: #e3e7f2;
  --deep: #353d97;
  --leaf: #f67619;
  --leaf-deep: #e0650c;
  --danger: #9f2d22;
  --sans: Inter, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: #e7e9ee;
  background-image: url("/media/images/bg-body-tile.webp");
  background-repeat: repeat;
  background-position: center top;
  background-size: 800px auto;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 3px; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--deep);
  color: white;
  padding: 8px 12px;
}
.skip:focus { top: 12px; }

.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding-top: 22px; }

.site-top {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 84px;
  padding: 10px 28px;
  background: #353d97;
  color: white;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.site-logo img { display: block; height: 52px; width: auto; }

.site-heading {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}

.site-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}
.site-nav a,
.nav-drop-toggle {
  color: white;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.site-nav a:hover,
.nav-drop-toggle:hover { color: #f67619; }

.nav-drop { position: relative; }
.nav-drop-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
}
.nav-drop-toggle::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.nav-drop-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  min-width: 148px;
  padding: 6px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 12px 32px rgba(30, 36, 64, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 4px);
  z-index: 5;
}
.nav-drop-panel::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 0;
  left: 0;
  height: 10px;
}
.nav-drop:hover .nav-drop-panel,
.nav-drop:focus-within .nav-drop-panel {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.nav-drop-panel a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: #1e2440;
  font-size: 14px;
}
.nav-drop-panel a:hover,
.nav-drop-panel a[aria-current="page"] {
  background: #eef0fb;
  color: #353d97;
}

.site-account {
  flex: none;
  padding: 12px 22px;
  border: 1px solid #f67619;
  border-radius: 66px;
  color: white;
  font-weight: 600;
  text-decoration: none;
}
.site-account:hover { background: #f67619; color: #1e2440; }

.shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.rail {
  position: sticky;
  top: 16px;
  min-height: 520px;
  padding: 28px 24px 22px;
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 28%),
    var(--deep);
  color: #f7f8ff;
}

.rail-main { position: relative; min-height: 400px; }
.rail-copy { position: relative; z-index: 1; }
.rail-value,
.rail-place,
.rail-meta { padding-right: 156px; }

.rail-art {
  position: absolute;
  top: 9px;
  right: -141px;
  width: 423px;
  height: 423px;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
}

.rail-label, .rail-meta, .rail-period { margin: 0; color: rgba(247, 248, 255, 0.78); }
.rail-label { font-size: 14px; }
.rail-value {
  margin: 14px 0 0;
  font-weight: 700;
  font-size: clamp(52px, 6vw, 76px);
  letter-spacing: -0.05em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  color: #f7f8ff;
}
.rail-value.tone-red { color: #ff4d4d; }
.rail-value.tone-orange { color: #ffc48a; }
.rail-value.tone-green { color: #b6f3d0; }
.rail-value.tone-blue { color: #e4c4ff; }
.rail-value.is-loading {
  display: flex;
  align-items: center;
  min-height: 0.9em;
}
.rail-place { margin: 16px 0 0; font-size: 18px; font-weight: 600; }
.rail-meta { margin-top: 8px; font-size: 14px; }
.rail-period {
  margin-top: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.board {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  min-width: 0;
}

.jenis { margin: 0; padding: 0; border: 0; min-inline-size: 0; }

.seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: #eef0f8;
}

.seg label {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 12px 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}

.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.seg span { font-weight: 600; }
.seg small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.seg label:has(input:checked) {
  background: var(--deep);
  color: white;
}
.seg label:has(input:checked) small { color: rgba(255, 255, 255, 0.72); }
.seg label:hover { background: rgba(53, 61, 151, 0.08); }
.seg label:has(input:checked):hover { background: var(--deep); }

.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 12px;
  align-items: end;
  margin-top: 18px;
}

.controls label, .finder { display: grid; gap: 6px; min-width: 0; }
.controls span, .finder span { font-size: 13px; color: var(--muted); }

.controls select,
.controls input,
.finder input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #d5dbeb;
  border-radius: 10px;
  background: white;
}

.controls select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%231e2440' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.controls select:disabled { color: #8b93a8; background-color: #f4f6fb; }

.control-actions { display: flex; align-items: center; gap: 12px; height: 44px; width: 100%; }

.apply, .back {
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--leaf);
  color: #1e2440;
  font-weight: 600;
  white-space: nowrap;
}

.back { background: var(--deep); color: white; }

.apply { flex: none; }

.reset {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: auto;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #d5dbeb;
  border-radius: 10px;
  background: #fff;
  color: var(--deep);
}
.reset:hover::after,
.reset:focus-visible::after {
  content: "Atur ulang";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}
.reset svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.reset:hover { background: #eef0fa; }

.textish {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.skeleton {
  display: inline-block;
  width: 2ch;
  height: 0.7em;
  border-radius: 0.18em;
  vertical-align: baseline;
  background-image: linear-gradient(90deg, #e3e8f3 0%, #f7f8fc 48%, #e3e8f3 100%);
  background-size: 220% 100%;
  animation: shimmer 1.15s ease-in-out infinite;
}
.rail-value .skeleton {
  width: 2.67ch;
  height: 0.9em;
  border-radius: 0.1em;
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0.48) 48%,
    rgba(255, 255, 255, 0.2) 100%
  );
}
.bar-value .skeleton { width: 2ch; height: 1em; }
.bar-name .skeleton { width: 12ch; }
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.status { min-height: 0; margin: 0; color: var(--muted); }
.status:not(:empty) { min-height: 1.3em; margin-top: 14px; }
.status.is-error { color: var(--danger); }

.trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 22px;
  min-width: 0;
  max-width: 100%;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}
.crumb-part {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}
.crumbs button {
  border: 0;
  padding: 0;
  background: none;
  color: #1e2440;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  cursor: pointer;
}
.crumbs button:hover { color: #353d97; }
.crumbs button[aria-current="page"] { color: #353d97; }
.crumb-sep {
  color: #9aa3bd;
  font-size: 13px;
  font-weight: 600;
}

.crumb-score {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 140px;
  min-width: min(100%, 120px);
  max-width: 100%;
  margin: 0;
  color: #1e2440;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.crumb-bar {
  flex: 1;
  min-width: 48px;
  height: 8px;
  border-radius: 999px;
  background: #e7ebf5;
  overflow: hidden;
}
.crumb-bar::before {
  content: "";
  display: block;
  height: 100%;
  width: var(--w, 0%);
  min-width: 8px;
  border-radius: inherit;
  background: #c9d0e4;
}
.crumb-bar.tone-red::before { background: linear-gradient(90deg, #c81e1e, #ff5d52); }
.crumb-bar.tone-orange::before { background: linear-gradient(90deg, #f67619, #ffb067); }
.crumb-bar.tone-green::before { background: linear-gradient(90deg, #0f7a45, #1fa971); }
.crumb-bar.tone-blue::before { background: linear-gradient(90deg, #6d28d9, #c084fc); }
.crumb-score.tone-red { color: #d21f1f; }
.crumb-score.tone-orange { color: #e2650d; }
.crumb-score.tone-green { color: #0f7a45; }
.crumb-score.tone-blue { color: #7c3aed; }

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-top: 18px;
}
.chart-head[hidden] { display: none !important; }

.chart-head h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
  font-weight: 600;
}

.legend {
  position: relative;
  z-index: 1;
  margin: 18px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  list-style: none;
  display: grid;
  gap: 4px;
  color: rgba(247, 248, 255, 0.9);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}
.legend li { display: flex; align-items: center; gap: 7px; }
.swatch {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.swatch.tone-red { background: #ff4d4d; }
.swatch.tone-orange { background: #ffc48a; }
.swatch.tone-green { background: #b6f3d0; }
.swatch.tone-blue { background: #d8a8ff; }

.plot {
  display: grid;
  gap: 4px;
  align-content: start;
  margin-top: 14px;
  min-height: 680px;
  max-height: 680px;
  overflow: auto;
  padding-right: 4px;
}
.plot:has(.solo) { min-height: 0; padding-right: 0; }

.axis, .bar-row {
  display: grid;
  grid-template-columns: minmax(128px, 190px) minmax(0, 1fr) 72px;
  gap: 12px;
  align-items: center;
}

.axis {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(var(--paper), var(--paper) 70%, transparent);
}

.axis-scale { display: flex; justify-content: space-between; }

.bar-row {
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.bar-row:hover, .bar-row:focus-visible { background: #f3f5fc; }

.bar-name { font-size: 14px; font-weight: 500; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-value.tone-red { color: #d21f1f; }
.bar-value.tone-orange { color: #d96510; }
.bar-value.tone-green { color: #0f7a45; }
.bar-value.tone-blue { color: #7c3aed; }
.bar-value.is-wait {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 1.45em;
}

.track {
  position: relative;
  height: 18px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(
      to right,
      #eef1f8,
      #eef1f8 calc(25% - 1px),
      #dde3f2 calc(25% - 1px),
      #dde3f2 25%
    );
  overflow: hidden;
}

.plot.is-sparse .track { height: 30px; border-radius: 8px; }

.fill.is-skeleton {
  background-image: linear-gradient(90deg, #dde3f0 0%, #f7f8fc 48%, #dde3f0 100%);
  background-size: 220% 100%;
  animation: shimmer 1.15s ease-in-out infinite;
  transition: none;
}

.fill {
  display: block;
  height: 100%;
  width: calc(var(--p) * 100%);
  border-radius: inherit;
  background: #c9d0e4;
  transition: width 700ms cubic-bezier(0.16, 1, 0.3, 1);
}
.fill.tone-red { background: linear-gradient(90deg, #c81e1e, #ff5d52); }
.fill.tone-orange { background: linear-gradient(90deg, #e0650c, #f67619); }
.fill.tone-green { background: linear-gradient(90deg, #0f7a45, #1fa971); }
.fill.tone-blue { background: linear-gradient(90deg, #6d28d9, #c084fc); }

.solo {
  display: grid;
  justify-items: stretch;
  gap: 8px;
  padding: 4px 0 28px;
}

.trend {
  width: 100%;
  margin-top: 8px;
  padding: 16px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(53, 61, 151, 0.07), transparent 46%),
    #fff;
}
.trend-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.trend-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.grains { display: flex; flex-wrap: wrap; gap: 6px; }
.grain {
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef1f8;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.grain-auto { font-size: 15px; padding-inline: 11px; }
.grain[aria-pressed="true"] { background: var(--deep); color: #fff; }
.grain:focus-visible { outline: 2px solid var(--deep); outline-offset: 2px; }
.trend-canvas { height: 220px; margin-top: 6px; }
.trend-canvas svg { display: block; width: 100%; height: 100%; }
.trend-canvas.is-loading { display: grid; align-items: end; }
.trend-canvas.is-loading .skeleton {
  display: block;
  width: 100%;
  height: 148px;
  border-radius: 14px;
  background-image: linear-gradient(90deg, #e3e8f3 0%, #f7f8fc 48%, #e3e8f3 100%);
}
.trend-area { fill: currentColor; opacity: 0.14; }
.trend-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.trend-dot { fill: #fff; stroke: currentColor; stroke-width: 2; }
.trend-grid { stroke: #e7ebf6; stroke-width: 1; }
.trend-rule { stroke: currentColor; stroke-opacity: 0.35; stroke-dasharray: 3 4; }
.trend-label { fill: #5c647f; font-size: 11px; font-family: Inter, sans-serif; }
.trend-hit { fill: transparent; cursor: crosshair; }
.trend-tip {
  min-height: 1.35em;
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.trend-canvas.tone-red { color: #d6453d; }
.trend-canvas.tone-orange { color: #f67619; }
.trend-canvas.tone-green { color: #128a4e; }
.trend-canvas.tone-blue { color: #7c3aed; }
.trend-fail { margin: 64px 0 0; color: var(--muted); font-size: 14px; font-weight: 500; }

.share {
  width: min(100%, 520px);
  margin-top: 12px;
}

.share-track {
  height: 22px;
  border-radius: 8px;
  background: #eef0f8;
  overflow: hidden;
}

.share-fill {
  display: block;
  height: 100%;
  width: var(--w);
  background: #c9d0e4;
}
.share-fill.tone-red { background: #e15b4a; }
.share-fill.tone-orange { background: #f67619; }
.share-fill.tone-green { background: #1fa971; }
.share-fill.tone-blue { background: #7c3aed; }

.share p { margin: 8px 0 0; color: var(--muted); }

.empty { margin: 24px 0; color: var(--muted); font-size: 18px; }

.site-foot {
  margin-top: 28px;
  padding: 22px 0;
  background: #353d97;
  color: white;
}
.site-foot-main {
  --footer-logo: 54px;
  --footer-logo-gap: 20px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.15fr) auto;
  align-items: start;
  gap: 22px 40px;
}
.site-foot-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-foot-logo img { display: block; height: 48px; width: auto; }
.site-foot-logo .logo-prov { height: var(--footer-logo); }
.site-foot p { margin: 0; font-size: 14px; line-height: 1.4; }
.site-foot .site-foot-brand p { margin: var(--footer-logo-gap) 0 0; max-width: 36ch; }
.site-foot h2 { margin: 0 0 4px; font-size: 14px; font-weight: 700; line-height: 1.4; }
.site-foot a { color: white; text-decoration: none; }
.site-foot a:hover { color: #fbbb76; }
.site-foot-reach {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 22px;
  margin-top: 12px;
}
.site-foot-reach h2 { margin-top: 0; }
.site-foot-reach p { margin-top: 0; overflow-wrap: anywhere; }
.site-foot-download { justify-self: end; }
.site-social { display: flex; gap: 10px; margin-top: 20px; }
.site-social a {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: white;
}
.site-social svg { width: 16px; height: 16px; fill: #353d97; }
.site-social a:hover { background: #f67619; }
.site-social a:hover svg { fill: white; }
.site-stores { display: flex; align-items: center; gap: 10px; }
.site-stores img { display: block; width: 132px; height: auto; }

.site-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 20px 28px;
  background: #000;
  color: white;
}
.site-copy p { margin: 0; }
.site-copy a { color: #c7c7c7; text-decoration: none; }
.site-copy a:hover { color: #f67619; }
.site-copy nav { display: flex; gap: 28px; }
.site-copy nav a:first-child { padding-right: 28px; border-right: 1px solid #c7c7c7; }

@media (max-width: 980px) {
  .site-nav { display: none; }
  .site-top { flex-wrap: wrap; gap: 10px 12px; padding: 10px 16px; }
  .site-logo img { height: 44px; }
  .site-title { font-size: 16px; }
  .site-heading { padding-left: 12px; }
  .site-account { margin-left: auto; padding: 8px 14px; }
  .shell, .controls, .site-foot-main { grid-template-columns: 1fr; }
  .site-foot-contact,
  .site-foot-download { margin-top: 18px; justify-self: start; }
  .rail { position: relative; top: auto; min-height: 0; }
  .control-actions { height: auto; }
}

@media (max-width: 640px) {
  .top p { display: none; }
  .trail { flex-direction: column; align-items: stretch; gap: 10px; }
  .crumbs,
  .crumb-score { width: 100%; }
  .site-foot-reach { grid-template-columns: 1fr; }
  .site-stores { flex-wrap: wrap; }
  .chart-head, .trend-head { flex-direction: column; align-items: stretch; }
  .grains { justify-content: flex-start; }
  .axis { display: none; }
  .bar-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name value" "track track";
  }
  .bar-name { grid-area: name; }
  .bar-value { grid-area: value; }
  .track { grid-area: track; }
}

@media (prefers-reduced-motion: reduce) {
  .fill, .skeleton, .track.is-skeleton { animation: none; transition: none; }
}
