:root {
  --bg: #f3f5f7;
  --panel: #f8fafc;
  --panel-border: #d6dde7;
  --text: #071126;
  --muted: #64748b;
  --blue: #2d9ae3;
  --blue-dark: #5b7593;
  --alert-bg: #eef3f8;
  --alert-border: #6d86a4;
  --footer-border: #d7dee8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page {
  width: min(100%, 700px);
  margin: 0 auto;
  padding: 22px 18px 0;
}

.view[hidden] {
  display: none;
}

.brand {
  text-align: center;
  margin-top: 2px;
}

.logo {
  width: 66px;
  height: 66px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  box-shadow: 0 8px 18px rgba(45, 154, 227, 0.18);
}

.logo svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.subtitle {
  margin: 10px 0 20px;
  font-size: clamp(1.05rem, 2.3vw, 1.35rem);
  line-height: 1.25;
  color: var(--blue-dark);
  font-weight: 400;
}

.card {
  width: min(100%, 650px);
  margin: 0 auto;
  padding: 26px 26px 22px;
  border: 2px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(12, 24, 45, 0.05);
}

.card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 2.8vw, 1.9rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.intro {
  margin: 0 0 22px;
  max-width: 560px;
  color: var(--blue-dark);
  font-size: clamp(0.95rem, 1.5vw, 1.08rem);
  line-height: 1.45;
}

.checks {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  color: var(--blue-dark);
  font-size: clamp(0.95rem, 1.45vw, 1.08rem);
  line-height: 1.55;
}

.checks li {
  margin-bottom: 8px;
  position: relative;
  padding-left: 1.15em;
}

.checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--blue-dark);
  font-weight: 500;
}

.warning {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 2px solid var(--alert-border);
  border-radius: 12px;
  background: var(--alert-bg);
  color: #111827;
}

.warning-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 2px;
}

.warning p {
  margin: 0;
  font-size: clamp(0.9rem, 1.35vw, 1rem);
  line-height: 1.5;
}

.warning strong {
  font-weight: 800;
}

.cta {
  display: block;
  margin-top: 18px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: white;
  text-align: center;
  text-decoration: none;
  padding: 14px 18px;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(45, 154, 227, 0.22);
  cursor: pointer;
}

.note {
  text-align: center;
  padding: 22px 14px 16px;
  color: var(--blue-dark);
  font-size: clamp(0.9rem, 1.3vw, 1rem);
}

.bottom-bar {
  margin-top: auto;
  border-top: 2px solid var(--footer-border);
  background: rgba(255, 255, 255, 0.2);
}

.bottom-bar p {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 22px 18px 24px;
  text-align: center;
  color: var(--blue-dark);
  font-size: clamp(0.88rem, 1.2vw, 0.98rem);
  line-height: 1.45;
}

.bottom-bar strong {
  color: #536b88;
  font-weight: 800;
}

.step-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 6px 0 18px;
  flex: 1;
}

.step-header {
  text-align: center;
  margin-bottom: 20px;
}

.step-header h2 {
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 2.8vw, 2.05rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.step-header p {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
}

.results-shell {
  width: min(100%, 980px);
  padding: 14px 18px 24px;
}

.results-header {
  text-align: center;
  margin-bottom: 18px;
}

.results-header h2 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.results-header p {
  margin: 0;
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  color: var(--blue-dark);
}

.analysis-notice,
.equal-likely-note {
  max-width: 820px;
  margin: 0 auto 16px;
  padding: 14px 18px;
  border: 1.5px solid #d7e2ef;
  border-radius: 12px;
  background: #f7fbff;
  color: #2f4f73;
  font-size: 0.94rem;
  line-height: 1.45;
}

.analysis-notice.warning {
  border-color: #f4c979;
  background: #fff7ea;
  color: #8a5b05;
}

.analysis-notice.neutral {
  background: #f5f8fb;
  color: #58718e;
}

.equal-likely-note {
  border-color: #bfd7ef;
  background: #edf6ff;
  color: #29608f;
}

.result-card {
  display: block;
  width: 100%;
  max-width: 820px;
  margin: 0 auto 16px;
  padding: 20px 24px 18px;
  border: 2px solid #d1d9e5;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(12, 24, 45, 0.05);
  text-align: left;
  cursor: default;
}

button.result-card {
  color: inherit;
  font: inherit;
}

.result-card-low {
  border-color: #d1d9e5;
}

.result-card-possible {
  border-color: #8ab6df;
}

.result-card-moderate {
  border-color: #e7b04c;
}

.result-card-likely {
  border-color: #e58d34;
}

.result-card-strong {
  border-color: #e35a54;
}

.result-card-top {
  box-shadow: 0 12px 28px rgba(45, 154, 227, 0.12);
  border-width: 2.5px;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.rank-pill,
.risk-pill,
.probability-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.rank-pill,
.probability-pill {
  border: 2px solid #d2dae5;
  background: #eef2f6;
  color: #182235;
}

.rank-pill {
  min-width: 44px;
  justify-content: center;
  background: #f7f9fb;
}

.risk-pill {
  color: white;
}

.risk-low {
  background: #16a34a;
}

.risk-possible {
  background: #2d9ae3;
}

.risk-moderate {
  background: #f5a000;
  color: #071126;
}

.risk-likely {
  background: #e58d34;
}

.risk-strong {
  background: #e35a54;
}

.pill-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.result-card h3,
.accuracy-panel h3 {
  margin: 0 0 12px;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.result-card p,
.accuracy-panel p {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(0.9rem, 1.15vw, 1rem);
  line-height: 1.5;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin: 14px 0 12px;
  color: #58718e;
  font-size: 0.88rem;
}

.result-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e9eff5;
  overflow: hidden;
}

.result-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.result-bar-fill.unlikely {
  background: #9aa9ba;
}

.result-bar-fill.possible {
  background: #2d9ae3;
}

.result-bar-fill.moderate {
  background: #e7b04c;
}

.result-bar-fill.likely {
  background: #e58d34;
}

.result-bar-fill.strong {
  background: #e35a54;
}

.result-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.result-recommendation {
  color: #5a748f;
  font-size: 0.88rem;
  font-weight: 600;
}

.result-link {
  border: 1.5px solid #ccd5df;
  border-radius: 9px;
  background: #f8fafc;
  color: #182235;
  font: inherit;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
}

.accuracy-panel {
  max-width: 820px;
  margin: 0 auto 20px;
  padding: 22px 22px 20px;
  border-radius: 12px;
  background: #f0f3f7;
}

.improve-btn {
  margin-top: 18px;
  min-width: 170px;
  font-size: 0.95rem;
  padding: 13px 18px;
}

.detail-actions {
  max-width: 820px;
  margin: 0 auto 20px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.detail-actions .secondary-btn {
  padding: 14px 20px;
  font-size: 0.95rem;
  width: auto;
}

.restart-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.restart-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.detail-warning {
  max-width: 820px;
  margin: 0 auto;
  padding: 18px 20px;
  border-radius: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}

.form-card {
  border: 2px solid var(--panel-border);
  border-radius: 12px;
  padding: 22px 22px 20px;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(12, 24, 45, 0.05);
}

.form-card h3 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  letter-spacing: -0.04em;
}

.form-card > p {
  margin: 0 0 20px;
  color: var(--blue-dark);
  font-size: 0.98rem;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #111827;
}

textarea,
select {
  width: 100%;
  border: 1.5px solid #ccd5df;
  border-radius: 9px;
  background: #f7f9fb;
  color: #182235;
  font: inherit;
}

textarea {
  min-height: 122px;
  resize: vertical;
  padding: 14px;
  line-height: 1.45;
}

.symptom-picker {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}

.symptom-search {
  width: 100%;
  border: 1.5px solid #ccd5df;
  border-radius: 9px;
  background: #f7f9fb;
  color: #182235;
  font: inherit;
  padding: 11px 14px;
}

.picker-btn {
  border: 1.5px solid #ccd5df;
  border-radius: 9px;
  background: #f8fafc;
  color: #182235;
  font: inherit;
  font-weight: 700;
  padding: 11px 16px;
  cursor: pointer;
}

select {
  padding: 11px 14px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #7b8798 50%), linear-gradient(135deg, #7b8798 50%, transparent 50%);
  background-position: calc(100% - 22px) calc(50% + 1px), calc(100% - 16px) calc(50% + 1px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.chip {
  border: 1.5px solid #ccd5df;
  background: #f8fafc;
  color: #182235;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.chip.active {
  background: #e3f1fc;
  border-color: #8fc7f0;
  color: #0b4f85;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}

.range-wrap {
  margin-top: 18px;
}

.range-label {
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.range-scale {
  display: flex;
  justify-content: space-between;
  color: var(--blue-dark);
  font-size: 0.84rem;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.secondary-btn,
.primary-btn {
  border: 1.5px solid #ccd5df;
  border-radius: 10px;
  padding: 13px 20px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.secondary-btn {
  background: #f8fafc;
  color: #182235;
}

.primary-btn {
  min-width: 180px;
  border-color: #97c8ec;
  background: #8fc7f0;
  color: white;
  box-shadow: 0 10px 24px rgba(45, 154, 227, 0.18);
}

@media (max-width: 720px) {
  .page {
    padding: 18px 12px 0;
  }

  .logo {
    width: 60px;
    height: 60px;
    margin-bottom: 14px;
  }

  .card {
    padding: 22px 16px 18px;
    border-radius: 14px;
  }

  .warning {
    padding: 14px 14px;
    gap: 10px;
  }

  .cta {
    padding: 14px 16px;
  }

  .form-grid,
  .mini-grid,
  .step-actions {
    grid-template-columns: 1fr;
  }

  .symptom-picker {
    grid-template-columns: 1fr;
  }

  .step-actions {
    display: grid;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
  }

  .results-shell {
    padding: 18px 12px 24px;
  }

  .result-card,
  .accuracy-panel,
  .detail-warning {
    padding: 20px 18px;
  }

  .detail-actions {
    display: grid;
  }

  .result-tags {
    gap: 10px;
  }

  .result-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
