/* ============================================================
   Part 107 Remote Pilot Study Guide — USWDS-Inspired Styles
   Federal Government Aesthetic
   ============================================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
  --blue-80: #162e51;
  --blue-70: #1a4480;
  --blue-60: #2672de;
  --blue-10: #d9e8f6;
  --blue-5: #e8f0f8;
  --red-50: #d83933;
  --red-10: #f9e6e6;
  --green-50: #008817;
  --green-10: #e5f4e5;
  --yellow-10: #faf3d1;
  --yellow-50: #947100;
  --gray-90: #1b1b1b;
  --gray-70: #565c65;
  --gray-50: #757575;
  --gray-30: #adadad;
  --gray-10: #e6e6e6;
  --gray-5: #f0f0f0;
  --gray-2: #f7f7f7;
  --white: #ffffff;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", Menlo, Courier, monospace;
  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.12);
  --max-width: 1100px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray-90);
  background: var(--gray-5);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a {
  color: var(--blue-70);
  text-underline-offset: 2px;
}
a:hover { color: var(--blue-60); }

h1, h2, h3, h4, h5, h6 {
  color: var(--blue-80);
  line-height: 1.25;
  font-weight: 700;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1rem; }

ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: .35rem; }

code, pre {
  font-family: var(--font-mono);
  background: var(--gray-10);
  border-radius: var(--radius-sm);
}
code { padding: .15em .4em; font-size: .9em; }
pre { padding: 1rem; overflow-x: auto; margin-bottom: 1rem; font-size: .9rem; line-height: 1.5; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
th, td {
  text-align: left;
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--gray-30);
}
th { background: var(--blue-10); color: var(--blue-80); font-weight: 700; font-size: .875rem; text-transform: uppercase; letter-spacing: .02em; }
tr:nth-child(even) td { background: var(--gray-2); }

hr {
  border: 0;
  border-top: 1px solid var(--gray-30);
  margin: 2rem 0;
}

/* --- USA Banner (thin gov-style bar) --- */
.usa-banner {
  background: var(--blue-80);
  color: var(--white);
  font-size: .75rem;
  padding: .4rem 1rem;
  text-align: center;
}
.usa-banner span {
  opacity: .85;
}

/* --- USA Header --- */
.usa-header {
  background: var(--blue-70);
  color: var(--white);
  padding: 1.25rem 1.5rem;
  border-bottom: 4px solid var(--red-50);
}
.usa-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.usa-header .site-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -.01em;
}
.usa-header .site-title:hover { text-decoration: underline; }

.usa-nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.usa-nav a {
  color: var(--white);
  text-decoration: none;
  padding: .4rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s;
}
.usa-nav a:hover,
.usa-nav a.active {
  background: rgba(255,255,255,.15);
}

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Hero Section --- */
.usa-hero {
  background: var(--white);
  border-bottom: 1px solid var(--gray-10);
  padding: 3rem 1.5rem;
  text-align: center;
}
.usa-hero h1 {
  font-size: 2.5rem;
  margin-bottom: .75rem;
}
.usa-hero .subtitle {
  font-size: 1.2rem;
  color: var(--gray-70);
  max-width: 700px;
  margin: 0 auto 1.5rem;
}

/* --- USA Button --- */
.usa-button {
  display: inline-block;
  background: var(--blue-70);
  color: var(--white);
  font-weight: 700;
  font-size: .95rem;
  padding: .7rem 1.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background .15s;
  text-align: center;
}
.usa-button:hover { background: var(--blue-60); color: var(--white); }
.usa-button--outline {
  background: transparent;
  color: var(--blue-70);
  border: 2px solid var(--blue-70);
}
.usa-button--outline:hover { background: var(--blue-5); color: var(--blue-80); }
.usa-button--large { font-size: 1.1rem; padding: .85rem 2rem; }
.usa-button--secondary { background: var(--gray-70); }
.usa-button--secondary:hover { background: var(--gray-90); }

/* --- USA Card --- */
.usa-card-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.usa-card {
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.usa-card:hover { box-shadow: var(--shadow-md); }
.usa-card h3 { margin-bottom: .5rem; }
.usa-card .card-icon {
  font-size: 2rem;
  margin-bottom: .75rem;
  display: block;
}

/* --- Stats Bar --- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.stat-item {
  text-align: center;
  background: var(--white);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-10);
}
.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--blue-70);
  display: block;
}
.stat-label {
  font-size: .85rem;
  color: var(--gray-70);
  margin-top: .25rem;
}

/* --- ACS Area Cards --- */
.acs-weight {
  font-size: .8rem;
  color: var(--gray-70);
  font-weight: 600;
  margin-top: .25rem;
}

/* --- Section --- */
.section {
  padding: 2.5rem 0;
}
.section--white { background: var(--white); }
.section--gray { background: var(--gray-5); }
.section-title {
  text-align: center;
  margin-bottom: 2rem;
}
.section-title h2 { margin-bottom: .5rem; }
.section-title p { color: var(--gray-70); max-width: 650px; margin: 0 auto; }

/* --- Alert Box --- */
.usa-alert {
  padding: 1rem 1.25rem;
  border-left: 4px solid;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: .95rem;
}
.usa-alert--info    { background: var(--blue-5);  border-color: var(--blue-60); }
.usa-alert--warning { background: var(--yellow-10); border-color: var(--yellow-50); }
.usa-alert--success { background: var(--green-10); border-color: var(--green-50); }
.usa-alert--error   { background: var(--red-10);   border-color: var(--red-50); }
.usa-alert h4 { margin-bottom: .35rem; font-size: 1rem; }

/* --- Badge --- */
.usa-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  padding: .15em .6em;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.usa-badge--correct { background: var(--green-10); color: var(--green-50); }
.usa-badge--wrong   { background: var(--red-10);   color: var(--red-50); }
.usa-badge--official { background: var(--blue-10); color: var(--blue-70); }

/* --- Footer --- */
.usa-footer {
  background: var(--blue-80);
  color: var(--white);
  padding: 2.5rem 1.5rem 1.5rem;
  margin-top: 3rem;
}
.usa-footer a { color: var(--blue-10); }
.usa-footer a:hover { color: var(--white); }
.usa-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.usa-footer .disclaimer {
  font-size: .8rem;
  opacity: .7;
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 1rem;
}

/* --- Study Guide Layout --- */
.study-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: start;
}
.study-sidebar {
  position: sticky;
  top: 1rem;
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.study-sidebar h4 {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .75rem;
  color: var(--gray-70);
}
.study-sidebar ul { list-style: none; padding: 0; margin: 0; }
.study-sidebar li { margin-bottom: .15rem; }
.study-sidebar a {
  display: block;
  padding: .4rem .5rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--gray-90);
  border-left: 3px solid transparent;
}
.study-sidebar a:hover,
.study-sidebar a.active {
  background: var(--blue-5);
  border-left-color: var(--blue-70);
  color: var(--blue-70);
}

.study-content section {
  margin-bottom: 2.5rem;
}

/* --- Accordion --- */
.accordion { border: 1px solid var(--gray-10); border-radius: var(--radius-md); margin-bottom: .75rem; overflow: hidden; }
.accordion-header {
  width: 100%;
  text-align: left;
  background: var(--white);
  border: none;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--blue-80);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
}
.accordion-header:hover { background: var(--gray-2); }
.accordion-header::after { content: "+"; font-size: 1.25rem; }
.accordion-header.open::after { content: "−"; }
.accordion-body {
  display: none;
  padding: 0 1.25rem 1.25rem;
  background: var(--white);
}
.accordion-body.open { display: block; }

/* --- Key Fact Box --- */
.key-fact {
  background: var(--blue-5);
  border-left: 4px solid var(--blue-70);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.key-fact strong { color: var(--blue-80); }

/* --- Mnemonic --- */
.mnemonic {
  background: var(--yellow-10);
  border: 1px solid var(--yellow-50);
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--gray-90);
}
.mnemonic::before { content: "🧠 "; }

/* --- METAR Block --- */
.metar-block {
  background: var(--gray-90);
  color: #00ff88;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: .9rem;
  margin-bottom: .75rem;
  overflow-x: auto;
  white-space: pre;
}

/* --- Quiz --- */
.quiz-container {
  max-width: 780px;
  margin: 0 auto;
}

.quiz-progress {
  background: var(--gray-10);
  height: 6px;
  border-radius: 3px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.quiz-progress-bar {
  height: 100%;
  background: var(--blue-70);
  border-radius: 3px;
  transition: width .3s;
}
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
}
.quiz-counter {
  font-weight: 700;
  color: var(--gray-70);
  font-size: .9rem;
}
.quiz-timer {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--blue-80);
  background: var(--blue-5);
  padding: .35rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .95rem;
}
.quiz-timer.warning { color: var(--red-50); background: var(--red-10); }

.quiz-question-card {
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.quiz-question-card h3 { margin-bottom: 1.25rem; }
.quiz-area-tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--blue-10);
  color: var(--blue-70);
  padding: .2em .6em;
  border-radius: 999px;
  margin-bottom: .75rem;
}

.quiz-choices { list-style: none; padding: 0; margin: 0; }
.quiz-choices li { margin-bottom: .6rem; }
.quiz-choices label {
  display: block;
  padding: .85rem 1rem;
  border: 2px solid var(--gray-10);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all .15s;
  font-size: .95rem;
}
.quiz-choices label:hover { border-color: var(--blue-60); background: var(--blue-5); }
.quiz-choices input[type="radio"] { margin-right: .5rem; accent-color: var(--blue-70); }
.quiz-choices input[type="radio"]:checked + span,
.quiz-choices label:has(input:checked) { border-color: var(--blue-70); background: var(--blue-5); }

.quiz-actions { display: flex; gap: .75rem; justify-content: flex-end; }

/* --- Review Mode --- */
.review-item {
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.review-item.correct { border-left: 4px solid var(--green-50); }
.review-item.incorrect { border-left: 4px solid var(--red-50); }
.review-choice {
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  margin: .25rem 0;
}
.review-choice.chosen { background: var(--red-10); }
.review-choice.answer { background: var(--green-10); }

/* --- Results --- */
.results-card {
  text-align: center;
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}
.results-score {
  font-size: 4rem;
  font-weight: 800;
  color: var(--blue-70);
  line-height: 1;
}
.results-pass { color: var(--green-50); }
.results-fail { color: var(--red-50); }
.results-message { font-size: 1.25rem; margin: .75rem 0; font-weight: 600; }
.results-breakdown { text-align: left; max-width: 500px; margin: 1.5rem auto 0; }
.results-breakdown h3 { text-align: center; margin-bottom: 1rem; }
.area-row {
  display: flex;
  justify-content: space-between;
  padding: .5rem 0;
  border-bottom: 1px solid var(--gray-10);
  font-size: .95rem;
}
.area-row:last-child { border-bottom: none; }
.area-score { font-weight: 700; }

/* --- Study Mode Selector --- */
.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}
.mode-card {
  background: var(--white);
  border: 2px solid var(--gray-10);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
}
.mode-card:hover { border-color: var(--blue-60); box-shadow: var(--shadow-md); }
.mode-card.selected { border-color: var(--blue-70); background: var(--blue-5); }
.mode-card h3 { margin-bottom: .5rem; }
.mode-card p { font-size: .9rem; color: var(--gray-70); margin: 0; }

/* --- Filter Chips --- */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}
.filter-chip {
  padding: .35rem .85rem;
  border: 1px solid var(--gray-30);
  border-radius: 999px;
  font-size: .85rem;
  cursor: pointer;
  background: var(--white);
  transition: all .15s;
  font-family: var(--font-sans);
}
.filter-chip:hover { border-color: var(--blue-60); }
.filter-chip.active {
  background: var(--blue-70);
  color: var(--white);
  border-color: var(--blue-70);
}

/* --- Back to top --- */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--blue-70);
  color: var(--white);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  z-index: 100;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }

/* --- FAQ --- */
.faq-item { margin-bottom: .75rem; }
.faq-question {
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--gray-10);
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  color: var(--gray-90);
  display: flex;
  justify-content: space-between;
}
.faq-question:hover { background: var(--gray-2); }
.faq-answer { display: none; padding: 1rem 1.25rem; background: var(--gray-2); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.faq-answer.open { display: block; }

/* --- Checklist --- */
.checklist { list-style: none; padding: 0; }
.checklist li {
  padding: .5rem 0;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.checklist li::before { content: "☐"; font-size: 1.2rem; color: var(--gray-50); }

/* --- Resources --- */
.resource-card {
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.resource-card h4 { margin-bottom: .25rem; }
.resource-card p { margin: 0; font-size: .9rem; color: var(--gray-70); }

/* --- Hidden --- */
.hidden { display: none !important; }

/* --- Spinner --- */
.spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--gray-10);
  border-top-color: var(--blue-70);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Skip Link (accessibility) --- */
.skip-link {
  position: absolute;
  top: -999px;
  left: 1rem;
  background: var(--blue-70);
  color: var(--white);
  padding: .5rem 1rem;
  z-index: 999;
}
.skip-link:focus { top: .5rem; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .study-layout { grid-template-columns: 1fr; }
  .study-sidebar { position: static; margin-bottom: 1.5rem; }
  .study-sidebar ul { display: flex; flex-wrap: wrap; gap: .25rem; }
  .study-sidebar li { margin-bottom: 0; }
}

@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }
  .usa-hero h1 { font-size: 1.85rem; }
  .usa-hero { padding: 2rem 1rem; }
  .usa-card-group { grid-template-columns: 1fr; }
  .mode-selector { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .usa-nav { justify-content: center; }
  .usa-header-inner { justify-content: center; text-align: center; }
  .quiz-actions { flex-direction: column; }
  .quiz-actions .usa-button { width: 100%; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .quiz-question-card { padding: 1.25rem; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .results-score { font-size: 3rem; }
}

/* --- Learning Path / Progress --- */
.progress-overview {
  display: flex;
  gap: .5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.progress-step {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: .75rem .5rem;
  background: var(--white);
  border: 2px solid var(--gray-10);
  border-radius: var(--radius-md);
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-50);
  position: relative;
  transition: all .2s;
}
.progress-step.active {
  border-color: var(--blue-70);
  color: var(--blue-70);
  background: var(--blue-5);
}
.progress-step.done {
  border-color: var(--green-50);
  color: var(--green-50);
  background: var(--green-10);
}
.progress-step .step-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: .25rem;
}

.learn-sidebar {
  position: sticky;
  top: 1rem;
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
}
.learn-sidebar a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  text-decoration: none;
  color: var(--gray-90);
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--gray-10);
  font-size: .9rem;
  transition: all .15s;
}
.learn-sidebar a:last-child { border-bottom: none; }
.learn-sidebar a:hover { background: var(--gray-2); }
.learn-sidebar a.active {
  background: var(--blue-5);
  border-left-color: var(--blue-70);
  color: var(--blue-70);
  font-weight: 600;
}
.learn-sidebar a.done {
  border-left-color: var(--green-50);
}
.learn-sidebar .status {
  font-size: 1rem;
  flex-shrink: 0;
}
.learn-sidebar .score-badge {
  font-size: .7rem;
  background: var(--green-10);
  color: var(--green-50);
  padding: .1em .4em;
  border-radius: 999px;
  margin-left: auto;
}

.module-objectives {
  background: var(--blue-5);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.module-objectives h4 { margin-bottom: .5rem; }
.module-objectives ul { margin-bottom: 0; }
.module-objectives li { font-size: .9rem; }

.section-quiz-block {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--gray-10);
}

.module-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-10);
}

/* --- Flashcards --- */
.flashcard-container {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
.flashcard {
  width: 100%;
  min-height: 220px;
  perspective: 1000px;
  cursor: pointer;
  margin-bottom: 1.5rem;
}
.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 220px;
  transition: transform .5s;
  transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }

.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  min-height: 220px;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  border: 2px solid var(--gray-10);
  background: var(--white);
  box-shadow: var(--shadow-md);
}
.flashcard-front {
  background: var(--blue-5);
  border-color: var(--blue-30);
  color: var(--blue-80);
}
.flashcard-back {
  background: var(--white);
  transform: rotateY(180deg);
  font-size: 1rem;
  text-align: left;
  line-height: 1.5;
}
.flashcard-category {
  display: inline-block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--blue-10);
  color: var(--blue-70);
  padding: .2em .6em;
  border-radius: 999px;
  margin-bottom: .75rem;
}
.flashcard-hint {
  font-size: .75rem;
  color: var(--gray-50);
  margin-top: .5rem;
  font-weight: 400;
}

.flashcard-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.flashcard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: .9rem;
  color: var(--gray-70);
}

.flashcard-stats {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.flashcard-stat {
  text-align: center;
  padding: .75rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: var(--radius-md);
  font-size: .85rem;
}
.flashcard-stat .stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--blue-70);
  display: block;
}

/* --- METAR Decoder --- */
.metar-container { max-width: 780px; margin: 0 auto; }

.metar-display {
  background: var(--gray-90);
  color: #00ff88;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 1.5rem;
  word-break: break-all;
}

.metar-breakdown { margin-bottom: 2rem; }
.metar-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--gray-10);
  align-items: center;
  font-size: .9rem;
}
.metar-row .label {
  font-weight: 700;
  color: var(--blue-70);
  font-family: var(--font-mono);
  font-size: .85rem;
}
.metar-row .value { font-weight: 500; }

.metar-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.metar-input-area {
  margin-bottom: 1.5rem;
}
.metar-input-area textarea {
  width: 100%;
  padding: .75rem;
  font-family: var(--font-mono);
  font-size: .9rem;
  border: 2px solid var(--gray-30);
  border-radius: var(--radius-sm);
  resize: vertical;
}
.metar-input-area textarea:focus {
  outline: none;
  border-color: var(--blue-60);
}

/* --- Quick Reference --- */
.quick-ref-section {
  margin-bottom: 2rem;
  page-break-inside: avoid;
}
.quick-ref-section h3 {
  border-bottom: 2px solid var(--blue-70);
  padding-bottom: .4rem;
  margin-bottom: 1rem;
}
.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .5rem;
}
.ref-item {
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
}
.ref-item .ref-term {
  font-weight: 700;
  color: var(--blue-80);
  font-size: .9rem;
}
.ref-item .ref-def {
  font-size: .85rem;
  color: var(--gray-70);
  margin-top: .15rem;
}

/* --- Print styles --- */
@media print {
  .usa-banner, .usa-header, .usa-nav, .usa-footer, .back-to-top,
  .quiz-actions, .quiz-progress, .study-sidebar, .learn-sidebar,
  .flashcard-actions, .flashcard-nav, .metar-controls,
  .module-nav { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  .container { max-width: 100%; }
  a::after { content: " (" attr(href) ")"; font-size: .8em; }
  .flashcard-inner { transform: none !important; }
  .flashcard-front, .flashcard-back { position: static; backface-visibility: visible; }
  .flashcard-back { display: block; }
  .flashcard { min-height: auto; }
  .quick-ref-section { page-break-inside: avoid; }
}
