:root {
  --tw-navy: #1f3548;
  --tw-steel: #6a7d8a;
  --tw-bg: #faf8f5;
  --tw-card: #ffffff;
  --tw-border: #e1dfd9;
  --tw-text: #1c1c1c;
  --tw-muted: #707070;
  --tw-blue: #4a6b85;
  --tw-blue-deep: #2c4860;
  --tw-green: #7aa05f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--tw-bg);
  color: var(--tw-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

.card {
  background: var(--tw-card);
  border: 1px solid var(--tw-border);
  border-radius: 6px;
  width: 100%;
  max-width: 620px;
  padding: 36px 40px 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  background: var(--tw-navy);
  color: white;
  font-weight: 700;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-family: Georgia, "Times New Roman", serif;
}

.brand-line1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--tw-navy);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.5px;
}

.brand-line2 {
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--tw-steel);
  margin-top: 2px;
}

h1 {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  margin: 0 0 16px;
}

p {
  margin: 0 0 14px;
  text-align: center;
}

.subtle { color: var(--tw-muted); font-size: 14px; }

.stage.hidden { display: none; }

/* Intake form */
.intake {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 28px;
}

.intake label {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  font-size: 14px;
  color: var(--tw-text);
}

.intake input {
  padding: 8px 10px;
  border: 1px solid var(--tw-border);
  border-radius: 3px;
  font-size: 15px;
  font-family: inherit;
}

.intake input:focus {
  outline: none;
  border-color: var(--tw-blue);
}

button.primary {
  background: var(--tw-blue);
  color: white;
  border: 0;
  border-radius: 3px;
  padding: 10px 32px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin: 18px auto 0;
  display: block;
  font-family: inherit;
}

button.primary:hover { background: var(--tw-blue-deep); }
button.primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Quiz instructions */
.instructions {
  font-size: 14px;
  text-align: center;
  margin-bottom: 18px;
}

/* Progress */
.progress { margin: 0 auto 18px; max-width: 460px; }
.progress-label { text-align: center; font-size: 12px; color: var(--tw-blue); font-weight: 600; margin-bottom: 4px; }
.progress-counter { color: var(--tw-muted); font-weight: 400; margin-left: 6px; }
.progress-bar {
  height: 18px;
  background: white;
  border: 1px solid var(--tw-border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8bc370, var(--tw-green));
  width: 0%;
  transition: width 0.4s ease;
}
.progress-pct {
  position: relative;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  margin-top: -16px;
  color: #1c1c1c;
  pointer-events: none;
}

/* Rank box */
.rank-box {
  margin: 0 auto 24px;
  max-width: 460px;
  border: 1px solid var(--tw-blue);
  border-radius: 4px;
  overflow: hidden;
}

.anchor {
  background: var(--tw-blue);
  color: white;
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  padding: 10px;
  letter-spacing: 0.5px;
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: white;
}

.rank-list li {
  padding: 14px 14px 14px 36px;
  border-bottom: 1px solid var(--tw-border);
  cursor: grab;
  font-size: 15px;
  background: white;
  position: relative;
  user-select: none;
}

.rank-list li:last-child { border-bottom: none; }

.rank-list li::before {
  content: "≡";
  position: absolute;
  left: 14px;
  color: var(--tw-steel);
  font-size: 16px;
}

.rank-list li.sortable-ghost { opacity: 0.4; background: #f0f4f8; }
.rank-list li.sortable-chosen { background: #f5f9fc; }

/* Results */
.result-card {
  background: #f5f9fc;
  border: 1px solid var(--tw-border);
  border-radius: 4px;
  padding: 16px 20px;
  margin: 18px 0;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}

.result-label { color: var(--tw-muted); font-size: 14px; }
.result-value { font-weight: 600; color: var(--tw-navy); }

.score-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}

.score-table th, .score-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--tw-border);
  font-size: 14px;
}

.score-table th {
  font-weight: 600;
  color: var(--tw-blue);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.score-bar {
  height: 8px;
  background: var(--tw-border);
  border-radius: 4px;
  overflow: hidden;
  width: 100px;
}

.score-bar-fill {
  height: 100%;
  background: var(--tw-blue);
}

.footer {
  text-align: center;
  font-size: 12px;
  color: var(--tw-muted);
  margin-top: 28px;
  border-top: 1px solid var(--tw-border);
  padding-top: 14px;
}

/* Mobile */
@media (max-width: 560px) {
  .card { padding: 22px 18px; }
  .brand-mark { width: 44px; height: 44px; font-size: 26px; }
  .brand-line1 { font-size: 22px; }
  .intake label { grid-template-columns: 1fr; gap: 4px; }
}
