@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;600;700&display=swap');

:root {
  --tq-bg: #14261f;
  --tq-surface: #1a3329;
  --tq-card: #1f3d31;
  --tq-border: #2d5c49;
  --tq-accent: #059669;
  --tq-accent-light: #34d399;
  --tq-teal: #14b8a6;
  --tq-gold: #fbbf24;
  --tq-red: #f87171;
  --tq-text: #e8f6ef;
  --tq-muted: #86b8a0;
  --tq-radius: 14px;
  --tq-hero-glow: rgba(5, 150, 105, 0.16);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body.tq-hub,
body.tq-body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--tq-bg);
  color: var(--tq-text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.tq-hub-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--tq-border);
  background: color-mix(in srgb, var(--tq-bg) 92%, transparent);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.tq-hud { display: flex; gap: 6px; flex-wrap: wrap; }
.tq-hud-pill,
.tq-stat-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--tq-surface);
  border: 1px solid var(--tq-border);
  font-size: 11px;
  font-weight: 600;
}
.tq-hud-pill i { color: var(--tq-accent-light); }

.tq-hub-hero,
.tq-module-hero {
  text-align: center;
  padding: 48px 24px 32px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, var(--tq-hero-glow) 0%, transparent 55%),
    linear-gradient(180deg, rgba(20, 184, 166, 0.08) 0%, transparent 60%);
}

.tq-hub-badge,
.tq-module-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--tq-accent-light);
  background: rgba(5, 150, 105, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 20px;
  padding: 6px 14px;
  margin-bottom: 12px;
}

.tq-hub-hero h1,
.tq-module-hero h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--tq-accent-light), var(--tq-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.tq-hub-hero p,
.tq-module-hero > p {
  color: var(--tq-muted);
  max-width: 560px;
  margin: 0 auto;
  font-size: 15px;
}

.tq-module-subtitle {
  font-size: 1rem;
  color: var(--tq-accent-light);
  font-weight: 600;
  margin-bottom: 8px;
}

.tq-hub-content {
  padding: 0 24px 48px;
  max-width: 720px;
  margin: 0 auto;
}

.tq-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.tq-stat-box {
  text-align: center;
  padding: 16px;
  background: var(--tq-card);
  border-radius: 12px;
  border: 1px solid var(--tq-border);
}
.tq-stat-box .num {
  font-size: 24px;
  font-weight: 700;
  color: var(--tq-accent-light);
}
.tq-stat-box .lbl {
  font-size: 11px;
  color: var(--tq-muted);
  margin-top: 4px;
}

.tq-module-hero-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--tq-card);
  border: 1px solid var(--tq-border);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 20px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.tq-module-hero-card:hover {
  transform: translateY(-4px);
  border-color: var(--tq-accent-light);
  box-shadow: 0 0 30px rgba(5, 150, 105, 0.15), 0 20px 40px -12px rgba(0, 0, 0, 0.4);
}
.tq-module-hero-inner { padding: 28px; }
.tq-module-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--tq-accent-light);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.tq-module-hero-card h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.tq-module-hero-card .desc {
  font-size: 14px;
  color: var(--tq-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}
.tq-module-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.tq-module-features span {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--tq-surface);
  border: 1px solid var(--tq-border);
}
.tq-module-cta {
  font-size: 14px;
  font-weight: 600;
  color: var(--tq-accent-light);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tq-module-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--tq-accent), #047857);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  float: right;
  margin-left: 16px;
  color: white;
}

.tq-module-hero-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--tq-accent), #047857);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: white;
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.28);
}

.tq-hub-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--tq-accent-light);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tq-module-grid { display: flex; flex-direction: column; gap: 14px; }

.tq-module-card {
  display: flex;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.1), var(--tq-card));
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: var(--tq-radius);
  padding: 18px;
  transition: all 0.25s;
}
.tq-module-card:hover {
  border-color: var(--tq-accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

.tq-module-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--tq-accent), #047857);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: white;
}

.tq-module-card-body { flex: 1; min-width: 0; }
.tq-module-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.tq-module-card-body h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}
.tq-module-card-body p {
  font-size: 12px;
  color: var(--tq-muted);
  line-height: 1.5;
}

.tq-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.tq-tag.new { background: rgba(5, 150, 105, 0.15); color: var(--tq-accent-light); border: 1px solid rgba(52, 211, 153, 0.3); }
.tq-tag.done { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.tq-tag.progress { background: rgba(20, 184, 166, 0.15); color: var(--tq-teal); border: 1px solid rgba(20, 184, 166, 0.3); }

.tq-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--tq-muted);
  margin-bottom: 20px;
}
.tq-breadcrumb a { color: var(--tq-accent-light); text-decoration: none; }
.tq-breadcrumb a:hover { text-decoration: underline; }

.tq-hub-footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--tq-muted);
  border-top: 1px solid var(--tq-border);
}
.tq-hub-footer a { color: var(--tq-accent-light); text-decoration: none; }
.tq-hub-footer a:hover { text-decoration: underline; }

.tq-group-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--tq-accent-light);
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tq-group-title:first-child { margin-top: 0; }

.tq-test-card { border-left: 3px solid var(--test-color, var(--tq-accent)); }

.tq-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--tq-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.tq-back:hover { color: var(--tq-accent-light); }

.tq-app { min-height: 100vh; display: flex; flex-direction: column; max-width: 900px; margin: 0 auto; }
.tq-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--tq-bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tq-border);
  padding: 12px 20px 0;
}
.tq-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
  flex-wrap: wrap;
}
.tq-title-block h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--tq-text);
}
.tq-title-block p { font-size: 11px; color: var(--tq-muted); margin-top: 2px; }
.tq-main { padding: 20px; flex: 1; }
.tq-progress-wrap { padding-bottom: 12px; }
.tq-progress-bar {
  height: 6px;
  background: var(--tq-surface);
  border-radius: 3px;
  overflow: hidden;
}
.tq-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--tq-accent), var(--tq-teal));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Quiz UI — align provisions-mastery vars with TibbQuest */
body.tq-body {
  --pm-bg: var(--tq-bg);
  --pm-surface: var(--tq-surface);
  --pm-card: var(--tq-card);
  --pm-border: var(--tq-border);
  --pm-accent: var(--tq-accent);
  --pm-accent-light: var(--tq-accent-light);
  --pm-text: var(--tq-text);
  --pm-muted: var(--tq-muted);
}

.pm-test-intro h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--tq-accent-light);
  margin: 14px 0 8px;
}

.pm-btn-primary {
  background: linear-gradient(135deg, var(--tq-accent), #047857) !important;
}

@media (max-width: 640px) {
  .tq-hub-hero h1, .tq-module-hero h1 { font-size: 2rem; }
  .tq-stats-row { grid-template-columns: 1fr; }
}