/* Raio-x: ilha de edição escura; o âmbar é o lápis de marcação (comentário, seleção, o que pede atenção). */
:root {
  --bg: #0d0e10;
  --surface: #15171a;
  --surface-2: #1c1f23;
  --line: #2a2e34;
  --fg: #ecebe6;
  --muted: #8b9098;
  --accent: #ffb23e;
  --accent-ink: #1d1402;
  --ok: #5cc98a;
  --alerta: #ff6b5b;
  --ui: "Schibsted Grotesk", "Helvetica Neue", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --r: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--ui); -webkit-text-size-adjust: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img, video { max-width: 100%; display: block; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.marca { font: 600 14px var(--mono); letter-spacing: .02em; text-decoration: none; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.marca i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.trilha { min-width: 0; flex: 1; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trilha b { color: var(--fg); font-weight: 600; }
.eu { font: 500 12px var(--mono); color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; }

main { max-width: 1180px; margin: 0 auto; padding-inline: 16px; padding-block: 18px 80px; }
.vazio { color: var(--muted); padding: 40px 0; text-align: center; }
.rot { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- início ---------- */
.inicio-cab { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.inicio-cab h1 { font-size: clamp(24px, 6vw, 34px); line-height: 1.05; margin: 0; letter-spacing: -.02em; text-wrap: balance; }
.filtros { display: flex; gap: 6px; flex-wrap: wrap; }
.filtro { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 12px; font: 500 12px var(--mono); color: var(--muted); }
.filtro[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.projetos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.projeto { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; text-decoration: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: 10px; transition: border-color .15s; }
.projeto:hover { border-color: #3b4047; }
.projeto .capa { width: 88px; aspect-ratio: 3 / 4; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.projeto h2 { font-size: 16px; line-height: 1.2; margin: 4px 0 4px; text-wrap: balance; }
.projeto p { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.projeto .pe { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font: 11px var(--mono); color: var(--muted); }
.engine { font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.engine.tiktok { color: #7fd1ff; } .engine.obra { color: #c9a7ff; } .engine.story { color: #9be38a; } .engine.brainstorm { color: #ffb0c8; }
.bolha { font: 600 11px var(--mono); background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 1px 8px; }

/* ---------- projeto ---------- */
.proj-cab { margin-bottom: 14px; }
.proj-cab h1 { font-size: clamp(26px, 7vw, 40px); line-height: 1.02; letter-spacing: -.025em; margin: 6px 0 8px; text-wrap: balance; }
.proj-cab p { margin: 0; color: var(--muted); max-width: 65ch; }
.proj-cab .meta { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; font: 12px var(--mono); color: var(--muted); }
.abas { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 49px); z-index: 15; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px 16px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.abas::-webkit-scrollbar { display: none; }
.aba { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 14px; font-size: 13px; font-weight: 600;
  color: var(--muted); text-decoration: none; display: flex; gap: 6px; align-items: center; }
.aba[aria-current="page"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.aba .bolha { font-size: 10px; }
.nota-secao { color: var(--muted); font: 12px var(--mono); margin: -4px 0 14px; }

.itens { display: grid; gap: 14px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 14px; scroll-margin-top: 120px; }
.item.tem-midia { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) {
  .item.tem-midia { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); align-items: start; }
  .item.video { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
  .item .midia { position: sticky; top: 118px; }
}
.item.alvo { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.item-cab { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.item-cab h3 { margin: 0; font: 700 18px var(--mono); letter-spacing: -.01em; }
.item-cab .sub { color: var(--muted); font-size: 13px; }
.item-cab .link { margin-left: auto; font: 11px var(--mono); color: var(--muted); text-decoration: none; background: none; border: 0; padding: 0; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { font: 11px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.alertas { display: grid; gap: 4px; }
.alerta { font-size: 13px; color: var(--alerta); background: color-mix(in srgb, var(--alerta) 10%, transparent); border-left: 3px solid var(--alerta);
  padding: 5px 9px; border-radius: 0 6px 6px 0; }

/* mídia */
.midia { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.midia > * { min-width: 0; }
.tela { position: relative; background: #000; border-radius: 9px; overflow: hidden; }
.tela img { width: 100%; height: auto; max-height: 66vh; object-fit: contain; cursor: zoom-in; }
@media (min-width: 860px) { .tela img { max-height: 78vh; } }
.tela video { width: 100%; max-height: 78vh; background: #000; }
.versoes { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.versao { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 6px; padding: 2px 8px; font: 11px var(--mono); }
.versao[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.versoes .rot { margin-right: 4px; }
.grade { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.grade button { flex: none; width: 72px; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  background: repeating-conic-gradient(#2b2f35 0 25%, #1f2226 0 50%) 0 0 / 12px 12px; }
.grade img { width: 100%; aspect-ratio: 9 / 16; object-fit: contain; }
.grade figcaption { font: 9px var(--mono); color: var(--muted); padding: 2px 3px; background: var(--surface-2); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.botao { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; text-decoration: none; }
.botao.forte { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.marcadores { display: flex; gap: 5px; flex-wrap: wrap; }
.marcador { border: 1px solid var(--line); background: var(--surface-2); border-radius: 6px; padding: 2px 7px; font: 11px var(--mono); color: var(--muted); }
.marcador.agora { border-color: var(--accent); color: var(--accent); }
.marcador .n { color: var(--accent); margin-left: 3px; }

/* textos */
.textos { display: grid; gap: 8px; min-width: 0; }
.txt .rot { display: block; margin-bottom: 2px; }
.txt.prosa p { margin: 0; }
.txt.narra { background: #000; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-weight: 600; }
.txt.fala { background: #f4f1ea; color: #15130f; border-radius: 14px; padding: 8px 12px; font-weight: 600; justify-self: start; max-width: 100%; }
.txt.fala .rot { color: #6c6558; }
.txt.msg { background: #22252b; border-radius: 12px; padding: 7px 12px; border: 1px solid var(--line); }
.txt.mono summary { cursor: pointer; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.txt.mono pre { white-space: pre-wrap; font: 12px/1.55 var(--mono); color: #c6c9ce; margin: 6px 0 0; background: var(--bg); padding: 10px; border-radius: 8px; border: 1px solid var(--line); }
.md { max-width: 72ch; }
.md h1, .md h2, .md h3, .md h4 { line-height: 1.2; margin: 1.1em 0 .4em; text-wrap: balance; }
.md h1 { font-size: 22px; } .md h2 { font-size: 18px; } .md h3, .md h4 { font-size: 15px; }
.md p { margin: .5em 0; } .md ul { margin: .4em 0; padding-left: 1.2em; } .md li { margin: .15em 0; }
.md code { font: 12px var(--mono); background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.md .tab { overflow-x: auto; } .md table { border-collapse: collapse; font-size: 13px; }
.md td, .md th { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }

/* comentários */
.conversa { display: grid; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; }
.item:not(.tem-midia) .conversa, .item.tem-midia .conversa { grid-column: 1 / -1; }
@media (min-width: 860px) { .item.tem-midia .conversa { grid-column: 2; } }
.coment { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; }
.coment .av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--mono); color: #111; }
.coment .corpo { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; padding: 6px 10px; min-width: 0; }
.coment.novo .corpo { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.coment .quem { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font: 11px var(--mono); color: var(--muted); }
.coment .quem b { color: var(--fg); font-family: var(--ui); font-size: 13px; }
.coment .texto { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.coment .tempo { color: var(--accent); background: none; border: 0; padding: 0; font: inherit; }
.coment.resolvido .corpo { opacity: .55; }
.coment.resolvido .texto { text-decoration: line-through; text-decoration-color: var(--muted); }
.coment .mini { background: none; border: 0; padding: 0; font: 11px var(--mono); color: var(--muted); }
.coment .mini:hover { color: var(--fg); }
.coment .mini.ok { color: var(--ok); }
.ver-resolvidos { justify-self: start; background: none; border: 0; padding: 0; font: 11px var(--mono); color: var(--muted); }
.compor { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: end; }
.compor textarea { resize: none; min-height: 38px; max-height: 180px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.compor textarea:focus { border-color: var(--accent); outline: none; }
.compor .extra { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; font: 11px var(--mono); color: var(--muted); }
.compor .extra label { display: flex; gap: 5px; align-items: center; }
.compor button { height: 38px; }

/* lupa */
.lupa { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .94); display: grid; grid-template-rows: auto minmax(0, 1fr); }
.lupa header { display: flex; gap: 10px; align-items: center; padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px; font: 12px var(--mono); color: var(--muted); }
.lupa header .botao { margin-left: auto; }
.lupa .quadro { display: grid; place-items: center; overflow: auto; padding: 0 8px calc(env(safe-area-inset-bottom, 0px) + 10px); }
.lupa img { max-height: 100%; width: auto; object-fit: contain; background: repeating-conic-gradient(#2b2f35 0 25%, #1f2226 0 50%) 0 0 / 16px 16px; }

.aviso { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); transform: translateX(-50%); z-index: 60;
  background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 99px; font-size: 13px; font-weight: 600; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(100%, 340px); display: grid; gap: 12px; }
.login h1 { font: 600 16px var(--mono); display: flex; gap: 8px; align-items: center; margin: 0 0 8px; }
.login h1 i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.login input { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; }
.login input:focus { border-color: var(--accent); outline: none; }
.login .erro { color: var(--alerta); font-size: 13px; min-height: 1.2em; }

.aviso.novidade { border: 0; cursor: pointer; background: var(--accent); color: var(--accent-ink); }
