:root {
  --paper: #f4f0e8;
  --ink: #1a1a1a;
  --muted: #6f6a62;
  --line: #ddd6cb;
  --red: #c44536;
  --blue: #2f6fd6;
  --serif: "Fraunces", "Times New Roman", serif;
  --sans: "Outfit", "Avenir Next", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}
button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wire {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #161616;
  color: #f4f0e8;
  height: 34px;
  overflow: hidden;
  border-bottom: 2px solid #161616;
}
.wire-track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: marquee 36s linear infinite;
}
.wire:hover .wire-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.tick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tick b { font-weight: 620; }
.up { color: #9ddead; }
.down { color: #f0a8a2; }
.flat { color: #d7d0c6; }

.page { max-width: 720px; margin: 0 auto; padding: 18px 18px 48px; }
.dateline {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #3c3c3c;
}
.live {
  margin: 10px 0 0;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.live b { color: var(--red); font-weight: 650; letter-spacing: 0.04em; }
.clock {
  margin: 8px 0 0;
  letter-spacing: 0.14em;
  font-size: 14px;
  text-transform: uppercase;
}
.rule { border: 0; border-top: 1px solid #cfc8be; margin: 14px 0; }
.rule.heavy { border-top: 2px solid #111; margin: 16px 0 18px; }

.mast {
  text-align: center;
  padding: 8px 0 4px;
}
.logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 620;
  font-size: 64px;
  letter-spacing: -0.03em;
  line-height: 0.9;
  color: #111;
}
.logo .o { position: relative; z-index: 1; }
.logo .mark {
  width: 46px;
  height: 32px;
  margin: 0 1px 8px -14px;
  z-index: 0;
  display: inline-flex;
}
.logo .mark svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 0 rgba(0,0,0,.08)); }
.tag {
  margin: 8px auto 0;
  max-width: 340px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #3a3a3a;
}
.sections-btn {
  margin-top: 0;
  background: transparent;
  border: 1.5px solid #111;
  color: var(--blue);
  letter-spacing: 0.14em;
  padding: 8px 18px;
  cursor: pointer;
  font-size: 14px;
}
.menu {
  display: none;
  text-align: center;
  padding: 8px 0 4px;
}
.menu.open { display: block; }
.menu a, .menu button {
  display: inline-block;
  margin: 6px;
  background: none;
  border: 0;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 13px;
  cursor: pointer;
  color: var(--blue);
}

.quote { padding: 8px 0 18px; }
.kicker {
  margin: 0;
  color: var(--red);
  letter-spacing: 0.08em;
  font-size: 15px;
  font-weight: 650;
  text-transform: uppercase;
}
.price {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-weight: 620;
  font-size: 52px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.delta { margin: 8px 0 0; color: var(--red); font-size: 18px; }
.delta.up { color: #1d6b45; }
.delta.flat { color: var(--muted); }
.src { margin: 6px 0 0; color: #444; font-size: 16px; }
.spark { width: 100%; height: 150px; margin-top: 18px; }
.spark path { fill: none; stroke: #111; stroke-width: 1.6; }

.word {
  padding: 6px 0 8px;
}
.word h2 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 28px;
  line-height: 1.2;
  margin: 8px 0;
}
.word p { margin: 0; color: #333; }
.word small { display: block; margin-top: 8px; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; font-size: 12px; }

.story {
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--line);
}
.story h3 {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.15;
  margin: 6px 0;
  font-weight: 560;
}
.story h3 button, .textbtn {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.lede { margin: 0 0 8px; color: #333; }
.meta { color: var(--muted); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.story img { width: 100%; height: 180px; object-fit: cover; margin: 8px 0; }

.letter { padding: 8px 0 12px; }
.letter h2 { font-family: var(--serif); font-weight: 560; font-size: 32px; margin: 6px 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.row input, .field input, textarea {
  border: 1px solid #111;
  background: transparent;
  padding: 10px 12px;
  color: var(--ink);
  width: 100%;
}
.row input { flex: 1 1 140px; }
.btn {
  border: 1.5px solid #111;
  background: #111;
  color: var(--paper);
  padding: 10px 14px;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}
.btn.ghost { background: transparent; color: var(--blue); }
.hp { position: absolute; left: -9999px; }
.foot {
  margin-top: 22px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.sheet-bg, .reader {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.4);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
}
.sheet-bg.open, .reader.open { display: flex; }
.sheet {
  background: var(--paper);
  width: min(680px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 18px 16px 28px;
  border-top: 2px solid #111;
}
.close {
  float: right;
  border: 1px solid #111;
  background: transparent;
  width: 32px;
  height: 32px;
  cursor: pointer;
}
.field { display: grid; gap: 4px; margin: 10px 0; font-size: 14px; }
.err { color: var(--red); min-height: 1.2em; font-size: 14px; }
.tabs { display: flex; gap: 8px; }
.comment { display: grid; grid-template-columns: 32px 1fr; gap: 8px; margin: 12px 0; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: #111; color: var(--paper); font-size: 13px;
}
.comment p { margin: 2px 0; }
.tools button { border: 0; background: none; color: var(--blue); padding: 0 8px 0 0; cursor: pointer; }
.replies { margin-left: 24px; }
.lock {
  border: 1px solid #111;
  padding: 12px;
  margin-top: 8px;
}
select {
  border: 1px solid #111;
  background: transparent;
  padding: 10px 12px;
  color: var(--ink);
  width: 100%;
}
.rec-item { display: grid; grid-template-columns: minmax(110px, 22vw) minmax(0, 1fr); gap: 14px; align-items: start; margin: 16px 0; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.rec-poster { width: 100%; max-width: 180px; aspect-ratio: 2 / 3; overflow: hidden; background: #1b1b1b; border-radius: 2px; }
.poster-art { width: 100%; height: 100%; display: grid; place-items: center; position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 35%, #777 0, #292929 35%, #111 76%); color: #f4f0e8; }
.poster-art::before { content: ""; position: absolute; width: 74%; aspect-ratio: 1; border: 1px solid rgba(244,240,232,.55); transform: rotate(45deg); }
.poster-art::after { content: "O PREGÃO · CINEMA"; position: absolute; bottom: 8%; left: 6%; right: 6%; text-align: center; font-size: clamp(6px, 1.4vw, 9px); letter-spacing: .12em; }
.poster-art span { font-family: var(--serif); font-size: clamp(32px, 6vw, 56px); line-height: 1; }
.poster-title { position: absolute; z-index: 1; left: 7%; right: 7%; bottom: 20%; text-align: center; font-family: var(--serif); font-size: clamp(8px, 1.8vw, 13px); line-height: 1.08; text-shadow: 0 1px 3px #000; }
.poster-art.prime { background: radial-gradient(ellipse at 60% 30%, #477d94 0, #163443 43%, #101b22 82%); }
.poster-art.netflix { background: radial-gradient(ellipse at 40% 25%, #8b3030 0, #3d1010 48%, #130d0d 82%); }
.rec-copy { min-width: 0; }
.rec-item h3 { font-family: var(--serif); font-size: clamp(18px, 3.5vw, 22px); line-height: 1.15; margin: 4px 0 7px; font-weight: 560; overflow-wrap: anywhere; }
.rec-item p { margin: 0; }
.rec-item small { color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; font-size: 12px; }

/* Slots de publicidade: espaço reservado que se adapta automaticamente quando o anúncio carrega */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100px;
  margin: 20px auto;
  padding: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #8b857b;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  overflow: hidden;
  background: rgba(0,0,0,.02);
}
.ad-slot:has(ins.adsbygoogle) {
  min-height: 90px;
  border: 0;
  background: transparent;
  padding: 0;
}
.ad-slot ins.adsbygoogle {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
}
button:disabled { opacity: .55; cursor: wait; }
@media (max-width: 480px) {
  .rec-item { grid-template-columns: minmax(90px, 28vw) minmax(0, 1fr); gap: 10px; }
  .rec-poster { max-width: 140px; }
  .ad-slot { margin: 16px auto; min-height: 80px; }
}

@media (min-width: 760px) {
  .logo { font-size: 84px; }
  .logo .mark { width: 58px; height: 40px; margin-left: -18px; }
  .price { font-size: 68px; }
  .sheet-bg, .reader { align-items: center; }
  .sheet { border: 2px solid #111; }
}

/* Atalho de administração: mantém a linguagem visual original e adapta ao celular. */
.header-actions { display:flex; align-items:center; gap:8px; }
.admin-entry { border:1px solid var(--ink, #202020); background:transparent; }
.admin-entry:hover { background:var(--ink, #202020); color:var(--paper, #f4f0e8); }
#admin-form input[type="file"] { max-width:100%; }
#admin-form button[disabled] { opacity:.65; cursor:wait; }
@media (max-width: 640px) {
  .header-actions { gap:6px; }
  .admin-entry { font-size: .78rem; padding: .55rem .65rem; }
}

/* Capas reais e ferramentas administrativas */
.rec-poster { background:#161616; }
.rec-poster img { width:100%; height:100%; object-fit:cover; object-position:center; }
.poster-fallback { background:linear-gradient(145deg,#292929,#111); }
.admin-manage { margin:12px 0 18px; }
.admin-row { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); }
.admin-row > span:first-child { flex:1; overflow-wrap:anywhere; font-weight:500; }
.admin-row > span:last-child { white-space:nowrap; }
.danger { color:#b3261e !important; }
#admin-cancel-edit[hidden] { display:none; }


/* v8: versão e estado real da conexão com o Worker/KV */
.build-version{font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;color:#777;margin:.25rem 0 .5rem}
.api-status{font-size:.95rem;line-height:1.45;margin:1rem 0;color:#b53d2d;overflow-wrap:anywhere}
.api-status.good{color:#176443}
.api-status.bad{color:#b53d2d}

/* Garante que o botão de cadastro fique realmente oculto no modo ADM. */
.tabs button[hidden] { display: none !important; }


/* v10: imagens responsivas com enquadramento consistente e fallback legível */
.rec-item { align-items: stretch; }
.rec-poster { position:relative; flex:0 0 29%; width:29%; max-width:180px; min-width:96px; aspect-ratio:2/3; height:auto; overflow:hidden; background:#161616; border-radius:3px; }
.rec-poster img { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:cover; object-position:center; }
.poster-placeholder { display:none; position:absolute; inset:0; padding:12px 8px; color:#f4f0e8; background:radial-gradient(ellipse at 50% 25%,#4a4a4a 0,#202020 58%,#101010 100%); align-items:center; justify-content:center; flex-direction:column; gap:12px; text-align:center; font-size:10px; letter-spacing:.14em; text-transform:uppercase; }
.poster-placeholder b { font-family:var(--serif); font-size:clamp(14px,3vw,22px); letter-spacing:0; text-transform:none; line-height:1.1; }
.poster-fallback .poster-placeholder { display:flex; }
.story-image-frame { position:relative; width:100%; aspect-ratio:16/9; min-height:130px; max-height:420px; margin:8px 0 14px; overflow:hidden; background:#e9e4da; border:1px solid var(--line); }
.story-image-frame img { display:block; width:100%; height:100%; margin:0; object-fit:cover; object-position:center; }
.image-placeholder { display:none; position:absolute; inset:0; align-items:center; justify-content:center; padding:16px; text-align:center; color:#777; letter-spacing:.08em; text-transform:uppercase; font-size:12px; background:linear-gradient(135deg,#eee9df,#ddd6ca); }
.story-image-frame.image-unavailable .image-placeholder { display:flex; }
.reader-image-frame { max-height:520px; }
@media (max-width:480px) { .rec-poster { width:34%; flex-basis:34%; max-width:140px; min-width:92px; } .story-image-frame { min-height:110px; } }


/* v11: Acesso ADM e Seções alinhados com a mesma altura e linguagem visual. */
.header-actions { display:flex; align-items:stretch; justify-content:flex-start; gap:8px; flex-wrap:wrap; }
.header-actions > button { box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; min-height:44px; margin:0; padding:8px 18px; border:1.5px solid #111; border-radius:0; background:transparent; color:var(--blue); font:inherit; font-size:14px; letter-spacing:.12em; line-height:1.2; cursor:pointer; }
.header-actions > button:hover, .header-actions > button:focus-visible { background:var(--ink, #202020); color:var(--paper, #f4f0e8); }
.header-actions > .admin-entry { letter-spacing:0; }
@media (max-width:640px) { .header-actions { gap:8px; } .header-actions > button { min-height:44px; padding:8px 14px; font-size:14px; } }


/* v12: player musical fixo e persistente entre as seções da página */
.music-dock { position:fixed; z-index:1000; right:12px; bottom:calc(12px + env(safe-area-inset-bottom)); width:min(310px,calc(100vw - 24px)); color:#f4f0e8; font-family:inherit; }
.music-toggle { width:100%; min-height:46px; display:flex; align-items:center; gap:10px; padding:11px 14px; border:1px solid #111; background:#171717; color:#f4f0e8; text-align:left; font:inherit; font-size:14px; letter-spacing:.03em; box-shadow:0 4px 18px #0002; cursor:pointer; }
.music-toggle > span:nth-child(2) { flex:1; }
.music-caret { font-size:20px; }
.music-panel { margin-bottom:7px; padding:14px; background:#171717; color:#f4f0e8; border:1px solid #333; box-shadow:0 4px 22px #0003; }
.music-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.music-heading button { border:0; background:transparent; color:inherit; font-size:25px; cursor:pointer; }
.music-panel p { margin:8px 0 12px; color:#d5d0c6; font-size:13px; }
.music-panel small { display:block; margin-top:10px; color:#c8c2b7; font-size:11px; line-height:1.45; }
.music-video { display:flex; min-height:120px; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:14px; background:#262626; text-align:center; font-size:12px; }
.music-video button { padding:10px 13px; border:1px solid #f4f0e8; background:transparent; color:#f4f0e8; font:inherit; cursor:pointer; }
.music-video iframe { display:block; width:100%; aspect-ratio:16/9; border:0; }
@media (max-width:480px) { .music-dock { right:8px; bottom:calc(8px + env(safe-area-inset-bottom)); width:min(280px,calc(100vw - 16px)); } .music-toggle { min-height:42px; } }

/* v13 playlist controls */
.music-controls{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;width:100%}.music-controls button{padding:8px 9px!important;font-size:12px!important}.music-volume{display:flex;align-items:center;gap:10px;margin:10px 0;color:#f4f0e8;font-size:12px}.music-volume input{width:100%;min-width:0;accent-color:#c44536}.music-off{width:100%;padding:8px;border:1px solid #777;background:#161616;color:#f4f0e8;cursor:pointer;font:inherit;font-size:12px}

/* Botão para instalar/adicionar O Pregão à tela inicial */
.install-app-btn {
  border: 1px solid #161616;
  border-radius: 999px;
  background: #161616;
  color: #fff;
  padding: 9px 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.install-app-btn:focus-visible { outline: 3px solid #2f6fd6; outline-offset: 3px; }
@media (max-width: 480px) {
  .header-actions { flex-wrap: wrap; justify-content: center; gap: 8px; }
  .install-app-btn { font-size: 13px; padding: 8px 11px; }
}


/* V16: mantém logotipo e slogan presos abaixo da faixa de cotações, inclusive no iPhone */
.mast {
  position: -webkit-sticky;
  position: sticky;
  top: 34px;
  z-index: 100;
  isolation: isolate;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 7px 0 10px;
  scroll-margin-top: 34px;
}
.mast .logo { font-size: clamp(42px, 9vw, 64px); }
.mast .tag { margin-top: 5px; }
.mast .build-version { margin: 3px 0 0; }
.mast .header-actions { margin-top: 8px; display: flex; align-items: stretch; justify-content: center; gap: 8px; flex-wrap: wrap; }
  .mast .header-actions button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; margin: 0; box-sizing: border-box; }
.mast .sections-btn { margin-top: 0; }
.converter-card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.28);
}
.converter-card input, .converter-card select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #b9b1a6;
  border-radius: 0;
}
.converter-controls { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
.converter-result-label { margin: 16px 0 0; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.converter-result { display: block; margin-top: 3px; font-family: var(--serif); font-size: clamp(30px, 8vw, 44px); overflow-wrap: anywhere; }
.converter-card .src { margin-bottom: 0; }
.visitor-counter { margin: 22px 0 0; color: var(--muted); font-size: 10px; text-align: center; letter-spacing: .04em; }
@media (max-width: 480px) {
  .mast .logo { font-size: 46px; }
  .mast .tag { font-size: 10px; }
  .mast .header-actions { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
  .mast .header-actions button { padding: 7px 9px; font-size: 12px; min-height: 44px; line-height: 1.2; }
  .mast .menu a, .mast .menu button { font-size: 11px; margin: 4px; }
}

.story-date { margin: 5px 0 9px; color: var(--muted); font-size: 12px; letter-spacing: .02em; }

/* V21: ícone de compartilhamento redesenhado */
.share-btn { color: #1769d2; }
.share-btn:focus-visible { outline: 2px solid #1769d2; outline-offset: 3px; }
.share-icon { display: inline-block; width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; margin-right: 5px; }
.meta .share-btn { display: inline-flex; align-items: center; gap: 2px; }
.meta .share-icon { width: 15px; height: 15px; flex-basis: 15px; margin-right: 2px; }
.reader-share { margin: 18px 0 22px; }
.reader-share .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.reader-share .share-icon { width: 19px; height: 19px; flex-basis: 19px; margin-right: 1px; }


/* V24: homepage shows 12 latest headlines; category filters expose older stories. */
.headline-filters{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0 10px}
.headline-filter{appearance:none;border:1px solid #bdb7ad;background:transparent;color:inherit;padding:8px 12px;font:inherit;font-size:.9rem;cursor:pointer;border-radius:2px}
.headline-filter.active{background:#191919;color:#f4f0e8;border-color:#191919}
.headline-view-note{font-size:.88rem;color:#77736c;margin:8px 0 18px}

/* V25: modernização visual sutil dos controles, sem alterar logotipo ou slogan. */
:root {
  --control-radius: 12px;
  --control-shadow: 0 2px 7px rgba(26, 26, 26, .07);
}
button, .headline-filter, .header-actions > button, .btn, .install-app-btn {
  -webkit-tap-highlight-color: transparent;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(47, 111, 214, .55);
  outline-offset: 3px;
}
.mast .header-actions > button,
.header-actions > button,
.sections-btn,
.install-app-btn {
  min-height: 44px;
  border-radius: var(--control-radius);
  border: 1px solid rgba(26, 26, 26, .18);
  box-shadow: var(--control-shadow);
  font-weight: 600;
  letter-spacing: .025em;
}
.mast .header-actions > .install-app-btn,
.header-actions > .install-app-btn,
.install-app-btn {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.mast .header-actions > .admin-entry,
.header-actions > .admin-entry,
.mast .header-actions > .sections-btn,
.header-actions > .sections-btn {
  background: rgba(255,255,255,.48);
  color: var(--ink);
}
.mast .header-actions > button:hover,
.header-actions > button:hover,
.sections-btn:hover,
.install-app-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(26,26,26,.12);
}
.btn {
  border-radius: 10px;
  border: 1px solid var(--ink);
  box-shadow: var(--control-shadow);
  font-weight: 600;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(26,26,26,.13); }
.btn.ghost { border-color: rgba(26,26,26,.22); border-radius: 10px; }
.headline-filter {
  border-radius: 999px;
  padding: 9px 15px;
  border-color: #d2cabe;
  background: rgba(255,255,255,.42);
  font-weight: 550;
}
.headline-filter:hover { border-color: var(--red); box-shadow: var(--control-shadow); }
.headline-filter.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.story {
  padding: 14px 0 20px;
  border-bottom-color: rgba(120, 108, 93, .22);
}
.story-image-frame, .story img { border-radius: 12px; }
.converter-card {
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(26,26,26,.045);
}
.converter-card input, .converter-card select,
.row input, .field input, textarea {
  border-radius: 10px;
}
.music-toggle, .music-panel {
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
}
.music-toggle { border-color: rgba(255,255,255,.14); }
.music-video, .music-video button { border-radius: 9px; }
@media (max-width: 480px) {
  .mast .header-actions { gap: 7px; }
  .mast .header-actions button { border-radius: 10px; padding: 8px 11px; }
  .headline-filters { gap: 7px; }
  .headline-filter { padding: 8px 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}


/* Vídeos incorporados nas manchetes */
.story-video-frame { position:relative; width:100%; aspect-ratio:16/9; margin:8px 0 14px; overflow:hidden; background:#111; border:1px solid var(--line); border-radius:12px; }
.story-video-frame iframe, .story-video-frame video { display:block; width:100%; height:100%; border:0; object-fit:contain; background:#111; }
.video-link { margin:10px 0 14px; }
.video-link a { display:inline-flex; align-items:center; gap:8px; padding:10px 14px; border:1px solid var(--line); border-radius:999px; color:inherit; text-decoration:none; font-weight:600; }
.field-hint { margin:-6px 0 12px; color:var(--muted, #777); font-size:.88rem; line-height:1.45; }


/* V35: créditos discretos do catálogo TMDB */
.tmdb-credit { display:flex; align-items:center; gap:12px; margin:18px 0 0; padding-top:12px; border-top:1px solid rgba(127,127,127,.25); font-size:.78rem; line-height:1.45; opacity:.88; }
.tmdb-credit img { display:block; width:48px; height:48px; object-fit:contain; flex:0 0 48px; }
.tmdb-credit p { margin:0 0 4px; }
.tmdb-credit small { display:block; font-size:.72rem; }
.movie-loading { opacity:.75; font-size:.9rem; }
@media (max-width:480px) { .tmdb-credit { align-items:flex-start; gap:9px; } .tmdb-credit img { width:40px; height:40px; flex-basis:40px; } }


/* V36: cabeçalho editorial futurista com vidro fosco; preserva paleta, tipografia e slogan. */
.mast {
  background: rgba(244, 240, 232, .88);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  backdrop-filter: blur(18px) saturate(125%);
  border-bottom: 1px solid rgba(221, 214, 203, .72);
  box-shadow: 0 10px 26px rgba(26, 26, 26, .055);
  position: -webkit-sticky;
  position: sticky;
  top: 34px;
  overflow: visible;
}
.mast::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: calc(100% - 1px);
  left: -1px;
  right: -1px;
  height: 24px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(244, 240, 232, .72) 0%, rgba(244, 240, 232, .34) 42%, rgba(244, 240, 232, 0) 100%);
}
.mast .logo {
  text-shadow: 0 1px 0 rgba(255, 255, 255, .22);
}
.mast .tag {
  text-wrap: balance;
}
.mast .header-actions > button {
  transition: background-color .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}
.mast .header-actions > .admin-entry,
.mast .header-actions > .sections-btn {
  background: rgba(255, 255, 255, .38);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.mast .header-actions > button:hover,
.mast .header-actions > button:focus-visible {
  box-shadow: 0 7px 18px rgba(26, 26, 26, .10);
}
@media (max-width: 480px) {
  .mast { padding-bottom: 11px; }
  .mast::after { height: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .mast .header-actions > button { transition: none; }
}


/* V37: garante que o botão de fechar o leitor fique acima do cabeçalho fixo */
.reader {
  z-index: 1200;
  align-items: flex-start;
  padding-top: env(safe-area-inset-top, 0px);
}

.reader .sheet {
  position: relative;
  width: min(680px, 100%);
  height: 100%;
  max-height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: 58px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

.reader .close {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: max(12px, calc((100vw - min(680px, 100vw)) / 2 + 12px));
  z-index: 1300;
  float: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(244, 240, 232, .96);
  box-shadow: 0 3px 14px rgba(0, 0, 0, .16);
  font-size: 28px;
  line-height: 1;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.reader .close:focus-visible {
  outline: 3px solid #2f6fd6;
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .reader .sheet {
    padding-left: 16px;
    padding-right: 16px;
  }
  .reader .close {
    right: 12px;
  }
}
