:root {
  color-scheme: dark;
  --bg: #090b12;
  --surface: rgba(18, 22, 35, 0.88);
  --surface-solid: #121623;
  --surface-raised: #191e2e;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f2f4fa;
  --muted: #939bad;
  --primary: #7567f8;
  --primary-light: #9a8fff;
  --blue: #4d95ff;
  --green: #35d49a;
  --red: #ff667a;
  --locked: #5f6677;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% -10%, rgba(80, 71, 206, 0.14), transparent 32rem),
    radial-gradient(circle at 90% 20%, rgba(39, 104, 171, 0.1), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(117, 103, 248, 0.45);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.11;
  pointer-events: none;
}

.ambient-one {
  top: 20%;
  left: -9rem;
  background: var(--primary);
}

.ambient-two {
  right: -7rem;
  bottom: 5%;
  background: var(--blue);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 8px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: -0.02em;
}

.brand small {
  color: var(--muted);
  font-size: 0.75rem;
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  background: rgba(12, 15, 24, 0.82);
  box-shadow:
    0 8px 24px rgba(77, 149, 255, 0.16),
    0 0 0 1px rgba(117, 103, 248, 0.08);
  font-weight: 900;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.brand-fallback {
  color: var(--text);
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark.large {
  width: 52px;
  height: 52px;
  margin-bottom: 24px;
  border-radius: 16px;
  font-size: 0.82rem;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-link {
  border-radius: 10px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}

.header-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.leaderboard-link {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.leaderboard-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: #c99a45;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: stroke 150ms ease;
}

.leaderboard-link:hover .leaderboard-icon {
  stroke: #f0bd61;
}

.account-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 4px;
  line-height: 1.2;
}

.account-chip small {
  color: var(--muted);
  font-size: 0.65rem;
}

.account-chip strong {
  max-width: 180px;
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dev-badge {
  border: 1px solid rgba(255, 190, 75, 0.32);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 190, 75, 0.08);
  color: #ffc862;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.admin-badge {
  border: 1px solid rgba(240, 189, 97, 0.3);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(201, 154, 69, 0.09);
  color: #e9b95e;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.admin-label-short {
  display: none;
}

.app-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 80px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  gap: 64px;
  align-items: end;
  margin-bottom: 46px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary-light);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(2.25rem, 5vw, 4.6rem);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.hero-copy {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.program-announcement {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  margin: 18px 0 0;
  border: 1px solid rgba(77, 149, 255, 0.25);
  border-radius: 13px;
  padding: 9px 12px;
  background: rgba(77, 149, 255, 0.07);
  color: #9bc3ff;
  font-size: 0.78rem;
}

.program-announcement strong {
  color: #bed6ff;
  font-weight: 800;
}

.mode-picker {
  display: grid;
  gap: 10px;
}

.mode-button {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 15px;
  background: rgba(18, 22, 35, 0.68);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.mode-button:hover {
  transform: translateY(-1px);
  border-color: rgba(154, 143, 255, 0.4);
}

.mode-button.active {
  border-color: rgba(154, 143, 255, 0.6);
  background: linear-gradient(100deg, rgba(117, 103, 248, 0.18), rgba(77, 149, 255, 0.06));
}

.mode-button strong,
.mode-button small {
  display: block;
}

.mode-button small {
  margin-top: 2px;
  color: var(--muted);
}

.mode-icon {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: rgba(117, 103, 248, 0.2);
  color: #b9b2ff;
  font-weight: 850;
}

.mode-icon.expert {
  background: rgba(77, 149, 255, 0.17);
  color: #88baff;
}

.progress-panel,
.quiz-header,
.question-card,
.result-summary,
.settings-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.progress-panel {
  margin-bottom: 58px;
  border-radius: 24px;
  padding: 26px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 24px;
}

.score-ring {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 1px solid rgba(154, 143, 255, 0.28);
  border-radius: 50%;
  background: rgba(117, 103, 248, 0.1);
  color: #c8c3ff;
  font-size: 0.95rem;
  font-weight: 800;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  margin-bottom: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--blue));
  transition: width 400ms ease;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.metric {
  border-left: 1px solid var(--line);
  padding-left: 17px;
}

.metric span,
.metric strong {
  display: block;
}

.metric span {
  color: var(--muted);
  font-size: 0.78rem;
}

.metric strong {
  margin-top: 3px;
  font-size: 1.12rem;
}

.unlock-hint {
  max-width: 300px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.day-card {
  position: relative;
  min-height: 172px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  padding: 20px;
  background: rgba(18, 22, 35, 0.68);
  text-align: left;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease;
}

button.day-card {
  width: 100%;
  cursor: pointer;
}

button.day-card:hover {
  transform: translateY(-3px);
  border-color: rgba(154, 143, 255, 0.42);
  background: rgba(25, 30, 46, 0.92);
}

.day-card.locked {
  color: #777f90;
  filter: saturate(0.55);
}

.day-card.completed {
  border-color: rgba(53, 212, 154, 0.25);
}

.day-top,
.day-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.day-number {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.day-card h3 {
  min-height: 48px;
  margin: 22px 0 18px;
  font-size: 1.02rem;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.status {
  font-size: 0.73rem;
  font-weight: 750;
}

.status.available {
  color: #a9a1ff;
}

.status.completed {
  color: var(--green);
}

.status.locked {
  color: var(--muted);
}

.day-meta {
  color: var(--muted);
  font-size: 0.72rem;
}

.lock-icon {
  font-size: 0.9rem;
  opacity: 0.75;
}

.settings-panel {
  margin-top: 54px;
  border-radius: 18px;
  box-shadow: none;
}

.settings-panel summary {
  padding: 18px 20px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 700;
}

.settings-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  padding: 20px;
}

.settings-content p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.primary-button,
.ghost-button,
.danger-button,
.back-button {
  border-radius: 12px;
  padding: 11px 17px;
  font-weight: 750;
  cursor: pointer;
}

.primary-button {
  border: 0;
  background: linear-gradient(100deg, var(--primary), #5a87f0);
  box-shadow: 0 10px 28px rgba(89, 76, 224, 0.25);
}

.primary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6);
  opacity: 0.42;
}

.ghost-button,
.back-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.ghost-button.compact {
  padding: 7px 11px;
  color: var(--muted);
  font-size: 0.73rem;
}

.danger-button {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 102, 122, 0.3);
  background: rgba(255, 102, 122, 0.08);
  color: #ff93a1;
}

.back-button {
  margin-bottom: 24px;
  color: var(--muted);
}

.quiz-header {
  margin-bottom: 18px;
  border-radius: 24px;
  padding: clamp(24px, 5vw, 42px);
}

.quiz-header h1 {
  margin-bottom: 20px;
  font-size: clamp(2rem, 5vw, 3.8rem);
}

.lesson-box {
  max-width: 850px;
  border-left: 3px solid var(--primary);
  padding: 5px 0 5px 18px;
  color: #bbc1cf;
  font-size: 1.02rem;
}

.lesson-reader {
  display: grid;
  gap: 24px;
  max-width: 900px;
  margin: 0 0 26px;
}

.lesson-intro {
  border-left: 3px solid var(--primary);
  padding: 3px 0 3px 18px;
  color: #d4d9e6;
  font-size: 1.08rem;
  line-height: 1.75;
}

.lesson-intro p,
.lesson-section p,
.takeaways-box li {
  overflow-wrap: anywhere;
}

.lesson-intro p:last-child,
.lesson-section p:last-child {
  margin-bottom: 0;
}

.lesson-sections {
  display: grid;
  gap: 22px;
}

.lesson-section h2,
.takeaways-box h2 {
  margin: 0 0 10px;
  color: #7eb2ff;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.lesson-section p {
  margin-bottom: 0;
  color: #c3cad8;
  font-size: 1rem;
  line-height: 1.72;
}

.takeaways-box {
  border: 1px solid rgba(77, 149, 255, 0.34);
  border-radius: 18px;
  padding: 20px 22px;
  background: rgba(77, 149, 255, 0.075);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.takeaways-box ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 1.25rem;
}

.takeaways-box li {
  color: #d9e4f8;
  line-height: 1.58;
}

.skip-quiz-link {
  justify-self: start;
  border: 1px solid rgba(154, 143, 255, 0.34);
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(117, 103, 248, 0.12);
  color: #cbc7ff;
  font-size: 0.84rem;
  font-weight: 750;
  text-decoration: none;
}

.skip-quiz-link:hover {
  border-color: rgba(154, 143, 255, 0.62);
  background: rgba(117, 103, 248, 0.18);
}

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

.question-card {
  border-radius: 20px;
  padding: clamp(20px, 4vw, 28px);
  box-shadow: none;
}

.question-index {
  margin-bottom: 8px;
  color: var(--primary-light);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.question-card h3 {
  margin-bottom: 20px;
  font-size: 1.08rem;
  line-height: 1.45;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.choice-button,
.review-choice {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.choice-button {
  width: 100%;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.choice-button:hover {
  border-color: rgba(154, 143, 255, 0.4);
}

.choice-button.selected {
  border-color: var(--primary-light);
  background: rgba(117, 103, 248, 0.13);
}

.choice-letter {
  display: grid;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.78rem;
  font-weight: 850;
}

.choice-button.selected .choice-letter {
  background: var(--primary);
}

.submit-bar {
  position: sticky;
  z-index: 5;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 13px 14px 13px 18px;
  background: rgba(12, 15, 24, 0.93);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(18px);
}

.submit-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.result-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 26px;
  align-items: center;
  margin-bottom: 18px;
  border-radius: 22px;
  padding: 24px;
}

.result-score {
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
  border: 7px solid rgba(53, 212, 154, 0.22);
  border-radius: 50%;
  color: var(--green);
  font-size: 1.55rem;
  font-weight: 850;
}

.result-copy h2 {
  margin-bottom: 8px;
}

.result-copy p {
  margin-bottom: 0;
  color: var(--muted);
}

.review-answer {
  display: grid;
  gap: 8px;
}

.review-choice.correct {
  border-color: rgba(53, 212, 154, 0.35);
  background: rgba(53, 212, 154, 0.07);
}

.review-choice.wrong {
  border-color: rgba(255, 102, 122, 0.35);
  background: rgba(255, 102, 122, 0.07);
}

.review-choice.correct .choice-letter {
  background: rgba(53, 212, 154, 0.2);
  color: var(--green);
}

.review-choice.wrong .choice-letter {
  background: rgba(255, 102, 122, 0.2);
  color: var(--red);
}

.answer-label {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.explanation {
  margin: 16px 0 0;
  border-radius: 12px;
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.035);
  color: #b7bdcb;
  font-size: 0.88rem;
}

.result-badge {
  display: inline-block;
  margin-bottom: 9px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.68rem;
  font-weight: 850;
}

.result-badge.correct {
  background: rgba(53, 212, 154, 0.12);
  color: var(--green);
}

.result-badge.wrong {
  background: rgba(255, 102, 122, 0.12);
  color: var(--red);
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100% - 48px));
  transform: translateY(20px);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px 15px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.hidden {
  display: none !important;
}

.empty-card {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 17px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.login-card {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(28px, 7vw, 48px);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card.register-card {
  width: min(500px, 100%);
}

.login-card h1 {
  margin-bottom: 12px;
  font-size: 2.6rem;
}

.login-card > p:not(.eyebrow) {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.login-form label {
  font-size: 0.78rem;
  font-weight: 750;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.form-error {
  margin: 0;
  color: var(--red);
  font-size: 0.83rem;
}

.field-hint {
  margin-top: -7px;
  color: var(--muted);
  font-size: 0.72rem;
}

.auth-switch {
  margin: 22px 0 0;
  font-size: 0.85rem;
  text-align: center;
}

.auth-switch a {
  color: var(--primary-light);
  font-weight: 750;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.leaderboard-shell {
  padding-top: 50px;
}

.leaderboard-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 34px;
}

.leaderboard-hero h1 {
  margin-bottom: 14px;
}

.leaderboard-hero p:last-child {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
}

.visibility-control {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 13px 15px;
  background: var(--surface);
  cursor: pointer;
}

.visibility-control input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.visibility-control strong,
.visibility-control small {
  display: block;
}

.visibility-control small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.leaderboard-tabs {
  display: inline-flex;
  gap: 5px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 5px;
  background: rgba(18, 22, 35, 0.7);
}

.leaderboard-tab {
  border: 0;
  border-radius: 10px;
  padding: 9px 16px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}

.leaderboard-tab.active {
  background: rgba(117, 103, 248, 0.18);
  color: #cbc7ff;
}

.leaderboard-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.leaderboard-head,
.leaderboard-row {
  display: grid;
  grid-template-columns: 72px minmax(180px, 1.5fr) 100px 130px 100px minmax(160px, 1fr);
  gap: 14px;
  align-items: center;
}

.leaderboard-head {
  border-bottom: 1px solid var(--line);
  padding: 13px 20px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.leaderboard-row {
  position: relative;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.012);
}

.leaderboard-row:last-child {
  border-bottom: 0;
}

.leaderboard-row.top-1 {
  background: linear-gradient(90deg, rgba(255, 195, 70, 0.1), transparent 65%);
}

.leaderboard-row.top-2 {
  background: linear-gradient(90deg, rgba(190, 202, 220, 0.08), transparent 65%);
}

.leaderboard-row.top-3 {
  background: linear-gradient(90deg, rgba(197, 123, 77, 0.09), transparent 65%);
}

.leaderboard-row.current-user::after {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(154, 143, 255, 0.4);
  border-radius: 13px;
  content: "";
  pointer-events: none;
}

.leaderboard-rank {
  font-size: 1.25rem;
}

.leaderboard-member strong,
.leaderboard-member small,
.leaderboard-metric strong,
.leaderboard-metric small {
  display: block;
}

.leaderboard-member strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-member small,
.leaderboard-metric small,
.leaderboard-date {
  color: var(--muted);
  font-size: 0.72rem;
}

.leaderboard-metric strong {
  font-size: 0.9rem;
}

@media (max-width: 850px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .days-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .leaderboard-head,
  .leaderboard-row {
    grid-template-columns: 60px minmax(150px, 1.4fr) 80px 110px 90px minmax(130px, 1fr);
    gap: 9px;
  }
}

@media (max-width: 580px) {
  .site-header,
  .app-shell {
    width: min(100% - 26px, 1180px);
  }

  .site-header {
    padding-top: 16px;
  }

  .brand small,
  .ghost-button.compact {
    display: none;
  }

  .header-link {
    padding: 6px;
    font-size: 0.7rem;
  }

  .account-chip strong {
    max-width: 100px;
  }

  .admin-label-full {
    display: none;
  }

  .admin-label-short {
    display: inline;
  }

  .app-shell {
    padding-top: 42px;
  }

  h1 {
    font-size: 2.45rem;
  }

  .days-grid,
  .choices {
    grid-template-columns: 1fr;
  }

  .day-card {
    min-height: 154px;
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .section-heading {
    align-items: start;
  }

  .unlock-hint {
    display: none;
  }

  .settings-content,
  .submit-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .submit-bar .primary-button {
    width: 100%;
  }

  .result-summary {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .result-score {
    margin: auto;
  }

  .leaderboard-hero {
    align-items: stretch;
    flex-direction: column;
    gap: 22px;
  }

  .visibility-control {
    width: 100%;
  }

  .leaderboard-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .leaderboard-tab {
    padding-inline: 8px;
  }

  .leaderboard-head {
    display: none;
  }

  .leaderboard-row {
    grid-template-columns: 48px 1fr 1fr;
    gap: 12px;
    padding: 17px 15px;
  }

  .leaderboard-rank {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .leaderboard-member {
    grid-column: 2 / 4;
    grid-row: 1;
  }

  .leaderboard-metric[data-label="Jours"] {
    grid-column: 2;
    grid-row: 2;
  }

  .leaderboard-metric[data-label="Score"] {
    grid-column: 3;
    grid-row: 2;
  }

  .leaderboard-metric[data-label="Réussite"] {
    grid-column: 2;
    grid-row: 3;
  }

  .leaderboard-date {
    grid-column: 3;
    grid-row: 3;
  }

  .leaderboard-metric::before,
  .leaderboard-date::before {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.62rem;
    font-weight: 750;
    text-transform: uppercase;
  }

  .leaderboard-date::before {
    content: "Progression";
  }
}
