:root {
  --bg: #e8eef2;
  --bg2: #f7fafb;
  --ink: #14232b;
  --muted: #5c7380;
  --line: #d3dde4;
  --surface: #ffffff;
  --surface2: #f1f6f8;
  --accent: #0b7a75;
  --accent-ink: #065a56;
  --accent-soft: #d8f1ef;
  --ok: #1f8a5b;
  --ok-soft: #e5f6ee;
  --warn: #b86a12;
  --warn-soft: #fff1de;
  --bad: #c23b3b;
  --shadow: 0 10px 30px rgba(20, 35, 43, 0.06);
  --top-bg: rgba(247, 250, 251, 0.86);
  --nav-bg: rgba(255, 255, 255, 0.94);
  --bar-track: #e2eaef;
  --grid-line: rgba(20, 35, 43, 0.03);
  --atm-1: rgba(11, 122, 117, 0.18);
  --atm-2: rgba(20, 35, 43, 0.08);
  --atm-base: linear-gradient(180deg, #f4f8fa 0%, var(--bg) 45%, #e4ecef 100%);
  --hero-grad: linear-gradient(135deg, #0c6864 0%, #0b7a75 42%, #145a6e 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 64px;
  --bottom-nav-h: 68px;
  --max: 1120px;
  --font: "Figtree", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0d1418;
  --bg2: #121b21;
  --ink: #e8eef2;
  --muted: #93a8b4;
  --line: #2a3a44;
  --surface: #162229;
  --surface2: #1c2b34;
  --accent: #2bb3ac;
  --accent-ink: #7ee0da;
  --accent-soft: #163a38;
  --ok: #3ecf8e;
  --ok-soft: #143328;
  --warn: #f0b45a;
  --warn-soft: #3a2e18;
  --bad: #ef6b6b;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --top-bg: rgba(13, 20, 24, 0.9);
  --nav-bg: rgba(18, 27, 33, 0.94);
  --bar-track: #24343d;
  --grid-line: rgba(232, 238, 242, 0.04);
  --atm-1: rgba(43, 179, 172, 0.16);
  --atm-2: rgba(0, 0, 0, 0.35);
  --atm-base: linear-gradient(180deg, #10181e 0%, var(--bg) 50%, #0a1014 100%);
  --hero-grad: linear-gradient(135deg, #0a4f4c 0%, #0d6b66 45%, #123f52 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  font: 15px/1.5 var(--font);
  color: var(--ink);
  background: var(--bg);
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
}
@media (min-width: 900px) {
  body { padding-bottom: 0; }
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
}
code.small { font-size: 11px; word-break: break-all; }

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 8% -10%, var(--atm-1), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, var(--atm-2), transparent 55%),
    var(--atm-base);
}
.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
}

/* —— shell —— */
.shell-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--nav-h);
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--top-bg);
  backdrop-filter: blur(14px);
  animation: dropIn 0.45s ease both;
}
.shell-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  box-shadow: var(--shadow);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.theme-toggle:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.theme-toggle .ico-sun { display: none; }
.theme-toggle .ico-moon { display: inline; }
html[data-theme="dark"] .theme-toggle .ico-sun { display: inline; }
html[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #12948e, #0b7a75 55%, #085f5b);
  box-shadow: 0 8px 18px rgba(11, 122, 117, 0.28);
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand-text strong {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.brand-text small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(52vw, 360px);
}

.nav-desktop {
  display: none;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-desktop a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.nav-desktop a:hover {
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
}
.nav-desktop a.active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: rgba(11, 122, 117, 0.2);
}

.nav-mobile {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: var(--nav-bg);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
}
.nav-mobile a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
}
.nav-mobile a .nav-ico {
  font-size: 16px;
  line-height: 1;
  opacity: 0.85;
}
.nav-mobile a.active {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
body.is-reader .nav-mobile { display: none; }
body.is-reader { padding-bottom: 12px; }
@media (min-width: 900px) {
  body.is-reader { padding-bottom: 0; }
}
@media (min-width: 900px) {
  .nav-desktop { display: flex; }
  .nav-mobile { display: none; }
  .shell-top { padding: 12px 28px; }
}

.shell-main {
  width: min(100% - 28px, var(--max));
  margin: 0 auto;
  padding: 22px 0 36px;
  animation: riseIn 0.4s ease both;
}
@media (min-width: 900px) {
  .shell-main { width: min(100% - 48px, var(--max)); padding-top: 28px; }
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeCard {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* —— typography / surfaces —— */
h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
}
h4 { margin: 0 0 8px; font-size: 0.95rem; }
.muted { color: var(--muted); }
.lead { color: var(--muted); margin: 0 0 18px; max-width: 62ch; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.page-head .lead { margin: 6px 0 0; }
.page-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}
.box.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.box.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); color: var(--warn); }
.box.flat { box-shadow: none; }
.sync-status { margin: 0 0 18px; }
.jwt-health {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}
.jwt-health > div { flex: 1; min-width: 0; }
.jwt-health b,
.jwt-health span { display: block; }
.jwt-health > div > span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.jwt-health-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 15%, transparent);
}
.jwt-health.valid .jwt-health-dot {
  background: var(--ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 15%, transparent);
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--line);
  vertical-align: middle;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.pill.acc { background: var(--accent-soft); color: var(--accent-ink); border-color: #b6e0dd; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

/* Lista canônica produto → módulo */
.mod-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mod-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.mod-row.is-focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.mod-main {
  flex: 1 1 220px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  min-width: 0;
}
.mod-main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 10px;
}
.mod-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--line);
}
.mod-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mod-thumb.is-empty {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--surface2)), var(--surface2));
}
.mod-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mod-body > .card-desc {
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.mod-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.mod-title strong {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}
.mod-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
@media (max-width: 640px) {
  .mod-actions {
    width: 100%;
    margin-left: 0;
  }
  .mod-actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }
}
.chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  font-weight: 600;
  font-size: 13px;
  transition: 0.2s ease;
}
.chip.active, .chip:hover {
  color: var(--accent-ink);
  border-color: rgba(11, 122, 117, 0.35);
  background: var(--accent-soft);
  text-decoration: none;
}

.bar {
  height: 8px;
  background: var(--bar-track);
  border-radius: 99px;
  overflow: hidden;
  min-width: 90px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
.bar.block { display: block; width: 100%; min-width: 0; }
.bar.lg { height: 12px; }
.bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #12a39c, #0b7a75);
  border-radius: inherit;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}
@media (min-width: 980px) {
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  animation: fadeCard 0.45s ease both;
}
.stat:nth-child(2) { animation-delay: 0.04s; }
.stat:nth-child(3) { animation-delay: 0.08s; }
.stat:nth-child(4) { animation-delay: 0.12s; }
.stat:nth-child(5) { animation-delay: 0.16s; }
.stat:nth-child(6) { animation-delay: 0.2s; }
.stat b {
  display: block;
  font-family: var(--display);
  font-size: 1.55rem;
  color: var(--accent-ink);
  letter-spacing: -0.02em;
}
.stat span { color: var(--muted); font-size: 12px; font-weight: 600; }

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  color: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  animation: fadeCard 0.4s ease both;
}
button.card { font: inherit; width: 100%; }
.card:hover {
  border-color: rgba(11, 122, 117, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(20, 35, 43, 0.1);
  text-decoration: none;
}
.card.static { cursor: default; }
.card.static:hover { transform: none; border-color: var(--line); box-shadow: var(--shadow); }
.card-material {
  padding-top: 0;
  overflow: hidden;
}
.card-media {
  position: relative;
  margin: 0 -16px 4px;
  width: calc(100% + 32px);
  aspect-ratio: 16 / 9;
  background: #101820;
  overflow: hidden;
}
.card-media-poster,
.card-media-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-media-poster.ph {
  background:
    radial-gradient(circle at 30% 30%, rgba(11, 122, 117, 0.35), transparent 55%),
    linear-gradient(135deg, #152028, #0b1216);
}
.card-media-video {
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.card-media.is-playing .card-media-video { opacity: 1; }
.card-media.is-playing .card-media-poster { opacity: 0; }
.card-media-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(8, 14, 18, 0.72);
  color: #fff;
  font-size: 12px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.card-media-count {
  position: absolute;
  right: 10px;
  bottom: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(8, 14, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
}
.card-material:hover .card-media-badge {
  background: rgba(11, 122, 117, 0.9);
}
.card-material .card-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}
.material-capa {
  width: 120px;
  max-width: 28vw;
  border-radius: 10px;
  object-fit: cover;
  aspect-ratio: 3/4;
  background: var(--surface-2, #222);
  flex-shrink: 0;
}
.material-detail .page-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}
.prof-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}
.prof-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface, #1a1a1a) 88%, #fff 12%);
  font-size: 0.85rem;
}
.prof-chip img,
.prof-ph {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.prof-ph {
  display: inline-grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent, #3d8) 35%, #333);
  font-weight: 600;
  font-size: 0.75rem;
}
.card-material .card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}
@media (hover: none) {
  .card-media-video { display: none; }
}
.card-preview {
  margin-top: 4px !important;
  pointer-events: none;
}
.card-preview .more-hint,
.more-hint {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.card-material:focus-visible {
  outline: 2px solid var(--accent, #0b7a75);
  outline-offset: 2px;
}

/* Workspace do módulo: lista à esquerda, player livre no meio */
body.is-reader .shell-main {
  width: min(100% - 20px, 1440px);
  max-width: none;
  padding-top: 16px;
}
.material-detail.is-workspace {
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  min-height: calc(100vh - var(--nav-h) - 40px);
}
.mat-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - var(--nav-h) - 36px);
  position: sticky;
  top: calc(var(--nav-h) + 10px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.mat-sidebar-head {
  flex: 0 0 auto;
  padding: 12px 14px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface2);
}
.mat-side-back {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 12px;
}
.mat-sidebar-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.25;
}
.mat-sidebar-head .muted {
  margin: 4px 0 0;
  font-size: 12px;
}
.mat-side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.mat-side-actions .btn {
  padding: 6px 10px;
  font-size: 12px;
}
.mat-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
}
.mat-side-block + .mat-side-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.mat-side-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.mat-side-label span {
  font-variant-numeric: tabular-nums;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--line);
  letter-spacing: 0;
  text-transform: none;
}
.mat-side-empty {
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
}
.mat-nav,
.mat-vlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mat-nav-item,
.mat-vitem {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.mat-nav-item:hover,
.mat-vitem:hover {
  background: var(--surface2);
  text-decoration: none;
}
.mat-nav-item.is-active,
.mat-vitem.is-active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
}
.mat-vitem.is-disabled {
  opacity: 0.5;
  cursor: default;
}
.mat-kind {
  width: 66px;
  min-height: 30px;
  padding: 4px 5px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--surface2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.mat-kind.vid {
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--accent-soft);
}
.mat-kind.htm {
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface2));
}
.mat-kind.dec {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 40%, var(--line));
  background: var(--warn-soft);
}
.mat-kind.ban {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 35%, var(--line));
  background: var(--ok-soft);
}
.mat-nav-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mat-nav-title {
  font-weight: 650;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.mat-nav-meta {
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.mat-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mat-panel-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
}
.mat-panel-titles {
  min-width: 0;
  flex: 1 1 240px;
}
.mat-panel-titles h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.2;
}
.mat-panel-titles .muted {
  margin: 6px 0 0;
  font-size: 13px;
}
.mat-panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.mat-panel-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.prof-row.compact {
  margin: 0;
}
.mat-more {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 0 12px;
}
.mat-more > summary {
  cursor: pointer;
  padding: 10px 0;
  font-weight: 650;
  font-size: 13px;
  color: var(--muted);
  list-style: none;
}
.mat-more > summary::-webkit-details-marker { display: none; }
.mat-more-body {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 0 12px;
  align-items: flex-start;
}
.mat-more-body .material-capa {
  width: 72px;
}
.related-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.related-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.related-chip.is-active {
  border-color: rgba(11, 122, 117, 0.45);
  background: color-mix(in srgb, var(--surface) 88%, #0b7a75 12%);
}
.related-chip b { display: block; font-family: var(--display); margin-bottom: 2px; }
.related-chip .muted { font-size: 12px; }
.related-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Em telas compactas, a lista vem antes do player para facilitar a escolha. */
@media (max-width: 760px) {
  .material-detail.is-workspace {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .mat-sidebar {
    position: relative;
    top: auto;
    max-height: none;
    order: 1;
  }
  .mat-panel {
    order: 2;
  }
  .mat-sidebar-scroll {
    max-height: 52dvh;
  }
}

.player-stage {
  margin: 0;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0b1216;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #0b1216;
}
.player-frame video,
.player-frame iframe.vimeo-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0b1216;
}
.player-frame video[hidden] { display: none; }
.player-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  font-weight: 600;
}
.player-empty[hidden] { display: none; }
.player-now {
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.player-now b {
  font-family: var(--display);
  font-size: 1.05rem;
}

.video-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.video-list li,
.video-item {
  display: grid;
  grid-template-columns: 32px 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.video-item:hover {
  border-color: rgba(11, 122, 117, 0.45);
  transform: translateY(-1px);
}
.video-item.is-active {
  border-color: rgba(11, 122, 117, 0.55);
  background: color-mix(in srgb, var(--surface) 86%, #0b7a75 14%);
}
.video-item.is-disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}
.video-item.is-disabled:hover {
  border-color: var(--line);
  transform: none;
}
.video-idx {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent, #0b7a75);
  background: color-mix(in srgb, var(--accent, #0b7a75) 14%, transparent);
}
.video-thumb {
  width: 72px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  background: #152028;
}
.video-thumb.ph {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}
.video-body { min-width: 0; }
.video-body b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.video-body .muted { font-size: 12px; }
.play-pill { pointer-events: none; }
@media (max-width: 560px) {
  .video-item {
    grid-template-columns: 28px 56px 1fr;
  }
  .video-item .pill {
    grid-column: 3;
    justify-self: start;
  }
  .video-thumb { width: 56px; height: 34px; }
}
.card strong {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card span { color: var(--muted); font-size: 13px; }
.card .card-foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.produtos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.produtos span {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  min-width: 120px;
}

/* —— hero home —— */
.hero-study {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 4px);
  padding: 22px 20px 20px;
  margin-bottom: 20px;
  color: #f4fbfa;
  background:
    radial-gradient(500px 220px at 90% 10%, rgba(255, 255, 255, 0.16), transparent 55%),
    var(--hero-grad);
  box-shadow: 0 18px 40px rgba(11, 122, 117, 0.25);
  animation: riseIn 0.5s ease both;
}
.hero-study h2 {
  color: #fff;
  margin-bottom: 6px;
  font-size: clamp(1.7rem, 4vw, 2.25rem);
}
.hero-study p { margin: 6px 0; }
.hero-study .muted { color: rgba(244, 251, 250, 0.78); }
.hero-study code {
  background: rgba(0, 0, 0, 0.18);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* —— home orientada a produtos —— */
.home-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 8px 2px 22px;
}
.home-intro h2 {
  margin: 2px 0 6px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}
.home-intro p:not(.eyebrow) {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
}
.home-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.home-summary span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.home-summary b { color: var(--ink); }
.home-product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 30px;
}
.home-product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.home-product-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--product-color, var(--accent)) 48%, var(--line));
  box-shadow: 0 16px 32px rgba(20, 35, 43, 0.11);
}
.home-product-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 122px;
  padding: 18px;
  color: inherit;
  background:
    radial-gradient(260px 130px at 100% 0%, color-mix(in srgb, var(--product-color, var(--accent)) 13%, transparent), transparent 72%);
}
.home-product-main:hover { text-decoration: none; }
.home-product-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--product-color, var(--accent)) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--product-color, var(--accent)) 34%, var(--line));
  color: var(--product-color, var(--accent-ink));
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
}
.home-product-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}
.home-product-copy small {
  color: var(--product-color, var(--accent-ink));
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.home-product-copy strong {
  margin: 2px 0 4px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.3rem;
}
.home-product-copy > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.home-product-arrow {
  color: var(--product-color, var(--accent));
  font-size: 1.35rem;
  transition: transform 0.18s ease;
}
.home-product-main:hover .home-product-arrow { transform: translateX(3px); }
.home-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.home-product-years {
  display: flex;
  gap: 7px;
  padding: 0 18px 16px;
}
.home-product-years a {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.home-product-years a:hover,
.home-product-years a.active {
  border-color: color-mix(in srgb, var(--product-color, var(--accent)) 45%, var(--line));
  background: color-mix(in srgb, var(--product-color, var(--accent)) 10%, var(--surface));
  color: var(--product-color, var(--accent-ink));
  text-decoration: none;
}
.product-med { --product-color: #0f9f97; }
.product-medcurso { --product-color: #4878d0; }
.product-intensivo { --product-color: #be7641; }
.product-foco { --product-color: #8b63c7; }
.product-nopapo { --product-color: #d05d7f; }
.home-tools-label,
.home-status-label { margin-top: 0; }
.home-tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 30px;
}
.home-tool-grid > a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
}
.home-tool-grid > a:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  text-decoration: none;
}
.home-tool-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 700;
}
.home-tool-grid > a > span:nth-child(2) {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}
.home-tool-grid b { font-size: 13px; }
.home-tool-grid small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-tool-grid i {
  color: var(--muted);
  font-style: normal;
}
@media (min-width: 680px) {
  .home-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .home-product-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .home-product-card { grid-column: span 3; }
  .home-product-card:nth-child(n + 3) { grid-column: span 2; }
  .section-label.home-tools-label,
  .home-tool-grid { display: none; }
}
@media (max-width: 700px) {
  .home-intro { align-items: flex-start; flex-direction: column; gap: 14px; }
  .home-summary { justify-content: flex-start; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  transition: 0.18s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent-ink); text-decoration: none; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-ink); color: #fff; }
.btn.ghost-light {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.btn.ghost-light:hover { background: rgba(255, 255, 255, 0.24); color: #fff; }

.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 12px;
}
.section-label a { font-weight: 600; font-size: 13px; }

/* —— tables / responsive list —— */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 640px;
  background: var(--surface);
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 0;
  vertical-align: middle;
  background: var(--surface);
  position: relative;
}
th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface2);
  position: sticky;
  top: 0;
  z-index: 1;
}
/* linha por cima do conteúdo — não é coberta pelos botões */
.table-wrap tbody td::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--line);
  pointer-events: none;
  z-index: 2;
}
.table-wrap thead th::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--line);
  pointer-events: none;
}
.table-wrap tbody tr:last-child td::after { display: none; }
.table-wrap tbody td:last-child {
  width: 1%;
  white-space: nowrap;
}
.actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}
.actions .btn {
  flex: 0 0 auto;
}

.item-list { display: none; gap: 10px; }
.item-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.item-card .item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.item-card .item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.item-card .item-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 760px) {
  .desktop-only { display: none !important; }
  .item-list { display: grid; }
  table.mobile-hide, .table-wrap.mobile-hide { display: none; }
}

ul.compact { columns: 1; gap: 20px; margin: 8px 0; padding-left: 18px; }
@media (min-width: 720px) {
  ul.compact { columns: 2; }
}
ul.tree { margin: 8px 0; padding-left: 18px; color: var(--muted); }
details summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--accent);
  transition: transform 0.15s ease;
}
details[open] summary::before { transform: rotate(90deg); }

/* —— reader —— */
.reader { max-width: 820px; margin: 0 auto; }
.reader-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 8px;
}
.back {
  display: inline-flex;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.reader-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.toggle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
}
.q-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
}
.q-nav select {
  grid-column: 1 / -1;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 12px;
  font: inherit;
}
.q-nav input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
@media (min-width: 720px) {
  .q-nav {
    display: flex;
    flex-wrap: wrap;
  }
  .q-nav select {
    grid-column: auto;
    min-width: 110px;
  }
  .q-nav input[type="range"] { flex: 1; min-width: 140px; }
}

.q-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 18px;
  box-shadow: var(--shadow);
}
.enunciado {
  font-size: 1.02rem;
  margin-bottom: 16px;
  white-space: pre-wrap;
  line-height: 1.55;
}
.alts { list-style: none; padding: 0; margin: 0 0 14px; }
.alts li { margin-bottom: 8px; }
.alt {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface2);
  color: inherit;
  font: inherit;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.alt:not(:disabled):hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface2));
  transform: translateY(-1px);
}
.alt:disabled {
  opacity: 1;
  cursor: default;
}
.alt.is-correct {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line));
  background: var(--ok-soft);
}
.alt.is-wrong {
  border-color: color-mix(in srgb, var(--bad) 58%, var(--line));
  background: color-mix(in srgb, var(--bad) 13%, var(--surface));
}
.alt.is-muted { opacity: 0.62; }
.alt.is-correct .letra {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 18%, var(--surface));
}
.alt.is-wrong .letra {
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 15%, var(--surface));
}
.alt-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.alt-text p:first-child { margin-top: 0; }
.alt-text p:last-child { margin-bottom: 0; }
.alt-result {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 800;
}
.alt.is-correct .alt-result {
  color: #fff;
  background: var(--ok);
}
.alt.is-wrong .alt-result {
  color: #fff;
  background: var(--bad);
}
.letra {
  display: inline-grid;
  place-items: center;
  width: 1.6em;
  height: 1.6em;
  margin-right: 6px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 12px;
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.comentario { font-size: 14px; }
.comentario p { margin: 0 0 8px; }
.gab { margin-top: 4px; }
.answer-hint {
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface2);
  font-size: 13px;
}
.answer-feedback {
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.answer-feedback.is-correct {
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
  color: var(--ok);
  background: var(--ok-soft);
}
.answer-feedback.is-wrong {
  border-color: color-mix(in srgb, var(--bad) 45%, var(--line));
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 12%, var(--surface));
}

.thumb-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 16px;
  overflow-x: auto;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 720px) {
  .thumb-strip { flex-wrap: wrap; max-height: 150px; overflow: auto; }
}
.thumb {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.thumb.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}
.thumb.has { box-shadow: inset 0 -3px 0 var(--ok); }

.pdf-embed {
  width: 100%;
  height: 280px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 8px;
  background: #111;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-weight: 600;
}

.mod-row.is-pending {
  opacity: 0.92;
  border-color: color-mix(in srgb, var(--warn, #c9852a) 45%, var(--line));
}
/* —— calendário MED FOCO —— */
.cal-filters summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  cursor: pointer;
}
.cal-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
  align-items: end;
}
.cal-filters-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.cal-filters-grid select,
.cal-filters-grid input[type="search"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}
.cal-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  padding-bottom: 10px;
  font-size: 13px !important;
  color: var(--text) !important;
}
.cal-filter-stats { margin-top: 12px; font-size: 13px; }
.cal-program-link {
  display: flex;
  gap: inherit;
  align-items: inherit;
  justify-content: inherit;
  width: 100%;
  color: inherit;
  text-decoration: none;
}
.cal-program-link:hover b { color: var(--accent); }

.cal-page-head { align-items: flex-end; }
.cal-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.cal-stats .stat { min-width: 0; }

.cal-next {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--ink);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.cal-next:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}
.cal-next-date {
  width: 58px;
  height: 58px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  line-height: 1.05;
}
.cal-next-date b { font-size: 18px; }
.cal-next-date small { font-size: 10px; opacity: 0.86; }
.cal-next > span:nth-child(2) { display: grid; gap: 2px; }
.cal-next > span:nth-child(2) small {
  color: var(--accent-ink);
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 700;
}
.cal-next-arrow { color: var(--accent); font-size: 24px; }

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0 12px;
}
.cal-view-switch {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface2);
}
.cal-view-switch button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 6px 14px;
  font: 600 13px/1 var(--font);
  cursor: pointer;
}
.cal-view-switch button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(20, 35, 43, 0.08);
}

.calendar-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}
.calendar-card,
.calendar-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.calendar-card { overflow: hidden; }
.calendar-detail {
  padding: 18px;
  position: sticky;
  top: calc(var(--nav-h) + 14px);
  max-height: calc(100dvh - var(--nav-h) - 34px);
  overflow: auto;
}
.cal-month-title {
  min-height: 64px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.cal-month-title div {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
}
.cal-month-title b {
  font: 700 20px/1.2 var(--display);
  text-transform: capitalize;
}
.cal-month-title span { color: var(--muted); font-size: 13px; }
.cal-nav-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--ink);
  font: 24px/1 var(--font);
  cursor: pointer;
}
.cal-nav-btn:hover { border-color: var(--accent); color: var(--accent); }

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal-weekdays {
  border-bottom: 1px solid var(--line);
  background: var(--surface2);
}
.cal-weekdays span {
  padding: 8px 4px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cal-day {
  position: relative;
  min-width: 0;
  min-height: 105px;
  padding: 8px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
}
.cal-day.is-clickable {
  cursor: pointer;
}
.cal-day.is-clickable:hover {
  background: color-mix(in srgb, var(--accent-soft) 28%, var(--surface));
}
.cal-day.is-clickable:focus {
  outline: none;
}
.cal-day.is-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  z-index: 1;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:nth-last-child(-n + 7) { border-bottom: 0; }
.cal-day.is-outside { background: var(--surface2); }
.cal-day.is-outside .cal-day-number { opacity: 0.42; }
.cal-day.is-selected { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.cal-day.is-clickable.is-selected:hover {
  background: color-mix(in srgb, var(--accent-soft) 65%, var(--surface));
}
.cal-day-number {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  border-radius: 50%;
  flex: 0 0 auto;
}
.cal-day.is-today .cal-day-number {
  background: var(--accent);
  color: #fff;
}
.cal-event {
  width: 100%;
  margin-top: auto;
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--warn) 26%, var(--line));
  border-radius: 9px;
  background: var(--warn-soft);
  color: var(--warn);
  display: grid;
  gap: 1px;
  text-align: left;
  font: inherit;
  pointer-events: none;
  box-sizing: border-box;
}
.cal-day.is-clickable:hover .cal-event,
.cal-day.is-selected .cal-event { border-color: var(--warn); }
.cal-event.is-open {
  border-color: color-mix(in srgb, var(--ok) 30%, var(--line));
  background: var(--ok-soft);
  color: var(--ok);
}
.cal-event span { font-size: 11px; font-weight: 700; }
.cal-event small { font-size: 9px; opacity: 0.9; }

.cal-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.cal-detail-head h2 {
  margin: 2px 0 1px;
  font: 700 20px/1.25 var(--display);
  text-transform: capitalize;
}
.cal-detail-head p { margin: 0; }
.cal-detail-count {
  margin: 16px 0 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 13px;
}
.cal-detail-count b { color: var(--ink); }
.cal-program {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.cal-program li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.cal-program li:last-child { border-bottom: 0; }
.cal-program li > div { min-width: 0; display: grid; gap: 3px; }
.cal-program li b { font-size: 13px; line-height: 1.35; }
.cal-program li small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.cal-program-type {
  border-radius: 6px;
  padding: 3px 6px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}
.cal-status-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--warn);
}
.cal-status-dot.is-open { background: var(--ok); }
.cal-empty-detail {
  min-height: 220px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}
.cal-empty-detail p { max-width: 220px; }
.cal-empty-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
}

.calendar-list-modern {
  display: grid;
  gap: 9px;
}
.cal-list-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cal-list-item[open] { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); }
.cal-list-item summary {
  list-style: none;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 12px 15px;
  cursor: pointer;
}
.cal-list-item summary::-webkit-details-marker { display: none; }
.cal-list-date {
  height: 54px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 12px;
  background: var(--surface2);
  line-height: 1;
}
.cal-list-date b { font-size: 20px; }
.cal-list-date small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.cal-list-copy { display: grid; gap: 2px; min-width: 0; }
.cal-list-copy small { color: var(--muted); }
.cal-list-detail {
  padding: 0 18px 16px 82px;
  border-top: 1px solid var(--line);
}
.cal-list-detail .cal-detail-head { margin-top: 16px; }

@media (max-width: 900px) {
  .calendar-shell { grid-template-columns: 1fr; }
  .calendar-detail { position: static; max-height: none; }
}

@media (max-width: 640px) {
  .cal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-toolbar { align-items: flex-start; flex-direction: column; }
  .cal-toolbar .muted { font-size: 11px; }
  .cal-view-switch { width: 100%; }
  .cal-view-switch button { flex: 1; }
  .cal-next { padding: 11px; grid-template-columns: auto 1fr; }
  .cal-next-arrow { display: none; }
  .cal-next-date { width: 50px; height: 50px; }
  .cal-day { min-height: 72px; padding: 4px; }
  .cal-day-number { width: 22px; height: 22px; font-size: 11px; }
  .cal-event { min-height: 26px; padding: 4px 5px; }
  .cal-event span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
  }
  .cal-event small { display: block; font-size: 8px; }
  .cal-weekdays span { font-size: 9px; }
  .cal-list-item summary { grid-template-columns: 48px minmax(0, 1fr); padding: 10px; }
  .cal-list-item summary .pill { display: none; }
  .cal-list-date { height: 48px; }
  .cal-list-detail { padding: 0 12px 12px; }
}

@media (max-width: 480px) {
  .shell-main { width: min(100% - 20px, var(--max)); padding-top: 16px; }
  .hero-study { padding: 18px 16px; }
  .brand-text small { max-width: 48vw; }
}

.slide-downloads {
  margin-bottom: 18px;
}
.slide-downloads summary {
  cursor: pointer;
}
.slide-download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.slide-download-item {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  background: var(--surface2);
}
.slide-download-item:hover {
  border-color: var(--accent);
}
.slide-download-item.is-unavailable {
  opacity: 0.72;
  cursor: default;
}
.slide-download-item.is-unavailable:hover {
  border-color: var(--line);
}
.slide-download-item span {
  color: var(--muted);
  font-size: 12px;
}
.slide-download-item small {
  color: var(--warn);
  font-size: 11px;
}

/* Banco de questões */
.bank-page {
  display: grid;
  gap: 22px;
}
.bank-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding: clamp(22px, 4vw, 38px);
  border-radius: 22px;
  color: #f4fffe;
  background:
    radial-gradient(520px 220px at 95% 0%, rgba(126, 224, 218, 0.2), transparent 70%),
    var(--hero-grad);
  box-shadow: 0 18px 42px rgba(8, 86, 82, 0.2);
}
.bank-hero .eyebrow {
  margin: 0 0 8px;
  color: rgba(244, 255, 254, 0.7);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.bank-hero h2 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.3rem);
}
.bank-hero p:last-child {
  max-width: 58ch;
  margin: 0;
  color: rgba(244, 255, 254, 0.78);
}
.bank-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 8px;
}
.bank-hero-stats span {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(5, 42, 46, 0.22);
  backdrop-filter: blur(10px);
}
.bank-hero-stats b {
  font-family: var(--display);
  font-size: 1.45rem;
}
.bank-hero-stats small {
  color: rgba(244, 255, 254, 0.7);
}
.bank-filter-block {
  padding: 16px 18px 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.bank-filter-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bank-dedupe-note {
  display: flex;
  align-items: center;
  gap: 10px 18px;
  margin: 0;
  background: color-mix(in srgb, var(--ok-soft) 65%, var(--surface));
  border-color: color-mix(in srgb, var(--ok) 30%, var(--line));
}
.bank-dedupe-note b {
  color: var(--ok);
  white-space: nowrap;
}
.bank-dedupe-note span {
  color: var(--muted);
}
.bank-section-label {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}
.bank-section-label > div > span,
.bank-year-group header div > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.bank-section-label h3 {
  margin: 2px 0 0;
  font-size: 1.45rem;
}
.bank-area-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.bank-page.has-selection .bank-area-grid {
  grid-template-columns: 1fr;
}
.bank-area-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 98px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: inherit;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.bank-area-card:hover,
.bank-area-card.active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface));
  text-decoration: none;
  transform: translateY(-2px);
}
.bank-area-code {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.bank-area-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.bank-area-copy strong {
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.2;
}
.bank-area-copy small,
.bank-area-copy > span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}
.bank-area-card > i {
  color: var(--accent);
  font-style: normal;
  font-size: 18px;
}
.bank-results {
  display: grid;
  gap: 18px;
}
.bank-empty-selection {
  min-height: 190px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.bank-empty-selection > span {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 50%;
  color: var(--accent-ink);
  background: var(--accent-soft);
  font-size: 22px;
}
.bank-empty-selection h3 { margin: 0 0 5px; }
.bank-empty-selection p { max-width: 52ch; margin: 0; color: var(--muted); }
.bank-year-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.bank-year-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface2);
}
.bank-year-group header h3 { margin: 0; }
.bank-year-group > header > span {
  color: var(--muted);
  font-size: 12px;
}
.bank-list {
  display: grid;
}
.bank-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: inherit;
}
.bank-list-item:last-child { border-bottom: 0; }
.bank-list-item:hover {
  background: var(--surface2);
  text-decoration: none;
}
.bank-list-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.bank-list-main strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.bank-list-main small {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.bank-question-count {
  min-width: 90px;
  display: grid;
  text-align: right;
}
.bank-question-count b { font-variant-numeric: tabular-nums; }
.bank-question-count small { color: var(--muted); }
.bank-open {
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.bank-open i { font-style: normal; }

@media (max-width: 900px) {
  .bank-area-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .bank-page { gap: 16px; }
  .bank-hero {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 22px 18px;
  }
  .bank-hero-stats { width: 100%; }
  .bank-hero-stats span { min-height: 74px; padding: 11px 12px; }
  .bank-dedupe-note { align-items: flex-start; flex-direction: column; }
  .bank-area-grid { grid-template-columns: 1fr; }
  .bank-area-card { min-height: 88px; }
  .bank-list-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px;
  }
  .bank-question-count { min-width: 74px; }
  .bank-open {
    grid-column: 1 / -1;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }
  .bank-year-group > header { align-items: flex-end; }
  .bank-year-group > header > span { max-width: 55%; text-align: right; }
}
