/* ============================================================
   FORMATADOR ABNT — visual próprio (claro, cor de papel)
   Toda a Área Acadêmica usa este tema: fundo de papel, folhas
   brancas, azul-marinho de destaque e títulos com serifa.
   O resto do site continua escuro.
   ============================================================ */

body.abnt-tema {
  --bg: #f4f2ec;
  --bg-dark: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #f0ede5;
  --surface-hover: #ebe8df;
  --field-bg: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.95);
  --border: #dedad0;
  --border-hover: #c9c4b7;
  --glass-border: #dedad0;
  --glass-border-hover: #c9c4b7;
  --primary: #1f3f6e;
  --primary-hover: #16304f;
  --primary-contrast: #ffffff;
  --primary-light: rgba(31, 63, 110, 0.08);
  --primary-border: rgba(31, 63, 110, 0.3);
  --accent: #1f3f6e;
  --accent-hover: #16304f;
  --accent-soft: rgba(31, 63, 110, 0.07);
  --ab-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  /* Identidade do "Acadêmico": azul-tinta (topo, rodapé) + verde "aprovado" no lugar do antigo dourado */
  --ac-tinta: #0e1f3d;
  --ac-tinta-2: #17305a;
  --ac-verde: #34d399;
  --ab-ouro: #0d8a66;
  --secondary: #ece9e1;
  --secondary-hover: #e3dfd5;
  --text: #1c1b18;
  --text-main: #1c1b18;
  --text-body: #2d2b27;
  --text-secondary: #57534b;
  --text-muted: #7d786e;
  --text-subtle: #a19c90;
  --success: #15803d;
  --success-soft: rgba(21, 128, 61, 0.1);
  --danger: #c2410c;
  --danger-soft: rgba(194, 65, 12, 0.08);
  --warning: #b45309;
  --warning-soft: rgba(180, 83, 9, 0.1);
  --gradient-accent: linear-gradient(135deg, #1c1b18, #57534b);
  --shadow-sm: 0 1px 2px rgba(40, 35, 20, 0.08);
  --shadow-md: 0 4px 14px rgba(40, 35, 20, 0.1);
  --shadow-lg: 0 14px 36px rgba(40, 35, 20, 0.16);
  --card-shadow-hover: 0 8px 24px rgba(40, 35, 20, 0.12);
  --ab-papel: #e7e4dc;
  --ab-tit: #4338ca;
  --ab-cit: #b45309;
  --ab-item: #0f766e;
  --ab-fig: #7c3aed;
  color-scheme: light;
  background: var(--bg);
  color: var(--text-body);
}

body.abnt-tema .slim-header {
  background: rgba(244, 242, 236, 0.94);
}
body.abnt-tema .tool-title { color: var(--text-secondary); }
body.abnt-tema .app-footer,
body.abnt-tema .footer-rich { background: #ebe8e0; }
body.abnt-tema .chat-fab { border-color: rgba(0, 0, 0, 0.08); }
body.abnt-tema .toast { background: #26241f; color: #f7f5f0; border-color: #26241f; }

.ab-main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 1.4rem 1.5rem 2.5rem;
}

/* ---------- topo (cara de folha de rosto: selo, título com serifa, normas numa linha) ---------- */
.ab-hero { text-align: center; margin: 0.4rem auto 1rem; max-width: 900px; }
.ac-sobre {
  display: inline-flex; align-items: center; gap: 0.6rem; margin-bottom: 0.55rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ab-ouro);
}
.ac-sobre::before, .ac-sobre::after { content: ''; width: 28px; height: 1px; background: currentColor; opacity: 0.6; }
.ab-hero h1 {
  font-family: var(--ab-serif);
  font-size: clamp(1.75rem, 3.2vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.ab-hero p { max-width: 720px; margin: 0 auto; color: var(--text-secondary); font-size: 0.98rem; line-height: 1.55; }
.ab-selos { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2rem 0; margin-top: 0.7rem; }
.ab-selos span { font-size: 0.76rem; font-weight: 600; color: var(--primary); letter-spacing: 0.01em; }
.ab-selos span + span::before { content: '·'; margin: 0 0.55rem; color: var(--text-subtle); font-weight: 700; }

/* Aviso em vermelho suave: curto, informa sem assustar */
.ab-alerta {
  max-width: 1100px; margin: 0 auto 1.1rem; display: flex; gap: 0.6rem; align-items: center;
  background: #fdf1ee; border: 1px solid #f3c9bf; border-radius: 10px; padding: 0.55rem 0.95rem;
}
.ab-alerta > .ico { width: 18px; height: 18px; flex: none; color: #d2573f; }
.ab-alerta p { margin: 0; font-size: 0.86rem; line-height: 1.45; color: var(--text-secondary); }
.ab-alerta b { color: #a83a24; }
.ab-alerta-mini {
  display: flex; gap: 0.6rem; align-items: flex-start; margin-top: 1.2rem;
  background: #fdf1ee; border: 1px solid #f3c9bf; border-radius: 10px; padding: 0.75rem 0.9rem;
  font-size: 0.84rem; line-height: 1.45; color: var(--text-secondary);
}
.ab-alerta-mini .ico { flex: none; width: 18px; height: 18px; color: #d2573f; margin-top: 0.1rem; }
.ab-alerta-mini b { color: #a83a24; }

/* ---------- duas colunas ---------- */
.ab-app {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(400px, 1.04fr);
  gap: 1.25rem;
  align-items: start;
}
.ab-esq { min-width: 0; }

/* ---------- abas ---------- */
.ab-abas {
  position: sticky; top: var(--header-height); z-index: 30;
  display: flex; gap: 0.3rem; padding: 0.55rem 0; margin-bottom: 0.4rem;
  background: var(--bg); overflow-x: auto; scrollbar-width: none;
}
.ab-abas::-webkit-scrollbar { display: none; }
.ab-abas button {
  flex: none; display: inline-flex; align-items: center; gap: 0.35rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
  border-radius: 999px; padding: 0.4rem 0.75rem 0.4rem 0.4rem; font: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ab-abas button .n {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--surface-2); color: var(--text-muted); font-size: 0.75rem; font-weight: 700;
}
.ab-abas button:hover { border-color: var(--border-hover); color: var(--text); }
.ab-abas button[aria-selected="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.ab-abas button[aria-selected="true"] .n { background: rgba(255, 255, 255, 0.18); color: #fff; }
.ab-cont:empty { display: none; }
.ab-cont {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-secondary);
}
.ab-cont.erro { background: #e4572e; color: #fff; }
.ab-cont.aviso { background: #f2b33d; color: #3b2a05; }
.ab-cont.ok { background: #22a35a; color: #fff; }

.ab-aba {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 1.15rem 1.25rem 1.3rem; box-shadow: var(--shadow-sm);
}
.ab-titulo-aba { margin-bottom: 1.1rem; }
.ab-titulo-aba h2 { font-family: var(--ab-serif); font-size: 1.35rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; margin-bottom: 0.2rem; }
.ab-titulo-aba p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; }
.ab-sub { font-size: 0.95rem; font-weight: 700; color: var(--text); margin: 1.5rem 0 0.7rem; }
.ab-sub span { color: var(--text-muted); font-weight: 500; }
.ab-rot { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.ab-rot small, .ab-campo label small { font-weight: 400; color: var(--text-muted); }

/* ---------- botões ---------- */
.ab-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  border-radius: 10px; padding: 0.62rem 1.05rem; font: inherit; font-size: 0.9rem; font-weight: 650;
  cursor: pointer; border: 1px solid transparent; transition: background 0.15s, border-color 0.15s, transform 0.1s;
  text-decoration: none; white-space: nowrap;
}
.ab-btn .ico { width: 17px; height: 17px; }
.ab-btn:active { transform: translateY(1px); }
.ab-btn:disabled { opacity: 0.55; cursor: wait; }
.ab-btn-pri { background: var(--primary); color: #fff; }
.ab-btn-pri:hover { background: var(--primary-hover); }
.ab-btn-sec { background: var(--surface); color: var(--text); border-color: var(--border); }
.ab-btn-sec:hover { border-color: var(--border-hover); background: var(--surface-2); }
.ab-btn-ia { background: linear-gradient(135deg, #7c3aed, #5b21b6); color: #fff; }
.ab-btn-ia:hover { filter: brightness(1.08); }
.ab-btn-p { padding: 0.45rem 0.75rem; font-size: 0.84rem; border-radius: 9px; }
.ab-btn-g { padding: 0.85rem 1.3rem; font-size: 1rem; border-radius: 12px; }
.ab-perigo { color: #b4371f; }
.ab-perigo:hover { background: #fdf1ee; border-color: #f3c9bf; }
.ab-link { background: none; border: 0; padding: 0; font: inherit; font-size: 0.8rem; color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.ab-icone {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.ab-icone:hover { color: var(--text); border-color: var(--border-hover); }
.ab-icone .ico { width: 17px; height: 17px; }
.ab-prox { display: flex; justify-content: space-between; gap: 0.6rem; margin-top: 1.5rem; flex-wrap: wrap; }
.ab-prox .ab-btn-pri:only-child { margin-left: auto; }

/* ---------- modelos ---------- */
.ab-modelos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; }
.ab-modelo {
  display: flex; flex-direction: column; gap: 0.35rem; text-align: left; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 13px; padding: 0.55rem 0.55rem 0.7rem;
  font: inherit; color: inherit; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.ab-modelo:hover { border-color: var(--border-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.ab-modelo[aria-checked="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.ab-modelo .mini {
  height: 112px; border-radius: 9px; background: var(--ab-papel); display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.ab-modelo .mini img { max-width: 100%; max-height: 100%; }
.ab-modelo b { font-size: 0.86rem; color: var(--text); line-height: 1.25; padding: 0 0.15rem; }
.ab-modelo small { font-size: 0.74rem; color: var(--text-muted); line-height: 1.35; padding: 0 0.15rem; }
.ab-modelo[aria-checked="true"] b::after { content: " ✓"; color: var(--primary); }

/* ---------- partes e chaves ---------- */
.ab-partes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.4rem 0.8rem; }
.ab-chave { display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; color: var(--text-body); cursor: pointer; padding: 0.3rem 0; line-height: 1.3; user-select: none; }
.ab-chave input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ab-chave span {
  flex: none; width: 34px; height: 20px; border-radius: 999px; background: #cfcabd; position: relative; transition: background 0.15s;
}
.ab-chave span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s;
}
.ab-chave input:checked + span { background: var(--primary); }
.ab-chave input:checked + span::after { transform: translateX(14px); }
.ab-chave input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.ab-chave.desligada { opacity: 0.5; }
.ab-chave-p { font-size: 0.8rem; gap: 0.4rem; }
.ab-chave-p span { width: 28px; height: 16px; }
.ab-chave-p span::after { width: 12px; height: 12px; }
.ab-chave-p input:checked + span::after { transform: translateX(12px); }

.ab-formato { display: grid; gap: 0.15rem; }
.ab-linha-op { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.45rem; }
.ab-linha-op .ab-rot { min-width: 9.5rem; }
.ab-seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.ab-seg button {
  border: 0; background: transparent; font: inherit; font-size: 0.83rem; font-weight: 600; color: var(--text-secondary);
  padding: 0.38rem 0.8rem; border-radius: 8px; cursor: pointer;
}
.ab-seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- campos ---------- */
.ab-grupo { border: 1px solid var(--border); border-radius: 13px; padding: 0.9rem 1rem 1rem; margin: 0 0 0.9rem; min-width: 0; }
.ab-grupo legend { font-size: 0.82rem; font-weight: 700; color: var(--text); padding: 0 0.4rem; text-transform: uppercase; letter-spacing: 0.04em; }
.ab-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem 0.8rem; }
.ab-campo { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.ab-campo.inteiro { grid-column: 1 / -1; }
.ab-chave.ab-campo { flex-direction: row; align-items: center; gap: 0.6rem; }
.ab-campo label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.ab-main input[type="text"], .ab-main input[type="url"], .ab-main input[type="date"], .ab-main input:not([type]),
.ab-main select, .ab-main textarea, .ab-modal input[type="text"], .ab-modal select, .ab-modal textarea {
  width: 100%; font: inherit; font-size: 0.92rem; color: var(--text); background: #fff;
  border: 1px solid var(--border); border-radius: 9px; padding: 0.55rem 0.7rem; line-height: 1.45; transition: border-color 0.15s, box-shadow 0.15s;
}
.ab-main textarea, .ab-modal textarea { resize: vertical; }
.ab-main input:focus, .ab-main select:focus, .ab-main textarea:focus, .ab-modal input:focus, .ab-modal select:focus, .ab-modal textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.ab-campo.destaque input, .ab-campo.destaque textarea { animation: ab-brilho 1.6s ease; }
@keyframes ab-brilho { 0%, 40% { box-shadow: 0 0 0 4px rgba(31, 63, 110, 0.3); border-color: var(--primary); } 100% { box-shadow: none; } }
.ab-logo { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.8rem; }
.ab-logo img { height: 38px; border-radius: 6px; border: 1px solid var(--border); background: #fff; }
.ab-ia { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.ab-ia small { color: var(--text-muted); font-size: 0.78rem; }
.ab-ia .ia-count { font-size: 0.75rem; color: var(--text-muted); }

/* ---------- editor ---------- */
.ab-acoes-texto { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.8rem; }
.ab-editor-caixa { border: 1px solid var(--border); border-radius: 14px; background: #fff; position: relative; }
.ab-barra {
  position: sticky; top: calc(var(--header-height) + 52px); z-index: 20;
  display: flex; flex-wrap: wrap; gap: 0.3rem 0.4rem; padding: 0.5rem 0.55rem;
  background: rgba(250, 249, 246, 0.97); border-bottom: 1px solid var(--border); border-radius: 14px 14px 0 0;
}
.ab-barra-g { display: flex; gap: 2px; background: var(--surface-2); border-radius: 9px; padding: 2px; }
.ab-barra button {
  border: 0; background: transparent; font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
  padding: 0.34rem 0.5rem; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap;
}
.ab-barra button:hover { background: var(--surface); color: var(--text); }
.ab-barra button.on { background: var(--text); color: #fff; }
.ab-barra button .ico { width: 15px; height: 15px; }
.ab-barra button:disabled { opacity: 0.4; }

.ab-editor {
  min-height: 420px; max-height: none; padding: 1.4rem 1.6rem 2.2rem 7.2rem; outline: none;
  font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.65; color: #1a1a1a;
  counter-reset: none; word-wrap: break-word; overflow-wrap: break-word; caret-color: var(--primary);
}
.ab-editor.times { font-family: "Times New Roman", Times, serif; font-size: 17px; }
.ab-editor > * { position: relative; margin: 0 0 0.45em; }
.ab-editor > p { text-indent: 2.2em; text-align: justify; }
.ab-editor > p.cit, .ab-editor > p.item { text-indent: 0; }
/* Etiqueta do tipo na margem */
.ab-editor > *::after {
  position: absolute; left: -6.6rem; top: 0.25em; width: 5.6rem; text-align: right;
  font-family: Inter, system-ui, sans-serif; font-size: 10.5px; font-weight: 650; letter-spacing: 0.02em;
  text-transform: uppercase; line-height: 1.3; text-indent: 0; font-style: normal; pointer-events: none;
}
.ab-editor > p.atual:not(.cit):not(.item)::after { content: "Parágrafo"; color: var(--text-subtle); }
.ab-editor > h1::after, .ab-editor > h2::after, .ab-editor > h3::after, .ab-editor > h4::after, .ab-editor > h5::after { color: var(--ab-tit); }
.ab-editor > h1::after { content: "Título 1"; }
.ab-editor > h2::after { content: "Título 2"; }
.ab-editor > h3::after { content: "Título 3"; }
.ab-editor > h4::after { content: "Título 4"; }
.ab-editor > h5::after { content: "Título 5"; }
.ab-editor > h1[data-esp="apendice"]::after { content: "Apêndice"; color: var(--ab-fig); }
.ab-editor > h1[data-esp="anexo"]::after { content: "Anexo"; color: var(--ab-fig); }
.ab-editor > h1[data-esp="glossario"]::after { content: "Glossário"; color: var(--ab-fig); }
.ab-editor > p.cit::after { content: "Citação longa"; color: var(--ab-cit); left: -6.6rem; }
.ab-editor > p.item::after { content: "Alínea"; color: var(--ab-item); }
.ab-editor > p.item[data-nivel="2"]::after { content: "Subalínea"; }
/* Faixa colorida na margem */
.ab-editor > h1, .ab-editor > h2, .ab-editor > h3, .ab-editor > h4, .ab-editor > h5, .ab-editor > p.cit, .ab-editor > p.item { box-shadow: -0.9rem 0 0 -0.75rem transparent; }
.ab-editor > *.atual { background: linear-gradient(90deg, rgba(67, 56, 202, 0.05), transparent 60%); border-radius: 4px; }

.ab-editor h1, .ab-editor h2, .ab-editor h3, .ab-editor h4, .ab-editor h5 {
  font-size: 1em; line-height: 1.45; margin: 1.05em 0 0.55em; color: #111; font-weight: 400; letter-spacing: 0;
}
.ab-editor h1 { font-weight: 700; text-transform: uppercase; }
.ab-editor h2 { text-transform: uppercase; }
.ab-editor h3 { font-weight: 700; }
.ab-editor h5 { font-style: italic; }
.ab-editor h1[data-esp] { text-align: center; }
.ab-editor h1::before, .ab-editor h2::before, .ab-editor h3::before, .ab-editor h4::before, .ab-editor h5::before {
  content: attr(data-num); color: var(--ab-tit); margin-right: 0.4em;
}
.ab-editor h1[data-num=""]::before, .ab-editor h2[data-num=""]::before, .ab-editor h3[data-num=""]::before, .ab-editor h4[data-num=""]::before, .ab-editor h5[data-num=""]::before { margin: 0; }
.ab-editor > p.cit { margin-left: 30%; font-size: 0.86em; line-height: 1.35; margin-top: 0.8em; margin-bottom: 0.9em; text-align: justify; }
.ab-editor > p.item { padding-left: 2.6em; text-align: left; }
.ab-editor > p.item[data-nivel="2"] { padding-left: 4.4em; }
.ab-editor > p.item::before { content: attr(data-marca); position: absolute; left: 0.9em; color: var(--ab-item); font-weight: 600; }
.ab-editor > p.item[data-nivel="2"]::before { left: 2.8em; }
.ab-editor > p[data-vazio][data-dica]::before {
  content: attr(data-dica); position: absolute; left: 0; right: 0; top: 0; text-indent: 2.2em; color: #a8a396; pointer-events: none; font-style: italic;
}
.ab-editor sup, .ab-editor sub { font-size: 0.72em; line-height: 0; }
.ab-editor span.nota {
  display: inline-block; vertical-align: super; font-size: 10px; line-height: 1; font-weight: 700; text-indent: 0;
  background: var(--primary); color: #fff; border-radius: 6px; padding: 2px 5px; margin: 0 1px; cursor: pointer; user-select: none;
  font-family: Inter, system-ui, sans-serif;
}
.ab-editor span.nota::after { content: attr(data-n); }
.ab-editor span.nota:hover { background: var(--primary-hover); }
.ab-editor > figure {
  margin: 0.9em 0 1em; border: 1.5px dashed #cdc6f2; border-radius: 12px; background: #faf9ff; padding: 0.7rem 0.8rem 0.6rem;
  cursor: pointer; text-indent: 0; font-family: Inter, system-ui, sans-serif; font-size: 13px; line-height: 1.4; color: var(--text-secondary);
  user-select: none;
}
.ab-editor > figure:hover { border-color: var(--ab-fig); background: #f6f3ff; }
.ab-editor > figure::after { content: "Ilustração"; color: var(--ab-fig); top: 0.7rem; left: -6.6rem; }
.ab-editor > figure[data-k="tab"]::after { content: "Tabela"; }
.ilha-cab { font-weight: 600; color: var(--text); margin-bottom: 0.45rem; padding-right: 9rem; }
.ilha-rot { color: var(--ab-fig); }
.ab-editor > figure img { display: block; max-width: 100%; max-height: 220px; margin: 0 auto; border-radius: 6px; }
.ilha-vazia { padding: 1.4rem 0.6rem; text-align: center; border-radius: 8px; background: #efecfb; color: #6d5fd3; font-weight: 600; }
.ilha-fonte { font-size: 12px; color: var(--text-muted); margin-top: 0.45rem; }
.ilha-tab { overflow-x: auto; }
.ilha-tab table { border-collapse: collapse; width: 100%; font-size: 12px; }
.ilha-tab th, .ilha-tab td { padding: 3px 7px; text-align: left; border-bottom: 1px solid #e3e0f3; }
.ilha-tab th { border-top: 1.5px solid #555; border-bottom: 1px solid #555; color: var(--text); }
.ilha-mais { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.ilha-acoes { position: absolute; top: 0.5rem; right: 0.5rem; display: flex; gap: 3px; }
.ilha-acoes button {
  border: 1px solid #ddd8f5; background: #fff; border-radius: 7px; font: inherit; font-size: 12px; font-weight: 600;
  padding: 2px 8px; color: var(--text-secondary); cursor: pointer; min-width: 26px;
}
.ilha-acoes button:hover { color: var(--text); border-color: var(--ab-fig); }
.ab-editor .piscar { animation: ab-piscar 1.5s ease; }
@keyframes ab-piscar { 0%, 50% { background: rgba(250, 204, 21, 0.35); } 100% { background: transparent; } }
.ab-rodape-ed {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 0.55rem 0.9rem; border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-muted); background: #fbfaf7; border-radius: 0 0 14px 14px;
}

/* ---------- referências ---------- */
.ab-ref-gerador { border: 1px solid var(--border); border-radius: 13px; padding: 0.9rem 1rem 1rem; background: #fcfbf8; }
.ab-ref-tipos { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.9rem; }
.ab-ref-tipos button, #pickProntas button {
  border: 1px solid var(--border); background: #fff; color: var(--text-secondary); border-radius: 999px; padding: 0.32rem 0.75rem;
  font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.ab-ref-tipos button:hover, #pickProntas button:hover { border-color: var(--border-hover); color: var(--text); }
.ab-ref-tipos button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.ab-ref-previa {
  margin-top: 0.9rem; padding: 0.75rem 0.9rem; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: 9px; font-family: Arial, sans-serif; font-size: 0.92rem; line-height: 1.45; color: #111;
}
.ab-ref-previa.vazia { color: var(--text-muted); font-family: inherit; border-left-color: var(--border); }
.ab-ref-cit { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.45rem; }
.ab-ref-cit code, .ab-ref-lista code { background: var(--surface-2); border-radius: 5px; padding: 1px 6px; font-size: 0.78rem; color: var(--text); }
.ab-ref-botoes { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.8rem; }
.ab-prontas { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.9rem; }
#pickProntas { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ab-colar-refs { margin-top: 1rem; border: 1px solid var(--border); border-radius: 12px; padding: 0.7rem 0.9rem; }
.ab-colar-refs summary { cursor: pointer; font-weight: 600; font-size: 0.88rem; color: var(--text); display: flex; align-items: center; gap: 0.45rem; }
.ab-colar-refs summary .ico { width: 16px; height: 16px; color: var(--text-muted); }
.ab-colar-refs textarea { margin-top: 0.7rem; }
.ab-ref-lista { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.ab-ref-lista li {
  display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.65rem 0.75rem; border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
.ab-ref-lista .txt { flex: 1; min-width: 0; font-family: Arial, sans-serif; font-size: 0.88rem; line-height: 1.45; color: #111; overflow-wrap: anywhere; }
.ab-ref-lista .cit { font-family: Inter, system-ui, sans-serif; font-size: 0.76rem; color: var(--text-muted); margin-top: 0.3rem; }
.ab-ref-lista .bts { display: flex; gap: 3px; flex: none; }
.ab-ref-lista .vazia { color: var(--text-muted); font-size: 0.88rem; border-style: dashed; justify-content: center; }
.ab-ref-lista li.editando { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* ---------- conferência e downloads ---------- */
.ab-baixar { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.ab-nota-word { font-size: 0.8rem; color: var(--text-muted); margin: 0.6rem 0 1.1rem; }
.ab-conf { display: grid; gap: 0.9rem; }
.ab-conf h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.4rem; font-weight: 700; }
.ab-conf ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.ab-conf li {
  display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.55rem 0.7rem; border-radius: 10px; font-size: 0.87rem; line-height: 1.45;
  background: #fff; border: 1px solid var(--border);
}
.ab-conf li .marca { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; margin-top: 1px; }
.ab-conf li.erro { border-color: #f1c4b8; background: #fff7f4; }
.ab-conf li.erro .marca { background: #e4572e; color: #fff; }
.ab-conf li.aviso { border-color: #f1dfb5; background: #fffbf1; }
.ab-conf li.aviso .marca { background: #f2b33d; color: #3b2a05; }
.ab-conf li.ok { border-color: transparent; background: transparent; padding: 0.25rem 0.7rem; color: var(--text-secondary); }
.ab-conf li.ok .marca { background: #dcf3e4; color: #15803d; }
.ab-conf li .txt { flex: 1; min-width: 0; }
.ab-conf li .ab-btn { flex: none; }
.ab-conf .tudo-certo { padding: 0.9rem 1rem; border-radius: 12px; background: #eefaf2; border: 1px solid #c4ebd2; color: #166534; font-weight: 600; font-size: 0.92rem; }

/* ---------- prévia ---------- */
.ab-dir {
  position: sticky; top: calc(var(--header-height) + 10px); height: calc(100vh - var(--header-height) - 20px);
  display: flex; flex-direction: column; background: var(--ab-papel); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
}
.ab-previa-topo {
  display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem 0.55rem 1rem;
  background: rgba(255, 255, 255, 0.75); border-bottom: 1px solid var(--border);
}
.ab-previa-topo strong { font-size: 0.92rem; color: var(--text); }
.ab-previa-topo span { font-size: 0.78rem; color: var(--text-muted); margin-left: 0.4rem; }
.ab-previa-acoes { display: flex; align-items: center; gap: 0.35rem; }
.ab-paginas { flex: 1; overflow: auto; padding: 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.9rem; overscroll-behavior: contain; }
.ab-folha { position: relative; flex: none; cursor: zoom-in; }
.ab-folha canvas { display: block; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 6px 18px rgba(40, 35, 20, 0.12); border-radius: 2px; }
.ab-folha .rot { position: absolute; left: 0; right: 0; bottom: -1.15rem; text-align: center; font-size: 0.7rem; color: var(--text-muted); }
.ab-folha.marcada canvas { box-shadow: 0 0 0 3px var(--primary), 0 6px 18px rgba(40, 35, 20, 0.12); }
.ab-folha + .ab-folha { margin-top: 0.5rem; }
.ab-so-cel { display: none; }

/* ---------- janelas ---------- */
.ab-modal { position: fixed; inset: 0; z-index: 9995; background: rgba(28, 27, 24, 0.82); display: flex; flex-direction: column; }
.ab-modal[hidden] { display: none; }
.ab-modal-topo { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.7rem 1rem; color: #fff; flex-wrap: wrap; }
.ab-modal-topo > div { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.ab-modal-folha { flex: 1; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 0 1rem 1.5rem; }
.ab-modal-folha canvas { background: #fff; max-width: 100%; height: auto; box-shadow: var(--shadow-lg); cursor: default; }
.ab-modal-caixa { align-items: center; justify-content: center; padding: 1rem; }
.ab-caixa {
  background: var(--surface); border-radius: 16px; width: min(640px, 100%); max-height: calc(100vh - 2rem); display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.ab-caixa-p { width: min(480px, 100%); }
.ab-caixa .ab-modal-topo { color: var(--text); border-bottom: 1px solid var(--border); }
.ab-caixa-corpo { padding: 1rem 1.1rem; overflow: auto; display: grid; gap: 0.8rem; }
.ab-caixa-pe { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.8rem 1.1rem; border-top: 1px solid var(--border); background: #fbfaf7; }
.ab-caixa-pe .ab-perigo { margin-right: auto; }
.ab-ilha-img { border: 1px dashed var(--border-hover); border-radius: 10px; min-height: 140px; display: flex; align-items: center; justify-content: center; background: #fbfaf7; overflow: hidden; }
.ab-ilha-img img { max-width: 100%; max-height: 260px; display: block; }
.ab-ilha-img img[src=""], .ab-ilha-img img:not([src]) { display: none; }
.ab-ilha-img span { color: var(--text-muted); font-size: 0.86rem; }
.ab-largura { flex-direction: row; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--text-secondary); }
.ab-largura input { width: 140px; }
.ab-tab-previa { overflow-x: auto; margin-top: 0.4rem; }
.ab-tab-previa table { border-collapse: collapse; font-size: 0.8rem; width: 100%; }
.ab-tab-previa th, .ab-tab-previa td { padding: 3px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.ab-tab-previa th { border-top: 1.5px solid #333; border-bottom: 1px solid #333; }
#ilLinhas { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.84rem; }

/* ---------- impressão ---------- */
#areaImpressao { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body > *:not(#areaImpressao) { display: none !important; }
  #areaImpressao { display: block !important; }
  #areaImpressao img { display: block; width: 210mm; height: 297mm; page-break-after: always; break-after: page; }
  #areaImpressao img:last-child { page-break-after: auto; break-after: auto; }
}

/* ---------- barra do celular ---------- */
.ab-barra-cel { display: none; }


@media (max-width: 1100px) {
  .ab-app { grid-template-columns: minmax(0, 1fr) minmax(340px, 0.85fr); }
  .ab-editor { padding-left: 1.6rem; }
  .ab-editor > *::after { display: none; }
  .ab-editor > *.atual::after {
    display: block; position: absolute; left: auto; right: 0; top: -1.15em; width: auto; padding: 0 6px; border-radius: 5px;
    background: #fff; font-size: 9.5px; text-align: right;
  }
  .ab-editor > p.atual:not(.cit):not(.item)::after { display: none; }
}

@media (max-width: 900px) {
  .ab-main { padding: 0.9rem 0.8rem 2rem; }
  .ab-alerta { align-items: flex-start; padding: 0.55rem 0.75rem; }
  .ab-alerta > .ico { margin-top: 0.12rem; }
  .ab-app { grid-template-columns: minmax(0, 1fr); }
  .ab-dir {
    position: fixed; inset: 0; z-index: 9990; height: auto; border-radius: 0; border: 0; display: none;
  }
  body.previa-aberta .ab-dir { display: flex; }
  body.previa-aberta { overflow: hidden; }
  .ab-so-cel { display: inline-flex; }
  .ab-aba { padding: 1.1rem 0.95rem 1.2rem; border-radius: 14px; }
  .ab-grade { grid-template-columns: 1fr; }
  .ab-barra { top: calc(var(--header-height) + 50px); overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .ab-barra::-webkit-scrollbar { display: none; }
  .ab-barra-g { flex: none; }
  .ab-editor { padding: 1.1rem 0.95rem 1.8rem; font-size: 16px; min-height: 340px; }
  .ab-editor > p.cit { margin-left: 18%; }
  .ab-modelos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ab-modelo .mini { height: 96px; }
  .ab-linha-op .ab-rot { min-width: 100%; }
  .ilha-cab { padding-right: 0; padding-top: 1.6rem; }
  .mobile-sticky-bar.ab-barra-cel {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 950; gap: 0.45rem;
    padding: 0.6rem 0.7rem calc(0.6rem + env(safe-area-inset-bottom)); background: rgba(250, 249, 246, 0.97);
    border-top: 1px solid var(--border); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .ab-barra-cel .ab-btn { flex: 1 1 0; min-width: 0; padding: 0.7rem 0.3rem; font-size: 0.84rem; gap: 0.3rem; white-space: nowrap; }
  .ab-barra-cel { gap: 0.35rem; }
  @media (max-width: 420px) { .ab-barra-cel #btnCelPrevia .ico, .ab-barra-cel #btnCelConferir .ico { display: none; } }
  body.abnt-tema { padding-bottom: 4.6rem; }
}
@media (max-width: 1024px) and (min-width: 901px) {
  .mobile-sticky-bar.ab-barra-cel { display: none; }
  body.abnt-tema.tem-barra-fixa { padding-bottom: 0; }
}
body.abnt-tema.previa-aberta .chat-fab { display: none; }

/* ---------- sugestões ---------- */
.ab-sr { position: absolute !important; left: 0; top: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
/* Botão de sugestão: laranja, diferente dos botões de trabalho (azul) e de IA (roxo) */
.ab-btn-sugerir {
  background: linear-gradient(135deg, #ea580c, #c2410c); color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.3);
}
.ab-btn-sugerir:hover { filter: brightness(1.07); box-shadow: 0 6px 18px rgba(234, 88, 12, 0.38); transform: translateY(-1px); }
.ab-btn-sugerir:active { transform: translateY(1px); }
.ab-btn-sugerir:focus-visible { outline: 3px solid #fdba74; outline-offset: 2px; }
.ab-hero-sugerir { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.4rem 0.7rem; margin-top: 0.8rem; }
.ab-hero-sugerir .ab-btn { padding: 0.45rem 0.95rem; border-radius: 999px; font-size: 0.86rem; }
.ab-hero-sugerir span { font-size: 0.82rem; color: var(--text-secondary); }
.ab-opiniao {
  position: relative; margin-top: 1.4rem; padding: 1.1rem 1.15rem; border-radius: 14px;
  border: 1px solid #fed7aa; border-left: 5px solid #ea580c; background: #fff7ed;
}
.ab-opiniao h3 { margin: 0 0 0.25rem; font-size: 1.05rem; color: var(--text); display: flex; align-items: center; gap: 0.4rem; }
.ab-opiniao h3 .ico { width: 20px; height: 20px; color: #ea580c; flex: none; }
.ab-opiniao > p { margin: 0 0 0.75rem; font-size: 0.86rem; color: var(--text-secondary); }
.ab-opiniao-tipos { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.6rem; }
.ab-opiniao-tipos button {
  font: inherit; font-size: 0.8rem; padding: 0.35rem 0.75rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-body);
}
.ab-opiniao-tipos button.on { background: #c2410c; border-color: #c2410c; color: #fff; }
.ab-opiniao textarea, .ab-opiniao input[type=email] {
  width: 100%; font: inherit; font-size: 0.9rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 0.75rem;
}
.ab-opiniao textarea { resize: vertical; min-height: 4.5rem; }
.ab-opiniao-linha { display: flex; gap: 0.5rem; margin-top: 0.5rem; align-items: stretch; }
.ab-opiniao-linha input[type=email] { flex: 1; min-width: 0; }
.ab-opiniao-status { margin: 0.5rem 0 0; font-size: 0.84rem; min-height: 1em; }
.ab-opiniao-status.ok { color: var(--success); }
.ab-opiniao-status.erro { color: var(--danger); }
.ab-opiniao.enviada .ab-opiniao-tipos, .ab-opiniao.enviada textarea, .ab-opiniao.enviada .ab-opiniao-linha { display: none; }
@media (max-width: 520px) { .ab-opiniao-linha { flex-direction: column; } }
/* Opinião em janela própria (aberta pelo botão do topo, longe da Revisão com IA) */
.ab-modal .ab-caixa.ab-opiniao { margin: 0; padding: 0; border: 1px solid var(--border); border-top: 5px solid #ea580c; background: var(--surface); width: min(560px, 100%); }
.ab-caixa.ab-opiniao .ab-modal-topo strong { display: flex; align-items: center; gap: 0.45rem; }
.ab-caixa.ab-opiniao .ab-modal-topo .ico { width: 20px; height: 20px; color: #ea580c; flex: none; }
.ab-caixa.ab-opiniao .ab-caixa-corpo { display: block; }
#opTurnstile:empty { display: none; }
.ab-caixa.ab-opiniao .ab-caixa-corpo > p { margin: 0 0 0.75rem; font-size: 0.88rem; color: var(--text-secondary); }
/* Botão "Dar opinião" no topo, à direita (laranja, diferente do roxo da IA) */
.ab-opiniao-topo {
  display: inline-flex; align-items: center; gap: 0.4rem; height: 32px; padding: 0 0.8rem; margin-left: auto; flex-shrink: 0;
  border: 1px solid #fdba74; background: #fff7ed; color: #c2410c; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer;
}
.ab-opiniao-topo .ico { width: 16px; height: 16px; }
.ab-opiniao-topo:hover { background: #ffedd5; border-color: #ea580c; }
.ab-opiniao-topo:focus-visible { outline: 3px solid #fdba74; outline-offset: 2px; }
.ab-opiniao-topo + .tool-actions { margin-left: 0.4rem; }
@media (max-width: 480px) { .ab-opiniao-topo { height: 34px; padding: 0 0.6rem; } }
@media (max-width: 359px) { .ab-opiniao-topo { width: 34px; padding: 0; justify-content: center; } .ab-opiniao-topo span { display: none; } }
@media (max-width: 600px) {
  .ab-hero { margin-bottom: 0.8rem; }
  .ab-hero h1 { font-size: 1.65rem; }
  .ab-hero p { font-size: 0.9rem; }
  .ab-hero p .ab-longo-cel { display: none; }
  .ab-hero .ac-sobre { display: none; }
  .ab-hero-sugerir .ab-btn { padding: 0.38rem 0.85rem; font-size: 0.8rem; box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25); }
  .ab-alerta .ab-longo-cel { display: none; }
  .ab-selos, .ab-hero-sugerir span { display: none; }
  .ab-hero-sugerir { margin-top: 0.6rem; }
  .ab-alerta p { font-size: 0.82rem; }
}

/* ---------- cores suaves que guiam (cada coisa com a sua cor) ---------- */
/* Etapas: cada uma com uma cor clara; a aberta fica tingida, não preta */
.ab-abas button { --c: #1f3f6e; --c-claro: #e9eef6; }
.ab-abas button[data-aba="capa"] { --c: #0f766e; --c-claro: #e6f6f3; }
.ab-abas button[data-aba="texto"] { --c: #b45309; --c-claro: #fdf3e4; }
.ab-abas button[data-aba="refs"] { --c: #0369a1; --c-claro: #e7f3fb; }
.ab-abas button[data-aba="final"] { --c: #15803d; --c-claro: #e8f6ec; }
.ab-abas button .n { background: var(--c-claro); color: var(--c); }
.ab-abas button:hover { border-color: var(--c); color: var(--c); }
.ab-abas button[aria-selected="true"] { background: var(--c-claro); border-color: var(--c); color: var(--c); box-shadow: 0 0 0 2px var(--c-claro); }
.ab-abas button[aria-selected="true"] .n { background: var(--c); color: #fff; }

/* Botões do texto: a cor diz o que cada um faz */
.ab-btn-sec.ab-cor { background: var(--c-claro); border-color: var(--c-borda); color: var(--c); }
.ab-btn-sec.ab-cor:hover { background: var(--c-claro); border-color: var(--c); filter: saturate(1.25); }
#btnRoteiro { --c: #0f766e; --c-claro: #ecf8f5; --c-borda: #b9e3da; }
#btnArrumar { --c: #6d28d9; --c-claro: #f4efff; --c-borda: #d9ccfb; }
#btnExemplo { --c: #a16207; --c-claro: #fdf6e3; --c-borda: #f1dca6; }
#btnWord { --c: #1d4ed8; --c-claro: #eef3ff; --c-borda: #bfd0fb; }

/* Barra do editor: as mesmas cores das etiquetas na margem do texto */
.ab-barra button[data-tipo^="h"] { --c: var(--ab-tit); --c-claro: #eceefe; }
.ab-barra button[data-tipo="cit"] { --c: var(--ab-cit); --c-claro: #fdf1e2; }
.ab-barra button[data-tipo^="item"] { --c: var(--ab-item); --c-claro: #e4f5f2; }
.ab-barra button[data-ins="fig"], .ab-barra button[data-ins="tab"],
.ab-barra button[data-tipo="apendice"], .ab-barra button[data-tipo="anexo"] { --c: var(--ab-fig); --c-claro: #f2ecff; }
.ab-barra button[data-ins="nota"] { --c: #0369a1; --c-claro: #e7f3fb; }
.ab-barra button[data-tipo^="h"], .ab-barra button[data-tipo="cit"], .ab-barra button[data-tipo^="item"],
.ab-barra button[data-ins], .ab-barra button[data-tipo="apendice"], .ab-barra button[data-tipo="anexo"] { color: var(--c); }
.ab-barra button[data-tipo^="h"]:hover, .ab-barra button[data-tipo="cit"]:hover, .ab-barra button[data-tipo^="item"]:hover,
.ab-barra button[data-ins]:hover, .ab-barra button[data-tipo="apendice"]:hover, .ab-barra button[data-tipo="anexo"]:hover { background: var(--c-claro); color: var(--c); }
.ab-barra button[data-tipo^="h"].on, .ab-barra button[data-tipo="cit"].on, .ab-barra button[data-tipo^="item"].on,
.ab-barra button[data-tipo="apendice"].on, .ab-barra button[data-tipo="anexo"].on { background: var(--c); color: #fff; }

/* Pergunta opcional "quem está usando" (fim do formatador) */
.ab-quem {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; margin-top: 1.1rem;
  padding: 0.7rem 0.9rem; border-radius: 12px; border: 1px dashed var(--primary-border); background: var(--primary-light);
  font-size: 0.86rem; color: var(--text-secondary);
}
.ab-quem-bts { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ab-quem-bts button {
  font: inherit; font-size: 0.8rem; font-weight: 600; padding: 0.35rem 0.8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--primary-border); background: var(--surface); color: var(--primary);
}
.ab-quem-bts button:hover { background: var(--primary); color: #fff; }

/* ============================================================
   TELA NOVA (2026-11): etapas com status, cara de plataforma
   - celular: etapas numa linha (5 bolinhas) presas no topo
   - tablet: etapas no topo + texto e prévia lado a lado
   - computador (1200px+): tela inteira, barra lateral, texto e
     prévia rolam cada um sozinho
   ============================================================ */
body.ab-formatador .ab-main { max-width: none; padding: 0; }
.ab-app { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-items: start; }
.ab-lado { display: contents; }
.ab-lado-topo { order: 1; text-align: center; padding: 1rem 1rem 0.2rem; }
.ab-lado > .ab-alerta { order: 2; margin: 0.6rem 0.8rem 0.2rem; max-width: none; }
.ab-lado .ab-abas { order: 3; }
.ab-salvo { order: 4; }
.ab-esq { order: 5; padding: 0.2rem 0.8rem 1.5rem; }
.ab-lado-pe { order: 6; padding: 0 0.8rem 1.5rem; }
.ab-lado-topo h1 { font-family: var(--ab-serif); font-size: 1.55rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; color: var(--text); margin: 0 0 0.3rem; }
.ab-lado-topo .ac-sobre { display: none; }
.ab-lado-sub { font-size: 0.88rem; line-height: 1.5; color: var(--text-secondary); max-width: 520px; margin: 0 auto; }
.ab-lado > .ab-alerta p { font-size: 0.8rem; }

/* ---------- etapas (linha de 5 bolinhas) ---------- */
.ab-lado .ab-abas {
  position: sticky; top: var(--header-height); z-index: 30;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0;
  padding: 0.55rem 0.4rem 0.45rem; margin: 0; background: rgba(244, 242, 236, 0.97);
  border-bottom: 1px solid var(--border); overflow: visible; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ab-lado .ab-abas button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  border: 0; background: transparent; box-shadow: none; padding: 0.1rem 0.15rem; border-radius: 10px; color: var(--text-secondary);
  font-size: 0.72rem; text-align: center; min-width: 0;
}
.ab-lado .ab-abas button:hover { background: transparent; color: var(--c); }
.ab-lado .ab-abas button[aria-selected="true"] { background: transparent; box-shadow: none; color: var(--c); }
.ab-lado .ab-abas button .n {
  position: relative; z-index: 1; width: 30px; height: 30px; flex: none; font-size: 0.82rem; font-weight: 700;
  border: 2px solid var(--c-claro); background: #fff; color: var(--c); transition: background 0.15s, border-color 0.15s;
}
.ab-lado .ab-abas button .n i { font-style: normal; }
.ab-lado .ab-abas button[aria-selected="true"] .n { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 0 0 4px var(--c-claro); }
.ab-lado .ab-abas button.feito .n { background: var(--c-claro); border-color: var(--c-claro); }
.ab-lado .ab-abas button.feito .n i { display: none; }
.ab-lado .ab-abas button.feito .n::after { content: "✓"; font-size: 0.9rem; }
.ab-lado .ab-abas button.feito[aria-selected="true"] .n { background: var(--c); color: #fff; }
/* Linha que liga as bolinhas */
.ab-lado .ab-abas button + button::before {
  content: ""; position: absolute; top: calc(0.1rem + 14px); right: calc(50% + 15px); width: calc(100% - 30px); height: 2px;
  background: var(--border); border-radius: 2px;
}
.ab-et { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.ab-et b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-et small { display: none; }
.ab-et .ab-longo { display: none; }
.ab-lado .ab-abas .ab-cont { position: absolute; top: -4px; left: calc(50% + 8px); z-index: 2; min-width: 18px; height: 18px; font-size: 0.66rem; padding: 0 5px; }
.ab-lado .ab-abas .ab-cont.ok { display: none; }

.ab-salvo { display: none; }
.ab-lado-pe .ab-btn-sugerir { padding: 0.45rem 0.95rem; border-radius: 999px; font-size: 0.84rem; }
.ab-lado-pe { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; }
.ab-lado-links, .ab-lado-pe .ab-selos { display: none; }

/* ---------- cabeçalho de cada etapa ---------- */
.ab-etapa { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ab-ouro); margin-bottom: 0.25rem; }

/* ---------- 1. tipo: ajustes recolhidos ---------- */
.ab-ajustes { margin-top: 1.1rem; border: 1px solid var(--border); border-radius: 13px; background: #fcfbf8; }
.ab-ajustes > summary {
  list-style: none; display: flex; align-items: center; gap: 0.7rem; padding: 0.8rem 1rem; cursor: pointer; border-radius: 13px;
}
.ab-ajustes > summary::-webkit-details-marker { display: none; }
.ab-ajustes > summary:hover { background: var(--surface-2); }
.ab-ajustes > summary > .ico { width: 18px; height: 18px; color: var(--text-muted); flex: none; }
.ab-ajustes > summary > span { flex: 1; min-width: 0; font-size: 0.9rem; color: var(--text); }
.ab-ajustes > summary small { color: var(--text-muted); font-weight: 400; }
.ab-ajustes > summary em { display: block; font-style: normal; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-ajustes .ab-seta { transition: transform 0.2s; }
.ab-ajustes[open] .ab-seta { transform: rotate(180deg); }
.ab-ajustes[open] > summary { border-bottom: 1px solid var(--border); border-radius: 13px 13px 0 0; }
.ab-ajustes > :not(summary) { margin-left: 1rem; margin-right: 1rem; }
.ab-ajustes > .ab-formato { margin-bottom: 1rem; }
.ab-ajustes > .ab-sub:first-of-type { margin-top: 1rem; }

/* ---------- 1. importar arquivo logo no começo ---------- */
.ab-importar {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.85rem;
  background: #eef3ff; border: 1.5px solid #bfd0fb; border-radius: 14px; padding: 0.85rem 1rem; margin-bottom: 1.2rem;
}
.ab-importar[hidden] { display: none; }
.ab-imp-ico { width: 42px; height: 42px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: #1d4ed8; }
.ab-imp-ico .ico { width: 22px; height: 22px; }
.ab-imp-txt { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.ab-imp-txt b { font-size: 1rem; color: var(--text); }
.ab-imp-txt > span { font-size: 0.86rem; line-height: 1.4; color: var(--text-secondary); overflow-wrap: anywhere; }
.ab-imp-tipos { font-size: 0.76rem; color: var(--text-muted); }
.ab-imp-btn { white-space: nowrap; }
#btnImportarInicio { background: #1d4ed8; }
#btnImportarInicio:hover { background: #1e40af; }
.ab-importar.ab-importado { background: #e8f6ec; border-color: #a7dcb7; }
.ab-importar.ab-importado .ab-imp-ico { color: #15803d; }
.ab-importar.ab-importado .ab-imp-tipos { color: #166534; }
.ab-imp-tipos:empty { display: none; }
.ab-lendo { cursor: wait !important; opacity: 0.7; }
@media (max-width: 640px) {
  .ab-importar { grid-template-columns: auto minmax(0, 1fr); padding: 0.8rem; gap: 0.7rem; }
  .ab-imp-btn { grid-column: 1 / -1; justify-content: center; width: 100%; }
}

/* ---------- 3. texto: três maneiras de começar ---------- */
.ab-comecar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem; margin-bottom: 1rem; }
.ab-comecar[hidden] { display: none; }
.ab-com {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; text-align: left; cursor: pointer;
  background: #fff; border: 1.5px solid var(--border); border-radius: 14px; padding: 0.9rem 0.9rem 1rem; font: inherit; color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.ab-com:hover { border-color: var(--c); box-shadow: 0 0 0 3px var(--c-claro); transform: translateY(-1px); }
.ab-com:disabled { opacity: 0.7; cursor: wait; }
.ab-com b { font-size: 0.95rem; color: var(--text); }
.ab-com small { font-size: 0.78rem; line-height: 1.4; color: var(--text-muted); }
.ab-com-ico { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--c-claro); color: var(--c); margin-bottom: 0.2rem; }
.ab-com-ico .ico { width: 20px; height: 20px; }
#btnComWord { --c: #1d4ed8; --c-claro: #eef3ff; border-color: #bfd0fb; }
#btnComColar { --c: #b45309; --c-claro: #fdf3e4; }
#btnComRoteiro { --c: #0f766e; --c-claro: #ecf8f5; }
.ab-com-ex { grid-column: 1 / -1; text-align: center; font-size: 0.84rem; color: var(--text-secondary); margin: 0.1rem 0 0; }
.ab-com-ex .ab-link { font-size: 0.84rem; font-weight: 600; }
.ab-aba:has(.ab-comecar:not([hidden])) .ab-editor { min-height: 220px; }
.ab-acoes-texto[hidden] { display: none; }

/* Menu "Mais opções" */
.ab-menu { position: relative; }
.ab-menu-lista {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 60; min-width: 230px; padding: 0.35rem;
  background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); display: grid; gap: 2px;
}
.ab-menu-lista[hidden] { display: none; }
.ab-menu-lista button, .ab-barra-pop button {
  display: flex; align-items: center; gap: 0.55rem; width: 100%; text-align: left; border: 0; background: transparent;
  font: inherit; font-size: 0.86rem; font-weight: 550; color: var(--text); padding: 0.5rem 0.65rem; border-radius: 8px; cursor: pointer;
}
.ab-menu-lista button:hover { background: var(--surface-2); }
.ab-menu-lista button .ico { width: 16px; height: 16px; color: var(--text-muted); }
.ab-menu-lista button.ab-perigo, .ab-menu-lista button.ab-perigo .ico { color: #b4371f; }
.ab-btn .ico + .ico, #btnMaisTexto .ico { width: 15px; height: 15px; }

/* "Mais" da barra do editor (fica por cima, mesmo com a barra rolando de lado) */
.ab-barra-mais { position: static; }
.ab-barra-pop {
  position: fixed; z-index: 9000; width: 230px; padding: 0.35rem; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); display: grid; gap: 1px;
}
.ab-barra-pop[hidden] { display: none; }
.ab-barra .ab-barra-pop button { justify-content: flex-start; padding: 0.45rem 0.6rem; font-size: 0.84rem; }
.ab-pop-rot { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); padding: 0.45rem 0.6rem 0.15rem; }
/* Formatação livre (fora da norma) */
.ab-barra .ab-livre-bt { color: #9a3412; }
.ab-barra .ab-livre-bt.tem { background: #fff7ed; border-color: #fdba74; }
.ab-pop-livre { width: 270px; }
.ab-pop-aviso { margin: 0.2rem 0.4rem 0.3rem; padding: 0.4rem 0.55rem; font-size: 0.76rem; line-height: 1.35; color: #9a3412; background: #fff7ed; border: 1px solid #fed7aa; }
.ab-pop-linha { display: flex; gap: 3px; padding: 0 0.35rem 0.2rem; }
.ab-barra .ab-pop-linha button { flex: 1; justify-content: center; padding: 0.4rem 0.2rem; border: 1px solid var(--border); font-size: 0.8rem; min-width: 0; }
.ab-barra .ab-pop-linha button[data-tam=""] { flex: 1.6; font-size: 0.74rem; }
.ab-barra .ab-pop-linha button .ico { width: 18px; height: 18px; }
.ab-barra .ab-barra-pop button.on { background: #1e3a5f; border-color: #1e3a5f; color: #fff; }
.ab-barra .ab-barra-pop .ab-pop-limpar { margin-top: 0.25rem; border-top: 1px solid var(--border); color: var(--text-secondary); }
.ab-editor > p[data-al="left"] { text-align: left; text-indent: 0; }
.ab-editor > p[data-al="center"] { text-align: center; text-indent: 0; }
.ab-editor > p[data-al="right"] { text-align: right; text-indent: 0; }
.ab-editor > p[data-tam="10"] { font-size: 0.84em; }
.ab-editor > p[data-tam="11"] { font-size: 0.92em; }
.ab-editor > p[data-tam="14"] { font-size: 1.17em; }
.ab-editor > p[data-tam="16"] { font-size: 1.33em; }
.ab-editor > p[data-tam="18"] { font-size: 1.5em; }
.ab-editor > p.atual[data-al]:not(.cit):not(.item)::after, .ab-editor > p.atual[data-tam]:not(.cit):not(.item)::after { content: "Livre"; color: #c2410c; }
/* Voltar: sempre visível no fim de cada etapa */
.ab-prox-fim { justify-content: flex-start; }

/* ---------- 4. referências: montar ou colar ---------- */
.ab-ref-modo { margin-bottom: 1rem; }
.ab-ref-modo button { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.9rem; }
.ab-ref-modo button .ico { width: 15px; height: 15px; }
.ab-colar-refs[hidden], #refModoMontar[hidden] { display: none; }
.ab-colar-refs:not([hidden]) { display: grid; gap: 0.6rem; border: 0; padding: 0; background: transparent; }

/* ---------- 5. conferir e baixar ---------- */
.ab-final-resumo { margin-top: 0.7rem; padding: 0.75rem 0.95rem; border-radius: 12px; font-weight: 600; font-size: 0.92rem; line-height: 1.45; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.ab-final-resumo.ok { background: #eefaf2; border-color: #c4ebd2; color: #166534; }
.ab-final-resumo.aviso { background: #fff8e6; border-color: #f4dc9f; color: #7a5208; }
.ab-final-resumo.erro { background: #fdf1ee; border-color: #f3c9bf; color: #9a3412; }
.ab-sub-conf { margin-top: 1.4rem; }
.ab-so-pc { display: inline-flex; }

/* ---------- tablet: etapas no topo, texto e prévia lado a lado ---------- */
@media (min-width: 640px) {
  .ab-et .ab-longo { display: inline; }
  .ab-et .ab-curto { display: none; }
  .ab-lado .ab-abas button { font-size: 0.78rem; }
}
@media (min-width: 901px) {
  .ab-app { grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr); column-gap: 1rem; padding: 0 1.2rem; }
  .ab-lado-topo, .ab-lado > .ab-alerta, .ab-lado .ab-abas, .ab-lado-pe { grid-column: 1 / -1; }
  .ab-lado .ab-abas { margin: 0 -1.2rem; padding-left: 1.2rem; padding-right: 1.2rem; }
  .ab-lado > .ab-alerta { margin: 0.6rem auto 0.4rem; max-width: 900px; }
  .ab-esq { padding: 0.8rem 0 1.5rem; }
  .ab-dir { order: 5; margin-top: 0.8rem; top: calc(var(--header-height) + 76px); height: calc(100vh - var(--header-height) - 90px); }
  .ab-barra { top: calc(var(--header-height) + 70px); }
}
@media (max-width: 900px) {
  .ab-so-pc { display: none; }
  .ab-barra { top: calc(var(--header-height) + 64px); }
  .ab-comecar { grid-template-columns: minmax(0, 1fr); }
  .ab-com { flex-direction: row; align-items: center; flex-wrap: wrap; column-gap: 0.75rem; padding: 0.75rem 0.85rem; }
  .ab-com-ico { margin: 0; grid-row: span 2; }
  .ab-com > b { flex: 1; }
  .ab-com > small { flex-basis: 100%; padding-left: calc(38px + 0.75rem); margin-top: -0.35rem; }
}

/* ---------- computador: tela inteira com barra lateral ---------- */
@media (min-width: 1200px) {
  body.ab-formatador .ac-nav { display: none; }
  .ab-app {
    grid-template-columns: 264px minmax(0, 1.1fr) minmax(0, 1fr); padding: 0; column-gap: 0;
    height: calc(100vh - var(--header-height)); height: calc(100dvh - var(--header-height));
    align-items: stretch; border-bottom: 1px solid var(--border);
  }
  .ab-lado {
    display: flex; flex-direction: column; gap: 0.9rem; grid-column: 1; grid-row: 1; min-height: 0; overflow-y: auto;
    padding: 1.1rem 0.9rem 1rem; background: #faf9f5; border-right: 1px solid var(--border); scrollbar-width: thin;
  }
  .ab-lado-topo { text-align: left; padding: 0 0.3rem; }
  .ab-lado-topo .ac-sobre { display: inline-flex; font-size: 0.62rem; margin-bottom: 0.35rem; }
  .ab-lado-topo .ac-sobre::before { display: none; }
  .ab-lado-topo h1 { font-size: 1.5rem; }
  .ab-lado-sub { font-size: 0.8rem; margin: 0; }
  .ab-lado > .ab-alerta { margin: 0; padding: 0.5rem 0.65rem; align-items: flex-start; border-radius: 10px; }
  .ab-lado > .ab-alerta > .ico { width: 16px; height: 16px; margin-top: 0.1rem; }
  .ab-lado > .ab-alerta p { font-size: 0.74rem; line-height: 1.4; }
  .ab-lado .ab-abas {
    position: static; display: flex; flex-direction: column; gap: 0.3rem; margin: 0; padding: 0;
    background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .ab-lado .ab-abas button {
    flex-direction: row; align-items: center; gap: 0.7rem; text-align: left; width: 100%;
    padding: 0.6rem 0.65rem; border-radius: 12px; border: 1px solid transparent; font-size: 0.9rem; color: var(--text);
  }
  .ab-lado .ab-abas button:hover { background: #fff; border-color: var(--border); color: var(--text); }
  .ab-lado .ab-abas button[aria-selected="true"] { background: #fff; border-color: var(--c); box-shadow: 0 0 0 3px var(--c-claro), var(--shadow-sm); color: var(--text); }
  .ab-lado .ab-abas button[aria-selected="true"] .n { box-shadow: none; }
  .ab-lado .ab-abas button + button::before {
    top: calc(-0.3rem - 50% + 15px + 0.6rem); right: auto; left: calc(0.65rem + 14px); width: 2px; height: calc(100% - 30px + 0.3rem - 0.2rem); display: none;
  }
  .ab-et { flex: 1; }
  .ab-et b { font-size: 0.9rem; }
  .ab-et small { display: block; font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.05rem; }
  .ab-lado .ab-abas button.falta .ab-et small { color: #b45309; }
  .ab-lado .ab-abas button.feito .ab-et small { color: #15803d; }
  .ab-et .ab-curto { display: none; }
  .ab-et .ab-longo { display: inline; }
  .ab-lado .ab-abas .ab-cont { position: static; flex: none; min-width: 22px; height: 22px; font-size: 0.72rem; }
  .ab-salvo { display: flex; align-items: flex-start; gap: 0.45rem; margin: 0; padding: 0 0.3rem; font-size: 0.74rem; line-height: 1.4; color: var(--text-muted); }
  .ab-salvo .ico { flex: none; width: 15px; height: 15px; color: #22a35a; margin-top: 0.05rem; }
  .ab-salvo.pulso .ico { animation: ab-pulso 0.9s ease; }
  .ab-lado-pe { margin-top: auto; align-items: stretch; gap: 0.8rem; padding: 0.8rem 0 0; border-top: 1px solid var(--border); }
  .ab-lado-pe .ab-btn-sugerir { width: 100%; }
  .ab-lado-links { display: grid; grid-template-columns: 1fr 1fr; gap: 0.15rem 0.4rem; }
  .ab-lado-links span { grid-column: 1 / -1; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ab-ouro); margin-bottom: 0.15rem; padding: 0 0.3rem; }
  .ab-lado-links a { display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; color: var(--text-secondary); text-decoration: none; padding: 0.25rem 0.3rem; border-radius: 7px; }
  .ab-lado-links a:hover { background: #fff; color: var(--primary); }
  .ab-lado-links a .ico { width: 14px; height: 14px; opacity: 0.7; }
  .ab-lado-pe .ab-selos { display: block; margin: 0; padding: 0 0.3rem; font-size: 0.66rem; line-height: 1.45; color: var(--text-muted); font-weight: 500; }

  .ab-esq { grid-column: 2; grid-row: 1; min-height: 0; overflow-y: auto; padding: 1rem 1rem 0; scrollbar-width: thin; overscroll-behavior: contain; }
  .ab-esq > .ab-aba { max-width: 860px; margin: 0 auto 1rem; padding: 1.15rem 1.25rem 0; }
  .ab-editor { padding-left: 6.4rem; }
  .ab-editor > *::after { left: -5.9rem; width: 5rem; }
  .ab-prox {
    position: sticky; bottom: 0; z-index: 25; margin: 1.5rem -1.25rem 0; padding: 0.8rem 1.25rem 0.9rem;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.85), #fff 35%); border-top: 1px solid var(--border); border-radius: 0 0 16px 16px;
  }
  .ab-barra { top: -1rem; }
  .ab-dir {
    grid-column: 3; grid-row: 1; position: relative; top: auto; height: auto; min-height: 0; margin: 0;
    border-radius: 0; border-width: 0 0 0 1px;
  }
  .ab-previa-topo { padding: 0.55rem 0.8rem 0.55rem 1.1rem; }
}
@media (min-width: 1600px) {
  .ab-app { grid-template-columns: 288px minmax(0, 1.1fr) minmax(0, 1fr); }
}
@keyframes ab-pulso { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---------- referências: a lista vem primeiro ---------- */
.ab-ref-na-lista[hidden] { display: none; }
.ab-ref-na-lista > .ab-sub:first-child { margin-top: 0; }

/* ---------- revisão com IA (roxo = IA) ---------- */
.ab-revisao { margin-top: 1.3rem; border: 1px solid #ddd0fb; background: linear-gradient(180deg, #faf7ff, #fff 60%); border-radius: 16px; padding: 1rem 1.1rem 1.1rem; }
.ab-rev-topo { display: flex; gap: 0.8rem; align-items: flex-start; }
.ab-rev-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #7c3aed, #5b21b6); color: #fff; }
.ab-rev-ico .ico { width: 20px; height: 20px; }
.ab-rev-topo h3 { font-size: 1.02rem; font-weight: 700; color: var(--text); margin: 0.1rem 0 0.2rem; display: flex; align-items: center; gap: 0.45rem; }
.ab-rev-selo { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.12rem 0.45rem; border-radius: 999px; background: #ede5ff; color: #6d28d9; }
.ab-rev-topo p { font-size: 0.85rem; line-height: 1.5; color: var(--text-secondary); margin: 0; }
.ab-rev-form { display: grid; gap: 0.5rem; margin-top: 0.9rem; }
.ab-rev-form[hidden], .ab-rev-resultado[hidden], .ab-rev-perg[hidden] { display: none; }
.ab-rev-nota { font-size: 0.76rem; color: var(--text-muted); line-height: 1.4; }
.ab-rev-resultado { margin-top: 0.9rem; display: grid; gap: 0.7rem; }
.ab-rev-quando { font-size: 0.76rem; color: var(--text-muted); margin: 0; }
.ab-rev-resumo { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--text); padding: 0.65rem 0.8rem; border-radius: 10px; background: #f4efff; }
.ab-rev-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; counter-reset: rev; }
.ab-rev-lista li { position: relative; border: 1px solid var(--border); border-left: 4px solid #a78bfa; border-radius: 10px; background: #fff; padding: 0.65rem 0.8rem 0.7rem 2.3rem; counter-increment: rev; }
.ab-rev-lista li::before { content: counter(rev); position: absolute; left: 0.65rem; top: 0.65rem; width: 20px; height: 20px; border-radius: 50%; background: #ede5ff; color: #6d28d9; font-size: 0.72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ab-rev-lista li.g-alta { border-left-color: #e4572e; }
.ab-rev-lista li.g-baixa { border-left-color: #cfc6e9; }
.ab-rev-cab { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-bottom: 0.3rem; }
.ab-rev-tag { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #6d28d9; }
.ab-rev-imp { font-size: 0.66rem; font-weight: 700; padding: 0.08rem 0.4rem; border-radius: 999px; background: #fdecea; color: #b4371f; }
.ab-rev-onde { font-size: 0.72rem; color: var(--text-muted); }
.ab-rev-lista q { display: block; font-size: 0.82rem; font-style: italic; color: var(--text-secondary); margin: 0.1rem 0 0.35rem; padding-left: 0.6rem; border-left: 2px solid var(--border); }
.ab-rev-lista p { margin: 0 0 0.25rem; font-size: 0.86rem; line-height: 1.45; color: var(--text); }
.ab-rev-lista p b { font-weight: 600; }
.ab-rev-lista p.sug { color: var(--text-secondary); }
.ab-rev-lista p.sug::before { content: "Como melhorar: "; font-weight: 600; color: #15803d; }
.ab-rev-lista .ab-btn { margin-top: 0.35rem; }
.ab-rev-chat { border-top: 1px solid #e7defc; padding-top: 0.8rem; display: grid; gap: 0.55rem; }
.ab-rev-chat h4 { font-size: 0.9rem; font-weight: 700; color: var(--text); margin: 0; }
.ab-rev-chat h4 small { font-weight: 500; color: var(--text-muted); }
.ab-rev-msgs { display: grid; gap: 0.4rem; }
.ab-rev-msgs:empty { display: none; }
.ab-rev-msgs .eu, .ab-rev-msgs .ia { max-width: 88%; padding: 0.5rem 0.75rem; border-radius: 12px; font-size: 0.86rem; line-height: 1.45; white-space: pre-wrap; }
.ab-rev-msgs .eu { justify-self: end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.ab-rev-msgs .ia { justify-self: start; background: #f4efff; color: var(--text); border-bottom-left-radius: 4px; }
.ab-rev-msgs .carregando { color: var(--text-muted); }
.ab-rev-msgs .fim { font-size: 0.78rem; color: var(--text-muted); margin: 0.2rem 0 0; }
.ab-rev-perg { display: flex; gap: 0.45rem; }
.ab-rev-perg input { flex: 1; min-width: 0; }
.ab-rev-resultado > .ab-link { justify-self: start; }
@media (max-width: 520px) { .ab-rev-perg { flex-direction: column; } }
@media (max-width: 400px) { .ab-lado .ab-abas button { font-size: 0.66rem; } }

/* ---------- cantos quadrados e colunas de ponta a ponta (Raul, 2026-11-14) ---------- */
body.ab-formatador .ab-app *, body.ab-formatador .ab-modal *, body.ab-formatador .ab-barra-cel *, body.ab-formatador .ab-barra-pop { border-radius: 0 !important; }
/* O que é redondo por natureza continua redondo: bolinhas das etapas, contadores, marcas e chaves liga/desliga */
body.ab-formatador .ab-abas .n, body.ab-formatador .ab-cont, body.ab-formatador .ab-conf li .marca { border-radius: 50% !important; }
body.ab-formatador .ab-cont { border-radius: 999px !important; }
body.ab-formatador .ab-chave span, body.ab-formatador .ab-editor span.nota { border-radius: 999px !important; }
@media (min-width: 1200px) {
  body.ab-formatador .ab-esq { padding: 0; background: #fff; }
  body.ab-formatador .ab-esq > .ab-aba {
    max-width: none; min-height: 100%; margin: 0; border: 0; box-shadow: none; background: #fff;
    padding: 1.2rem clamp(1.2rem, 2.2vw, 2rem) 0; display: flex; flex-direction: column;
  }
  body.ab-formatador .ab-esq > .ab-aba > .ab-prox { margin: auto calc(-1 * clamp(1.2rem, 2.2vw, 2rem)) 0; padding: 0.8rem clamp(1.2rem, 2.2vw, 2rem) 0.9rem; background: #fff; }
  body.ab-formatador .ab-esq > .ab-aba > .ab-prox { position: sticky; bottom: 0; }
  body.ab-formatador .ab-esq > .ab-aba > :not(.ab-prox) { flex: none; }
  body.ab-formatador .ab-esq > .ab-aba > .ab-titulo-aba { margin-top: 0; }
  body.ab-formatador .ab-barra { top: 0; }
  body.ab-formatador .ab-lado .ab-abas button[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--c); border-color: var(--border); }
}

/* ---------- modo avançado: tudo numa página, sem o passo a passo (Raul, 2026-11-14) ---------- */
.ab-modo { order: 4; display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0.8rem 0; padding: 0.45rem 0.7rem; border: 1px solid var(--border); background: #fff; font-size: 0.84rem; }
.ab-modo b { font-weight: 650; color: var(--text); white-space: nowrap; }
.ab-modo small { font-size: 0.74rem; color: var(--text-muted); margin-left: auto; text-align: right; }
.ab-modo span { flex: none; }
@media (min-width: 901px) { .ab-modo { grid-column: 1 / -1; justify-self: end; margin: 0.5rem 0 0; } }
@media (min-width: 1200px) {
  .ab-modo { margin: 0; flex-wrap: wrap; row-gap: 0.1rem; padding: 0.55rem 0.65rem; justify-self: auto; }
  .ab-modo small { flex-basis: 100%; margin: 0; padding-left: calc(32px + 0.5rem); text-align: left; }
}
body.ab-avancado .ab-modo { border-color: var(--primary-border); background: var(--primary-light); }

body.ab-avancado .ab-esq > .ab-aba[hidden] { display: block !important; }
body.ab-avancado .ab-etapa,
body.ab-avancado .ab-prox,
body.ab-avancado .ab-titulo-aba p,
body.ab-avancado .ab-comecar { display: none !important; }
body.ab-avancado .ab-acoes-texto { display: flex !important; }
body.ab-avancado .ab-esq > .ab-aba { scroll-margin-top: calc(var(--header-height) + 84px); padding-bottom: 1.2rem; }
body.ab-avancado .ab-esq > .ab-aba + .ab-aba { margin-top: 0.8rem; }
@media (min-width: 1200px) {
  body.ab-avancado .ab-esq > .ab-aba { scroll-margin-top: 0; min-height: 0; display: block !important; padding-bottom: 1.6rem; }
  body.ab-avancado .ab-esq > .ab-aba + .ab-aba { margin-top: 0; border-top: 6px solid #f4f2ec !important; }
  body.ab-avancado .ab-esq > .ab-aba:last-child { min-height: 100%; }
}

/* ---------- começar do zero (Raul, 2026-11-14) ---------- */
.ab-btn-zerar { background: #fff; border: 1px solid #f3c9bf; color: #b4371f; font-size: 0.84rem; padding: 0.45rem 0.95rem; }
.ab-btn-zerar:hover { background: #fdf1ee; border-color: #e8a594; }
.ab-btn-zerar .ico { width: 15px; height: 15px; }
@media (min-width: 1200px) { .ab-lado-pe .ab-btn-zerar { width: 100%; justify-content: center; } }
