* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Georgia, serif;
  background: #f5f5f0;
  color: #1a1a1a;
  line-height: 1.7;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 40px 20px;
}

.screen.active {
  display: block;
}

#screen-auth.active,
#screen-welcome.active {
  padding-top: 16px;
}

.container {
  max-width: 720px;
  margin: 0 auto;
}

h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 12px;
}

h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 20px;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.subtitle {
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 24px;
}

.btn-primary {
  background: #1a3a5c;
  color: white;
  border: none;
  padding: 18px 32px;
  font-size: 1.05rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 28px;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #0f2540;
}

.btn-primary-block {
  align-self: stretch;
  width: 100%;
}

/* ── START BUTTONS (welcome screen) ──────────────────── */
.start-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.start-buttons .btn-primary,
.start-buttons .btn-secondary {
  margin-top: 0;
}

.btn-secondary-block {
  align-self: stretch;
  width: 100%;
}

/* ── AUTH ────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-bottom: 2px solid #d0d0d0;
  justify-content: center;
}

.auth-tab {
  background: transparent;
  border: none;
  padding: 10px 24px;
  font-size: 1rem;
  font-family: Georgia, serif;
  color: #777;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.auth-tab:hover {
  color: #1a3a5c;
}

.auth-tab.active {
  color: #1a3a5c;
  font-weight: 700;
  border-bottom: 3px solid #1a3a5c;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.auth-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #333;
  margin: 22px 0 6px 0;
  text-align: left;
  letter-spacing: 0.02em;
}

.auth-form .auth-label:first-child {
  margin-top: 0;
}

.auth-input {
  padding: 16px 18px;
  font-size: 1.05rem;
  font-family: Georgia, serif;
  border: 1.5px solid #d0d0d0;
  border-radius: 4px;
  background: white;
  color: #1a1a1a;
  transition: border-color 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: #1a3a5c;
}

.auth-error {
  color: #c62828;
  font-size: 0.9rem;
  min-height: 1.2em;
  margin-top: 8px;
}

.auth-success {
  color: #2e7d32;
  font-size: 0.9rem;
  min-height: 1.2em;
  margin-top: 8px;
}

/* ============================================================
   LANDING LAYOUT — auth screen + welcome screen
   ============================================================ */
.landing-container {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 8px;
}

.brand-logo {
  display: block;
  margin: 0 auto 24px auto;
  max-width: 600px;
  width: 100%;
  height: auto;
}

.landing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: stretch;
  max-width: 1200px;
  margin: 0 auto;
}

.landing-left {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  align-self: stretch;
}

.landing-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 0;
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
}

.landing-right .brag-list {
  flex: 1;
  justify-content: space-between;
}

/* ── BRAG STATS ──────────────────────────────────────── */
.brag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brag-item {
  padding: 14px 20px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  border-left: 4px solid #1a3a5c;
}

.brag-headline {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a3a5c;
  margin-bottom: 4px;
  line-height: 1.3;
}

.brag-sub {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;
}

/* ── WELCOME ─────────────────────────────────────────── */
.welcome-info {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.welcome-info:not(.welcome-info-tools) {
  margin-bottom: 18px;
}

.welcome-info-tools {
  flex: 1;
  margin-bottom: 0;
}

.info-item {
  position: relative;
  padding-left: 28px;
  font-size: 1.08rem;
  color: #1a1a1a;
  line-height: 1.5;
}

.info-item strong {
  color: #1a3a5c;
  font-weight: 700;
}

.info-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1a3a5c;
}

.tools-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a3a5c;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #1a3a5c;
}

.btn-signout {
  background: transparent;
  border: 1.5px solid #a0a0a0;
  color: #666;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-signout:hover {
  border-color: #1a3a5c;
  color: #1a3a5c;
}

.btn-signout-floating {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
}

/* ── TEST LAYOUT ─────────────────────────────────────── */
#screen-test {
  padding: 0;
  position: relative;
}

.test-layout {
  display: flex;
  min-height: 100vh;
  margin-right: 0;
  transition: margin-right 0.25s ease-out;
}

.test-layout.calc-open {
  margin-right: var(--calc-width, 520px);
}

.side-panel {
  width: 200px;
  min-width: 200px;
  background: #1a3a5c;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.module-label {
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  padding: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  font-family: Georgia, serif;
}

.timer-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px 14px;
  text-align: center;
}

.timer-box.timer-hidden {
  display: none;
}

.timer-label {
  color: #a0b8d0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.timer-display {
  color: white;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: Georgia, serif;
  letter-spacing: 0.05em;
}

/* ── CALCULATOR BUTTON (in side panel) ───────────────── */
.btn-calculator {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: Georgia, serif;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.btn-calculator:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: white;
}

.btn-calculator.active {
  background: #c9902a;
  border-color: #c9902a;
}

/* ── FORMULA SHEET BUTTON (in side panel) ────────────── */
.btn-formula-sheet {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: Georgia, serif;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.btn-formula-sheet:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: white;
}

.btn-formula-sheet.active {
  background: #c9902a;
  border-color: #c9902a;
}

.side-panel-title {
  color: #a0b8d0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

.q-num-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.q-num-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #a0b8d0;
  background: transparent;
  color: #a0b8d0;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.q-num-btn:hover {
  border-color: white;
  color: white;
}

.q-num-btn.current {
  border-color: white;
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

.q-num-btn.answered {
  border-color: #5bc8a0;
  color: #5bc8a0;
}

.q-num-btn.current.answered {
  background: rgba(91, 200, 160, 0.2);
}

.q-flag {
  position: absolute;
  top: -6px;
  right: -4px;
  font-size: 11px;
  color: #f5a623;
  pointer-events: none;
}

.side-panel-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #a0b8d0;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #5bc8a0;
  display: inline-block;
}

.legend-flag {
  font-size: 11px;
  color: #f5a623;
}

.btn-submit {
  margin-top: auto;
  background: #c9902a;
  color: white;
  border: none;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit:hover {
  background: #a8751f;
}

.btn-exit {
  background: transparent;
  color: #a0b8d0;
  border: 1.5px solid rgba(160, 184, 208, 0.5);
  padding: 8px 14px;
  font-size: 0.82rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-exit:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #a0b8d0;
  color: white;
}

.test-main {
  flex: 1;
  padding: 40px;
  max-width: 760px;
  min-width: 0;
}

.question-counter {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 16px;
}

.question-text {
  font-size: 1.15rem;
  line-height: 1.8;
  margin-bottom: 28px;
  background: white;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.answer-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.choice-btn {
  flex: 1;
  background: white;
  border: 1.5px solid #d0d0d0;
  padding: 14px 20px;
  font-size: 1rem;
  font-family: Georgia, serif;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.choice-btn:hover {
  border-color: #1a3a5c;
  background: #f0f4f8;
}

.choice-btn.selected {
  border-color: #1a3a5c;
  background: #e8f0f8;
  color: #1a3a5c;
}

.choice-btn.struck {
  text-decoration: line-through;
  color: #999;
  background: #f5f5f0;
  opacity: 0.65;
}

.choice-btn.struck:hover {
  border-color: #d0d0d0;
  background: #f5f5f0;
}

.choice-strike {
  width: 38px;
  min-width: 38px;
  background: white;
  border: 1.5px solid #d0d0d0;
  border-radius: 6px;
  font-family: Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  user-select: none;
}

.choice-strike:hover {
  border-color: #c62828;
  color: #c62828;
  background: #fff5f5;
}

.choice-strike.active {
  background: #c62828;
  border-color: #c62828;
  color: white;
}

.choice-strike.active:hover {
  background: #a41f1f;
  border-color: #a41f1f;
}

.choice-btn.correct {
  border-color: #2e7d32;
  background: #e8f5e9;
  color: #1b5e20;
}

.choice-btn.incorrect {
  border-color: #c62828;
  background: #ffebee;
  color: #b71c1c;
}

.choice-btn.reveal {
  border-color: #2e7d32;
  background: #e8f5e9;
  color: #1b5e20;
}

.test-actions {
  margin-top: 20px;
}

.btn-mark {
  background: transparent;
  border: 1.5px solid #a0a0a0;
  color: #666;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-mark:hover {
  border-color: #f5a623;
  color: #c9902a;
}

.btn-mark.marked {
  border-color: #f5a623;
  color: #c9902a;
  background: #fff8ee;
}

.test-nav {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-nav {
  background: white;
  border: 1.5px solid #1a3a5c;
  color: #1a3a5c;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-nav:hover {
  background: #1a3a5c;
  color: white;
}

/* ── DESMOS CALCULATOR PANEL ─────────────────────────── */
.calculator-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 520px;
  max-width: 90vw;
  min-width: 320px;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.18);
  border-left: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease-out;
  z-index: 1000;
}

.calculator-panel.open {
  transform: translateX(0);
}

.calculator-panel.resizing,
.test-layout.resizing {
  transition: none;
}

.calculator-resize-handle {
  position: absolute;
  top: 0;
  left: -4px;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
  background: transparent;
  z-index: 1001;
}

.calculator-resize-handle:hover,
.calculator-panel.resizing .calculator-resize-handle {
  background: rgba(26, 58, 92, 0.25);
}

.calculator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #1a3a5c;
  color: white;
  border-bottom: 1px solid #0f2540;
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
}

.calculator-header.dragging {
  cursor: grabbing;
}

.calculator-title {
  font-family: Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.calculator-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 8px;
  transition: opacity 0.2s;
}

.calculator-close:hover {
  opacity: 0.7;
}

.calculator-mount {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
}

@media (max-width: 700px) {
  .calculator-panel {
    width: 100vw !important;
    max-width: 100vw;
    min-width: 100vw;
  }

  .calculator-resize-handle {
    display: none;
  }

  .test-layout.calc-open {
    margin-right: 0;
  }
}

/* ── FORMULA SHEET (floating draggable window) ───────── */
.formula-sheet-panel {
  position: fixed;
  top: 80px;
  left: 80px;
  width: 780px;
  height: 540px;
  min-width: 320px;
  min-height: 240px;
  background: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
  border: 1px solid #c0c0c0;
  border-radius: 8px;
  display: none;
  flex-direction: column;
  z-index: 1100;
  overflow: hidden;
}

.formula-sheet-panel.open {
  display: flex;
}

.formula-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #1a3a5c;
  color: white;
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
  border-radius: 7px 7px 0 0;
}

.formula-sheet-header.dragging {
  cursor: grabbing;
}

.formula-sheet-title {
  font-family: Georgia, serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.formula-sheet-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  transition: opacity 0.2s;
}

.formula-sheet-close:hover {
  opacity: 0.7;
}

.formula-sheet-body {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: white;
  padding: 12px;
  overflow: auto;
}

.formula-sheet-body svg {
  width: 100%;
  height: 100%;
  display: block;
}

.formula-sheet-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.formula-sheet-resize {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  background: linear-gradient(
    135deg,
    transparent 0%,
    transparent 50%,
    #b0b0b0 50%,
    #b0b0b0 60%,
    transparent 60%,
    transparent 70%,
    #b0b0b0 70%,
    #b0b0b0 80%,
    transparent 80%
  );
  z-index: 1101;
}

@media (max-width: 700px) {
  .formula-sheet-panel {
    left: 10px !important;
    right: 10px !important;
    top: 10px !important;
    width: calc(100vw - 20px) !important;
    height: calc(100vh - 20px) !important;
    max-width: 100vw;
    max-height: 100vh;
  }
  .formula-sheet-resize {
    display: none;
  }
}

/* ── CONFIRMATION ────────────────────────────────────── */
#screen-confirm,
#screen-exit-confirm {
  display: none;
  align-items: center;
  justify-content: center;
}

#screen-confirm.active,
#screen-exit-confirm.active {
  display: flex;
}

.confirm-container {
  background: white;
  border-radius: 12px;
  padding: 48px;
  max-width: 480px;
  width: 100%;
  border: 1px solid #e0e0e0;
  text-align: center;
}

.confirm-text {
  font-size: 1.1rem;
  color: #444;
  margin-bottom: 28px;
  line-height: 1.6;
}

.confirm-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
  text-align: left;
}

.confirm-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  color: #444;
  padding: 10px 16px;
  background: #f5f5f0;
  border-radius: 6px;
}

.confirm-stat span {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a3a5c;
  min-width: 32px;
}

.confirm-stat.warn span {
  color: #c62828;
}

.confirm-stat.flag span {
  color: #c9902a;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-back-confirm {
  background: white;
  border: 1.5px solid #1a3a5c;
  color: #1a3a5c;
  padding: 12px 24px;
  font-size: 1rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back-confirm:hover {
  background: #f0f4f8;
}

.btn-confirm-submit {
  background: #c9902a;
  color: white;
  border: none;
  padding: 12px 28px;
  font-size: 1rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-confirm-submit:hover {
  background: #a8751f;
}

.btn-exit-confirm {
  background: #c62828;
  color: white;
  border: none;
  padding: 12px 28px;
  font-size: 1rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-exit-confirm:hover {
  background: #a41f1f;
}

/* ── BREAK SCREEN ────────────────────────────────────── */
#screen-break {
  display: none;
  align-items: center;
  justify-content: center;
}

#screen-break.active {
  display: flex;
}

.break-container {
  background: white;
  border-radius: 12px;
  padding: 48px;
  max-width: 480px;
  width: 100%;
  border: 1px solid #e0e0e0;
  text-align: center;
}

.break-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.break-text {
  font-size: 1.1rem;
  color: #444;
  margin-bottom: 32px;
  line-height: 1.6;
}

.break-timer-box {
  background: #1a3a5c;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.break-timer-box.timer-hidden {
  display: none;
}

.break-timer-label {
  color: #a0b8d0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.break-timer-display {
  color: white;
  font-size: 3rem;
  font-weight: 700;
  font-family: Georgia, serif;
  letter-spacing: 0.05em;
}

.break-note {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 8px;
}

/* ── RESULTS ─────────────────────────────────────────── */
.score-summary {
  background: white;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 28px;
  border: 1px solid #e0e0e0;
  font-size: 1.1rem;
}

.score-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a3a5c;
  margin-bottom: 8px;
}

.module-scores {
  font-size: 0.9rem;
  color: #777;
  margin-top: 8px;
}

.score-message {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  font-size: 1rem;
  line-height: 1.8;
  color: #444;
  text-align: left;
}

.results-message {
  background: white;
  border-radius: 8px;
  padding: 28px;
  border: 1px solid #e0e0e0;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: #444;
}

.results-watch-inbox {
  font-size: 1.1rem;
  color: #1a3a5c;
}

.results-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-secondary {
  background: white;
  border: 1.5px solid #1a3a5c;
  color: #1a3a5c;
  padding: 14px 32px;
  font-size: 1rem;
  font-family: Georgia, serif;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 24px;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f0f4f8;
}

/* ── TUTORIAL ────────────────────────────────────────── */
.tutorial-progress {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 16px;
}

.tutorial-title {
  font-size: 1.4rem;
  color: #1a3a5c;
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 2px solid #1a3a5c;
}

.tutorial-section {
  margin-bottom: 28px;
}

.content-box {
  background: white;
  border-radius: 8px;
  padding: 24px;
  border: 1px solid #e0e0e0;
  font-size: 1.05rem;
  line-height: 1.8;
}

.tutorial-video-container {
  margin-bottom: 28px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.tutorial-video {
  width: 100%;
  height: 360px;
  border: none;
}

/* ── PRACTICE ────────────────────────────────────────── */
.difficulty-badge-container {
  margin-bottom: 16px;
}

.difficulty-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.difficulty-badge.easy {
  background: #e8f5e9;
  color: #2e7d32;
}

.difficulty-badge.medium {
  background: #fff3e0;
  color: #e65100;
}

.difficulty-badge.hard {
  background: #ffebee;
  color: #c62828;
}

.feedback-box {
  margin-top: 20px;
  padding: 20px 24px;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.7;
}

.feedback-box.correct {
  background: #e8f5e9;
  border-left: 4px solid #2e7d32;
  color: #1b5e20;
}

.feedback-box.incorrect {
  background: #ffebee;
  border-left: 4px solid #c62828;
  color: #7f0000;
}

.loading {
  text-align: center;
  padding: 60px 20px;
  color: #777;
  font-size: 1.1rem;
}

/* ── VISUAL QUESTION CONTAINER ───────────────────────── */
.visual-container {
  margin-bottom: 16px;
  text-align: center;
}

.visual-container svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.inline-desmos-graph {
  width: 100%;
  height: 360px;
  max-width: 600px;
  margin: 0 auto;
  border: 1px solid #1a3a5c;
  border-radius: 4px;
  background: white;
  touch-action: none;
}

.question-body-text {
  font-size: 1.15rem;
  line-height: 1.8;
  margin-top: 4px;
}

#practice-question .visual-container {
  margin-bottom: 14px;
}

/* ============================================================
   MOBILE STYLES (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {

  .screen {
    padding: 24px 14px;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .subtitle {
    font-size: 1rem;
    margin-bottom: 18px;
  }

  .landing-container {
    padding-top: 8px;
  }

  .brand-logo {
    max-width: 380px;
    margin-bottom: 18px;
  }

  .landing-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 480px;
  }

  .landing-left {
    max-width: 100%;
  }

  .landing-right {
    padding-top: 0;
  }

  .brag-list {
    gap: 12px;
  }

  .brag-item {
    padding: 14px 16px;
  }

  .brag-headline {
    font-size: 1.05rem;
  }

  .brag-sub {
    font-size: 0.9rem;
  }

  .btn-signout-floating {
    position: static;
    margin-bottom: 16px;
  }

  .welcome-info {
    gap: 10px;
  }

  .welcome-info:not(.welcome-info-tools) {
    margin-bottom: 14px;
  }

  .info-item {
    font-size: 1rem;
    padding-left: 24px;
  }

  .tools-heading {
    font-size: 0.85rem;
    margin-bottom: 10px;
  }

  .start-buttons {
    margin-top: 16px;
  }

  .test-layout {
    flex-direction: column;
    min-height: 100vh;
  }

  .test-layout.calc-open {
    margin-right: 0;
  }

  .side-panel {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    align-items: center;
  }

  .module-label {
    flex: 0 0 auto;
    font-size: 0.85rem;
    padding: 6px 12px;
    margin: 0;
  }

  .timer-box {
    flex: 1 1 auto;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .timer-label {
    margin-bottom: 0;
    font-size: 0.65rem;
  }

  .timer-display {
    font-size: 1.1rem;
  }

  .btn-calculator,
  .btn-formula-sheet {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .side-panel-title {
    flex: 1 1 100%;
    text-align: center;
    margin-top: 4px;
    font-size: 0.7rem;
  }

  .question-grid {
    flex: 1 1 100%;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
  }

  .q-num-btn {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }

  .side-panel-legend {
    flex: 1 1 100%;
    flex-direction: row;
    justify-content: center;
    gap: 16px;
    margin-top: 4px;
  }

  .btn-submit {
    flex: 1 1 auto;
    margin-top: 6px;
    padding: 10px;
    font-size: 0.9rem;
  }

  .btn-exit {
    flex: 1 1 auto;
    margin-top: 6px;
    padding: 8px;
    font-size: 0.8rem;
  }

  .test-main {
    padding: 20px 14px 40px 14px;
    max-width: 100%;
    width: 100%;
  }

  .question-text {
    font-size: 1rem;
    line-height: 1.7;
    padding: 16px;
    margin-bottom: 20px;
  }

  .question-body-text {
    font-size: 1rem;
    line-height: 1.7;
  }

  .inline-desmos-graph {
    height: 280px;
  }

  .answer-choices {
    gap: 10px;
  }

  .choice-btn {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  .choice-strike {
    width: 34px;
    min-width: 34px;
    font-size: 1rem;
  }

  .test-actions {
    margin-top: 16px;
  }

  .btn-mark {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .test-nav {
    flex-wrap: wrap;
    gap: 8px;
  }

  .btn-nav {
    flex: 1 1 auto;
    padding: 10px 16px;
    font-size: 0.9rem;
    min-width: 110px;
  }

  .confirm-container,
  .break-container {
    padding: 28px 20px;
  }

  .break-timer-display {
    font-size: 2.2rem;
  }

  .confirm-actions {
    flex-direction: column;
  }

  .btn-back-confirm,
  .btn-confirm-submit,
  .btn-exit-confirm {
    width: 100%;
  }

  .results-actions {
    flex-direction: column;
  }

  .btn-secondary,
  .results-actions .btn-primary {
    width: 100%;
    margin-top: 12px;
  }

  .score-number {
    font-size: 2rem;
  }

  .tutorial-video {
    height: 220px;
  }

  .content-box {
    padding: 16px;
    font-size: 1rem;
  }

  .auth-form {
    max-width: 100%;
  }

  .auth-tab {
    padding: 10px 16px;
    font-size: 0.95rem;
  }

  .btn-primary {
    padding: 12px 24px;
    width: 100%;
  }
}

@media (max-width: 380px) {
  .question-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .timer-display {
    font-size: 1rem;
  }

  .module-label {
    font-size: 0.75rem;
    padding: 5px 10px;
  }

  .brand-logo {
    max-width: 260px;
  }
}

/* ── PREREQUISITE DIAGNOSIS (Phase 3 results-screen analysis) ── */
.prereq-diagnosis {
  margin-bottom: 28px;
}

.diag-loading {
  text-align: center;
  padding: 28px 20px;
  color: #777;
  font-size: 1rem;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.diag-card {
  background: white;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  border-top: 4px solid #1a3a5c;
  padding: 28px;
}

.diag-card.diag-clean {
  border-top-color: #2e7d32;
  text-align: center;
}

/* Mastery headline — the big reassuring number */
.diag-mastery {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.diag-mastery-num {
  font-size: 3rem;
  font-weight: 700;
  color: #1a3a5c;
  line-height: 1;
  flex: 0 0 auto;
}

.diag-mastery-label {
  font-size: 1.05rem;
  color: #444;
  line-height: 1.4;
}

.diag-headline {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2e7d32;
  margin-bottom: 12px;
}

.diag-lede {
  font-size: 1.02rem;
  line-height: 1.75;
  color: #444;
  margin-bottom: 4px;
}

.diag-lede strong {
  color: #1a3a5c;
}

/* Ranked gap list */
.diag-gaps-title {
  margin-top: 24px;
  margin-bottom: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1a3a5c;
  padding-bottom: 8px;
  border-bottom: 2px solid #d4a04a;
}

.diag-gaps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.diag-gap {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 18px;
  background: #f5f5f0;
  border-radius: 8px;
  border-left: 4px solid #c65d4e;
}

.diag-gap-rank {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1a3a5c;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diag-gap-body {
  flex: 1;
  min-width: 0;
}

.diag-gap-name {
  font-size: 1.08rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.4;
  margin-bottom: 4px;
}

.diag-gap-desc {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 6px;
}

.diag-gap-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: #c65d4e;
  letter-spacing: 0.02em;
}

.diag-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e0e0e0;
  font-size: 1rem;
  line-height: 1.75;
  color: #444;
}

@media (max-width: 768px) {
  .diag-card {
    padding: 18px;
  }
  .diag-mastery {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }
  .diag-mastery-num {
    font-size: 2.4rem;
  }
  .diag-mastery-label {
    font-size: 0.95rem;
  }
  .diag-gap {
    gap: 12px;
    padding: 14px;
  }
  .diag-gap-rank {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }
  .diag-gap-name {
    font-size: 1rem;
  }
}

/* ── TEASER: locked/blurred gaps + CTA ──────────────── */
.diag-locked {
  position: relative;
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
}

.diag-locked-blur {
  filter: blur(5px);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

.diag-gap-ghost {
  border-left-color: #a0a0a0;
}

.diag-locked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(245, 245, 240, 0.35);
}

.diag-lock-icon {
  font-size: 1.1rem;
}

.diag-locked-text {
  font-size: 1.02rem;
  font-weight: 700;
  color: #1a3a5c;
  letter-spacing: 0.01em;
}

.diag-cta {
  margin-top: 22px;
  width: 100%;
}
/* ──────────────────────────────────────────────────────────────
   APPEND THIS TO style.css
   (CSS for the new two-tier diagnosis layout: foundational + specific
    gaps with two CTA buttons. Existing .diag-card styles remain in use.)
   ────────────────────────────────────────────────────────────── */

/* ──────────────────────────────────────────────────────────────
   APPEND THIS TO style.css
   (CSS for the new two-tier diagnosis layout: foundational + specific
    gaps with two CTA buttons. Existing .diag-card styles remain in use.)
   ────────────────────────────────────────────────────────────── */

.diag-section {
  margin-top: 18px;
  padding: 14px 16px;
  background: #fafafa;
  border-left: 3px solid #1a3a5c;
  border-radius: 0 8px 8px 0;
}

.diag-section-locked {
  background: #fff8e1;
  border-left-color: #c9902a;
}

.diag-section-locked .diag-section-label {
  color: #8a6515;
}

.diag-locked-message {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #5d4037;
}

.diag-section:first-of-type {
  margin-top: 14px;
}

.diag-section-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #1a3a5c;
  font-weight: 700;
  margin-bottom: 10px;
}

.diag-gap-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 4px 0;
  font-size: 0.98rem;
  line-height: 1.4;
}

.diag-gap-line .diag-gap-name {
  font-weight: 600;
  color: #1a1a1a;
}

.diag-gap-line .diag-gap-count {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

.diag-more {
  font-size: 0.85rem;
  color: #c9902a;
  font-style: italic;
}

.diag-more-block {
  margin-top: 8px;
}

.diag-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.diag-cta-row .diag-cta {
  flex: 1 1 240px;
  min-width: 0;
}

.diag-cta-ack {
  margin-top: 14px;
  padding: 12px 16px;
  background: #e8f5e9;
  border-left: 4px solid #2e7d32;
  border-radius: 0 6px 6px 0;
  color: #1f5e22;
  font-size: 0.92rem;
  line-height: 1.5;
}

.diag-footer {
  margin-top: 18px;
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
  text-align: center;
}
/* Tighter brag list on desktop */
.landing-right .brag-list {
  gap: 8px;
}

/* ── TEST HISTORY SECTION ───────────────────────────── */
.test-history-section {
  margin-top: 28px;
  padding-bottom: 24px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.test-history-heading {
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  color: #1a3a5c !important;
  text-transform: uppercase !important;
  letter-spacing: 0.07em !important;
  text-align: center !important;
  margin: 0 0 12px !important;
  padding: 0 !important;
  border: none !important;
}

.test-history-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.btn-test-history {
  background: #1a3a5c !important;
  color: #fff !important;
  border: none !important;
  border-radius: 4px;
  padding: 13px 24px !important;
  font-family: Georgia, serif !important;
  font-size: 1rem !important;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  margin-top: 0 !important;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-test-history:hover {
  background: #122a44 !important;
}
/* ── RESULTS SCREEN REDESIGN ────────────────────────── */
.results-untimed-banner {
  background: #fff8ee;
  border-left: 4px solid #c9902a;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 6px;
  font-size: 0.92rem;
  color: #8a6515;
  text-align: left;
}

.score-label {
  font-size: 1rem;
  color: #555;
  margin-top: 4px;
}

.results-prev-score {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #555;
  padding-top: 10px;
  border-top: 1px solid #e0e0e0;
  line-height: 1.5;
}

/* Tighter score card — the number is the hero, nothing else competes */
.score-summary {
  text-align: center;
  padding: 20px 24px;
}

.score-number {
  font-size: 3.2rem;
  line-height: 1;
  margin-bottom: 6px;
}
/* ── TIER CARDS (Spectrum-style) ────────────────────── */
#tier-options {
  max-width: 720px;
  margin: 24px auto 0;
}

.tc-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a3a5c;
  margin-bottom: 6px;
  font-family: Georgia, serif;
}

.tc-sub {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 18px;
  line-height: 1.5;
}

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

.tc-card {
  background: #fff;
  border: 1.5px solid #d8d8d0;
  border-radius: 10px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.tc-card-featured {
  border-color: #1a3a5c;
  border-width: 2px;
  box-shadow: 0 4px 16px rgba(26,58,92,0.12);
}

.tc-card-owned {
  border-color: #1a7a4c;
  background: #f4fbf6;
}

.tc-card-soon {
  opacity: 0.65;
}

.tc-popular-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a3a5c;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 12px;
  border-radius: 20px;
  white-space: nowrap;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
}

.tc-owned-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a7a4c;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 12px;
  border-radius: 20px;
  white-space: nowrap;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
}

.tc-coming-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: #999;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 12px;
  border-radius: 20px;
  white-space: nowrap;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
}

.tc-tier-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  margin-bottom: 4px;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
}

.tc-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
  line-height: 1.3;
  font-family: Georgia, serif;
}

.tc-price {
  font-size: 2rem;
  font-weight: 700;
  color: #1a3a5c;
  line-height: 1;
  margin-bottom: 10px;
  font-family: Georgia, serif;
}

.tc-once {
  font-size: 0.85rem;
  font-weight: 400;
  color: #888;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
}

.tc-pitch {
  font-size: 0.9rem;
  color: #444;
  line-height: 1.45;
  margin-bottom: 12px;
  font-style: italic;
}

.tc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.tc-list li {
  font-size: 0.88rem;
  color: #333;
  padding-left: 18px;
  position: relative;
  line-height: 1.4;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
}

.tc-list li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: #1a3a5c;
  font-weight: 700;
}

.tc-action {
  margin-top: auto;
  padding-top: 4px;
}

.tc-btn {
  display: block;
  width: 100%;
  padding: 11px 16px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  border: none;
  font-family: Georgia, serif;
  transition: background 0.2s;
}

.tc-btn-buy {
  background: #1a3a5c;
  color: #fff;
}

.tc-btn-buy:hover {
  background: #122a44;
}

.tc-btn-owned {
  background: #1a7a4c;
  color: #fff;
  cursor: default;
}

.tc-btn-soon {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
}

/* Stack cards on narrow screens */
@media (max-width: 680px) {
  .tc-grid {
    grid-template-columns: 1fr;
  }
  .tc-price {
    font-size: 1.7rem;
  }
}