:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f7f9f7;
  --ink: #151916;
  --muted: #65706a;
  --muted-strong: #3e4842;
  --line: #dfe6e0;
  --line-strong: #c7d2ca;
  --charcoal: #101512;
  --charcoal-2: #18201b;
  --green: #11823b;
  --green-strong: #086c2d;
  --green-soft: #e7f6ec;
  --gold: #d19a05;
  --gold-soft: #fff5d6;
  --red: #d93a31;
  --red-soft: #fde9e7;
  --blue: #1766c2;
  --blue-soft: #e8f1ff;
  --violet: #6f48c9;
  --violet-soft: #f0eafa;
  --shadow: 0 18px 45px rgba(16, 21, 18, 0.1);
  --shadow-soft: 0 10px 28px rgba(16, 21, 18, 0.08);
  --radius: 8px;
  --header-h: 66px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 1) 430px),
    radial-gradient(circle at 18% 0%, rgba(17, 130, 59, 0.07), transparent 32%),
    var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: 6px;
  background: #fff;
  color: var(--green-strong);
  padding: 10px 14px;
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  min-height: var(--header-h);
  align-items: center;
  gap: 18px;
  padding: 13px 24px;
  background:
    linear-gradient(90deg, rgba(16, 21, 18, 0.99), rgba(16, 21, 18, 0.94)),
    url("./assets/pitch-bracket.png");
  background-position: center 38%;
  background-size: cover;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: #fff;
  color: var(--charcoal);
}

.brand-mark i {
  width: 24px;
  height: 24px;
}

.brand-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 23px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.2;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.language-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
}

.language-switch button {
  min-width: 48px;
  min-height: 34px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.language-switch button[aria-pressed="true"] {
  background: rgba(57, 216, 107, 0.16);
  color: #7df397;
}

.status-chip,
.wallet-chip,
.saved-state {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-chip {
  padding: 0 12px;
}

.wallet-chip {
  padding: 0 12px;
}

.wallet-chip i {
  width: 18px;
  height: 18px;
  color: #f0c650;
}

.wallet-chip div {
  display: grid;
  gap: 1px;
}

.wallet-chip strong {
  font-size: 14px;
  line-height: 1;
}

.wallet-chip span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  line-height: 1;
}

.saved-state {
  max-width: 170px;
  overflow: hidden;
  padding: 0 11px;
  color: rgba(255, 255, 255, 0.68);
  text-overflow: ellipsis;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #39d86b;
  box-shadow: 0 0 0 4px rgba(57, 216, 107, 0.12);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 398px);
  gap: 28px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 30px 44px;
}

.main-column {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 290px);
  gap: 28px;
  align-items: end;
  min-height: 148px;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, #fff 0 52%, rgba(255, 255, 255, 0.78)),
    url("./assets/pitch-bracket.png");
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow-soft);
}

.hero-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 680px;
  margin: 0;
  color: var(--muted-strong);
  font-size: 15px;
  line-height: 1.55;
}

.vote-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  align-items: center;
  min-height: 88px;
  padding: 16px;
  border: 1px solid rgba(17, 130, 59, 0.34);
  border-radius: var(--radius);
  background: rgba(231, 246, 236, 0.94);
  color: var(--green-strong);
}

.vote-note i {
  width: 28px;
  height: 28px;
}

.vote-note strong,
.vote-note span {
  display: block;
}

.vote-note strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.vote-note span {
  color: #2f553b;
  font-size: 12px;
  line-height: 1.42;
}

.section-block {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}

.section-head h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.15;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.metric-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 11px;
  color: var(--muted);
  font-size: 12px;
}

.metric-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-box {
  width: 20px;
  height: 7px;
  border-radius: 99px;
}

.legend-box.low {
  background: var(--red);
}

.legend-box.medium {
  background: var(--gold);
}

.legend-box.high {
  background: var(--green);
}

.proposal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.proposal-card {
  --accent: var(--green);
  display: grid;
  min-height: 360px;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  outline: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.proposal-card:hover,
.proposal-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent), #ffffff 28%);
  box-shadow: var(--shadow-soft);
}

.proposal-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent), transparent 82%);
}

.proposal-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.rank-badge,
.selected-badge {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.selected-badge {
  visibility: hidden;
  background: var(--accent);
  color: #fff;
}

.proposal-card.selected .selected-badge {
  visibility: visible;
}

.proposal-icon {
  display: grid;
  justify-self: center;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent), #ffffff 88%);
  color: var(--accent);
}

.proposal-icon i {
  width: 31px;
  height: 31px;
  stroke-width: 2.2px;
}

.proposal-title {
  text-align: center;
}

.proposal-title h3 {
  margin: 0 0 5px;
  font-size: 16px;
  line-height: 1.15;
}

.proposal-title p {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.proposal-summary {
  margin: 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.metric-list {
  display: grid;
  gap: 8px;
  align-self: end;
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(54px, 1fr) 62px 32px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}

.metric-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}

.meter span {
  height: 6px;
  border-radius: 99px;
  background: #dce4de;
}

.meter span.on {
  background: var(--accent);
}

.score-value {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.token-stepper {
  display: grid;
  grid-template-columns: 34px minmax(44px, 1fr) 34px auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.token-stepper button {
  display: grid;
  min-height: 36px;
  place-items: center;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.token-stepper button:hover {
  background: #fff;
}

.token-stepper i {
  width: 16px;
  height: 16px;
}

.token-stepper input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
  text-align: center;
}

.token-unit {
  padding-right: 9px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.reference-only {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
}

.reference-only i {
  width: 16px;
  height: 16px;
}

.rail-reference {
  width: 100%;
}

.allocation-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.allocation-ring {
  --pct: 0deg;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--pct), #e4ebe5 0);
}

.allocation-ring div {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--green-strong);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.allocation-ring strong {
  font-size: 16px;
}

.allocation-copy {
  display: grid;
  gap: 2px;
}

.allocation-copy strong {
  color: var(--green-strong);
  font-size: 14px;
}

.allocation-copy span {
  color: var(--muted);
  font-size: 12px;
}

.utility-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.utility-button {
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--muted-strong);
}

.utility-button:hover,
.secondary-button:hover {
  border-color: var(--green);
  color: var(--green-strong);
}

.primary-button {
  width: 100%;
  padding: 0 16px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 14px 26px rgba(17, 130, 59, 0.24);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--green-strong);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
}

.secondary-button {
  width: 100%;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.utility-button i,
.primary-button i,
.secondary-button i {
  width: 17px;
  height: 17px;
}

.compare-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.compare-table table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

.compare-table th,
.compare-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.35;
}

.compare-table th {
  background: #fbfcfb;
  color: var(--muted-strong);
  font-size: 11px;
  text-transform: uppercase;
}

.compare-table tr:last-child td {
  border-bottom: 0;
}

.compare-table td:first-child,
.compare-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  color: var(--muted-strong);
  font-weight: 850;
}

.compare-table th:first-child {
  background: #fbfcfb;
}

.global-vote-panel {
  display: grid;
  gap: 12px;
}

.global-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr)) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(231, 246, 236, 0.9), rgba(255, 255, 255, 0.94)),
    var(--surface);
}

.global-stat {
  display: grid;
  gap: 2px;
}

.global-stat strong {
  color: var(--green-strong);
  font-size: 24px;
  line-height: 1;
}

.global-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.results-list {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.result-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) 1fr minmax(70px, auto);
  gap: 12px;
  align-items: center;
  font-size: 12px;
}

.result-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-track {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: #e5ebe6;
}

.result-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.global-empty {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.global-empty strong {
  color: var(--muted-strong);
  font-size: 13px;
}

.decision-rail {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.decision-rail--inline {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  border-color: color-mix(in srgb, var(--green), var(--line) 74%);
}

.decision-rail--stacked {
  margin-bottom: 18px;
}

.decision-panel {
  --accent: var(--green);
  display: grid;
  gap: 20px;
  padding: 22px;
}

.selected-package {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  align-items: start;
}

.selected-package .rank-badge {
  width: 38px;
  height: 38px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
}

.rail-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.selected-package h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.12;
}

.recommendation {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  margin-top: 9px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--accent), #ffffff 62%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent), #ffffff 90%);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.rail-summary {
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.52;
}

.rail-section {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.rail-section h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.change-list {
  display: grid;
  gap: 10px;
}

.change-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 0.72fr) minmax(140px, 1.28fr);
  gap: 9px;
  align-items: start;
  color: var(--muted-strong);
  font-size: 12px;
}

.change-row i {
  width: 18px;
  height: 18px;
  color: var(--ink);
}

.change-row span:nth-child(2) {
  min-width: 0;
  line-height: 1.3;
}

.change-row strong {
  line-height: 1.35;
  text-align: right;
  overflow-wrap: anywhere;
}

.rail-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-list li {
  display: grid;
  grid-template-columns: 19px 1fr;
  gap: 9px;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.42;
}

.rail-list i {
  width: 16px;
  height: 16px;
}

.rail-list .good-icon {
  color: var(--green);
}

.rail-list .risk-icon {
  color: var(--red);
}

.best-fit {
  margin: 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

.rail-actions {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.save-note {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.save-note i {
  width: 15px;
  height: 15px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: none;
  max-width: min(360px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid rgba(17, 130, 59, 0.26);
  border-radius: var(--radius);
  background: #fff;
  color: var(--green-strong);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 850;
}

.toast.visible {
  display: block;
}

@media (max-width: 1360px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
    padding-inline: 22px;
  }

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

@media (max-width: 1180px) {
  :root {
    --header-h: 66px;
  }

  .topbar {
    grid-template-columns: minmax(190px, 1fr) auto;
  }

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

  .decision-rail {
    position: static;
    max-height: none;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 14px;
  }

  .brand {
    flex: 1 1 210px;
  }

  .brand-copy strong {
    font-size: 19px;
  }

  .top-actions {
    flex: 1 1 100%;
    justify-content: space-between;
    overflow-x: auto;
    padding-bottom: 1px;
  }

  .saved-state {
    display: none;
  }

  .workspace {
    padding: 18px 14px 34px;
  }

  .hero-panel {
    padding: 22px;
  }

  .hero-copy h1 {
    font-size: 35px;
  }

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

  .metric-legend {
    justify-content: flex-start;
  }

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

  .decision-rail--inline {
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
  }

  .decision-rail--inline .decision-panel {
    padding: 17px;
  }

  .decision-rail--inline .rail-section {
    padding-top: 14px;
  }

  .proposal-card {
    min-height: auto;
  }

  .token-stepper {
    grid-template-columns: 48px minmax(64px, 1fr) 48px auto;
  }

  .token-stepper button {
    min-height: 44px;
  }

  .token-stepper input {
    height: 36px;
  }

  .primary-button,
  .secondary-button,
  .utility-button {
    min-height: 46px;
  }

  .allocation-strip {
    grid-template-columns: auto 1fr;
  }

  .allocation-actions {
    grid-column: 1 / -1;
  }

  .utility-button {
    width: 100%;
  }

  .result-row {
    grid-template-columns: 1fr;
  }

  .global-summary {
    grid-template-columns: 1fr;
  }

  .change-row {
    grid-template-columns: 24px 1fr;
  }

  .change-row strong {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 440px) {
  .status-chip {
    display: none;
  }

  .language-switch button {
    min-width: 43px;
  }

  .wallet-chip {
    min-width: 96px;
  }

  .token-stepper {
    grid-template-columns: 36px 66px 36px auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
