@font-face {
  font-family: 'Anek Latin';
  src: url('../fonts/AnekLatin-VariableFont_wdth,wght.ttf') format('truetype');
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

/* Ensure Anek is actually used site-wide (the HTML inline style loads first). */
body {
  font-family: 'Anek Latin', sans-serif, 'Segoe UI';
}

:root {
  --red: #C7222A;
  --red-dark: #8B151B;
  --gold: #FFD65C;
  --black: #231F20;
  --grey-dk: #414042;
  --grey-md: #77787B;
  --grey-lt: #DCDDDE;
  --white: #FFFFFF;
  --ivory: #FFF4D9;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}


body.mobile-view {
  font-family: 'Anek Latin', sans-serif, 'Segoe UI';
  background: #FFFFFF;
  color: var(--black);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Mobile global "pop" tap animation for filters */
@keyframes mw-pop {
  0% { transform: scale(1); filter: brightness(1); }
  24% { transform: scale(0.965); filter: brightness(0.99); }
  62% { transform: scale(0.995); filter: brightness(1.04); }
  100% { transform: scale(1); filter: brightness(1); }
}

body.mobile-view .mw-pop {
  animation: mw-pop 520ms cubic-bezier(0.22, 1, 0.36, 1) 40ms;
  will-change: transform, filter;
}

/* Tab pane fade-in on switch */
@keyframes mw-fadein {
  0% { opacity: 0; transform: translateY(10px); filter: blur(2px); }
  60% { opacity: 1; transform: translateY(0); filter: blur(0); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

body.mobile-view .mw-fadein {
  animation: mw-fadein 600ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform, filter;
}

/* Dropdown arrow bounce (Index tab) */
@keyframes mw-bounce {
  0% { transform: translateY(-50%) scale(1); }
  35% { transform: translateY(calc(-50% - 4px)) scale(1.02); }
  62% { transform: translateY(calc(-50% - 1.5px)) scale(1.008); }
  82% { transform: translateY(-50%) scale(1); }
  100% { transform: translateY(-50%) scale(1); }
}

body.mobile-view .drop-arrow.mw-bounce {
  animation-name: mw-bounce;
  animation-duration: 560ms;
  animation-timing-function: ease-in-out;
  animation-iteration-count: 1;
  will-change: transform;
  transform-origin: center;
}

/* Pure CSS fallback (still feels good on tap) */
body.mobile-view .chip:active:not(.mw-pop),
body.mobile-view .gen-card:active:not(.mw-pop),
body.mobile-view .btn-reset:active,
body.mobile-view .btn-results:active {
  transform: scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
  body.mobile-view .mw-pop {
    animation: none;
  }
  body.mobile-view .mw-fadein {
    animation: none;
    filter: none;
  }
  body.mobile-view .drop-arrow.mw-bounce {
    animation: none;
  }
}

.mobile-widget {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding-bottom: 16px;
  background: var(--white);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
  border-radius: 0;
}

body.mobile-view #app {
  width: 100%;
  margin: 0;
  padding: 0;
}

.mobile-widget {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding-bottom: 16px;
  background: var(--white);
  /* box-shadow: var(--shadow); */
  box-shadow: none;
}

body.mobile-view #app {
  width: 100%;
  margin: 0;
  padding: 0;
}

.mw-header {
  background: var(--black);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 999;
}

.mw-header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
}

.mw-header-title span {
  color: var(--red);
}

.mw-header-badge {
  background: var(--red);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.section {
  background: var(--white);
  margin: 12px 16px 0;
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.section+.section {
  margin-top: 10px;
}

.btn-results-wrap,
.results-btn-wrap {
  padding: 4px 0px 0px 0px;
  margin: 0 16px;
}

.btn-results {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 50px;
  background: var(--red);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(199, 34, 42, 0.24);
  margin-top: 8px;
}

.btn-results:active {
  background: var(--red-dark);
  transform: scale(0.98);
}

.btn-results-hint {
  font-size: 11px;
  color: var(--grey-md);
  margin-top: 10px;
  text-align: center;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}

.section-header.open {
  border-bottom-color: #eee;
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.section-number.done {
  background: var(--red);
}

.section-number.done::after {
  content: '✓';
  font-size: 12px;
}

.section-number.done .num-text {
  display: none;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
}

.section-selection {
  font-size: 11px;
  color: var(--red);
  margin-top: 1px;
  font-weight: 600;
}

.section-chevron {
  font-size: 12px;
  color: var(--grey-md);
  transition: transform 0.25s;
}

.section-chevron.open {
  transform: rotate(180deg);
}

.section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.2s;
  padding: 0 16px;
}

.section-body.open {
  max-height: 600px;
  padding: 16px 16px 18px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.chip {
  border-radius: 50px;
  border: 1.5px solid #ddd;
  background: #fff;
  color: var(--grey-md);
  font-size: 13px;
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.chip.selected {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 600;
}

.gen-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gen-card {
  border: 1.5px solid #ddd;
  border-radius: 10px;
  padding: 11px;
  background: #fff;
  cursor: pointer;
  text-align: center;
}

.gen-card.selected {
  border-color: var(--red);
  background: var(--ivory);
}

.gen-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
}

.gen-card-years {
  font-size: 10px;
  color: var(--grey-md);
  margin-top: 2px;
}

.gen-card.selected .gen-card-name {
  color: var(--red);
}

.gen-card.selected .gen-card-years {
  color: var(--grey-md);
}

.btn-results-wrap {
  padding: 16px;
}

.btn-results {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 50px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(199, 34, 42, 0.3);
}

.btn-results:active {
  background: var(--red-dark);
  transform: scale(0.98);
}

.btn-results-hint {
  font-size: 11px;
  color: var(--grey-md);
  margin-top: 10px;
  text-align: center;
}

.results-panel {
  margin: 12px 16px 0;
  display: none;
}

.results-panel.visible {
  display: block;
}

.results-hero {
  background: var(--black);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 16px;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.cohort-tag {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin: 0 auto 10px;
  letter-spacing: 1.5px;
}

.scores-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 12px;
}

.score-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
}

.score-val {
  font-size: 30px;
  font-weight: 700;
  color: var(--gold);
}

.score-lbl {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 3px;
}

.quote-box {
  background: rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--red);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
}

.quote-text {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.82);
  font-style: italic;
  line-height: 1.4;
  word-break: break-word;
}

/* City line after the dash — same role as desktop .statement-footnote */
.quote-footnote {
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  font-style: italic;
  line-height: 1.35;
  word-break: break-word;
}

.quote-footnote[hidden] {
  display: none !important;
}

.results-tabs-card {
  background: #FFF;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.tab-row {
  display: flex;
  border: 1.5px solid var(--red);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  border: none;
  color: var(--red);
  background: transparent;
  padding: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--red);
  color: #fff;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.drop-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--grey-md);
  margin-bottom: 6px;
}

.drop-wrap {
  position: relative;
  margin-bottom: 8px;
}

.mw-native-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.mw-dd-trigger {
  width: 100%;
  padding: 11px 36px 11px 12px;
  border: 1.5px solid var(--red);
  border-radius: 10px;
  background: var(--ivory);
  color: var(--black);
  font-size: 13px;
  font-weight: 600;
  min-height: 40px;
  text-align: left;
}

.mw-dd-trigger:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(199, 34, 42, 0.14);
}

.mw-dd-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid rgba(35, 31, 32, 0.12);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
  z-index: 30;
  max-height: 240px;
  overflow: auto;
}

.drop-wrap.mw-dd-open .mw-dd-menu {
  display: block;
  animation: mw-fadein 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mw-dd-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
}

.mw-dd-item.active {
  background: rgba(199, 34, 42, 0.08);
  color: var(--red);
}

.mw-dd-item:active {
  transform: scale(0.99);
}

.drop-select {
  width: 100%;
  padding: 11px 36px 11px 12px;
  border: 1.5px solid var(--red);
  border-radius: 10px;
  background: var(--ivory);
  color: var(--black);
  font-size: 13px;
  font-weight: 600;
  min-height: 40px;
  appearance: none;
}

.drop-select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(199, 34, 42, 0.14);
}

.drop-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--red);
  font-size: 15px;
  font-weight: 700;
}

.interact-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--ivory);
  border: 1.5px solid var(--grey-lt);
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 14px;
}

.interact-banner-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.interact-banner-text {
  font-size: 12px;
  color: #333;
  line-height: 1.5;
}

.highlight-red {
  color: var(--red);
  font-weight: 700;
}

.stmt-preview {
  background: var(--ivory);
  border: 1.5px solid var(--grey-lt);
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
}

.stmt-preview-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--black);
  line-height: 1.5;
  margin-bottom: 8px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rank-badge {
  background: var(--red);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.rank-label {
  font-size: 10px;
  color: var(--grey-md);
}

.drop-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--red);
  font-size: 14px;
}

.cluster-item {
  margin-bottom: 10px;
}

.cluster-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.cluster-name {
  font-size: 12px;
  font-weight: 600;
}

.cluster-pct {
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
}

.cluster-bar-bg {
  height: 5px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
}

.cluster-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--red);
  transition: width 0.8s ease;
}

.cluster-desc {
  font-size: 10px;
  color: var(--grey-md);
  margin-top: 3px;
}

.reset-row {
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

.btn-reset {
  border: 1.5px solid #ddd;
  background: transparent;
  color: var(--grey-md);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
}

.btn-reset:active {
  border-color: var(--red);
  color: var(--red);
}

.disclaimer {
  font-size: 10px;
  color: #aaa;
  text-align: center;
  padding: 16px 16px 0;
  line-height: 1.5;
}

.sub-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--grey-md);
  margin-bottom: 8px;
  margin-top: 16px;
}

@media (max-width: 480px) {
  .section {
    margin: 12px 16px 0;
  }

  /* .section-header { padding: 12px; } */
  /* .section-title { font-size: 14px; } */
  /* .chip { padding: 7px 12px; font-size: 12px; } */
}