:root {
  --joy-blue: #2D9CFF;
  --growth-green: #6BCB3D;
  --discovery-yellow: #FFD93D;
  --energy-red: #FF5A5A;
  --creative-purple: #7B61FF;
  --turquoise: #29C7C9;
  --ink: #213047;
  --muted: #65738a;
  --paper: #fffaf0;
  --panel: rgba(255, 255, 255, 0.88);
  --line: rgba(49, 65, 92, 0.16);
  --blue: var(--joy-blue);
  --blue-deep: #167ad1;
  --gold: var(--discovery-yellow);
  --rose: var(--energy-red);
  --green: var(--growth-green);
  --shadow: 0 18px 55px rgba(26, 45, 76, 0.16);
}

.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 217, 61, 0.24), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(41, 199, 201, 0.18), transparent 30%),
    linear-gradient(135deg, #f7fcff 0%, #fffdf3 100%);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: min(720px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 2px solid rgba(45, 156, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(40, 80, 120, 0.16);
  padding: 28px;
}

.auth-logo {
  display: block;
  width: min(260px, 72vw);
  margin: 0 auto 18px;
}

.auth-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}

.auth-form {
  display: none;
  gap: 14px;
}

.auth-form.active {
  display: grid;
}

.auth-form h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--title-font);
  text-align: center;
}

.auth-form p,
.auth-back,
.auth-message {
  text-align: center;
}

.auth-message {
  min-height: 24px;
  color: var(--green);
  font-weight: 800;
}

.auth-message.error {
  color: var(--red);
}

.auth-message .renewal-payment-link {
  margin-top: 10px;
}

.action-message {
  display: none;
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(107, 203, 61, 0.14);
  border: 1px solid rgba(107, 203, 61, 0.38);
  color: #276414;
  font-weight: 900;
}

.action-message.visible {
  display: block;
}

.action-message.error {
  background: rgba(255, 90, 90, 0.12);
  border-color: rgba(255, 90, 90, 0.38);
  color: #b42b2b;
}

.auth-back {
  display: block;
  color: var(--blue);
  font-weight: 800;
}

.user-admin-list {
  display: grid;
  gap: 12px;
}

.user-admin-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: #fff;
  border: 1px solid rgba(45, 156, 255, 0.16);
  border-radius: 14px;
}

.user-admin-card.pending {
  border-color: rgba(255, 90, 90, 0.32);
}

.user-admin-card strong,
.user-admin-card span,
.user-admin-card small,
.user-admin-card em {
  display: block;
}

.user-admin-card em {
  color: var(--red);
  font-weight: 800;
  font-style: normal;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.communication-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.communication-grid h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: var(--title-font);
}

.communication-recipient-card,
.communication-campaign-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(45, 156, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
}

.communication-recipient-card strong,
.communication-campaign-card strong {
  color: var(--ink);
}

.communication-recipient-card span,
.communication-recipient-card small,
.communication-campaign-card span,
.communication-campaign-card small {
  color: var(--muted);
}

.communication-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 760px) {
  .communication-grid {
    grid-template-columns: 1fr;
  }
}

.profile-card {
  width: min(760px, 100%);
}

.admin-export-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.access-log-list {
  display: grid;
  gap: 10px;
}

.access-log-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(45, 156, 255, 0.16);
  border-radius: 12px;
  background: #fff;
}

.access-log-card strong,
.access-log-card span,
.access-log-card small {
  display: block;
}

.access-log-card span,
.access-log-card small {
  color: var(--muted);
  font-weight: 800;
}

.user-access-control {
  display: grid;
  gap: 4px;
  min-width: 150px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.user-access-control select {
  min-height: 42px;
  border: 1px solid rgba(45, 156, 255, 0.18);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Nunito, Poppins, Montserrat, "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(180deg, rgba(246, 251, 255, 0.92), rgba(255, 250, 239, 0.96)),
    #f7fbff;
}

h1,
h2,
h3,
.tab,
.icon-button,
.lesson-card strong {
  font-family: "Baloo 2", Fredoka, Nunito, "Segoe UI", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

#skyCanvas {
  position: fixed;
  inset: 0;
  z-index: -1;
}

.app-shell {
  width: min(1420px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar,
.toolbar,
.editor,
.data-panel,
.lesson-list,
.lesson-reader {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar {
  position: relative;
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-radius: 8px;
  overflow: visible;
}

.topbar-actions {
  position: relative;
  z-index: 90;
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 0;
  overflow: visible;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.brand-logo {
  width: 124px;
  height: auto;
  display: block;
}

.brand-mark svg {
  width: 30px;
  height: 30px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  letter-spacing: 0;
}

.brand p,
.data-panel p,
.reader-empty p {
  color: var(--muted);
}

.tabs {
  position: relative;
  z-index: 90;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  padding: 6px;
  border: 1px solid rgba(45, 156, 255, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(246, 252, 255, 0.68)),
    rgba(255, 255, 255, 0.58);
  overflow: visible;
}

.nav-main {
  width: min(100%, 920px);
  align-items: center;
}

.tab {
  --tab-accent: var(--blue-deep);
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #41506a;
  background: rgba(255, 255, 255, 0.68);
  font-weight: 900;
}

.tab:nth-child(1) { --tab-accent: #2f7da4; }
.tab:nth-child(2) { --tab-accent: #4f8f73; }
.tab:nth-child(3) { --tab-accent: #a56d16; }
.tab:nth-child(4) { --tab-accent: #7b4f9d; }
.tab:nth-child(5) { --tab-accent: #b84f6a; }
.tab.admin-link { --tab-accent: #244c79; }

.brand-home-link {
  border: 0;
  background: transparent;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.nav-menu {
  position: relative;
}

.nav-menu[open] {
  z-index: 110;
}

.nav-menu summary {
  list-style: none;
  cursor: pointer;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-submenu {
  position: absolute;
  z-index: 120;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 220px;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(45, 156, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 38px rgba(31, 77, 117, 0.18);
}

.nav-submenu .tab {
  justify-content: flex-start;
  width: 100%;
}

.tab:hover {
  border-color: color-mix(in srgb, var(--tab-accent) 34%, white);
  color: var(--tab-accent);
}

.tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--tab-accent), color-mix(in srgb, var(--tab-accent) 72%, #29c7c9));
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) repeat(5, minmax(130px, 0.7fr));
  gap: 10px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(45, 156, 255, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92), rgba(248,252,255,0.76)),
    rgba(255,255,255,0.78);
  box-shadow: 0 14px 34px rgba(31, 77, 117, 0.08);
}

.toolbar label {
  gap: 7px;
}

.toolbar input,
.toolbar select {
  min-height: 44px;
  border-radius: 10px;
  border-color: rgba(119, 143, 174, 0.26);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
  font-size: 0.9rem;
}

.toolbar input[type="month"] {
  max-width: 210px;
  font-variant-numeric: tabular-nums;
}

.filter-hidden {
  display: none !important;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  outline: none;
}

input,
select {
  padding: 0 12px;
}

textarea {
  min-height: 120px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.5;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(45, 156, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
}

.rich-toolbar button,
.rich-toolbar select,
.rich-toolbar input[type="color"] {
  width: auto;
  min-height: 34px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 900;
}

.rich-toolbar button {
  padding: 0 10px;
  border: 1px solid rgba(45, 156, 255, 0.18);
  color: #15456d;
  background: #fff;
}

.rich-toolbar select {
  max-width: 110px;
  padding: 0 8px;
}

.rich-toolbar input[type="color"] {
  width: 42px;
  padding: 3px;
}

.rich-source {
  display: none !important;
}

.rich-surface {
  width: 100%;
  min-height: 140px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  line-height: 1.55;
  outline: none;
  overflow: hidden auto;
}

.rich-surface[data-large-text="true"],
.editor textarea[rows="4"],
.editor textarea[rows="5"],
.editor textarea[rows="8"] {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

.rich-surface:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(55, 119, 168, 0.16);
}

.rich-surface ul,
.rich-surface ol {
  margin: 0.5rem 0 0.5rem 1.2rem;
  padding-left: 1rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(55, 119, 168, 0.16);
}

.icon-button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  white-space: nowrap;
}

.icon-button.primary {
  color: #fff;
  border-color: transparent;
  background: var(--blue-deep);
}

.icon-button.accent {
  color: #3f2e08;
  border-color: rgba(216, 167, 47, 0.38);
  background: linear-gradient(135deg, #ffe6a3, #f6c95f);
}

.icon-button.light {
  color: var(--blue-deep);
  background: rgba(255, 255, 255, 0.9);
}

.icon-button.danger {
  color: #9b2430;
}

.view {
  display: none;
}

.view.active {
  display: grid;
}

.admin-only {
  display: none !important;
}

.admin-only.visible {
  display: inline-flex !important;
}

.master-only {
  display: none !important;
}

.master-only.visible {
  display: initial !important;
}

button.master-only.visible,
.manage-tab.master-only.visible {
  display: inline-flex !important;
}

.auth-slot {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(45, 156, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.auth-name {
  max-width: 260px;
  padding: 0 10px;
  color: var(--ink);
  font-weight: 1000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-bell {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(45, 156, 255, 0.18);
  cursor: pointer;
}

.notification-bell span {
  font-size: 1.25rem;
}

.notification-bell strong {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--energy-red);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1;
}

.notification-bell:not(.has-news) strong {
  background: #aab5c4;
}

.news-home-section {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.news-home-list,
.news-drawer-list {
  display: grid;
  gap: 14px;
}

.news-home-list {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.news-card {
  display: grid;
  gap: 14px;
  align-content: space-between;
  padding: 18px;
  border: 1px solid rgba(45, 156, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 32px rgba(33, 48, 71, 0.09);
}

.news-card.featured {
  border-color: rgba(255, 217, 61, 0.8);
  background: linear-gradient(135deg, #fff 0%, #fff9d7 100%);
}

.news-card.seen {
  opacity: 0.72;
}

.news-card h3 {
  margin: 8px 0 6px;
  font-family: var(--title-font);
  color: var(--ink);
}

.news-card p,
.news-card small {
  margin: 0;
  color: var(--muted);
}

.news-type {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(41, 199, 201, 0.14);
  color: #087d80;
  font-weight: 900;
  font-size: 0.78rem;
}

.news-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(33, 48, 71, 0.32);
}

.news-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(420px, calc(100vw - 24px));
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  padding: 22px;
  background: #fff;
  box-shadow: -22px 0 48px rgba(33, 48, 71, 0.18);
  transform: translateX(105%);
  transition: transform 0.22s ease;
  overflow-y: auto;
}

.news-drawer.open {
  transform: translateX(0);
}

.news-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.news-drawer-header h2 {
  margin: 0;
  font-family: var(--title-font);
  color: var(--ink);
}

.news-admin-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

#studyView {
  grid-template-columns: 360px 1fr;
  gap: 18px;
  align-items: start;
}

.content-layout {
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

#devotionalList,
#trainingList,
#ebfList {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 292px);
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 0 0 8px;
  scroll-snap-type: x proximity;
}

#devotionalList .lesson-card,
#trainingList .lesson-card,
#ebfList .lesson-card {
  min-height: 100%;
  margin-bottom: 0;
  scroll-snap-align: start;
}

.content-layout .lesson-list {
  position: static;
  max-height: none;
  overflow: hidden;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lesson-list,
.lesson-reader,
.editor,
.data-panel {
  border-radius: 8px;
}

.lesson-list {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 142px);
  overflow: auto;
  padding: 14px;
}

.list-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.lesson-row-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#lessonCount {
  color: var(--muted);
  font-size: 0.86rem;
}

.lesson-card {
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.68)),
    linear-gradient(135deg, var(--lesson-soft, #eef5fb), rgba(255, 255, 255, 0.62));
}

.lesson-card.active {
  border-color: rgba(55, 119, 168, 0.55);
  border-color: color-mix(in srgb, var(--lesson-primary, #3777a8) 58%, white);
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(36, 76, 121, 0.12);
}

.lesson-card strong {
  font-size: 1rem;
}

.lesson-card-age {
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  color: #3f2e08;
  background: rgba(255, 217, 61, 0.32);
  font-size: 0.74rem;
  font-weight: 1000;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-card-topic {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--lesson-primary, #15456d);
  background: color-mix(in srgb, var(--lesson-soft, #eef5fb) 78%, white);
  font-size: 0.72rem;
  font-weight: 1000;
  line-height: 1;
}

.lesson-card-verse {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--lesson-primary, #15456d);
  background: color-mix(in srgb, var(--lesson-accent, #ffd93d) 25%, white);
  font-size: 0.84rem;
  font-weight: 1000;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devotional-card .devotional-card-title,
.devotional-card .devotional-card-category,
.devotional-card .devotional-card-verse {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
}

.devotional-card .devotional-card-title {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 1000;
  line-height: 1.25;
  white-space: normal;
}

.devotional-card .devotional-card-category {
  color: #7b641c;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.devotional-card .devotional-card-verse {
  color: var(--lesson-primary, #15456d);
  font-size: 0.84rem;
  font-weight: 1000;
  line-height: 1.25;
  white-space: nowrap;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(212, 167, 44, 0.35);
  border-radius: 999px;
  color: #775714;
  background: rgba(255, 245, 205, 0.75);
  font-size: 0.78rem;
  font-weight: 700;
}

.lesson-reader {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  background: rgba(255, 252, 245, 0.94);
}

.reader-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 620px;
  padding: 36px;
  text-align: center;
}

.reader-empty svg {
  width: 72px;
  height: 72px;
  color: var(--gold);
}

.reader-hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  min-height: 190px;
  padding: 30px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(36, 76, 121, 0.94), rgba(95, 148, 111, 0.88)),
    var(--blue-deep);
}

.reader-hero::after {
  content: "";
  position: absolute;
  right: 42px;
  bottom: -34px;
  width: 190px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: -72px 18px 0 rgba(255, 255, 255, 0.12), 60px 10px 0 rgba(255, 255, 255, 0.11);
}

.reader-kicker {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.reader-hero h2 {
  max-width: 820px;
  font-size: clamp(1.9rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.reader-verse {
  margin-top: 12px;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.05rem;
}

.halo {
  position: absolute;
  inset: 24px auto auto 28px;
  width: 108px;
  height: 108px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  opacity: 0.35;
}

.section-timeline {
  display: grid;
  gap: 18px;
  padding: 24px 30px 34px;
}

.lesson-section {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
}

.section-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  background: var(--gold);
  box-shadow: 0 8px 18px rgba(212, 167, 44, 0.26);
}

.section-body {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(49, 65, 92, 0.12);
}

.lesson-section:last-child .section-body {
  border-bottom: 0;
}

.section-body h3 {
  margin-bottom: 8px;
  color: var(--blue-deep);
  font-size: 1.05rem;
  text-transform: uppercase;
}

.section-body p {
  color: #31425c;
  line-height: 1.7;
  white-space: normal;
}

.manage-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.video-manager {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.manager-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.manager-heading h2,
.trails-header h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.manager-heading p,
.trails-header p,
.muted-line {
  color: var(--muted);
}

.video-form {
  display: grid;
  gap: 14px;
}

.video-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.video-flags legend {
  padding: 0 6px;
  color: var(--blue-deep);
  font-size: 0.86rem;
  font-weight: 900;
}

.video-flags label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(216, 167, 47, 0.24);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 247, 220, 0.68);
  font-size: 0.86rem;
}

.video-flags input {
  width: auto;
  min-height: auto;
}

.video-admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.video-admin-card {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.78);
}

.video-admin-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-item-list {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.admin-card-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 36px) / 4);
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 14px;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(21, 69, 109, 0.42) rgba(21, 69, 109, 0.08);
  scrollbar-width: thin;
}

.admin-card-rail > * {
  scroll-snap-align: start;
}

.lesson-admin-rail .admin-lesson-card {
  min-width: 0;
  margin-bottom: 0;
}

.lesson-admin-rail .lesson-cover {
  aspect-ratio: 16 / 10;
}

.lesson-admin-rail .lesson-card strong {
  font-size: 0.84rem;
  line-height: 1.12;
}

.lesson-admin-rail .lesson-card-verse {
  font-size: 0.72rem;
}

.lesson-admin-rail .lesson-meta {
  display: none;
}

.trail-admin-rail {
  margin-bottom: 18px;
}

.trail-admin-rail .admin-item-card {
  grid-template-columns: 46px minmax(0, 1fr);
  align-content: start;
  min-height: 132px;
}

.trail-admin-rail .admin-item-action {
  grid-column: 1 / -1;
  width: fit-content;
}

.manager-subheading {
  display: grid;
  gap: 4px;
  margin: 10px 0 4px;
}

.manager-subheading h3 {
  color: #15456d;
  font-size: 1.08rem;
}

.manager-subheading p {
  color: var(--muted);
}

.admin-item-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(45, 156, 255, 0.16);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  text-align: left;
}

.admin-item-card.active,
.admin-item-card:hover {
  border-color: rgba(45, 156, 255, 0.42);
  background: #fff;
  box-shadow: 0 12px 26px rgba(31, 77, 117, 0.12);
}

.admin-item-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 217, 61, 0.42), transparent 32%),
    linear-gradient(135deg, rgba(45, 156, 255, 0.16), rgba(41, 199, 201, 0.18));
  font-size: 1.8rem;
}

.admin-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-item-icon.video-icon {
  color: #fff;
  background: linear-gradient(135deg, #167ad1, #7b61ff);
  font-size: 1rem;
}

.admin-item-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-item-body strong,
.admin-item-body small,
.admin-item-body em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-item-body small {
  color: #135f9c;
  font-weight: 800;
}

.admin-item-body em {
  color: var(--muted);
  font-size: 0.86rem;
  font-style: normal;
}

.admin-item-action {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: #135f9c;
  background: rgba(45, 156, 255, 0.1);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.trails-layout {
  gap: 18px;
  padding: 18px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 10%, rgba(216, 167, 47, 0.16), transparent 22%),
    linear-gradient(145deg, #101923, #172838 58%, #10231d);
  box-shadow: var(--shadow);
}

.stream-player {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(240px, 0.45fr);
  gap: 18px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.stream-player-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
  aspect-ratio: 16 / 9;
  min-height: 280px;
  max-height: 620px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.32);
}

.stream-player-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stream-player-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.42));
}

.stream-player-frame span {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  color: #fff;
  background: rgba(11, 18, 26, 0.88);
  transform: translate(-50%, -50%);
}

.stream-player-info {
  display: grid;
  align-content: center;
  gap: 12px;
  min-width: 0;
}

.stream-player-info .reader-kicker,
.stream-hero-copy .reader-kicker {
  width: fit-content;
  color: #ffe6a3;
  border-color: rgba(255, 230, 163, 0.28);
  background: rgba(255, 230, 163, 0.09);
}

.stream-player-info h2,
.stream-hero-copy h2 {
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2.65rem);
  line-height: 1.02;
  text-wrap: balance;
}

.stream-player-info p,
.stream-hero-copy p {
  display: none !important;
}

.stream-player .pill,
.stream-hero .pill {
  color: #ffe6a3;
  border-color: rgba(255, 230, 163, 0.22);
  background: rgba(255, 230, 163, 0.08);
}

.stream-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.5fr);
  gap: 18px;
  align-items: center;
  min-height: 260px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(16, 25, 35, 0.96), rgba(16, 25, 35, 0.7) 48%, rgba(16, 25, 35, 0.16)),
    radial-gradient(circle at 82% 18%, rgba(216, 167, 47, 0.18), transparent 32%);
}

.stream-hero-copy {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.stream-hero-thumb {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #263b51, #152433);
  box-shadow: 0 28px 52px rgba(0, 0, 0, 0.32);
  cursor: pointer;
}

.stream-hero-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stream-hero-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.34));
}

.stream-hero-thumb span {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #fff;
  background: rgba(11, 18, 26, 0.88);
  transform: translate(-50%, -50%);
}

.stream-quick-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
}

.stream-quick-nav a {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.trails-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 4px 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: #fff;
}

.trails-header .reader-kicker {
  margin-bottom: 10px;
  color: #ffe6a3;
  border-color: rgba(255, 230, 163, 0.25);
  background: rgba(255, 230, 163, 0.09);
}

.trails-header p {
  max-width: 780px;
  color: rgba(255, 255, 255, 0.68);
}

.trail-count {
  min-width: max-content;
  padding: 8px 12px;
  border-radius: 999px;
  color: #ffe6a3;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

.trail-grid {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.trail-row {
  min-width: 0;
}

.trail-row-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0 2px;
  color: #fff;
}

.trail-row-heading h3 {
  font-size: 1.18rem;
}

.trail-row-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trail-row-heading span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.86rem;
  font-weight: 700;
}

.rail-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.45rem;
  line-height: 1;
}

.rail-arrow:hover {
  background: rgba(255, 230, 163, 0.18);
}

.trail-rail {
  display: grid;
  grid-auto-columns: minmax(245px, 292px);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 4px 2px 18px;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.trail-card {
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.2);
  transform-origin: center left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
  min-height: 268px;
}

.trail-card:hover {
  z-index: 2;
  border-color: rgba(255, 230, 163, 0.42);
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.035);
}

.trail-card.active {
  border-color: rgba(255, 230, 163, 0.72);
  background: rgba(255, 255, 255, 0.14);
}

.trail-thumb {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
  background:
    linear-gradient(135deg, rgba(216, 167, 47, 0.32), transparent),
    linear-gradient(145deg, #263b51, #152433);
}

.trail-card.active .trail-thumb::after {
  content: "Assistindo";
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #111923;
  background: #ffe6a3;
  font-size: 0.72rem;
  font-weight: 900;
}

.trail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.trail-thumb span {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: #fff;
  background: rgba(11, 18, 26, 0.86);
  transform: translate(-50%, -50%);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.trail-content {
  display: grid;
  gap: 10px;
  padding: 15px;
  grid-template-rows: auto 1fr;
}

.trail-category-line {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  color: #ffe6a3;
  background: rgba(255, 217, 61, 0.16);
  font-size: 0.78rem;
  font-weight: 1000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trail-content h3 {
  font-size: 1.08rem;
  line-height: 1.25;
  color: #fff;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trail-content p {
  display: none !important;
}

.trail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: end;
}

.trail-card .pill {
  color: #ffe6a3;
  border-color: rgba(255, 230, 163, 0.22);
  background: rgba(255, 230, 163, 0.08);
}

.trail-card .icon-button {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.08);
}

.trail-favorite {
  min-width: 46px;
  padding-inline: 12px;
  font-size: 1.05rem;
}

.trail-favorite.active {
  color: #3f2e08;
  border-color: rgba(255, 217, 61, 0.7);
  background: linear-gradient(135deg, #fff3a8, #ffd93d);
}

.stream-mobile-hint {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-weight: 800;
}

.compact-empty {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
}

.ebook-print-area {
  display: none;
}

.hidden {
  display: none !important;
}

.home-view {
  gap: 24px;
}

.home-toolkit-section,
.home-steps-section,
.age-section {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(45, 156, 255, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 34px rgba(31, 77, 117, 0.08);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 26px;
  align-items: center;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  background:
    radial-gradient(circle at 86% 12%, rgba(255, 217, 61, 0.42), transparent 26%),
    radial-gradient(circle at 10% 90%, rgba(107, 203, 61, 0.26), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,0.95), rgba(235, 250, 255, 0.92));
  box-shadow: var(--shadow);
}

.home-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #135f9c;
  background: rgba(45, 156, 255, 0.12);
  font-weight: 900;
}

.home-copy h2 {
  max-width: 760px;
  color: #15456d;
  font-size: clamp(1.8rem, 4vw, 3.45rem);
  line-height: 1;
}

.home-copy p {
  max-width: 620px;
  margin-top: 16px;
  color: #526176;
  font-size: 1.08rem;
  line-height: 1.6;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

/* Cards de valor da Home: mantem a promessa do sistema visivel logo no primeiro acesso. */
.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.home-feature-grid > button,
.home-feature-grid > span {
  --feature-accent: #2f7da4;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--feature-accent) 24%, white);
  border-radius: 22px;
  color: var(--ink);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--feature-accent) 10%, white), rgba(255, 255, 255, 0.82));
  text-align: left;
  box-shadow: 0 16px 32px rgba(31, 77, 117, 0.1);
}

.home-feature-grid > button:nth-child(1),
.home-feature-grid > span:nth-child(1) { --feature-accent: #2D9CFF; background: #dff1ff; }
.home-feature-grid > button:nth-child(2),
.home-feature-grid > span:nth-child(2) { --feature-accent: #4f8f73; background: #dcfac7; }
.home-feature-grid > button:nth-child(3),
.home-feature-grid > span:nth-child(3) { --feature-accent: #a56d16; background: #fff1bd; }
.home-feature-grid > button:nth-child(4),
.home-feature-grid > span:nth-child(4) { --feature-accent: #7b4f9d; background: #e2dcff; }
.home-feature-grid > button:nth-child(5),
.home-feature-grid > span:nth-child(5) { --feature-accent: #c4516f; background: #ffdede; }
.home-feature-grid > button:nth-child(6),
.home-feature-grid > span:nth-child(6) { --feature-accent: #078f94; background: #d6fbfb; }

.home-feature-grid > button:hover,
.home-feature-grid > span:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(31, 77, 117, 0.12);
}

.home-feature-grid button > span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-left: 0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(31, 77, 117, 0.08);
  font-size: 1.45rem;
}

.home-feature-grid strong {
  color: var(--feature-accent);
  font-size: 1.2rem;
  line-height: 1.15;
}

.home-feature-grid small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.3;
}

.home-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.home-steps-grid article {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(45, 156, 255, 0.13);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 217, 61, 0.25), transparent 28%),
    #fff;
  box-shadow: 0 12px 28px rgba(31, 77, 117, 0.08);
}

.home-steps-grid span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--joy-blue), var(--creative-purple));
  font-weight: 1000;
}

.home-steps-grid strong {
  color: #15456d;
  font-family: "Baloo 2", Fredoka, Nunito, "Segoe UI", Arial, sans-serif;
  font-size: 1.18rem;
}

.home-steps-grid p {
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .home-feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.home-illustration {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.home-illustration img {
  width: min(100%, 390px);
  filter: drop-shadow(0 18px 28px rgba(45, 156, 255, 0.18));
}

.kid-scene {
  display: flex;
  gap: 12px;
  justify-content: center;
  font-size: 2.2rem;
}

.kid-scene span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(31, 77, 117, 0.12);
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2 {
  color: #15456d;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.age-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
}

.age-card {
  display: grid;
  gap: 6px;
  min-height: 150px;
  padding: 18px;
  border: 0;
  border-radius: 22px;
  color: #1f2b3d;
  text-align: left;
  box-shadow: 0 16px 32px rgba(31, 77, 117, 0.14);
}

.age-card span {
  font-size: 2.2rem;
}

.age-card strong {
  font-size: 1.35rem;
}

.age-card em {
  font-style: normal;
  font-weight: 800;
}

.age-card.yellow { background: #FFD93D; }
.age-card.green { background: #B4F084; }
.age-card.blue { background: #BFE4FF; }
.age-card.purple { background: #D8D0FF; }
.age-card.red { background: #FFC4C4; }
.age-card.orange { background: #FFD8A8; }

.lesson-cover {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  row-gap: 3px;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 6px;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(circle at 88% 88%, rgba(255, 255, 255, 0.92), transparent 13%),
    radial-gradient(circle at 16% 18%, color-mix(in srgb, var(--lesson-accent, #ffd93d) 54%, transparent), transparent 31%),
    radial-gradient(circle at 78% 24%, color-mix(in srgb, var(--lesson-primary, #15456d) 18%, transparent), transparent 26%),
    linear-gradient(135deg, color-mix(in srgb, var(--lesson-soft, #eef5fb) 74%, white), color-mix(in srgb, var(--lesson-primary, #15456d) 22%, white) 55%, #ffe7d4);
  color: var(--lesson-primary, #15456d);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.lesson-cover-book,
.lesson-cover-principle,
.lesson-cover-ref,
.lesson-cover-mark {
  position: relative;
  z-index: 2;
}

.lesson-cover-book {
  max-width: calc(100% - 18px);
  color: #10233a;
  font-family: "Baloo 2", Fredoka, Nunito, "Segoe UI", Arial, sans-serif;
  font-size: clamp(2rem, 5.6vw, 4.25rem);
  font-weight: 1000;
  line-height: 0.78;
  letter-spacing: 0;
  text-align: center;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.72),
    0 10px 20px rgba(21, 69, 109, 0.16);
  text-transform: uppercase;
}

.lesson-cover-principle {
  max-width: calc(100% - 22px);
  margin-top: 0;
  color: #10233a;
  font-size: clamp(0.78rem, 1.85vw, 1.12rem);
  font-weight: 1000;
  line-height: 0.98;
  text-align: center;
  text-transform: uppercase;
}

.lesson-cover-ref {
  position: absolute;
  top: 8px;
  right: 8px;
  max-width: calc(100% - 16px);
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--lesson-primary, #15456d);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid color-mix(in srgb, var(--lesson-primary, #15456d) 18%, white);
  font-size: 0.74rem;
  font-weight: 1000;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-cover-mark {
  position: absolute;
  left: 10px;
  bottom: 9px;
  color: color-mix(in srgb, var(--lesson-primary, #15456d) 54%, white);
  font-size: 1.45rem;
  filter: drop-shadow(0 8px 10px rgba(21, 69, 109, 0.13));
}

.lesson-cover-shine,
.lesson-cover-piece {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.lesson-cover-shine {
  right: 9%;
  bottom: 9%;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.26) 35%, transparent 68%);
}

.lesson-cover-piece {
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, var(--lesson-accent, #ffd93d), rgba(255, 255, 255, 0.62));
  clip-path: polygon(50% 0, 100% 100%, 0 72%);
  opacity: 0.78;
}

.lesson-cover-piece.piece-a {
  right: 12%;
  top: 42%;
  transform: rotate(28deg);
}

.lesson-cover-piece.piece-b {
  left: 10%;
  top: 56%;
  transform: rotate(-16deg);
}

.lesson-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lesson-cover.custom-cover {
  display: block;
  background: #fff;
}

.lesson-cover.custom-cover img {
  display: block;
}

.lesson-cover.custom-cover .lesson-cover-ref {
  z-index: 3;
  box-shadow: 0 8px 18px rgba(21, 69, 109, 0.13);
}

.card-image-preview img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.manage-tabs {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255,255,255,0.75);
  box-shadow: var(--shadow);
}

.manage-tab-group {
  position: relative;
  flex: 0 0 auto;
  padding: 6px;
  border: 1px solid rgba(45, 156, 255, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.manage-tab-dropdown summary {
  list-style: none;
  cursor: pointer;
}

.manage-tab-dropdown summary::-webkit-details-marker {
  display: none;
}

.manage-tab-submenu {
  position: absolute;
  z-index: 25;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 190px;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(45, 156, 255, 0.16);
  border-radius: 12px;
  background: rgba(255,255,255,0.98);
  box-shadow: 0 18px 38px rgba(31, 77, 117, 0.18);
}

.manage-tab {
  flex: 1;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.manage-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--joy-blue), var(--creative-purple));
}

.manage-panel {
  display: none;
}

.manage-panel.active {
  display: block;
}

.image-field small {
  color: var(--muted);
  font-weight: 700;
}

.activity-image-preview {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.activity-image-preview img {
  max-width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.activity-art img {
  width: min(100%, 720px);
  border-radius: 12px;
  background: #fff;
}

.lesson-section-copy {
  color: #28384d;
  font-size: 1rem;
  line-height: 1.72;
}

.lesson-inline-video {
  display: block;
  width: min(100%, 460px);
  margin: 8px 0 12px;
  padding: 6px;
  border: 1px solid rgba(45, 156, 255, 0.16);
  border-radius: 10px;
  background: rgba(235, 250, 255, 0.72);
}

.lesson-inline-video-frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #15456d;
}

.lesson-inline-video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.lesson-inline-video:fullscreen {
  max-width: none;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: clamp(14px, 3vw, 34px);
  border: 0;
  border-radius: 0;
  background: #081e2f;
}

.lesson-inline-video:fullscreen .lesson-inline-video-frame {
  width: min(100%, 150vh);
}

@media print {
  .lesson-inline-video {
    display: none !important;
  }

  .lesson-section-copy {
    color: #28384d;
    font-size: 9.4pt;
    line-height: 1.48;
  }
}

.stream-player-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.stream-player-frame img,
.stream-player-frame::after,
.stream-player-frame > span {
  display: none;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(420px, 1.4fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 28px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.site-footer-brand {
  display: grid;
  align-content: center;
  gap: 12px;
}

.site-footer img {
  width: 150px;
}

.site-footer p {
  color: var(--muted);
  font-weight: 800;
}

.site-info-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.site-info-section article {
  padding: 16px;
  border: 1px solid rgba(45, 156, 255, 0.15);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.site-info-section h2 {
  margin: 4px 0 10px;
  font-size: 1.05rem;
}

.site-info-section p {
  margin: 7px 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.48;
}

.site-info-section a {
  color: #135f9c;
  font-weight: 900;
  text-decoration: none;
}

@media print {
  .ebook-cover {
    background: url("assets/layout-pdf.png") center / cover no-repeat !important;
    border: 0 !important;
  }

  .ebook-cover p,
  .ebook-cover h1,
  .ebook-cover span,
  .ebook-cover small,
  .ebook-cover-line {
    background: rgba(255,255,255,0.72);
    border-radius: 8px;
    padding: 2mm 4mm;
  }

  .ebook-lesson {
    position: relative;
    padding: 12mm;
    border-left: 2.2mm solid #6BCB3D;
    border-right: 2.2mm solid #FFD93D;
    border-radius: 6mm;
  }

  .ebook-lesson::before {
    content: "";
    position: fixed;
    inset: 6mm;
    border: 0.6mm solid rgba(45, 156, 255, 0.18);
    border-radius: 8mm;
    pointer-events: none;
  }
}

@media (max-width: 980px) {
  .home-hero,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .age-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .brand-logo {
    width: 96px;
  }

  .age-grid {
    grid-template-columns: 1fr;
  }

  .site-info-section {
    grid-template-columns: 1fr;
  }
}

.editor,
.data-panel {
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.section-fields {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.form-actions,
.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: -4px;
  padding: 8px 10px;
  border: 1px dashed rgba(50, 89, 112, 0.28);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  font-weight: 800;
}

.inline-check input {
  width: 16px;
  height: 16px;
  margin: 0 8px 0 0;
  accent-color: var(--blue);
}

.current-attachments {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(50, 89, 112, 0.16);
  border-radius: 8px;
  background: rgba(243, 250, 255, 0.72);
}

.current-attachments-heading,
.current-attachments-empty {
  display: grid;
  gap: 4px;
}

.current-attachments-heading span,
.current-attachments-empty span,
.attachment-remove-option small {
  color: var(--muted);
  font-size: 0.84rem;
}

.current-attachments-list {
  display: grid;
  gap: 8px;
}

.attachment-remove-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(50, 89, 112, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.attachment-remove-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--red);
}

.attachment-remove-option span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.attachment-remove-option strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-panel {
  position: sticky;
  top: 18px;
}

.data-panel h2 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.file-button {
  cursor: pointer;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.note-box {
  margin-top: 18px;
  padding: 14px;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: rgba(255, 246, 214, 0.72);
}

.note-box p {
  margin-top: 6px;
}

.print-watermark {
  display: none;
}

@media (max-width: 980px) {
  .topbar,
  .toolbar {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  #studyView,
  .manage-layout {
    grid-template-columns: 1fr;
  }

  .lesson-list,
  .data-panel {
    position: static;
    max-height: none;
  }

  .stream-player,
  .stream-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1420px);
    padding-top: 10px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .tabs,
  .form-actions,
  .data-actions {
    width: 100%;
  }

  .tab,
  .icon-button,
  .file-button {
    flex: 1;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .reader-hero {
    flex-direction: column;
    padding: 24px 20px;
  }

  .section-timeline {
    padding: 20px;
  }

  .lesson-section {
    grid-template-columns: 36px 1fr;
  }

  .section-icon {
    width: 36px;
    height: 36px;
  }
}

@media print {
  body {
    background: #fff;
  }

  #skyCanvas,
  .topbar,
  .toolbar,
  .lesson-list,
  .no-print {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  #studyView {
    display: block;
  }

  .lesson-reader {
    min-height: auto;
    border: 0;
    box-shadow: none;
    background: #fff;
  }

  .reader-hero {
    color: #213047;
    background: #fff;
    border-bottom: 2px solid #d4a72c;
  }

  .reader-verse {
    color: #41506a;
  }

  .reader-kicker {
    border-color: #d4a72c;
    color: #775714;
  }

  .print-watermark {
    position: fixed;
    inset: 42% auto auto 14%;
    z-index: 5;
    display: block;
    color: rgba(36, 76, 121, 0.08);
    font-size: 5.5rem;
    font-weight: 900;
    letter-spacing: 0;
    transform: rotate(-24deg);
    pointer-events: none;
  }
}

/* Modern biblical visual system */
:root {
  --heaven: #e9f7ff;
  --cream: #fff9ea;
  --ink: #1f2b3d;
  --muted: #68788f;
  --panel: rgba(255, 255, 255, 0.82);
  --line: rgba(51, 72, 104, 0.14);
  --blue: #347ca4;
  --blue-deep: #1f4d75;
  --gold: #d8a72f;
  --green: #4f8f73;
  --shadow: 0 22px 70px rgba(26, 45, 76, 0.17);
}

body {
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 239, 178, 0.65), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(181, 223, 255, 0.75), transparent 32%),
    linear-gradient(145deg, var(--heaven), var(--cream) 48%, #eef8f0);
}

.topbar,
.toolbar,
.editor,
.data-panel,
.lesson-list,
.lesson-reader {
  border-color: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.topbar {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(246, 252, 255, 0.78)),
    rgba(255, 255, 255, 0.84);
}

.brand-mark {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent),
    linear-gradient(135deg, #2f7da4, #4f8f73 58%, #c99a28);
}

.tab,
.icon-button,
.file-button,
input,
select,
textarea,
.lesson-card {
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.tab.active,
.icon-button.primary {
  background: linear-gradient(135deg, var(--tab-accent, var(--blue-deep)), #376f87);
  box-shadow: 0 12px 22px rgba(31, 77, 117, 0.22);
}

.icon-button:hover,
.file-button:hover,
.lesson-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(31, 77, 117, 0.16);
}

.lesson-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.68)),
    linear-gradient(135deg, var(--lesson-soft, #eef5fb), rgba(255, 255, 255, 0.62));
}

.lesson-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--lesson-accent, var(--gold)), var(--lesson-primary, var(--green)));
  opacity: 0.82;
}

.lesson-card.active {
  border-color: rgba(216, 167, 47, 0.58);
  background: #fff;
}

.lesson-card.locked,
.trail-card.locked {
  position: relative;
}

.lesson-card.locked::after {
  content: "🔒";
  position: absolute;
  top: auto;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(21, 69, 109, 0.9);
  color: #fff;
  font-size: 0.72rem;
  box-shadow: 0 10px 22px rgba(31, 77, 117, 0.18);
}

.trail-card.locked::after {
  content: "🔒";
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(21, 69, 109, 0.9);
  color: #fff;
  box-shadow: 0 10px 22px rgba(31, 77, 117, 0.18);
}

.lock-pill {
  color: #15456d;
  border-color: rgba(21, 69, 109, 0.2);
  background: rgba(45, 156, 255, 0.12);
}

/* Estado bloqueado para visitantes: mostra o acervo, mas conduz para login/cadastro. */
.locked-reader {
  display: grid;
  gap: 14px;
  align-content: center;
  min-height: 520px;
  padding: clamp(24px, 5vw, 54px);
  color: #15456d;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 217, 61, 0.28), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(235, 250, 255, 0.9));
  text-align: center;
}

.locked-reader .reader-kicker {
  justify-self: center;
  color: #135f9c;
  border-color: rgba(45, 156, 255, 0.22);
  background: rgba(45, 156, 255, 0.1);
}

.locked-reader h2 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.02;
}

.locked-reader p {
  max-width: 620px;
  justify-self: center;
  color: var(--muted);
  line-height: 1.6;
}

.locked-reader .lesson-meta,
.locked-reader .home-login-actions {
  justify-content: center;
}

.locked-icon {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: #15456d;
  color: #fff;
  font-size: 2rem;
  box-shadow: 0 18px 36px rgba(31, 77, 117, 0.18);
}

.stream-lock {
  min-height: 100%;
  border-radius: 8px;
}

.lesson-reader {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 236, 0.96)),
    #fff;
}

.reader-hero {
  isolation: isolate;
  min-height: 260px;
  padding: 38px;
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.3), transparent 24%),
    radial-gradient(circle at 16% 92%, rgba(216, 167, 47, 0.36), transparent 28%),
    linear-gradient(135deg, var(--theme, #244c79), #295e78 55%, #4f8f73);
}

.reader-hero::before {
  content: "";
  position: absolute;
  inset: 18px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
}

.reader-hero::after {
  width: 260px;
  height: 120px;
  right: 34px;
  bottom: -42px;
  opacity: 0.82;
  filter: blur(0.2px);
}

.reader-glow {
  position: absolute;
  inset: -120px auto auto -90px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 230, 149, 0.5), transparent 67%);
  pointer-events: none;
}

.reader-cover-mark {
  position: absolute;
  right: 42px;
  top: 34px;
  color: rgba(255, 255, 255, 0.38);
  font-family: Georgia, serif;
  font-size: 5rem;
  line-height: 1;
}

.reader-title-block {
  max-width: 860px;
}

.reader-hero-actions {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  min-width: 150px;
}

.reader-kicker {
  background: rgba(255, 255, 255, 0.13);
  letter-spacing: 0;
}

.reader-hero h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  line-height: 0.98;
  text-wrap: balance;
}

.reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.reader-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
}

.reader-verse {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 4px solid rgba(255, 226, 143, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
}

.reader-verse span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.reader-verse strong {
  color: #fff;
  font-size: 1.03rem;
  line-height: 1.45;
}

.section-timeline {
  gap: 16px;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(216, 167, 47, 0.12), transparent 24%),
    linear-gradient(180deg, #fff, #fffaf0);
}

.lesson-section {
  grid-template-columns: 56px 1fr;
  align-items: start;
}

.section-icon {
  width: 56px;
  height: 56px;
  color: var(--theme, var(--blue-deep));
  background: linear-gradient(135deg, var(--theme-soft, #eef5fb), #fff);
  border: 1px solid rgba(216, 167, 47, 0.26);
  box-shadow: 0 12px 26px rgba(31, 77, 117, 0.12);
}

.section-icon > span {
  font-size: 1.45rem;
}

.section-icon svg {
  display: none;
}

.section-body {
  padding: 18px 20px;
  border: 1px solid rgba(51, 72, 104, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 252, 245, 0.96)),
    #fff;
  box-shadow: 0 12px 28px rgba(31, 77, 117, 0.08);
}

.lesson-section:last-child .section-body {
  border-bottom: 1px solid rgba(51, 72, 104, 0.1);
}

.section-body h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--theme, var(--blue-deep));
  font-size: 0.98rem;
  letter-spacing: 0;
}

.section-body h3 span {
  font-size: 1.15rem;
}

.section-body p {
  color: #31425c;
  font-size: 0.98rem;
}

.section-body a {
  color: #246996;
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.print-footer {
  display: none;
}

@media (max-width: 640px) {
  .reader-hero {
    min-height: 240px;
  }

  .lesson-section {
    grid-template-columns: 42px 1fr;
  }

  .section-icon {
    width: 42px;
    height: 42px;
  }

  .section-body {
    padding: 14px;
  }
}

@media print {
  body.ebook-printing #skyCanvas,
  body.ebook-printing .app-shell {
    display: none !important;
  }

  body.ebook-printing .ebook-print-area {
    display: block;
  }

  body:not(.ebook-printing) .reader-hero {
    min-height: auto;
    padding: 13mm;
    color: #1f2b3d;
    background:
      linear-gradient(180deg, rgba(255, 250, 236, 0.92), #fff),
      #fff;
    border: 0.45mm solid rgba(216, 167, 47, 0.55);
    page-break-after: auto;
  }

  body:not(.ebook-printing) .reader-hero::before,
  body:not(.ebook-printing) .reader-hero::after,
  body:not(.ebook-printing) .reader-glow {
    display: none;
  }

  body:not(.ebook-printing) .reader-cover-mark {
    color: rgba(216, 167, 47, 0.28);
  }

  body:not(.ebook-printing) .reader-hero h2,
  body:not(.ebook-printing) .reader-verse strong,
  body:not(.ebook-printing) .reader-chip {
    color: #1f2b3d;
  }

  body:not(.ebook-printing) .reader-kicker,
  body:not(.ebook-printing) .reader-chip {
    border-color: rgba(216, 167, 47, 0.42);
    background: rgba(255, 247, 220, 0.88);
  }

  body:not(.ebook-printing) .reader-verse {
    background: #fff;
    border: 0.35mm solid rgba(216, 167, 47, 0.35);
    border-left: 1.3mm solid rgba(216, 167, 47, 0.9);
  }

  body:not(.ebook-printing) .reader-verse span {
    color: #775714;
  }

  .ebook {
    color: #1f2b3d;
    background: #fff;
  }

  .ebook-cover {
    display: grid;
    min-height: 255mm;
    align-content: center;
    justify-items: center;
    padding: 24mm 18mm;
    border: 1.1mm solid rgba(216, 167, 47, 0.72);
    text-align: center;
    page-break-after: always;
  }

  .ebook-mark {
    display: grid;
    place-items: center;
    width: 28mm;
    height: 28mm;
    margin-bottom: 10mm;
    border: 0.55mm solid rgba(216, 167, 47, 0.75);
    border-radius: 50%;
    color: #a56d16;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26pt;
  }

  .ebook-cover p {
    color: #775714;
    font-size: 12pt;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .ebook-cover h1 {
    max-width: 155mm;
    margin-top: 6mm;
    color: #1f2b3d;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 36pt;
    line-height: 1.04;
  }

  .ebook-cover-line {
    width: 58mm;
    height: 0.7mm;
    margin: 9mm 0;
    background: #d8a72f;
  }

  .ebook-cover span,
  .ebook-cover small {
    display: block;
    color: #526176;
    font-size: 11pt;
  }

  .ebook-cover small {
    margin-top: 3mm;
  }

  .ebook-toc {
    page-break-after: always;
  }

  .ebook-toc h2 {
    margin: 0 0 8mm;
    color: #1f4d75;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22pt;
  }

  .ebook-toc-row {
    display: grid;
    grid-template-columns: 12mm 1fr 38mm;
    gap: 4mm;
    padding: 3mm 0;
    border-bottom: 0.25mm solid rgba(31, 77, 117, 0.15);
    break-inside: avoid;
  }

  .ebook-toc-row strong {
    color: #a56d16;
  }

  .ebook-toc-row em {
    color: #66758a;
    font-size: 8.5pt;
    font-style: normal;
    text-align: right;
  }

  .ebook-lesson {
    page-break-before: always;
  }

  .ebook-lesson-header {
    display: grid;
    grid-template-columns: 16mm 1fr;
    gap: 5mm;
    margin-bottom: 6mm;
    padding-bottom: 5mm;
    border-bottom: 0.55mm solid var(--theme, #1f4d75);
    break-inside: avoid;
  }

  .ebook-lesson-header > span {
    display: grid;
    place-items: center;
    width: 13mm;
    height: 13mm;
    border-radius: 50%;
    color: #fff;
    background: var(--theme, #1f4d75);
    font-weight: 900;
  }

  .ebook-lesson-header p {
    color: var(--theme, #1f4d75);
    font-size: 9pt;
    font-weight: 900;
    text-transform: uppercase;
  }

  .ebook-lesson-header h2 {
    margin-top: 1.5mm;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 23pt;
    line-height: 1.08;
  }

  .ebook-lesson-header strong {
    display: block;
    margin-top: 3mm;
    color: #526176;
    font-size: 10pt;
    line-height: 1.4;
  }

  .ebook-sections {
    display: block;
  }

  .ebook-section {
    margin-bottom: 4.5mm;
    padding: 4mm 4.5mm;
    border: 0.3mm solid rgba(31, 77, 117, 0.13);
    border-left: 1.15mm solid var(--theme, #1f4d75);
    border-radius: 2mm;
    background: #fff;
    break-inside: avoid;
  }

  .ebook-section h3 {
    margin: 0 0 2mm;
    color: var(--theme, #1f4d75);
    font-size: 11pt;
    text-transform: uppercase;
  }

  .ebook-section p {
    color: #28384d;
    font-size: 9.2pt;
    line-height: 1.46;
    white-space: pre-line;
  }
}

@media print {
  @page {
    size: A4;
    margin: 13mm 12mm 15mm;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    color: #1f2b3d;
    background: #fff;
    font-family: "Segoe UI", Arial, sans-serif;
  }

  .app-shell {
    width: 100%;
  }

  .lesson-reader {
    overflow: visible;
  }

  .reader-hero {
    display: grid;
    min-height: 255mm;
    align-content: center;
    padding: 24mm 18mm;
    color: #fff;
    background:
      radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.34), transparent 25%),
      radial-gradient(circle at 14% 86%, rgba(216, 167, 47, 0.42), transparent 30%),
      linear-gradient(145deg, var(--theme, #244c79), #2f6f86 58%, #5f8d6c);
    border: 0;
    page-break-after: always;
  }

  .reader-hero::before {
    inset: 11mm;
    border-color: rgba(255, 255, 255, 0.34);
  }

  .reader-cover-mark {
    right: 18mm;
    top: 18mm;
    font-size: 32mm;
  }

  .reader-kicker {
    width: fit-content;
    margin-bottom: 8mm;
    padding: 2.4mm 4mm;
    border-color: rgba(255, 255, 255, 0.42);
    color: #fff;
  }

  .reader-hero h2 {
    max-width: 160mm;
    color: #fff;
    font-size: 35pt;
    line-height: 1.02;
  }

  .reader-meta {
    margin-top: 7mm;
  }

  .reader-chip {
    min-height: 9mm;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
  }

  .reader-verse {
    max-width: 165mm;
    margin-top: 9mm;
    background: rgba(255, 255, 255, 0.14);
  }

  .reader-verse strong {
    color: #fff;
    font-size: 12pt;
  }

  .section-timeline {
    display: block;
    padding: 0;
    background: #fff;
  }

  .lesson-section {
    display: grid;
    grid-template-columns: 13mm 1fr;
    gap: 4mm;
    margin: 0 0 5mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .section-icon {
    width: 12mm;
    height: 12mm;
    box-shadow: none;
  }

  .section-icon > span {
    font-size: 15pt;
  }

  .section-body {
    padding: 4.5mm 5mm;
    border: 0.35mm solid rgba(31, 77, 117, 0.12);
    box-shadow: none;
  }

  .section-body h3 {
    margin-bottom: 2.4mm;
    color: var(--theme, #244c79);
    font-size: 11pt;
  }

  .section-body p {
    color: #28384d;
    font-size: 9.4pt;
    line-height: 1.48;
  }

  .print-watermark {
    inset: 45% auto auto 16%;
    color: rgba(31, 77, 117, 0.055);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 56pt;
  }

  .print-footer {
    position: fixed;
    right: 0;
    bottom: -8mm;
    left: 0;
    display: block;
    border-top: 0.25mm solid rgba(216, 167, 47, 0.55);
    padding-top: 2mm;
    color: rgba(31, 43, 61, 0.64);
    font-size: 8pt;
    text-align: center;
  }
}

@media print {
  body:not(.ebook-printing) .reader-hero {
    display: block;
    min-height: auto;
    padding: 13mm;
    color: #1f2b3d;
    background:
      linear-gradient(180deg, rgba(255, 250, 236, 0.92), #fff),
      #fff;
    border: 0.45mm solid rgba(216, 167, 47, 0.55);
    page-break-after: auto;
  }

  body:not(.ebook-printing) .reader-hero::before,
  body:not(.ebook-printing) .reader-hero::after,
  body:not(.ebook-printing) .reader-glow {
    display: none;
  }

  body:not(.ebook-printing) .reader-cover-mark {
    color: rgba(216, 167, 47, 0.28);
    font-size: 18mm;
  }

  body:not(.ebook-printing) .reader-kicker,
  body:not(.ebook-printing) .reader-chip {
    color: #775714;
    border-color: rgba(216, 167, 47, 0.42);
    background: rgba(255, 247, 220, 0.88);
  }

  body:not(.ebook-printing) .reader-hero h2,
  body:not(.ebook-printing) .reader-verse strong {
    color: #1f2b3d;
  }

  body:not(.ebook-printing) .reader-verse {
    background: #fff;
    border: 0.35mm solid rgba(216, 167, 47, 0.35);
    border-left: 1.3mm solid rgba(216, 167, 47, 0.9);
  }

  body:not(.ebook-printing) .reader-verse span {
    color: #775714;
  }

  body.ebook-printing .app-shell,
  body.ebook-printing #skyCanvas {
    display: none !important;
  }

  body.ebook-printing .ebook-print-area {
    display: block !important;
  }
}

/* Raízes Kids final theme */
.topbar,
.toolbar,
.editor,
.data-panel,
.lesson-list,
.lesson-reader,
.video-manager {
  border-radius: 22px;
}

.trails-layout {
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 217, 61, 0.36), transparent 22%),
    radial-gradient(circle at 88% 18%, rgba(41, 199, 201, 0.28), transparent 28%),
    linear-gradient(145deg, #f8fdff, #fff9de 58%, #f1ffe9);
}

.trails-header,
.stream-player,
.stream-hero,
.trail-card,
.trail-row-heading h3 {
  color: #15456d;
}

.trails-header p,
.stream-player-info p,
.stream-hero-copy p,
.trail-content p,
.trail-row-heading span {
  color: #526176;
}

.trails-header p,
.stream-player-info p,
.stream-hero-copy p,
.trail-content p {
  display: none !important;
}

.stream-player,
.stream-hero,
.trail-card {
  border-color: rgba(45, 156, 255, 0.16);
  background: rgba(255, 255, 255, 0.84);
}

.stream-hero {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.72)),
    radial-gradient(circle at 86% 20%, rgba(255, 217, 61, 0.26), transparent 36%);
}

.stream-player-info h2,
.stream-hero-copy h2,
.trail-content h3 {
  color: #15456d;
}

.stream-player .pill,
.stream-hero .pill,
.trail-card .pill {
  color: #135f9c;
  border-color: rgba(45, 156, 255, 0.18);
  background: rgba(45, 156, 255, 0.08);
}

.stream-player-info .reader-kicker,
.stream-hero-copy .reader-kicker,
.trails-header .reader-kicker,
.stream-quick-nav a,
.rail-arrow,
.trail-card .icon-button {
  color: #135f9c;
  border-color: rgba(45, 156, 255, 0.18);
  background: rgba(255, 255, 255, 0.78);
}

.trail-card:hover,
.trail-card.active {
  border-color: rgba(123, 97, 255, 0.42);
  background: #fff;
}

.trail-card.active .trail-thumb::after {
  color: #15456d;
  background: #FFD93D;
}

.ebook-activity-image {
  display: block;
  max-width: 100%;
  max-height: 185mm;
  margin-top: 3mm;
  object-fit: contain;
}

/* Layout definitivo da exportacao do livro.
   Este bloco fica depois dos estilos antigos para impedir que regras da tela desalinem o PDF. */
@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body.ebook-printing {
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    color: #1f2b3d !important;
  }

  body.ebook-printing::before {
    display: none !important;
    content: none !important;
  }

  body.ebook-printing #skyCanvas,
  body.ebook-printing .app-shell,
  body.ebook-printing .print-watermark,
  body.ebook-printing .print-footer {
    display: none !important;
  }

  body.ebook-printing .ebook-print-area {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }

  body.ebook-printing .ebook,
  body.ebook-printing .ebook * {
    box-sizing: border-box;
  }

  body.ebook-printing .ebook {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #1f2b3d !important;
    font-family: "Segoe UI", Arial, sans-serif !important;
    background: transparent !important;
  }

  body.ebook-printing .ebook-cover,
  body.ebook-printing .ebook-toc,
  body.ebook-printing .ebook-lesson {
    position: relative !important;
    width: 210mm !important;
    max-width: none !important;
    margin: 0 !important;
    min-height: 296mm !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.ebook-printing .ebook-cover {
    display: grid !important;
    height: 296mm !important;
    min-height: 296mm !important;
    max-height: 296mm !important;
    align-content: start !important;
    justify-items: center !important;
    padding: 36mm 32mm 28mm !important;
    border: 0 !important;
    background: #fff !important;
    text-align: center !important;
    overflow: hidden !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    break-after: auto;
    page-break-after: auto;
  }

  body.ebook-printing .ebook-cover p,
  body.ebook-printing .ebook-cover-line {
    display: none !important;
  }

  body.ebook-printing .ebook-cover p,
  body.ebook-printing .ebook-cover h1,
  body.ebook-printing .ebook-cover span,
  body.ebook-printing .ebook-cover small,
  body.ebook-printing .ebook-cover strong,
  body.ebook-printing .ebook-cover-line {
    background: transparent !important;
  }

  body.ebook-printing .ebook-cover h1 {
    max-width: 155mm !important;
    margin: 0 !important;
    font-size: 28pt !important;
    line-height: 1.08 !important;
  }

  body.ebook-printing .ebook-cover h1::before {
    content: "" !important;
    display: block !important;
    width: 76mm !important;
    height: 52mm !important;
    margin: 0 auto 16mm !important;
    background: url("assets/logo-raizes-kids.png") center / contain no-repeat !important;
  }

  body.ebook-printing .ebook-cover span,
  body.ebook-printing .ebook-cover strong,
  body.ebook-printing .ebook-cover small {
    display: block !important;
    width: 100% !important;
    max-width: 140mm !important;
    margin-top: 5mm !important;
    line-height: 1.28 !important;
    text-align: center !important;
  }

  body.ebook-printing .ebook-cover span {
    color: #1f5f8e !important;
    font-size: 15pt !important;
    font-weight: 900 !important;
  }

  body.ebook-printing .ebook-cover strong {
    color: #26344d !important;
    font-size: 12pt !important;
    font-weight: 800 !important;
  }

  body.ebook-printing .ebook-cover small {
    color: #5f6d82 !important;
    font-size: 11pt !important;
    font-weight: 800 !important;
  }

  body.ebook-printing .ebook-toc {
    min-height: 297mm !important;
    padding: 0 20mm 32mm !important;
    background: #fff !important;
    break-after: auto;
    page-break-after: auto;
  }

  body.ebook-printing .ebook-toc-row {
    display: grid !important;
    grid-template-columns: 12mm minmax(0, 1fr) 38mm !important;
    gap: 4mm !important;
    align-items: start !important;
    width: 100% !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.ebook-printing .ebook-toc-row span,
  body.ebook-printing .ebook-toc-row em,
  body.ebook-printing .ebook-section p,
  body.ebook-printing .ebook-lesson-header h2,
  body.ebook-printing .ebook-lesson-header strong {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  body.ebook-printing .ebook-lesson {
    display: block !important;
    min-height: 297mm !important;
    padding: 0 20mm 32mm !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    break-before: auto;
    page-break-before: auto;
  }

  body.ebook-printing .ebook-lesson + .ebook-lesson {
    break-before: page;
    page-break-before: always;
  }

  body.ebook-printing .ebook-cover + .ebook-toc,
  body.ebook-printing .ebook-cover + .ebook-lesson,
  body.ebook-printing .ebook-toc + .ebook-lesson {
    break-before: page;
    page-break-before: always;
  }

  body.ebook-printing .ebook-lesson::before {
    display: none !important;
  }

  body.ebook-printing .ebook-page-header {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    width: 100% !important;
    height: 25mm !important;
    min-height: 25mm !important;
    margin: 0 0 6mm !important;
    padding: 6mm 0 4mm !important;
    border-bottom: 0.45mm solid rgba(31, 77, 117, 0.22) !important;
  }

  body.ebook-printing .ebook-page-header img {
    width: 22mm !important;
    height: auto !important;
    object-fit: contain !important;
  }

  body.ebook-printing .ebook-lesson-header {
    display: grid !important;
    grid-template-columns: 14mm minmax(0, 1fr) !important;
    gap: 4mm !important;
    align-items: start !important;
    width: 100% !important;
    margin: 0 0 7mm !important;
    padding: 0 0 4.5mm !important;
    border-bottom: 0.55mm solid var(--theme, #1f4d75) !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.ebook-printing .ebook-lesson-header > span {
    width: 11mm !important;
    height: 11mm !important;
    font-size: 9pt !important;
  }

  body.ebook-printing .ebook-lesson-header h2 {
    margin: 1.5mm 0 0 !important;
    font-size: 20pt !important;
    line-height: 1.12 !important;
  }

  body.ebook-printing .ebook-sections {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.ebook-printing .ebook-section {
    display: block !important;
    width: 100% !important;
    margin: 0 0 4.2mm !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    break-inside: auto;
    page-break-inside: auto;
  }

  body.ebook-printing .ebook-section h3 {
    display: block !important;
    margin: 0 0 1.8mm !important;
    padding: 2mm 0 1.8mm 3mm !important;
    border-left: 1mm solid var(--theme, #1f4d75) !important;
    background: rgba(255, 255, 255, 0.92) !important;
    font-size: 10.5pt !important;
    line-height: 1.25 !important;
    break-after: avoid;
    page-break-after: avoid;
  }

  body.ebook-printing .ebook-section p,
  body.ebook-printing .ebook-copy {
    display: block !important;
    margin: 0 0 2.2mm !important;
    padding: 0 0 0 3mm !important;
    border-left: 0.35mm solid rgba(31, 77, 117, 0.16) !important;
    font-size: 9.2pt !important;
    line-height: 1.46 !important;
    white-space: pre-line !important;
    background: transparent !important;
    break-inside: auto !important;
    page-break-inside: auto !important;
    widows: 3;
    orphans: 3;
  }

  body.ebook-printing .ebook-section .ebook-copy:last-child {
    margin-bottom: 0 !important;
  }

  body.ebook-printing .ebook-copy div,
  body.ebook-printing .ebook-copy p,
  body.ebook-printing .ebook-copy span,
  body.ebook-printing .ebook-copy strong,
  body.ebook-printing .ebook-copy em {
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  body.ebook-printing .ebook-copy ul,
  body.ebook-printing .ebook-copy ol {
    margin: 2mm 0 2mm 5mm !important;
    padding-left: 4mm !important;
    white-space: normal !important;
  }

  body.ebook-printing .ebook-copy li {
    margin-bottom: 1mm !important;
  }

  body.ebook-printing .ebook-activity-image {
    max-width: 100% !important;
    max-height: 150mm !important;
    margin: 3mm auto 0 !important;
  }

  body.ebook-printing .ebook-page-footer {
    position: absolute !important;
    right: 20mm !important;
    bottom: 0 !important;
    left: 20mm !important;
    display: grid !important;
    grid-template-columns: 18mm minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 4mm !important;
    align-items: center !important;
    width: auto !important;
    height: 25mm !important;
    min-height: 25mm !important;
    margin: 0 !important;
    padding: 4mm 0 3mm !important;
    border-top: 0.35mm solid rgba(31, 77, 117, 0.22) !important;
    color: #31506f !important;
    font-size: 8pt !important;
    line-height: 1.22 !important;
    text-align: center !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  body.ebook-printing .ebook-page-footer img {
    width: 17mm !important;
    max-height: 12mm !important;
    object-fit: contain !important;
    margin: 0 auto !important;
  }

  body.ebook-printing .ebook-page-footer strong {
    display: inline !important;
    color: #15456d !important;
    font-weight: 900 !important;
  }

  body.ebook-printing .ebook-page-model {
    position: absolute !important;
    inset: 6mm !important;
    z-index: 0 !important;
    width: calc(100% - 12mm) !important;
    height: calc(100% - 12mm) !important;
    max-width: none !important;
    object-fit: contain !important;
    pointer-events: none !important;
  }

  body.ebook-printing .ebook-page-model-2 {
    display: none !important;
  }

  body.ebook-printing .ebook-page-model-1 {
    z-index: 1 !important;
  }

  body.ebook-printing .ebook-cover > :not(.ebook-page-model),
  body.ebook-printing .ebook-toc > :not(.ebook-page-model),
  body.ebook-printing .ebook-lesson > :not(.ebook-page-model) {
    position: relative !important;
    z-index: 2 !important;
  }
}

/* Access and mobile polish */
body:not(.is-authenticated) .member-only,
body.is-authenticated .visitor-only {
  display: none !important;
}

.home-login-panel {
  display: grid;
  gap: 14px;
  align-content: center;
  justify-items: center;
  min-height: 340px;
  padding: 24px;
  border: 2px solid rgba(45, 156, 255, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(31, 77, 117, 0.16);
  text-align: center;
}

.home-login-panel img {
  width: min(230px, 70vw);
}

.home-login-panel h3 {
  color: #15456d;
  font-size: 1.45rem;
  line-height: 1.1;
}

.home-login-panel p {
  max-width: 360px;
  color: var(--muted);
  line-height: 1.5;
}

.home-login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.limited-notice,
.session-notice {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(45, 156, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 12px 26px rgba(31, 77, 117, 0.12);
}

.limited-notice {
  margin-bottom: 12px;
}

.limited-notice span {
  color: var(--muted);
  font-size: 0.88rem;
}

.limited-notice a {
  color: #135f9c;
  font-weight: 900;
  text-decoration: none;
}

.session-notice {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 20;
  width: min(520px, calc(100% - 24px));
  transform: translateX(-50%);
  border-color: rgba(107, 203, 61, 0.34);
  background: #f7fff3;
  color: #276414;
  font-weight: 900;
  text-align: center;
}

.session-notice.error {
  border-color: rgba(155, 36, 48, 0.32);
  background: #fff5f5;
  color: #9b2430;
}

.user-admin-card.inactive {
  border-color: rgba(155, 36, 48, 0.34);
  background: rgba(255, 245, 245, 0.96);
}

.user-admin-card.inactive strong {
  color: #9b2430;
}

.sales-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 16%, rgba(255, 217, 61, 0.48), transparent 28%),
    radial-gradient(circle at 86% 12%, rgba(45, 156, 255, 0.32), transparent 30%),
    radial-gradient(circle at 78% 86%, rgba(107, 203, 61, 0.24), transparent 28%),
    linear-gradient(145deg, #eaf6ff, #fff9ea 50%, #eff8f3);
}

.sales-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: clamp(24px, 5vw, 58px) 0;
}

.sales-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 22px;
  align-items: stretch;
}

.sales-copy,
.sales-benefits {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 70px rgba(31, 77, 117, 0.16);
}

.sales-copy {
  display: grid;
  gap: 18px;
  padding: clamp(24px, 5vw, 52px);
  border-top: 7px solid #2f7da4;
}

.sales-logo {
  width: min(180px, 54vw);
}

.sales-copy h1 {
  max-width: 820px;
  color: #15456d;
  font-size: clamp(2.3rem, 6vw, 4.8rem);
  line-height: 0.98;
}

.sales-copy p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

.sales-price-card {
  display: grid;
  gap: 7px;
  max-width: 560px;
  padding: 18px;
  border: 2px solid rgba(216, 167, 47, 0.5);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 247, 220, 0.98), rgba(235, 250, 255, 0.92)),
    #fff;
  box-shadow: 0 18px 36px rgba(165, 109, 22, 0.13);
}

.sales-price-card small,
.sales-price-card em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.sales-price-card span {
  color: #775714;
  text-decoration: line-through;
  font-weight: 900;
}

.sales-price-card strong {
  color: #1f6b45;
  font-size: clamp(1.4rem, 4vw, 2.3rem);
  line-height: 1.05;
}

.sales-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sales-benefits {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(22px, 4vw, 36px);
  border-top: 7px solid #4f8f73;
}

.sales-benefits h2 {
  color: #15456d;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
}

.sales-benefits ul {
  display: grid;
  gap: 13px;
  margin: 0;
  padding-left: 20px;
  color: #526176;
  line-height: 1.5;
  font-weight: 800;
}

.sales-benefits li::marker {
  color: #4f8f73;
}

/* Lista horizontal de licoes: fica abaixo dos filtros e facilita navegar no celular. */
#studyView {
  grid-template-columns: 1fr;
}

#studyView .lesson-list {
  position: static;
  max-height: none;
  overflow: visible;
}

#studyView #lessonList {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 18px) / 4);
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: 12px;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(21, 69, 109, 0.42) rgba(21, 69, 109, 0.08);
  scrollbar-width: thin;
}

#studyView .lesson-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  min-width: 0;
  min-height: 100%;
  padding: 6px;
  margin-bottom: 0;
  scroll-snap-align: start;
}

#studyView .lesson-cover {
  grid-row: auto;
  aspect-ratio: 16 / 10;
  margin: 0;
  border-radius: 10px;
}

#studyView .lesson-cover-ref {
  top: 5px;
  right: 5px;
  max-width: calc(100% - 10px);
  padding: 3px 5px;
  font-size: 0.5rem;
}

#studyView .lesson-cover-book {
  max-width: calc(100% - 12px);
  font-size: clamp(1.18rem, 3.4vw, 2.45rem);
  line-height: 0.78;
}

#studyView .lesson-cover-principle {
  max-width: calc(100% - 16px);
  margin-top: 0;
  font-size: clamp(0.54rem, 1.35vw, 0.82rem);
  line-height: 0.96;
}

#studyView .lesson-cover-mark {
  left: 6px;
  bottom: 5px;
  font-size: clamp(0.78rem, 2vw, 1.1rem);
}

#studyView .lesson-card strong {
  min-width: 0;
  font-size: 0.7rem;
  line-height: 1.12;
}

#studyView .lesson-card-age {
  max-width: 100%;
  padding: 2px 5px;
  font-size: 0.58rem;
}

#studyView .lesson-card-topic {
  display: none;
}

#studyView .lesson-card.locked::after {
  top: auto;
  right: 8px;
  bottom: 8px;
  width: 22px;
  height: 22px;
  font-size: 0.72rem;
}

#studyView .lesson-card-verse {
  display: block;
  max-width: 100%;
  padding: 2px 5px;
  font-size: 0.58rem;
}

#studyView .lesson-meta {
  display: none;
}

.lesson-rail-arrow {
  color: #15456d;
  border-color: rgba(45, 156, 255, 0.22);
  background: rgba(255, 255, 255, 0.86);
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    width: 100%;
    padding: 8px 10px 24px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  border-radius: 16px;
  max-width: 100%;
}

.auth-profile-summary {
  display: grid;
  gap: 2px;
  max-width: min(320px, 100%);
  padding: 8px 12px;
  border: 1px solid rgba(45, 156, 255, 0.18);
  border-radius: 12px;
  color: #183856;
  background: rgba(255, 255, 255, 0.82);
  line-height: 1.15;
}

.auth-profile-summary strong,
.auth-profile-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-profile-summary small {
  color: var(--muted);
  font-size: 0.76rem;
}

  .topbar-actions {
    justify-items: stretch;
  }

  .brand {
    width: 100%;
    align-items: center;
  }

  .brand h1 {
    font-size: 1.05rem;
    line-height: 1.1;
  }

  .brand p {
    font-size: 0.82rem;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
  }

  .nav-menu {
    min-width: 0;
  }

  .nav-submenu {
    position: static;
    min-width: 0;
    margin-top: 6px;
    box-shadow: none;
  }

  .auth-slot {
    display: flex;
    justify-content: stretch;
    width: 100%;
  }

  .auth-name,
  .auth-profile-summary {
    max-width: none;
    width: 100%;
    text-align: center;
  }

  .tab,
  .icon-button,
  .file-button {
    min-width: 0;
    min-height: 44px;
    padding: 0 10px;
    white-space: normal;
    text-align: center;
  }

  .toolbar {
    gap: 10px;
    margin: 12px 0;
    padding: 12px;
    border-radius: 16px;
  }

  .site-info-section {
    grid-template-columns: 1fr;
  }

  .manage-tab-group {
    width: 100%;
    flex: 1 0 100%;
  }

  .manage-tab-submenu {
    position: static;
    min-width: 0;
    margin-top: 6px;
    box-shadow: none;
  }

  .home-view {
    gap: 16px;
  }

  .home-hero {
    gap: 18px;
    padding: 18px;
    border-radius: 18px;
  }

  .home-copy h2 {
    font-size: 2rem;
    line-height: 1.02;
  }

  .home-copy p {
    font-size: 0.98rem;
  }

  .home-actions,
  .home-feature-grid,
  .home-steps-grid,
  .home-login-actions,
  .trail-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .home-toolkit-section,
  .home-steps-section,
  .age-section {
    padding: 16px;
    border-radius: 18px;
  }

  .home-feature-grid > button,
  .home-feature-grid > span,
  .home-steps-grid article {
    min-height: auto;
    padding: 16px;
  }

  .home-login-panel {
    min-height: auto;
    padding: 18px;
  }

  .sales-hero {
    grid-template-columns: 1fr;
  }

  .sales-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  #studyView {
    gap: 12px;
  }

  .content-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .lesson-list {
    padding: 12px;
    border-radius: 16px;
  }

  .list-heading {
    display: grid;
    gap: 8px;
  }

  .lesson-row-controls {
    justify-content: space-between;
  }

  .lesson-reader {
    min-height: auto;
    border-radius: 16px;
  }

  .lesson-inline-video {
    width: min(100%, 460px);
    margin: 8px 0 12px;
    padding: 6px;
    border-radius: 10px;
  }

  .reader-hero {
    min-height: auto;
    padding: 18px;
  }

  .reader-hero h2,
  .stream-player-info h2,
  .stream-hero-copy h2 {
    font-size: 1.55rem;
    line-height: 1.08;
  }

  .reader-meta,
  .lesson-meta {
    gap: 5px;
  }

  .reader-chip,
  .pill {
    max-width: 100%;
    white-space: normal;
  }

  .section-timeline {
    padding: 14px;
  }

  .lesson-section {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .section-icon {
    width: 38px;
    height: 38px;
  }

  .trails-layout {
    padding: 12px;
    border-radius: 16px;
  }

  .trails-header,
  .manager-heading,
  .trail-row-heading,
  .user-admin-card {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .trail-row-controls {
    justify-content: space-between;
  }

  .rail-arrow {
    display: none;
  }

  .trail-rail {
    grid-auto-columns: minmax(82vw, 1fr);
  }

  .admin-card-rail {
    grid-auto-columns: minmax(178px, 54vw);
  }

  .trail-card:hover {
    transform: none;
  }

  .stream-player,
  .stream-hero {
    padding: 12px;
  }

  .stream-player-frame {
    min-height: auto;
    max-height: none;
  }

  .manage-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .user-actions {
    justify-content: stretch;
  }

  .user-actions .icon-button,
  .user-actions .pill {
    flex: 1 1 100%;
  }

  .admin-item-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .admin-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .admin-item-action {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }

  .auth-shell {
    padding: 10px;
    place-items: start center;
  }

  .auth-card {
    padding: 18px;
    border-radius: 18px;
  }

  .auth-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Mobile-first safety layer: keeps the page inside the viewport and favors vertical scrolling. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
iframe,
canvas {
  max-width: 100%;
}

button,
input,
select,
textarea,
a,
summary {
  min-width: 0;
  max-width: 100%;
}

.brand,
.topbar,
.topbar-actions,
.toolbar,
.view,
.home-hero,
.lesson-list,
.lesson-reader,
.editor,
.data-panel,
.video-manager,
.trails-layout,
.stream-player,
.stream-hero,
.trail-grid,
.trail-row,
.site-footer,
.site-info-section,
.communication-grid,
.user-admin-card,
.access-log-card,
.admin-item-card {
  max-width: 100%;
}

.brand *,
.toolbar *,
.lesson-reader *,
.video-manager *,
.site-footer *,
.news-drawer *,
.auth-card * {
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .app-shell {
    width: 100%;
    max-width: 100%;
    padding-inline: 10px;
    overflow: hidden;
  }

  .brand {
    gap: 10px;
  }

  .brand-logo {
    flex: 0 0 auto;
    width: 82px;
  }

  .brand h1 {
    font-size: clamp(0.98rem, 6vw, 1.28rem);
  }

  .brand p {
    display: none;
  }

  .topbar,
  .toolbar,
  .home-hero,
  .lesson-list,
  .lesson-reader,
  .editor,
  .data-panel,
  .video-manager,
  .trails-layout,
  .site-footer,
  .auth-card {
    width: 100%;
  }

  .nav-main,
  .tabs,
  .manage-tabs {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .nav-menu,
  .nav-menu summary,
  .nav-submenu,
  .nav-submenu .tab,
  .manage-tab,
  .manage-tab-group,
  .manage-tab-submenu {
    width: 100%;
  }

  .nav-submenu,
  .manage-tab-submenu {
    position: static;
    right: auto;
    min-width: 0;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar input,
  .toolbar select,
  .toolbar input[type="month"] {
    width: 100%;
    max-width: 100%;
  }

  .home-copy h2 {
    font-size: clamp(1.65rem, 10vw, 2.2rem);
  }

  .home-feature-grid,
  .age-grid,
  .form-grid,
  .communication-grid,
  .site-info-section,
  .stream-player,
  .stream-hero,
  .content-layout,
  #studyView,
  .manage-layout {
    grid-template-columns: 1fr !important;
  }

  .home-illustration,
  .home-login-panel {
    width: 100%;
  }

  .form-actions,
  .data-actions,
  .user-actions,
  .communication-link-list,
  .admin-export-row {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
    width: 100%;
  }

  .form-actions > *,
  .data-actions > *,
  .user-actions > *,
  .admin-export-row > *,
  .communication-link-list > * {
    width: 100%;
  }

  #studyView #lessonList,
  .trail-rail,
  .admin-card-rail,
  .stream-quick-nav {
    display: grid;
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: 1fr;
    overflow-x: visible;
    scroll-snap-type: none;
    padding-right: 0;
    padding-left: 0;
  }

  #studyView .lesson-card,
  .trail-card,
  .admin-card-rail > *,
  .video-admin-card,
  .news-card,
  .news-drawer-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .trail-card {
    min-height: auto;
  }

  .trail-content h3,
  .trail-content p {
    min-height: 0;
  }

  .lesson-row-controls,
  .trail-row-controls {
    display: none;
  }

  .reader-hero,
  .trails-header,
  .manager-heading,
  .trail-row-heading,
  .user-admin-card,
  .access-log-card,
  .attachment-remove-option {
    grid-template-columns: 1fr !important;
  }

  .reader-chip,
  .pill,
  .trail-category-line,
  .admin-item-body strong,
  .admin-item-body small,
  .admin-item-body em,
  .attachment-remove-option strong {
    white-space: normal;
  }

  .stream-player-frame,
  .stream-hero-thumb,
  .lesson-inline-video-frame {
    width: 100%;
  }

  .news-drawer {
    inset: 8px 8px 8px auto;
    width: calc(100% - 16px);
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding-inline: 8px;
  }

  .topbar,
  .toolbar,
  .home-hero,
  .lesson-list,
  .lesson-reader,
  .editor,
  .data-panel,
  .video-manager,
  .trails-layout,
  .site-footer,
  .auth-card {
    padding-inline: 10px;
  }

  .brand-logo {
    width: 70px;
  }

  .tab,
  .icon-button,
  .file-button,
  .manage-tab {
    min-height: 48px;
    padding-inline: 8px;
  }
}

/* Lições Bíblicas: aproxima a navegação do padrão confortável do Culto em Família. */
@media (min-width: 721px) {
  #studyView #lessonList {
    grid-auto-columns: minmax(240px, 292px);
    gap: 10px;
  }

  #studyView .lesson-card {
    gap: 8px;
    padding: 10px;
  }

  #studyView .lesson-card strong {
    font-size: 0.98rem;
    line-height: 1.18;
  }

  #studyView .lesson-card-age,
  #studyView .lesson-card-verse {
    padding: 4px 8px;
    font-size: 0.74rem;
    line-height: 1.2;
  }

  #studyView .lesson-cover-ref {
    font-size: 0.62rem;
  }

  #studyView .lesson-cover-principle {
    font-size: clamp(0.66rem, 0.95vw, 0.88rem);
    line-height: 1.05;
  }
}

@media (max-width: 720px) {
  #studyView #lessonList {
    gap: 10px;
  }

  #studyView .lesson-card {
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
  }

  #studyView .lesson-cover {
    aspect-ratio: 16 / 9;
    border-radius: 12px;
  }

  #studyView .lesson-card strong {
    font-size: 1rem;
    line-height: 1.22;
  }

  #studyView .lesson-card-age,
  #studyView .lesson-card-verse {
    padding: 5px 8px;
    font-size: 0.78rem;
    line-height: 1.22;
  }

  #studyView .lesson-cover-book {
    font-size: clamp(1.55rem, 13vw, 2.7rem);
  }

  #studyView .lesson-cover-ref {
    font-size: 0.62rem;
  }

  #studyView .lesson-cover-principle {
    font-size: clamp(0.68rem, 3.3vw, 0.92rem);
    line-height: 1.05;
  }
}

/* Refinamento final: Lições Bíblicas com dimensões equivalentes ao Culto em Família. */
#studyView .lesson-list {
  overflow: hidden;
}

#studyView #lessonList {
  grid-auto-columns: minmax(240px, 292px);
  gap: 10px;
}

#studyView .biblical-lesson-card {
  padding: 12px;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(31, 77, 117, 0.08);
}

#studyView .biblical-lesson-card strong {
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.22;
  white-space: normal;
}

#studyView .biblical-lesson-card .lesson-card-age,
#studyView .biblical-lesson-card .lesson-card-verse {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 5px 9px;
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
}

#studyView .biblical-lesson-card .lesson-cover {
  aspect-ratio: 16 / 9;
  border-radius: 14px;
}

#studyView .biblical-lesson-card .lesson-cover-book {
  font-size: clamp(1.55rem, 3.2vw, 2.7rem);
}

#studyView .biblical-lesson-card .lesson-cover-principle {
  font-size: clamp(0.7rem, 1.05vw, 0.9rem);
  line-height: 1.06;
}

@media (max-width: 720px) {
  #studyView {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  #studyView .lesson-list {
    padding: 14px;
    overflow: hidden;
    border-radius: 22px;
  }

  #studyView #lessonList {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-template-columns: none !important;
    grid-auto-columns: minmax(300px, calc(100vw - 58px)) !important;
    gap: 14px;
    overflow-x: auto !important;
    overflow-y: visible;
    overscroll-behavior-inline: contain;
    padding: 0 0 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  #studyView .biblical-lesson-card {
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 12px;
    border-radius: 18px;
    scroll-snap-align: start;
  }

  #studyView .biblical-lesson-card .lesson-cover {
    aspect-ratio: 16 / 9;
    border-radius: 16px;
  }

  #studyView .biblical-lesson-card strong {
    font-size: 1.34rem;
    line-height: 1.15;
  }

  #studyView .biblical-lesson-card .lesson-card-age,
  #studyView .biblical-lesson-card .lesson-card-verse {
    padding: 5px 9px;
    font-size: 1rem;
    white-space: normal;
  }

  #studyView .biblical-lesson-card .lesson-cover-book {
    font-size: clamp(1.9rem, 15vw, 3.1rem);
  }

  #studyView .biblical-lesson-card .lesson-cover-principle {
    font-size: clamp(0.82rem, 3.8vw, 1rem);
  }

  #studyView .lesson-reader {
    overflow: hidden;
    border-radius: 22px;
  }

  #studyView .reader-hero {
    padding: 28px;
    border-radius: 22px 22px 0 0;
  }

  #studyView .reader-hero h2 {
    font-size: clamp(2rem, 9vw, 2.65rem);
    line-height: 1.02;
  }

  #studyView .reader-verse strong {
    font-size: 1.05rem;
  }

  #studyView .section-timeline {
    display: grid;
    gap: 16px;
    padding: 22px;
  }

  #studyView .lesson-section {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  #studyView .section-icon {
    width: 54px;
    height: 54px;
  }

  #studyView .section-body {
    padding: 18px;
    border-radius: 16px;
  }

  #studyView .section-body h3 {
    font-size: 1.02rem;
  }

  #studyView .section-body p,
  #studyView .lesson-section-copy {
    font-size: 1.02rem;
    line-height: 1.65;
  }
}

@media (max-width: 380px) {
  #studyView #lessonList {
    grid-auto-columns: minmax(270px, calc(100vw - 52px)) !important;
  }

  #studyView .biblical-lesson-card strong {
    font-size: 1.18rem;
  }

  #studyView .biblical-lesson-card .lesson-card-age,
  #studyView .biblical-lesson-card .lesson-card-verse {
    font-size: 0.92rem;
  }
}

.mobile-filter-launcher,
.mobile-age-chips,
.mobile-bottom-nav,
.mobile-more-sheet,
.mobile-menu-overlay,
.mobile-filter-sheet-header,
.mobile-filter-sheet-actions {
  display: none;
}

@media (max-width: 720px) {
  body {
    padding-bottom: 78px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 70;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

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

  .topbar .nav-main,
  .topbar .auth-slot {
    display: none;
  }

  .notification-bell {
    width: 46px;
    height: 46px;
  }

  .mobile-filter-launcher {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    margin: 12px 0;
  }

  body[data-active-tab="home"] .mobile-filter-launcher {
    display: none;
  }

  .mobile-filter-button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 54px;
    width: 100%;
    padding: 0 16px;
    border: 1px solid rgba(45, 156, 255, 0.22);
    border-radius: 18px;
    color: #15456d;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 28px rgba(31, 77, 117, 0.12);
    text-align: left;
  }

  .mobile-filter-button span {
    font-size: 1.2rem;
  }

  .mobile-filter-button strong {
    font-family: "Baloo 2", Fredoka, Nunito, "Segoe UI", Arial, sans-serif;
    font-size: 1.05rem;
  }

  .mobile-filter-summary {
    display: block;
    padding: 0 4px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
  }

  .mobile-age-chips {
    display: flex;
    gap: 8px;
    margin: 0 0 12px;
    overflow-x: auto;
    padding: 1px 0 10px;
    scrollbar-width: none;
  }

  .mobile-age-chips::-webkit-scrollbar {
    display: none;
  }

  body:not([data-active-tab="study"]):not([data-active-tab="trails"]) .mobile-age-chips {
    display: none;
  }

  .mobile-age-chips button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(45, 156, 255, 0.18);
    border-radius: 999px;
    color: #15456d;
    background: rgba(255, 255, 255, 0.92);
    font-weight: 1000;
    box-shadow: 0 8px 18px rgba(31, 77, 117, 0.08);
  }

  .mobile-age-chips button.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--joy-blue), var(--creative-purple));
  }

  .toolbar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 88px;
    z-index: 140;
    max-height: min(76vh, 620px);
    margin: 0;
    overflow-y: auto;
    transform: translateY(calc(100% + 110px));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
    box-shadow: 0 28px 70px rgba(31, 77, 117, 0.28);
  }

  body.filter-sheet-open .toolbar {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-filter-sheet-header,
  .mobile-filter-sheet-actions {
    display: grid;
  }

  .mobile-filter-sheet-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
  }

  .mobile-filter-sheet-header .rail-arrow {
    display: grid;
    color: #15456d;
    border-color: rgba(45, 156, 255, 0.18);
    background: rgba(45, 156, 255, 0.1);
  }

  .mobile-filter-sheet-header h2 {
    color: var(--ink);
    font-size: 1.35rem;
  }

  .mobile-filter-sheet-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: block;
    background: rgba(33, 48, 71, 0.32);
    backdrop-filter: blur(2px);
  }

  .mobile-menu-overlay[hidden] {
    display: none;
  }

  .mobile-more-sheet {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 88px;
    z-index: 150;
    display: grid;
    gap: 8px;
    max-height: min(72vh, 560px);
    padding: 16px;
    border: 1px solid rgba(45, 156, 255, 0.18);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 28px 70px rgba(31, 77, 117, 0.28);
    overflow-y: auto;
    transform: translateY(calc(100% + 110px));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }

  body.mobile-more-open .mobile-more-sheet {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-more-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-family: "Baloo 2", Fredoka, Nunito, "Segoe UI", Arial, sans-serif;
    font-size: 1.2rem;
  }

  .mobile-more-header .rail-arrow {
    display: grid;
    color: #15456d;
    border-color: rgba(45, 156, 255, 0.18);
    background: rgba(45, 156, 255, 0.1);
  }

  .mobile-more-sheet button,
  .mobile-more-sheet a {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid rgba(45, 156, 255, 0.14);
    border-radius: 16px;
    color: #15456d;
    background: rgba(245, 251, 255, 0.92);
    font: inherit;
    font-weight: 1000;
    text-decoration: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
    gap: 4px;
    padding: 8px;
    border: 1px solid rgba(45, 156, 255, 0.2);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 44px rgba(31, 77, 117, 0.24);
    backdrop-filter: blur(14px);
  }

  .mobile-bottom-nav button,
  .mobile-bottom-nav a {
    display: grid;
    place-items: center;
    gap: 2px;
    min-height: 50px;
    padding: 4px 2px;
    border: 0;
    border-radius: 16px;
    color: #526176;
    background: transparent;
    font: inherit;
    font-weight: 1000;
    text-decoration: none;
  }

  .mobile-bottom-nav span {
    font-size: 1.18rem;
    line-height: 1;
  }

  .mobile-bottom-nav strong {
    font-size: 0.72rem;
    line-height: 1;
  }

  .mobile-bottom-nav .active {
    color: #fff;
    background: linear-gradient(135deg, var(--joy-blue), var(--creative-purple));
    box-shadow: 0 10px 20px rgba(45, 156, 255, 0.22);
  }
}

@media (max-width: 380px) {
  .mobile-bottom-nav {
    left: 6px;
    right: 6px;
    gap: 2px;
    padding: 7px;
  }

  .mobile-bottom-nav strong {
    font-size: 0.66rem;
  }

  .mobile-bottom-nav span {
    font-size: 1.05rem;
  }
}

/* Trilhas mobile: experiência de streaming com player focado, favoritos e carrosséis horizontais. */
.trail-card .trail-favorite.active,
.stream-player .trail-favorite.active {
  color: #3f2e08;
  border-color: rgba(255, 217, 61, 0.7);
  background: linear-gradient(135deg, #fff3a8, #ffd93d);
}

.stream-player .stream-mobile-hint {
  color: #526176;
}

@media (max-width: 720px) {
  body[data-active-tab="trails"] .app-shell {
    padding-inline: 8px;
  }

  body[data-active-tab="trails"] .mobile-filter-button {
    min-height: 50px;
  }

  .trails-layout {
    gap: 14px;
    padding: 10px;
    border-radius: 20px;
  }

  .trails-header {
    padding: 6px 4px 0;
  }

  .trails-header h2 {
    font-size: clamp(1.35rem, 7vw, 1.85rem);
    line-height: 1.06;
  }

  .trail-count {
    width: fit-content;
    padding: 6px 10px;
    font-size: 0.82rem;
  }

  .stream-player {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 10px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
  }

  .stream-player-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: auto !important;
    max-height: none !important;
    border-radius: 16px;
  }

  .stream-player-info {
    gap: 8px;
    align-content: start;
  }

  .stream-player-info h2 {
    font-size: clamp(1.24rem, 6.5vw, 1.65rem);
    line-height: 1.08;
  }

  .stream-mobile-hint {
    display: block;
    color: #526176;
    font-size: 0.86rem;
  }

  .stream-player .trail-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .stream-player .trail-favorite {
    min-width: 54px;
    padding-inline: 10px;
  }

  .stream-hero {
    display: none;
  }

  .stream-quick-nav {
    display: flex !important;
    grid-auto-flow: unset !important;
    grid-template-columns: none !important;
    gap: 8px;
    margin-inline: -2px;
    overflow-x: auto !important;
    padding: 0 2px 10px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .stream-quick-nav::-webkit-scrollbar,
  .trail-rail::-webkit-scrollbar {
    display: none;
  }

  .stream-quick-nav a {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .trail-grid {
    gap: 18px;
  }

  .trail-row-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
  }

  .trail-row-heading h3 {
    font-size: 1.08rem;
    line-height: 1.1;
  }

  .trail-row-controls {
    display: none;
  }

  .trail-rail {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-template-columns: none !important;
    grid-auto-columns: minmax(238px, 78vw) !important;
    gap: 10px;
    overflow-x: auto !important;
    overflow-y: visible;
    padding: 2px 2px 14px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
  }

  .trail-card {
    width: auto;
    min-height: 236px;
    border-radius: 16px;
    scroll-snap-align: start;
  }

  .trail-thumb {
    border-radius: 16px 16px 0 0;
  }

  .trail-thumb span {
    width: 48px;
    height: 48px;
  }

  .trail-content {
    gap: 8px;
    padding: 12px;
  }

  .trail-content h3 {
    min-height: 2.5em;
    font-size: 1rem;
    line-height: 1.22;
  }

  .trail-card .trail-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .trail-card .icon-button {
    min-height: 44px;
    padding-inline: 10px;
  }

  .trail-card .trail-favorite {
    width: 46px;
    min-width: 46px;
    padding-inline: 0;
  }
}
