*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #0D1B2A;
  --navy-mid:   #152438;
  --navy-card:  #1C3354;
  --accent:     #2E7CF6;
  --accent-lt:  #7AAFF8;
  --ice:        #F0F5FC;
  --ice-card:   #E2EDF9;
  --white:      #FFFFFF;
  --body:       #1A2B3C;
  --muted:      #4A6785;
  --muted-lt:   #8AAAC8;
  --border:     #D0DFF0;
}

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--ice);
  color: var(--body);
  min-height: 100vh;
  padding: 0 0 80px 0;
}

/* ── HEADER ── */
.page-header {
  background: var(--navy);
  padding: 48px 0 40px 0;
  border-bottom: 3px solid var(--accent);
  margin-bottom: 48px;
}
.page-header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 40px;
}
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-lt);
  margin-bottom: 12px;
}
.page-header h1 {
  font-size: 30px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.page-header p {
  font-size: 14px;
  color: var(--muted-lt);
  line-height: 1.7;
  max-width: 620px;
  font-weight: 300;
}

/* ── PROGRESS ── */
.progress-bar-wrap {
  max-width: 860px;
  margin: 0 auto 36px auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.progress-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 500;
}
.progress-track {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.35s ease;
  width: 0%;
}
.progress-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
  min-width: 48px;
  text-align: right;
}

/* ── MAIN CONTENT ── */
.main {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ── SUBDOMAIN CARD ── */
.subdomain {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.subdomain.scored {
  border-color: var(--accent-lt);
}

/* ── ACCORDION HEADER ── */
.sd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
  gap: 12px;
}
.sd-header:hover { background: var(--ice); }

.sd-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.sd-index {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted-lt);
  min-width: 22px;
  flex-shrink: 0;
}
.sd-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}

.sd-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.score-badge {
  display: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--ice-card);
  color: #0C447C;
  white-space: nowrap;
}
.score-badge.visible { display: inline-block; }

.chevron {
  width: 18px;
  height: 18px;
  color: var(--muted-lt);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}
.chevron.open { transform: rotate(180deg); }

/* ── ACCORDION BODY ── */
.sd-body {
  display: none;
  border-top: 1px solid var(--border);
}
.sd-body.open { display: block; }

/* ── SCALE SECTION ── */
.scale-section {
  padding: 22px 22px 0 22px;
}
.section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted-lt);
  margin-bottom: 12px;
}

.score-buttons {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.score-btn {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 4px 8px 4px;
  background: var(--white);
  cursor: pointer;
  text-align: center;
  transition: all 0.12s ease;
  font-family: inherit;
}
.score-btn:hover {
  border-color: var(--accent-lt);
  background: var(--ice);
}
.score-btn.active {
  border-color: var(--accent);
  background: #E6F1FB;
}
.score-btn .snum {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
  margin-bottom: 4px;
}
.score-btn.active .snum { color: var(--accent); }
.score-btn .slabel {
  display: block;
  font-size: 9px;
  color: var(--muted-lt);
  line-height: 1.3;
  font-weight: 500;
}
.score-btn.active .slabel { color: var(--accent); }

/* ── DESCRIPTOR BOX ── */
.descriptor {
  margin: 10px 0 20px 0;
  padding: 13px 16px;
  background: var(--ice-card);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  min-height: 46px;
}
.descriptor p {
  font-size: 13px;
  color: var(--body);
  line-height: 1.65;
  font-style: italic;
}
.descriptor .placeholder {
  font-size: 12px;
  color: var(--muted-lt);
  font-style: normal;
}

/* ── QUESTIONS SECTION ── */
.questions-section {
  border-top: 1px solid var(--border);
  padding: 18px 22px 22px 22px;
}
.q-item {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid #EEF3FA;
  align-items: flex-start;
}
.q-item:first-of-type { border-top: none; }
.q-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-lt);
  flex-shrink: 0;
  margin-top: 7px;
}
.q-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  font-weight: 300;
}

/* ── SUBMIT ROW ── */
.submit-row {
  max-width: 860px;
  margin: 36px auto 0 auto;
  padding: 24px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.avg-display {
  font-size: 13px;
  color: var(--muted);
}
.avg-display strong {
  color: var(--navy);
  font-weight: 600;
}
.submit-btn {
  padding: 11px 28px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: background 0.15s;
}
.submit-btn:hover:not(:disabled) { background: var(--accent); }
.submit-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.status-msg { font-size: 13px; color: var(--muted); min-height: 20px; }

/* ── GATE SCREEN ── */
.gate-screen {
  max-width: 560px;
  margin: 80px auto;
  padding: 40px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
}
.gate-screen h2 { font-size: 18px; font-weight: 600; color: var(--navy); margin-bottom: 12px; }
.gate-screen p { font-size: 14px; color: var(--muted); line-height: 1.7; }

/* ── CONFIRM SCREEN ── */
.confirm-screen {
  display: none;
  max-width: 560px;
  margin: 80px auto;
  padding: 48px 40px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
}
.confirm-screen.visible { display: block; }
.confirm-screen h2 { font-size: 20px; font-weight: 600; color: var(--navy); margin-bottom: 10px; }
.confirm-screen p { font-size: 14px; color: var(--muted); line-height: 1.7; }
