.mm-mattress-tool {
  --mm-blue: #003366;
  --mm-blue-2: #00509d;
  --mm-light: #eef6ff;
  --mm-soft: #f7fbff;
  --mm-border: #d8e6f3;
  --mm-text: #1f2933;
  --mm-muted: #5b6673;
  --mm-green: #0f766e;
  width: 100%;
  font-family: inherit;
  color: var(--mm-text);
  box-sizing: border-box;
  line-height: 1.55;
}

.mm-mattress-tool *,
.mm-mattress-tool *::before,
.mm-mattress-tool *::after {
  box-sizing: border-box;
}

.mm-tool-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 14px 42px;
}

.mm-hero,
.mm-section {
  background: #ffffff;
  border: 1px solid var(--mm-border);
  border-radius: 20px;
  padding: 26px;
  margin: 22px 0;
  box-shadow: 0 8px 24px rgba(0, 51, 102, 0.06);
}

.mm-hero {
  background: linear-gradient(135deg, #eef6ff 0%, #ffffff 62%);
}

.mm-eyebrow {
  display: inline-flex;
  background: #ffffff;
  color: var(--mm-blue);
  border: 1px solid var(--mm-border);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
}

.mm-hero h1 {
  color: var(--mm-blue);
  font-size: clamp(31px, 5vw, 50px);
  line-height: 1.08;
  margin: 0 0 14px;
}

.mm-hero p,
.mm-section-intro {
  color: var(--mm-muted);
  max-width: 880px;
  font-size: 16px;
  margin: 0 0 18px;
}

.mm-section h2 {
  color: var(--mm-blue);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
  margin: 0 0 12px;
}

.mm-hero-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.mm-hero-chip {
  background: #ffffff;
  border: 1px solid var(--mm-border);
  border-radius: 14px;
  padding: 12px;
  color: var(--mm-blue);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.mm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  background: var(--mm-blue);
  color: #ffffff !important;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none !important;
  cursor: pointer;
  transition: 0.18s ease;
  box-shadow: 0 6px 15px rgba(0, 51, 102, 0.18);
}

.mm-btn:hover {
  background: var(--mm-blue-2);
  transform: translateY(-1px);
}

.mm-btn-secondary {
  background: #ffffff;
  color: var(--mm-blue) !important;
  border: 1px solid var(--mm-border);
  box-shadow: none;
}

.mm-btn-secondary:hover {
  background: var(--mm-light);
}

.mm-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.mm-category-card {
  background: var(--mm-soft);
  border: 1px solid var(--mm-border);
  border-radius: 16px;
  padding: 16px;
}

.mm-category-card h3 {
  color: var(--mm-blue);
  font-size: 18px;
  margin: 0 0 8px;
}

.mm-category-card p {
  color: var(--mm-muted);
  font-size: 14px;
  margin: 0;
}

.mm-tool-shell {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 22px;
  align-items: start;
}

/* IMPORTANT: after results load, the whole results area becomes full width */
.mm-mattress-tool.mm-results-mode .mm-tool-shell {
  display: block;
}

.mm-mattress-tool.mm-results-mode .mm-progress-panel,
.mm-mattress-tool.mm-results-mode #mmMattressForm {
  display: none !important;
}

.mm-progress-panel {
  position: sticky;
  top: 18px;
  background: var(--mm-soft);
  border: 1px solid var(--mm-border);
  border-radius: 18px;
  padding: 18px;
}

.mm-progress-panel h3 {
  color: var(--mm-blue);
  margin: 0 0 10px;
  font-size: 19px;
}

.mm-progress-bar {
  height: 10px;
  background: #dcebf7;
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 10px;
}

.mm-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--mm-blue);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.mm-progress-text {
  font-size: 14px;
  color: var(--mm-muted);
  margin: 0 0 14px;
}

.mm-safety-note {
  background: #fff8e8;
  border: 1px solid #f1d28b;
  border-radius: 14px;
  padding: 13px;
  font-size: 13px;
  color: #68460d;
  margin-top: 14px;
}

.mm-question-card {
  display: none;
  background: #ffffff;
  border: 1px solid var(--mm-border);
  border-radius: 18px;
  padding: 26px;
  min-height: 410px;
}

.mm-question-card.active {
  display: block;
}

.mm-question-kicker {
  color: var(--mm-blue-2);
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.mm-question-card h3 {
  color: var(--mm-blue);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  margin: 0 0 10px;
}

.mm-question-help {
  color: var(--mm-muted);
  margin: 0 0 20px;
  font-size: 15px;
}

.mm-options {
  display: grid;
  gap: 12px;
}

.mm-option {
  border: 1px solid var(--mm-border);
  border-radius: 15px;
  padding: 16px;
  cursor: pointer;
  background: #ffffff;
  transition: 0.16s ease;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.mm-option:hover {
  border-color: var(--mm-blue-2);
  background: var(--mm-soft);
}

.mm-option input {
  margin-top: 5px;
  accent-color: var(--mm-blue);
}

.mm-option strong {
  display: block;
  color: var(--mm-blue);
  font-size: 15px;
  margin-bottom: 2px;
}

.mm-option span {
  display: block;
  color: var(--mm-muted);
  font-size: 13px;
}

.mm-nav-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}

.mm-results {
  display: none;
  width: 100%;
}

.mm-results.active {
  display: block;
}

.mm-result-heading {
  background: linear-gradient(135deg, var(--mm-blue), #004b8f);
  color: #ffffff;
  border-radius: 20px;
  padding: 24px;
  margin: 0 0 22px;
}

.mm-result-heading h2 {
  color: #ffffff;
  margin: 0 0 8px;
}

.mm-result-heading p {
  margin: 0;
  color: #eaf4ff;
}

.mm-alert {
  background: #fff3f0;
  border: 1px solid #ffc9bf;
  color: #7a271a;
  padding: 14px;
  border-radius: 14px;
  margin: 14px 0;
  font-size: 14px;
}

.mm-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0 28px;
}

.mm-summary-item {
  background: var(--mm-soft);
  border: 1px solid var(--mm-border);
  border-radius: 15px;
  padding: 15px;
}

.mm-summary-item span {
  display: block;
  color: var(--mm-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.mm-summary-item strong {
  color: var(--mm-blue);
  font-size: 16px;
}

/* Revised product section: full-width professional report cards */
.mm-product-grid {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 22px;
}

.mm-product-card {
  background: #ffffff;
  border: 1px solid var(--mm-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0, 51, 102, 0.07);
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: stretch;
}

.mm-product-badge {
  grid-column: 1 / -1;
  background: var(--mm-light);
  color: var(--mm-blue);
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 18px;
  border-bottom: 1px solid var(--mm-border);
}

.mm-product-img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: contain;
  background: #ffffff;
  padding: 22px;
  border-right: 1px solid var(--mm-border);
}

.mm-product-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.mm-product-body h3 {
  color: var(--mm-blue);
  font-size: clamp(21px, 2.3vw, 29px);
  line-height: 1.18;
  margin: 0 0 10px;
}

.mm-match-score {
  display: inline-flex;
  width: fit-content;
  background: #e9fbf8;
  color: var(--mm-green);
  border: 1px solid #b8eee5;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 12px;
}

.mm-product-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 12px 0 14px;
  font-size: 13px;
}

.mm-product-meta div {
  background: var(--mm-soft);
  border: 1px solid var(--mm-border);
  border-radius: 12px;
  padding: 10px;
  color: var(--mm-muted);
}

.mm-product-meta strong {
  color: var(--mm-blue);
}

.mm-product-body p {
  color: var(--mm-muted);
  margin: 0 0 12px;
}

.mm-why-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 14px;
  padding-left: 0;
  list-style: none;
  margin: 12px 0 18px;
  font-size: 14px;
  color: var(--mm-muted);
}

.mm-why-list li {
  padding-left: 22px;
  position: relative;
}

.mm-why-list li::before {
  content: "✓";
  color: var(--mm-green);
  font-weight: 900;
  position: absolute;
  left: 0;
}

.mm-product-body .mm-btn {
  margin-top: auto;
  width: fit-content;
  min-width: 190px;
}

.mm-education-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

details.mm-faq {
  border: 1px solid var(--mm-border);
  border-radius: 14px;
  padding: 14px 16px;
  background: #ffffff;
  margin: 10px 0;
}

details.mm-faq summary {
  cursor: pointer;
  color: var(--mm-blue);
  font-weight: 900;
  font-size: 15px;
}

details.mm-faq p {
  margin: 10px 0 0;
  color: var(--mm-muted);
  font-size: 14px;
}

.mm-bottom-cta {
  background: linear-gradient(135deg, var(--mm-blue), #004b8f);
  color: #ffffff;
  border-radius: 20px;
  padding: 26px;
  margin-top: 24px;
  text-align: center;
}

.mm-bottom-cta h2 {
  color: #ffffff;
  margin: 0 0 10px;
}

.mm-bottom-cta p {
  color: #eaf4ff;
  margin: 0 auto 16px;
  max-width: 760px;
}

@media (max-width: 920px) {
  .mm-hero-grid,
  .mm-category-grid,
  .mm-summary-grid,
  .mm-education-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mm-tool-shell {
    grid-template-columns: 1fr;
  }

  .mm-progress-panel {
    position: relative;
    top: auto;
  }

  .mm-product-card {
    grid-template-columns: 1fr;
  }

  .mm-product-img {
    border-right: none;
    border-bottom: 1px solid var(--mm-border);
    min-height: 220px;
  }

  .mm-product-meta {
    grid-template-columns: 1fr;
  }

  .mm-why-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .mm-tool-wrap {
    padding: 14px 10px 34px;
  }

  .mm-hero,
  .mm-section,
  .mm-question-card {
    padding: 18px;
    border-radius: 16px;
  }

  .mm-hero-grid,
  .mm-category-grid,
  .mm-summary-grid,
  .mm-education-grid {
    grid-template-columns: 1fr;
  }

  .mm-nav-row {
    flex-direction: column;
  }

  .mm-nav-row .mm-btn,
  .mm-product-body .mm-btn {
    width: 100%;
  }
}
.mm-results-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 6px 0 16px;
}

.mm-results-top-row h2 {
  margin: 0 0 6px;
}

.mm-results-top-row .mm-section-intro {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .mm-results-top-row {
    flex-direction: column;
    align-items: stretch;
  }

  .mm-results-top-row .mm-btn {
    width: 100%;
  }
}
.mm-mattress-tool .mm-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.mm-mattress-tool .mm-action-row-center {
  justify-content: center;
}

@media (max-width: 640px) {
  .mm-mattress-tool .mm-action-row {
    flex-direction: column;
  }

  .mm-mattress-tool .mm-action-row .mm-btn {
    width: 100%;
  }
}
