/* Estudos PRF — mobile-first. Celular: menu inferior, 1 coluna. Tablet (720px+): 2 colunas. Computador (1024px+): menu lateral. */
:root {
  color-scheme: light;
  --bg: #f4f6fa; --card: #ffffff; --ink: #14202e; --mut: #54657a; --line: #dbe2ec; --soft: #eef2f8;
  --navy: #0b2a4a; --navy-2: #123d6b; --amber: #f5b301; --ok: #0f7a40; --bad: #b83225; --info: #1f6fd1;
  --ok-bg: #e3f4ea; --bad-bg: #fbe8e5; --amber-bg: #fff4cf; --sel: #e4ecf8;
  --accent-ink: #123d6b; --r: 14px; --gut: 16px; --rail: 232px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0c141f; --card: #152233; --ink: #e8eef6; --mut: #9fb0c4; --line: #26384e; --soft: #1b2b40;
    --navy: #0a213a; --navy-2: #2a66ad; --ok-bg: #12301f; --bad-bg: #3a1a17; --amber-bg: #3a3012; --ok: #46c27f; --bad: #ff7b6b; --info: #6aa8ff; --sel: #1d3350; --accent-ink: #f5b301; color-scheme: dark; } }
:root[data-theme="dark"] { --bg: #0c141f; --card: #152233; --ink: #e8eef6; --mut: #9fb0c4; --line: #26384e; --soft: #1b2b40;
    --navy: #0a213a; --navy-2: #2a66ad; --ok-bg: #12301f; --bad-bg: #3a1a17; --amber-bg: #3a3012; --ok: #46c27f; --bad: #ff7b6b; --info: #6aa8ff; --sel: #1d3350; --accent-ink: #f5b301; color-scheme: dark; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scrollbar-color: var(--line) transparent; scrollbar-width: thin; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5; padding-bottom: calc(64px + env(safe-area-inset-bottom)); accent-color: var(--navy-2); caret-color: var(--amber); }
::selection { background: var(--amber); color: #1a1400; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; color: #000; padding: 8px 12px; z-index: 99; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
button, select, input { font: inherit; }
h2, h3 { text-wrap: balance; } p, li { text-wrap: pretty; }
.i { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -0.2em; }
.i.fill { fill: currentColor; }

/* topo */
.top { background: var(--navy); color: #fff; padding: calc(10px + env(safe-area-inset-top)) max(var(--gut), env(safe-area-inset-left)) 12px; position: sticky; top: 0; z-index: 10; display: flex; align-items: baseline; gap: 10px; }
.top h1 { margin: 0; font-size: 1.15rem; letter-spacing: 0; } .top .sub { color: #c7d6e8; font-size: .85rem; }

/* conteúdo */
main:focus, main:focus-visible { outline: none; }
main { padding: var(--gut); padding-left: max(var(--gut), env(safe-area-inset-left)); padding-right: max(var(--gut), env(safe-area-inset-right)); max-width: 1120px; margin: 0 auto; outline: none; }
main > * { animation: entra .22s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } }
h2 { font-size: 1.25rem; line-height: 1.25; margin: 20px 0 10px; } h3 { font-size: 1.05rem; line-height: 1.3; margin: 18px 0 6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 12px; }
.card.hl { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 55%, var(--line)); }
.row { display: flex; gap: 10px; align-items: center; } .row.sp { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.mut { color: var(--mut); } .small { font-size: .875rem; }
.cols, .mats { display: grid; gap: 0 20px; } .side { min-width: 0; }
.sec-title { margin-top: 0; }

/* menu */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
.tabs button { background: none; border: 0; color: var(--mut); padding: 8px 2px 7px; min-height: 56px; font-size: .74rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; }
.tabs .i { width: 24px; height: 24px; }
.tabs button[aria-current="page"] { color: var(--accent-ink); font-weight: 700; }

/* botões */
.btn { appearance: none; border: 0; border-radius: 12px; background: var(--navy-2); color: #fff; font-weight: 600; min-height: 48px; padding: 10px 18px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.btn.sec { background: transparent; color: var(--ink); border: 1.5px solid var(--line); } .btn.am { background: var(--amber); color: #1a1400; }
.btn.ok { background: var(--ok); color: #fff; } .btn.bad { background: var(--bad); color: #fff; } .btn.block { width: 100%; } .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.sm { min-height: 44px; padding: 6px 14px; font-size: .92rem; }
.btn:active { transform: scale(.98); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-size: .84rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }

/* tarefas do dia (linhas) */
.task { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); background: var(--card); border-radius: var(--r); margin-bottom: 8px; width: 100%; text-align: left; color: inherit; cursor: pointer; min-height: 64px; }
.ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent-ink); flex: none; }
.task.done .ico { background: var(--ok); color: #fff; } .task.done { opacity: .78; }
.task b, .rowbtn b { display: block; } .task .s, .rowbtn .s { color: var(--mut); font-size: .86rem; display: block; }
/* lista de tópicos dentro do cartão da matéria: linhas com divisor, sem cartão dentro de cartão */
.rows { margin: 4px -14px -14px; border-top: 1px solid var(--line); }
.rowbtn { display: flex; gap: 12px; align-items: center; width: 100%; padding: 11px 14px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; color: inherit; cursor: pointer; min-height: 60px; }
.rowbtn:last-child { border-bottom: 0; border-radius: 0 0 var(--r) var(--r); }
.rowbtn.done .ico { background: var(--ok); color: #fff; }

/* aula */
.lesson { max-width: 70ch; } .lesson p, .lesson li { font-size: 1.04rem; line-height: 1.65; }
.lesson h3 { color: var(--accent-ink); margin-top: 20px; } .lesson h3:first-child { margin-top: 2px; }
.lesson ul { padding-left: 20px; } .lesson .box { background: var(--amber-bg); border: 1px solid color-mix(in srgb, var(--amber) 50%, var(--line)); padding: 10px 14px; border-radius: 10px; margin: 12px 0; }
.keys { padding-left: 18px; margin: 8px 0 0; } .keys li { margin-bottom: 6px; }

/* questões */
.q-enun { font-size: 1.1rem; line-height: 1.55; margin: 8px 0 16px; } .q-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-btns .btn { min-height: 56px; font-size: 1.05rem; letter-spacing: .3px; }
.fb { border-radius: 12px; padding: 12px 14px; margin-top: 14px; } .fb.ok { background: var(--ok-bg); } .fb.bad { background: var(--bad-bg); } .fb strong { display: block; margin-bottom: 4px; }
.flash { min-height: 180px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 1.2rem; padding: 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.stat { text-align: center; padding: 4px 6px; } .stat + .stat { border-left: 1px solid var(--line); }
.stat b { font-size: 1.3rem; display: block; line-height: 1.2; font-variant-numeric: tabular-nums; } .stat span { color: var(--mut); font-size: .8rem; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 72px; } .spark i { flex: 1; background: var(--info); border-radius: 3px 3px 0 0; min-height: 3px; opacity: .85; }
select, input[type=number], input[type=date] { padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); min-height: 46px; width: 100%; }
label.chk { display: flex; gap: 8px; align-items: center; min-height: 44px; padding-right: 8px; }
input[type=checkbox] { width: 20px; height: 20px; }
.timer { font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #111; color: #fff; padding: 10px 16px; border-radius: 99px; z-index: 40; font-size: .9rem; max-width: 90vw; }
.tag-c { color: var(--ok); font-weight: 700; } .tag-e { color: var(--bad); font-weight: 700; }
.loading { color: var(--mut); padding: 24px 4px; }

/* TABLET: duas colunas, mais respiro */
@media (min-width: 720px) {
  :root { --gut: 24px; }
  .cols { grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); }
  .cols .side { position: sticky; top: 76px; align-self: start; }
  .mats { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  main[data-v^="questoes"], main[data-v^="simulado"], main[data-v="hoje:revisao"] { max-width: 700px; }
  .btn:hover:not([disabled]) { filter: brightness(1.06); }
}
@media (min-width: 720px) and (hover: hover) {
  .task:hover, .rowbtn:hover { background: var(--soft); }
  .tabs button:hover { color: var(--ink); }
}

/* COMPUTADOR: menu lateral fixo */
@media (min-width: 1024px) {
  body { padding-bottom: 0; padding-top: 56px; padding-left: var(--rail); }
  .top { position: fixed; inset: 0 0 auto 0; height: 56px; align-items: center; padding: 0 24px; }
  .tabs { top: 56px; bottom: 0; right: auto; width: var(--rail); display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 16px 12px; border-top: 0; border-right: 1px solid var(--line); }
  .tabs button { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: .95rem; padding: 10px 14px; min-height: 46px; border-radius: 10px; }
  .tabs button[aria-current="page"] { background: var(--sel); }
  .mats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols .side { top: 72px; }
  .toast { bottom: 28px; }
}

/* CELULAR deitado: pouca altura */
@media (max-height: 480px) and (orientation: landscape) {
  .top { padding-top: 6px; padding-bottom: 6px; position: static; }
  .tabs button { flex-direction: row; gap: 6px; min-height: 44px; font-size: .78rem; } .tabs .i { width: 20px; height: 20px; }
  body { padding-bottom: calc(46px + env(safe-area-inset-bottom)); }
  .flash { min-height: 120px; }
}
@media (max-width: 359px) { .tabs button { font-size: .68rem; } .grid4 { grid-template-columns: repeat(2, 1fr); } .stat:nth-child(3) { border-left: 0; } }
@media (prefers-reduced-motion: reduce) { main > * { animation: none; } .btn:active { transform: none; } html { scroll-behavior: auto; } }
@media print { .tabs, .top, .skip { display: none; } body { padding: 0; background: #fff; } main { max-width: none; } }

.vids { margin-top: 10px; } .vids summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent-ink); } a.rowbtn { text-decoration: none; }
