@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/plus-jakarta-sans.woff2') format('woff2');
  font-weight: 200 800; font-style: normal; font-display: swap;
}

:root {
  --bg: #fbf7f0;
  --surface: #ffffff;
  --ink: #2b2118;
  --ink-2: #5e5146;
  --muted: #8a7d70;
  --line: #ece3d6;
  --accent: #ecb84f;
  --accent-hover: #e3a935;
  --accent-ink: #2b2118;
  --accent-text: #9c5f00;
  --accent-soft: #fbefd2;
  --vanilla: #f3dc9b;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --ok: #2e7d32;
  --ok-soft: #e8f5e9;
  --warn: #8a5a00;
  --warn-soft: #fff4d6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(43, 33, 24, .06), 0 4px 16px rgba(43, 33, 24, .06);
  --serif: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 800; line-height: 1.12; letter-spacing: -.025em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.5rem; }
p { margin: 0 0 1em; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 440px; }
.prose { max-width: 720px; }

/* ---------- topo ---------- */
.topbar { border-bottom: 1px solid var(--line); background: rgba(251, 247, 240, .9); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(6px); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: var(--ink); text-decoration: none; }
.brand-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--vanilla); box-shadow: inset -4px -4px 0 rgba(201, 142, 28, .35); }
.topbar nav { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar nav a:not(.btn) { color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.topbar nav form { margin: 0; }

/* ---------- botões e formulários ---------- */
[hidden] { display: none !important; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 999px; padding: 10px 18px; font: 600 .95rem/1 var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); }
.btn-danger { background: transparent; color: var(--danger); border-color: #f0c9c5; }
.btn-sm { padding: 7px 12px; font-size: .85rem; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.btn[disabled] { opacity: .55; cursor: wait; }
.page-head .btn[disabled] { cursor: not-allowed; }
.linklike { background: none; border: 0; padding: 0; color: var(--ink-2); font: inherit; font-size: .95rem; cursor: pointer; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.hint { color: var(--muted); font-size: .85rem; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--vanilla); border-color: var(--accent-hover); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: .95rem; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }

.auth { padding: 56px 0; }
.auth h1 { font-size: 2rem; }

/* ---------- landing ---------- */
.hero { padding: 56px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); margin: 0 0 .35em; }
.hero h1 .hero-mark { background: linear-gradient(transparent 62%, var(--vanilla) 62%); }
.hero p.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 480px; margin: 0 0 28px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-free { margin: 12px 0 0; color: var(--muted); font-size: .9rem; }
/* Celular da landing: imita a página publicada de verdade (só o que o editor faz). */
.hero-phone { justify-self: center; width: 290px; display: grid; border: 8px solid #2b2118; border-radius: 36px; background: #2b2118; box-shadow: 0 24px 60px rgba(43,33,24,.18); position: relative; }
.hp-slide { grid-area: 1 / 1; display: flex; flex-direction: column; border-radius: 28px; overflow: hidden; background: var(--hp-bg); color: #1f1f1f; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; transition: opacity .6s ease, visibility .6s; }
.hp-slide.hp-off, .hp-stats.hp-off { opacity: 0; visibility: hidden; }
.hp-url { margin: 10px 12px 0; background: rgba(0,0,0,.06); border-radius: 999px; padding: 5px 12px; font-size: .68rem; color: #555; text-align: center; font-family: var(--sans); }
.hp-page { flex: 1; padding: 18px 18px 8px; }
.hp-title { font-size: 1.45rem; font-weight: 700; line-height: 1.15; margin-bottom: 10px; }
.hp-text { font-size: .82rem; line-height: 1.55; }
.hp-text p { margin: 0 0 .5em; }
.hp-text .hp-h2 { font-size: 1rem; font-weight: 700; line-height: 1.2; margin: .8em 0 .2em; }
.hp-text ul { margin: 0 0 .5em; padding-left: 18px; }
.hp-text img { display: block; width: 100%; height: auto; aspect-ratio: 560 / 313; object-fit: cover; border-radius: 8px; margin: 4px 0 10px; }
.hp-text mark { color: inherit; padding: 0 2px; }
.hp-text a { color: var(--hp-accent); font-weight: 600; text-decoration: underline; }
.hp-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 14px; padding: 10px 0 14px; border-top: 1px solid rgba(0,0,0,.1); font-size: .62rem; color: #555; }
.hp-wm { display: inline-flex; align-items: center; gap: 5px; background: rgba(0,0,0,.05); border-radius: 999px; padding: 4px 9px; }
.hp-wm-dot { width: 9px; height: 9px; border-radius: 50%; background: #f3dc9b; }
.hp-foot > span:last-child { text-decoration: underline; }
.hero-phone .hp-stats { position: relative; z-index: 2; grid-area: 1 / 1; align-self: start; justify-self: end; margin: -26px -40px 0 0; background: var(--surface); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow), 0 8px 24px rgba(43,33,24,.14); font-size: .8rem; color: var(--ink-2); transition: opacity .6s ease, visibility .6s; }
.hero-phone .hp-stats b { display: block; font-size: 1.4rem; color: var(--ink); font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .hp-slide, .hero-phone .hp-stats { transition: none; } }
@media (max-width: 820px) {
  .hero { padding: 36px 0 32px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-phone { margin-bottom: 20px; }
  .hero-phone .hp-stats { margin-right: -12px; }
}

.pill { display: inline-block; background: var(--accent-soft); color: var(--accent-text); border-radius: 999px; padding: 6px 14px; font-size: .85rem; font-weight: 600; margin-bottom: 18px; }

.section { padding: 56px 0; }
.section h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); text-align: center; margin-bottom: .3em; }
.section .sub { text-align: center; color: var(--ink-2); max-width: 620px; margin: 0 auto 36px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.step .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--vanilla); font-weight: 700; margin-bottom: 12px; }
.step h3 { font-size: 1.2rem; }
.step p { color: var(--ink-2); margin: 0; }

.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.compare ul { margin: 0; padding-left: 20px; color: var(--ink-2); }
.compare li { margin-bottom: 6px; }
.compare .bad h3 { color: var(--muted); }

.usecases { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.usecases span, .usecases a { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; }
.usecases a { color: var(--ink); text-decoration: none; border-color: var(--accent); font-weight: 600; }
.usecases a:hover { border-color: var(--ink-2); }
.section .uso-h2 { font-size: 1.25rem; text-align: left; margin: 0 0 .6em; }
.uso-others { padding-top: 0; }

.zero-tolerance { background: var(--ink); color: #fbf7f0; border-radius: 20px; padding: 40px 28px; }
.zero-tolerance h2 { color: #fff; text-align: left; }
.zero-tolerance p { color: #e2d7c9; max-width: 760px; }
.zero-tolerance .badge { display: inline-block; background: var(--danger); color: #fff; border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 14px; }
.zero-tolerance ul { color: #e2d7c9; padding-left: 20px; }
.zero-tolerance li { margin-bottom: 6px; }
.zero-tolerance strong { color: #fff; }
.zero-tolerance a { color: var(--vanilla); }

.faq-list { max-width: 720px; margin: 24px auto 0; display: grid; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; }
.faq-item summary { cursor: pointer; padding: 16px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.3rem; line-height: 1; color: var(--accent-text); }
.faq-item[open] summary::after { content: '–'; }
.faq-item p { margin: 0 0 16px; color: var(--ink-2); }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.mock-stats div { background: var(--accent-soft); border-radius: 10px; padding: 10px; text-align: center; }
.mock-stats b { display: block; font-size: 1.4rem; font-family: var(--serif); }
.mock-stats small { color: var(--ink-2); }

.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; margin-top: 40px; }
.footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--ink-2); }
.footer .sp { margin-left: auto; }

/* ---------- painel ---------- */
.page-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 32px 0 20px; }
.page-head h1 { margin: 0; font-size: 2rem; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.page-list { display: grid; gap: 12px; }
.page-row { display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: center; }
.page-row h3 { font-family: var(--sans); font-size: 1.1rem; margin: 0 0 4px; }
.page-row h3 a { color: var(--ink); text-decoration: none; }
.page-row .url { color: var(--muted); font-size: .9rem; word-break: break-all; }
.row-link { display: flex; gap: 6px; margin-top: 10px; max-width: 520px; }
.row-link input { flex: 1; min-width: 0; font-size: 1rem; font-weight: 600; color: var(--ink); background: var(--accent-soft); border-color: var(--vanilla); padding: 9px 12px; }
.row-link .btn { flex: none; }
.row-share { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: center; margin-top: 10px; max-width: 620px; }
.row-share .row-link { margin-top: 0; }
.row-share-main { flex: 1 1 240px; min-width: 0; }
.row-qr { flex: none; width: 88px; height: 88px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.row-qr-btn { flex: none; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; }
.row-qr-btn:hover .row-qr { border-color: var(--accent); }
.qr-modal { text-align: center; }
.qr-modal img { display: block; width: min(320px, 100%); height: auto; margin: 6px auto 10px; }
.qr-modal .qr-modal-link { font-weight: 600; color: var(--ink); word-break: break-all; }
.qr-modal .modal-actions { justify-content: center; }
.row-qr-dl { display: inline-block; margin-top: 8px; font-size: .9rem; font-weight: 600; color: var(--accent-text); }
.page-row .nums { display: flex; gap: 20px; }
.page-row .nums div { text-align: right; }
.page-row .nums b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.page-row .nums small { color: var(--muted); font-size: .78rem; }
.page-row .row-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 640px) { .page-row { grid-template-columns: 1fr; } .page-row .nums div { text-align: left; } }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; border-radius: 999px; padding: 3px 10px; margin-left: 6px; vertical-align: middle; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-published { background: var(--ok-soft); color: var(--ok); }
.status-draft { background: #f1ede8; color: var(--ink-2); }
.status-review { background: var(--warn-soft); color: var(--warn); }
.status-removed { background: var(--danger-soft); color: var(--danger); }

.empty { text-align: center; padding: 56px 24px; }
.empty p { color: var(--ink-2); }

/* ---------- editor ---------- */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; padding-bottom: 60px; }
@media (max-width: 900px) { .editor-layout { grid-template-columns: 1fr; } }
/* O cartão do editor ocupa a altura da tela e só o texto rola dentro dele:
   a barra de formatação fica acima do texto, nunca por cima. */
.editor-main { padding: 0; overflow: hidden; display: flex; flex-direction: column;
  height: calc(100dvh - 60px - var(--editor-bar-h) - 12px - 16px); min-height: 380px; }
.title-input { border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; font: 700 1.6rem/1.2 var(--serif) !important; padding: 20px 22px !important; outline: none !important; }
#editor-wrap .ql-toolbar.ql-snow { flex: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; background: var(--surface); }
#editor-wrap .ql-container.ql-snow { flex: 1; min-height: 0; border: 0; font-size: 17px; }
.title-input { flex: none; }
#editor-wrap .ql-editor { height: 100%; overflow-y: auto; padding: 22px 22px 60px; }
.side { display: grid; gap: 16px; position: sticky; top: calc(60px + var(--editor-bar-h) + 12px); }
@media (max-width: 900px) { .side { position: static; } }
.side .card { padding: 18px; }
.side h3 { font-family: var(--sans); font-size: 1rem; margin-bottom: 12px; }
.slug-field { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.slug-field span { padding: 11px 0 11px 12px; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.slug-field input { border: 0 !important; padding-left: 2px !important; min-width: 0; }
.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.colors label { font-size: .78rem; font-weight: 500; color: var(--ink-2); }
.colors input[type=color] { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--surface); cursor: pointer; }
.save-state { font-size: .82rem; color: var(--muted); }
:root { --editor-bar-h: 58px; }
.editor-bar { position: sticky; top: 60px; z-index: 15; display: flex; align-items: center; gap: 10px; height: var(--editor-bar-h); box-sizing: border-box; flex-wrap: nowrap; white-space: nowrap; margin-bottom: 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.editor-bar .actions { margin-left: auto; display: flex; gap: 8px; }
@media (max-width: 640px) { .editor-bar .hide-sm, .editor-bar .save-state { display: none; } }
.share { display: flex; gap: 6px; }
.share input { font-size: .85rem; padding: 8px 10px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); max-width: calc(100% - 32px); z-index: 50; font-size: .95rem; }
.toast.error { background: var(--danger); }
.toast[hidden] { display: none; }
.toast.has-action { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.toast-action { background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; border-radius: 999px; padding: 7px 14px; white-space: nowrap; }
.toast-action:hover { background: var(--accent-hover); }

/* ---------- estatísticas ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { padding: 18px 20px; }
.tile .label { color: var(--ink-2); font-size: .88rem; }
.tile .value { font: 700 2.2rem/1.1 var(--serif); font-variant-numeric: tabular-nums; margin-top: 4px; }
.tile .note { color: var(--muted); font-size: .8rem; margin-top: 4px; }

.chart-card h2, .list-card h2 { font-family: var(--sans); font-size: 1.05rem; margin-bottom: 4px; }
.chart-card .sub { color: var(--muted); font-size: .85rem; margin-bottom: 14px; }
.bars { position: relative; display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; height: 180px; align-items: end; border-bottom: 1px solid var(--line); }
.bars .gridline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); pointer-events: none; }
.bars .gridline span { position: absolute; right: 0; top: -18px; font-size: .72rem; color: var(--muted); background: var(--surface); padding-left: 4px; }
.bar { position: relative; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.bar i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.bar.is-empty i { background: transparent; }
.bar:hover i, .bar:focus i { background: #c98e1c; }
.bar .tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .78rem; padding: 6px 9px; border-radius: 8px; white-space: nowrap; z-index: 3; pointer-events: none; }
.bar:hover .tip, .bar:focus .tip { display: block; }
.bar:first-child .tip, .bar:nth-child(2) .tip { left: 0; transform: none; }
.bar:last-child .tip, .bar:nth-last-child(2) .tip { left: auto; right: 0; transform: none; }
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; margin-top: 6px; }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
table.simple { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.simple th { text-align: left; color: var(--muted); font-weight: 500; font-size: .8rem; padding: 6px 0; border-bottom: 1px solid var(--line); }
table.simple td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.simple td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
table.simple th.n { text-align: right; }
table.simple .u { word-break: break-all; }
.meter { height: 6px; background: var(--accent-soft); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.muted { color: var(--muted); }

/* ---------- admin ---------- */
.admin-section { margin-bottom: 28px; }
.admin-item { display: grid; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.admin-item .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-item form { display: inline; margin: 0; }
.admin-item pre { white-space: pre-wrap; background: #f6f2ec; padding: 10px; border-radius: 8px; font-size: .8rem; max-height: 200px; overflow: auto; margin: 0; }

/* editor: cartões de senha e data */
.access-card .hint { margin: 0 0 12px; line-height: 1.45; }
.access-card h3 .hint { font-weight: 400; margin: 0; }
.access-on { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; font-size: .9rem; font-weight: 600; }
.date-row { display: flex; gap: 8px; align-items: center; }
.date-row input { flex: 1; min-width: 0; }

/* editor: publicar no fim e excluir por último */
.publish-end .hint { margin: 0; line-height: 1.45; }
.publish-end .btn { width: 100%; margin-top: 12px; }
.danger-zone { border: 1.5px solid #f0c9c5; background: var(--danger-soft); }
.danger-zone h3 { color: var(--danger); }
.danger-zone .hint { margin: 0 0 12px; line-height: 1.45; }
.danger-zone .btn-danger-solid { width: 100%; }
.btn-danger-solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger-solid:hover { background: #8f1e18; }

/* modal (substitui alert/confirm do navegador) */
.modal { border: 0; border-radius: 16px; padding: 24px; width: min(440px, calc(100% - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(43, 33, 24, .25); }
.modal::backdrop { background: rgba(43, 33, 24, .45); }
.modal h2 { font-family: var(--sans); font-size: 1.2rem; margin: 0 0 10px; }
.modal p { margin: 0 0 10px; color: var(--ink-2); line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
@media (max-width: 480px) { .modal-actions .btn { flex: 1; } }

/* editor: a área de escrita usa as cores e a fonte escolhidas (iguais à página publicada) */
#editor-wrap { background: var(--p-bg); }
#editor-wrap .title-input { background: var(--p-bg) !important; color: var(--p-text) !important; font-family: var(--p-font) !important; }
#editor-wrap .title-input::placeholder { color: color-mix(in srgb, var(--p-text) 45%, transparent); }
#editor-wrap .ql-editor { color: var(--p-text); font-family: var(--p-font); }
#editor-wrap .ql-editor.ql-blank::before { color: color-mix(in srgb, var(--p-text) 45%, transparent); }
#editor-wrap .ql-editor a { color: var(--p-accent); font-weight: 600; }
#editor-wrap .ql-editor blockquote { border-left-color: var(--p-accent); }
.theme-preview { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--p-bg); color: var(--p-text); font-family: var(--p-font); }
.theme-preview .tp-label { font: 600 .7rem/1 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: color-mix(in srgb, var(--p-text) 55%, transparent); margin-bottom: 8px; }
.theme-preview strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.theme-preview p { margin: 0; font-size: .9rem; line-height: 1.45; }
.theme-preview .tp-link { color: var(--p-accent); font-weight: 600; text-decoration: underline; }

/* barra de formatação em português e no estilo Word */
/* compacta para caber numa linha: grupos mais próximos, seletores mais estreitos */
#editor-wrap .ql-toolbar.ql-snow { padding: 8px 10px; }
#editor-wrap .ql-toolbar.ql-snow .ql-formats { margin-right: 6px; }
#editor-wrap .ql-snow .ql-picker.ql-font { width: 112px; }
#editor-wrap .ql-snow .ql-picker.ql-header { width: 86px; }
#editor-wrap .ql-snow .ql-picker.ql-size { width: 78px; }
#editor-wrap .ql-snow .ql-picker-label { padding-left: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#editor-wrap .ql-snow .ql-picker.ql-font .ql-picker-options { min-width: 180px; }
#editor-wrap .ql-toolbar.ql-snow button { width: 26px; padding: 3px 4px; }
@media (min-width: 901px) and (max-width: 1150px) { .editor-layout { grid-template-columns: minmax(0, 1fr) 270px; } }
#editor-wrap .ql-snow .ql-picker.ql-header .ql-picker-label::before,
#editor-wrap .ql-snow .ql-picker.ql-header .ql-picker-item::before { content: 'Texto'; }
#editor-wrap .ql-snow .ql-picker.ql-header [data-value="1"]::before { content: 'Título'; }
#editor-wrap .ql-snow .ql-picker.ql-header [data-value="2"]::before { content: 'Subtítulo'; }
#editor-wrap .ql-snow .ql-picker.ql-font .ql-picker-label::before,
#editor-wrap .ql-snow .ql-picker.ql-font .ql-picker-item::before { content: 'Moderna'; }
#editor-wrap .ql-snow .ql-picker.ql-font [data-value="serif"]::before { content: 'Clássica'; font-family: Georgia, serif; }
#editor-wrap .ql-snow .ql-picker.ql-font [data-value="rounded"]::before { content: 'Arredondada'; font-family: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Trebuchet MS', sans-serif; }
#editor-wrap .ql-snow .ql-picker.ql-font [data-value="monospace"]::before { content: 'Máquina de escrever'; font-family: ui-monospace, 'Courier New', monospace; }
#editor-wrap .ql-snow .ql-picker.ql-size .ql-picker-label::before,
#editor-wrap .ql-snow .ql-picker.ql-size .ql-picker-item::before { content: 'Normal'; }
#editor-wrap .ql-snow .ql-picker.ql-size [data-value="small"]::before { content: 'Pequeno'; }
#editor-wrap .ql-snow .ql-picker.ql-size [data-value="large"]::before { content: 'Grande'; }
#editor-wrap .ql-snow .ql-picker.ql-size [data-value="huge"]::before { content: 'Enorme'; }
/* botões de cor: linha grossa com a cor atual (padrão = cor automática do texto) */
#editor-wrap .ql-snow .ql-color .ql-color-label { opacity: 1; stroke-width: 3px; stroke: var(--p-text); filter: drop-shadow(0 0 .6px rgba(0,0,0,.6)); }
#editor-wrap .ql-snow .ql-background .ql-color-label { opacity: 1; }
#editor-wrap .ql-snow .ql-color-picker .ql-picker-options { width: 176px; padding: 6px; }
#editor-wrap .ql-snow .ql-color-picker .ql-picker-item { width: 18px; height: 18px; margin: 2px; border: 1px solid rgba(0,0,0,.12); }
#editor-wrap .ql-snow .ql-color-picker .ql-picker-item:not([data-value]) { display: block; float: none; width: auto; height: auto; margin: 0 0 6px; padding: 6px 8px; border-radius: 6px; font: 600 13px/1 var(--sans); color: var(--ink); background: #f4efe8; }
#editor-wrap .ql-snow .ql-color .ql-picker-item:not([data-value])::before { content: 'Automática'; }
#editor-wrap .ql-snow .ql-background .ql-picker-item:not([data-value])::before { content: 'Sem cor'; }
.ql-more-colors { position: relative; display: block; clear: both; margin-top: 6px; padding: 6px 8px; border-radius: 6px; font: 600 13px/1 var(--sans); color: var(--ink); background: #f4efe8; cursor: pointer; }
.ql-more-colors input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }

/* caixinha de link do editor, em português */
#editor-wrap .ql-snow .ql-tooltip { border-radius: 10px; box-shadow: 0 6px 24px rgba(43,33,24,.18); border-color: var(--line); font-family: var(--sans); z-index: 10; }
#editor-wrap .ql-snow .ql-tooltip::before { content: 'Abrir link:'; }
#editor-wrap .ql-snow .ql-tooltip[data-mode=link]::before { content: 'Endereço do link:'; }
#editor-wrap .ql-snow .ql-tooltip a.ql-action::after { content: 'Editar'; }
#editor-wrap .ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: 'Salvar'; }
#editor-wrap .ql-snow .ql-tooltip a.ql-remove::before { content: 'Remover'; }
#editor-wrap .ql-snow .ql-tooltip input[type=text] { width: 220px; }
.own-visits { margin: -8px 0 16px; }
