/* English Training — estilos. Leve, sem dependências externas, responsivo (celular primeiro no que importa). */
:root {
  --bg: #F6F3EC; --surface: #FFFFFF; --ink: #1D2940; --muted: #66718A; --line: #E7E2D6; --soft: #F1EDE3;
  --brand: #0E9F8E; --brand-ink: #0A7468; --brand-soft: #DDF4EF; --accent: #FF6B57; --sun: #FFC64D;
  --ok: #249457; --ok-soft: #E1F5E8; --bad: #D8433F; --bad-soft: #FCE7E5; --warn-soft: #FFF2CF;
  --r: 18px; --r-sm: 12px; --shadow: 0 1px 2px rgba(29,41,64,.06), 0 8px 24px rgba(29,41,64,.07);
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1 { font-size: 1.7rem; margin: 0 0 4px; letter-spacing: -.02em; }
h2 { font-size: 1.1rem; margin: 28px 0 12px; }
p { margin: 0 0 12px; }
a { color: var(--brand-ink); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.lead { color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- estrutura ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); line-height: 1.05; font-size: 1.02rem; padding: 0 8px; }
.brand b { color: var(--brand-ink); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--muted); font-weight: 600; }
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand-ink); }
.nav a .count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 999px; font-size: .74rem; padding: 1px 8px; }
.side-foot { margin-top: auto; font-size: .8rem; color: var(--muted); padding: 0 8px; }
.content { min-width: 0; }
.top { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 16px 28px 0; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: .88rem; white-space: nowrap; }
.chip svg.ic { width: 16px; height: 16px; }
.chip.xp svg { color: #E0A100; } .chip.fire svg { color: var(--accent); } .chip.due svg { color: var(--brand); }
#view { padding: 18px 28px 80px; max-width: 1120px; outline: none; }
#banner:empty { display: none; }
.note { margin: 14px 28px 0; padding: 11px 14px; border-radius: var(--r-sm); background: var(--warn-soft); font-size: .9rem; max-width: 1064px; }
.note.info { background: var(--brand-soft); }

/* ---------- componentes ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 10px 16px; border-radius: 999px; font-weight: 700; cursor: pointer; min-height: 44px; transition: transform .06s, background .15s, border-color .15s; }
.btn:hover:not(:disabled) { border-color: #CFC8B8; background: #FBFAF6; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .86rem; }
.btn.big { min-height: 54px; padding: 14px 26px; font-size: 1.05rem; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
:focus-visible { outline: 3px solid rgba(14,159,142,.45); outline-offset: 2px; }
select, input[type=text], input[type=search], input[type=date], input[type=number] { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 9px 12px; min-height: 44px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.toolbar label { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); font-weight: 600; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--soft); color: var(--muted); white-space: nowrap; }
.badge.revisar { background: #FFE5E0; color: #B5382A; } .badge.aprendendo { background: var(--warn-soft); color: #8A6300; }
.badge.consolidada { background: var(--brand-soft); color: var(--brand-ink); } .badge.dominada { background: var(--ok-soft); color: var(--ok); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

/* ---------- estudar ---------- */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; margin: 18px 0 8px; }
.hero .panel.go { background: linear-gradient(135deg, #0E9F8E, #0B7F8F); color: #fff; border: 0; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.hero .panel.go p { color: rgba(255,255,255,.9); margin: 0; }
.hero .panel.go .btn { align-self: flex-start; background: #fff; color: var(--brand-ink); border-color: #fff; margin-top: 6px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; align-content: center; }
.kpi b { display: block; font-size: 1.6rem; letter-spacing: -.02em; }
.kpi span { font-size: .8rem; color: var(--muted); }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.mode { display: flex; flex-direction: column; gap: 6px; }
.mode h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }
.mode h3 i { width: 36px; height: 36px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-style: normal; flex: none; }
.mode p { color: var(--muted); font-size: .9rem; margin: 0; flex: 1; }
.mode .meta { font-size: .82rem; font-weight: 700; color: var(--brand-ink); }
.mode .btn { align-self: flex-start; margin-top: 6px; }

/* ---------- listas (biblioteca, dominadas, revisão) ---------- */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: grid; grid-template-columns: auto 64px 1.2fr 1fr auto auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; }
.row img { width: 64px; height: 48px; border-radius: 8px; display: block; }
.row .w b { display: block; } .row .w span { color: var(--muted); font-size: .9rem; }
.row .meta { font-size: .82rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.row .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row input[type=checkbox], .hit input { width: 20px; height: 20px; accent-color: var(--brand); }
.row input[type=date] { min-height: 34px; padding: 3px 8px; font-size: .82rem; }
.bulk { position: sticky; top: 8px; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: 999px; padding: 8px 10px 8px 18px; margin: 10px 0; box-shadow: var(--shadow); }
.bulk .btn { min-height: 36px; padding: 6px 14px; font-size: .86rem; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.tile img { width: 100%; border-radius: 10px; display: block; }
.tile input { position: absolute; top: 16px; left: 16px; width: 20px; height: 20px; accent-color: var(--brand); }
.tile span { color: var(--muted); font-size: .86rem; }

/* ---------- desempenho ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; }
.stat b { display: block; font-size: 1.7rem; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .84rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 96px; gap: 10px; align-items: center; font-size: .9rem; margin: 8px 0; }
.bar { height: 10px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar-row .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 150px; }
.days div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; font-size: .68rem; color: var(--muted); }
.days i { display: block; width: 100%; max-width: 26px; background: var(--brand); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.days em { font-style: normal; font-weight: 700; color: var(--ink); font-size: .7rem; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th, table.t td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.t th { color: var(--muted); font-size: .78rem; font-weight: 700; }

/* ---------- configurações ---------- */
.set { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set:last-child { border-bottom: 0; }
.set b { display: block; } .set span { color: var(--muted); font-size: .86rem; }
.set input[type=range] { width: 170px; accent-color: var(--brand); }
.set .rv { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; font-weight: 700; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; font-size: .88rem; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 44px; height: 26px; border-radius: 999px; background: #CFC8B8; position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid rgba(14,159,142,.45); outline-offset: 2px; }
.switch em { font-style: normal; }

/* ---------- sessão ---------- */
.session { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; }
.s-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.s-title { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.s-title span { color: var(--muted); font-size: .8rem; }
.s-progress { flex: 1; min-width: 80px; height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.s-progress i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 999px; transition: width .3s; }
.s-body { flex: 1; display: grid; grid-template-columns: 1fr 300px; min-height: 0; overflow: hidden; }
.s-main { overflow: auto; padding: 18px 16px 28px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.s-card { width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 20px; text-align: center; position: relative; }
.s-card .label { color: var(--muted); font-weight: 700; font-size: .86rem; text-transform: uppercase; letter-spacing: .05em; }
.s-card .pic { width: 100%; height: auto; max-width: 300px; aspect-ratio: 4 / 3; margin: 12px auto; border-radius: 18px; display: block; background: var(--soft); }
.s-card .pic.hiddenpic { display: grid; place-items: center; color: var(--muted); font-size: .86rem; padding: 12px; border: 2px dashed var(--line); background: transparent; }
.s-card .pic.hiddenpic svg { width: 44px; height: 44px; display: block; margin: 0 auto 6px; }
.s-card .main { font-size: clamp(1.5rem, 4.6vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; margin: 6px 0; overflow-wrap: anywhere; }
.s-card .main mark { background: var(--warn-soft); color: inherit; border-radius: 6px; padding: 0 4px; box-shadow: inset 0 -3px 0 var(--sun); }
.s-card .gap { font-size: 1.25rem; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); display: inline-block; padding: 8px 14px; border-radius: 12px; margin: 6px 0; }
.s-card .sub { color: var(--muted); margin: 4px 0; }
.s-card .hint { background: var(--warn-soft); border-radius: 10px; padding: 8px 12px; font-size: .9rem; margin-top: 8px; display: inline-block; }
.s-card .tip { color: var(--muted); font-size: .82rem; margin-top: 8px; }
.s-card .try2 { position: absolute; top: 14px; right: 14px; }
.s-card .tag { position: absolute; top: 14px; left: 14px; }
.verdict { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; padding: 8px 16px; border-radius: 999px; margin-bottom: 4px; }
.verdict.ok { background: var(--ok-soft); color: var(--ok); } .verdict.bad { background: var(--bad-soft); color: var(--bad); } .verdict.neutral { background: var(--soft); color: var(--muted); }
.said { color: var(--muted); font-size: .92rem; margin-top: 8px; }
.said q { color: var(--ink); font-weight: 600; }
.nextinfo { font-size: .86rem; color: var(--muted); margin-top: 6px; }
.s-status { min-height: 58px; width: 100%; max-width: 620px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.s-status .line { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.s-status .line.live { color: var(--accent); }
.s-status .line.live svg { animation: pulse 1s ease-in-out infinite; }
.s-status .interim { color: var(--muted); font-style: italic; min-height: 1.3em; }
.s-status .msg { background: var(--warn-soft); padding: 6px 12px; border-radius: 10px; font-size: .9rem; }
.s-status .msg.err { background: var(--bad-soft); color: var(--bad); }
.s-status .confirm { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.countdown { width: 220px; height: 5px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.countdown i { display: block; height: 100%; background: var(--accent); width: 100%; }
@keyframes pulse { 50% { transform: scale(1.25); opacity: .6; } }
.s-answer { display: flex; gap: 8px; width: 100%; max-width: 620px; }
.s-answer input { flex: 1; min-width: 0; border-radius: 999px; padding: 12px 18px; font-size: 1.05rem; }
.s-controls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 720px; }
.s-panel { background: var(--surface); border-left: 1px solid var(--line); padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.s-panel h3 { margin: 0; font-size: 1rem; }
.hit { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.hit.done { opacity: .55; }
.hit b { display: block; font-size: .95rem; } .hit span { color: var(--muted); font-size: .8rem; }
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.summary div { background: var(--soft); border-radius: 12px; padding: 10px 4px; }
.summary b { display: block; font-size: 1.4rem; }
.summary span { font-size: .74rem; color: var(--muted); }
.paused-box { padding: 26px 8px; }

/* ---------- modal e toast ---------- */
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(29,41,64,.45); display: grid; place-items: center; padding: 16px; }
.modal .box { background: var(--surface); border-radius: 20px; padding: 22px; max-width: 460px; width: 100%; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 8px; }
.modal .acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; max-width: 90vw; text-align: center; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- responsivo ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); z-index: 20; }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-between; gap: 0; }
  .nav a { flex-direction: column; gap: 2px; font-size: .64rem; padding: 6px 2px; flex: 1; position: relative; text-align: center; }
  .nav a .count { position: absolute; top: 0; right: 14%; margin: 0; font-size: .62rem; padding: 0 5px; }
  .top { padding: 12px 14px 0; justify-content: flex-start; }
  #view { padding: 14px 14px 110px; }
  .note { margin: 12px 14px 0; }
  .hero, .two { grid-template-columns: 1fr; }
  .row { grid-template-columns: auto 56px 1fr; }
  .row img { width: 56px; height: 42px; }
  .row .meta { grid-column: 2 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .row .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .bar-row { grid-template-columns: 104px 1fr 78px; }
  .set { grid-template-columns: 1fr; }
  .s-body { grid-template-columns: 1fr; position: relative; }
  .s-panel { position: absolute; inset: 0 0 0 auto; width: min(320px, 88vw); box-shadow: var(--shadow); transform: translateX(105%); visibility: hidden; transition: transform .2s, visibility 0s .2s; z-index: 3; }
  .s-panel.open { transform: none; visibility: visible; transition: transform .2s; }
  .s-top { padding: 8px 10px; gap: 8px; }
  .s-top .switch em { display: none; }
  .s-progress { order: 10; flex-basis: 100%; }
  .s-card { padding: 16px 14px; }
  .s-card .pic { max-width: 240px; }
  .summary { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 901px) { #s-panel-btn, #s-panel-close { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-height: 840px) and (min-width: 901px) { .s-card .pic { max-width: 232px; } .s-main { gap: 10px; padding-top: 12px; } }
