:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-alt: #f7f7f7;
  --ink: #111111;
  --muted: #6f6f6f;
  --line: #d9d9d9;
  --line-strong: #bcbcbc;
  --button: #111111;
  --button-text: #ffffff;
  --alert: #b0352a;
  --shadow: 0 18px 50px rgba(17, 17, 17, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffffff 0%, #fcfcfc 52%, #f5f5f5 100%);
  line-height: 1.65;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 28px;
  display: grid;
  gap: 24px;
}

.topbar-primary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-icon {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.utility-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px 22px;
  font-size: 0.84rem;
}

.utility-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: rgba(17, 17, 17, 0.88);
  text-decoration: none;
}

.utility-links svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-link span {
  min-width: 0.8em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 16px;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links a {
  text-decoration: none;
  color: rgba(17, 17, 17, 0.84);
}

.inline-logout-form {
  margin: 0;
}

.inline-logout-form .link-button {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: rgba(17, 17, 17, 0.84);
  cursor: pointer;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.inline-logout-form .link-button:hover,
.inline-logout-form .link-button:focus-visible {
  color: var(--ink);
}

.hero-page,
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: 28px;
  padding-right: 28px;
}

.hero-page {
  padding-top: 54px;
  padding-bottom: 84px;
  display: grid;
  gap: 22px;
}

.container {
  padding-top: 34px;
  padding-bottom: 70px;
}

.hero-card,
.card,
.report-hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: clamp(28px, 5vw, 68px);
}

.hero-intro {
  min-height: 56vh;
  display: grid;
  align-content: center;
}

.hero-bridge {
  padding: 24px 28px;
}

.hero-support {
  margin-top: 18px;
  font-size: 0.95rem;
  color: var(--muted);
}

.home-paths {
  margin-top: 0;
}

.path-card {
  min-height: 0;
}

.path-copy {
  display: grid;
  gap: 14px;
}

.path-actions {
  margin-top: 28px;
}

.feature-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  color: rgba(17, 17, 17, 0.84);
}

.feature-list li {
  padding-left: 18px;
  position: relative;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--ink);
  transform: translateY(-50%);
}

.extension-card,
.support-card {
  padding: 28px;
}

.support-card {
  text-align: left;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

h1 {
  margin-top: 6px;
  font-size: clamp(2.3rem, 5.4vw, 5.1rem);
  max-width: 11ch;
}

h2 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0;
}

.lead {
  margin-top: 18px;
  max-width: 60ch;
  font-size: clamp(1rem, 1.8vw, 1.24rem);
  font-weight: 300;
  color: rgba(17, 17, 17, 0.86);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 34px 0 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  cursor: pointer;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--button);
  color: var(--button-text);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
}

.btn-small {
  min-height: 38px;
  padding: 9px 14px;
  font-size: 0.74rem;
  background: var(--button);
  color: var(--button-text);
}

.two-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.two-paths article {
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 24px;
  min-height: 210px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.centered-page {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
  padding: 28px;
}

.card {
  padding: 26px;
  margin-bottom: 18px;
}

.table-shell {
  width: 100%;
  overflow-x: auto;
}

.form-card {
  width: min(560px, 100%);
}

.form-card.wide {
  width: 100%;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: rgba(17, 17, 17, 0.86);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 13px 15px;
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.05);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px 18px;
}

.error {
  background: #fff2ef;
  color: var(--alert);
  border: 1px solid #efc6bf;
  border-radius: 18px;
  padding: 13px 15px;
  margin-bottom: 18px;
}

.dashboard-hero {
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  display: grid;
  gap: 6px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

.stat-card span,
.muted {
  color: var(--muted);
}

.stat-card strong {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 400;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 620px;
}

th,
td {
  padding: 14px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.report-hero {
  padding: clamp(24px, 4vw, 42px);
  margin-bottom: 18px;
  background:
    radial-gradient(circle at top right, rgba(0, 0, 0, 0.03), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8f8f8 100%);
}

.report-hero .lead {
  max-width: 56ch;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 20px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.report-meta strong {
  color: var(--ink);
  font-weight: 600;
}

.report-actions {
  margin-top: 26px;
  margin-bottom: 0;
}

.report-intro-card,
.report-section-card,
.unlock-card,
.debug-card {
  padding-top: 30px;
  padding-bottom: 30px;
}

.report-section-card p + p,
.report-intro-card p + p,
.unlock-card p + p {
  margin-top: 12px;
}

.debug-card details {
  display: grid;
  gap: 16px;
}

.debug-card summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.personality-test-shell {
  display: grid;
  gap: 18px;
}

.pt-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.pt-live-code {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--text);
  display: block;
}

/* Account page TPQ result block */
.account-tpq-result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
  margin-top: 6px;
}
.account-tpq-result:hover {
  border-color: var(--line-strong);
  background: #f7f7f7;
}
.account-tpq-code {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--text);
  min-width: 90px;
}
.account-tpq-meta {
  flex: 1;
  font-size: 0.85rem;
  color: #6f6f6f;
}
.account-tpq-arrow {
  font-size: 1.1rem;
  color: #aaa;
}

.pt-completion-banner {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
}

.pt-completion-banner.is-ready {
  border-color: var(--line-strong);
  background: var(--panel-alt);
}

.pt-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.pt-tab {
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 12px 10px;
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  font-size: 0.83rem;
}

.pt-tab:last-child {
  border-right: 0;
}

.pt-tab.is-active {
  background: var(--panel-alt);
  box-shadow: inset 0 -2px 0 0 var(--ink);
}

.pt-tab .pt-count {
  color: var(--muted);
}

.pt-panel {
  display: none;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  background: #fff;
  gap: 12px;
}

.pt-panel.is-active {
  display: grid;
}

.pt-question-list {
  display: grid;
  gap: 14px;
}

.pt-question {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
  display: grid;
  gap: 10px;
}

.pt-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pt-option {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 8px;
  cursor: pointer;
}

.pt-option:hover,
.pt-option:focus-visible {
  border-color: var(--line-strong);
  outline: none;
}

.pt-option.is-selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.pt-option-label {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 0.78rem;
}

.pt-option.is-selected .pt-option-label {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.pt-result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.pt-result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#pt-mark-complete,
#pt-new-attempt {
  display: none;
}

.pt-option:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.pt-interpretation {
  font-weight: 600;
}

.pt-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-size: 1.6rem;
  letter-spacing: 0.1em;
}

.pt-result-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pt-result-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-alt);
  font-size: 0.83rem;
  line-height: 1.7;
}

.site-footer {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
}

@media (max-width: 900px) {
  .topbar-inner,
  .hero-page,
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .topbar-inner {
    gap: 18px;
  }

  .topbar-primary {
    gap: 14px;
  }

  .utility-links {
    gap: 12px 16px;
  }

  .two-paths,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .pt-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pt-options,
  .pt-result-grid {
    grid-template-columns: 1fr;
  }

  .pt-result-head,
  .pt-result-actions {
    flex-wrap: wrap;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .hero-intro {
    min-height: auto;
  }
}

@media (max-width: 700px) {
  .topbar-inner {
    gap: 14px;
  }

  .topbar-primary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .utility-links {
    width: 100%;
    justify-content: flex-end;
  }

  .nav-links {
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links a {
    white-space: nowrap;
  }

  .hero-page {
    padding-top: 28px;
    padding-bottom: 48px;
  }

  .pt-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .hero-card,
  .card,
  .report-hero {
    border-radius: 22px;
  }

  .card {
    padding: 20px;
  }

  h1 {
    max-width: none;
  }

  .table-shell {
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 12px 14px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  td {
    border-bottom: none;
    padding: 6px 0;
    font-size: 0.84rem;
  }

  td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: 0.69rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
  }
}
