/* ---------- Blocks ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); min-width: 0; display: grid; gap: 14px; align-content: start; }
.section { display: grid; gap: 14px; min-width: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lead { font-size: 1.0625rem; color: var(--muted); max-width: 65ch; }
.page-head { display: grid; gap: 10px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@container (max-width: 640px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
a.stat-link { text-decoration: none; color: inherit; transition: border-color .2s ease, transform .2s ease; }
a.stat-link:hover { border-color: var(--accent); transform: translateY(-1px); }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.stat-label { font-size: .8125rem; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; font-family: var(--font-label); white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill.pass { background: var(--pass-soft); color: var(--pass); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.fail { background: var(--fail-soft); color: var(--fail); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.highlight { background: color-mix(in srgb, var(--highlight) 16%, var(--surface)); color: var(--highlight); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .8125rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 20px; border-radius: 999px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.small { min-height: 36px; padding: 7px 14px; font-size: .875rem; }
.btn.btn-lg { min-height: 52px; padding: 14px 26px; font-size: 1.0625rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--font-label); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.en { font-weight: 600; }

.kv { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.kv > div { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.kv > div:nth-child(odd) { color: var(--muted); font-size: .875rem; background: var(--surface-2); }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 480px) { .kv { grid-template-columns: minmax(0, 1fr); } .kv > div:nth-child(odd) { border-bottom: 0; padding-bottom: 2px; } .kv > div:nth-last-child(2) { border-bottom: 0; } }

.timebar { display: flex; height: 40px; border-radius: var(--r-sm); overflow: hidden; gap: 2px; }
.timebar > span { display: flex; align-items: center; padding: 0 10px; font-family: var(--font-label); font-size: .75rem; background: var(--surface-2); white-space: nowrap; overflow: hidden; min-width: 0; }
.timebar > span:nth-child(2), .timebar > span:nth-child(4) { background: var(--accent-soft); color: var(--accent); }
.timebar > span:nth-child(3) { background: var(--accent); color: var(--accent-ink); }
.timebar-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; font-size: .875rem; }
.timebar-legend b { font-family: var(--font-label); font-weight: 500; font-size: .8125rem; margin-right: 6px; }

.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s ease; }

.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 680px) { .two { grid-template-columns: minmax(0, 1fr); } }
.note { border-left: 3px solid var(--line); padding: 2px 0 2px 14px; color: var(--muted); font-size: .9375rem; }
.banner { background: var(--warn-soft); color: var(--ink); border-radius: var(--r-md); padding: 12px 16px; font-size: .9rem; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(104px + env(safe-area-inset-bottom, 0px)); z-index: 50; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r-md); font-size: .9rem; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
@media (min-width: 1024px) { .toast { bottom: 24px; } }
.empty { border: 1px dashed var(--line); border-radius: var(--r-md); padding: 18px; color: var(--muted); font-size: .9375rem; }
.list-clean { list-style: none; padding: 0; display: grid; gap: 8px; }
.list-clean li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; }
.list-clean li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin: .6em 0 0 4px; }

/* next lesson */
.next { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: space-between; padding: 22px; border: 0; border-radius: var(--r-xl); color: var(--accent-ink); position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(110% 130% at 100% 0%, color-mix(in srgb, var(--glow) 60%, transparent), transparent 55%), radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, #000 22%, transparent), transparent 70%), var(--accent);
  box-shadow: 0 22px 40px -24px var(--accent); }
.next .eyebrow, .next .next-count { color: color-mix(in srgb, var(--accent-ink) 80%, transparent); }
.next h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.6rem); }
.next .next-obj { color: color-mix(in srgb, var(--accent-ink) 88%, transparent); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.next .progress { background: color-mix(in srgb, var(--accent-ink) 22%, transparent); }
.next .progress > i { background: var(--accent-ink); }
.next .btn { background: var(--accent-ink); color: var(--accent); justify-self: start; }
.next-empty { display: grid; align-content: center; }

/* weekday schedule */
/* Cronograma da semana (3.7.0): trilho horizontal com scroll-snap no celular, grade de 5 colunas quando cabe */
.sched { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(212px, 1fr); gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: 2px; padding: 2px 2px 10px; margin: 0 -2px; position: relative; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.sched::-webkit-scrollbar { height: 6px; }
.sched::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.sched-item { --k: var(--accent); position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; min-height: 196px; padding: 14px 14px 12px; scroll-snap-align: start;
  border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; color: var(--ink); overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 70% at 100% 0%, color-mix(in srgb, var(--k) 14%, transparent), transparent 70%), var(--surface); }
.sched-item::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--k); opacity: .85; }
a.sched-item:hover { border-color: color-mix(in srgb, var(--k) 60%, var(--line)); }
.sched-item.today { border-color: var(--highlight); box-shadow: inset 0 0 0 1px var(--highlight), var(--shadow); }
.sched-top { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.sched-day { display: grid; gap: 0; font-family: var(--font-label); font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: capitalize; }
.sched-day strong { font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); letter-spacing: -.01em; }
.sched-item.today .sched-day strong { color: var(--highlight); }
.sched-today { font-size: .6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; color: var(--accent-ink); background: var(--highlight); }
.sched-body { display: grid; gap: 3px; min-width: 0; align-content: start; }
.sched-num { font-family: var(--font-label); font-size: .75rem; font-weight: 700; color: var(--k); }
.sched-body .t { font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; line-height: 1.2; text-wrap: balance; }
.sched-body .s { font-size: .8125rem; color: var(--muted); }
.sched-foot { display: grid; gap: 8px; justify-items: start; }
.sched-bar { width: 100%; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--k) 14%, var(--surface-2)); overflow: hidden; }
.sched-bar i { display: block; height: 100%; border-radius: inherit; background: var(--k); }
.sched-item.is-corrigida .sched-bar i { background: var(--pass); }

/* course */
/* Curso (3.7.0): mapa das 26 semanas + trilho horizontal de semanas por módulo (grade quando cabe) */
.modules { display: grid; gap: 30px; }
.module-head { display: grid; gap: 6px; }
.module-head .eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.mod-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--k); }
.weeks { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; padding: 2px 2px 10px; margin: 0 -2px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.weeks::-webkit-scrollbar { height: 6px; }
.weeks::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.week-card { --k: var(--accent); position: relative; display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 6px; min-height: 200px; padding: 14px; scroll-snap-align: start; overflow: hidden; isolation: isolate;
  border: 1px solid var(--line); background: radial-gradient(110% 80% at 100% 0%, color-mix(in srgb, var(--k) 13%, transparent), transparent 70%), var(--surface); text-decoration: none; color: var(--ink); }
.module .week-card { --k: inherit; }
a.week-card:hover { border-color: color-mix(in srgb, var(--k) 60%, var(--line)); }
.week-card.locked { background: color-mix(in srgb, var(--surface-2) 55%, transparent); border-style: dashed; color: var(--muted); }
.week-card.current { border-color: var(--highlight); box-shadow: inset 0 0 0 1px var(--highlight), var(--shadow); }
.week-card .num { font-family: var(--font-label); font-size: .75rem; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wk-n { font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; color: color-mix(in srgb, var(--k) 70%, var(--ink)); }
.week-card.locked .wk-n { color: color-mix(in srgb, var(--muted) 45%, transparent); }
.week-card .t { font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; line-height: 1.2; text-wrap: balance; }
.wk-foot { display: grid; gap: 8px; align-self: end; }
.wk-bar { height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--k) 14%, var(--surface-2)); overflow: hidden; }
.wk-bar i { display: block; height: 100%; border-radius: inherit; background: var(--k); }
.course-map .section-head { margin-bottom: 4px; }
/* Página da semana: grade (bento) com aproveitamento, liberação e objetivos */
.bento { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; }
.bento > .bento-wide { grid-column: 1 / -1; }
.week-hero .lesson-head { gap: 10px; }

/* months (plan) */
.track { display: grid; }
.month { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.month:first-child { border-top: 0; padding-top: 0; }
.month-n { font-family: var(--font-label); font-size: .75rem; color: var(--muted); display: grid; gap: 2px; align-content: start; }
.month-n strong { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); line-height: 1; }
.month.current .month-n strong { color: var(--highlight); }
.month-body { display: grid; gap: 6px; min-width: 0; font-size: .9375rem; }
.month-body dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 0; }
.month-body dt { color: var(--muted); font-size: .8125rem; }
.month-body dd { margin: 0; }
@media (max-width: 520px) { .month { grid-template-columns: minmax(0, 1fr); gap: 8px; } .month-body dl { grid-template-columns: minmax(0, 1fr); } .month-body dd { margin-bottom: 6px; } }

/* diagnostic */
.results { display: grid; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.result-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); align-items: start; }
.result-row:first-child { border-top: 0; }
.result-row .id { font-family: var(--font-label); font-size: .8125rem; color: var(--muted); padding-top: 2px; }
.result-row .body { display: grid; gap: 4px; min-width: 0; }
.result-row .q { font-weight: 600; }
.result-row .fix { font-size: .875rem; color: var(--muted); }
@media (max-width: 520px) { .result-row { grid-template-columns: 36px minmax(0, 1fr); } .result-row .pill { grid-column: 2; justify-self: start; } }
.scorebar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.scorebar i.p { background: var(--pass); } .scorebar i.w { background: var(--warn); } .scorebar i.f { background: var(--fail); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .875rem; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

/* lesson */
.lesson-head { display: grid; gap: 12px; }
.lesson-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.callout { background: var(--accent-soft); border-radius: var(--r-md); padding: 14px 16px; display: grid; gap: 4px; }
.callout .eyebrow { color: var(--accent); }
.part { display: grid; gap: 16px; padding-top: 8px; }
.part-title { display: flex; align-items: center; gap: 12px; }
.part-title .idx { font-family: var(--font-label); font-size: .75rem; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 9px; }
.theory { display: grid; gap: 12px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); min-width: 0; }
.theory p { max-width: 70ch; }
.rule { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--warn-soft); font-size: .9375rem; }
.rule svg { width: 20px; height: 20px; stroke: var(--warn); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.examples { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.examples li { display: grid; gap: 2px; padding: 9px 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.examples .en { font-family: var(--font-body); font-weight: 600; font-size: .9375rem; overflow-wrap: anywhere; }
.examples .pt { font-size: .875rem; color: var(--muted); }
.reading { display: grid; gap: 12px; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.reading .text { display: grid; gap: 10px; font-size: 1.0625rem; line-height: 1.7; max-width: 68ch; }
.dialogue { display: grid; gap: 8px; }
.line { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.line .who { font-family: var(--font-label); font-size: .75rem; color: var(--muted); text-align: right; }
.line .say { background: var(--surface); border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 8px 12px; justify-self: start; }
.line.me .say { background: var(--accent-soft); border-color: transparent; }
.speak-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .8125rem; font-weight: 600; }
.speak-btn:hover { border-color: var(--accent); color: var(--accent); }
.speak-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.speak-btn.is-playing { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (pointer: coarse) { .speak-btn { min-height: 40px; padding: 8px 14px; } }

.stage { display: grid; gap: 12px; }
.stage-head { display: grid; gap: 4px; }
.level { font-family: var(--font-label); font-size: .6875rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.level[data-l="Médio"] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.level[data-l="Desafio"] { color: var(--fail); border-color: color-mix(in srgb, var(--fail) 40%, var(--line)); }
.qs { display: grid; gap: 10px; }
.q-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.q-item.answered { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.q-n { font-family: var(--font-label); font-size: .75rem; color: var(--muted); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.q-item.answered .q-n { background: var(--accent); color: var(--accent-ink); }
.q-main { display: grid; gap: 10px; min-width: 0; }
.q-prompt { font-weight: 600; overflow-wrap: anywhere; }
.q-sentence { font-size: 1.0625rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.q-sentence .gap { display: inline-block; min-width: 56px; border-bottom: 2px solid var(--line); text-align: center; font-weight: 700; color: var(--accent); padding: 0 6px; }
.q-sentence input.field { width: auto; min-width: 120px; flex: 1 1 140px; max-width: 260px; min-height: 40px; padding: 7px 10px; }
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice .speak-btn { position: relative; z-index: 1; margin-left: 4px; vertical-align: middle; } /* o rádio invisível cobre a opção; o Ouvir fica por cima */
.choice span { display: inline-block; padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: .9375rem; background: var(--surface); }
.choice input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); font: inherit; font-size: 1rem; resize: vertical; min-height: 46px; line-height: 1.45; }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
details.reveal summary { cursor: pointer; font-size: .8125rem; color: var(--muted); }
details.reveal p { font-size: .9375rem; padding-top: 6px; }
.fb { border-radius: var(--r-sm); padding: 10px 12px; font-size: .9rem; display: grid; gap: 4px; }
.fb.pass { background: var(--pass-soft); } .fb.warn { background: var(--warn-soft); } .fb.fail { background: var(--fail-soft); }
.fb .fb-h { font-family: var(--font-label); font-size: .75rem; font-weight: 600; }
.fb.pass .fb-h { color: var(--pass); } .fb.warn .fb-h { color: var(--warn); } .fb.fail .fb-h { color: var(--fail); }
/* Exercícios Fale */
.speak-q { display: grid; gap: 10px; min-width: 0; }
.speak-q .q-prompt { font-size: 1.0625rem; }
.speak-q .row { gap: 8px; }
.mic-btn { border-color: var(--accent); color: var(--accent); }
.mic-btn.is-listening { background: var(--fail); border-color: var(--fail); color: #FFFFFF; animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--fail) 45%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
@media (prefers-reduced-motion: reduce) { .mic-btn.is-listening { animation: none; } }
.sfb { border-radius: var(--r-sm); padding: 10px 12px; font-size: .9rem; display: grid; gap: 6px; background: var(--surface-2); overflow-wrap: anywhere; }
.sfb.pass { background: var(--pass-soft); } .sfb.warn { background: var(--warn-soft); } .sfb.fail { background: var(--fail-soft); }
.sfb .sfb-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; font-family: var(--font-label); font-size: .75rem; font-weight: 600; color: var(--muted); }
.sfb.pass .sfb-h { color: var(--pass); } .sfb.warn .sfb-h { color: var(--warn); } .sfb.fail .sfb-h { color: var(--fail); }
.sfb .words { display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: 1rem; font-weight: 600; }
.sfb .w-ok { color: var(--pass); }
.sfb .w-miss { color: var(--fail); text-decoration: underline wavy; text-underline-offset: 4px; }
.sfb .w-extra { color: var(--muted); font-weight: 400; text-decoration: line-through; }
.submitbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); position: sticky; bottom: 12px; box-shadow: var(--shadow); z-index: 5; }
.submitbar { position: static; }
@media (min-width: 681px) { .submitbar { position: sticky; } }
@media (min-width: 681px) and (max-width: 1023px) { .submitbar { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }
.submitbar .info { display: grid; gap: 6px; min-width: 0; flex: 1 1 220px; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* report */
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 680px) { .report-grid { grid-template-columns: minmax(0, 1fr); } }
.comp-list { display: grid; gap: 6px; }
.comp { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .9375rem; padding: 6px 0; border-bottom: 1px solid var(--line); }
.comp:last-child { border-bottom: 0; }

/* level diagnosis */
.lvl-now { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.lvl-big { font-family: var(--font-display); font-weight: 700; font-size: 3rem; line-height: 1; color: var(--highlight); }
.ltrack { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.lstep { display: grid; gap: 6px; }
.lstep .bar { height: 8px; border-radius: 999px; background: var(--surface-2); }
.lstep.done .bar { background: color-mix(in srgb, var(--highlight) 45%, var(--surface-2)); }
.lstep.now .bar { background: var(--highlight); }
.lstep .lbl { font-family: var(--font-label); font-size: .6875rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lstep.now .lbl { color: var(--highlight); font-weight: 600; }
.lstep.goal .lbl { color: var(--ink); }
.lstep.goal .bar { box-shadow: inset 0 0 0 1.5px var(--ink); }
@media (max-width: 520px) { .meta-tag { display: none; } }

/* settings */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.theme-opt { position: relative; display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; }
.theme-opt:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.theme-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.theme-opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); height: 40px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.swatches i { display: block; }
.theme-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; }
.theme-opt:has(input:checked) .check { background: var(--accent); border-color: var(--accent); }
.theme-opt:has(input:checked) .check::after { content: ""; width: 8px; height: 5px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.link-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.link-card { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-decoration: none; color: var(--ink); }
.link-card:hover { border-color: var(--accent); }
.link-card > span { font-size: .875rem; color: var(--muted); }

/* Documentação */
.version-num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
/* Meta de liberação da próxima semana (Painel e página da semana): blocos empilhados em qualquer largura */
.release-goal { display: grid; gap: 12px; min-width: 0; }
.release-goal > * { min-width: 0; margin: 0; }
.release-goal .progress { width: 100%; }
.doc { display: grid; gap: 10px; }
.doc p, .doc li { max-width: 70ch; }
.doc ol, .doc ul { display: grid; gap: 6px; }
code { font-family: var(--font-mono); font-size: .85em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; }
.toc a { font-size: .8125rem; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); }

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

/* ---------- Revisão de layout 3.4.2: alinhamento e toque em todas as telas ---------- */
.section-head > a.more { font-size: .875rem; font-weight: 600; text-decoration: none; padding: 6px 2px; }
.section-head > a.more:hover { text-decoration: underline; }
.panel .section-head h2 { font-size: 1.2rem; }
@media (min-width: 681px) { .timebar-legend { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); } .timebar-legend b { display: block; margin: 0 0 2px; } }
@media (max-width: 480px) {
  .timebar-legend { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .timebar > span { padding: 0 6px; }
  .submitbar .btn { width: 100%; justify-content: center; }
  .q-sentence input.field { min-width: 96px; flex-basis: 110px; max-width: 200px; }
  .panel, .theory { padding: 16px; }
}
/* Tabelas no celular: curtas ficam mais justas; as de texto longo viram cartões */
@media (max-width: 600px) {
  th, td { padding: 9px 8px; }
  th:first-child, td:first-child { padding-left: 12px; }
  th { white-space: normal; letter-spacing: .02em; font-size: .6875rem; }
  .table-wrap.is-stack { overflow: visible; }
  .table-wrap.is-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table-wrap.is-stack table, .table-wrap.is-stack tbody, .table-wrap.is-stack tr { display: block; width: 100%; }
  .table-wrap.is-stack tr { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
  .table-wrap.is-stack tr:last-child { border-bottom: 0; }
  .table-wrap.is-stack td { display: grid; grid-template-columns: minmax(84px, 34%) minmax(0, 1fr); gap: 10px; padding: 0; border: 0; overflow-wrap: anywhere; }
  .table-wrap.is-stack td::before { content: attr(data-label); padding-top: 3px; font-family: var(--font-label); font-size: .6875rem; line-height: 1.4; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 500; }
  .table-wrap.is-stack td:first-child { display: block; font-size: 1rem; }
  .table-wrap.is-stack td:first-child::before { content: none; }
}

/* ---------- Aula viva 3.5.0: cores por seção, movimento e cara de caderno ----------
   Cada seção ganha uma cor de estudo (--k) que só decora: títulos, ícones, números e fundos suaves.
   Ação continua no acento (botões, opção marcada). Texto colorido mistura a cor com --ink
   para manter contraste em todos os temas. */
.part { --k: var(--accent); --k-ink: color-mix(in srgb, var(--k) 72%, var(--ink)); --k-soft: color-mix(in srgb, var(--k) 13%, var(--surface)); --k-line: color-mix(in srgb, var(--k) 30%, var(--line)); }
.part[data-kind="review"] { --k: var(--k-review); }
.part[data-kind="theory"] { --k: var(--k-theory); }
.part[data-kind="vocab"] { --k: var(--k-vocab); }
.part[data-kind="usage"] { --k: var(--k-usage); }
.part[data-kind="reading"] { --k: var(--k-reading); }
.part[data-kind="dialogue"] { --k: var(--k-dialogue); }
.part[data-kind="warm"] { --k: var(--k-usage); }
.part[data-kind="practice"], .part[data-kind="assess"] { --k: var(--accent); }
.part[data-kind="listen"] { --k: var(--k-reading); }
.part[data-kind="writing"] { --k: var(--k-theory); }
.part[data-kind="speak"] { --k: var(--k-dialogue); }
.part[data-kind="check"], .part[data-kind="summary"] { --k: var(--pass); }
.part[data-kind="fix"] { --k: var(--k-vocab); }
.part[data-kind="pron"] { --k: var(--highlight); }
.toc-chip[data-kind="pron"] { --k: var(--highlight); }
/* 5.0: banco de palavras (ordenar), exemplo resolvido, resposta modelo, roteiro de fala e diálogo com transcrição */
.word-bank { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.word-chip { font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--k-line, var(--line)); background: var(--k-soft, var(--surface-2)); color: var(--k-ink, var(--ink)); cursor: pointer; transition: transform .15s ease, background-color .2s ease; }
.word-chip:hover { transform: translateY(-1px); }
.word-chip:active { transform: scale(.96); }
.word-chip.clear { background: transparent; color: var(--muted); border-style: dashed; }
.ex-example { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 2px; padding: 10px 12px; border-radius: 12px; background: var(--k-soft, var(--surface-2)); border: 1px dashed var(--k-line, var(--line)); font-size: 14px; }
.ex-example b { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--k-ink, var(--accent)); }
.ex-example .arrow { color: var(--muted); }
.prep-link { font: inherit; font-size: 13px; background: none; border: 0; color: var(--k-ink, var(--accent)); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }
.self-check { margin: 6px 0; padding-left: 18px; }
.reveal.model .en { font-weight: 500; }
.pron-tip { display: grid; gap: 10px; }
.pairs { display: flex; flex-wrap: wrap; gap: 8px; }
.pair { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; background: var(--k-soft); border: 1px solid var(--k-line); }
.pair .vs { color: var(--muted); font-size: 12px; }
.ff-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ff-list li { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--highlight) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--highlight) 25%, var(--line)); }
.comp-audio { margin: 8px 0 12px; }
.comp-audio .dialogue { margin-top: 8px; }
.comp-text { margin: 8px 0 12px; }

/* título da seção: ícone em selo colorido + número + título */
.part-title { gap: 12px; }
.part-ic { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #FFFFFF; background: linear-gradient(140deg, color-mix(in srgb, var(--k) 78%, #FFFFFF), var(--k)); box-shadow: 0 8px 18px -10px var(--k), inset 0 1px 0 rgba(255, 255, 255, .25); }
.part-ic svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.part-title .idx { color: var(--k-ink); border-color: var(--k-line); background: var(--k-soft); }
.part-title h2 { color: var(--ink); }
.part-title::after { content: ""; flex: 1 1 24px; height: 2px; min-width: 24px; border-radius: 2px; background: linear-gradient(90deg, var(--k-line), transparent); }

/* cartões da seção: faixa de cor no topo e linhas de caderno bem leves */
.part .theory, .part .reading { position: relative; overflow: hidden; border-color: var(--k-line); }
.part .theory::before, .part .reading::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--k), color-mix(in srgb, var(--k) 35%, var(--surface))); }
.part .reading { background: repeating-linear-gradient(to bottom, transparent 0 31px, color-mix(in srgb, var(--k) 9%, transparent) 31px 32px), var(--surface); background-position: 0 14px; }
.part .theory h3 { color: var(--k-ink); }
.part .table-wrap { border-color: var(--k-line); }
.part .table-wrap th { background: var(--k-soft); color: var(--k-ink); }
.part td.en { color: var(--k-ink); }
.part .examples li { background: var(--k-soft); transition: transform .2s ease; }
.part .list-clean li::before { background: var(--k); width: 8px; height: 8px; border-radius: 3px; transform: rotate(45deg); margin-top: .5em; }
.part .line .say { border-color: var(--k-line); }
.part .line:not(.me) .say { background: var(--k-soft); border-color: transparent; }
.part .line.me .say { background: var(--accent-soft); }
.part .line .who { color: var(--k-ink); font-weight: 500; }

/* objetivo e herói da aula */
.lesson-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 22px; border-radius: var(--r-lg); position: relative; overflow: hidden; color: var(--ink);
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--k-theory) 22%, transparent), transparent 55%), radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, var(--k-vocab) 18%, transparent), transparent 60%), linear-gradient(135deg, var(--accent-soft), var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); box-shadow: var(--shadow); }
.lesson-hero-text { display: grid; gap: 10px; min-width: 0; }
.lesson-hero .eyebrow { color: color-mix(in srgb, var(--accent) 70%, var(--ink)); }
.lesson-ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; display: grid; place-content: center; text-align: center; position: relative; flex: none;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), color-mix(in srgb, var(--accent) 14%, var(--surface)) 0); transition: --p .6s ease; }
.lesson-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .06); }
.lesson-ring > span { position: relative; }
.lesson-ring-n { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; line-height: 1; font-variant-numeric: tabular-nums; }
.lesson-ring-l { font-family: var(--font-label); font-size: .5625rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.lesson-ring.done { background: conic-gradient(var(--pass) 100%, transparent 0); }
.lesson-ring.done .lesson-ring-n { color: var(--pass); }
@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }
@media (max-width: 520px) { .lesson-hero { padding: 18px; gap: 14px; } .lesson-ring { width: 76px; height: 76px; } .lesson-ring::before { inset: 7px; } .lesson-ring-n { font-size: 1.1rem; } .lesson-ring-l { font-size: .5rem; } }
.callout { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; background: linear-gradient(120deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 40%, var(--surface))); }
.callout-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.callout-ic svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.callout > div { display: grid; gap: 4px; min-width: 0; }
.lesson-head .chip { background: var(--surface); border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); color: color-mix(in srgb, var(--accent) 55%, var(--ink)); font-weight: 500; }

/* exercícios: cartões que respondem, número com a cor da seção, pulo ao responder */
.part .q-item { border-color: var(--line); transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease; }
.part .q-item:focus-within { border-color: var(--k-line); box-shadow: 0 0 0 4px color-mix(in srgb, var(--k) 12%, transparent), var(--shadow); }
.part .q-n { background: var(--k-soft); color: var(--k-ink); font-weight: 600; transition: background-color .25s ease, color .25s ease; }
.part .q-item.answered { border-color: var(--k-line); background: linear-gradient(180deg, color-mix(in srgb, var(--k) 5%, var(--surface)), var(--surface)); }
.part .q-item.answered .q-n { background: var(--k); color: #FFFFFF; animation: q-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.part .q-sentence .gap { color: var(--k-ink); border-bottom-color: var(--k-line); }
.choice span { transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .15s ease; }
.choice:hover span { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.choice input:checked + span { animation: q-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.choice:active span { transform: scale(.95); }
.stage-head h3 { color: var(--k-ink); }
.level { background: var(--surface); }
.level[data-l="Fácil"] { color: var(--pass); border-color: color-mix(in srgb, var(--pass) 40%, var(--line)); }
.speak-btn { transition: border-color .2s ease, color .2s ease, background-color .2s ease, transform .15s ease; }
.speak-btn:active, .btn:active { transform: scale(.96); }
.btn { transition: filter .2s ease, transform .15s ease, background-color .2s ease; }
.submitbar { border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); background: linear-gradient(120deg, var(--surface), color-mix(in srgb, var(--accent-soft) 60%, var(--surface))); }
.submitbar .progress > i { background: linear-gradient(90deg, var(--accent), var(--k-vocab)); }

@keyframes q-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* entrada: o topo da aula sobe ao abrir; as seções sobem quando entram na tela (onde o navegador suporta) */
.lesson-head > * { animation: rise .55s cubic-bezier(.2, .8, .3, 1) both; }
.lesson-head > :nth-child(2) { animation-delay: .08s; }
.lesson-head > :nth-child(3) { animation-delay: .14s; }
.lesson-head > :nth-child(4) { animation-delay: .2s; }
.lesson-ring { animation: ring-in .9s cubic-bezier(.2, .8, .3, 1) .15s both; }
@keyframes ring-in { from { transform: rotate(-90deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@supports (animation-timeline: view()) {
  .part > .part-title, .part .theory, .part .reading, .part .stage, .part > .table-wrap, .part > .examples, .part .dialogue { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 30%; }
}
.part-ic { transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.part:hover .part-ic { transform: rotate(-6deg) scale(1.06); }
@media print { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- 3.6.0: Aparência, sumário da aula e acabamento ---------- */
/* Modo: controle segmentado */
.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); max-width: 100%; justify-self: start; }
.seg-opt { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: .9375rem; color: var(--muted); cursor: pointer; transition: background-color .2s ease, color .2s ease, box-shadow .2s ease; }
.seg-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-opt:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg-ic svg { width: 18px; height: 18px; display: block; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 400px) { .seg-opt { padding: 8px 10px; gap: 6px; font-size: .875rem; } }

/* Paleta: miniatura clara + escura */
/* Ajustes: cartões de paleta (miniatura clara e escura + ícone da marca na paleta) */
.palettes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin-bottom: 18px; }
.palette-preview { display: grid; grid-template-columns: 1fr 1fr; height: 92px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.palette-opt:has(input:checked) { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.palette-opt .theme-meta { align-items: center; gap: 10px; justify-content: start; }
.palette-opt .theme-meta > div { flex: 1; min-width: 0; }
.palette-mark { width: 30px; height: 30px; flex: none; border-radius: 24%; display: block; stroke: none; }
.pv { position: relative; display: grid; align-content: start; gap: 5px; padding: 10px; background: var(--pv-bg); }
.pv i { display: block; }
.pv-line { height: 6px; width: 70%; border-radius: 3px; background: var(--pv-ink); opacity: .85; }
.pv-line.short { width: 42%; opacity: .35; }
.pv-card { margin-top: 4px; padding: 7px; border-radius: 7px; background: var(--pv-accent); display: grid; gap: 6px; }
.pv-bar { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--pv-card) 45%, transparent); }
.pv-btn { width: 40%; height: 9px; border-radius: 5px; background: var(--pv-card); }
.pv-dot { position: absolute; right: 9px; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: var(--pv-hi); }

/* Aula: chips e PDF na mesma linha; sumário fixo com as seções */
.lesson-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.lesson-toc { position: sticky; top: 0; z-index: 15; min-width: 0; margin-block: -12px; padding-block: 8px; margin-inline: -16px; padding-inline: 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
@media (max-width: 1023px) { .lesson-toc { top: calc(55px + env(safe-area-inset-top, 0px)); } }
@media (min-width: 681px) and (max-width: 1023px) { .lesson-toc { margin-inline: -32px; padding-inline: 32px; } }
@media (min-width: 1024px) { .lesson-toc { margin-inline: -12px; padding-inline: 12px; border-radius: 0 0 var(--r-md) var(--r-md); } }
.lesson-toc-track { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain;
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 24px), transparent); padding-inline: 4px; }
.lesson-toc-track::-webkit-scrollbar { display: none; }
.toc-chip { --k: var(--accent); flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: .8125rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: border-color .2s ease, background-color .2s ease; }
.toc-chip:hover { border-color: var(--k); background: color-mix(in srgb, var(--k) 10%, var(--surface)); }
.toc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--k); }
.toc-chip[data-kind="review"] { --k: var(--k-review); }
.toc-chip[data-kind="theory"] { --k: var(--k-theory); }
.toc-chip[data-kind="vocab"] { --k: var(--k-vocab); }
.toc-chip[data-kind="usage"] { --k: var(--k-usage); }
.toc-chip[data-kind="reading"] { --k: var(--k-reading); }
.toc-chip[data-kind="dialogue"] { --k: var(--k-dialogue); }
.part { scroll-margin-top: 72px; }
@media (max-width: 1023px) { .part { scroll-margin-top: calc(124px + env(safe-area-inset-top, 0px)); } }
.part-title h2:focus { outline: none; }
.lesson-hero h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); letter-spacing: -.02em; }
.lesson-hero { border-radius: var(--r-xl); }

/* acabamento geral */
.link-card, .theme-opt { border-radius: var(--r-md); }
.sched-item, .week-card { border-radius: var(--r-lg); }
.sched-item, .week-card, .link-card, .theme-opt { transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
a.sched-item:hover, a.week-card:hover, .link-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.progress { border-radius: 999px; overflow: hidden; }
.progress > i { border-radius: 999px; }
.banner { border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.toast { border-radius: 999px; padding: 11px 18px; box-shadow: var(--shadow-lg); }
.section-head h2 { letter-spacing: -.015em; }
#corr-summary:empty { display: none; }
@media (max-width: 420px) { th { white-space: normal; letter-spacing: .02em; font-size: .6875rem; overflow-wrap: anywhere; } th, td { padding-inline: 7px; } }
/* Telas largas: os trilhos viram grade (5 aulas, 4 ou 5 semanas por linha) sem rolagem lateral */
@container (min-width: 860px) {
  .sched { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; }
  /* 5.5: 6 semanas por módulo em 2 linhas de 3 (antes 5 + 1 sobrando) */
  .weeks { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
}

/* Ajustes (3.8.0): modo em cartões com miniatura da Aurora */
.mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.seg-opt.mode-card { display: grid; justify-content: stretch; gap: 10px; padding: 10px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 500; }
.seg-opt.mode-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow); background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); }
.mode-pv { display: grid; height: 96px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.mode-pv.split { grid-template-columns: 1fr 1fr; }
.mode-meta { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 0 4px 2px; }
.mode-meta strong { display: block; }
.mode-meta small { display: block; font-size: .8125rem; color: var(--muted); }
.mode-meta .seg-ic svg { width: 20px; height: 20px; }
.mode-card:has(input:checked) .check { background: var(--accent); border-color: var(--accent); }
.mode-card:has(input:checked) .check::after { content: ""; width: 8px; height: 5px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.ajustes .bento > .panel { display: grid; gap: 12px; align-content: start; }
/* Como funciona (3.8.0): blocos em cartões e grade */
.level-jump { display: grid; grid-template-columns: auto auto auto; align-items: center; justify-items: center; gap: 2px 10px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.level-jump b { font-family: var(--font-display); font-size: 1.9rem; line-height: 1; letter-spacing: -.02em; }
.level-jump b:last-of-type { color: var(--accent); }
.level-jump span { color: var(--muted); font-size: 1.2rem; }
.level-jump small { grid-column: 3; font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--highlight); }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.tile { display: grid; gap: 6px; align-content: start; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.tile-k { font-family: var(--font-label); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.tile-v { font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; line-height: 1.25; text-wrap: balance; }
.tile-accent { background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--glow) 18%, transparent), transparent 70%), color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.tile-wide { grid-column: 1 / -1; }
.tile-wide .tile-v { font-family: var(--font-body); font-weight: 500; font-size: 1rem; }
.cal-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.cal-tile .tile-v { font-family: var(--font-body); font-weight: 500; font-size: 1rem; }
.day-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.day-tile { --k: var(--accent); position: relative; display: grid; gap: 6px; padding: 14px 12px 12px; border-radius: var(--r-md); border: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--k) 16%, transparent), transparent 70%), var(--surface); }
.day-tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--k); }
.day-tile strong { font-family: var(--font-display); font-size: 1rem; line-height: 1.2; }
@media (max-width: 640px) { .day-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .day-tile:last-child { grid-column: 1 / -1; } }
.step-grid { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.step-grid li { counter-increment: step; position: relative; padding: 16px 16px 16px 58px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); line-height: 1.5; }
.step-grid li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 14px; top: 14px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: .875rem; color: var(--accent); background: var(--accent-soft); }
.plano .track { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.plano .month { --k: var(--accent); position: relative; grid-template-columns: 1fr; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: radial-gradient(110% 70% at 100% 0%, color-mix(in srgb, var(--k) 13%, transparent), transparent 70%), var(--surface); }
.plano .month:first-child { padding-top: 18px; border-top: 1px solid var(--line); }
.plano .month::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--k); }
.plano .month.current { border-color: var(--highlight); box-shadow: inset 0 0 0 1px var(--highlight), var(--shadow); }
.plano .month-n { grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 10px; }
.plano .month-n strong { font-size: 2rem; color: color-mix(in srgb, var(--k) 70%, var(--ink)); letter-spacing: -.03em; }
.plano .month-body dl { grid-template-columns: 1fr; gap: 2px; }
.plano .month-body dd + dt { margin-top: 8px; }
/* Meu nível (3.8.0): competências em cartões com 3 degraus */
.comp-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.comp.comp-card { grid-template-columns: 1fr; align-content: start; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.comp.comp-card:last-child { border-bottom: 1px solid var(--line); }
.comp-name { display: grid; gap: 2px; }
.comp-name .muted { font-size: .8125rem; }
.comp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.comp-steps i { height: 6px; border-radius: 99px; background: var(--surface-2); }
.comp-steps i.on { background: var(--muted); }
.comp-steps i.on.pass { background: var(--pass); }
.comp-steps i.on.accent { background: var(--accent); }
.comp-steps i.on.warn { background: var(--warn); }
.nivel .bento > .panel { align-self: stretch; }
/* Ajuda (3.8.0): índice de tópicos em grade */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.doc-tile { font: inherit; text-align: left; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9375rem; line-height: 1.3; transition: border-color .2s ease, transform .2s ease; }
.doc-tile b { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; font-family: var(--font-display); color: var(--accent); background: var(--accent-soft); }
.doc-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.doc { scroll-margin-top: 80px; }
@media (max-width: 560px) { .plano .hero { grid-template-columns: 1fr; } .plano .level-jump { justify-self: start; } }

/* Mapa do curso (3.8.1): cor = situação da semana (a mesma da legenda); módulos agrupados com rótulo */
.map-mods { display: flex; flex-wrap: wrap; gap: 14px 20px; margin-top: 12px; }
.map-mod { display: grid; gap: 6px; }
.map-mod-l { font-family: var(--font-label); font-size: .6875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.map-row { display: flex; gap: 6px; }
.map-tile { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; text-decoration: none; overflow: hidden; flex: none;
  font-family: var(--font-display); font-size: .9375rem; transition: transform .2s ease; border: 1px solid transparent; }
.map-tile b { position: relative; z-index: 1; }
.map-tile i { position: absolute; inset: auto 0 0 0; height: var(--d, 0%); background: color-mix(in srgb, var(--accent) 30%, transparent); }
a.map-tile:hover { transform: translateY(-2px); }
.map-tile.is-closed { background: var(--pass); color: #fff; }
.map-tile.is-current { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--highlight); }
.map-tile.is-current i { background: color-mix(in srgb, var(--accent-ink) 22%, transparent); }
.map-tile.is-open { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.map-tile.is-locked { background: transparent; color: var(--muted); border: 1px dashed var(--line); }
.map-legend { display: flex; flex-wrap: nowrap; align-items: center; gap: 16px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; font-size: .8125rem; color: var(--muted); }
.map-legend::-webkit-scrollbar { display: none; }
.map-key { display: inline-flex; align-items: center; gap: 7px; flex: none; }
.map-key .map-tile { width: 14px; height: 14px; border-radius: 4px; }
.map-key .map-tile.is-current { box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--highlight); }
@media (max-width: 420px) { .map-tile { width: 38px; height: 38px; border-radius: 10px; font-size: .875rem; } .map-row { gap: 5px; } .map-legend { gap: 12px; font-size: .75rem; } }
@media (max-width: 560px) {
  .map-mods { display: grid; gap: 8px; }
  .map-mod { grid-template-columns: 30px auto; align-items: center; gap: 8px; }
  .map-mod-x { display: none; }
}
.map-short { display: none; }
@media (max-width: 420px) { .map-long { display: none; } .map-short { display: inline; } .map-legend { gap: 9px; font-size: .6875rem; } .map-key { gap: 5px; } }

/* ==========================================================================
   Ajustes 4.1.0: painéis em grade (Voz e velocidade, Tema, Ajuda) e perfil no topo
   ========================================================================== */
.set-panel { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: clamp(18px, 3cqi, 28px); border-radius: var(--r-xl); }
.set-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.set-head h2 { font-size: clamp(1.2rem, 2.4cqi, 1.45rem); letter-spacing: -.01em; }
.set-kicker { display: block; font-family: var(--font-label); font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin-bottom: 4px; }
.set-panel h3 { font-family: var(--font-label); font-size: .8125rem; font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: 0; margin: 2px 0 -4px; }
.set-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@container (min-width: 760px) { .set-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.set-group { display: grid; gap: 12px; align-content: start; }
.set-note { font-size: .8125rem; color: var(--muted); line-height: 1.5; }
.opt-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.opt-grid.opt-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container (max-width: 520px) { .opt-grid.opt-3 { grid-template-columns: minmax(0, 1fr); } }
.opt-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-md); background: var(--surface); }
.opt-col { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: start; }
.opt-col .speed-bars { grid-column: 1; }
.opt-col .opt-t { grid-column: 1 / -1; }
.opt-col .check { grid-column: 2; grid-row: 1; }
@container (max-width: 520px) { .opt-col { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto; align-items: center; } .opt-col .opt-t { grid-column: 2; } .opt-col .check { grid-column: 3; grid-row: 1; } }
.opt-t { display: grid; gap: 2px; min-width: 0; }
.opt-t strong { font-size: .9375rem; }
.opt-t small { font-size: .8125rem; color: var(--muted); line-height: 1.35; }
.opt-ic, .opt-n { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; font-weight: 700; font-family: var(--font-display); }
.opt-ic svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.opt-card:has(input:checked) { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.opt-card:has(input:checked) .opt-ic, .opt-card:has(input:checked) .opt-n { background: var(--accent); color: var(--accent-ink); }
.speed-bars { display: inline-flex; align-items: flex-end; gap: 4px; height: 22px; }
.speed-bars i { width: 6px; border-radius: 3px; background: color-mix(in srgb, var(--muted) 30%, transparent); }
.speed-bars i:nth-child(1) { height: 9px; } .speed-bars i:nth-child(2) { height: 15px; } .speed-bars i:nth-child(3) { height: 22px; }
.speed-bars i.on { background: var(--accent); }

/* Tema: modo em pílula (Sistema, Claro, Escuro) e cores em cartões com miniatura */
.mode-seg { display: grid; width: auto; justify-self: stretch; max-width: 520px; min-width: 0; }
.mode-seg .seg-opt { min-width: 0; padding-inline: 10px; }
.mode-seg .seg-opt { min-height: 46px; }
.color-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); max-width: 560px; }
.color-opt { display: grid; gap: 10px; padding: 10px 10px 14px; border-radius: var(--r-lg); border-width: 1.5px; background: var(--surface-2); }
.color-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); background: var(--surface-2); }
.color-name { display: grid; gap: 2px; padding-inline: 4px; }
.color-name strong { font-size: .9375rem; }
.color-name small { font-size: .75rem; color: var(--muted); }
.cp-wrap { display: block; }
.cp { display: grid; gap: 8px; padding: 10px; border-radius: 14px; background: var(--cp-bg); border: 1px solid color-mix(in srgb, var(--cp-card) 70%, var(--line)); }
.cp i { display: block; }
.cp-hero { height: 46px; border-radius: 10px; padding: 9px 10px; display: grid; align-content: start; gap: 5px; background: linear-gradient(135deg, var(--cp-a), var(--cp-b)); }
.cp-hero i { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .92); width: 55%; }
.cp-hero i + i { width: 30%; opacity: .6; }
.cp-row { display: flex !important; align-items: center; gap: 8px; }
.cp-row i { flex: 1; height: 12px; border-radius: 6px; background: var(--cp-card); }
.cp-row b { width: 14px; height: 14px; border-radius: 50%; background: var(--cp-dot); flex: none; }
.cp-dark { display: none; }
:root[data-mode="dark"] .cp-light { display: none; }
:root[data-mode="dark"] .cp-dark { display: grid; }
@media (prefers-color-scheme: dark) { :root:not([data-mode]) .cp-light { display: none; } :root:not([data-mode]) .cp-dark { display: grid; } }

/* Ajuda: tópicos em cartões */
.help-all { display: inline-flex !important; align-items: center; gap: 6px; padding: 8px 14px !important; border-radius: 999px !important; font-size: .875rem; font-weight: 600; color: var(--accent); }
.help-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.help-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.help-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.help-card > span:last-child { display: grid; gap: 2px; min-width: 0; }
.help-card strong { font-size: .9375rem; }
.help-card small { font-size: .8125rem; color: var(--muted); line-height: 1.35; }
.help-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.help-ic svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { .help-card:hover { transform: none; } }

/* Perfil no topo de Ajustes */
.profile-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-xl); border: 1px solid var(--line); background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 70%, var(--surface)), var(--surface)); }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: #fff; background: linear-gradient(135deg, var(--brand-a), var(--brand-b)); }
/* foto de perfil (4.3.0): toque na foto para trocar; o selo de câmera mostra que dá para mudar */
.avatar-wrap { display: grid; justify-items: center; gap: 4px; }
.avatar-edit { position: relative; width: 56px; height: 56px; cursor: pointer; overflow: visible; transition: transform .15s ease; }
.avatar-edit:hover { transform: scale(1.04); }
.avatar-edit:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.avatar-edit img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar-cam { position: absolute; right: -3px; bottom: -3px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--accent); border: 1px solid var(--line); box-shadow: 0 2px 6px rgb(0 0 0 / .12); }
.avatar-cam svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.avatar-rm { border: 0; background: none; padding: 2px 4px; font: inherit; font-size: .6875rem; color: var(--muted); cursor: pointer; border-radius: 4px; }
.avatar-rm:hover { color: var(--fail, #c0392b); }
@media (prefers-reduced-motion: reduce) { .avatar-edit { transition: none; } .avatar-edit:hover { transform: none; } }
.profile-t { display: grid; gap: 2px; min-width: 0; }
.profile-t small { color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.profile-act { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 520px) { .profile-card { grid-template-columns: auto minmax(0, 1fr); } .profile-act { grid-column: 1 / -1; } .profile-act .btn { flex: 1; } }

/* ==========================================================================
   Introdução e entrada (#gate)
   ========================================================================== */
body.gated .shell { display: none; }
.gate { position: fixed; inset: 0; z-index: 95; overflow-y: auto; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--brand-b) 22%, transparent), transparent 60%), radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, var(--brand-dot) 14%, transparent), transparent 60%), var(--bg); }
.gate.out { animation: fl-fade .35s ease reverse forwards; }
.gate-card { width: min(100%, 480px); display: grid; gap: 16px; padding: clamp(22px, 5vw, 36px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: gate-in .45s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes gate-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.gate-card h1 { font-size: clamp(1.5rem, 5vw, 1.9rem); line-height: 1.15; letter-spacing: -.02em; }
.gate-lead { color: var(--muted); line-height: 1.55; }
.gate-kicker { font-family: var(--font-label); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.gate-dots { display: flex; gap: 6px; }
.gate-dots i { height: 4px; flex: 1; border-radius: 2px; background: var(--line); transition: background-color .3s ease; }
.gate-dots i.on { background: var(--accent); }
.gate-hero { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.gate-mark { width: 52px; height: 52px; border-radius: 24%; box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--brand-a) 80%, transparent); }
.gate-word { height: 34px; }
.gate-feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.gate-feats li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }
.gate-feats b { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-family: var(--font-display); font-size: .875rem; }
.gate-feats span { display: grid; gap: 2px; }
.gate-feats small { color: var(--muted); font-size: .8125rem; }
.gate-btn { width: 100%; min-height: 52px; font-size: 1rem; }
.gate-foot { text-align: center; color: var(--muted); font-size: .875rem; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.gate-form { display: grid; gap: 14px; }
.gate-field { display: grid; gap: 6px; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.gate-field .field { font-size: 1.0625rem; min-height: 52px; border-radius: 14px; }
.gate-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 10px; }
.code-input { letter-spacing: .5em; text-align: center; font-family: var(--font-display); font-size: 1.6rem !important; font-weight: 700; }
.gate-levels { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.gate-levels legend { font-size: .8125rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; padding: 0; }
.gate-err { color: var(--fail); background: var(--fail-soft); padding: 10px 12px; border-radius: var(--r-sm); font-size: .875rem; }
.gate-inbox { display: grid; gap: 6px; padding: 14px; border-radius: var(--r-md); border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface)); font-size: .8125rem; color: var(--muted); }
.gate-inbox-h { font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; font-size: .6875rem; }
.gate-inbox b { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: .3em; color: var(--ink); }
.gate-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; }
.gate-icon svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gate-icon.ok { background: var(--pass-soft); color: var(--pass); }
.gate-icon.warn { background: var(--warn-soft); color: var(--warn); }
.gate-busy { display: grid; place-items: center; min-height: 260px; }
@media (prefers-reduced-motion: reduce) { .gate-card { animation: none; } }
.gate-how { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.gate-how li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }
.gate-how li > span:last-child { display: grid; gap: 3px; }
.gate-how strong { font-size: .9375rem; }
.gate-how small { color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.gate-how-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.gate-how-ic svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================================
   Modal da marca (4.2.0): cartão central no desktop, folha que sobe no celular
   ========================================================================== */
.fl-modal { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: min(560px, calc(100vw - 32px)); width: 100%; max-height: calc(100dvh - 32px); }
.fl-modal.wide { max-width: min(720px, calc(100vw - 32px)); }
.fl-modal::backdrop { background: color-mix(in srgb, #0b0a14 55%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.fl-modal[open] { animation: fl-modal-in .28s cubic-bezier(.2, .9, .3, 1.1) both; }
.fl-modal-card { display: grid; gap: 14px; padding: 22px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .45); max-height: calc(100dvh - 32px); overflow-y: auto; }
.fl-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fl-modal-head h2 { font-size: 1.25rem; letter-spacing: -.01em; }
.fl-modal-x { flex: none; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.fl-modal-x svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.fl-modal-body { display: grid; gap: 12px; font-size: .9375rem; line-height: 1.55; }
.fl-modal-body ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.fl-modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.btn.danger { background: #C2332B; border-color: #C2332B; color: #fff; }
.btn.danger:disabled { opacity: .45; cursor: not-allowed; }
.fl-consent { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); font-size: .875rem; cursor: pointer; }
.fl-consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.fl-note-box { padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-soft); font-size: .875rem; }
.fl-note-box.warn { background: color-mix(in srgb, #C2332B 12%, var(--surface)); }
@keyframes fl-modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@media (max-width: 560px) {
  .fl-modal { margin: auto 0 0; max-width: 100vw; max-height: 92dvh; }
  .fl-modal-card { border-radius: 24px 24px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); max-height: 92dvh; }
  .fl-modal-foot { flex-direction: column-reverse; }
  .fl-modal-foot .btn { width: 100%; justify-content: center; }
  .fl-modal[open] { animation-name: fl-sheet-in; }
}
@keyframes fl-sheet-in { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fl-modal[open] { animation: none; } }
.btn.danger-link { color: #C2332B; border-color: color-mix(in srgb, #C2332B 35%, var(--line)); }
.btn.danger-link:hover { background: color-mix(in srgb, #C2332B 10%, transparent); }
:root[data-mode="dark"] .btn.danger-link { color: #FF8A80; }
@media (prefers-color-scheme: dark) { :root:not([data-mode="light"]) .btn.danger-link { color: #FF8A80; } }

/* Botão "i" (informação) ao lado de títulos */
.h-plus { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.info-btn { width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--accent); display: inline-grid; place-items: center; cursor: pointer; flex: none; transition: transform .2s ease, background-color .2s ease; }
.info-btn:hover { background: var(--accent-soft); transform: scale(1.06); }
.info-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Ações de documento: ícones de PDF e compartilhar com legenda (4.2.0) */
.doc-acts { display: inline-flex; align-items: flex-start; gap: 14px; }
.doc-act { display: inline-grid; justify-items: center; gap: 5px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; min-width: 52px; -webkit-tap-highlight-color: transparent; }
.act-ic { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 80%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1), background-color .2s ease, box-shadow .2s ease; }
.act-ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.act-ic .sh-c { fill: var(--brand-dot, #FF6A4D); stroke: var(--brand-dot, #FF6A4D); }
.act-t { font-family: var(--font-label); font-size: .75rem; font-weight: 600; color: var(--muted); }
.doc-act:hover .act-ic, .doc-act:focus-visible .act-ic { transform: translateY(-2px); background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 22px -12px var(--accent); }
.doc-act:hover .act-t { color: var(--ink); }
.doc-act:focus-visible { outline: none; }
.doc-act:focus-visible .act-ic { outline: 2px solid var(--accent); outline-offset: 3px; }
.doc-act:active .act-ic { transform: scale(.94); }
.doc-act:hover .pdf-arrow, .doc-act[aria-busy="true"] .pdf-arrow { animation: act-drop 1s ease-in-out infinite; }
.doc-act:hover .sh-b, .doc-act:hover .sh-c { animation: act-pop .9s ease-in-out infinite alternate; transform-origin: center; transform-box: fill-box; }
.doc-act:hover .sh-c { animation-delay: .15s; }
.doc-act[aria-busy="true"] { pointer-events: none; }
.doc-act[aria-busy="true"] .act-ic { background: var(--accent); color: var(--accent-ink); }
.doc-act:disabled { cursor: default; }
@keyframes act-drop { 0%, 100% { transform: translateY(-1.5px); } 50% { transform: translateY(2px); } }
@keyframes act-pop { to { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .doc-act .pdf-arrow, .doc-act .sh-b, .doc-act .sh-c { animation: none !important; } }
.share-prev { margin: 0; display: grid; place-items: center; padding: 12px; border-radius: var(--r-lg); background: var(--surface-2); }
.share-prev img { height: min(56dvh, 520px); width: auto; aspect-ratio: 9 / 16; border-radius: 18px; box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .5); }
.gate-terms { margin-top: 2px; }
.gate-terms .linklike { font-size: inherit; padding: 0; }

/* Avisos (5.0) */
.notice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notice { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); animation: notice-in .35s ease both; }
.notice.unread { background: var(--accent-soft, var(--surface-2)); box-shadow: inset 3px 0 0 var(--accent); }
.notice-ic { font-size: 1.35rem; line-height: 1; }
.notice-t { display: grid; gap: 2px; min-width: 0; }
.notice-t > span:not(.mono) { color: var(--ink-2, var(--ink)); font-size: .9rem; }
.notice-ask { margin-top: 14px; }
@keyframes notice-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .notice { animation: none; } }

/* Ritmo, certificado e cursos (5.0) */
.cert-card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.cert-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--surface-2); color: var(--muted); }
.cert-ic svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cert-card.is-ready { background: linear-gradient(135deg, var(--accent-soft), var(--surface)); }
.cert-card.is-ready .cert-ic { background: var(--accent); color: var(--accent-ink, #fff); animation: cert-glow 2.4s ease-in-out infinite; }
.cert-t h2 { margin: 2px 0 4px; font-size: 1.1rem; }
.cert-t p { margin: 0 0 8px; }
.cert-card .btn svg { width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.8; }
@keyframes cert-glow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); } 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent); } }
@media (max-width: 640px) { .cert-card { grid-template-columns: auto 1fr; } .cert-card > .btn { grid-column: 1 / -1; justify-self: start; } }
@media (prefers-reduced-motion: reduce) { .cert-card.is-ready .cert-ic { animation: none; } }
.course-pick { display: grid; gap: 10px; }
.course-opt { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.course-opt.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.course-opt .opt-t { display: grid; gap: 2px; }
.course-opt .opt-n { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .8rem; }
@media (max-width: 640px) { .course-opt { grid-template-columns: auto 1fr; } .course-opt > .btn { grid-column: 1 / -1; justify-self: start; } }
.notify-set { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.notify-set > p { flex-basis: 100%; margin: 0; }
.remind-set { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.remind-set h3 { margin: 0; font-size: 1rem; }
.remind-set p { margin: 0; }
.remind-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.remind-seg button { min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.remind-seg button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.week-card.is-soon, .map-tile.is-soon { opacity: .75; }

/* Carimbos do Passport por curso (5.0) */
.pp-stamps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pp-stamp { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; border: 1px dashed var(--line); background: var(--surface); }
.pp-seal { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 2px dashed var(--line); color: var(--muted); font-weight: 700; font-size: .8rem; transform: rotate(var(--r)); }
.pp-stamp.done { border-style: solid; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.pp-stamp.done .pp-seal { border: 3px double var(--accent); color: var(--accent); background: var(--accent-soft); animation: pp-stamp .55s calc(var(--s) * .12s) cubic-bezier(.2,.9,.3,1.4) both; }
.pp-stamp.retry .pp-seal { border-color: var(--warn); color: var(--warn); }
.pp-t { display: grid; gap: 2px; }
.pp-t small { color: var(--muted); }
@keyframes pp-stamp { from { transform: rotate(var(--r)) scale(1.8); opacity: 0; } 70% { transform: rotate(var(--r)) scale(.92); opacity: 1; } to { transform: rotate(var(--r)) scale(1); } }
@media (prefers-reduced-motion: reduce) { .pp-stamp.done .pp-seal { animation: none; } }
.corr-acts { margin-top: 12px; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Alinhamento (5.5) ----------
   Grades sem buracos: cada linha fecha cheia e os cartões de uma linha têm a mesma altura.
   Bento (Semana, Meu nível, Como funciona, Ajustes): 2 por linha; o que sobra sozinho ocupa a linha. */
.bento { display: flex; flex-wrap: wrap; align-items: stretch; }
.bento > * { flex: 1 1 calc(50% - 14px); min-width: min(100%, 280px); }
.bento > .bento-wide { flex-basis: 100%; }
/* Meu nível: 4 carimbos numa linha (2 + 2 no tablet); competências em 3 ou 2 colunas, a última sozinha ocupa a linha */
.pp-stamps { grid-template-columns: minmax(0, 1fr); }
.comp-grid { grid-template-columns: minmax(0, 1fr); }
@container (min-width: 480px) {
  .pp-stamps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comp-grid > :last-child:nth-child(2n + 1) { grid-column: 1 / -1; }
}
@container (min-width: 820px) {
  .pp-stamps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .comp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .comp-grid > :last-child:nth-child(2n + 1) { grid-column: auto; }
  .comp-grid > :last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
  .comp-grid > :last-child:nth-child(3n + 2) { grid-column: span 2; }
}
/* Como funciona: carga horária em 3 + (nível, equilíbrio); método em 2 colunas; módulos 2 por linha */
@container (min-width: 560px) {
  .plano .tile-grid:not(.cal-grid) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plano .tile-grid > .tile-wide.tile-accent { grid-column: span 1; }
  .plano .tile-grid > .tile-wide:not(.tile-accent) { grid-column: span 2; }
  .method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (min-width: 640px) {
  .plano .track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Mapa do curso: 2 módulos por linha, alinhados (antes 3 e 1) */
  .map-mods { display: grid; grid-template-columns: repeat(2, max-content); justify-content: start; gap: 16px 40px; }
}
