/* =====================================================
   GOOGLE IT CERT STUDY GUIDE - SHARED STYLESHEET
   ===================================================== */

:root {
  --bg-0: #0d1117;
  --bg-1: #161b22;
  --bg-2: #21262d;
  --bg-3: #2d333b;
  --border: #30363d;
  --border-muted: #21262d;

  --text-0: #e6edf3;
  --text-1: #adbac7;
  --text-2: #768390;
  --text-3: #545d68;

  --accent: #0891b2;
  --accent-light: #22d3ee;
  --accent-dim: rgba(8, 145, 178, 0.12);

  --success: #3fb950;
  --warning: #d29922;
  --danger:  #f85149;

  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', ui-monospace, monospace;

  --nav-h: 52px;
  --max-w: 920px;
  --r: 6px;
  --r-lg: 10px;
}

/* ── Course accent overrides ──────────────────────── */
[data-course="01"] { --accent: #7c3aed; --accent-light: #a78bfa; --accent-dim: rgba(124,58,237,.12); }
[data-course="02"] { --accent: #0891b2; --accent-light: #22d3ee; --accent-dim: rgba(8,145,178,.12); }
[data-course="03"] { --accent: #059669; --accent-light: #34d399; --accent-dim: rgba(5,150,105,.12); }
[data-course="04"] { --accent: #b45309; --accent-light: #fbbf24; --accent-dim: rgba(180,83,9,.12); }
[data-course="05"] { --accent: #b91c1c; --accent-light: #f87171; --accent-dim: rgba(185,28,28,.12); }

/* =====================================================
   RESET & BASE
   ===================================================== */

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--font-body);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =====================================================
   NAVIGATION
   ===================================================== */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-0);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -.01em;
}
.nav-logo:hover { color: var(--accent-light); text-decoration: none; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.125rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  display: block;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  color: var(--text-2);
  border-radius: var(--r);
  white-space: nowrap;
  transition: background .14s, color .14s;
}
.nav-links a:hover { background: var(--bg-2); color: var(--text-1); text-decoration: none; }
.nav-links a.active { background: var(--accent-dim); color: var(--accent-light); }

/* =====================================================
   PAGE WRAPPER
   ===================================================== */

.page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

/* =====================================================
   INDEX - HERO
   ===================================================== */

.hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-0);
  margin-bottom: 0.6rem;
}

.hero p {
  font-size: 0.95rem;
  color: var(--text-2);
  max-width: 520px;
}

/* =====================================================
   INDEX - COURSE CARDS
   ===================================================== */

.course-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.course-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.4rem 1.4rem 1.25rem;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .15s;
}

.course-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--card-color, #444);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.course-card:hover {
  border-color: var(--card-color, var(--border));
  transform: translateY(-1px);
}

.card-num {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--card-color, var(--text-2));
  margin-bottom: 0.35rem;
}

.course-card h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.course-card .desc {
  font-size: 0.83rem;
  color: var(--text-2);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  font-size: 0;
  border-radius: var(--r-lg);
}
.card-link:hover { text-decoration: none; }

/* Progress bar */
.progress-wrap { flex: 1; min-width: 0; }

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-3);
  margin-bottom: 0.3rem;
}

.progress-track {
  height: 4px;
  background: var(--bg-3);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--card-color, var(--accent));
  border-radius: 99px;
  width: 0%;
  transition: width .5s ease;
}

/* =====================================================
   COURSE PAGE HEADER
   ===================================================== */

.course-header {
  padding: 2.5rem 0 1.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.course-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent-light);
  background: var(--accent-dim);
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  margin-bottom: 0.65rem;
}

.course-header h1 {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-0);
  margin-bottom: 0.45rem;
}

.course-header .subtitle {
  font-size: 0.9rem;
  color: var(--text-2);
}

/* =====================================================
   ACCORDION SECTIONS
   ===================================================== */

.section-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.topic-section {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color .2s;
}

.topic-section.complete {
  border-color: var(--accent);
  border-left-width: 3px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  user-select: none;
  gap: 0.75rem;
  transition: background .14s;
}
.section-header:hover { background: var(--bg-2); }

.section-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}

.chevron {
  font-size: 0.6rem;
  color: var(--text-3);
  transition: transform .2s ease, color .15s;
  flex-shrink: 0;
  line-height: 1;
}

.topic-section.open .chevron {
  transform: rotate(90deg);
  color: var(--accent-light);
}

.section-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-0);
  line-height: 1.3;
}

/* Completion checkbox */
.complete-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  cursor: pointer;
}

.complete-wrap span {
  font-size: 0.75rem;
  color: var(--text-3);
}

.complete-cb {
  -webkit-appearance: none;
  appearance: none;
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: background .14s, border-color .14s;
  position: relative;
  flex-shrink: 0;
}

.complete-cb:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.complete-cb:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding-top: 1px;
}

/* Accordion content */
.section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.section-inner {
  padding: 0 1.4rem 1.4rem;
  border-top: 1px solid var(--border-muted);
}

/* =====================================================
   SECTION CONTENT ELEMENTS
   ===================================================== */

.subsection {
  margin-top: 1.4rem;
}

.subsection-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent-light);
  margin-bottom: 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-muted);
}

/* Bullet list */
.concept-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.concept-list li {
  font-size: 0.875rem;
  color: var(--text-1);
  padding-left: 1.15rem;
  position: relative;
  line-height: 1.55;
}

.concept-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 0.12em;
  color: var(--accent-light);
  font-size: 0.65rem;
}

.concept-list li strong { color: var(--text-0); }
.concept-list li code  { font-size: 0.82em; }

/* Note / callout */
.note {
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 0.55rem 0.9rem;
  font-size: 0.855rem;
  color: var(--text-1);
  margin-top: 0.75rem;
  line-height: 1.55;
}
.note strong { color: var(--accent-light); }

/* Term/definition grid */
.term-grid { display: flex; flex-direction: column; gap: 0; }

.term-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 0.75rem;
  padding: 0.42rem 0.5rem;
  border-bottom: 1px solid var(--border-muted);
  font-size: 0.86rem;
}
.term-row:last-child { border-bottom: none; }

.term-key {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-0);
}

.term-val { color: var(--text-1); line-height: 1.5; }

/* Layer / reference tables */
.layer-table,
.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.845rem;
  margin-top: 0.5rem;
}

.layer-table th,
.ref-table th {
  background: var(--bg-2);
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 0.45rem 0.7rem;
  text-align: left;
  border: 1px solid var(--border);
}

.layer-table td,
.ref-table td {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border-muted);
  color: var(--text-1);
  vertical-align: top;
  line-height: 1.45;
}

.layer-table tr:hover td,
.ref-table tr:hover td { background: var(--bg-2); }

.layer-num {
  font-family: var(--font-mono);
  color: var(--accent-light);
  font-weight: 700;
  font-size: 0.82rem;
}

.ref-table td:first-child {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-light);
  white-space: nowrap;
}

/* Protocol tags */
.tag {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.1rem 0.42rem;
  border-radius: 99px;
  font-weight: 700;
  font-family: var(--font-mono);
  vertical-align: middle;
  margin-left: 0.2rem;
}
.tag-tcp  { background: rgba(59,130,246,.15); color: #60a5fa; }
.tag-udp  { background: rgba(245,158,11,.15); color: #fbbf24; }
.tag-both { background: rgba(99,102,241,.15); color: #a5b4fc; }
.tag-section { background: rgba(8,145,178,.15); color: #22d3ee; font-family: var(--font-body); font-size: 0.65rem; font-weight: 600; letter-spacing: 0.01em; }

/* Code & commands */
code {
  font-family: var(--font-mono);
  font-size: 0.83em;
  background: var(--bg-3);
  color: var(--accent-light);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

pre.cmd-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.875rem 1rem;
  margin-top: 0.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.845rem;
  line-height: 1.75;
  color: var(--text-0);
}

pre.cmd-block .c { color: #6e7681; }  /* comment */
pre.cmd-block .k { color: #79c0ff; }  /* keyword/command */
pre.cmd-block .f { color: #d2a8ff; }  /* flag */
pre.cmd-block .v { color: #56d364; }  /* value */

/* Math / formula blocks */
.math-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.9rem 1.1rem;
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--text-1);
  line-height: 2;
}

.math-block .label {
  color: var(--text-3);
  display: inline-block;
  min-width: 210px;
}

.math-block .val { color: var(--accent-light); }

/* Example box */
.example-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 0.75rem 1rem;
  margin-top: 0.6rem;
  font-size: 0.875rem;
}

.example-box .ex-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--warning);
  margin-bottom: 0.4rem;
}

/* =====================================================
   PRACTICE QUESTIONS
   ===================================================== */

.practice-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-muted);
}

.practice-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 0.4rem 0.9rem;
  border-radius: var(--r);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background .14s, color .14s, border-color .14s;
}
.practice-btn:hover,
.practice-btn.open {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-light);
}

.practice-btn .arr { font-size: 0.6rem; transition: transform .2s; }
.practice-btn.open .arr { transform: rotate(90deg); }

.practice-body { display: none; margin-top: 1rem; }
.practice-body.open { display: block; }

.q-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  counter-reset: q;
}

.q-list li {
  font-size: 0.875rem;
  color: var(--text-1);
  padding: 0.65rem 0.9rem 0.65rem 2.2rem;
  background: var(--bg-2);
  border-radius: var(--r);
  border-left: 2px solid var(--border);
  counter-increment: q;
  position: relative;
  line-height: 1.5;
}

.q-list li::before {
  content: counter(q);
  position: absolute;
  left: 0.6rem;
  top: 0.65rem;
  width: 18px;
  height: 18px;
  background: var(--bg-3);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-light);
  text-align: center;
  line-height: 18px;
}

.ans-btn {
  margin-top: 0.9rem;
  background: none;
  border: none;
  font-size: 0.78rem;
  color: var(--text-3);
  cursor: pointer;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0;
  transition: color .14s;
}
.ans-btn:hover { color: var(--text-2); }
.ans-btn .arr { font-size: 0.6rem; transition: transform .2s; }
.ans-btn.open .arr { transform: rotate(90deg); }

.ans-body { display: none; margin-top: 0.65rem; }
.ans-body.open { display: block; }

.a-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  counter-reset: a;
}

.a-list li {
  font-size: 0.845rem;
  color: var(--text-2);
  padding-left: 1.5rem;
  position: relative;
  counter-increment: a;
  line-height: 1.5;
}

.a-list li::before {
  content: counter(a) '.';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
  font-size: 0.78rem;
}

/* =====================================================
   STUB PAGES
   ===================================================== */

.stub-box {
  background: var(--bg-1);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 2rem;
  text-align: center;
}

.stub-box .stub-icon { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--text-3); }
.stub-box p { font-size: 0.875rem; color: var(--text-3); }

/* =====================================================
   FOOTER
   ===================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  text-align: center;
  color: var(--text-3);
  font-size: 0.75rem;
}

/* =====================================================
   DAILY QUESTION WIDGET
   ===================================================== */

.dq-widget {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.4rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.dq-widget::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--dq-color, var(--accent));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.dq-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
}

.dq-chevron {
  font-size: 0.6rem;
  color: var(--text-3);
  margin-left: auto;
  line-height: 1;
  transition: transform .2s ease, color .15s;
}

.dq-widget.open .dq-chevron {
  transform: rotate(90deg);
  color: var(--dq-color, var(--accent-light));
}

.dq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-top: 0;
}

.dq-widget.open .dq-body {
  padding-top: 0.9rem;
}

.dq-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--dq-color, var(--accent-light));
  background: color-mix(in srgb, var(--dq-color, var(--accent)) 15%, transparent);
  padding: 0.18rem 0.6rem;
  border-radius: 99px;
}

.dq-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
}

.dq-q {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-0);
  line-height: 1.5;
  margin-bottom: 0.9rem;
}

.dq-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dq-option {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-1);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.855rem;
  padding: 0.55rem 0.85rem;
  text-align: left;
  transition: background .12s, border-color .12s, color .12s;
  line-height: 1.45;
}

.dq-option:hover:not(:disabled) {
  background: var(--bg-3);
  border-color: var(--dq-color, var(--accent));
  color: var(--text-0);
}

.dq-option:disabled { cursor: default; }

.dq-option.correct {
  background: rgba(63,185,80,.12);
  border-color: var(--success);
  color: var(--success);
}

.dq-option.wrong {
  background: rgba(248,81,73,.1);
  border-color: var(--danger);
  color: var(--danger);
}

.dq-option.revealed {
  background: rgba(63,185,80,.07);
  border-color: var(--success);
  color: var(--success);
}

.dq-explanation {
  display: none;
  margin-top: 0.75rem;
  background: var(--accent-dim);
  border-left: 3px solid var(--dq-color, var(--accent));
  border-radius: 0 var(--r) var(--r) 0;
  padding: 0.55rem 0.9rem;
  font-size: 0.845rem;
  color: var(--text-1);
  line-height: 1.55;
}

.dq-explanation.visible { display: block; }

.dq-done-msg {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: var(--text-3);
}

/* =====================================================
   IPv6 COMPRESSION TOOL
   ===================================================== */

.ipv6-group-display {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.75rem 1rem;
  margin-top: 0.6rem;
  letter-spacing: 0.03em;
  word-break: break-all;
  line-height: 1.8;
}

.ipv6-group.lz { color: var(--warning); }
.ipv6-group.az { color: var(--accent-light); }
.ipv6-sep { color: var(--text-3); }

.ipv6-legend {
  display: flex;
  gap: 1.1rem;
  margin-top: 0.5rem;
  font-size: 0.78rem;
}

.ipv6-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-2);
}

.ipv6-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ipv6-quiz-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.ipv6-quiz-bar-track {
  flex: 1;
  height: 5px;
  background: var(--bg-3);
  border-radius: 99px;
  overflow: hidden;
}

.ipv6-quiz-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .4s ease;
}

.ipv6-quiz-bar-label {
  font-size: 0.75rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.ipv6-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.ipv6-input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.5rem 0.75rem;
  color: var(--text-0);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  outline: none;
  transition: border-color .14s;
}
.ipv6-input:focus { border-color: var(--accent); }
.ipv6-input:disabled { opacity: .6; }

.ipv6-submit-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--r);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: var(--font-body);
  white-space: nowrap;
  transition: opacity .14s;
}
.ipv6-submit-btn:hover { opacity: .85; }
.ipv6-submit-btn:disabled { opacity: .45; cursor: default; }

.ipv6-feedback {
  margin-top: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--r);
  font-size: 0.875rem;
  line-height: 1.6;
  display: none;
}
.ipv6-feedback.correct {
  background: rgba(63,185,80,.1);
  border-left: 3px solid var(--success);
  color: var(--success);
  display: block;
}
.ipv6-feedback.wrong {
  background: rgba(248,81,73,.1);
  border-left: 3px solid var(--danger);
  color: var(--text-1);
  display: block;
}

.ipv6-feedback .correct-ans {
  font-family: var(--font-mono);
  color: var(--accent-light);
  font-weight: 600;
}

.ipv6-feedback .fb-step {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-2);
  margin-top: 0.35rem;
}
.ipv6-feedback .fb-step strong { color: var(--text-0); font-family: var(--font-body); }

.ipv6-next-btn {
  display: none;
  margin-top: 0.65rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-1);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .14s, border-color .14s, color .14s;
}
.ipv6-next-btn:hover { background: var(--bg-3); border-color: var(--accent); color: var(--accent-light); }
.ipv6-next-btn.visible { display: inline-block; }

.ipv6-quiz-area.hidden { display: none; }

.ipv6-score-box {
  display: none;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.4rem;
  text-align: center;
}
.ipv6-score-box.visible { display: block; }

.ipv6-score-num {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-0);
  font-family: var(--font-mono);
  line-height: 1;
}

.ipv6-score-label {
  font-size: 0.85rem;
  color: var(--text-2);
  margin-top: 0.4rem;
  margin-bottom: 1rem;
}

.ipv6-restart-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--r);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity .14s;
}
.ipv6-restart-btn:hover { opacity: .85; }

/* =====================================================
   QUIZ ME - FLASHCARD MODAL
   ===================================================== */

.quiz-me-btn {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent-light);
  padding: 0.4rem 0.9rem;
  border-radius: var(--r);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background .14s;
  margin-left: 0.5rem;
}
.quiz-me-btn:hover { background: var(--accent-dim); }

.quiz-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.quiz-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.quiz-modal {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 580px;
  padding: 1.75rem;
  position: relative;
  transform: translateY(14px);
  transition: transform .2s ease;
}
.quiz-overlay.open .quiz-modal { transform: translateY(0); }

.quiz-close-btn {
  position: absolute;
  top: 0.85rem;
  right: 0.9rem;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border-radius: var(--r);
  transition: color .14s, background .14s;
}
.quiz-close-btn:hover { color: var(--text-1); background: var(--bg-3); }

.quiz-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.quiz-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent-light);
  white-space: nowrap;
}

.quiz-progress-track {
  flex: 1;
  height: 4px;
  background: var(--bg-3);
  border-radius: 99px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .3s ease;
}

.quiz-counter {
  font-size: 0.72rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.quiz-question-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-0);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  min-height: 2.5rem;
}

.quiz-answer-area {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 0.75rem 1rem;
  font-size: 0.885rem;
  color: var(--text-1);
  line-height: 1.6;
  margin-bottom: 1.1rem;
  display: none;
}
.quiz-answer-area.visible { display: block; }

.quiz-actions { display: flex; gap: 0.6rem; }

.quiz-reveal-btn {
  flex: 1;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent-light);
  padding: 0.6rem 1rem;
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .14s, color .14s;
}
.quiz-reveal-btn:hover { background: var(--accent); color: #fff; }

.quiz-grade-row {
  display: none;
  gap: 0.6rem;
  width: 100%;
}
.quiz-grade-row.visible { display: flex; }

.quiz-got-it-btn {
  flex: 1;
  background: rgba(63, 185, 80, .12);
  border: 1px solid var(--success);
  color: var(--success);
  padding: 0.6rem 1rem;
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .14s;
}
.quiz-got-it-btn:hover { background: rgba(63, 185, 80, .25); }

.quiz-missed-btn {
  flex: 1;
  background: rgba(248, 81, 73, .1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.6rem 1rem;
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .14s;
}
.quiz-missed-btn:hover { background: rgba(248, 81, 73, .22); }

.quiz-score-screen {
  display: none;
  text-align: center;
  padding: 1.25rem 0 0.5rem;
}
.quiz-score-screen.visible { display: block; }

.quiz-score-nums { line-height: 1; margin-bottom: 0.6rem; }

.quiz-score-num {
  font-size: 3.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-0);
}

.quiz-score-denom {
  font-size: 1.6rem;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.quiz-score-msg {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 0.25rem;
}

.quiz-score-label {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 1.5rem;
}

.quiz-retry-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--r);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1.75rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity .14s;
}
.quiz-retry-btn:hover { opacity: .85; }

/* =====================================================
   RAPID FIRE QUIZ PAGE
===================================================== */
.rf-setup {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
}

.rf-setup-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 1rem;
}

.rf-count-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.rf-count-btn {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  padding: 0.55rem 1.6rem;
  border-radius: var(--r);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color .14s, color .14s, background .14s;
}
.rf-count-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.rf-count-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-light);
}

.rf-start-btn {
  display: block;
  width: 100%;
  max-width: 220px;
  margin: 0 auto 1.1rem;
  background: var(--accent);
  border: none;
  border-radius: var(--r);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity .14s;
}
.rf-start-btn:hover { opacity: .85; }

.rf-pool-label {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-bottom: 0.4rem;
}

.rf-dashboard-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  padding: 0.9rem 1.25rem;
  color: var(--accent-light);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 1.75rem;
  transition: background .14s;
}
.rf-dashboard-btn:hover { background: rgba(var(--accent-rgb, 8,145,178), .22); }
.rf-dashboard-arrow { font-size: 1rem; }

.rf-hint {
  font-size: 0.72rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  opacity: 0.7;
}

.rf-card-wrap,
.rf-score-wrap {
  max-width: 620px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.rf-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.75rem;
}

.rf-quit-btn {
  display: block;
  margin: 0.9rem auto 0;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 0.78rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color .14s;
}
.rf-quit-btn:hover { color: var(--text-1); }

.rf-score-btns {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.rf-new-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-1);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1.75rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity .14s;
}
.rf-new-btn:hover { opacity: .8; }

/* ─── Mode toggle (Flashcards / Multiple Choice) ───── */
.rf-mode-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.rf-mode-btn {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 0.45rem 1.25rem;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color .14s, color .14s, background .14s;
}
.rf-mode-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.rf-mode-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-light);
}

/* ─── MC option buttons ─────────────────────────────── */
.mc-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.mc-option-btn {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-1);
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.875rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color .14s, background .14s, color .14s;
  line-height: 1.45;
}
.mc-option-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-light);
  background: var(--accent-dim);
}
.mc-option-btn:disabled { cursor: default; }
.mc-option-btn.correct {
  background: rgba(63,185,80,.15);
  border-color: var(--success);
  color: var(--success);
}
.mc-option-btn.wrong {
  background: rgba(248,81,73,.12);
  border-color: var(--danger);
  color: var(--danger);
}

/* ─── MC explanation + next ─────────────────────────── */
.mc-explanation {
  display: none;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 0.82rem;
  color: var(--text-1);
  line-height: 1.55;
}
.mc-explanation.visible { display: block; }

.mc-next-btn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  background: var(--accent);
  border: none;
  border-radius: var(--r);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity .14s;
}
.mc-next-btn:hover { opacity: .85; }

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 700px) {
  .course-grid { grid-template-columns: 1fr; }

  .term-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .term-val { color: var(--text-2); }

  .layer-table, .ref-table { font-size: 0.8rem; }
  .layer-table th, .ref-table th,
  .layer-table td, .ref-table td { padding: 0.35rem 0.5rem; }

  .section-header h2 { font-size: 0.88rem; }
  .complete-wrap span { display: none; }

  .page-wrap { padding: 1.25rem 1rem 4rem; }
  .hero h1 { font-size: 1.45rem; }
  .course-header h1 { font-size: 1.35rem; }

  .math-block .label { min-width: auto; display: block; }

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

/* =====================================================
   RESOURCES PAGE
   ===================================================== */

.nav-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  flex-shrink: 0;
  align-self: center;
  margin: 0 0.25rem;
  list-style: none;
}

.resources-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.resource-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.4rem 1.4rem 1.25rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .2s, transform .15s;
}

.resource-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.resource-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.resource-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent-light);
  background: var(--accent-dim);
  padding: 0.18rem 0.6rem;
  border-radius: 99px;
  margin-bottom: 0.6rem;
  width: fit-content;
}

.resource-card h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.resource-card .desc {
  font-size: 0.83rem;
  color: var(--text-2);
  margin-bottom: 1.1rem;
  line-height: 1.5;
  flex: 1;
}

.resource-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 0.38rem 0.85rem;
  border-radius: var(--r);
  font-size: 0.8rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background .14s, color .14s, border-color .14s;
  white-space: nowrap;
}
.btn-ghost:hover {
  background: var(--bg-2);
  color: var(--text-1);
  text-decoration: none;
}

.btn-accent {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent-light);
  padding: 0.38rem 0.85rem;
  border-radius: var(--r);
  font-size: 0.8rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background .14s, color .14s;
  white-space: nowrap;
}
.btn-accent:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* =====================================================
   PRINT — CHART PAGES
   ===================================================== */

/* ── Course tab bar ───────────────────────────────────── */

.course-tabs {
  display: flex;
  gap: .5rem;
  margin-top: 1.25rem;
}

.course-tab {
  display: inline-block;
  padding: .35rem .9rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none;
  transition: color .15s, background .15s, border-color .15s;
}

.course-tab:hover {
  color: var(--text-0);
  text-decoration: none;
}

.course-tab.active {
  color: var(--accent-light);
  background: var(--accent-dim);
  border-color: var(--accent);
}

@media print {
  .print-hide { display: none !important; }
  .site-nav, .site-footer { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .page-wrap { padding: 0.5rem 1rem !important; max-width: 100% !important; }
}
