:root {
  --bg: #0a0d0d;
  --surface: #101515;
  --surface-2: #151c1b;
  --surface-3: #1b2423;
  --text: #f2f7f3;
  --text2: #d8e4dc;
  --muted: #94a59d;
  --dim: #65736d;
  --border: #263330;
  --accent: #42e8a6;
  --accent-dim: #2ebd8d;
  --warn: #f3c969;
  --neg: #ff6b70;
  --pos: #42e8a6;
  --r-sm: 7px;
  --sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg);
  font-family: var(--sans);
  letter-spacing: 0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(66, 232, 166, .08), transparent 260px),
    radial-gradient(circle at 15% 0, rgba(66, 232, 166, .08), transparent 32rem),
    var(--bg);
  color: var(--text);
}

body,
input,
button,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }

.chrome {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(210px, auto) minmax(280px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px clamp(12px, 3vw, 24px);
  max-width: 100%;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 13, 13, .92);
  backdrop-filter: blur(16px);
}

.chrome-left,
.chrome-right,
.tabs,
.section-head,
.profile-bar,
.seg,
.stats,
.partners,
.bench-head,
.waterfall-line,
.cat-grid,
.tweaks-head,
.tweaks-row .row {
  min-width: 0;
}

.chrome-left,
.chrome-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chrome-right { justify-content: flex-end; }

.chrome-logo {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 156px;
  height: 68px;
  line-height: 1;
}

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

.chrome-divider {
  width: 1px;
  height: 34px;
  background: var(--border);
}

.chrome-title {
  overflow: hidden;
  color: var(--text2);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dim { color: var(--dim); }

.tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow-x: auto;
  padding: 3px;
  scrollbar-width: thin;
}

.tab,
.btn,
.action,
.cta,
.powered,
.seg button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text2);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.tab,
.seg button,
.btn,
.action {
  padding: 7px 10px;
}

.tab {
  flex: 0 0 auto;
  color: var(--muted);
}

.tab.active,
.seg button.active,
.btn:hover,
.action:hover {
  border-color: rgba(66, 232, 166, .65);
  background: rgba(66, 232, 166, .12);
  color: var(--accent);
}

.powered {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  height: 34px;
  min-width: 112px;
  padding: 3px 9px;
  border-color: #dfe5e8;
  border-radius: 4px;
  background: #ffffff;
  color: #171d22;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .22);
}

.powered-kicker {
  display: block;
  width: 100%;
  color: #3d454b;
  font-family: var(--mono);
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: .22em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.powered-kicker-underlined {
  color: #555;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: .18em;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 2px;
}

.powered-kicker-underlined:hover,
a:active .powered-kicker-underlined,
a:focus .powered-kicker-underlined,
a:visited .powered-kicker-underlined {
  color: #555;
  text-decoration-color: currentColor;
}

.alokin-logo-img {
  display: block;
  width: 104px;
  height: 18px;
  object-fit: contain;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-color: var(--accent);
  background: var(--accent);
  color: #06110d;
  white-space: nowrap;
}

.progress {
  position: sticky;
  top: 72px;
  z-index: 18;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 8px clamp(12px, 3vw, 24px);
  max-width: 100%;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 13, 13, .88);
  scrollbar-width: thin;
}

.progress-step {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
}

.progress-step.done { color: var(--muted); }
.progress-step.active { border-color: var(--accent); color: var(--accent); }
.glyph.done,
.glyph.active { color: var(--accent); }

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px;
  width: min(1540px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: 18px clamp(12px, 3vw, 24px) 36px;
}

.shell.no-rail {
  grid-template-columns: minmax(0, 1fr);
}

.main,
.rail {
  min-width: 0;
}

.rail {
  position: sticky;
  top: 126px;
  align-self: start;
}

.readme,
.warn-banner,
.section,
.profile-bar {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: rgba(16, 21, 21, .92);
}

.readme {
  margin-bottom: 12px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.mark,
.idx,
.lbl,
.count,
.subhead,
.waterfall-cap,
.stat-label,
.stat-sub,
.hdr {
  color: var(--dim);
  font-family: var(--mono);
  text-transform: uppercase;
}

.section {
  margin-bottom: 14px;
  padding: 14px;
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--text2);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.section-head > span:not(.rule) {
  flex: 0 0 auto;
}

.rule {
  flex: 1 1 auto;
  height: 1px;
  min-width: 18px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.section-note {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.profile-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 9px;
  overflow-x: auto;
}

.spacer { flex: 1 1 auto; }
.count { font-size: 10px; white-space: nowrap; }

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .18);
}

.seg button {
  flex: 1 1 auto;
  min-width: 0;
  border-color: transparent;
  background: transparent;
}

.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(255, 107, 112, .45); color: var(--neg); }
.btn.sm,
.action,
.btn-x { min-height: 30px; font-size: 10px; }

.btn-x {
  display: inline-grid;
  place-items: center;
  width: 30px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}

.warn-banner {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-color: rgba(243, 201, 105, .45);
  color: var(--warn);
  font-family: var(--mono);
  font-size: 12px;
}

.tbl-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.tbl {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
  background: var(--surface);
}

.tbl th,
.tbl td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  font-size: 12px;
  vertical-align: middle;
}

.tbl th {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.tbl .r,
.r { text-align: right; }

.pct-row td {
  padding-top: 2px;
  padding-bottom: 8px;
  background: rgba(255, 255, 255, .015);
  color: var(--dim);
  font-size: 10.5px;
}

.data-row.off,
.pct-row.off {
  opacity: .45;
}

.inline-input {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: #0d1211;
  overflow: hidden;
}

.inline-input input,
.inline-input select,
.ename,
.profile-bar select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.inline-input input,
.inline-input select {
  padding: 6px 7px;
  font-family: var(--mono);
  font-size: 11px;
}

.ename,
.profile-bar select {
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: #0d1211;
  color: var(--text2);
}

.pre,
.suf {
  flex: 0 0 auto;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
}

.pre { padding-left: 7px; }
.suf { padding-right: 7px; }

.toggle-sw {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 22px;
}

.toggle-sw input {
  position: absolute;
  opacity: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #0c1110;
  cursor: pointer;
}

.slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--dim);
  transition: transform .16s ease, background .16s ease;
}

.toggle-sw input:checked + .slider {
  border-color: rgba(66, 232, 166, .55);
  background: rgba(66, 232, 166, .15);
}

.toggle-sw input:checked + .slider::before {
  transform: translateX(16px);
  background: var(--accent);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.stat,
.partner {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.stat-label,
.stat-sub {
  overflow-wrap: anywhere;
  font-size: 10px;
}

.stat-value {
  margin: 5px 0 3px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 800;
}

.pos { color: var(--pos) !important; }
.neg { color: var(--neg) !important; }
.warn { color: var(--warn) !important; }

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.pos,
.tag.pos { border-color: rgba(66, 232, 166, .45); color: var(--pos); }
.badge.warn,
.tag.warn { border-color: rgba(243, 201, 105, .45); color: var(--warn); }
.badge.neg,
.tag.neg { border-color: rgba(255, 107, 112, .45); color: var(--neg); }

.subhead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 8px;
  font-size: 10px;
  font-weight: 800;
}

.empty {
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
}

.partners {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.partner-name {
  margin-bottom: 9px;
  color: var(--text);
  font-family: var(--mono);
  font-weight: 800;
}

.partner-row,
.waterfall-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

.partner-row .val,
.waterfall-line .amt {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-family: var(--mono);
  font-weight: 700;
}

.partner-row.total,
.waterfall-line.total {
  border-bottom: 0;
  color: var(--text);
}

.waterfall-cap {
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 800;
}

.sign {
  display: inline-block;
  width: 13px;
  color: var(--dim);
}

.bench {
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
}

.bench-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.bench-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bench-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 12px;
}

.bench-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #070a0a;
}

.bench-fill {
  height: 100%;
  border-radius: inherit;
}

.bench-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, .26);
}

.cat-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) repeat(4, minmax(96px, 1fr));
  gap: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

div[style*="minmax(300px"],
div[style*="minmax(260px"] {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)) !important;
  max-width: 100%;
}

.cat-grid > div {
  min-width: 0;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
  font-size: 12px;
}

.cat-grid .hdr {
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
}

.cat-grid .name {
  color: var(--text2);
}

.tweaks {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  width: min(380px, 100vw);
  height: 100dvh;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .35);
  transform: translateX(105%);
  transition: transform .2s ease;
}

.tweaks.open { transform: translateX(0); }

.tweaks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.tweaks-head .title {
  font-family: var(--mono);
  font-weight: 800;
  text-transform: uppercase;
}

.tweaks-body {
  height: calc(100dvh - 59px);
  overflow-y: auto;
  padding: 14px;
}

.tweaks-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.tweaks-row .lbl {
  margin-bottom: 8px;
  font-size: 10px;
}

.tweaks-row .row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tweaks-row input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--accent);
}

.tweaks-row .v {
  min-width: 44px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-align: right;
}

[data-density="normal"] .section { padding: 18px; }
[data-density="normal"] .tbl th,
[data-density="normal"] .tbl td { padding: 10px; }

@media (max-width: 1180px) {
  .chrome {
    grid-template-columns: 1fr auto;
  }

  .tabs {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
  }

  .progress { top: 106px; }

  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    order: 2;
  }
}

@media (max-width: 760px) {
  .chrome {
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: center;
    gap: 10px;
    min-height: 0;
  }

  .chrome-left,
  .chrome-right {
    width: 100%;
    justify-content: center;
  }

  .chrome-left {
    flex-direction: column;
    gap: 8px;
  }

  .chrome-divider,
  .chrome-title .dim {
    display: none;
  }

  .chrome-title {
    text-align: center;
    font-size: 10px;
  }

  .chrome-right {
    flex-direction: column;
    overflow-x: auto;
  }

  .powered,
  .cta {
    width: min(220px, 100%);
    flex: 0 0 auto;
  }

  .progress {
    position: static;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .shell {
    padding-top: 12px;
    padding-bottom: 24px;
  }

  .section {
    padding: 12px;
  }

  .section-head {
    flex-wrap: wrap;
    align-items: center;
  }

  .section-head .rule {
    order: 10;
    flex-basis: 100%;
  }

  .profile-bar {
    align-items: stretch;
    flex-wrap: wrap;
    overflow: visible;
  }

  .profile-bar .lbl,
  .profile-bar .count {
    width: 100%;
  }

  .profile-bar select,
  .profile-bar .btn {
    flex: 1 1 140px;
  }

  .readme {
    font-size: 12px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 24px;
  }

  .seg {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .seg button {
    min-width: max-content;
  }

  .tbl {
    min-width: 900px;
  }

  div[style*="minmax(300px"],
  div[style*="minmax(260px"] {
    grid-template-columns: 1fr !important;
  }

  .tbl th,
  .tbl td {
    padding: 7px;
  }

  .cat-grid {
    grid-template-columns: minmax(110px, 1.1fr) repeat(4, minmax(92px, 1fr));
  }

  .bench-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .bench-name {
    max-width: 100%;
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .chrome-logo { width: 148px; height: 64px; }
  .chrome-title { font-size: 9px; }
  .powered { min-width: 120px; padding-inline: 8px; }
  .alokin-logo-img { width: 98px; height: 17px; }
  .cta { font-size: 10px; padding-inline: 8px; }
  .section-head { font-size: 11px; }
  .tab { font-size: 10px; }
}

@media print {
  .chrome,
  .progress,
  .tweaks,
  .btn,
  .action,
  .btn-x {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }

  .shell {
    display: block;
    padding: 0;
  }

  .section,
  .readme,
  .profile-bar {
    border-color: #ddd;
    background: #fff;
    break-inside: avoid;
  }
}
