:root {
  color-scheme: light;
  --ink: #141817;
  --muted: #5e6a66;
  --line: #d9dfdc;
  --paper: #f7f8f4;
  --panel: #ffffff;
  --green: #147a5b;
  --blue: #245fb3;
  --red: #b84242;
  --gold: #d8a928;
  --shadow: 0 18px 44px rgba(20, 24, 23, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 244, 0.94);
  backdrop-filter: blur(16px);
  padding: 14px max(18px, calc((100vw - 1180px) / 2));
}

.brand,
.top-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
}

.top-nav {
  gap: 8px;
}

.top-nav a {
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  padding: 8px 10px;
  text-decoration: none;
}

.top-nav a:hover {
  background: #e9eee9;
  color: var(--ink);
}

.app-shell {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.tool-rail {
  display: grid;
  align-content: start;
  gap: 7px;
  position: sticky;
  top: 82px;
}

.tool-tab {
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  padding: 10px 12px;
  text-align: left;
}

.tool-tab:hover,
.tool-tab.is-active {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.tool-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(36px, 6vw, 70px);
  line-height: 0.96;
}

.panel-head p:last-child {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
}

.small-button,
.action-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  padding: 9px 12px;
}

.action-button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.tool-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin: 22px 0;
}

.field {
  display: grid;
  gap: 7px;
}

.field.wide {
  grid-column: 1 / -1;
}

.field label {
  color: #33413c;
  font-size: 13px;
  font-weight: 850;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c8d3ce;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
}

.field textarea {
  min-height: 142px;
  resize: vertical;
}

.result-zone {
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 20px;
}

.primary-result span,
.metric span {
  display: block;
  color: #bcd8cd;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

#primary-result {
  display: block;
  margin-top: 5px;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.secondary-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  padding: 12px;
}

.metric b {
  display: block;
  margin-top: 3px;
  font-size: 19px;
  overflow-wrap: anywhere;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.wheel-preview {
  display: none;
  width: min(320px, 100%);
  aspect-ratio: 1;
  margin-top: 18px;
  border: 10px solid #fff;
  border-radius: 50%;
  background: conic-gradient(var(--green), var(--blue), var(--gold), var(--red), var(--green));
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
}

.wheel-preview.is-visible {
  display: block;
}

.wheel-preview.is-spinning {
  animation: spin-wheel 0.7s ease-out;
}

.popular-band {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 28px;
  border-top: 1px solid var(--line);
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0;
}

.popular-band h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.06;
}

.popular-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.popular-list a {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-weight: 850;
  padding: 14px;
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 24px 16px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@keyframes spin-wheel {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(720deg);
  }
}

@media (max-width: 900px) {
  .app-shell,
  .popular-band {
    grid-template-columns: 1fr;
  }

  .tool-rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .site-header,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-nav,
  .tool-rail,
  .tool-form,
  .result-zone,
  .secondary-results,
  .popular-list {
    grid-template-columns: 1fr;
  }

  .top-nav {
    display: grid;
  }

  .app-shell,
  .popular-band {
    width: min(100% - 24px, 1180px);
  }

  .tool-panel {
    padding: 18px;
  }
}
