.hsd-roadmap {
  --hsd-dark: #012626;
  --hsd-green: #025951;
  --hsd-bright: #04bf7b;
  --hsd-soft: #cef2d7;
  --hsd-light: #f2f2f2;
  --hsd-white: #ffffff;
  color: var(--hsd-dark);
  font-family: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hsd-roadmap__heading,
.hsd-roadmap-card__title {
  font-family: "Josefin Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--hsd-dark);
}

.hsd-roadmap__intro {
  max-width: 760px;
  margin: 0 0 2rem;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.hsd-roadmap__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.hsd-roadmap-card {
  background: var(--hsd-white);
  border: 2px solid var(--hsd-soft);
  border-radius: 24px;
  padding: 1.35rem;
  box-shadow: none;
}

.hsd-roadmap-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .85rem;
}

.hsd-roadmap-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .35rem .7rem;
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1.2;
  background: var(--hsd-soft);
  color: var(--hsd-dark);
}


.hsd-roadmap-badge--visibility {
  background: var(--hsd-light);
  color: var(--hsd-dark);
}

.hsd-roadmap-card__title {
  margin: 0 0 .75rem;
  font-size: 1.45rem;
  line-height: 1.25;
}

.hsd-roadmap-card__content {
  line-height: 1.65;
}

.hsd-roadmap-card__content p:last-child {
  margin-bottom: 0;
}

.hsd-roadmap-card__facts {
  display: grid;
  gap: .5rem;
  margin: 1rem 0 1.25rem;
}

.hsd-roadmap-card__facts div {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.hsd-roadmap-card__facts dt {
  font-weight: 700;
}

.hsd-roadmap-card__facts dd {
  margin: 0;
}

.hsd-roadmap-card__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  align-items: stretch;
}

.hsd-roadmap-vote {
  appearance: none;
  border: 2px solid var(--hsd-green);
  border-radius: 64px;
  background: var(--hsd-green);
  color: var(--hsd-white);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  min-height: 44px;
  padding: .72rem 1rem;
  text-align: left;
  text-transform: uppercase;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.hsd-roadmap-vote:hover,
.hsd-roadmap-vote:focus-visible {
  background: var(--hsd-white);
  border-color: var(--hsd-bright);
  color: var(--hsd-dark);
  outline: 3px solid var(--hsd-bright);
  outline-offset: 3px;
}

.hsd-roadmap-vote:disabled {
  cursor: not-allowed;
  opacity: .72;
}

.hsd-roadmap-vote__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 1.75rem;
  min-height: 1.75rem;
  margin-left: auto;
  border-radius: 999px;
  background: var(--hsd-white);
  color: var(--hsd-dark);
}

@media (max-width: 640px) {
  .hsd-roadmap-card__actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .hsd-roadmap-card {
    padding: 1rem;
    border-radius: 18px;
  }

  .hsd-roadmap-vote {
    width: 100%;
  }
}

.hsd-roadmap-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.hsd-roadmap-pagination__button {
  appearance: none;
  border: 2px solid var(--hsd-green);
  border-radius: 999px;
  background: var(--hsd-white);
  color: var(--hsd-dark);
  cursor: pointer;
  font-weight: 800;
  min-height: 44px;
  padding: .7rem 1rem;
}

.hsd-roadmap-pagination__button:hover,
.hsd-roadmap-pagination__button:focus-visible {
  background: var(--hsd-green);
  color: var(--hsd-white);
  outline: 3px solid var(--hsd-bright);
  outline-offset: 3px;
}

.hsd-roadmap-pagination__button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.hsd-roadmap-pagination__status {
  font-weight: 700;
}

/* v1.4: Mobile pagination refinement */
@media (max-width: 640px) {
  .hsd-roadmap-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .85rem;
  }

  .hsd-roadmap-pagination__status {
    order: -1;
    width: 100%;
    text-align: center;
  }

  .hsd-roadmap-pagination__button {
    width: 100%;
    max-width: 320px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
}

/* v1.5.1: Language note and keyboard navigation refinement */
.hsd-roadmap-note {
  background: var(--hsd-soft);
  border: 2px solid var(--hsd-bright);
  border-left-width: 6px;
  border-radius: 18px;
  color: var(--hsd-dark);
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
}

.hsd-roadmap-note p {
  margin: 0;
  line-height: 1.65;
}

.hsd-roadmap-note strong {
  color: var(--hsd-green);
}

.hsd-roadmap-card:focus-visible {
  outline: 4px solid var(--hsd-bright);
  outline-offset: 4px;
}

.hsd-roadmap-card[hidden] {
  display: none !important;
}

/* v1.5.3: accessible focusable vote buttons and compact desktop typography */
.hsd-roadmap-vote {
  font-size: .78rem;
  line-height: 1.15;
  padding: .62rem .75rem;
  white-space: nowrap;
}

.hsd-roadmap-vote__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hsd-roadmap-vote__count {
  min-width: 1.55rem;
  min-height: 1.55rem;
  font-size: .82rem;
}

.hsd-roadmap-vote[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .72;
}

.hsd-roadmap-vote[aria-disabled="true"]:focus-visible {
  background: var(--hsd-green);
  border-color: var(--hsd-bright);
  color: var(--hsd-white);
  outline: 3px solid var(--hsd-bright);
  outline-offset: 3px;
}

@media (min-width: 641px) {
  .hsd-roadmap-card__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hsd-roadmap-note {
    border-left-width: 4px;
    border-radius: 14px;
    margin-bottom: 1.25rem;
    padding: .85rem 1rem;
  }
}

/* v1.5.4: Robust vertical vote actions and keyboard-friendly pagination */
.hsd-roadmap-card {
  display: flex;
  flex-direction: column;
}

.hsd-roadmap-card__actions {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: .65rem;
  margin-top: auto;
  align-items: stretch;
}

.hsd-roadmap-vote {
  width: 100%;
  min-height: 46px;
  justify-content: space-between;
  font-size: .92rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  padding: .68rem .85rem;
}

.hsd-roadmap-vote__label {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.hsd-roadmap-vote__count {
  flex: 0 0 auto;
}

.hsd-roadmap-pagination__button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .55;
}

.hsd-roadmap-pagination__button[aria-disabled="true"]:focus-visible {
  background: var(--hsd-white);
  color: var(--hsd-dark);
  outline: 3px solid var(--hsd-bright);
  outline-offset: 3px;
}


/* v1.5.7: Keep last odd roadmap card at half width on desktop */
.hsd-roadmap__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hsd-roadmap-card {
  width: auto;
  max-width: none;
}

@media (max-width: 640px) {
  .hsd-roadmap__grid {
    grid-template-columns: 1fr;
  }
}


/* v1.5.8: Desktop vote buttons use a refined, content-friendly width */
@media (min-width: 1025px) {
  .hsd-roadmap-card__actions {
    width: 70%;
    max-width: 340px;
    min-width: 280px;
    align-self: flex-start;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .hsd-roadmap-card__actions {
    width: 85%;
    max-width: 360px;
    min-width: 0;
    align-self: flex-start;
  }
}

@media (max-width: 640px) {
  .hsd-roadmap-card__actions {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
}

/* v1.6.2: Accessible Roadmap / Bugfix filters */
.hsd-roadmap-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin: 0 0 1.5rem;
}

.hsd-roadmap-filter {
  appearance: none;
  border: 2px solid var(--hsd-green);
  border-radius: 999px;
  background: var(--hsd-white);
  color: var(--hsd-dark);
  cursor: pointer;
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.2;
  min-height: 44px;
  padding: .65rem 1rem;
}

.hsd-roadmap-filter:hover,
.hsd-roadmap-filter:focus-visible {
  border-color: var(--hsd-bright);
  outline: 3px solid var(--hsd-bright);
  outline-offset: 3px;
}

.hsd-roadmap-filter.is-active,
.hsd-roadmap-filter[aria-pressed="true"] {
  background: var(--hsd-green);
  border-color: var(--hsd-green);
  color: var(--hsd-white);
}

.hsd-roadmap-filter.is-active:focus-visible,
.hsd-roadmap-filter[aria-pressed="true"]:focus-visible {
  border-color: var(--hsd-bright);
  outline: 3px solid var(--hsd-bright);
  outline-offset: 3px;
}

.hsd-roadmap-filter-empty {
  margin: 0 0 1.5rem;
  font-weight: 600;
}

.hsd-roadmap-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 640px) {
  .hsd-roadmap-filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hsd-roadmap-filter {
    width: 100%;
  }
}
