:root {
  --ink: #172326;
  --muted: #607074;
  --paper: #f4f1e9;
  --card: #fffdf8;
  --teal: #0f6b63;
  --teal-dark: #0a4c47;
  --teal-soft: #dceee9;
  --gold: #d9a441;
  --coral: #c85b45;
  --line: #d9ddd7;
  --shadow: 0 18px 55px rgba(23, 35, 38, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 80% 0%, #e4eee9 0, transparent 28rem), var(--paper); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem max(2rem, calc((100vw - 1180px) / 2));
  background: rgba(244, 241, 233, 0.92);
  border-bottom: 1px solid rgba(23, 35, 38, 0.1);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; color: white; background: var(--teal); border-radius: 13px; font-weight: 800; letter-spacing: -.04em; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: .1rem; color: var(--muted); font-size: .72rem; }
nav { display: flex; gap: .25rem; }
.nav-link { padding: .65rem .9rem; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-weight: 700; font-size: .9rem; }
.nav-link:hover, .nav-link.active { color: var(--teal-dark); background: white; box-shadow: 0 3px 16px rgba(23,35,38,.07); }

main { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 5rem; }
.page { display: none; }
.page.active { display: block; animation: rise .3s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 800px; margin-bottom: 1rem; font-family: Georgia, serif; font-size: clamp(2.7rem, 6vw, 5.7rem); line-height: .95; letter-spacing: -.055em; font-weight: 500; }
h2 { font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.3rem); letter-spacing: -.035em; font-weight: 500; }
h3 { font-size: 1rem; }
.eyebrow { margin-bottom: 1rem; color: var(--teal); font-size: .76rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.lede { max-width: 720px; color: var(--muted); font-size: 1.12rem; line-height: 1.7; }
.hero { display: grid; grid-template-columns: 1.45fr .55fr; gap: 3rem; align-items: end; min-height: 500px; padding: 2rem 0 3rem; }
.hero-art { position: relative; min-height: 390px; }
.orb { position: absolute; border-radius: 50%; border: 1px solid rgba(15,107,99,.28); }
.orb.one { inset: 2rem 0 auto auto; width: 320px; height: 320px; background: rgba(220,238,233,.6); }
.orb.two { inset: 6rem 4rem auto auto; width: 235px; height: 235px; border-color: rgba(217,164,65,.6); }
.orb.three { inset: 10rem 8rem auto auto; display: grid; place-items: center; width: 150px; height: 150px; color: white; background: var(--teal); border: 0; text-align: center; }
.orb.three strong { display: block; font: 500 3.8rem/.9 Georgia, serif; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.7rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .7rem 1.05rem; border: 1px solid transparent; border-radius: 10px; background: var(--teal); color: white; font-weight: 800; text-decoration: none; }
.button:hover { background: var(--teal-dark); }
.button.secondary { color: var(--ink); background: var(--card); border-color: var(--line); }
.button.ghost { color: var(--teal); background: transparent; border-color: var(--teal); }
.button.danger { background: var(--coral); }
.button.small { min-height: 36px; padding: .45rem .7rem; font-size: .82rem; }
.session-badge { display: inline-flex; align-items: center; padding: .55rem .75rem; color: var(--teal-dark); background: var(--teal-soft); border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; }

.login-shell { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2rem; align-items: stretch; min-height: calc(100vh - 160px); }
.login-intro { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 5vw, 5rem); color: white; background: var(--teal-dark); border-radius: 26px; overflow: hidden; position: relative; }
.login-intro::after { content: ""; position: absolute; right: -110px; bottom: -120px; width: 390px; height: 390px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.035), 0 0 0 110px rgba(255,255,255,.025); }
.login-intro h1 { position: relative; z-index: 1; font-size: clamp(2.9rem, 5.2vw, 5.2rem); }
.login-intro .lede { position: relative; z-index: 1; color: #cfe3de; }
.login-panel { display: flex; flex-direction: column; justify-content: center; gap: 1rem; }
.login-card { padding: 1.7rem; background: var(--card); border: 1px solid rgba(23,35,38,.09); border-radius: 18px; box-shadow: var(--shadow); }
.login-card h2 { margin-bottom: .5rem; font-size: 2rem; }
.login-card form { display: grid; gap: 1rem; }
.login-divider { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.team-code-input { text-transform: uppercase; letter-spacing: .13em; font-weight: 900; }
.access-code { display: inline-block; padding: .75rem 1rem; color: var(--teal-dark); background: var(--teal-soft); border: 1px dashed var(--teal); border-radius: 10px; font: 800 1.25rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.team-switch-label { min-width: 220px; color: var(--muted); font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.team-switch-label select { margin-top: .3rem; color: var(--ink); font-weight: 800; text-transform: none; letter-spacing: 0; }
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.team-card { box-shadow: none; }
.team-card.selected { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.team-card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin: 1rem 0; }
.complete-card { max-width: 720px; margin: 7vh auto 0; padding: clamp(2rem, 6vw, 4rem); text-align: center; }
.complete-check { display: grid; place-items: center; width: 74px; height: 74px; margin: 0 auto 1.5rem; color: white; background: var(--teal); border-radius: 50%; font-size: 2rem; }

.grid { display: grid; gap: 1rem; }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.card { padding: 1.4rem; background: var(--card); border: 1px solid rgba(23,35,38,.09); border-radius: 18px; box-shadow: var(--shadow); }
.feature-card { min-height: 180px; }
.feature-card .number { display: block; margin-bottom: 2rem; color: var(--gold); font: 500 2.7rem/1 Georgia, serif; }
.feature-card p, .muted { color: var(--muted); line-height: 1.55; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.page-heading h2 { margin-bottom: .4rem; }
.assessment-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 1.5rem; align-items: start; }
.assessment-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
label { display: grid; gap: .4rem; color: var(--muted); font-size: .82rem; font-weight: 800; }
input, select { width: 100%; padding: .75rem .8rem; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); }
input:focus, select:focus { outline: 3px solid rgba(15,107,99,.15); border-color: var(--teal); }
.dimension-block { margin-bottom: 1rem; padding: 1.5rem; background: var(--card); border: 1px solid rgba(23,35,38,.09); border-radius: 18px; }
.dimension-title { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.question { display: grid; grid-template-columns: 2rem 1fr; gap: .8rem; padding: 1.15rem 0; border-bottom: 1px solid #ecece7; }
.question:last-child { border-bottom: 0; padding-bottom: 0; }
.question-number { display: grid; place-items: center; align-self: start; width: 28px; height: 28px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-dark); font-size: .78rem; font-weight: 900; }
.question p { margin-bottom: .9rem; line-height: 1.55; }
.score-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.score-option { position: relative; }
.score-option input { position: absolute; opacity: 0; }
.score-option span { display: block; min-height: 58px; padding: .55rem; border: 1px solid var(--line); border-radius: 8px; background: white; text-align: center; font-size: .72rem; font-weight: 700; }
.score-option b { display: block; margin-bottom: .15rem; color: var(--teal); font-size: 1rem; }
.score-option input:checked + span { color: white; background: var(--teal); border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.score-option input:checked + span b { color: white; }
.assessment-aside { position: sticky; top: 92px; }
.progress-track { height: 8px; margin: .9rem 0 .5rem; overflow: hidden; background: #e5e6e1; border-radius: 999px; }
.progress-fill { width: 0; height: 100%; background: var(--gold); transition: width .2s; }
.scale-list { margin: 1.2rem 0 0; padding: 0; list-style: none; }
.scale-list li { display: grid; grid-template-columns: 1.5rem 1fr; gap: .5rem; padding: .45rem 0; color: var(--muted); font-size: .78rem; border-top: 1px solid #ecece7; }
.scale-list b { color: var(--teal); }

.report-header { padding: 1.8rem; color: white; background: var(--teal-dark); border-radius: 20px; }
.report-header .eyebrow { color: #a9d8ca; }
.report-header h2 { margin-bottom: .5rem; }
.report-meta { display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; color: #d3e6e1; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1rem 0; }
.kpi { padding: 1.2rem; background: var(--card); border-radius: 15px; border: 1px solid var(--line); }
.kpi span { color: var(--muted); font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.kpi strong { display: block; margin-top: .35rem; font: 500 2rem/1 Georgia, serif; }
.report-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 1rem; }
.level-panel { padding: 1.5rem; color: white; background: var(--teal); border-radius: 18px; }
.level-panel .level-number { font: 500 4rem/1 Georgia, serif; }
.recommendation { padding: 1.3rem; border-left: 5px solid var(--gold); background: #fff7df; border-radius: 0 12px 12px 0; }
.recommendation.warn { border-color: var(--coral); background: #fff0ec; }
.bar-chart { display: grid; gap: 1rem; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 42px; gap: .8rem; align-items: center; font-size: .82rem; }
.bar-track { position: relative; height: 16px; background: #e8ebe7; border-radius: 999px; }
.bar-range { position: absolute; top: 3px; height: 10px; border-radius: 999px; background: #8ac5b7; }
.bar-median { position: absolute; top: -3px; width: 4px; height: 22px; background: var(--teal-dark); border-radius: 3px; }
.radar { display: grid; place-items: center; min-height: 320px; }
.radar svg { width: min(100%, 340px); overflow: visible; }
.agreement-table, .responses-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.agreement-table th, .agreement-table td, .responses-table th, .responses-table td { padding: .72rem .6rem; text-align: left; border-bottom: 1px solid var(--line); }
.agreement-table th, .responses-table th { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.status { display: inline-block; padding: .28rem .55rem; border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); font-size: .7rem; font-weight: 900; }
.status.split { background: #ffded6; color: #923d2c; }
.empty { padding: 5rem 2rem; text-align: center; background: var(--card); border: 1px dashed #bfc6c2; border-radius: 18px; }
.empty .empty-icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 1.2rem; border-radius: 50%; color: var(--teal); background: var(--teal-soft); font: 500 2rem Georgia, serif; }

.admin-tabs { display: flex; gap: .4rem; margin-bottom: 1rem; }
.admin-tab { padding: .6rem .9rem; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--card); font-weight: 800; }
.admin-tab.active { color: white; background: var(--teal); border-color: var(--teal); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row p { margin: .2rem 0 0; color: var(--muted); font-size: .82rem; }
.toggle { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.toggle input { opacity: 0; }
.toggle span { position: absolute; inset: 0; background: #c9cdca; border-radius: 99px; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: white; border-radius: 50%; transition: .2s; }
.toggle input:checked + span { background: var(--teal); }
.toggle input:checked + span::after { transform: translateX(20px); }
.toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; max-width: 360px; padding: .9rem 1rem; color: white; background: var(--ink); border-radius: 10px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .site-header { align-items: flex-start; padding: .8rem 1rem; }
  .brand small { display: none; }
  nav { overflow-x: auto; max-width: 72vw; }
  .nav-link { white-space: nowrap; }
  .hero, .assessment-layout, .report-grid, .login-shell { grid-template-columns: 1fr; }
  .login-shell { min-height: auto; }
  .hero-art { display: none; }
  .hero { min-height: auto; }
  .grid.four, .kpis { grid-template-columns: repeat(2, 1fr); }
  .assessment-aside { position: static; order: -1; }
}

@media (max-width: 600px) {
  main { width: min(100% - 1rem, 1180px); padding-top: 1.3rem; }
  .brand strong { display: none; }
  .site-header { gap: .5rem; }
  nav { max-width: calc(100vw - 75px); }
  .grid.four, .grid.three, .grid.two, .kpis, .assessment-meta, .team-grid { grid-template-columns: 1fr; }
  .score-options { grid-template-columns: 1fr 1fr; }
  .page-heading { display: block; }
  .bar-row { grid-template-columns: 105px 1fr 35px; }
}

@media print {
  @page { size: letter; margin: .45in; }
  :root, body { background: white; }
  .no-print, .button, .admin-tabs { display: none !important; }
  main { width: 100%; margin: 0; padding: 0; }
  .page { display: none !important; }
  #report.page { display: block !important; }
  .report-header { break-inside: avoid; border-radius: 0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
  .report-grid { grid-template-columns: 1fr 1fr; }
  .agreement-table { font-size: 7.5pt; }
  .agreement-table th, .agreement-table td { padding: 5px; }
  .report-section { break-inside: avoid; }
}
