:root {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #242424;
  background: #f4f3f1;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --cgi-red: #e31937;
  --cgi-red-dark: #b80f29;
  --ink: #242424;
  --muted: #686868;
  --paper: #ffffff;
  --line: #ddd9d5;
  --soft: #f7f5f3;
  --success: #26734d;
  --warning: #945d00;
  --shadow: 0 18px 48px rgba(45, 35, 31, 0.08);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; }
button, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
a { color: inherit; }
[hidden] { display: none !important; }

.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;
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  min-width: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.brand-logo { display: block; width: 74px; height: 47px; object-fit: contain; }
.brand-divider { width: 1px; height: 30px; background: var(--line); }
.brand-label { display: flex; flex-direction: column; gap: 2px; }
.brand-label strong { font-size: 0.91rem; }

.main-navigation {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.main-navigation button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #625d59;
  font-size: 0.74rem;
  font-weight: 700;
}

.main-navigation button:hover { color: var(--cgi-red-dark); }
.main-navigation button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 5px rgba(45, 35, 31, 0.12); }

.account { display: flex; align-items: center; gap: 12px; text-align: right; font-size: 0.8rem; }
.profile-trigger { min-width: 0; padding: 3px; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; background: transparent; color: inherit; }
.profile-trigger:hover { background: var(--soft); }
.profile-trigger:focus-visible { outline: 3px solid rgba(227, 25, 55, 0.18); outline-offset: 2px; }
.profile-trigger strong { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-avatar { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; overflow: hidden; border: 1px solid #d9d2ce; border-radius: 50%; background: #f5e8eb center / cover no-repeat; color: var(--cgi-red-dark); font-size: 0.62rem; font-weight: 800; }

.primary-button, .secondary-button, .text-button {
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.primary-button { border: 0; background: var(--cgi-red); color: #fff; box-shadow: 0 7px 18px rgba(227, 25, 55, 0.18); }
.primary-button:hover:not(:disabled) { transform: translateY(-1px); background: var(--cgi-red-dark); box-shadow: 0 10px 24px rgba(184, 15, 41, 0.24); }
.secondary-button { border: 1px solid var(--line); background: #fff; color: #444; }
.secondary-button:hover:not(:disabled) { border-color: #aaa39e; background: #fcfbfa; }
.primary-button.compact, .secondary-button.compact { min-height: 36px; padding: 0 11px; font-size: 0.72rem; }
.text-button { min-height: 36px; padding: 0; border: 0; background: transparent; color: var(--cgi-red-dark); }
.wide { width: 100%; }

.eyebrow {
  margin: 0;
  color: var(--cgi-red-dark);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.loading-page {
  min-height: calc(100vh - 118px);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
}

.loading-page p { margin: 0; }
.spinner { width: 22px; height: 22px; display: inline-block; border: 2px solid #ded9d6; border-top-color: var(--cgi-red); border-radius: 50%; animation: spin 0.75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.access-page {
  min-height: calc(100vh - 118px);
  padding: 54px 20px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(227, 25, 55, 0.035), transparent 48%),
    #f5f4f2;
}

.access-card {
  width: min(100%, 420px);
  padding: 32px 36px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--cgi-red);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.access-card h1 { margin: 10px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 6vw, 2.5rem); line-height: 1.05; }
.access-card > p:not(.eyebrow) { margin: 0 0 24px; color: #57504c; line-height: 1.5; }
.access-note { margin-top: 12px; display: block; color: var(--muted); text-align: center; line-height: 1.4; }

.home-page { padding-bottom: 34px; }
.path-section { width: min(1180px, 100%); margin: 0 auto; padding: 30px clamp(20px, 5vw, 60px) 20px; }
.path-section > h1 { margin: 0 0 20px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.65rem, 3vw, 2.1rem); }
.trainer-launch { margin-bottom: 14px; padding: 15px 17px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border: 1px solid #ead4d8; border-radius: 8px; background: #fffafb; }
.trainer-launch > div { min-width: 0; display: grid; gap: 3px; }
.trainer-launch strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; }
.trainer-launch span { color: var(--muted); font-size: 0.76rem; line-height: 1.45; }
.section-heading { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: end; gap: 32px; }
.section-heading h2 { margin: 6px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.45rem, 3vw, 2rem); }
.section-heading > p { max-width: 450px; margin: 0; color: var(--muted); line-height: 1.55; }
.path-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.path-card {
  position: relative;
  min-width: 0;
  min-height: 180px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(45, 35, 31, 0.045);
}

.path-card::after { position: absolute; right: -25px; top: 42px; width: 100px; height: 100px; border: 18px solid rgba(227, 25, 55, 0.035); border-radius: 50%; content: ""; pointer-events: none; }
.path-card.featured { border-top: 3px solid var(--cgi-red); }
.path-icon { width: 44px; height: 44px; margin: 0 0 16px; display: grid; place-items: center; border-radius: 6px; background: #fce9ec; color: var(--cgi-red-dark); font-family: Georgia, serif; font-size: 1.25rem; font-weight: 800; }
.path-card h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; line-height: 1.14; }
.track-actions { margin-top: auto; padding-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.path-start { width: 100%; min-height: 40px; padding: 0 10px; font-size: 0.72rem; }

.quiz-page { width: min(1280px, 100%); margin: 0 auto; padding: 32px clamp(18px, 4vw, 52px) 70px; }
.quiz-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.quiz-identity { text-align: center; }
.quiz-identity strong { margin-top: 4px; display: block; }
.quiz-timer { justify-self: end; min-width: 88px; display: flex; flex-direction: column; text-align: right; }
.quiz-timer small { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.61rem; }
.quiz-timer strong { font-variant-numeric: tabular-nums; }
.progress-track { height: 5px; margin-top: 24px; overflow: hidden; border-radius: 999px; background: #dfdcda; }
.progress-track span { height: 100%; display: block; border-radius: inherit; background: var(--cgi-red); transition: width 0.2s ease; }
.quiz-layout { margin-top: 32px; display: grid; grid-template-columns: 190px minmax(0, 820px); gap: 32px; justify-content: center; align-items: start; }
.quiz-page.trainer-page { padding-top: 34px; }
.quiz-layout.trainer-layout { margin-top: 0; grid-template-columns: minmax(0, 900px); }
.trainer-page .question-actions { justify-content: flex-end; }

.question-map { position: sticky; top: 105px; padding: 19px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.question-map > small { display: block; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.question-map > div { margin: 14px 0 18px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.question-map button { aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: #5b5652; font-size: 0.66rem; }
.question-map button:hover { border-color: #cb8e97; }
.question-map button.current { border-color: var(--cgi-red); box-shadow: 0 0 0 2px rgba(227, 25, 55, 0.12); color: var(--cgi-red-dark); }
.question-map button.answered { border-color: #b9d3c5; background: #e9f4ee; color: var(--success); }
.question-map > span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.67rem; }
.question-map i { width: 9px; height: 9px; border-radius: 2px; background: #e9f4ee; border: 1px solid #b9d3c5; }

.question-card { padding: clamp(24px, 5vw, 48px); border: 1px solid var(--line); border-top: 3px solid var(--cgi-red); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.question-meta { display: flex; align-items: center; gap: 8px; }
.question-meta span { padding: 5px 8px; border-radius: 3px; background: var(--soft); color: #625d59; font-size: 0.64rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.question-card h1 { margin: 20px 0 28px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.3; }
.question-card fieldset { min-width: 0; margin: 0; padding: 0; display: grid; gap: 10px; border: 0; }
.answer-option { min-width: 0; padding: 15px 17px; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; border: 1px solid #d8d3cf; border-radius: 6px; background: #fff; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease; }
.answer-option:hover { border-color: #d58a95; background: #fffafb; }
.answer-option:has(input:checked) { border-color: var(--cgi-red); background: #fff4f6; box-shadow: 0 0 0 2px rgba(227, 25, 55, 0.08); }
.answer-option input { position: absolute; opacity: 0; }
.option-letter { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #cdc7c3; border-radius: 50%; color: #665f5b; font-size: 0.72rem; font-weight: 800; }
.answer-option:has(input:checked) .option-letter { border-color: var(--cgi-red); background: var(--cgi-red); color: #fff; }
.option-text { padding-top: 3px; color: #494441; line-height: 1.5; }
.answer-option input:focus-visible + .option-letter { outline: 3px solid rgba(227, 25, 55, 0.18); outline-offset: 2px; }
.answer-option.correct { border-color: #8fc2a6; background: #f0f8f4; }
.answer-option.incorrect { border-color: #dfa5ae; background: #fff3f5; }
.answer-option.correct .option-letter { border-color: var(--success); background: var(--success); color: #fff; }
.answer-option.incorrect .option-letter { border-color: var(--cgi-red-dark); background: var(--cgi-red-dark); color: #fff; }
.answer-option:has(input:disabled) { cursor: default; }
.trainer-feedback { margin-top: 18px; padding: 15px 17px; border-left: 4px solid var(--success); border-radius: 4px; background: #f0f8f4; color: #3e4e45; line-height: 1.5; }
.trainer-feedback.incorrect { border-left-color: var(--cgi-red-dark); background: #fff3f5; color: #5e343a; }
.trainer-feedback strong, .trainer-feedback span { display: block; }
.trainer-feedback span { margin-top: 5px; font-size: 0.84rem; }
.trainer-feedback p { margin: 8px 0 0; font-size: 0.82rem; }
.question-actions { margin-top: 30px; padding-top: 20px; display: flex; align-items: center; gap: 10px; border-top: 1px solid #eeeae7; }
.question-actions > span { margin: 0 auto; color: var(--muted); font-size: 0.74rem; }

.results-page { width: min(1120px, 100%); margin: 0 auto; padding: 48px clamp(18px, 5vw, 60px) 72px; }
.result-hero { padding: clamp(26px, 5vw, 48px); display: grid; grid-template-columns: 180px 1fr; gap: clamp(30px, 6vw, 64px); align-items: center; border: 1px solid var(--line); border-top: 4px solid var(--cgi-red); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.score-ring { --score: 0%; width: 170px; height: 170px; display: grid; place-content: center; justify-items: center; border-radius: 50%; background: radial-gradient(circle closest-side, white 79%, transparent 80% 99%), conic-gradient(var(--cgi-red) var(--score), #e7e2df 0); }
.score-ring strong { font-family: Georgia, serif; font-size: 2.6rem; }
.score-ring small { color: var(--muted); }
.result-hero h1 { margin: 8px 0 9px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 5vw, 3.3rem); }
.result-hero > div:last-child > p:not(.eyebrow) { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.6; }
.result-metrics { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.result-metrics span { min-width: 130px; padding: 11px 13px; display: flex; flex-direction: column; gap: 3px; border-radius: 5px; background: var(--soft); }
.result-metrics small { color: var(--muted); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.06em; }
.result-actions { margin: 18px 0 46px; display: flex; flex-wrap: wrap; gap: 9px; }
.review-list { display: grid; gap: 10px; }
.review-item { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.review-item summary { padding: 17px 19px; display: grid; grid-template-columns: 33px 1fr auto; gap: 12px; align-items: center; cursor: pointer; list-style: none; }
.review-item summary::-webkit-details-marker { display: none; }
.review-status { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: #e9f4ee; color: var(--success); font-weight: 900; }
.review-item.incorrect .review-status { background: #fce8eb; color: var(--cgi-red-dark); }
.review-item summary strong { font-size: 0.86rem; line-height: 1.4; }
.review-item summary small { color: var(--muted); }
.review-body { padding: 0 20px 20px 64px; color: #514b48; line-height: 1.55; }
.review-answer { margin: 0 0 10px; padding: 10px 12px; border-left: 3px solid var(--success); background: #f0f7f3; }
.review-body p:last-child { margin-bottom: 0; }

.leaderboard-page { width: min(1760px, 100%); margin: 0 auto; padding: 24px clamp(18px, 3vw, 44px) 48px; }
.leaderboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.leaderboard-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 3vw, 2.35rem); }
.leaderboard-heading .secondary-button { min-height: 38px; }
.leaderboard-loading, .leaderboard-error { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.leaderboard-error { color: var(--cgi-red-dark); }
.leaderboard-matrix { margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.leaderboard-role { min-width: 0; }
.leaderboard-role > h2 { margin: 0 0 7px; color: var(--cgi-red-dark); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.leaderboard-role .track-board + .track-board { margin-top: 10px; }
.track-board { min-width: 0; min-height: 180px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 10px 28px rgba(45, 35, 31, 0.055); }
.track-board > header { min-height: 44px; padding: 8px 12px; display: flex; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--line); }
.track-board h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; }
.track-board-empty { min-height: 134px; margin: 0; display: grid; place-items: center; color: var(--muted); font-size: 0.8rem; }
.table-scroll {
  max-height: calc(30px + (46px * 5));
  overflow-x: auto;
  overflow-y: scroll;
  scrollbar-color: #b8b0ac #f4f0ed;
  scrollbar-width: thin;
}
.table-scroll::-webkit-scrollbar { width: 7px; height: 7px; }
.table-scroll::-webkit-scrollbar-track { background: #f4f0ed; }
.table-scroll::-webkit-scrollbar-thumb { border-radius: 999px; background: #b8b0ac; }
.table-scroll::-webkit-scrollbar-thumb:hover { background: #8d817b; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 7px; text-align: left; white-space: nowrap; }
th { height: 30px; background: var(--soft); color: #6b6561; font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; }
.table-scroll th { position: sticky; top: 0; z-index: 1; }
tbody tr + tr td { border-top: 1px solid #eeeae7; }
tbody tr { height: 46px; cursor: help; }
tbody tr.current-user { background: #fff8f9; }
.rank-cell { width: 42px; color: var(--cgi-red-dark); font-size: 0.75rem; font-weight: 800; text-align: center; }
.rank-medal { width: 22px; height: 26px; display: block; margin: 0 auto; overflow: visible; }
.rank-medal circle { fill: currentColor; stroke: rgba(36, 36, 36, 0.25); stroke-width: 1; }
.rank-medal text { fill: #fff; font-size: 10px; font-weight: 900; font-family: "Segoe UI", Arial, sans-serif; }
.rank-medal.gold { color: #c79200; }
.rank-medal.silver { color: #8b9299; }
.rank-medal.bronze { color: #a95f32; }
.leaderboard-person-cell { display: flex; align-items: center; gap: 8px; }
.leaderboard-avatar { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; object-fit: cover; border: 1px solid #e1dcda; border-radius: 50%; background: #f5e8eb; color: var(--cgi-red-dark); font-size: 0.61rem; font-weight: 800; }
.leaderboard-person { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.leaderboard-person strong { max-width: 135px; overflow: hidden; text-overflow: ellipsis; font-size: 0.78rem; }
.leaderboard-person small { max-width: 135px; overflow: hidden; color: var(--muted); font-size: 0.66rem; text-overflow: ellipsis; }
.score-cell strong { color: var(--cgi-red-dark); font-size: 0.86rem; }

.profile-dialog { width: min(620px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; overflow-y: auto; border: 0; border-radius: 10px; background: #fff; color: var(--ink); box-shadow: 0 24px 70px rgba(30, 24, 21, 0.3); }
.profile-dialog::backdrop { background: rgba(35, 29, 27, 0.52); backdrop-filter: blur(2px); }
.profile-form { padding: 26px; }
.profile-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.profile-heading h2 { margin: 6px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.65rem; }
.profile-close { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--soft); color: #5d5652; font-size: 1.35rem; line-height: 1; }
.profile-onboarding-note { margin: 20px 0 0; padding: 12px 14px; border-left: 3px solid var(--cgi-red); border-radius: 4px; background: #fff5f6; color: #5c5551; font-size: 0.79rem; line-height: 1.55; }
.profile-photo-editor { margin-top: 24px; padding: 16px; display: grid; grid-template-columns: 78px 1fr; gap: 16px; align-items: center; border-radius: 7px; background: var(--soft); }
.profile-photo-editor img, .profile-photo-fallback { width: 78px; height: 78px; display: grid; place-items: center; object-fit: cover; border: 1px solid #d8d0cc; border-radius: 50%; background: #f5e8eb; color: var(--cgi-red-dark); font-weight: 800; }
.profile-photo-editor > div { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.profile-photo-editor small { width: 100%; color: var(--muted); line-height: 1.4; }
.profile-remove-photo { min-height: 34px; font-size: 0.72rem; }
.profile-photo-status { margin: 12px 0 0; padding: 10px 12px; border-radius: 5px; background: var(--soft); color: var(--muted); font-size: 0.75rem; line-height: 1.45; }
.profile-photo-status.error { background: #fff1f3; color: var(--cgi-red-dark); }
.profile-crop-editor { margin-top: 16px; padding: 16px; border: 1px solid #e2dcda; border-radius: 7px; background: #fbfaf9; }
.profile-crop-heading strong, .profile-crop-heading small { display: block; }
.profile-crop-heading strong { font-size: 0.86rem; }
.profile-crop-heading small { margin-top: 4px; color: var(--muted); font-size: 0.72rem; line-height: 1.45; }
.profile-crop-canvas { width: min(100%, 320px); height: auto; margin: 14px auto 0; display: block; border-radius: 7px; background: #ece8e5; box-shadow: inset 0 0 0 1px rgba(45, 35, 31, 0.14); cursor: grab; touch-action: none; }
.profile-crop-canvas.dragging { cursor: grabbing; }
.profile-crop-canvas:focus-visible { outline: 3px solid rgba(227, 25, 55, 0.2); outline-offset: 3px; }
.profile-crop-controls { margin-top: 14px; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; }
.profile-crop-controls label { min-width: 0; display: grid; gap: 5px; color: #5c5551; font-size: 0.68rem; font-weight: 700; }
.profile-crop-controls input { width: 100%; accent-color: var(--cgi-red); }
.profile-crop-actions { margin-top: 15px; display: flex; justify-content: flex-end; gap: 8px; }
.profile-field { margin-top: 20px; display: grid; gap: 7px; }
.profile-field > span { color: #504a47; font-size: 0.75rem; font-weight: 800; }
.profile-field select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); }
.profile-note { margin: 16px 0 0; color: var(--muted); font-size: 0.75rem; line-height: 1.5; }
.profile-actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 9px; }

.trainer-nudge-dialog { width: min(540px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 10px; background: #fff; color: var(--ink); box-shadow: 0 24px 70px rgba(30, 24, 21, 0.3); }
.trainer-nudge-dialog::backdrop { background: rgba(35, 29, 27, 0.52); backdrop-filter: blur(2px); }
.trainer-nudge-content { padding: 30px; }
.trainer-nudge-content h2 { margin: 7px 0 14px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.55rem, 4vw, 2rem); }
.trainer-nudge-content > p:not(.eyebrow) { margin: 0 0 11px; color: var(--muted); line-height: 1.6; }
.trainer-nudge-actions { margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 40; max-width: min(420px, calc(100vw - 32px)); padding: 14px 17px; border-radius: 6px; background: #2d2927; color: #fff; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2); line-height: 1.45; }
.toast.error { background: #8c1628; }

footer { min-height: 50px; padding: 12px clamp(20px, 5vw, 72px); display: flex; align-items: center; gap: 20px; border-top: 1px solid var(--line); background: #fff; color: #777; font-size: 0.7rem; }

@media (max-width: 980px) {
  .path-grid { grid-template-columns: 1fr; }
  .path-card { min-height: 0; }
  .quiz-layout { grid-template-columns: 1fr; }
  .question-map { position: static; }
  .question-map > div { grid-template-columns: repeat(10, 1fr); }
}

@media (max-width: 1220px) {
  .leaderboard-matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .leaderboard-matrix { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar { min-height: 62px; padding: 0 14px; gap: 10px; }
  .brand-logo { width: 62px; }
  .brand-divider, .brand-label, .profile-trigger strong { display: none; }
  .main-navigation { margin-left: auto; }
  .main-navigation button { width: 37px; padding: 0; overflow: hidden; font-size: 0; }
  .main-navigation button::first-letter { font-size: 0.75rem; }
  .main-navigation button[data-view-target="home"]::after { content: "Play"; font-size: 0.68rem; }
  .main-navigation button[data-view-target="leaderboard"]::after { content: "Board"; font-size: 0.68rem; }
  .path-section { padding-top: 24px; }
  .trainer-launch { align-items: stretch; flex-direction: column; gap: 12px; }
  .trainer-launch button { width: 100%; }
  .section-heading { align-items: start; flex-direction: column; gap: 12px; }
  .quiz-header { grid-template-columns: 1fr auto; }
  .quiz-identity { grid-row: 2; grid-column: 1 / -1; }
  .quiz-timer { grid-column: 2; }
  .question-map > div { grid-template-columns: repeat(6, 1fr); }
  .question-card { padding: 24px 18px; }
  .question-actions { flex-wrap: wrap; }
  .question-actions > span { width: 100%; order: -1; text-align: center; }
  .question-actions button { flex: 1; }
  .result-hero { grid-template-columns: 1fr; }
  .score-ring { margin: 0 auto; }
  .result-actions > button { width: 100%; }
  .review-item summary { grid-template-columns: 33px 1fr; }
  .review-item summary small { grid-column: 2; }
  .review-body { padding-left: 20px; }
  .leaderboard-heading { align-items: flex-start; flex-direction: column; }
  .profile-form { padding: 21px 18px; }
  .profile-photo-editor { grid-template-columns: 64px 1fr; }
  .profile-photo-editor img, .profile-photo-fallback { width: 64px; height: 64px; }
  .profile-crop-controls { grid-template-columns: 1fr; }
  .trainer-nudge-actions { flex-direction: column-reverse; }
  .trainer-nudge-actions button { width: 100%; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
