:root {
  color-scheme: dark;
  --bg: #0d0e12;
  --surface: #16181e;
  --surface-2: #1d2029;
  --surface-3: #252936;
  --line: #282c37;
  --line-strong: #3a4050;
  --text: #e8e9ee;
  --muted: #9096a6;
  --accent: #e5527c;
  --accent-ink: #fff;
  --ok: #3fb27f;
  --warn: #e0a33a;
  --bad: #ef5b5b;
  --radius: 12px;
  --radius-sm: 8px;
  --gutter: 16px;
  --accent-soft: rgba(229, 82, 124, .16);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .25);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: #8db8ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
h3 { font-size: .95rem; margin: 0 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.hint { color: var(--muted); margin: 0 0 12px; max-width: 70ch; }
.empty { color: var(--muted); padding: 24px 0; }
.count { color: var(--muted); font-weight: 400; font-size: .9em; }

/* ---------- layout ---------- */
header.top {
  display: flex; align-items: center; gap: 20px; padding: 10px var(--gutter);
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 800; letter-spacing: .02em; color: var(--accent); }
header.top nav { display: flex; gap: 4px; flex: 1; }
header.top nav a { padding: 6px 12px; border-radius: 8px; color: var(--text); }
header.top nav a.on { background: var(--surface-2); }
header.top nav a:hover { text-decoration: none; background: var(--surface-2); }
main { max-width: 1100px; margin: 0 auto; padding: 20px var(--gutter) 60px; }
main.wide { max-width: 1400px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
section { margin-bottom: 28px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: rgba(63,178,127,.12); border-color: rgba(63,178,127,.4); }
.flash.err { background: rgba(239,91,91,.12); border-color: rgba(239,91,91,.45); }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--text); border-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .9em; }
.filters a.on { color: var(--text); border-color: var(--accent); }
.filters a:hover { text-decoration: none; color: var(--text); }

/* ---------- forms ---------- */
label { display: block; font-size: .85rem; color: var(--muted); }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; margin-top: 4px; padding: 8px 10px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; font: inherit; min-height: 38px;
}
input[type=file] { margin-top: 4px; width: 100%; color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
button, .btn {
  font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); cursor: pointer; min-height: 38px;
}
button:hover:not(:disabled) { border-color: #444a58; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover:not(:disabled) { filter: brightness(1.08); border-color: var(--accent); }
button.danger { color: var(--bad); }
button.link { background: none; border: none; padding: 4px 6px; min-height: 0; color: #8db8ff; }
button.link.danger { color: var(--bad); }
button.small { padding: 4px 8px; min-height: 30px; font-size: .85rem; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.small { gap: 8px; margin: 8px 0; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input[type=text], .inline select { width: auto; margin-top: 0; }
.inline input.grow { flex: 1 1 220px; }
.check { display: inline-flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }
.check input { width: auto; margin: 0; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.grid-form .span2 { grid-column: 1 / -1; }

.login { max-width: 360px; margin: 12vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.login h1 { color: var(--accent); margin-bottom: 16px; }

/* ---------- cards ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cards.photos { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
/* Uma pessoa/item por bloco na aba Materiais, em ordem alfabética. */
.group-head { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.group-head h3 { margin: 0; font-size: 1.05rem; }
.group-head a { font-size: .85rem; margin-left: auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card.is-blocked, .row.is-blocked { opacity: .6; }
.card .thumb { display: block; aspect-ratio: 9 / 16; max-height: 300px; background: #000; overflow: hidden; width: 100%; }
.card.video .thumb { aspect-ratio: 16 / 9; max-height: none; }
.card.video { flex-direction: row; }
.card.video .thumb { width: 90px; aspect-ratio: 9 / 16; flex: none; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .ph { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .8rem; }
.card .body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card .title { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .85rem; }
details summary { cursor: pointer; color: #8db8ff; font-size: .9rem; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; border: 1px solid var(--line); background: var(--surface-2); }
.badge.warn { border-color: rgba(224,163,58,.5); }
.badge.bad { color: var(--bad); border-color: rgba(239,91,91,.5); }
.badge.st-approved, .badge.st-published { color: var(--ok); border-color: rgba(63,178,127,.5); }
.badge.st-rendering { color: var(--warn); border-color: rgba(224,163,58,.5); }
.badge.st-rejected { color: var(--bad); border-color: rgba(239,91,91,.5); }
/* O atributo hidden perde para um display definido pela classe (.panel é flex); isto o faz valer. */
[hidden] { display: none !important; }
/* Signo: a cor da borda é a do elemento (fogo, terra, ar, água). */
.badge.sign { font-size: .8rem; }
.badge.el-fire { color: #ff9a6c; border-color: rgba(255,154,108,.5); }
.badge.el-earth { color: #9cc27a; border-color: rgba(156,194,122,.5); }
.badge.el-air { color: #e8d98a; border-color: rgba(232,217,138,.5); }
.badge.el-water { color: #7dbdf0; border-color: rgba(125,189,240,.5); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .75rem; background: var(--surface-2); color: var(--muted); }

.rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rows .row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rows .row:last-child { border-bottom: none; }
.rows audio { display: block; margin-top: 6px; max-width: 100%; }

/* ---------- editor ---------- */
.ed { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.ed-main, .ed-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ed-side { position: sticky; top: 64px; max-height: calc(100vh - 76px); overflow-y: auto; } /* mais alta que a janela: rola por dentro */
.ed-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.ed-top .title-input { flex: 1 1 260px; font-size: 1.15rem; font-weight: 600; margin: 0; }
.savestate { font-size: .85rem; color: var(--muted); min-width: 90px; }
.savestate.err { color: var(--bad); }
.fieldrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pick { display: flex; align-items: center; gap: 10px; }
.pick .mini { width: 44px; height: 78px; border-radius: 6px; background: #000 center/cover no-repeat; flex: none; border: 1px solid var(--line); }
.pick .mini.empty-mini { display: grid; place-items: center; font-size: .65rem; color: var(--muted); background: var(--surface-2); text-align: center; }

.slides { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.slide { display: grid; grid-template-columns: 22px 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.slide.drag-over { border-color: var(--accent); }
.slide.dragging { opacity: .4; }
.slide .grip { cursor: grab; color: var(--muted); text-align: center; user-select: none; }
.slide .num { position: relative; }
.slide .thumbimg { width: 44px; height: 78px; border-radius: 6px; background: #000 center/cover no-repeat; border: 1px solid var(--line); }
.slide .info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.slide .info .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slide .controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.slide .controls input[type=number] { width: 84px; margin-top: 0; }
.slide .controls select { width: auto; margin-top: 0; }
.slide .actions { display: flex; gap: 4px; }

.player { background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 9 / 16; max-height: 70vh; margin: 0 auto; width: min(100%, calc(70vh * 9 / 16)); display: grid; place-items: center; }
.player video { width: 100%; height: 100%; background: #000; }
.player .ph { color: var(--muted); padding: 20px; text-align: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: none; border-radius: 0; background: var(--surface-2); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.issues li { padding: 6px 10px; border-radius: 6px; font-size: .88rem; border-left: 3px solid; background: var(--surface-2); }
.issues li.error { border-color: var(--bad); }
.issues li.warn { border-color: var(--warn); }
.issues li.ok { border-color: var(--ok); }
.jobline { font-size: .88rem; color: var(--muted); }
.jobline.err { color: var(--bad); }
.comp { font-size: .88rem; display: flex; flex-direction: column; gap: 4px; }

/* picker modal */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); width: min(960px, 100%); max-height: 90vh; display: flex; flex-direction: column; }
.modal header { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; flex: 1; }
.modal .filter { padding: 10px 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.modal .filter select, .modal .filter input { width: auto; margin: 0; flex: 1 1 180px; }
.modal .grid { padding: 0 14px 14px; overflow: auto; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.tile { position: relative; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #000; aspect-ratio: 9 / 16; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile:hover:not(:disabled) { border-color: var(--accent); }
.tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: .72rem; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.tile.used { opacity: .35; }

.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 8px; z-index: 60; max-width: 90vw; }
.toast.err { border-color: var(--bad); }

@media (max-width: 960px) {
  .ed { grid-template-columns: 1fr; }
  .ed-side { position: static; order: -1; max-height: none; overflow: visible; }
  .card.video { flex-direction: row; }
}
@media (max-width: 560px) {
  .slide { grid-template-columns: 22px 44px minmax(0, 1fr); }
  .slide .actions { grid-column: 1 / -1; justify-content: flex-end; }
  header.top { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ficha da pessoa (Biblioteca · Pessoas e itens) */
.profile { flex: 1 1 100%; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.profile .facts { display: flex; gap: 4px 14px; flex-wrap: wrap; align-items: center; }
.profile summary { cursor: pointer; color: var(--muted); width: max-content; }
.profile details[open] > summary { margin-bottom: 10px; }
.profile details > * + * { margin-top: 12px; }
.cands { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

/* Imagens candidatas: o que se decide é a foto inteira, então não corta. */
.cands-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.card.cand .thumb { position: relative; max-height: 260px; }
.card.cand .thumb img { object-fit: contain; }
.card.cand .thumb .ph { position: absolute; inset: auto 6px 6px 6px; height: auto; z-index: 1; background: rgba(0,0,0,.65); padding: 2px 6px; border-radius: 6px; }
.card.cand .title-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; max-width: 100%; vertical-align: bottom; }
.card.cand .clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.cand .note { font-size: .8rem; }
.bar { position: sticky; top: 0; z-index: 2; background: var(--bg, var(--surface)); padding: 8px 0; align-items: center; }

/* Página da extensão */
.steps { padding-left: 20px; margin: 6px 0 14px; }
.steps li { margin: 5px 0; }
.panel h3 { margin: 16px 0 6px; font-size: 1rem; }
.panel h3:first-child { margin-top: 0; }
.panel .inline input[readonly] { flex: 1 1 280px; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }

/* Caixa de filtro por palavras acima das listas */
.filterbar { margin: 8px 0 12px; }
.filterbar input[type=search] { flex: 1 1 320px; width: auto; margin-top: 0; }

/* ======================================================================
   Polimento visual: campos, botões, abas, cartões, estados vazios.
   Fica no fim para valer sobre as regras acima sem mexer nelas.
   ====================================================================== */
body { background: radial-gradient(1100px 420px at 50% -180px, rgba(229, 82, 124, .08), transparent 70%), var(--bg); background-attachment: fixed; min-height: 100vh; }
::selection { background: rgba(229, 82, 124, .35); }
html { scrollbar-color: #343845 transparent; }
h1, h2 { letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 700; }
a { transition: color .15s; }

/* topo */
header.top { background: rgba(22, 24, 30, .8); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand::before {
  content: ""; width: 20px; height: 20px; border-radius: 6px; flex: none;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 1.5v9M1.5 6h9' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}
header.top nav a { color: var(--muted); font-weight: 500; transition: color .15s, background .15s; }
header.top nav a.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
header.top nav a:hover { color: var(--text); }

/* campos */
input, select, textarea, button { transition: border-color .15s, box-shadow .15s, background-color .15s; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea { border-color: var(--line); }
input[type=text]:hover, input[type=url]:hover, input[type=email]:hover, input[type=password]:hover, input[type=number]:hover, input[type=search]:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input[type=text]:focus, input[type=url]:focus, input[type=email]:focus, input[type=password]:focus, input[type=number]:focus, input[type=search]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: #6b7182; }
input[readonly] { color: var(--muted); }
input[type=search] {
  -webkit-appearance: none; appearance: none; padding-left: 38px;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%239096a6' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='9' cy='9' r='5.5'/%3E%3Cpath d='m13.5 13.5 3.5 3.5'/%3E%3C/svg%3E") 12px 50% / 16px no-repeat;
}
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; height: 14px; width: 14px; cursor: pointer; opacity: .6;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' stroke='%23b7bcc9' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m3 3 8 8M11 3l-8 8'/%3E%3C/svg%3E") center / 14px no-repeat; }
input[type=search]::-webkit-search-cancel-button:hover { opacity: 1; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%239096a6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
}
select option { background: var(--surface-2); color: var(--text); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
.check { cursor: pointer; color: var(--text); font-size: .9rem; }
input[type=file] { padding: 6px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
input[type=file]:hover { border-color: var(--accent); }
input[type=file]::file-selector-button {
  font: inherit; font-size: .88rem; margin-right: 12px; padding: 6px 12px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface-3); color: var(--text);
}
label { font-weight: 500; }

/* botões */
button, .btn { transition: background-color .15s, border-color .15s, transform .06s, box-shadow .15s, filter .15s; font-weight: 500; }
button:where(:not(.primary, .on, .tile, .link)):hover:not(:disabled) { background: var(--surface-3); border-color: var(--line-strong); }
button:active:not(:disabled) { transform: translateY(1px); }
button.primary { background: linear-gradient(180deg, #ee5f89, var(--accent)); box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 4px 14px rgba(229, 82, 124, .28); font-weight: 600; }
button.primary:hover:not(:disabled) { background: linear-gradient(180deg, #f2688f, #ea5880); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 18px rgba(229, 82, 124, .38); filter: none; }
button.danger:hover:not(:disabled) { border-color: rgba(239, 91, 91, .5); }
button.link { transition: color .15s; }
button.link:hover:not(:disabled) { background: none; text-decoration: underline; }
a.btn { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; }

/* abas e filtros */
.tabs { gap: 2px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { white-space: nowrap; padding: 10px 14px; font-weight: 500; transition: color .15s, border-color .15s; }
.tabs a:not(.on):hover { border-color: var(--line-strong); }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--surface-2); font-size: .72rem; line-height: 18px; text-align: center; color: var(--muted); }
.tabs a.on .count { background: var(--accent-soft); color: #ffb3c9; }
.filters a { transition: color .15s, border-color .15s, background .15s; }
.filters a.on { background: var(--accent-soft); border-color: rgba(229, 82, 124, .6); }

/* caixas e cabeçalhos de seção */
.panel { background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 55%), var(--surface); box-shadow: var(--shadow); }
.panel > h2:first-child { margin-bottom: 4px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; margin: 0 0 14px; }
.section-head h2 { margin: 0; }
.section-head .filterbar { margin: 0; flex: 1 1 340px; max-width: 560px; }
.filterbar { display: flex; gap: 8px; align-items: center; margin: 8px 0 14px; }
.filterbar input[type=search] { flex: 1 1 220px; min-width: 0; }
.filterbar a { white-space: nowrap; font-size: .88rem; }
.crumb { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--muted); font-size: .9rem; }
.crumb:hover { color: var(--text); text-decoration: none; }
.pagetitle { font-size: 1.6rem; font-weight: 800; margin: 0 0 14px; letter-spacing: -.02em; }

/* avisos */
.flash { display: flex; gap: 10px; align-items: flex-start; border-left-width: 3px; box-shadow: var(--shadow); }
.flash.ok { border-left-color: var(--ok); }
.flash.err { border-left-color: var(--bad); }

/* cartões */
.card { transition: transform .18s var(--ease), border-color .18s, box-shadow .18s; }
.card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 12px 30px rgba(0, 0, 0, .38); }
.card .thumb img { transition: transform .4s var(--ease); }
.card:hover .thumb img { transform: scale(1.035); }
.card .body { padding: 12px; gap: 7px; }
.badge, .chip { line-height: 1.5; }
.chip { background: var(--surface-3); }
.badge.st-approved { background: rgba(63, 178, 127, .1); }
.badge.warn { background: rgba(224, 163, 58, .1); }
.badge.bad { background: rgba(239, 91, 91, .1); }
/* setinha própria no lugar do triângulo azul do navegador */
details > summary { list-style: none; transition: color .15s; }
details > summary::-webkit-details-marker { display: none; }
details:not(.fold) > summary::before { content: "›"; display: inline-block; width: 12px; margin-right: 4px; font-size: 1.15rem; line-height: 1; transition: transform .15s; }
details[open]:not(.fold) > summary::before { transform: rotate(90deg); }
details summary:hover { color: #b6d1ff; }

/* estados vazios */
.empty { text-align: center; padding: 44px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255, 255, 255, .015); }
.empty::before {
  content: ""; display: block; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 12px;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239096a6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='4.5' width='17' height='15' rx='2.5'/%3E%3Ccircle cx='9' cy='10' r='1.6'/%3E%3Cpath d='m4 17.5 4.5-4.5 3.5 3.5 3-3 5 4.5'/%3E%3C/svg%3E") center / 22px no-repeat;
}

/* login */
.login { box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.login h1 { display: flex; align-items: center; gap: 10px; font-size: 1.4rem; }
.login h1::before {
  content: ""; width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 1.5v9M1.5 6h9' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}

/* ---------- pessoas e itens ---------- */
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.person {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 16px; row-gap: 6px; align-items: start;
  padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .18s, box-shadow .18s;
}
.person:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.person.is-blocked { opacity: .6; }
.avatar {
  grid-row: 1 / span 4; width: 76px; height: 100px; border-radius: 10px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--surface-3), var(--surface-2)); border: 1px solid var(--line); color: var(--muted); font-weight: 700; font-size: 1.4rem; letter-spacing: .02em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person-top { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; min-width: 0; }
.person-name { font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.person-links { display: flex; gap: 2px 14px; flex-wrap: wrap; align-items: center; font-size: .88rem; color: var(--muted); }
.person .profile { grid-column: 2; gap: 8px; }
.person .profile .facts { gap: 6px 12px; color: var(--text); }
.person .profile .facts b { color: var(--muted); font-weight: 500; margin-right: 2px; }
.person details { grid-column: 2; }
.person details > summary { padding: 2px 0; color: var(--muted); font-size: .88rem; }
.person details > summary:hover { color: var(--text); }
.person .edit { margin-top: -4px; }
.person .edit form { padding: 10px 0 2px; }
.person .profile .facts > span:not(.badge):not(:first-child) { color: #c3c7d3; }

/* ---------- imagens candidatas ---------- */
.thumbwrap { position: relative; }
.pickbox {
  position: absolute; top: 8px; left: 8px; z-index: 3; width: 28px; height: 28px; margin: 0; border-radius: 8px; cursor: pointer;
  display: grid; place-items: center; background: rgba(10, 11, 14, .62); border: 1.5px solid rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: background .12s, border-color .12s;
}
.pickbox:hover { border-color: #fff; }
.pickbox input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pickbox::after { content: ""; width: 13px; height: 7px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: translateY(-1px) rotate(-45deg); opacity: 0; transition: opacity .1s; }
.pickbox:has(input:checked) { background: var(--accent); border-color: var(--accent); }
.pickbox:has(input:checked)::after { opacity: 1; }
.pickbox:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.card.cand:has(.pickbox input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.card.cand .thumb { background: var(--surface-2); }
.card.cand .title-line { font-weight: 600; }
.cand-links { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .85rem; }
.cand-by { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .82rem; color: var(--muted); }
.actionbar {
  position: sticky; top: 56px; z-index: 5; align-items: center; gap: 8px 12px; padding: 10px 12px; margin-bottom: 14px;
  background: rgba(22, 24, 30, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.actionbar .selcount { color: var(--muted); font-size: .9rem; min-width: 96px; }
.actionbar .selcount b { color: var(--text); }
.actionbar .hint { margin: 0; font-size: .85rem; }

/* ---------- fotos ---------- */
details.fold { padding: 0; margin-bottom: 28px; }
details.fold > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; cursor: pointer; color: var(--text); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; }
details.fold > summary .fold-hint { flex: 1; color: var(--muted); font-size: .88rem; font-weight: 400; }
details.fold > summary::after {
  content: ""; width: 14px; height: 14px; flex: none; transition: transform .2s var(--ease);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%239096a6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E") center / 14px no-repeat;
}
details.fold[open] > summary::after { transform: rotate(180deg); }
details.fold > .fold-body { padding: 0 16px 16px; }

/* ---------- telas pequenas ---------- */
@media (max-width: 640px) {
  .person { grid-template-columns: 56px minmax(0, 1fr); column-gap: 12px; padding: 12px; }
  .avatar { width: 56px; height: 76px; font-size: 1.1rem; }
  .section-head .filterbar { flex-basis: 100%; max-width: none; }
  .actionbar { top: 52px; }
  .pagetitle { font-size: 1.35rem; }
}

/* página da extensão: passos numerados */
.stepwrap { counter-reset: step; }
.stepwrap h3.stepnum { display: flex; align-items: center; gap: 10px; margin: 22px 0 8px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 1.02rem; color: var(--text); text-transform: none; letter-spacing: 0; }
.stepwrap h3.stepnum:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.stepwrap h3.stepnum::before {
  counter-increment: step; content: counter(step); flex: none; display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 999px; background: var(--accent-soft); color: #ffb3c9; font-size: .85rem; font-weight: 700; border: 1px solid rgba(229, 82, 124, .45);
}

@media (max-width: 640px) {
  .cards.photos, .cands-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* ---------- aba Vozes: um bloco por voz, filtro por idioma ---------- */
.voice-group { margin-bottom: 8px; }
/* Ganchos | CTAs: sub-abas em segmento, menores que as abas da biblioteca. */
.subtabs { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.subtabs a { padding: 6px 16px; border-radius: 8px; color: var(--muted); font-weight: 500; white-space: nowrap; transition: color .15s, background .15s; }
.subtabs a:hover { text-decoration: none; color: var(--text); }
.subtabs a.on { color: var(--text); background: var(--accent-soft); }
.subtabs .count { margin-left: 4px; }
.voice-group .hint { margin: 10px 0 0; font-size: .88rem; }
.chip.lang-en { color: #7dbdf0; background: rgba(125, 189, 240, .12); }
.chip.lang-pt { color: #9cc27a; background: rgba(156, 194, 122, .12); }
.filters a .count { margin-left: 4px; }

/* ---------- resultados: posts, números e histórico ---------- */
input[type=datetime-local], input[type=date] {
  width: 100%; margin-top: 4px; padding: 8px 10px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; font: inherit; min-height: 38px; color-scheme: dark;
}
.inline input[type=date] { width: auto; margin-top: 0; }
a.btn { display: inline-block; text-decoration: none; line-height: 1.4; white-space: nowrap; align-self: center; }
a.btn:hover { text-decoration: none; border-color: var(--line-strong); background: var(--surface-3); }
.rows.posts .row { align-items: center; }
.nums { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .9rem; color: var(--muted); }
.nums b { color: var(--text); font-size: 1rem; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.grid { width: 100%; border-collapse: collapse; font-size: .88rem; white-space: nowrap; }
table.grid th, table.grid td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--line); }
table.grid th:first-child, table.grid td:first-child, table.grid th:nth-child(2), table.grid td:nth-child(2) { text-align: left; }
table.grid th { color: var(--muted); font-weight: 500; font-size: .8rem; }
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid td form { display: inline; }
.cards.minis { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin-top: 8px; }
.cards.minis .thumb.tall { max-height: 160px; }

/* ---------- uso dos arquivos: contagem no cartão e janela de detalhe (duplo clique) ---------- */
.usagebar { margin-top: 10px; align-items: center; }
.usagebar select, .usagebar input[type=date] { width: auto; min-width: 140px; margin-top: 0; }
.usagebar > label:first-child { margin: 0; }
button.chip.usebtn { border: none; cursor: pointer; font: inherit; font-size: .75rem; min-height: 0; padding: 1px 8px; }
button.chip.usebtn:hover { background: var(--surface-3); color: var(--text); }
button.chip.usebtn.used { color: var(--text); background: var(--accent-soft); }
.card.photo[data-asset] .thumb { cursor: zoom-in; }
dialog.usage-dialog {
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0; width: min(680px, 94vw); max-height: 88vh; overflow: auto; box-shadow: var(--shadow);
}
dialog.usage-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.usage-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.usage-head h2 { margin: 0; flex: 1; font-size: 1.05rem; }
.usage-body { display: flex; gap: 16px; padding: 16px; align-items: flex-start; }
.usage-img { flex: none; width: 150px; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.usage-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.usage-info { flex: 1; min-width: 0; gap: 8px; font-size: .92rem; }
.usage-info h3 { margin: 10px 0 2px; }
.usage-info p { margin: 0; }
.usage-sum { font-size: 1rem; }
.usage-note { font-size: .8rem; }
.usage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.usage-row { padding: 5px 8px; border-radius: 6px; border-left: 3px solid transparent; opacity: .6; }
.usage-row.in { opacity: 1; background: var(--surface-2); border-left-color: var(--accent); }
.usage-nets { display: flex; flex-direction: column; gap: 6px; }
.usage-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
button.usage-tab { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); min-height: 0; padding: 6px 12px; margin-bottom: -1px; font-size: .88rem; }
button.usage-tab:hover:not(:disabled) { background: none; color: var(--text); border-color: transparent; }
button.usage-tab.on { color: var(--text); border-bottom-color: var(--accent); }
button.usage-tab.has .count { color: var(--accent); font-weight: 600; }
.usage-panel { min-height: 40px; padding-top: 4px; }
@media (max-width: 560px) { .usage-body { flex-direction: column; } .usage-img { width: 110px; } }
.filterbar { flex-wrap: wrap; }
.filterbar .usagebar { flex: 1 1 100%; margin-top: 2px; }

/* ---------- lista de vídeos: cartão largo, sem espremer o conteúdo ---------- */
/* Antes, com a conta de destino no cartão, o corpo ficava com ~170px e o título, o seletor e o botão se atropelavam.
   Agora cada cartão tem no mínimo 360px (uma coluna no celular) e o miolo respira: título, selos, conta, data. */
.cards.videos { grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 16px; }
.card.video .thumb { width: 104px; }
.card.video .body { flex: 1 1 0; padding: 14px 16px; gap: 10px; justify-content: flex-start; }
.card.video .title {
  white-space: normal; overflow-wrap: anywhere; line-height: 1.3; font-size: 1rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card.video .meta { gap: 6px 8px; }
.card.video .when { margin-top: auto; padding-top: 2px; font-size: .8rem; }
.dest { display: flex; gap: 8px; align-items: center; margin: 0; }
.dest select { flex: 1 1 0; min-width: 0; width: auto; margin-top: 0; min-height: 36px; padding-top: 6px; padding-bottom: 6px; text-overflow: ellipsis; }
.dest select.empty-pick { border-color: rgba(224, 163, 58, .55); color: var(--warn); }
.dest button { flex: none; min-height: 36px; }
.filters.accountfilter { margin-bottom: 16px; }

/* ---------- Conexões: um cartão por rede, com o estado testado ---------- */
.conn-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.conn-top h2 { margin: 0; }
.conn-meter { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.conn-meter strong { margin-left: 6px; font-weight: 600; }
.conn-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); flex: none; }
.conn-dot.is-connected { background: var(--ok); }
.conn-dot.is-error { background: var(--bad); }
.conn-dot.is-saved { background: var(--warn); }
.conn-account.is-open { border-color: var(--line-strong); }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 14px; margin-top: 14px; align-items: start; }
.conn-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius); }
.conn-card.is-connected { border-left-color: var(--ok); background: linear-gradient(90deg, rgba(63, 178, 127, .07), transparent 40%), var(--surface-2); }
.conn-card.is-error { border-left-color: var(--bad); background: linear-gradient(90deg, rgba(239, 91, 91, .07), transparent 40%), var(--surface-2); }
.conn-card.is-saved { border-left-color: var(--warn); }
.conn-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.conn-head h3 { margin: 0; color: var(--text); font-size: 1rem; text-transform: none; letter-spacing: 0; }
.conn-pill { padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; border: 1px solid var(--line-strong); color: var(--muted); }
.conn-pill.is-connected { color: var(--ok); border-color: rgba(63, 178, 127, .55); background: rgba(63, 178, 127, .12); }
.conn-pill.is-error { color: var(--bad); border-color: rgba(239, 91, 91, .55); background: rgba(239, 91, 91, .12); }
.conn-pill.is-saved { color: var(--warn); border-color: rgba(224, 163, 58, .55); background: rgba(224, 163, 58, .1); }
.conn-who { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 1.05rem; overflow-wrap: anywhere; }
.conn-who a { font-size: .85rem; }
.conn-when { margin: 0; font-size: .85rem; }
.conn-msg { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); font-size: .9rem; overflow-wrap: anywhere; }
.conn-msg.bad { color: #ffb4b4; background: rgba(239, 91, 91, .1); border: 1px solid rgba(239, 91, 91, .35); }
.conn-msg.warn { color: #f0cd87; background: rgba(224, 163, 58, .1); border: 1px solid rgba(224, 163, 58, .35); }
.conn-card .hint { margin: 0; font-size: .88rem; }
.conn-card .stack.small { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.conn-card input[type=password] { letter-spacing: .08em; }
.conn-card input[type=password]::placeholder { letter-spacing: 0; }
.conn-actions { gap: 8px; }
a.btn.primary { background: linear-gradient(180deg, #ee5f89, var(--accent)); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
a.btn.primary:hover { filter: brightness(1.08); background: linear-gradient(180deg, #ee5f89, var(--accent)); }
.redirect .copyrow { display: flex; gap: 8px; margin-top: 4px; }
.redirect .copyrow input { flex: 1 1 auto; min-width: 0; margin-top: 0; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.guide { padding-top: 4px; border-top: 1px dashed var(--line); }
.guide > summary { margin-top: 8px; }
.guide ol { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; color: #c3c7d3; }
.guide code { font-size: .85em; padding: 1px 5px; border-radius: 4px; background: var(--surface-3); color: var(--text); overflow-wrap: anywhere; }
.guide p.muted { margin: 10px 0 0; font-size: .85rem; }
.appform > * + * { margin-top: 10px; }
/* Página Contas: um cartão por conta, com o estado das quatro redes; a conta se abre para conectar. */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; margin: 14px 0 22px; }
.acc-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.acc-card h2 { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.acc-card h2 a { color: var(--text); text-decoration: none; }
.acc-card h2 a:hover { text-decoration: underline; }
.acc-card .connpills { flex: 0 0 auto; }
.acc-card .acc-sum { margin: 0; font-size: .9rem; }
.acc-card .btn { margin-top: auto; align-self: flex-start; }
.crumb { margin: 0 0 8px; font-size: .9rem; }
.connpills { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; flex-wrap: wrap; flex: 1 1 auto; font-size: .9rem; }
.connpill { display: inline-flex; align-items: center; gap: 6px; }
.connpill.is-connected { color: var(--ok); }
.connpill.is-error { color: var(--bad); }
.connpill.is-saved { color: var(--warn); }

/* ---------- Sons em alta: ouvir a prévia e favoritar com a estrela ---------- */
.soundname .play { display: inline-grid; place-items: center; vertical-align: middle; width: 26px; height: 26px; min-height: 0; padding: 0; margin-right: 8px; border-radius: 50%; font-size: .65rem; line-height: 1; color: var(--text); }
.soundname .play::before { content: "\25B6\FE0E"; padding-left: 2px; }
.soundname .play.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.soundname .play.on::before { content: "\275A\275A"; padding-left: 0; letter-spacing: -1px; }
.soundname .play.none { border: 1px dashed var(--line); background: none; opacity: .5; cursor: help; }
.soundname .play.none::before { content: ""; }
.seekrow { display: flex; align-items: center; gap: 10px; margin: 6px 0 0 34px; }
.seekrow .seek { width: 220px; max-width: 40vw; margin: 0; padding: 0; accent-color: var(--accent); background: none; border: none; }
.seekrow .clock { font-size: .78rem; font-variant-numeric: tabular-nums; }
.playerr { margin: 6px 0 0 34px; font-size: .8rem; white-space: normal; max-width: 46ch; }
button.star { background: none; border: none; min-height: 0; padding: 2px 8px; font-size: 1.3rem; line-height: 1; color: var(--muted); cursor: pointer; }
button.star:hover:not(:disabled) { background: none; color: var(--warn); }
button.star.on { color: var(--warn); }

/* ---------- Pedidos prontos (Vídeos) e copiar a lista de sons (Músicas) ---------- */
.orderbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin: 0 0 14px; }
.orderbar label { min-width: 220px; }
table.orders td { white-space: normal; vertical-align: top; }
table.orders td.kw { white-space: nowrap; text-align: left; }
table.orders td.kw code { font-size: .85em; padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--text); }
table.orders td:nth-child(3) { max-width: 56ch; text-align: left; }
table.orders td:last-child { text-align: right; white-space: nowrap; }
.copypreview { margin: 12px 0 0; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .82rem; color: var(--muted); white-space: pre-wrap; user-select: all; }
.soundhead { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 0 8px; }
.soundhead h3 { margin: 0; }

/* ---------- Editor: simular o vídeo com o som ---------- */
.soundsim { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.soundsim h3 { margin: 0 0 8px; }
.soundsim .hint { margin: 8px 0 0; font-size: .8rem; }
.soundsim #sim-status { margin: 8px 0 0; font-size: .85rem; }
.simrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.simrow label { flex: 1 1 100%; }
/* ajustes do começo: fechados por padrão (só para o caso de precisar) */
.simadjust { margin-top: 10px; }
.simadjust summary { font-size: .85rem; }
.simadjust .simrow { margin-top: 8px; }
.simadjust .simrow label { flex: 1 1 130px; }
.simadjust .simrow label .muted { display: block; margin-top: 4px; font-size: .75rem; }
.simadjust .simnote { margin: 8px 0 0; font-size: .75rem; }
.simrow select { width: 100%; text-overflow: ellipsis; }
.simrow input[type=number] { width: 100%; }
.simrow input[type=range] { width: 100%; padding: 0; margin-top: 10px; accent-color: var(--accent); background: none; border: none; }

/* ---------- Enviar pelas APIs (painel na página do vídeo) ---------- */
#publish textarea { width: 100%; min-height: 96px; }
#publish .inline.sends { gap: 10px; }
#publish .pub .conn-msg { margin: 6px 0 0; }
#publish .pub .inline { margin-top: 6px; }

/* ---------- Legenda da postagem (painel junto da simulação do vídeo) ---------- */
.postsim { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.postsim h3 { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.postsim textarea { width: 100%; min-height: 84px; }
.postsim .hint { font-size: .85rem; margin: 8px 0 0; }
.postsim .stack.small { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 0; }
.tagchips { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.tagchip { display: inline-flex; align-items: baseline; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .85rem; background: var(--surface-3); border: 1px solid var(--line-strong); }
.tagchip span { font-size: .72rem; color: var(--muted); }
.tagchip.tier-top { border-color: rgba(125, 189, 240, .55); }
.tagchip.tier-mid { border-color: rgba(224, 163, 58, .55); }
.tagchip.tier-bottom { border-color: rgba(63, 178, 127, .55); }
.postprev { margin-top: 10px; }
.postprev .precap { margin: 10px 0; }
.postprev .precap .meta { margin-bottom: 4px; }
.pubcaption { margin-top: 6px; }
.pubcaption textarea { width: 100%; margin: 6px 0; }

/* TikTok com som: escolher a faixa pelo nome e regular os volumes (painel "Enviar pelas APIs") */
.tiksound { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0; background: var(--surface-2); }
.tiksound legend { padding: 0 6px; font-weight: 600; }
.tiksound-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; }
.tiksound select[size] { width: 100%; }
.tiksound select option[hidden] { display: none; }
.tiksound-ids { font-size: .8rem; margin: 0; word-break: break-word; }
.tiksound-vols { display: grid; gap: 10px; }
.tiksound .volrow { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.tiksound .volrow input[type=range] { flex: 1 1 auto; min-width: 0; }
.tiksound .volrow input[type=number] { width: 4.5rem; }
.tiksound.is-draft .tiksound-grid { opacity: .5; }
.tiksound > label.check { margin-top: 10px; white-space: normal; align-items: flex-start; }
@media (max-width: 720px) { .tiksound-grid { grid-template-columns: 1fr; } }

.apimode { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px 10px; margin: 0; }
.apimode legend { padding: 0 6px; font-size: .85rem; color: var(--muted); }
.apimode label.check { white-space: normal; align-items: flex-start; margin: 4px 0; }
.apimode p { margin: 6px 0 0; font-size: .82rem; }

.pubsound { margin: 4px 0 0; font-size: .88rem; word-break: break-word; }
.pubrequest { margin-top: 6px; }
.pubrequest pre { margin: 6px 0; padding: 8px 10px; background: var(--surface-3); border-radius: var(--radius-sm); overflow-x: auto; font-size: .8rem; }

.soundfilter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.soundfilter input[type=search] { width: min(22rem, 100%); }
.soundid code { font-size: .78rem; }
