:root {
  /* Marca Elenco: roxo #3A1C71, roxo médio #7B4AE2, verde-limão #D4F04C, lilás #F5F3FF, roxo-noite #1A0B36 */
  --bg: #f5f3ff; --card: #fff; --ink: #1a0b36; --muted: #5b4f78; --line: #e2dcf5;
  --brand: #3a1c71; --brand-ink: #fff; --brand-text: #3a1c71; --brand-soft: #ede7fb; --accent: #d4f04c; --accent-ink: #1a0b36; --top: #3a1c71;
  --control: #7d71a6; /* borda de botões de escolha: 4,4:1 sobre branco */
  --focus: #7b4ae2;   /* anel de foco: 5,4:1 sobre branco */
  --maybe: #e6defa; --maybe-ink: #3a1c71; --no: #b42318; --no-ink: #fff;
  --font-display: "Unbounded", system-ui, sans-serif;
  --good: #166534; --good-soft: #e7f6ec; --bad: #b91c1c; --bad-soft: #fdecec;
  --warn: #92400e; --warn-soft: #fff6e0; --info-soft: #eaf2fb; --info: #1e4e8c;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #120726; --card: #1e0f3d; --ink: #f1edfb; --muted: #a99cc8; --line: #33245a;
    --brand: #6d42d9; --brand-text: #c4b0fa; --brand-soft: #2c1a55; --top: #2a1259;
    --control: #7d6fae; --focus: #d4f04c; --maybe: #3b2a6b; --maybe-ink: #e6defa; --good: #4ade80; --good-soft: #15301f; --bad: #f87171; --bad-soft: #3a1a1a;
    --warn: #fbbf24; --warn-soft: #33290f; --info-soft: #172536; --info: #93c5fd;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.45 "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: 84px; }
a { color: var(--brand-text); }
/* ícones próprios (src/icons.js): traço de 2px, cor do texto */
.icon { width: 1.2em; height: 1.2em; flex-shrink: 0; vertical-align: -0.22em; }
h1 { font-size: 1.5rem; margin: .2rem 0; }
h2 { font-size: 1.12rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: .8rem 0 .3rem; }
main { max-width: 640px; margin: 0 auto; padding: 14px 16px; }
main.wide { max-width: 1000px; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--top); color: var(--brand-ink); }
.top .back { color: inherit; text-decoration: none; font-size: 2rem; line-height: 1; padding: 0 8px 4px 0; }
.top .logo { display: flex; flex-shrink: 0; }
.brand-word { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; }
.top-title .brand-word { font-size: 1.25rem; }
.hero .brand-mark { display: flex; justify-content: center; }
.hero .brand-word { font-size: 2.6rem; line-height: 1.05; color: var(--brand-text); margin: .3rem 0 0; }
.hero .tagline { margin: .2rem 0 .6rem; font-weight: 600; color: var(--muted); }
.top-title { display: flex; flex-direction: column; min-width: 0; }
.top-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title small { opacity: .85; font-size: .8rem; }
.demo-banner { display: flex; align-items: center; justify-content: center; gap: 6px; background: #fde68a; color: #4a3500; padding: 8px 16px; font-size: .9rem; text-align: center; font-weight: 600; }
.flash { display: flex; align-items: flex-start; gap: 8px; margin: 12px auto 0; max-width: 608px; padding: 12px 14px; border-radius: 10px; font-weight: 600; }
main .flash { margin: 0 0 12px; }
.flash.ok { background: var(--good-soft); color: var(--good); border: 1px solid var(--good); }
.flash.erro { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; }
.card.good { border-color: var(--good); }
.card.good h2 { color: var(--good); }
.card.bad { border-color: var(--bad); }
.card.bad h2 { color: var(--bad); }
.card.warn { background: var(--warn-soft); border-color: var(--warn); }
.card ul, .card ol { padding-left: 1.2rem; margin: .3rem 0; }
.card li { margin: .3rem 0; }
.note { background: var(--info-soft); color: var(--ink); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: .95rem; }
.note p { margin: .3rem 0; }
.note > .icon { color: var(--brand-text); margin-right: 2px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.section { margin: 20px 0 8px; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hero { text-align: center; padding: 12px 0; }
.empty { text-align: center; background: var(--card); border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px 16px; margin: 0 0 14px; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 18px; border-radius: 12px;
  border: 1.5px solid var(--brand-text); background: var(--card); color: var(--brand-text); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.big { width: 100%; min-height: 56px; font-size: 1.08rem; margin: 6px 0; }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: .92rem; }
.btn.ghost { border-color: var(--line); color: var(--muted); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; }
.link-btn { background: none; border: 0; color: var(--bad); text-decoration: underline; font: inherit; font-size: .85rem; cursor: pointer; padding: 4px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
form.inline { display: inline; }
.danger-zone { margin-top: 24px; text-align: center; }

/* formulários */
.field { display: block; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field .lbl { display: block; font-weight: 650; margin-bottom: 5px; }
.field em { font-style: normal; font-weight: 500; font-size: .78rem; padding: 1px 6px; border-radius: 6px; margin-left: 4px; }
.field em.opt { color: var(--muted); background: var(--bg); }
.field em.req { color: var(--bad); background: var(--bad-soft); }
.help { display: block; color: var(--muted); font-size: .85rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], select, textarea {
  width: 100%; font: inherit; font-size: 17px; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); min-height: 50px; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--brand-text); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.score-inputs { display: flex; align-items: end; gap: 10px; }
.score-inputs label { flex: 1; font-weight: 600; }
.score-inputs input { text-align: center; font-size: 1.4rem; }
.score-inputs span { padding-bottom: 12px; font-size: 1.3rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; padding: 10px 14px; border-radius: 999px; border: 1.5px solid var(--control); background: var(--card); cursor: pointer; min-height: 44px; }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 650; }
.chip input:checked + span::before { content: "✓"; margin-right: 6px; font-weight: 800; color: var(--accent); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.draft-note { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 8px 12px; font-size: .9rem; margin-bottom: 12px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.draft-note button { background: none; border: 0; color: inherit; text-decoration: underline; font: inherit; cursor: pointer; }
.sticky-save { position: sticky; bottom: 76px; background: linear-gradient(transparent, var(--bg) 30%); padding-top: 14px; }

/* listas */
.list { list-style: none; margin: 0 0 14px; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list li > a, .list li > span.grow { display: flex; align-items: center; gap: 12px; padding: 13px 14px; color: inherit; text-decoration: none; min-height: 56px; }
.list li:has(> span.grow) { display: flex; align-items: center; gap: 8px; padding-right: 10px; }
.list.compact li > a { min-height: 48px; padding: 10px 14px; }
.list .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list .grow small { color: var(--muted); font-size: .85rem; }
.list .grow small.inline { display: inline; }
.list .grow small.by { font-size: .75rem; }
.list .chev { color: var(--muted); font-size: 1.4rem; }
.list .chev .icon { width: 18px; height: 18px; }
.list .ico { display: flex; justify-content: center; width: 1.8rem; color: var(--brand-text); }
.list .ico .icon { width: 24px; height: 24px; }
.num { display: inline-flex; align-items: center; justify-content: center; min-width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); font-weight: 700; font-size: .9rem; }
.date { display: flex; flex-direction: column; align-items: center; min-width: 3rem; }
.date small { color: var(--muted); font-size: .75rem; }
.pill { font-size: .85rem; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); font-weight: 650; white-space: nowrap; }
.pill.win { background: var(--good-soft); color: var(--good); }
.pill.loss { background: var(--bad-soft); color: var(--bad); }
.pill.draw { background: var(--warn-soft); color: var(--warn); }
.tag { font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; letter-spacing: .03em; vertical-align: 1px; }
.tag.registro, .tag.observado { background: var(--brand-soft); color: var(--brand-text); }
.tag.percepcao, .tag.hipotese { background: var(--accent); color: var(--accent-ink); }
ul.notes, ul.basis { list-style: none; padding-left: 0; }
ul.notes li, ul.basis li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
details summary { cursor: pointer; font-weight: 600; }

/* início */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 104px; border-radius: var(--radius);
  background: var(--brand); color: var(--brand-ink); text-decoration: none; font-weight: 700; font-size: 1.05rem; text-align: center; padding: 10px; }
.action span { display: flex; color: var(--accent); }
.action .icon { width: 30px; height: 30px; }
.next { display: flex; flex-direction: column; text-decoration: none; color: inherit; padding: 8px 0; }
.next span { color: var(--muted); font-size: .92rem; }
.steps li.done { text-decoration: line-through; color: var(--muted); }
.steps li.done::after { content: "✓"; display: inline-block; margin-left: 6px; color: var(--good); font-weight: 800; }

/* partida */
.match-head h1 { margin: 2px 0; }
.score { font-size: 2rem; font-weight: 800; margin: 6px 0; }
.score small { font-size: 1rem; font-weight: 600; }
.score.win { color: var(--good); } .score.loss { color: var(--bad); } .score.draw { color: var(--warn); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.tile { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: inherit; min-height: 104px; }
.tile .ico { display: flex; color: var(--brand-text); }
.tile .ico .icon { width: 28px; height: 28px; }
.tile.primary .ico { color: var(--accent); }
.tile small { color: var(--muted); font-size: .82rem; }
.tile.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.tile.primary small { color: inherit; opacity: .85; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-bottom: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 1.6rem; }
.stat span { font-size: .8rem; color: var(--muted); }
.big-name { font-size: 1.3rem; font-weight: 700; margin: 0; }
.drill { border-top: 1px solid var(--line); padding-top: 6px; }
.drill dl { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.drill dt { font-weight: 700; font-size: .85rem; color: var(--muted); margin-top: 6px; }
.drill dd { margin: 0; }
dl dt { font-weight: 700; margin-top: 8px; }
dl dd { margin: 2px 0 0; color: var(--ink); }

/* disponibilidade e escalação */
.avail-row { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 8px; }
.avail-row legend { float: left; width: 100%; font-weight: 650; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.avail-row legend small { color: var(--muted); font-weight: 400; }
.avail-row select { margin-top: 8px; min-height: 44px; padding: 8px; font-size: .95rem; }
.seg { display: flex; clear: both; border: 1.5px solid var(--control); border-radius: 10px; overflow: hidden; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 11px 4px; cursor: pointer; font-weight: 600; border-left: 1px solid var(--control); min-height: 46px; }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--brand); color: var(--brand-ink); font-weight: 750; }
.seg input:checked + span::before { content: "✓ "; font-weight: 800; }
.seg .sim input:checked + span { background: var(--accent); color: var(--accent-ink); }
.seg .talvez input:checked + span { background: var(--maybe); color: var(--maybe-ink); }
.seg .nao input:checked + span { background: var(--no); color: var(--no-ink); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -4px; box-shadow: inset 0 0 0 6px var(--card); }

/* guia */
.guide-q legend { font-weight: 700; font-size: 1.05rem; display: flex; gap: 8px; }
.qnum { display: inline-flex; align-items: center; justify-content: center; min-width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: .85rem; }
.field.compact { margin: 10px 0 0; }

/* modo rápido */
.live-score { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 4px 0; }
.live-score div { text-align: center; }
.live-score b { display: block; font-size: 2.4rem; line-height: 1; }
.live-score small { color: var(--muted); }
.clock { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.clock small { display: block; color: var(--muted); font-size: .82rem; }
.clock b { font-size: 1.2rem; }
.live-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.live-btn { min-height: 92px; border-radius: 16px; border: 0; font: inherit; font-weight: 750; font-size: 1.02rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #fff; padding: 8px; }
.live-btn .i { display: flex; }
.live-btn .i .icon { width: 30px; height: 30px; }
.live-btn.nos { background: #3a1c71; }
.live-btn.nos .i { color: var(--accent); }
.live-btn.eles { background: var(--no); }
.live-btn.eles .i { color: #ffd8d3; }
.live-btn.neutro { background: #5b4f78; }
.live-btn.neutro .i { color: var(--maybe); }
.live-btn.wide { grid-column: span 2; min-height: 64px; flex-direction: row; }
.live-btn:active { transform: scale(.97); filter: brightness(1.1); }
.sync { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .9rem; text-align: center; min-height: 1.2em; }
.sync.pending { color: var(--warn); font-weight: 700; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 30px rgba(0,0,0,.2); padding: 16px 16px 24px; max-height: 80vh; overflow: auto; }
.sheet h3 { margin: 0 0 4px; }
.with-icon { display: flex; align-items: center; gap: 8px; }
.with-icon .icon { width: 26px; height: 26px; color: var(--brand-text); }
.sheet .chip-row { margin: 6px 0 12px; }
.sheet .chip span { padding: 8px 12px; min-height: 40px; }
.sheet-actions { display: flex; gap: 8px; position: sticky; bottom: -24px; background: var(--card); padding-top: 8px; }
.sheet-actions .btn { flex: 1; }

/* importação */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.tabs a { padding: 10px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: inherit; white-space: nowrap; }
.tabs a.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 650; }
.table-wrap { overflow-x: auto; }
table.preview { border-collapse: collapse; width: 100%; font-size: .85rem; }
table.preview th, table.preview td { border: 1px solid var(--line); padding: 6px; text-align: left; vertical-align: top; }
table.preview tr.err td { background: var(--bad-soft); }
.code { font-family: ui-monospace, monospace; font-size: 1.2rem; letter-spacing: .1em; }
article.ai h3 { margin-top: 1rem; }

/* navegação inferior */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; color: var(--muted); text-decoration: none; font-size: .75rem; font-weight: 600; min-height: 60px; }
.bottom-nav a .icon { width: 24px; height: 24px; }
.bottom-nav a.on { color: var(--brand-text); }
#toast { position: fixed; left: 50%; top: 72px; transform: translateX(-50%); z-index: 40; background: #111; color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 650; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.err { background: var(--bad); }

/* duas colunas no tablet */
.col2.rows .avail-row:last-child { margin-bottom: 0; }
@media (min-width: 700px) {
  .col2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; margin-bottom: 14px; }
  .col2 > .card { margin: 0; height: 100%; }
  .col2 > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .col2.rows { gap: 10px; }
  .col2.rows .avail-row { margin: 0; height: 100%; }
  .drills { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 8px; }
  .drills { grid-template-columns: 1fr 1fr; }
  .drills .drill { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 12px; }
  .drills .drill:last-child:nth-child(odd) { grid-column: 1 / -1; }
  main.wide .sticky-save { display: flex; justify-content: flex-end; }
  main.wide .sticky-save .btn { max-width: 420px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .actions { grid-template-columns: repeat(4, 1fr); }
  .live-grid { grid-template-columns: repeat(3, 1fr); }
}
@media print {
  .top, .bottom-nav, .btn, .demo-banner, #toast { display: none !important; }
  body { padding: 0; background: #fff; }
  .card { break-inside: avoid; }
}
.guide-q legend { float: left; width: 100%; margin-bottom: 6px; }
.guide-q > p { clear: both; }

/* ---------- gráficos da visão geral ---------- */
:root { --series-1: #7b4ae2; --series-2: #eb6834; --grid: #e6e1f5; }
@media (prefers-color-scheme: dark) { :root { --series-1: #9a75f0; --series-2: #d95926; --grid: #33245a; } }
.s1 { background: var(--series-1); }
.s2 { background: var(--series-2); }
.legend { display: flex; gap: 16px; font-size: .88rem; color: var(--muted); margin: 0 0 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.vbars { display: flex; align-items: flex-end; gap: 6px; overflow-x: auto; padding: 18px 2px 0; border-bottom: 1px solid var(--grid); }
.vb-col { flex: 1 0 44px; max-width: 80px; display: flex; flex-direction: column; align-items: center; position: relative; }
.vb-plot { height: 140px; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.vb-bar { width: 14px; min-height: 2px; border-radius: 4px 4px 0 0; position: relative; }
.vb-bar em { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: .75rem; color: var(--ink); font-weight: 650; }
.vb-none { font-size: .7rem; color: var(--muted); text-align: center; padding-bottom: 4px; }
.vb-x { font-size: .72rem; color: var(--muted); padding: 4px 0; }
.vb-col:hover .vb-plot, .vb-col:focus .vb-plot { background: var(--bg); border-radius: 6px; }
.hbars { list-style: none; padding: 0; margin: 6px 0 0; }
.hbars li { display: grid; grid-template-columns: minmax(110px, 40%) 1fr 2rem; align-items: center; gap: 8px; padding: 5px 0; position: relative; }
.hb-label { font-size: .9rem; }
.hb-track { height: 14px; background: var(--grid); border-radius: 4px; overflow: hidden; }
.hb-bar { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hb-val { font-weight: 700; text-align: right; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; z-index: 5; left: 50%; bottom: 100%; transform: translateX(-50%); white-space: nowrap;
  background: #111; color: #fff; font-size: .8rem; padding: 5px 9px; border-radius: 6px; pointer-events: none; }
.trend { margin: 12px 0 0; }
.trend small { display: block; }
table.data td, table.data th { padding: 8px; }
.stat span, .stat small { display: block; }
.stat small { font-size: .75rem; margin-top: 2px; }
.stats { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); } }

/* ---------- acessibilidade ---------- */
/* Foco sempre visível para teclado, controle por botão e leitores de tela. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.top :focus-visible, .action:focus-visible, .tile.primary:focus-visible, .live-btn:focus-visible { outline-color: var(--accent); }
.btn.primary:focus-visible { outline-color: var(--focus); }
/* Elementos focados não ficam escondidos atrás do botão fixo de salvar nem do menu inferior. */
html { scroll-padding-top: 72px; scroll-padding-bottom: 170px; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.link-btn { min-height: 44px; min-width: 44px; }
fieldset.chips-group { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.chips-group legend { font-weight: 700; padding: 0; margin: 8px 0 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn:active, .live-btn:active { transform: none; }
}
@media (forced-colors: active) {
  .chip input:checked + span, .seg input:checked + span { outline: 2px solid CanvasText; }
}

/* ---------- app instalado na Tela de Início (iPad/iPhone) ---------- */
/* A barra roxa passa por baixo da barra de status; o conteúdo fica abaixo dela. */
.top { padding-top: calc(10px + env(safe-area-inset-top)); padding-left: calc(16px + env(safe-area-inset-left)); padding-right: calc(16px + env(safe-area-inset-right)); }
.bottom-nav { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
/* Sem destaque cinza ao tocar e sem zoom por toque duplo nos botões. */
a, button, label, .chip span, .seg span { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
}

/* ---------- modo rápido no iPad ---------- */
.live-head { text-align: center; }
.live-head p { margin: .2rem 0; }
.last-bar { position: sticky; top: calc(64px + env(safe-area-inset-top)); z-index: 8; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--brand); color: var(--brand-ink); border-radius: 14px; padding: 10px 12px; margin: 0 0 12px; box-shadow: 0 6px 18px rgba(26, 11, 54, .18); }
.last-bar .grow { flex: 1; min-width: 160px; }
.last-bar .last-ico { display: flex; color: var(--accent); }
.last-bar .last-ico .icon { width: 26px; height: 26px; }
.last-bar .btn { background: var(--card); color: var(--brand-text); border-color: var(--card); min-height: 44px; }
.last-bar .btn.ghost { background: transparent; color: var(--brand-ink); border-color: rgba(255,255,255,.6); }
.focus-pick .seg span { padding: 10px 4px; }
.live-side .list { max-height: none; }
@media (min-width: 700px) {
  .live-top { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; align-items: center; margin-bottom: 12px; }
  .live-top .clock { margin: 0; }
  .live-btn { min-height: 104px; font-size: 1.1rem; }
  /* painel de detalhes centralizado no tablet */
  .sheet { left: 50%; right: auto; width: min(760px, calc(100% - 32px)); transform: translateX(-50%); bottom: 16px; border-radius: 22px; border: 1px solid var(--line); }
}
@media (min-width: 1000px) {
  .live-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
  .live-side { position: sticky; top: calc(80px + env(safe-area-inset-top)); max-height: calc(100vh - 180px); overflow: auto; }
  .live-side .section { margin-top: 0; }
}
/* Elemento escondido fica escondido, mesmo quando tem display definido acima. */
[hidden] { display: none !important; }

/* ---------- modo rápido no celular (scouts): botões visíveis sem rolar ---------- */
@media (max-width: 699px) {
  .live-top { display: flex; align-items: stretch; gap: 8px; margin-bottom: 8px; }
  .live-head { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; }
  .live-head > p { display: none; }
  .live-score { gap: 10px; margin: 0; }
  .live-score b { font-size: 1.7rem; }
  .live-score small { font-size: .7rem; }
  .live-top .clock { flex: 1; margin: 0; padding: 8px 10px; gap: 4px; }
  .live-top .clock b { font-size: 1rem; }
  .live-top .clock small { display: none; }
  .live-top .clock .row { margin: 0; gap: 4px; flex-wrap: nowrap; }
  .live-top .clock .btn.small { min-height: 40px; padding: 4px 8px; font-size: .82rem; flex: 1; }
  .focus-pick { margin: 0 0 8px; }
  .focus-pick > .lbl, .focus-pick .help { display: none; }
  .focus-pick .seg span { padding: 8px 2px; font-size: .9rem; white-space: nowrap; min-height: 40px; }
  .live-grid { gap: 8px; margin: 6px 0; }
  .live-btn { min-height: 78px; font-size: .98rem; border-radius: 14px; }
  .live-btn .i .icon { width: 26px; height: 26px; }
  .last-bar { padding: 8px 10px; gap: 6px; }
  .last-bar .grow { min-width: 0; font-size: .92rem; }
  .last-bar .btn.small { min-height: 40px; padding: 4px 10px; }
  .demo-banner { font-size: .78rem; padding: 4px 12px; }
}
.focus-pick .sm { display: none; }
@media (max-width: 699px) { .focus-pick .lg { display: none; } .focus-pick .sm { display: inline; } }
.seg span span { display: inline; padding: 0; border: 0; min-height: 0; background: none; }
@media (max-width: 699px) { .hide-phone { display: none; } .live-top .clock .btn.small { white-space: nowrap; } }

/* ---------- página inicial pública ---------- */
.lp { padding-bottom: 24px; }
.lp h2 { font-size: 1.45rem; margin: 0 0 14px; }
.lp h3 { margin: 6px 0 4px; font-size: 1.05rem; }
.lp p { margin: 0 0 8px; }
.lp-ico { display: inline-flex; color: var(--brand-text); }
.lp-hero { display: grid; gap: 28px; align-items: center; padding: 18px 0 30px; }
.lp-mark { display: flex; }
.lp-title { font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1.04; color: var(--brand-text); margin: 10px 0 12px; }
.lp-lead { font-size: 1.12rem; color: var(--ink); max-width: 36rem; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 10px; }
.lp-cta .btn.big { width: auto; flex: 1 1 200px; margin: 0; }
.lp-section { padding: 26px 0; border-top: 1px solid var(--line); }
.lp-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.lp-step { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; }
.lp-step-n { position: absolute; top: 12px; right: 14px; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--accent); -webkit-text-stroke: 1px var(--brand-text); }
.lp-roles { display: grid; gap: 12px; }
.lp-roles .card { margin: 0; }
.lp-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.lp-features li { display: flex; gap: 12px; align-items: flex-start; }
.lp-features .lp-ico { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); align-items: center; justify-content: center; }
.lp-faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; margin-bottom: 8px; }
.lp-faq summary { padding: 14px 0; min-height: 48px; }
.lp-faq details p { padding-bottom: 12px; }
.lp-final { text-align: center; background: var(--top); color: #fff; border-radius: 22px; padding: 28px 18px; margin-top: 10px; }
.lp-final h2 { color: #fff; font-size: 1.7rem; }
.lp-final .btn { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lp-final .btn:not(.primary) { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.lp-footer { text-align: center; color: var(--muted); padding: 22px 0 0; font-size: .9rem; }
/* miniatura do celular */
.lp-phone { width: min(300px, 82vw); margin: 0 auto; border-radius: 34px; background: #1a0b36; padding: 10px; box-shadow: 0 24px 50px rgba(58, 28, 113, .28); }
.lp-phone-bar { background: #3a1c71; color: #fff; font-weight: 700; padding: 18px 14px 10px; border-radius: 26px 26px 0 0; font-size: .95rem; }
.lp-phone-body { background: #f5f3ff; border-radius: 0 0 26px 26px; padding: 12px; }
.lp-mini-score { display: flex; justify-content: center; gap: 14px; align-items: baseline; color: #1a0b36; font-size: .8rem; margin-bottom: 10px; }
.lp-mini-score b { font-size: 1.6rem; }
.lp-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lp-mini-grid span { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #fff; font-size: .72rem; font-weight: 700; border-radius: 10px; padding: 10px 4px; text-align: center; }
.lp-mini-grid .nos { background: #3a1c71; } .lp-mini-grid .nos .icon { color: #d4f04c; }
.lp-mini-grid .eles { background: #b42318; }
.lp-mini-last { margin-top: 8px; background: #3a1c71; color: #fff; border-radius: 10px; padding: 8px 10px; font-size: .75rem; display: flex; gap: 6px; align-items: center; }
.lp-mini-last .icon { color: #d4f04c; }
@media (min-width: 700px) {
  .lp-hero { grid-template-columns: 1.2fr 1fr; padding-top: 30px; }
  .lp-steps, .lp-roles { grid-template-columns: repeat(3, 1fr); }
  .lp-features { grid-template-columns: 1fr 1fr; gap: 20px 28px; }
}
