:root {
  --bg: #111;
  --surface: #181818;
  --card: #1f1f1f;
  --card-hover: #262626;
  --line: #333;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --accent: #f97316;
  --accent-soft: rgba(249,115,22,.15);
  --ok: #22c55e;
  --warn: #eab308;
  --radius: 16px;
}
* { box-sizing: border-box; }
body.comunidade {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  background: rgba(17,17,17,.95);
  border-bottom: 1px solid var(--line);
  padding: .85rem 1rem;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 1.1rem; color: var(--accent); }
.topbar__nav { display: flex; gap: .45rem; flex-wrap: wrap; margin-left: auto; }
.tab {
  padding: .45rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
}
.tab.active, .tab--primary.active {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
  font-weight: 700;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.stats-bar {
  display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center;
  color: var(--muted); font-size: .85rem; margin-bottom: 1rem;
}
.stats-bar strong { color: var(--accent); }
.hero { text-align: center; margin-bottom: 2rem; }
.hero h1 { margin: 0 0 .5rem; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.hero p { margin: 0; color: var(--muted); max-width: 640px; margin-inline: auto; line-height: 1.5; }
.section-title {
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin: 2rem 0 1rem;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  transition: border-color .2s, transform .2s, background .2s;
  cursor: pointer;
  min-height: 170px;
}
.product-card:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  transform: translateY(-2px);
}
.product-card h3 { margin: 0; font-size: 1.05rem; }
.product-card p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.45; flex: 1; }
.product-card__meta { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .75rem; color: var(--muted); }
.pill {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #fdba74;
  font-weight: 700;
}
.pill.ok { background: rgba(34,197,94,.15); color: var(--ok); }
.pill.warn { background: rgba(234,179,8,.15); color: var(--warn); }
.breadcrumb { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; font-size: .85rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.course-head { margin-bottom: 1.5rem; }
.course-head h2 { margin: 0 0 .35rem; font-size: 1.6rem; }
.course-head p { margin: 0; color: var(--muted); line-height: 1.5; }
.chapter {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}
.chapter__head {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  padding: .9rem 1.1rem;
  background: var(--card-hover);
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.chapter__cover { width: 120px; height: 68px; object-fit: cover; border-radius: 10px; background: #000; }
.chapter__head h3 { margin: 0; font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: .85rem;
  align-items: center;
  padding: .8rem 1rem;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s;
}
.lesson-item:first-child { border-top: 0; }
.lesson-item:hover { background: rgba(255,255,255,.03); }
.lesson-item__thumb {
  width: 48px; height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #000;
  border: 1px solid var(--line);
}
.lesson-item__thumb--empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 1rem;
}
.lesson-item__title { margin: 0; font-size: .92rem; font-weight: 600; }
.lesson-item__sub { margin: .1rem 0 0; color: var(--muted); font-size: .76rem; }
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(960px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.modal__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
}
.modal__head h2 { margin: 0; font-size: 1.05rem; }
.modal__head p { margin: .25rem 0 0; color: var(--muted); font-size: .82rem; }
.modal__close {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  width: 36px; height: 36px;
  cursor: pointer;
}
.modal__body { padding: 1rem 1.1rem 1.25rem; }
.modal video, .modal iframe.video-frame {
  width: 100%;
  aspect-ratio: 16/9;
  border: 0;
  border-radius: 12px;
  background: #000;
}
.modal__desc { margin-top: 1rem; color: #d1d5db; line-height: 1.6; font-size: .92rem; white-space: pre-wrap; }
.modal__section { margin-top: 1.1rem; }
.modal__section h3 { margin: 0 0 .55rem; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.modal__links, .modal__materials { list-style: none; margin: 0; padding: 0; }
.modal__links li, .modal__materials li { padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.modal__actions { margin-top: 1rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: .45rem .8rem;
  border-radius: 10px;
  font-size: .78rem;
  font-weight: 700;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--card);
}
.btn--primary { background: var(--accent); border-color: var(--accent); color: #111; }
.empty-note { color: var(--muted); font-size: .88rem; padding: .75rem 0; }
@media (max-width: 640px) {
  .chapter__head { grid-template-columns: 1fr; }
  .chapter__cover { width: 100%; height: 120px; }
  .lesson-item { grid-template-columns: 48px 1fr; }
  .lesson-item__status { grid-column: 1 / -1; }
}
