:root {
  --navy: #060E24;
  --navy2: #0F1D3A;
  --ink: #16213A;
  --muted: #5B6578;
  --line: #DCE2EA;
  --bg: #F3F6FA;
  --card: #FFFFFF;
  --teal: #00A3BA;
  --teal-d: #007F91;
  --teal-l: #E2F6F9;
  --ok: #1F8F55;
  --ok-l: #E5F5EC;
  --warn: #B4540A;
  --warn-l: #FDF1E6;
  --bad: #C2333A;
  --radius: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--teal-d); }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* top */
.hero { background: var(--navy); color: #fff; padding: 22px 0 20px; }
.hero .ligas { font-size: 12px; letter-spacing: .14em; font-weight: 700; color: #7FD6E2; text-transform: uppercase; }
.hero h1 { margin: 4px 0 2px; font-size: 28px; line-height: 1.2; }
.hero p { margin: 0; color: #C9D3E3; font-size: 15px; }
.bar {
  position: sticky; top: 0; z-index: 20; background: rgba(6,14,36,.97); color: #fff;
  border-bottom: 1px solid #1E2A44; backdrop-filter: blur(6px);
}
.bar .wrap { display: flex; gap: 8px; align-items: center; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.bar .who { font-size: 14px; color: #C9D3E3; margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.bar select { background: #0F1D3A; border: 1px solid #2A3A5C; color: #fff; border-radius: 10px; padding: 7px 10px; max-width: 46vw; }
.btn {
  border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 650; background: var(--teal); color: #fff;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--teal-d); }
.btn.ghost { background: transparent; color: inherit; border: 1px solid currentColor; opacity: .9; }
.btn.light { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 6px 10px; font-size: 14px; }
.btn.danger { background: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.status { font-size: 13px; color: var(--muted); padding: 10px 0 0; }

/* join */
.join { background: var(--card); border-radius: var(--radius); padding: 22px; margin: 22px 0; box-shadow: 0 1px 3px rgba(10,20,40,.08); }
.join h2 { margin: 0 0 4px; }
.join p { margin: 0 0 16px; color: var(--muted); }
label.f { display: block; font-weight: 650; margin: 14px 0 6px; }
input.t, select.t, textarea.t {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; background: #fff;
}
input.t:focus, select.t:focus, textarea.t:focus { outline: 3px solid var(--teal-l); border-color: var(--teal); }
.ligas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.chip-radio { position: relative; }
.chip-radio input { position: absolute; opacity: 0; }
.chip-radio span { display: block; text-align: center; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 8px; font-weight: 650; background: #fff; }
.chip-radio input:checked + span { border-color: var(--teal); background: var(--teal-l); color: var(--teal-d); }
.chip-radio input:focus-visible + span { outline: 3px solid var(--teal-l); }
.err { color: var(--bad); font-weight: 600; margin-top: 12px; min-height: 1em; }

/* etapas e partes */
.section, .card { scroll-margin-top: 76px; }
.section { margin: 22px 0 6px; }
.section.first { margin-top: 34px; }
.section .kicker { font-size: 12px; letter-spacing: .14em; font-weight: 800; color: var(--teal-d); text-transform: uppercase; }
.etapa { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; }
.etapa .k { font-size: 12px; letter-spacing: .16em; font-weight: 800; color: #7FD6E2; text-transform: uppercase; }
.etapa .t { font-size: 24px; font-weight: 750; line-height: 1.2; margin-top: 2px; }
.section h2 { margin: 2px 0 8px; font-size: 20px; line-height: 1.3; padding-left: 12px; border-left: 4px solid var(--teal); }
.section.now h2 { border-left-color: #E8A33D; }
.nowpill { display: inline-block; vertical-align: middle; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: #E8A33D; color: #fff; padding: 2px 8px; border-radius: 99px; margin-left: 6px; }
.bar .btn.now { background: #E8A33D; color: #1b1205; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.bar .btn.now:hover { background: #F0B357; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 18px 18px; margin: 12px 0;
  box-shadow: 0 1px 3px rgba(10,20,40,.08); border: 1px solid #E6EBF2; position: relative;
}
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 8px 0; }
.card ul, .card ol { padding-left: 22px; margin: 8px 0; }
.card li { margin: 4px 0; }
.card .tag { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; margin-bottom: 8px; }
.tag.case { background: #EEF2F8; color: #3A4A66; }
.tag.q { background: var(--teal-l); color: var(--teal-d); }
.tag.ex { background: var(--ok-l); color: var(--ok); }
.tag.note { background: var(--warn-l); color: var(--warn); }
.tag.learn { background: #EEE8FB; color: #5B3FA8; }
.card.learn { border-left: 6px solid #7B5CD6; background: #FCFBFF; }
.card.learn h3::before { content: "💡 "; }
.card .glos { display: grid; grid-template-columns: minmax(110px, 30%) 1fr; gap: 6px 12px; margin: 10px 0; }
.card .glos dt { font-weight: 750; }
.card .glos dd { margin: 0; }
@media (max-width: 520px) { .card .glos { grid-template-columns: 1fr; gap: 2px; } .card .glos dd { margin-bottom: 8px; } }
.card.question { border: 2px solid var(--teal); }
.card.explanation { border-left: 6px solid var(--ok); }
.card.note { border-left: 6px solid #E8A33D; }
.card.new::after {
  content: "NOVO"; position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 800; letter-spacing: .1em;
  background: #E8A33D; color: #fff; padding: 2px 7px; border-radius: 6px;
}
.prompt { font-size: 18px; font-weight: 600; }
.poll-q { font-weight: 700; margin: 14px 0 8px; }
.opts { display: grid; gap: 8px; }
.opt {
  display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px;
  background: #fff; text-align: left; width: 100%; position: relative; overflow: hidden;
}
.opt b.l { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #EEF2F8; display: grid; place-items: center; font-size: 14px; }
.opt span.tx { position: relative; z-index: 1; }
.opt.sel { border-color: var(--teal); background: var(--teal-l); }
.opt.sel b.l { background: var(--teal); color: #fff; }
.opt.correct { border-color: var(--ok); }
.opt.correct b.l { background: var(--ok); color: #fff; }
.opt[disabled] { cursor: default; }
.opt .fill { position: absolute; inset: 0 auto 0 0; background: rgba(0,163,186,.10); z-index: 0; }
.opt.correct .fill { background: rgba(31,143,85,.14); }
.opt .pct { margin-left: auto; font-weight: 700; font-size: 14px; color: var(--muted); position: relative; z-index: 1; padding-left: 8px; white-space: nowrap; }
.qfoot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.qfoot .msg { font-size: 14px; color: var(--muted); }
.qfoot .msg.ok { color: var(--ok); font-weight: 650; }
.pill { font-size: 12px; font-weight: 750; padding: 3px 9px; border-radius: 99px; }
.pill.open { background: var(--ok-l); color: var(--ok); }
.pill.closed { background: #EEF2F8; color: var(--muted); }
textarea.t { min-height: 92px; resize: vertical; }
.print-answer { display: none; }
figure { margin: 10px 0; }
figure img { cursor: zoom-in; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: block; margin: 0 auto; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }
table.lab { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0; }
table.lab th { background: var(--navy2); color: #BFEFF6; text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 8px 10px; }
table.lab td { border-bottom: 1px solid var(--line); padding: 8px 10px; vertical-align: top; }
table.lab td.c, table.lab th.c { text-align: center; }
table.lab tr td:first-child { font-weight: 650; }
.tablewrap { overflow-x: auto; }
.foot { font-size: 14px; color: var(--muted); }
.callout { background: var(--teal-l); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.callout.ok { background: var(--ok-l); }
.callout.warn { background: var(--warn-l); }
.answer-line { font-weight: 700; color: var(--ok); }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--navy); color: #fff; z-index: 50;
  padding: 10px 12px 10px 16px; border-radius: 12px; display: flex; gap: 12px; align-items: center; box-shadow: 0 6px 24px rgba(0,0,0,.25);
  max-width: calc(100vw - 32px); width: max-content; min-width: min(380px, calc(100vw - 32px));
}
.toast #toastText { flex: 1; line-height: 1.3; }
.hidden { display: none !important; }
.print-head { display: none; }
footer { color: var(--muted); font-size: 13px; padding: 30px 0 40px; text-align: center; }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 23px; }
  .card { padding: 15px 14px; }
  .bar .wrap { gap: 6px; padding-top: 6px; padding-bottom: 8px; }
  .bar .who { order: -1; width: 100%; font-size: 13px; }
  .bar select { flex: 1; max-width: none; min-width: 0; }
  .bar .btn.now { flex: 1 1 100%; max-width: none; order: 0; }
  .section, .card { scroll-margin-top: 150px; }
  .bar .btn.small { padding: 7px 10px; }
}

@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 11.5pt; }
  .bar, .join, .toast, .qfoot, .no-print, footer, .status, textarea, .opts, .poll-q .hint { display: none !important; }
  .hero { background: #fff; color: #000; padding: 0 0 8px; border-bottom: 2px solid #000; }
  .hero p, .hero .ligas { color: #333; }
  .print-head { display: block; font-size: 10pt; margin: 6px 0 10px; color: #333; }
  .card { box-shadow: none; border: 1px solid #bbb; }
  .card.question, .card.note, .card.case, .card.image { break-inside: avoid; page-break-inside: avoid; }
  figure, .callout, tr, li, .answer-line, .print-opts, .print-answer { break-inside: avoid; page-break-inside: avoid; }
  .card h3, .card h4, .tag { break-after: avoid; page-break-after: avoid; }
  .section { break-inside: avoid; page-break-inside: avoid; break-after: avoid; page-break-after: avoid; }
  .card.new::after { display: none; }
  .print-answer { display: block; margin-top: 8px; }
  .print-answer .row { margin: 3px 0; }
  .print-opts { display: block !important; margin: 6px 0; }
  figure img { max-height: 120mm; width: auto; }
  a { color: #000; text-decoration: none; }
  .etapa { background: #fff; color: #000; border: 2px solid #000; break-inside: avoid; }
  .etapa .k { color: #333; }
  .section h2 { break-after: avoid; }
  .nowpill { display: none; }
  .card.learn { background: #fff; }
}
.print-opts { display: none; }
.print-opts div { margin: 2px 0; }
.print-opts .mark { font-weight: 700; }
