*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-secondary: #4A4A4A;
  --text-muted: #888888;
  --accent: #00C2FF;
  --accent-light: rgba(0, 194, 255, 0.08);
  --btn-bg: #2D3748;
  --btn-bg-hover: #3D4A5C;
  --border: #E8E8E8;
  --card-bg: #FAFAFA;
  --max-w: 1200px;
  --low: #E0902A;
  --mid: #6B7280;
  --high: #0E9E6E;
}
body {
  font-family: 'Poppins', sans-serif; background: var(--bg); color: var(--text-primary);
  line-height: 1.7; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
.wrapper { max-width: var(--max-w); margin: 0 auto; padding: 40px 32px 96px; width: 100%; flex: 1; display: grid; grid-template-columns: 1fr 260px; gap: 64px; }
.wrapper > main { min-width: 0; max-width: 720px; }

.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); margin-bottom: 14px; }
h1 { font-size: 34px; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 16px; }
.lede { font-size: 16px; color: var(--text-secondary); margin-bottom: 14px; max-width: 60ch; }
.meta { font-size: 12px; color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase; }
.rule { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.section-h { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin: 40px 0 8px; }

/* questionnaire */
.progress {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  padding: 14px 0 12px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--border);
}
.progress .track { flex: 1; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.progress .track > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s ease; }
.progress .count { font-size: 12px; color: var(--text-muted); letter-spacing: 0.05em; white-space: nowrap; font-variant-numeric: tabular-nums; }

.question { padding: 24px 0; border-bottom: 1px solid var(--border); }
.question .stem { font-size: 16px; font-weight: 500; line-height: 1.55; color: var(--text-primary); margin-bottom: 16px; }
.question .stem em { font-style: normal; color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.opt-btn {
  padding: 12px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
  font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 500; line-height: 1.35;
  color: var(--text-primary); cursor: pointer; transition: all 0.15s;
}
.opt-btn:hover { border-color: var(--accent); color: var(--accent); }
.opt-btn.selected { background: var(--btn-bg); color: #fff; border-color: var(--btn-bg); }
.opt-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.options.cols-3 { grid-template-columns: repeat(3, 1fr); }

.submit-row { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.btn {
  padding: 14px 28px; border: none; border-radius: 10px;
  font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; text-decoration: none; display: inline-block;
}
.btn-primary { background: var(--btn-bg); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--btn-bg-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--text-primary); }
.submit-hint { font-size: 13px; color: var(--text-muted); }

/* results */
.overall-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px;
  padding: 32px 36px; margin: 24px 0 8px; display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center;
}
.score-num { font-size: 60px; font-weight: 700; line-height: 1; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.score-num small { font-size: 20px; font-weight: 500; color: var(--text-muted); }
.score-label .tier { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 6px; }
.score-label p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

.bars { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 24px 28px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 112px; gap: 16px; align-items: center; padding: 10px 0; }
.bar-row .name { font-size: 14px; font-weight: 600; line-height: 1.25; }
.bar-row .name small { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.04em; }
.bar-row .track { position: relative; height: 12px; border-radius: 4px; background: var(--border); overflow: hidden; }
.bar-row .track > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.bar-row.weakest .track > i { background: var(--low); }
.bar-row .track > b { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--card-bg); }
.bar-row .val { font-size: 12px; font-weight: 500; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-row .val span { display: inline-block; min-width: 28px; font-size: 15px; font-weight: 600; color: var(--text-primary); }
.bar-legend { position: relative; height: 18px; margin: 4px 128px 0 112px; font-size: 10.5px; color: var(--text-muted); }
.bar-legend span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

.band-scale { grid-column: 1 / -1; position: relative; padding-top: 26px; }
.band-scale .segs { display: flex; gap: 2px; height: 10px; }
.band-scale .seg { border-radius: 4px; background: var(--border); }
.band-scale .seg.on { background: var(--accent); }
.band-scale .marker { position: absolute; top: 0; transform: translateX(-50%); font-size: 12px; font-weight: 600; color: var(--text-primary); line-height: 18px; }
.band-scale .marker::after { content: ''; position: absolute; left: 50%; top: 20px; width: 2px; height: 16px; margin-left: -1px; background: var(--text-primary); border-radius: 1px; }
.band-scale .ticks { position: relative; height: 18px; margin-top: 6px; font-size: 10.5px; color: var(--text-muted); }
.band-scale .ticks span { position: absolute; transform: translateX(-50%); }
.band-scale .ticks span:first-child { transform: none; }
.band-scale .ticks span:last-child { transform: translateX(-100%); }

.stmt { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 10px 0 0; margin-top: 10px; border-top: 1px solid var(--border); }
.stmt p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; }
.dots { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.dots i.on { background: var(--accent); }
.dots span { font-size: 12px; color: var(--text-muted); margin-left: 6px; min-width: 84px; }

.days { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 12px; }
.days i { position: relative; width: 26px; height: 26px; border-radius: 4px; background: #fff; border: 1px solid var(--border); overflow: hidden; }
.days i b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }
.days span { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-left: 8px; }

.first { background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; padding: 20px 22px; margin-top: 16px; font-size: 15px; color: var(--text-secondary); line-height: 1.65; }
.first b { color: var(--text-primary); }

.gate { margin-top: 40px; border: 1px solid var(--border); border-radius: 16px; padding: 28px 32px; }
.gate h2 { font-size: 20px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.01em; }
.gate > p { font-size: 15px; color: var(--text-secondary); margin-bottom: 18px; max-width: 58ch; }
.gate ul { list-style: none; margin: 0 0 22px; }
.gate li { font-size: 14px; color: var(--text-secondary); padding-left: 20px; position: relative; margin-bottom: 6px; }
.gate li::before { content: ''; position: absolute; left: 0; top: 10px; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 6px; }
.field label .opt { font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-family: 'Poppins', sans-serif; font-size: 15px; color: var(--text-primary); background: #fff;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin: 6px 0 18px; }
.consent input { margin-top: 3px; accent-color: var(--btn-bg); }
.consent a { color: var(--text-muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { font-size: 13px; margin-top: 10px; min-height: 1em; }
.form-status.err { color: #C0392B; }

.dim-card { border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-bottom: 12px; }
.dim-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.dim-head h3 { font-size: 16px; font-weight: 600; }
.dim-score { font-size: 13px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dim-read { font-size: 14px; color: var(--text-secondary); }

.cost { margin-top: 16px; padding: 18px 22px; background: var(--accent-light); border-radius: 12px; font-size: 15px; color: var(--text-secondary); line-height: 1.65; }
.cost b { color: var(--text-primary); }

.tool { border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; margin-bottom: 12px; }
.tool h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.tool p { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.tool p:last-child { margin-bottom: 0; }
.tool pre {
  white-space: pre-wrap; font-family: 'Poppins', sans-serif; font-size: 13px; line-height: 1.6; color: var(--text-secondary);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin: 10px 0;
}
.copy-btn { padding: 8px 16px; font-size: 13px; border-radius: 8px; }

.offer { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.offer h2 { font-size: 20px; font-weight: 600; margin-bottom: 10px; letter-spacing: -0.01em; }
.offer p { font-size: 15px; color: var(--text-secondary); margin-bottom: 18px; max-width: 58ch; }
.offer .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-note { font-size: 12.5px; color: var(--text-muted); margin-top: 10px; }
.done-note { font-size: 15px; color: var(--high); font-weight: 500; }

.retake-link { display: inline-block; margin-top: 28px; font-size: 14px; color: var(--accent); text-decoration: none; }
.retake-link:hover { text-decoration: underline; }

.empty-state { text-align: center; padding: 60px 0; }
.empty-state h1 { font-size: 24px; margin-bottom: 12px; }
.empty-state p { color: var(--text-secondary); margin-bottom: 20px; }
.empty-state a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* sidebar: Get in touch on top, no outbound links */
.sidebar { position: sticky; top: 48px; align-self: start; }
.sidebar-section { margin-bottom: 36px; }
.sidebar-section h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 12px; }
.sidebar-section p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; }
.sidebar-section ul { list-style: none; }
.sidebar-section li { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.5; }
.sidebar-cta { display: block; width: 100%; text-align: center; background: var(--accent); color: #fff; font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 600; padding: 12px 24px; border: none; border-radius: 8px; cursor: pointer; transition: opacity 0.2s; }
.sidebar-cta:hover { opacity: 0.85; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(26,26,26,0.45); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 300; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 28px 32px; position: relative; }
.modal h2 { font-size: 22px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.modal > p { font-size: 14px; color: var(--text-secondary); margin-bottom: 18px; }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 24px; line-height: 1; color: var(--text-muted); cursor: pointer; }
.modal-close:hover { color: var(--text-primary); }

.footer { padding: 24px 32px 28px; font-size: 12px; color: var(--text-muted); text-align: center; }
.footer a { color: var(--text-muted); text-decoration: none; margin-left: 16px; }
.footer a:hover { color: var(--accent); }

@media (max-width: 900px) {
  .wrapper { grid-template-columns: 1fr; gap: 24px; padding: 20px 16px 80px; }
  .sidebar { position: static; order: -1; display: flex; justify-content: flex-end; }
  .sidebar .sidebar-section { margin-bottom: 0; }
  .sidebar .sidebar-section.desk { display: none; }
  .sidebar-cta { width: auto; padding: 10px 20px; }
  h1 { font-size: 27px; }
  .options { grid-template-columns: repeat(2, 1fr); }
  .options.cols-3 { grid-template-columns: 1fr; }
  .overall-card { grid-template-columns: 1fr; gap: 16px; padding: 26px 24px; }
  .bar-row { grid-template-columns: 76px 1fr 92px; gap: 10px; }
  .bar-row .val { line-height: 1.25; white-space: normal; }
  .bar-row .val span { display: block; }
  .bar-legend { margin: 4px 102px 0 86px; }
  .bar-legend span:nth-child(2), .bar-legend span:nth-child(3) { display: none; }
  .stmt { grid-template-columns: 1fr; gap: 6px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .gate, .modal { padding: 24px 20px; }
}

@media print {
  .sidebar, .footer, .gate, .offer, .retake-link, .copy-btn, .modal-backdrop { display: none !important; }
  .wrapper { display: block; padding: 0; }
  .overall-card, .bars, .cost, .tool, .dim-card { break-inside: avoid; }
}
