:host {
  --ink: #13201d;
  --muted: #52615d;
  --line: #d7e0dd;
  --soft: #f4f8f6;
  --paper: #ffffff;
  --green: #087f65;
  --green-dark: #075d4d;
  --coral: #f16c55;
  --yellow: #f5c64d;
  --blue: #246b84;
  --shadow: 0 20px 55px rgba(17, 45, 38, 0.18);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic", "YuGothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: var(--ink);
  display: block;
  width: 100%;
  min-width: 0;
  background: transparent;
  color-scheme: light;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

button,
a {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.page-shell {
  display: grid;
  width: 100%;
  min-height: 0;
  place-items: stretch;
  padding: 0;
}

.diagnosis-launch {
  width: min(850px, 100%);
  overflow: hidden;
  border: 1px solid #cbd8d3;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 14px 40px rgba(22, 58, 49, 0.1);
}

.launch-header {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
}

.brand {
  color: var(--green-dark);
  font-size: 15px;
  font-weight: 800;
}

.tool-name {
  padding-left: 12px;
  border-left: 3px solid var(--coral);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.launch-body {
  max-width: 670px;
  padding: 58px 44px 54px;
}

.launch-kicker {
  margin: 0 0 18px;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 800;
}

.launch-kicker::before {
  display: inline-block;
  width: 38px;
  height: 4px;
  margin: 0 10px 3px 0;
  background: var(--coral);
  content: "";
}

.launch-title {
  margin: 0;
  color: var(--ink);
  font-size: 44px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0;
}

.launch-lead {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.95;
}

.launch-button,
.primary-button {
  border: 0;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.launch-button {
  display: inline-flex;
  width: min(360px, 100%);
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  margin-top: 30px;
  padding: 0 20px 0 24px;
  border-radius: 7px;
  box-shadow: 0 12px 25px rgba(8, 127, 101, 0.2);
}

.launch-button span:last-child {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
}

.launch-button:hover,
.primary-button:hover {
  background: var(--green-dark);
}

.launch-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.close-button:focus-visible,
.option-button:focus-visible,
.service-link:focus-visible,
.restart-button:focus-visible {
  outline: 3px solid rgba(36, 107, 132, 0.35);
  outline-offset: 2px;
}

.launch-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  background: var(--soft);
}

.launch-facts div {
  min-width: 0;
  padding: 17px 24px;
}

.launch-facts div + div {
  border-left: 1px solid var(--line);
}

.launch-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.launch-facts dd {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 24, 20, 0.72);
}

.modal-backdrop[hidden] {
  display: none;
}

.diagnosis-modal {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(900px, 100%);
  max-height: min(880px, calc(100vh - 40px));
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: #10221d;
  color: #fff;
}

.modal-branding {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-branding span {
  color: #67ddb9;
  font-size: 14px;
  font-weight: 800;
}

.modal-branding strong {
  padding-left: 14px;
  border-left: 1px solid #4c625c;
  font-size: 15px;
}

.close-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #586b66;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 25px;
  line-height: 1;
}

.progress-area {
  padding: 20px 28px 0;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

#progress-percent {
  color: var(--coral);
}

.progress-track {
  height: 5px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 3px;
  background: #e5ece9;
}

.progress-track span {
  display: block;
  width: 17%;
  height: 100%;
  background: var(--coral);
  transition: width 180ms ease;
}

.modal-content {
  min-height: 0;
  overflow-y: auto;
  padding: 34px 48px 40px;
}

.question-eyebrow {
  margin: 0 0 14px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
}

.question-eyebrow::before {
  display: inline-block;
  width: 20px;
  height: 2px;
  margin: 0 8px 3px 0;
  background: currentColor;
  content: "";
}

.question-title {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 27px;
  font-weight: 800;
  line-height: 1.5;
}

.question-description {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 25px;
}

.option-button {
  min-height: 92px;
  padding: 16px 18px;
  border: 1px solid #cad6d2;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.option-button:hover {
  border-color: var(--green);
  background: #f6fbf9;
}

.option-button[aria-pressed="true"] {
  border: 2px solid var(--green);
  background: #edf8f4;
  box-shadow: inset 4px 0 0 var(--yellow);
}

.option-label {
  display: block;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
}

.option-description {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: #f6f9f8;
}

.primary-button,
.secondary-button {
  min-width: 132px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
}

.secondary-button {
  border: 1px solid #bfcac6;
  background: #fff;
  color: var(--ink);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  border-color: #d6dedb;
  background: #e8edeb;
  color: #94a29e;
  box-shadow: none;
}

.loading-state,
.error-state {
  display: grid;
  min-height: 250px;
  place-items: center;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  border: 4px solid #dce8e4;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.result-intro {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.result-label {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
}

.result-title {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.45;
}

.result-summary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.answer-factors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 17px;
}

.factor-chip,
.service-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.factor-chip {
  padding: 7px 10px;
  background: #e9f5f1;
  color: var(--green-dark);
}

.result-section-title {
  margin: 27px 0 14px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.result-section-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.service-list {
  display: grid;
  gap: 13px;
}

.service-card {
  border: 1px solid #d2dcd8;
  border-left: 5px solid var(--green);
  border-radius: 7px;
  background: #fff;
}

.service-card:nth-child(2) {
  border-left-color: var(--blue);
}

.service-card:nth-child(3) {
  border-left-color: var(--coral);
}

.service-main {
  padding: 20px 21px 18px;
}

.service-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.service-tag {
  padding: 5px 8px;
  background: #eef3f1;
  color: #40504b;
}

.pr-tag {
  padding: 4px 7px;
  border: 1px solid #e5a13b;
  border-radius: 3px;
  color: #8b5609;
  font-size: 10px;
  font-weight: 800;
}

.budget-warning {
  padding: 4px 7px;
  border: 1px solid #d7a140;
  border-radius: 3px;
  background: #fff9e8;
  color: #76500e;
  font-size: 10px;
  font-weight: 800;
}

.result-warning {
  margin: 15px 0 0;
  padding: 11px 13px;
  border-left: 4px solid var(--yellow);
  background: #fffaf0;
  color: #654d1e;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.65;
}

.service-name {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.45;
}

.service-headline {
  margin: 5px 0 0;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
}

.service-description {
  margin: 10px 0 0;
  color: #34433f;
  font-size: 14px;
  line-height: 1.78;
}

.matched-heading {
  margin: 16px 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.matched-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.matched-list li {
  padding: 6px 9px;
  border: 1px solid #cfe0da;
  border-radius: 4px;
  background: #f5faf8;
  color: #245b4d;
  font-size: 12px;
  font-weight: 700;
}

.service-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 20px;
  border-top: 1px solid #e1e7e5;
  background: #f8faf9;
}

.service-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.service-link {
  display: inline-flex;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
  border-radius: 5px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.service-link:hover {
  background: var(--green-dark);
  color: #fff;
}

.alternatives {
  margin-top: 22px;
  padding: 17px 19px;
  border: 1px solid #d8e0de;
  border-radius: 7px;
  background: var(--soft);
}

.alternatives strong {
  display: block;
  font-size: 14px;
}

.alternative-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.alternative-list span {
  padding: 6px 9px;
  border: 1px solid #d3dcda;
  border-radius: 4px;
  background: #fff;
  color: #34433f;
  font-size: 12px;
  font-weight: 700;
}

.result-actions {
  display: flex;
  justify-content: center;
  margin-top: 25px;
}

.restart-button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #bbc8c4;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.result-disclaimer {
  margin: 18px 0 0;
  color: #6c7975;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 700px) {
  .page-shell {
    padding: 0;
  }

  .launch-header {
    min-height: 58px;
    padding: 13px 16px;
  }

  .launch-body {
    padding: 38px 22px 40px;
  }

  .launch-title {
    font-size: 32px;
    line-height: 1.45;
  }

  .launch-lead {
    font-size: 14px;
  }

  .launch-facts div {
    padding: 14px 12px;
  }

  .launch-facts dd {
    font-size: 14px;
  }

  .modal-backdrop {
    padding: 0;
  }

  .diagnosis-modal {
    width: 100%;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
  }

  .modal-header {
    min-height: 58px;
    padding: 10px 14px;
  }

  .progress-area {
    padding: 14px 18px 0;
  }

  .modal-content {
    padding: 27px 20px 32px;
  }

  .question-title,
  .result-title {
    font-size: 23px;
  }

  .options-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .option-button {
    min-height: 80px;
    padding: 13px 15px;
  }

  .modal-footer {
    padding: 10px 14px;
  }

  .primary-button,
  .secondary-button {
    min-width: 0;
    flex: 1;
  }

  .service-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .service-link {
    justify-content: center;
  }
}

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