/* ============================================================
   AI HUB — Design System
   Dark-first theme inspired by futurepedia.io / futuretools.io
   Toggle light mode via <html data-theme="light">
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Surfaces */
  --bg: #070a13;
  --bg-2: #0a0f1d;
  --panel: #0d1424;
  --card: #101a30;
  --card-hover: #15203a;
  --input-bg: #0b1222;

  /* Lines */
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.25);

  /* Text */
  --text: #e9edf6;
  --text-2: #aab4c8;
  --muted: #76829b;

  /* Brand */
  --accent: #7c6cff;
  --accent-soft: rgba(124, 108, 255, 0.14);
  --accent-2: #22d3ee;
  --accent-3: #f471b5;
  --grad: linear-gradient(120deg, #7c6cff 0%, #a78bfa 45%, #22d3ee 100%);
  --grad-warm: linear-gradient(120deg, #f471b5, #fb923c);

  /* Status */
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.14);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.14);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.14);
  --cyan-soft: rgba(34, 211, 238, 0.12);
  --pink-soft: rgba(244, 113, 181, 0.14);

  /* Geometry */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --nav-h: 64px;

  /* Effects */
  --shadow-card: 0 12px 32px rgba(2, 6, 23, 0.4);
  --shadow-pop: 0 24px 64px rgba(2, 6, 23, 0.6);
  --glow: 0 0 0 1px rgba(124, 108, 255, 0.4), 0 10px 40px rgba(124, 108, 255, 0.16);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f5f7fc;
  --bg-2: #eef1f9;
  --panel: #ffffff;
  --card: #ffffff;
  --card-hover: #f7f8ff;
  --input-bg: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.2);
  --text: #0f172a;
  --text-2: #3f4a61;
  --muted: #69748c;
  --accent-soft: rgba(124, 108, 255, 0.1);
  --shadow-card: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-pop: 0 24px 64px rgba(15, 23, 42, 0.16);
  --glow: 0 0 0 1px rgba(124, 108, 255, 0.35), 0 10px 32px rgba(124, 108, 255, 0.14);
  color-scheme: light;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Cross-document page transitions (Chromium); harmless elsewhere */
@view-transition { navigation: auto; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  animation: pageIn 0.35s ease both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

img { max-width: 100%; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5rem; letter-spacing: -0.015em; }
p { margin: 0 0 0.75rem; }
button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: rgba(124, 108, 255, 0.35); }

.container {
  width: min(1240px, 100% - 40px);
  margin-inline: auto;
}

main.container { padding-block: 36px 72px; min-height: 60vh; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.12rem;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--grad);
  display: grid;
  place-items: center;
  font-size: 17px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 108, 255, 0.45);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); text-decoration: none; }
.nav-links a.active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(124,108,255,.35); }

.nav-spacer { flex: 1; }

/* Global search */
.nav-search { position: relative; }

.nav-search input {
  width: 230px;
  padding: 9px 14px 9px 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.9rem;
  transition: width 0.25s ease, border-color 0.2s ease;
}
.nav-search input:focus { width: 300px; border-color: var(--accent); outline: none; }
.nav-search .search-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  translate: 0 -50%;
  color: var(--muted);
  pointer-events: none;
  font-size: 0.9rem;
}

.search-results {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 380px;
  max-height: 420px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 8px;
}

.search-group {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 8px 10px 4px;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--text);
  cursor: pointer;
}
.search-item:hover { background: var(--accent-soft); text-decoration: none; }
.search-item .si-ico { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--card-hover); font-size: 14px; }
.search-item .si-title { font-weight: 600; font-size: 0.9rem; }
.search-item .si-sub { font-size: 0.78rem; color: var(--muted); }
.search-empty { padding: 16px; text-align: center; color: var(--muted); font-size: 0.9rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 17px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

.hamburger { display: none; }

/* Mobile nav drawer */
@media (max-width: 1020px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px 16px;
    box-shadow: var(--shadow-pop);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
  .hamburger { display: inline-grid; }
  .nav-search input { width: 150px; }
  .nav-search input:focus { width: 190px; }
  .search-results { width: min(380px, calc(100vw - 40px)); }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 84px 0 64px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  pointer-events: none;
}
.hero::before {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(124, 108, 255, 0.55), transparent 65%);
  top: -260px; left: -120px;
}
.hero::after {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.4), transparent 65%);
  bottom: -260px; right: -100px;
}
[data-theme="light"] .hero::before, [data-theme="light"] .hero::after { opacity: 0.25; }

.hero > .container { position: relative; z-index: 1; }

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 22px;
}
.hero-kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  margin-bottom: 14px;
}

.hero-sub {
  max-width: 620px;
  margin: 0 auto 30px;
  color: var(--text-2);
  font-size: 1.06rem;
}

.hero-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto 26px;
}
.hero-search input {
  width: 100%;
  padding: 16px 22px 16px 50px;
  font-size: 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.hero-search input:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.hero-search .search-ico {
  position: absolute; left: 20px; top: 50%; translate: 0 -50%;
  color: var(--muted); font-size: 1.05rem; pointer-events: none;
}
.hero-search .search-results { left: 0; right: 0; width: auto; text-align: left; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 5vw, 56px);
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat b { display: block; font-size: 1.5rem; font-weight: 800; }
.stat span { font-size: 0.82rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* Page header (non-home pages) */
.page-head { padding: 46px 0 8px; }
.page-head h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 800; }
.page-head p { color: var(--text-2); max-width: 660px; font-size: 1rem; }

/* ============================================================
   SECTIONS & GRIDS
   ============================================================ */
.section { margin-top: 46px; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h2 { font-size: 1.35rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 10px; }
.section-head .see-all { font-size: 0.88rem; font-weight: 600; white-space: nowrap; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 18px;
}
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 22px 0 24px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: sticky;
  top: calc(var(--nav-h) + 10px);
  z-index: 50;
}

.pills { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.pill:hover { border-color: var(--accent); color: var(--text); }
.pill.active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 108, 255, 0.35);
}
.pill .count { opacity: 0.7; font-weight: 500; margin-left: 4px; font-size: 0.78rem; }

.filter-search { position: relative; flex: 1 1 200px; min-width: 170px; }
.filter-search input {
  width: 100%;
  padding: 9px 14px 9px 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.9rem;
}
.filter-search input:focus { outline: none; border-color: var(--accent); }
.filter-search .search-ico { position: absolute; left: 11px; top: 50%; translate: 0 -50%; color: var(--muted); font-size: 0.85rem; }

.select {
  padding: 9px 32px 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2376829b' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.result-count { font-size: 0.85rem; color: var(--muted); font-weight: 600; white-space: nowrap; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 108, 255, 0.5);
  box-shadow: var(--glow);
  background: var(--card-hover);
}

a.card { color: inherit; }
a.card:hover { text-decoration: none; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge.featured { background: var(--grad); color: #fff; }
.badge.new { background: var(--green-soft); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.4); }
.badge.live { background: var(--green-soft); color: var(--green); }
.badge.demo { background: var(--amber-soft); color: var(--amber); }
.badge.official { background: var(--cyan-soft); color: var(--accent-2); border: 1px solid rgba(34, 211, 238, 0.35); }

.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #a99eff;
  font-size: 0.72rem;
  font-weight: 700;
}
[data-theme="light"] .chip { color: #5b4cd6; }

.chip.alt { background: var(--cyan-soft); color: var(--accent-2); }
[data-theme="light"] .chip.alt { color: #0e7490; }

/* Favorite star */
.fav-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
  z-index: 2;
}
.fav-btn:hover { background: var(--amber-soft); color: var(--amber); border-color: rgba(251, 191, 36, 0.35); }
.fav-btn.on { color: var(--amber); }

/* --- Tool card --- */
.tool-card .tool-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding-right: 34px; }
.tool-logo {
  position: relative;
  width: 44px; height: 44px;
  flex: 0 0 auto;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  overflow: hidden;
}
.tool-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 7px; background: #fff; }
[data-theme="light"] .tool-logo img { background: #f4f5f9; }
.tool-card h3 { font-size: 1.05rem; margin: 0; }
.tool-card .tool-desc { color: var(--text-2); font-size: 0.88rem; flex: 1; margin-bottom: 14px; }
.tool-card .tool-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tool-card .pricing { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.tool-card .visit { font-size: 0.82rem; font-weight: 700; color: var(--accent-2); }

/* --- Video card --- */
.video-card { padding: 0; overflow: hidden; cursor: pointer; }
.video-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--bg-2); overflow: hidden; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.video-card:hover .video-thumb img { transform: scale(1.05); }
.video-thumb .play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(4, 8, 18, 0.25);
  opacity: 0;
  transition: opacity 0.2s;
}
.video-card:hover .video-thumb .play { opacity: 1; }
.video-thumb .play span {
  width: 58px; height: 58px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad);
  color: #fff;
  font-size: 22px;
  padding-left: 4px;
  box-shadow: 0 8px 30px rgba(124, 108, 255, 0.55);
}
.video-thumb .vchip { position: absolute; top: 10px; left: 10px; }
.video-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.video-body h3 { font-size: 0.95rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--muted); flex-wrap: wrap; }
.video-meta b { color: var(--text-2); font-weight: 600; }
.video-why { font-size: 0.82rem; color: var(--text-2); }

/* --- News card --- */
.news-card { gap: 10px; }
.news-card .news-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-source {
  font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent-2);
}
.news-date { font-size: 0.78rem; color: var(--muted); }
.news-card h3 { font-size: 1rem; margin: 0; }
.news-card h3 a { color: var(--text); }
.news-card h3 a:hover { color: var(--accent-2); text-decoration: none; }
.news-card .news-summary { font-size: 0.86rem; color: var(--text-2); flex: 1; }
.news-card .read-more { font-size: 0.82rem; font-weight: 700; }

/* --- Prompt card --- */
.prompt-card .prompt-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.prompt-card h3 { font-size: 1rem; margin: 0; padding-right: 4px; }
.prompt-text {
  position: relative;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--text-2);
  font-family: var(--mono);
  line-height: 1.55;
  max-height: 150px;
  overflow: hidden;
  flex: 1;
  white-space: pre-wrap;
}
.prompt-text.expanded { max-height: none; }
.prompt-text .fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 48px;
  background: linear-gradient(transparent, var(--input-bg));
  pointer-events: none;
}
.prompt-text.expanded .fade { display: none; }
.prompt-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.prompt-foot .spacer { flex: 1; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 20px rgba(124, 108, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(124, 108, 255, 0.5); }

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-2);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }

.btn-sm { padding: 7px 13px; font-size: 0.82rem; border-radius: 9px; }

.btn-copy { background: var(--accent-soft); color: #a99eff; border: 1px solid rgba(124, 108, 255, 0.3); }
[data-theme="light"] .btn-copy { color: #5b4cd6; }
.btn-copy:hover { background: rgba(124, 108, 255, 0.25); }
.btn-copy.copied { background: var(--green-soft); color: var(--green); border-color: rgba(52, 211, 153, 0.4); }

.btn-danger-ghost { background: transparent; border: 1px solid transparent; color: var(--muted); }
.btn-danger-ghost:hover { color: var(--red); background: var(--red-soft); }

/* ============================================================
   QUICK LINK CARDS (home)
   ============================================================ */
.quick-card { align-items: flex-start; gap: 10px; }
.quick-card .q-ico {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 22px;
  background: var(--accent-soft);
}
.quick-card h3 { font-size: 1.02rem; margin: 0; }
.quick-card p { font-size: 0.86rem; color: var(--text-2); margin: 0; flex: 1; }
.quick-card .q-go { font-size: 0.84rem; font-weight: 700; color: var(--accent-2); }

/* ============================================================
   LEARN PAGE
   ============================================================ */
.path-card { gap: 12px; }
.path-card .path-top { display: flex; align-items: center; gap: 12px; }
.path-emoji { font-size: 30px; }
.path-card h3 { margin: 0; font-size: 1.15rem; }
.path-level { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; }

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--grad);
  transition: width 0.4s ease;
}
.progress-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; }

.path-section {
  margin-top: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  overflow: hidden;
}
.path-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px;
  cursor: pointer;
  user-select: none;
}
.path-header:hover { background: var(--card-hover); }
.path-header .path-emoji { font-size: 34px; }
.path-header h2 { margin: 0; font-size: 1.3rem; }
.path-header .path-sub { color: var(--text-2); font-size: 0.9rem; margin: 2px 0 0; }
.path-header .path-meta { margin-left: auto; text-align: right; min-width: 150px; }
.path-header .caret { font-size: 13px; color: var(--muted); transition: transform 0.2s; margin-left: 10px; }
.path-section.collapsed .caret { transform: rotate(-90deg); }
.path-section.collapsed .topic-list { display: none; }

.topic-list { border-top: 1px solid var(--border); }

.topic {
  display: flex;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.topic:last-child { border-bottom: none; }
.topic:hover { background: var(--card-hover); }
.topic.done { opacity: 0.62; }
.topic.done .topic-title { text-decoration: line-through; }

.topic-check {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  margin-top: 2px;
  border-radius: 8px;
  border: 2px solid var(--border-strong);
  background: transparent;
  color: transparent;
  display: grid; place-items: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.topic-check:hover { border-color: var(--accent); }
.topic.done .topic-check { background: var(--grad); border-color: transparent; color: #fff; }

.topic-body { flex: 1; }
.topic-title { font-weight: 700; font-size: 1rem; }
.topic-desc { color: var(--text-2); font-size: 0.88rem; margin: 4px 0 8px; }
.topic-workflow {
  display: flex;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-2);
  background: var(--accent-soft);
  border: 1px solid rgba(124, 108, 255, 0.22);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 10px;
}
.topic-workflow b { color: var(--text); }
.topic-links { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.topic-links .mins { font-size: 0.78rem; color: var(--muted); font-weight: 600; }

/* ============================================================
   NEWS / FEED STATUS
   ============================================================ */
.feed-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
}
.refresh-btn.spinning .ico { display: inline-block; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--card) 40%, var(--card-hover) 50%, var(--card) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  min-height: 150px;
  border: 1px solid var(--border);
}
@keyframes shimmer { to { background-position: -200% 0; } }

.notice {
  display: flex;
  gap: 10px;
  align-items: start;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: var(--amber-soft);
  color: var(--text-2);
  font-size: 0.88rem;
  margin: 14px 0;
}
.notice.info { border-color: rgba(34, 211, 238, 0.3); background: var(--cyan-soft); }
.notice b { color: var(--text); }

/* ============================================================
   TODAY PAGE (daily dose)
   ============================================================ */
.today-hero { padding-bottom: 18px; }
.today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
}
.streak-box {
  text-align: center;
  padding: 14px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  min-width: 130px;
}
.streak-flame { font-size: 1.6rem; font-weight: 800; }
.streak-label { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.streak-sub { font-size: 0.72rem; color: var(--text-2); margin-top: 4px; }

.week-dots { display: flex; gap: 8px; margin-top: 18px; }
.wdot {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 0.7rem; font-weight: 700;
  color: var(--text-2);
  background: var(--bg-2);
}
.wdot.on { background: var(--green-soft); color: var(--green); border-color: rgba(52, 211, 153, 0.5); }
.wdot.today { outline: 2px solid var(--accent); outline-offset: 2px; }
.wdot.future { opacity: 0.35; }

.drill-card { padding: 22px; }
.drill-card.done { border-color: rgba(52, 211, 153, 0.5); }
.drill-title { font-size: 1.25rem; margin: 0 0 8px; }
.drill-instructions { color: var(--text-2); margin: 0 0 14px; }
.ctx-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.drill-context {
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.92rem;
  margin-bottom: 14px;
}
.drill-criteria { font-size: 0.88rem; color: var(--text-2); margin-bottom: 16px; }
.drill-criteria ul { margin: 6px 0 0; padding-left: 20px; }
.drill-criteria li { margin: 3px 0; }
.drill-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.dive-card.done, .scan-card.done { border-color: rgba(52, 211, 153, 0.5); }
.why-greg {
  display: flex; gap: 10px; align-items: start;
  padding: 12px 14px;
  background: var(--cyan-soft);
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin: 10px 0 14px;
}
.scan-list { margin: 0 0 12px; padding-left: 20px; }
.scan-list li { margin: 8px 0; }

/* Archive streak calendar */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(24px, 34px));
  gap: 6px;
  justify-content: start;
  padding: 8px 4px;
}
.cal-head { font-size: 0.65rem; color: var(--text-2); text-align: center; font-weight: 700; }
.cal-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
}
.cal-cell.on { background: var(--green); border-color: var(--green); opacity: 0.85; }
.cal-cell.part { background: var(--amber-soft); border-color: rgba(251, 191, 36, 0.5); }
.cal-cell.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-cell.future { opacity: 0.25; }

/* Sticky warning shown by the data loader when /data fetch fails */
.data-banner {
  position: sticky;
  top: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: var(--amber-soft);
  border-bottom: 1px solid rgba(251, 191, 36, 0.45);
  color: var(--text);
  font-size: 0.85rem;
}
.data-banner button {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
}

/* ============================================================
   AGENT HQ (repo table + guides)
   ============================================================ */
.repo-table { width: 100%; border-collapse: collapse; }
.repo-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-strong);
}
.repo-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.repo-table tr:hover td { background: var(--card-hover); }
.repo-table .rank { font-weight: 800; color: var(--muted); font-size: 0.9rem; width: 36px; }
.repo-name { font-weight: 700; font-family: var(--mono); font-size: 0.88rem; white-space: nowrap; }
.repo-desc { color: var(--text-2); font-size: 0.85rem; }
.repo-stars { font-weight: 700; white-space: nowrap; color: var(--amber); font-size: 0.88rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }

@media (max-width: 760px) {
  .repo-table .hide-sm { display: none; }
}

.guide-card { gap: 8px; }
.guide-card h3 { font-size: 1.02rem; display: flex; gap: 8px; align-items: center; }
.guide-card p, .guide-card li { font-size: 0.88rem; color: var(--text-2); }
.guide-card ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.guide-card code {
  font-family: var(--mono);
  font-size: 0.8rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 6px;
  color: var(--accent-2);
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 6, 14, 0.78);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }

.modal-box {
  width: min(860px, 100%);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: popIn 0.22s ease;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(10px); } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: 20px; }

.video-frame { aspect-ratio: 16 / 9; width: 100%; background: #000; }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Forms */
.form-grid { display: grid; gap: 14px; }
.form-grid label { font-size: 0.82rem; font-weight: 700; color: var(--text-2); display: block; margin-bottom: 6px; }
.input, .textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
}
.textarea { min-height: 130px; resize: vertical; font-family: var(--mono); font-size: 0.85rem; line-height: 1.55; }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  translate: -50% 0;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-pop);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, translate 0.25s;
}
.toast.show { opacity: 1; translate: -50% -6px; }
.toast .t-ico { color: var(--green); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  margin-top: 40px;
  padding: 44px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 28px;
}
.footer h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer ul a { color: var(--text-2); font-size: 0.9rem; }
.footer ul a:hover { color: var(--text); }
.footer-about p { color: var(--muted); font-size: 0.88rem; max-width: 320px; }
.footer-bottom {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .filter-bar { position: static; }
}

/* ============================================================
   EMPTY STATE & MISC
   ============================================================ */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty .e-ico { font-size: 40px; margin-bottom: 10px; }

.reveal { animation: pageIn 0.4s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
