:root {
  --bg: #f3eee4;
  --bg-2: #eae2d4;
  --card: #fffcf7;
  --ink: #1f1710;
  --muted: #5c5146;
  --line: #d9cebc;
  --accent: #8a3d12;
  --accent-2: #c46a2b;
  --good: #1f5b3a;
  --good-bg: #e5f3ea;
  --alert: #8b1e2d;
  --alert-bg: #fde8ea;
  --miss: #5c5146;
  --miss-bg: #ece7de;
  --comum: #6b5344;
  --shadow: 0 10px 30px rgba(31, 23, 16, 0.06);
  --radius: 16px;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 400px at 10% -10%, #efe3d0 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}
.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 20; }
.topo {
  background: #1f1710;
  color: #f8f1e6;
  padding: 28px 20px 32px;
}
.topo-inner { max-width: 1120px; margin: 0 auto; }
.olho {
  margin: 0 0 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #e2b989;
  font-weight: 600;
}
.topo h1 {
  font-family: var(--display);
  font-weight: 650;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.sub, .meta-linha { margin: 0; color: #d7c9b6; }
.meta-linha { margin-top: 8px; font-size: 0.92rem; }
main { max-width: 1120px; margin: 0 auto; padding: 8px 16px 64px; }
.bloco { margin-top: 36px; }
.bloco h2 {
  font-family: var(--display);
  font-size: 1.45rem;
  margin: 0 0 6px;
}
.lead { margin: 0 0 16px; color: var(--muted); }
.aviso {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--alert-bg);
  color: var(--alert);
}
.cards, .prio-grid, .mercados-grid {
  display: grid;
  gap: 12px;
}
.cards { grid-template-columns: 1fr; }
.prio-grid, .mercados-grid { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .cards, .prio-grid, .mercados-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .prio-grid { grid-template-columns: repeat(3, 1fr); }
}
.card, .prio, .mercado {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  box-shadow: var(--shadow);
}
.card.vence { border-color: #e8b4ba; background: linear-gradient(#fff, var(--alert-bg)); }
.selo {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  margin: 0 6px 8px 0;
}
.selo.boa { background: var(--good-bg); color: var(--good); }
.selo.hoje { background: var(--alert-bg); color: var(--alert); }
.selo.comum { background: var(--miss-bg); color: var(--comum); }
.selo.ok { background: var(--good-bg); color: var(--good); }
.selo.nao { background: var(--miss-bg); color: var(--miss); }
.card h3, .prio h3, .mercado h3 {
  font-family: var(--display);
  font-size: 1.08rem;
  margin: 0 0 6px;
  line-height: 1.25;
}
.preco {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.55rem;
  color: var(--accent);
  margin: 4px 0;
}
.preco small { font-size: 0.7rem; font-weight: 500; color: var(--muted); margin-left: 4px; }
.card p, .prio p, .mercado p { margin: 0 0 6px; color: var(--muted); font-size: 0.92rem; }
.card a, .prio a, .mercado a, td a { color: var(--accent); }
.prio { min-height: 160px; }
.prio.sem { opacity: 0.95; }
.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: end;
  margin-bottom: 10px;
}
.campo { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.campo.grow { flex: 1; min-width: 200px; }
.campo span { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
input[type="search"], select {
  font: inherit;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
.check { display: flex; gap: 6px; align-items: center; font-size: 0.92rem; padding-bottom: 8px; }
.contador { margin: 0 0 8px; color: var(--muted); font-size: 0.9rem; }
.tabela-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { padding: 10px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
th { position: sticky; top: 0; background: #f7f1e8; z-index: 1; }
th button {
  font: inherit;
  font-weight: 700;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
th button:hover, th button[aria-pressed="true"] { color: var(--accent); }
th.num, td.num { text-align: right; white-space: nowrap; }
td.produto { font-weight: 600; }
tr.vencida { opacity: 0.55; }
tr.vence-hoje { background: #fff5f5; }
.hist { margin-bottom: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.hist h3 { margin: 0 0 8px; font-size: 1rem; font-family: var(--display); }
.hist ol { margin: 0; padding-left: 18px; }
.hist li { margin: 0 0 4px; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.links a { font-size: 0.88rem; }
.rodape { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
code { font-size: 0.85em; background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }

.selo.tipo { background: #f3e4d2; color: #6a3410; font-weight: 650; }
.selo.vencida { background: #ece7de; color: #5a4a40; }
.linha-mercado { font-weight: 600; color: var(--ink) !important; margin-bottom: 8px !important; }
.tipos { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.faixas {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.faixas li { margin: 0 0 2px; }
.validade { font-weight: 600; color: var(--ink) !important; }
.preco-miss { color: var(--miss) !important; font-size: 1.15rem !important; }
.vencida-card { opacity: 0.7; }
.td-preco { text-align: left !important; }
.preco-cel { display: block; font-family: var(--display); font-size: 1.15rem; color: var(--accent); }
.unitario { display: block; margin-top: 4px; color: var(--muted); }
.lista-cards { display: none; }
.oferta-card h3 { margin-bottom: 8px; }
.oferta-card .preco { margin: 2px 0 6px; }

@media (max-width: 799px) {
  .tabela-wrap { display: none; }
  .lista-cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
}
@media (min-width: 800px) {
  .lista-cards { display: none !important; }
  .tabela-wrap { display: block; }
}
