/* TSC — demonstração local. Sem fontes externas; tipografia do sistema. */

:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --header-bg: #111111;
  --header-text: #ffffff;
  --header-muted: #d6d6d6;
  --header-line: rgba(255, 255, 255, 0.14);
  --top-h: 88px;
  --sidebar-w: 232px;
  --content-max: 1080px;
  --bottom-bar-h: 64px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111111;
  --surface: #191919;
  --surface-2: #242424;
  --text: #ffffff;
  --text-2: #d6d6d6;
  --muted: #a6a6a6;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #00ccfe;
  --accent-text: #00ccfe;
  --accent-soft: rgba(0, 204, 254, 0.12);
  --on-accent: #0b0b0b;
  --focus: #00ccfe;
  --warn-soft: rgba(255, 196, 0, 0.14);
  --warn-text: #ffd666;
  --danger: #ffadb0;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-2: #ebebed;
  --text: #111111;
  --text-2: #3a3a3c;
  --muted: #5c5c61;
  --line: rgba(0, 0, 0, 0.12);
  --accent: #00ccfe;
  --accent-text: #00627a;
  --accent-soft: rgba(0, 150, 190, 0.1);
  --on-accent: #0b0b0b;
  --focus: #00627a;
  --warn-soft: rgba(176, 116, 0, 0.12);
  --warn-text: #7a5000;
  --danger: #9f2936;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

[hidden] { display: none !important; }

a { color: var(--accent-text); }

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

.topbar :focus-visible { outline-color: #00ccfe; }

h1, h2, h3, h4, p, dl, dd { margin: 0; overflow-wrap: anywhere; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -80px;
  z-index: 100;
  padding: 12px 16px;
  background: #00ccfe;
  color: #0b0b0b;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Topo (sempre escuro: logo original preservada sobre preto) ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  color: var(--header-text);
  border-bottom: 1px solid var(--header-line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 6px 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 4px;
  flex-shrink: 0;
}

.brand-logo { width: 176px; min-width: 160px; height: auto; }

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.select {
  min-height: 44px;
  padding: 0 34px 0 12px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  max-width: 100%;
  cursor: pointer;
}

.topbar .select {
  color: var(--header-text);
  background-color: #1d1d1d;
  border-color: var(--header-line);
}
.topbar .select option { color: #ffffff; background: #1d1d1d; }

.control-scenario .select { min-width: 250px; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--header-text);
  background: transparent;
  border: 1px solid var(--header-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.07); }

.demo-banner {
  padding: 4px 20px;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--header-muted);
  border-top: 1px solid var(--header-line);
}

/* ---------- Estrutura ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: var(--top-h);
  height: calc(100vh - var(--top-h));
  height: calc(100dvh - var(--top-h));
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 12px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text-2);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  font-size: 0.95rem;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 700;
  border-left-color: var(--accent);
}
.nav-link[aria-current="page"] svg { color: var(--accent-text); }

/* Administração separada visualmente do restante da navegação. */
.nav-admin { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

.scenario-card {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}
.scenario-card:empty { display: none; }
.scenario-text { min-width: 0; display: grid; gap: 1px; }
.scenario-name { color: var(--text); font-weight: 700; font-size: 0.88rem; }
.scenario-line { overflow-wrap: anywhere; }

.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 800;
  font-size: 0.85rem;
}

.main {
  min-width: 0;
  padding: 28px 36px 72px;
}
.main:focus { outline: none; }

.page {
  max-width: var(--content-max);
  display: grid;
  gap: 28px;
}

.loading { color: var(--muted); padding: 40px 0; }

/* ---------- Tipografia ---------- */

.page-header { display: grid; gap: 8px; }
.page-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }

.page-title {
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.005em;
}
.page-title:focus { outline: none; }
.page-title:focus-visible { outline: 2px solid var(--focus); }

.lead { font-size: 0.98rem; color: var(--text-2); max-width: 64ch; }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.section { display: grid; gap: 14px; }

.section-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.section-lead { color: var(--muted); font-size: 0.9rem; }

.sub-title { font-size: 1rem; font-weight: 700; margin-top: 8px; }

.meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 0.84rem;
  color: var(--muted);
}

.muted { color: var(--muted); }
.strong { font-weight: 700; }

.note {
  font-size: 0.84rem;
  color: var(--muted);
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.error-inline { color: var(--warn-text); }

/* ---------- Botões e links ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  font: inherit;
  font-size: 0.93rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }

.btn-quiet {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
  font-weight: 500;
  font-size: 0.88rem;
  padding: 0 16px;
}
.btn-quiet:hover { background: var(--surface-2); }
.btn-quiet[aria-expanded="true"] { border-color: var(--accent-text); }

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; }

/* ---------- Filtros ---------- */

.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 20px; }

.field { display: grid; gap: 6px; width: 100%; max-width: 480px; }
.field-inline { max-width: 360px; }
.field-label { font-size: 0.86rem; color: var(--text-2); font-weight: 500; }

.input {
  min-height: 48px;
  width: 100%;
  padding: 0 16px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.input::placeholder { color: var(--muted); }

.select-wide { width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 0.88rem;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 700;
}

.result-count { font-size: 0.82rem; color: var(--muted); }

/* ---------- Mural ---------- */

.wall-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

.wall-main { display: grid; gap: 12px; min-width: 0; }
.wall-aside { display: grid; gap: 12px; align-content: start; min-width: 0; }

.feed { min-width: 0; }

.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.post {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.post-lesson { border-left-color: var(--text-2); }
.post-material { border-left-color: var(--warn-text); }
.post.is-pinned { background: linear-gradient(0deg, var(--accent-soft), var(--accent-soft)), var(--surface); }

.post-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.post-author { font-weight: 700; font-size: 0.9rem; }
.post-top .meta { margin-left: auto; }
.post-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.post-title { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.post-body { color: var(--text-2); font-size: 0.95rem; }
.post-link { justify-self: start; font-size: 0.92rem; }

.aside-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.aside-card-start { border-color: var(--accent-text); }
.aside-title { font-weight: 700; line-height: 1.3; }
.aside-text { color: var(--text-2); font-size: 0.92rem; }

.empty {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--text-2);
}
.empty-title { font-size: 1.05rem; font-weight: 700; color: var(--text); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-published { background: var(--accent-soft); color: var(--accent-text); }
.badge-draft { background: var(--warn-soft); color: var(--warn-text); }
.badge-other { background: var(--surface-2); color: var(--text-2); }
.badge-group { background: var(--surface-2); color: var(--text); white-space: normal; }
.badge-type { background: var(--accent-soft); color: var(--accent-text); }
.badge-type-lesson { background: var(--surface-2); color: var(--text); }
.badge-type-material { background: var(--warn-soft); color: var(--warn-text); }
.badge-pinned { border: 1px solid var(--accent-text); color: var(--accent-text); }
.badge-start { background: var(--accent); color: var(--on-accent); justify-self: start; }
.badge-real { background: var(--accent); color: var(--on-accent); justify-self: start; }
.lesson-card-body .badge { justify-self: start; }

/* ---------- Aulas ---------- */

.lesson-results[aria-busy="true"] { opacity: 0.6; }

.lesson-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}
.lesson-item { display: flex; min-width: 0; }

.lesson-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.lesson-card:hover { border-color: var(--accent-text); }

.lesson-card-body { display: grid; gap: 6px; align-content: start; padding: 14px 16px 16px; }
.lesson-row-title { font-size: 1.02rem; font-weight: 700; line-height: 1.3; }
.lesson-row-summary {
  font-size: 0.88rem;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lesson-row-meta { font-size: 0.8rem; color: var(--muted); }

/* Capas tipográficas originais: formas geométricas em CSS, sem imagem e sem símbolo de reprodução. */
.cover {
  position: relative;
  display: block;
  height: 124px;
  overflow: hidden;
  background: #111111;
  color: #ffffff;
  isolation: isolate;
}
.cover::before,
.cover::after { content: ""; position: absolute; z-index: -1; }
.cover-mark {
  position: absolute;
  top: 12px; left: 14px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #00ccfe;
}
.cover-figure { position: absolute; left: 14px; bottom: 10px; display: flex; align-items: baseline; gap: 6px; }
.cover-num { font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.cover-unit { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: #d6d6d6; }

.cover-v0::before { right: -28px; top: -28px; width: 128px; height: 128px; border-radius: 50%; border: 18px solid #00ccfe; opacity: 0.9; }
.cover-v0::after { right: 40px; bottom: 18px; width: 56px; height: 8px; background: #ffffff; opacity: 0.85; }

.cover-v1::before { right: 18px; top: 18px; width: 84px; height: 84px; border: 2px solid #00ccfe; transform: rotate(45deg); }
.cover-v1::after { right: 40px; top: 40px; width: 40px; height: 40px; background: #00ccfe; transform: rotate(45deg); opacity: 0.85; }

.cover-v2::before {
  right: 0; top: 0; width: 55%; height: 100%;
  background: repeating-linear-gradient(135deg, #00ccfe 0 6px, transparent 6px 18px);
  opacity: 0.55;
}
.cover-v2::after { right: 24px; bottom: 16px; width: 36px; height: 36px; background: #ffffff; }

.cover-v3::before { right: -10px; bottom: -44px; width: 150px; height: 150px; border-radius: 50%; background: #00ccfe; opacity: 0.9; }
.cover-v3::after { right: 0; top: 30px; width: 90px; height: 2px; background: #ffffff; opacity: 0.8; }

/* Capa real (JPG original): largura total e altura natural, sem recorte do título. */
.cover-photo { display: block; width: 100%; height: auto; background: #111111; }

.cover-intro { background: #00ccfe; color: #0b0b0b; }
.cover-intro .cover-mark { color: #0b0b0b; }
.cover-intro .cover-unit { color: #0b0b0b; }
.cover-intro::before { border-color: #111111; background: transparent; opacity: 0.9; }
.cover-intro::after { background: #111111; opacity: 0.9; }
.cover-v1.cover-intro::before { border-color: #111111; }
.cover-v2.cover-intro::before { background: repeating-linear-gradient(135deg, #111111 0 6px, transparent 6px 18px); }
.cover-v3.cover-intro::before { background: #111111; }

/* ---------- Detalhe da aula ---------- */

.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.88rem;
  color: var(--muted);
}
.breadcrumb li { display: inline-flex; align-items: center; min-width: 0; }
.breadcrumb li + li::before { content: "/"; margin: 0 8px; color: var(--muted); }
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 6px;
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 600;
}
.breadcrumb [aria-current="page"] { color: var(--text-2); overflow-wrap: anywhere; }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 4px 0 0;
}
.facts div { display: grid; gap: 2px; min-width: 0; }
.facts dt { font-size: 0.76rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.lang-tag {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.8rem;
  font-weight: 600;
}

.about-text { color: var(--text-2); max-width: 66ch; }

.player {
  min-height: 180px;
  max-height: 300px;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(135deg, rgba(0, 204, 254, 0.05) 0 2px, transparent 2px 16px),
    #161616;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: hidden;
}
.player-inner { display: grid; justify-items: center; gap: 6px; text-align: center; max-width: 42ch; }
.player-icon { color: #8a8a8a; margin-bottom: 2px; }
.player-kicker { font-size: 0.76rem; color: #00ccfe; font-weight: 700; }
.player-title { font-size: 1.1rem; font-weight: 800; }
.player-text { font-size: 0.9rem; color: #d6d6d6; }

/* Player oficial incorporado: sem sobreposição; controles do provedor ficam visíveis. */
.video-player { display: grid; gap: 12px; min-width: 0; }
.video-stage { min-width: 0; }
.video-poster { display: block; width: 100%; height: auto; border-radius: var(--radius); background: #111111; }
.video-play { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: var(--radius); background: #111111; cursor: pointer; overflow: hidden; min-height: 44px; }
.video-play-nocover { aspect-ratio: 16 / 9; min-height: 200px; }
.video-play:focus-visible { outline: 3px solid #ffffff; outline-offset: -6px; box-shadow: 0 0 0 3px #1a5fd0; }
.video-play-pill {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: max-content; max-width: calc(100% - 24px);
  min-height: 44px; min-width: 44px; padding: 8px 18px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.72); color: #ffffff; font-weight: 600; font-size: 1rem; white-space: nowrap;
  transition: background-color 0.15s ease;
}
.video-play-icon { flex: 0 0 22px; width: 22px; height: 22px; }
.video-play:hover .video-play-pill { background: rgba(0, 0, 0, 0.88); }
@media (prefers-reduced-motion: reduce) { .video-play-pill { transition: none; } }
.video-frame-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000000;
}
.video-frame { display: block; width: 100%; height: 100%; min-height: 200px; border: 0; }

.item-list { list-style: none; margin: 0; padding: 0; display: grid; }
.item { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.item:last-child { border-bottom: 0; }
.item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.item-title { font-weight: 600; flex: 1 1 180px; min-width: 0; }
.item-current { padding-left: 12px; border-left: 3px solid var(--accent); }
.item-list-previous { padding-left: 12px; border-left: 1px solid var(--line); }

.preview {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.93rem;
  color: var(--text-2);
  max-height: 420px;
  overflow-y: auto;
}

.qa-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.qa {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.qa-question { font-weight: 600; }
.qa-answer {
  display: grid;
  gap: 4px;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
  color: var(--text-2);
}

/* ---------- Passos ---------- */

.step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: step; }
.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.step::before {
  content: counter(step);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.85rem;
}
.step-text { font-weight: 500; }
.step-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }

/* ---------- Minha Empresa / Administração ---------- */

.subnav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  border-bottom: 1px solid var(--line);
}
.subnav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.subnav-link:hover { color: var(--text); }
.subnav-link[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

.journey {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.journey-item, .private-item {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.journey-item dt, .private-item dt { font-size: 0.76rem; color: var(--muted); }
.journey-item dd, .private-item dd { margin: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.journey-item:first-child { border-left: 3px solid var(--accent); }

.cta-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cta-title { font-weight: 700; }

.artifacts { display: grid; gap: 24px; }
.artifact { display: grid; gap: 6px; }
.artifact-title { font-size: 1.05rem; font-weight: 700; }

.private-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.private-item-accent { border-color: var(--accent-text); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 1px solid var(--line); display: grid; gap: 14px; }
.timeline li { position: relative; display: grid; gap: 2px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -21px; top: 7px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.portfolio {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 12px;
}
.company-card {
  display: grid;
  gap: 12px;
  height: 100%;
  padding: 16px 18px;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.company-card:hover { border-color: var(--accent-text); }
.company-card-name { font-size: 1.05rem; font-weight: 800; }
.company-card-facts { display: grid; gap: 8px; margin: 0; }
.company-card-facts div { display: grid; gap: 1px; }
.company-card-facts dt { font-size: 0.74rem; color: var(--muted); }
.company-card-facts dd { margin: 0; font-size: 0.9rem; }
.company-card-facts .is-accent { padding-left: 10px; border-left: 3px solid var(--accent); }
.company-card-cta { color: var(--accent-text); font-weight: 700; font-size: 0.9rem; }

/* ---------- Diagnóstico (etapas e estado) ---------- */

.notice {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  background: var(--warn-soft);
  border: 1px solid var(--warn-text);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.92rem;
}
.notice-title { font-weight: 800; }

.stepper {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.stepper-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stepper-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line);
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--muted);
}
.stepper-text { display: grid; gap: 2px; min-width: 0; }
.stepper-title { font-weight: 700; }
.stepper-state { font-size: 0.8rem; color: var(--muted); }
.stepper-item.is-done .stepper-mark { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.stepper-item.is-current { border-color: var(--accent-text); }
.stepper-item.is-current .stepper-mark { border-color: var(--accent-text); color: var(--accent-text); }
.stepper-item.is-current .stepper-state { color: var(--accent-text); font-weight: 700; }
.stepper-item.is-todo { opacity: 0.8; }

.summary-card {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  color: var(--text-2);
}

.diag-sections { display: grid; gap: 8px; }
.diag-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.diag-section summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}
.diag-section p { padding: 0 16px 14px; color: var(--text-2); font-size: 0.93rem; }

.internal-notes {
  margin: 0;
  padding: 12px 16px 12px 32px;
  display: grid;
  gap: 6px;
  background: var(--warn-soft);
  border: 1px dashed var(--warn-text);
  border-radius: var(--radius);
}

/* ---------- Responsivo ---------- */

/* Tablet: sidebar mais estreita, mural em coluna única com orientação abaixo do feed. */
@media (max-width: 1099px) {
  :root { --sidebar-w: 200px; }
  .main { padding: 24px 24px 64px; }
  .wall-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .wall-aside { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
  .wall-aside > .section-title, .wall-aside > .note { grid-column: 1 / -1; }
  .control-scenario .select { min-width: 200px; }
}

@media (max-width: 860px) {
  .topbar { position: static; }
  .topbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-height: 0;
    padding: 4px 12px 8px;
  }
  .brand { align-self: flex-start; }
  .controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 44px;
    align-items: center;
    gap: 6px;
  }
  .control-scenario .select { min-width: 0; width: 100%; }
  .control-lang .select { padding-right: 28px; background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; }
  .theme-toggle { padding: 0; }
  .theme-text {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .demo-banner { padding: 3px 12px; font-size: 0.72rem; }

  .shell { display: block; }

  .sidebar {
    position: fixed;
    top: auto; left: 0; right: 0; bottom: 0;
    height: auto;
    z-index: 30;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-right: 0;
    gap: 0;
    overflow: visible;
  }
  .nav-list { display: flex; gap: 2px; }
  .nav-list li { flex: 1 1 0; min-width: 0; }
  .nav-link {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
    padding: 4px 2px;
    font-size: 0.7rem;
    text-align: center;
    line-height: 1.15;
    border-left: 0;
    border-top: 3px solid transparent;
    border-radius: var(--radius-sm);
  }
  .nav-link[aria-current="page"] { border-top-color: var(--accent); }
  .nav-link span { overflow-wrap: anywhere; }
  .nav-admin { margin: 0 0 0 4px; padding: 0 0 0 6px; border-top: 0; border-left: 1px solid var(--line); }
  .scenario-card { display: none; }

  .main { padding: 14px 14px calc(var(--bottom-bar-h) + 40px + env(safe-area-inset-bottom)); }
  .page { gap: 20px; }
  .page-header { gap: 4px; }
  .lead { font-size: 0.9rem; }
  .field, .field-inline { max-width: none; }
  .journey, .private-grid, .stepper { grid-template-columns: minmax(0, 1fr); }
  .post { padding: 14px; }
  .cover { height: 108px; }
}

@media (max-width: 360px) {
  .brand-logo { width: 160px; }
  .page-title { font-size: 1.35rem; }
  .chip { padding: 0 12px; }
  .qa, .step { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Modo auth (auth.html): entrada, sair e telas de sessão ---------- */

/* Sem sessão não há navegação protegida: a barra lateral/inferior some e o conteúdo ocupa a largura toda. */
body[data-gate="true"] .shell { display: block; }
body[data-gate="true"] .sidebar { display: none; }
body[data-gate="true"] .main { padding-bottom: 72px; }

.auth-card { max-width: 560px; display: grid; gap: 16px; }
.auth-card .lead { max-width: 56ch; }
.auth-form { margin: 0; }
.auth-unavailable { display: grid; gap: 12px; justify-items: start; }
.auth-google { width: 100%; max-width: 360px; min-height: 44px; }
.auth-google[disabled] { opacity: 0.55; cursor: not-allowed; filter: none; }
.auth-logout { padding: 0 14px; }
.page-auth { gap: 16px; }

@media (max-width: 860px) {
  html[data-auth="true"] .controls { display: flex; flex-wrap: wrap; justify-content: flex-end; }
  body[data-gate="true"] .main { padding-bottom: 40px; }
  .auth-google { max-width: none; }
}

/* Individual access administration: readable cards and an explicit, keyboard-friendly form. */
.access-panel { min-width: 0; }
.access-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.access-header .actions { margin-top: 0; flex-shrink: 0; }
.access-header .section-lead { margin-bottom: 0; }
.access-user-list { display: grid; gap: 16px; list-style: none; padding: 0; margin: 24px 0 0; }
.access-user-card { border: 1px solid var(--line); border-radius: 14px; padding: 24px; background: var(--surface); min-width: 0; }
.access-user-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.access-user-heading h3 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.access-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.access-user-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 20px 0; }
.access-user-facts div { min-width: 0; }
.access-user-facts dt { color: var(--muted); font-size: .78rem; margin-bottom: 3px; }
.access-user-facts dd { margin: 0; overflow-wrap: anywhere; font-size: .9rem; }
.access-form { max-width: 920px; margin-top: 24px; }
.access-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.access-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.access-field { max-width: none; align-content: start; }
.access-field input, .access-field select { min-height: 46px; width: 100%; min-width: 0; }
.access-field .note, .access-active-field .note { font-size: .8rem; line-height: 1.55; margin: 0; }
.access-field input[readonly] { opacity: .8; }
.field-error { min-height: 0; margin: 0; color: var(--danger); font-size: .82rem; line-height: 1.45; }
.field-error:empty { display: none; }
.access-form [aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 2px; }
.access-groups { min-width: 0; margin: 24px 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; }
.access-groups legend { padding: 0 8px; }
.access-group-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.access-check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; font-size: .9rem; cursor: pointer; }
.access-check input { width: 18px; height: 18px; flex-shrink: 0; margin: 1px 0 0; accent-color: var(--accent); }
.access-check span { overflow-wrap: anywhere; }
.access-notice { padding: 14px 16px; margin: 16px 0; font-size: .88rem; line-height: 1.55; }
.access-active-field { margin: 20px 0 28px; }
.access-form .actions { flex-wrap: wrap; }
.access-form .btn { min-height: 44px; white-space: normal; }
.access-success { padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--surface); line-height: 1.55; }
.access-conflict { padding: 20px; margin: 20px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.access-conflict h3 { margin-top: 0; }
.access-fields:disabled { opacity: .75; }
@media (max-width: 760px) {
  .access-header, .access-user-heading { flex-direction: column; gap: 14px; }
  .access-header .actions { width: 100%; }
  .access-user-card { padding: 18px; }
  .access-badges { justify-content: flex-start; }
  .access-form-grid, .access-group-grid, .access-user-facts { grid-template-columns: minmax(0, 1fr); }
  .access-groups { padding: 14px; }
  .access-form .actions .btn, .access-header .actions .btn { flex: 1 1 auto; }
}

/* Administrative catalog preview: existing cards/layout, clear private status. */
.page-admin-preview .preview-notice { margin-block: 1rem; }
.page-admin-preview .badge { white-space: normal; line-height: 1.5; }
.page-admin-preview .lesson-card-body { min-width: 0; }
.page-admin-preview .lesson-row-title { overflow-wrap: anywhere; }
