:root {
  --bg: #f3f7f6;
  --surface: #ffffff;
  --surface-soft: #e9f2f0;
  --text: #18302d;
  --muted: #607773;
  --border: #d6e2df;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --shadow: 0 22px 60px rgba(13, 59, 54, .12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 17px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 0; overflow-x: hidden; scroll-behavior: smooth; }
body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 2%, rgba(15,118,110,.12), transparent 26rem),
    radial-gradient(circle at 90% 12%, rgba(217,119,6,.09), transparent 24rem),
    var(--bg);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible {
  outline: 3px solid rgba(15,118,110,.28);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 999;
  padding: .75rem 1rem;
  border-radius: 12px;
  color: white;
  background: #111827;
}
.skip-link:focus { top: 1rem; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 82px;
  padding: 14px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid rgba(214,226,223,.9);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: white;
  font-size: 1.45rem;
  font-weight: 900;
  background: linear-gradient(145deg, #0f766e, #d4a04e);
  box-shadow: 0 12px 25px rgba(15,118,110,.2);
}
.brand strong, .brand span { display: block; }
.brand strong { font-size: 1.02rem; }
.brand span {
  max-width: 58vw;
  overflow: hidden;
  color: var(--muted);
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(26px, 5vw, 70px) 0;
}
.view { animation: fadeIn .35s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
  min-height: 690px;
  overflow: hidden;
  border: 1px solid rgba(214,226,223,.8);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 7vw, 92px);
}
.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1, h2, p { overflow-wrap: anywhere; }
h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.25rem, 5.5vw, 5.2rem);
  line-height: .99;
  letter-spacing: -.055em;
}
.hero-copy > p {
  max-width: 720px;
  margin: 28px 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.7vw, 1.25rem);
  line-height: 1.7;
}
.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 680px;
  margin-bottom: 25px;
  padding: 16px 18px;
  border: 1px solid #cae2de;
  border-radius: 16px;
  background: #f0f8f6;
}
.privacy-note > span { font-size: 1.25rem; }
.privacy-note strong, .privacy-note span { display: block; }
.privacy-note div span { margin-top: 3px; color: var(--muted); font-size: .9rem; line-height: 1.45; }

.optional-name { display: grid; gap: 8px; max-width: 420px; font-weight: 800; }
.optional-name small { color: var(--muted); font-weight: 500; }
.optional-name input {
  width: 100%;
  min-height: 56px;
  padding: 0 17px;
  border: 1px solid var(--border);
  border-radius: 15px;
  color: var(--text);
  background: white;
}
.start-actions, .result-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.primary-btn, .secondary-btn, .ghost-btn {
  min-height: 52px;
  padding: 0 22px;
  border-radius: 15px;
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.primary-btn {
  border: 1px solid var(--primary);
  color: white;
  background: var(--primary);
  box-shadow: 0 12px 28px rgba(15,118,110,.22);
}
.secondary-btn { border: 1px solid #c8dbd7; color: var(--primary-dark); background: #eaf5f2; }
.ghost-btn { border: 1px solid var(--border); color: var(--text); background: white; }
.primary-btn:hover, .secondary-btn:hover, .ghost-btn:hover { transform: translateY(-1px); }
.primary-btn:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; transform: none; }
.small-disclaimer { margin-top: 20px !important; color: #738581 !important; font-size: .83rem !important; }

.pillar-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 44px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(7,49,45,.96), rgba(15,118,110,.86)),
    #0f766e;
}
.pillar-preview::before, .pillar-preview::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
}
.pillar-preview::before { width: 540px; height: 540px; }
.pillar-preview::after { width: 360px; height: 360px; }
.radar-placeholder {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 190px;
  height: 190px;
  border: 2px solid rgba(255,255,255,.72);
  border-radius: 50%;
  color: white;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 0 0 28px rgba(255,255,255,.035), 0 24px 70px rgba(0,0,0,.18);
}
.radar-placeholder span { font-size: 5.5rem; font-weight: 950; line-height: .8; }
.radar-placeholder small { font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.category-legend {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
  width: min(100%, 430px);
  margin-top: 38px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  color: white;
  background: rgba(255,255,255,.075);
  font-size: .78rem;
  font-weight: 800;
}
.legend-item i { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; }

.quiz-shell { width: min(900px, 100%); margin: 0 auto; }
.progress-panel {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.9);
  box-shadow: 0 12px 35px rgba(18,59,54,.08);
}
.progress-meta { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .9rem; }
.progress-meta strong { color: var(--text); }
.progress-track { height: 10px; margin: 12px 0 18px; overflow: hidden; border-radius: 999px; background: #dfeae8; }
.progress-bar { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #d59b44); transition: width .32s ease; }
.category-pills { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: thin; }
.category-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: white;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
.category-pill.active { color: white; border-color: transparent; background: var(--pill-color); }
.category-pill.done { color: var(--text); border-color: #bfd8d3; background: #e7f4f1; }

.question-card {
  min-height: 560px;
  padding: clamp(28px, 6vw, 68px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: white;
  box-shadow: var(--shadow);
}
.question-heading { display: flex; align-items: flex-start; gap: 18px; }
.question-icon {
  display: grid;
  place-items: center;
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  border-radius: 20px;
  color: white;
  font-size: 1.55rem;
  font-weight: 950;
  background: var(--category-color, var(--primary));
  box-shadow: 0 14px 26px color-mix(in srgb, var(--category-color, var(--primary)) 24%, transparent);
}
.category-label { color: var(--category-color, var(--primary)); font-size: .82rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.question-heading h2 {
  max-width: 700px;
  margin: 8px 0 0;
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -.025em;
}
.answer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
  margin: 52px 0 42px;
  padding: 0;
  border: 0;
}
.answer-grid legend { margin-bottom: 16px; color: var(--muted); font-weight: 750; }
.answer-btn {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  min-height: 100px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 19px;
  text-align: left;
  background: #fbfdfc;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.answer-btn:hover { transform: translateY(-2px); }
.answer-btn.selected { border-color: var(--category-color, var(--primary)); background: color-mix(in srgb, var(--category-color, var(--primary)) 9%, white); }
.answer-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: white;
  font-size: 1.4rem;
  font-weight: 900;
}
.answer-yes .answer-symbol { background: #15803d; }
.answer-partly .answer-symbol { background: #d97706; }
.answer-no .answer-symbol { background: #dc2626; }
.answer-btn strong, .answer-btn small { display: block; }
.answer-btn strong { font-size: 1.02rem; }
.answer-btn small { margin-top: 4px; color: var(--muted); }
.quiz-navigation { display: flex; justify-content: space-between; gap: 12px; }

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 22px;
}
.result-header h1 { font-size: clamp(2.2rem, 5vw, 4.7rem); }
.result-header p { color: var(--muted); }
.overall-badge {
  display: grid;
  place-items: center;
  flex: 0 0 150px;
  width: 150px;
  height: 150px;
  border: 12px solid #d8e8e5;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow);
}
.overall-badge strong { font-size: 2.3rem; line-height: 1; }
.overall-badge span { color: var(--muted); font-size: .72rem; font-weight: 900; text-transform: uppercase; }

.result-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(300px,.75fr); gap: 20px; }
.result-card {
  min-width: 0;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.94);
  box-shadow: 0 16px 45px rgba(18,59,54,.08);
}
.card-title h2 { margin: 0; font-size: clamp(1.35rem, 2.5vw, 2rem); }
.canvas-wrap { width: 100%; min-height: 470px; }
#radarCanvas { display: block; width: 100%; height: auto; max-height: 620px; }
.summary-text { margin-top: 26px; }
.summary-block { margin-bottom: 18px; padding: 16px; border-radius: 15px; background: var(--surface-soft); }
.summary-block strong { display: block; margin-bottom: 6px; }
.summary-block p { margin: 0; color: var(--muted); line-height: 1.55; }
.result-key { display: grid; gap: 8px; margin-top: 24px; color: var(--muted); font-size: .82rem; }
.result-key span { display: flex; align-items: center; gap: 8px; }
.key-dot { width: 10px; height: 10px; border-radius: 50%; }
.key-strong { background: #15803d; }
.key-good { background: #65a30d; }
.key-focus { background: #d97706; }
.key-priority { background: #dc2626; }

.category-results { margin-top: 20px; }
.category-results-list { display: grid; gap: 14px; margin-top: 26px; }
.category-row {
  display: grid;
  grid-template-columns: minmax(180px,.55fr) minmax(220px,1fr) 76px;
  align-items: center;
  gap: 18px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: #fbfdfc;
}
.category-name { display: flex; align-items: center; gap: 11px; min-width: 0; font-weight: 900; }
.category-name i { flex: 0 0 13px; width: 13px; height: 13px; border-radius: 50%; }
.score-track { height: 13px; overflow: hidden; border-radius: 999px; background: #e0e9e7; }
.score-fill { height: 100%; width: 0; border-radius: inherit; transition: width .5s ease; }
.category-score { text-align: right; font-size: 1.18rem; font-weight: 950; }
.category-tip {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.55;
}
.next-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  margin-top: 20px;
  padding: clamp(28px, 5vw, 48px);
  border-radius: var(--radius-lg);
  color: white;
  background: linear-gradient(135deg, #0c625c, #123f3b);
  box-shadow: var(--shadow);
}
.next-steps h2 { margin: 0; font-size: clamp(1.7rem,3vw,2.7rem); }
.next-steps p { max-width: 650px; margin-bottom: 0; color: rgba(255,255,255,.8); line-height: 1.65; }
.next-steps .eyebrow { color: #f0c77c; }
.next-steps .ghost-btn { color: white; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.08); }
.next-steps .secondary-btn { color: white; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.15); }
.result-actions { justify-content: flex-end; min-width: 280px; }
.result-disclaimer {
  margin: 20px 0 0;
  padding: 18px 20px;
  border: 1px solid #e5dcc8;
  border-radius: 15px;
  color: #675d47;
  background: #fff9ee;
  font-size: .86rem;
  line-height: 1.55;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 38px;
  color: var(--muted);
  font-size: .82rem;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 13px 18px;
  border-radius: 13px;
  color: white;
  background: #173b37;
  box-shadow: 0 14px 35px rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: .22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .hero-card { grid-template-columns: 1fr; }
  .pillar-preview { min-height: 540px; }
  .result-grid { grid-template-columns: 1fr; }
  .next-steps { align-items: flex-start; flex-direction: column; }
  .result-actions { justify-content: flex-start; min-width: 0; }
}

@media (max-width: 620px) {
  .app-header { min-height: 72px; padding: 10px 14px; }
  .brand span { display: none; }
  .brand-mark { width: 44px; height: 44px; flex-basis: 44px; }
  .install-btn { padding: 0 14px; min-height: 44px; font-size: .83rem; }
  main { width: min(100% - 20px, 1220px); padding: 18px 0 34px; }
  .hero-card { min-height: 0; border-radius: 23px; }
  .hero-copy { padding: 31px 23px; }
  .hero-copy > p { margin: 21px 0; line-height: 1.55; }
  .pillar-preview { min-height: 510px; padding: 34px 18px; }
  .category-legend { grid-template-columns: 1fr; }
  .question-card { min-height: 0; padding: 24px 18px; border-radius: 23px; }
  .question-heading { gap: 12px; }
  .question-icon { flex-basis: 50px; width: 50px; height: 50px; border-radius: 15px; }
  .answer-grid { grid-template-columns: 1fr; gap: 10px; margin: 33px 0; }
  .answer-btn { min-height: 78px; }
  .quiz-navigation > button { flex: 1; }
  .result-header { align-items: flex-start; }
  .overall-badge { flex-basis: 104px; width: 104px; height: 104px; border-width: 9px; }
  .overall-badge strong { font-size: 1.55rem; }
  .overall-badge span { font-size: .55rem; }
  .canvas-wrap { min-height: 300px; }
  .category-row { grid-template-columns: 1fr 62px; gap: 10px; }
  .score-track { grid-column: 1 / -1; grid-row: 2; }
  .category-score { grid-column: 2; grid-row: 1; }
  .category-tip { grid-row: 3; }
  .result-actions { display: grid; width: 100%; }
  .app-footer { align-items: flex-start; flex-direction: column; width: calc(100% - 28px); }
}

@media print {
  :root { --bg: white; }
  body { background: white; }
  .app-header, .app-footer, .result-actions, .install-btn, .toast, .start-view, .quiz-view { display: none !important; }
  main { width: 100%; padding: 0; }
  .result-view { display: block !important; }
  .result-header { margin-bottom: 12px; }
  .result-header h1 { font-size: 34px; }
  .overall-badge { width: 110px; height: 110px; flex-basis: 110px; }
  .result-grid { grid-template-columns: 1.15fr .85fr; gap: 10px; }
  .result-card, .next-steps, .result-disclaimer { break-inside: avoid; box-shadow: none; }
  .result-card { padding: 18px; }
  .canvas-wrap { min-height: 320px; }
  #radarCanvas { max-height: 410px; }
  .category-results-list { gap: 7px; }
  .category-row { padding: 10px; }
  .next-steps { margin-top: 10px; padding: 20px; color: #173b37; background: #eaf5f2; }
  .next-steps p { color: #536965; }
  .next-steps .eyebrow { color: #0f766e; }
}
