:root {
    --bg: #f4f3ef; --panel: #fff; --ink: #1c1b19; --muted: #6b6860; --line: #e2dfd7; --soft: #f0eee8;
    --accent: #1f3864; --accent2: #2f6db0; --ok: #2f7d4f; --mid: #2f8a8a; --warn: #b8861a; --low: #8a8780;
    --ouro: #f2b51c; --header: 58px;
  }
  * { box-sizing: border-box; }
  body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
  button, select, input { font: inherit; color: inherit; }
  button { cursor: pointer; }
  header { height: var(--header); background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 22px; display: flex; gap: 14px; align-items: center; position: sticky; top: 0; z-index: 10; }
  header h1 { font-size: 18px; margin: 0; letter-spacing: -0.01em; white-space: nowrap; }
  header .status { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  header .acoes { margin-left: auto; display: flex; gap: 6px; }
  .btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 11px; white-space: nowrap; }
  .btn:hover { border-color: #c9c5bb; }
  .btn.primario { background: var(--accent); border-color: var(--accent); color: #fff; }
  .btn.primario:hover { background: #18304f; }
  .btn.peq { padding: 4px 9px; font-size: 12.5px; }
  .btn:disabled { opacity: .5; cursor: default; }
  .wrap { max-width: 1680px; margin: 0 auto; padding: 16px 22px 40px; }
  .aviso { background: #fff8e6; border: 1px solid #f0d99a; border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
  .aviso h2 { margin: 0 0 4px; font-size: 16px; }
  .aviso p { margin: 0; color: #5a4a1a; max-width: 760px; }
  .progresso { flex: 1 1 300px; }
  .barra { height: 8px; background: #efe6cc; border-radius: 99px; overflow: hidden; margin-top: 6px; }
  .barra > div { height: 100%; background: var(--warn); width: 0; transition: width .2s; }

  .app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(430px, 46%); gap: 18px; align-items: start; }
  .card-ui { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
  .card-ui h2 { font-size: 15px; margin: 0 0 8px; }
  .card-ui h2 small { color: var(--muted); font-weight: 400; }

  /* busca */
  .busca-box { position: relative; }
  .busca-box input { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
  .sugs { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.12); max-height: 400px; overflow: auto; z-index: 20; }
  .sug { display: flex; gap: 10px; align-items: center; padding: 6px 10px; cursor: pointer; }
  .sug:hover, .sug.ativo { background: var(--soft); }
  .sug img { width: 34px; height: 47px; object-fit: cover; border-radius: 3px; background: #e9e7e1; }
  .sug .t { font-weight: 600; font-size: 13px; }
  .sug .m { color: var(--muted); font-size: 12px; }
  .sug .semcor { color: #a0522d; font-size: 11px; }
  .sug .ja { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
  .dica { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
  .dica b { color: var(--ink); font-weight: 600; }
  .estrela-ic { color: var(--ouro); }

  /* filtros */
  .filtros { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 10px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
  .campo label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
  .campo select { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
  .seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
  .seg button { flex: 1; border: none; background: #fff; padding: 6px 8px; font-size: 13px; }
  .seg button + button { border-left: 1px solid var(--line); }
  .seg button.on { background: var(--accent); color: #fff; }
  .chips { display: flex; flex-wrap: wrap; gap: 4px; }
  .chip { border: 1px solid var(--line); background: var(--soft); color: var(--muted); border-radius: 99px; padding: 2px 8px; font-size: 11.5px; font-weight: 600; }
  .chip.on { background: var(--accent2); border-color: var(--accent2); color: #fff; }
  .linha { grid-column: 1 / -1; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
  .check { display: flex; gap: 6px; align-items: center; font-size: 13px; }
  details.avanc { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf7; }
  details.avanc summary { cursor: pointer; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; }
  details.avanc summary::-webkit-details-marker { display: none; }
  details.avanc summary::before { content: '▸'; transition: transform .15s; display: inline-block; }
  details.avanc[open] summary::before { transform: rotate(90deg); }
  .avanc-corpo { padding: 4px 12px 12px; }
  .pesos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .pesos input[type=range] { width: 100%; accent-color: var(--accent); }
  .pesos .v { float: right; color: var(--ink); font-variant-numeric: tabular-nums; }
  .pesos small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
  .avanc-rodape { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--muted); }

  /* sugestões */
  .res-head { display: flex; align-items: baseline; gap: 12px; margin: 18px 0 10px; flex-wrap: wrap; }
  .res-head h2 { margin: 0; font-size: 16px; }
  .res-head .info { color: var(--muted); font-size: 13px; }
  .zona-res { border-radius: 12px; transition: background .15s, outline-color .15s; outline: 2px dashed transparent; outline-offset: 4px; }
  .zona-res.alvo-tirar { outline-color: #c0392b; background: #fbeeee; }
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .res { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; display: flex; flex-direction: column; cursor: grab; transition: box-shadow .12s, transform .12s; }
  .res:hover { box-shadow: 0 6px 16px rgba(0,0,0,.08); }
  .res.arrastando { opacity: .45; }
  .res .imgw { position: relative; }
  .res img { width: 100%; display: block; aspect-ratio: 733/1024; object-fit: cover; background: #e9e7e1; }
  .score { position: absolute; left: 7px; top: 7px; color: #fff; font-weight: 700; font-size: 12.5px; padding: 1px 7px; border-radius: 6px; font-variant-numeric: tabular-nums; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
  .lupa { position: absolute; right: 7px; top: 7px; width: 26px; height: 26px; border-radius: 50%; border: none; background: rgba(255,255,255,.9); font-size: 13px; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
  .res .corpo { padding: 7px 9px 9px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
  .res .nome { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .res .meta { color: var(--muted); font-size: 11.5px; display: flex; gap: 5px; align-items: center; white-space: nowrap; overflow: hidden; }
  .sig { font-size: 10px; font-weight: 700; color: #fff; background: #6b6860; padding: 0 5px; border-radius: 4px; }
  .paleta { display: flex; height: 8px; border-radius: 3px; overflow: hidden; margin-top: 3px; }
  .paleta span { display: block; height: 100%; }
  .comp { display: grid; grid-template-columns: auto 1fr; gap: 1px 6px; font-size: 10px; color: var(--muted); margin-top: 2px; align-items: center; }
  .comp i { display: block; height: 4px; border-radius: 2px; background: #dcd8cf; position: relative; overflow: hidden; }
  .comp i b { position: absolute; inset: 0 auto 0 0; background: var(--accent2); }
  .res .add { margin-top: auto; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 4px 8px; font-size: 12px; }
  .res .add.in { background: #e8f2ec; border-color: #b7d8c3; color: var(--ok); }
  .vazio { color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: 12px; padding: 36px 24px; text-align: center; grid-column: 1 / -1; }
  .sentinela { height: 1px; }
  .fim-lista { color: var(--muted); font-size: 12.5px; text-align: center; padding: 18px 0 4px; }

  /* binder */
  .binder-col { position: sticky; top: calc(var(--header) + 12px); max-height: calc(100vh - var(--header) - 24px); display: flex; flex-direction: column; padding: 12px 14px; }
  .binder-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .binder-head h2 { margin: 0 auto 0 0; }
  .binder-head .seg button { padding: 4px 10px; font-size: 12.5px; }
  .binder-info { color: var(--muted); font-size: 12.5px; margin: 6px 0 8px; }
  .paginas { overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 2px 2px 6px; min-height: 200px; }
  .pagina { background: #2b2a33; border-radius: 12px; padding: 10px; margin: 0 auto;
    width: min(100%, calc((100vh - 300px - (var(--rows) - 1) * 7px) / var(--rows) * 0.716 * var(--cols) + (var(--cols) - 1) * 7px + 20px)); min-width: 260px; }
  .pagina .rot { color: #c9c6d6; font-size: 11px; margin: 0 2px 6px; display: flex; justify-content: space-between; }
  .pagina.nova .rot { color: #9d9aac; }
  .bolsos { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 7px; }
  .bolso { aspect-ratio: 733/1024; background: #3a3945; border-radius: 6px; position: relative; overflow: hidden; outline: 2px solid transparent; outline-offset: -2px; transition: outline-color .1s, background .1s; }
  .bolso img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
  .bolso.cheio { cursor: grab; }
  .bolso.alvo { outline-color: #7fb4ff; background: #4a4a5c; }
  .bolso.ref { outline: 3px solid var(--ouro); outline-offset: -3px; }
  .bolso .acoes-b { position: absolute; inset: 4px 4px auto 4px; display: flex; justify-content: space-between; opacity: 0; transition: opacity .1s; }
  .bolso:hover .acoes-b { opacity: 1; }
  .bolso .acoes-b button { width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(0,0,0,.7); color: #fff; font-size: 12px; line-height: 1; padding: 0; }
  .bolso .acoes-b .estrela { color: #fff; }
  .bolso.ref .acoes-b { opacity: 1; }
  .bolso.ref .acoes-b .estrela { background: var(--ouro); color: #3b2a00; }
  .bolso.ref .acoes-b .x { opacity: 0; }
  .bolso.ref:hover .acoes-b .x { opacity: 1; }
  .bolso .num { position: absolute; bottom: 3px; right: 5px; color: #6f6c80; font-size: 10px; }
  .bolso.cheio .num { display: none; }
  .binder-rodape { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

  /* detalhe */
  dialog { border: none; border-radius: 14px; padding: 0; width: min(960px, calc(100% - 32px)); }
  dialog::backdrop { background: rgba(20,20,18,.6); }
  .det { display: grid; grid-template-columns: minmax(0, 380px) 1fr; }
  .det img { width: 100%; display: block; background: #e9e7e1; }
  .det .lado { padding: 20px 22px; }
  .det h3 { margin: 0 0 2px; font-size: 20px; }
  .det .sub { color: var(--muted); margin-bottom: 12px; }
  .pal-det { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 14px; }
  .pal-det div { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
  .pal-det span.sw { width: 34px; height: 18px; border-radius: 4px; border: 1px solid rgba(0,0,0,.08); }
  .pal-det span.pc { color: var(--muted); width: 44px; text-align: right; }
  .metricas { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 13px; }
  .metricas div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 3px 0; }
  .metricas span { color: var(--muted); }
  .det .rodape { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
  .toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #1c1b19; color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; }
  .toast.on { opacity: .95; }
  @media (max-width: 1100px) {
    .app { grid-template-columns: 1fr; }
    .binder-col { position: static; max-height: none; }
    .paginas { max-height: 80vh; }
    .det { grid-template-columns: 1fr; }
    .filtros, .pesos { grid-template-columns: 1fr; }
    header .status { display: none; }
  }

/* ---------- versão site ---------- */
header .marca { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
header .marca img { width: 28px; height: 28px; }
header nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
header nav a { color: var(--muted); text-decoration: none; font-size: 13.5px; padding: 6px 10px; border-radius: 8px; }
header nav a:hover { background: var(--soft); color: var(--ink); }
.carregando { color: var(--muted); text-align: center; padding: 60px 20px; }
.carregando .giro { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 12px; animation: giro 0.9s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
.intro { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; max-width: 900px; }
.intro b { color: var(--ink); }
.anuncio { display: none; }
html[data-anuncios="1"] .anuncio { display: block; margin: 14px 0; min-height: 90px; }
footer.rodape { border-top: 1px solid var(--line); margin-top: 30px; padding: 18px 22px 90px; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.6; }
footer.rodape a { color: var(--muted); }
.bolso.selecionado, .res.selecionado { outline: 3px solid #4f9bff !important; outline-offset: -3px; }
.res.selecionado { box-shadow: 0 0 0 3px #4f9bff; }
.res, .bolso, .abas button, .mao button { -webkit-tap-highlight-color: transparent; }
.binder-head .btn { margin-left: 0; }

/* barra da carta selecionada (toque) */
.mao { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 40; background: #1c1b19; color: #fff; border-radius: 12px; padding: 8px 10px 8px 8px; display: flex; gap: 10px; align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.3); max-width: calc(100% - 20px); }
.mao[hidden] { display: none; }
.mao img { width: 34px; height: 47px; border-radius: 4px; object-fit: cover; }
.mao .txt { font-size: 12.5px; line-height: 1.3; min-width: 0; }
.mao .txt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.mao .txt span { color: #c9c6bf; }
.mao button { background: #33312c; border: none; color: #fff; border-radius: 8px; padding: 6px 9px; font-size: 12.5px; white-space: nowrap; }
.mao button.prim { background: #2f6db0; }

/* abas do celular */
.abas { display: none; }
@media (max-width: 1100px) {
  .abas { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--panel); border-top: 1px solid var(--line); }
  .abas button { flex: 1; border: none; background: none; padding: 12px 6px 14px; font-size: 14px; color: var(--muted); font-weight: 600; }
  .abas button.on { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
  body[data-aba="sugestoes"] .binder-col { display: none; }
  body[data-aba="binder"] .col-sug { display: none; }
  .mao { bottom: 62px; left: 8px; right: 8px; transform: none; max-width: none; padding: 7px 8px; }
  .mao .txt b { max-width: 40vw; }
  .mao .txt span { font-size: 11.5px; }
  #maoAcoes { flex-wrap: nowrap !important; margin-left: auto; }
  .mao button { padding: 7px 8px; }
  .toast { bottom: auto; top: 66px; max-width: calc(100% - 24px); text-align: center; }
  body[data-aba="binder"] .intro { display: none; }
  header nav a.secundario { display: none; }
  .wrap { padding: 12px 12px 30px; }
  .pagina { width: 100%; min-width: 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .filtros { grid-template-columns: 1fr 1fr; }
  .filtros .campo:first-child { grid-column: 1 / -1; }
}
@media (pointer: coarse) {
  .bolso .acoes-b { opacity: 1; }
  .res { cursor: pointer; }
}

/* páginas de texto (Sobre, Privacidade) */
.texto { max-width: 820px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 26px 30px; line-height: 1.6; }
.texto h1 { font-size: 24px; margin: 0 0 6px; }
.texto h2 { font-size: 17px; margin: 26px 0 6px; }
.texto p, .texto li { color: #35332e; }
.texto .nota { color: var(--muted); font-size: 13px; }
.texto code { background: var(--soft); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
