/* ============================================================
   Artigos Altikids — estilo editorial moderno (mobile-first)
   Paleta: roxo / azul / coral · dark mode via prefers-color-scheme
   ============================================================ */

:root {
  --bg: #faf8ff;
  --bg2: #f1ecfd;
  --card: #ffffff;
  --text: #241d38;
  --muted: #6f6690;
  --border: #e8e1f8;
  --brand: #6d28d9;
  --brand2: #8b5cf6;
  --blue: #2563eb;
  --coral: #ff6f61;
  --teal: #0d9488;
  --amber: #d97706;
  --danger: #dc2626;
  --ring: rgba(109, 40, 217, 0.35);
  --shadow: 0 10px 28px -14px rgba(46, 25, 100, 0.22);
  --shadow-lift: 0 22px 44px -18px rgba(46, 25, 100, 0.32);
  --radius: 18px;
  --radius-sm: 10px;
  --grad: linear-gradient(135deg, #6d28d9 0%, #2563eb 55%, #ff6f61 110%);
  --header-bg: rgba(250, 248, 255, 0.82);
  --code-bg: #241d38;
  --code-text: #f3eefc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121020;
    --bg2: #191431;
    --card: #1e1936;
    --text: #eee9fb;
    --muted: #a89fc7;
    --border: #302850;
    --brand: #a78bfa;
    --brand2: #8b5cf6;
    --ring: rgba(167, 139, 250, 0.4);
    --shadow: 0 10px 28px -14px rgba(0, 0, 0, 0.6);
    --shadow-lift: 0 22px 44px -18px rgba(0, 0, 0, 0.7);
    --header-bg: rgba(18, 16, 32, 0.78);
    --code-bg: #0d0b18;
    --code-text: #e8e2f8;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1100px 500px at 85% -100px, rgba(139, 92, 246, 0.14), transparent 60%),
    radial-gradient(900px 420px at -10% -60px, rgba(37, 99, 235, 0.10), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5em; font-weight: 800; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 780px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.spacer { flex: 1; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 18px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }

.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 1.02rem; }
.logo:hover { text-decoration: none; }
.logo strong { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-mark {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 1.15rem;
  box-shadow: 0 6px 14px -6px rgba(109, 40, 217, 0.55);
}
.logo-mark.small { width: 26px; height: 26px; font-size: 0.85rem; border-radius: 8px; }

.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  padding: 7px 13px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 0.94rem;
}
.main-nav a:hover { color: var(--text); background: var(--bg2); text-decoration: none; }
.main-nav a.active { color: #fff; background: var(--brand); }

.search-form { display: flex; margin-left: auto; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 3px 4px 3px 14px; box-shadow: var(--shadow); }
.search-form input { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.92rem; width: 150px; outline: none; }
.search-form button {
  border: 0; cursor: pointer; background: var(--grad); color: #fff;
  width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center;
}
.header-cta { white-space: nowrap; }

.user-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.92rem; margin-left: auto; }

/* ------------------------------------------------------------ botões */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  padding: 9px 16px; border-radius: 12px; font: inherit; font-weight: 700; font-size: 0.94rem;
  cursor: pointer; box-shadow: var(--shadow); transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none !important;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--border); }
.btn-ghost:hover { background: var(--bg2); box-shadow: none; }
.btn-warn { background: var(--amber); border-color: transparent; color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); box-shadow: none; }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.btn-sm { padding: 5px 10px; font-size: 0.82rem; border-radius: 9px; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------ home: hero */
main { min-height: 60vh; padding: 34px 0 60px; }
.admin main { padding-top: 26px; }

.hero { margin-bottom: 34px; }
.hero-card {
  position: relative; display: grid; overflow: hidden;
  border-radius: 26px; background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--shadow-lift); color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero-card:hover { transform: translateY(-3px); text-decoration: none; }
.hero-media { position: relative; min-height: 220px; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-content { position: relative; padding: 26px 26px 22px; }
.hero-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.hero-new { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--coral); }
.hero-title { font-size: clamp(1.5rem, 3.6vw, 2.5rem); margin-bottom: 10px; }
.hero-excerpt { color: var(--muted); font-size: 1.04rem; max-width: 60ch; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 0.92rem; }
.hero-cta { margin-left: auto; font-weight: 800; color: var(--brand); }

@media (min-width: 900px) {
  .hero-card { grid-template-columns: 1.15fr 1fr; }
  .hero-media { min-height: 380px; }
  .hero-content { display: flex; flex-direction: column; justify-content: center; padding: 40px 44px; }
}

/* cover placeholders por categoria */
.cover-ph { display: grid; place-items: center; }
.cover-ph span { font-size: clamp(2.4rem, 6vw, 4rem); filter: saturate(1.1); }
.cover-artigo { background: linear-gradient(135deg, #7c3aed, #4f46e5 60%, #312e81); }
.cover-estudo { background: linear-gradient(135deg, #0ea5e9, #2563eb 60%, #1e3a8a); }
.cover-video { background: linear-gradient(135deg, #fb7185, #ff6f61 55%, #c2410c); }
.cover-outro { background: linear-gradient(135deg, #2dd4bf, #0d9488 60%, #115e59); }

/* ------------------------------------------------------------ badges/pills */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; color: #fff;
}
.badge-artigo { background: #7c3aed; }
.badge-estudo { background: #2563eb; }
.badge-video { background: #ff6f61; }
.badge-outro { background: #0d9488; }

.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.pill-published { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal); }
.pill-draft { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }

/* ------------------------------------------------------------ listagem */
.list-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 20px; }
.page-title { font-size: clamp(1.35rem, 2.6vw, 1.9rem); margin: 0; }
.page-title .q { color: var(--brand); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--muted); font-weight: 700; font-size: 0.9rem;
  transition: all 0.15s ease;
}
.tab:hover { color: var(--text); border-color: var(--brand2); text-decoration: none; transform: translateY(-1px); }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 8px 18px -10px rgba(109, 40, 217, 0.6); }

.card-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--brand2) 45%, var(--border)); text-decoration: none; }
.card-cover-wrap { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.card-cover { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.card:hover .card-cover { transform: scale(1.04); }
.card-cover-wrap .badge { position: absolute; top: 12px; left: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 1.08rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card:hover .card-title { color: var(--brand); }
.card-excerpt { color: var(--muted); font-size: 0.9rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin-top: auto; display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 0.8rem; flex-wrap: wrap; }

.pagination { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 36px; flex-wrap: wrap; }
.page-link {
  min-width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--card);
  color: var(--text); font-weight: 700; font-size: 0.92rem; box-shadow: var(--shadow);
}
.page-link:hover:not(.disabled):not(.current) { border-color: var(--brand2); text-decoration: none; transform: translateY(-1px); }
.page-link.current { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-link.disabled { opacity: 0.45; pointer-events: none; }
.page-gap { color: var(--muted); }

.empty-state { text-align: center; padding: 70px 20px; }
.empty-emoji { font-size: 3rem; margin-bottom: 10px; }
.empty-state h2 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); margin-bottom: 22px; }

/* ------------------------------------------------------------ página do artigo */
.article-page .narrow { padding-top: 8px; }
.back { display: inline-block; color: var(--muted); font-weight: 600; font-size: 0.92rem; margin-bottom: 18px; }
.back:hover { color: var(--brand); }

.article-head { margin-bottom: 24px; }
.article-head h1 { font-size: clamp(1.7rem, 4.4vw, 2.7rem); margin: 14px 0 10px; }
.lead { font-size: 1.13rem; color: var(--muted); max-width: 65ch; }
.article-meta { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 999px;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 0.8rem; flex: none;
}
.avatar.lg { width: 46px; height: 46px; font-size: 1rem; }

.article-cover { width: 100%; border-radius: 20px; box-shadow: var(--shadow-lift); margin-bottom: 30px; max-height: 460px; object-fit: cover; }
div.article-cover { aspect-ratio: 21 / 9; }

.toc {
  border: 1px solid var(--border); border-left: 4px solid var(--brand2);
  background: var(--card); border-radius: var(--radius-sm);
  padding: 16px 20px; margin-bottom: 30px; box-shadow: var(--shadow);
}
.toc strong { display: block; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 4px 0; }

.article-body { max-width: 720px; margin: 0 auto; font-size: 1.06rem; }
.article-body > * { max-width: 100%; }
.article-body h2 { font-size: 1.55rem; margin: 2.2em 0 0.7em; padding-top: 0.4em; }
.article-body h3 { font-size: 1.25rem; margin: 1.8em 0 0.6em; }
.article-body h4, .article-body h5, .article-body h6 { margin: 1.5em 0 0.5em; }
.article-body p { margin: 0 0 1.15em; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.article-body a:hover { text-decoration-color: var(--brand); }
.article-body img { border-radius: var(--radius-sm); box-shadow: var(--shadow); display: block; margin: 1.4em auto; }
.article-body video { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lift); margin: 1.4em 0; background: #000; }
.article-body blockquote {
  margin: 1.5em 0; padding: 6px 20px; border-left: 4px solid var(--coral);
  background: color-mix(in srgb, var(--coral) 7%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text); font-style: italic;
}
.article-body ul, .article-body ol { padding-left: 1.5em; margin: 0 0 1.2em; }
.article-body li { margin: 0.35em 0; }
.article-body li::marker { color: var(--brand2); font-weight: 700; }
.article-body code {
  background: color-mix(in srgb, var(--brand2) 12%, transparent); color: var(--brand);
  padding: 2px 7px; border-radius: 6px; font-size: 0.88em;
}
.article-body pre {
  background: var(--code-bg); color: var(--code-text);
  padding: 18px 20px; border-radius: var(--radius-sm); overflow-x: auto; margin: 1.5em 0;
  box-shadow: var(--shadow); font-size: 0.9rem; line-height: 1.55;
}
.article-body pre code { background: none; color: inherit; padding: 0; }
.article-body hr { border: 0; height: 3px; border-radius: 3px; background: var(--grad); opacity: 0.35; margin: 2.4em 0; }
.article-body table { border-collapse: collapse; width: 100%; margin: 1.5em 0; font-size: 0.95rem; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 9px 13px; text-align: left; }
.article-body th { background: var(--bg2); font-weight: 800; }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 46px 0 10px; }
@media (max-width: 600px) { .prevnext { grid-template-columns: 1fr; } }
.prevnext-card {
  border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-sm);
  padding: 14px 16px; box-shadow: var(--shadow); color: var(--text);
  display: flex; flex-direction: column; gap: 5px; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.prevnext-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); text-decoration: none; border-color: var(--brand2); }
.prevnext-card.next { text-align: right; }
.prevnext-card strong { font-size: 0.95rem; line-height: 1.35; }

.related { margin-top: 56px; }
.section-title { font-size: 1.4rem; margin-bottom: 18px; }

/* ------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg2); margin-top: 30px; }
.footer-inner { display: flex; flex-direction: column; gap: 12px; padding: 28px 20px; align-items: center; text-align: center; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.footer-brand strong { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.footer-nav { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.footer-nav a { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.footer-nav a:hover { color: var(--brand); }
@media (min-width: 800px) {
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* ------------------------------------------------------------ login */
.login-wrap { min-height: 70vh; display: grid; place-items: center; padding: 30px 16px; }
.login-card {
  width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border);
  border-radius: 24px; box-shadow: var(--shadow-lift); padding: 32px 30px;
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; font-size: 1.05rem; }
.login-logo .muted { display: block; font-size: 0.82rem; }
.login-logo strong { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hint { text-align: center; margin: 18px 0 0; }

/* ------------------------------------------------------------ formulários */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: 0.9rem; }
.field input, .field textarea, .field select, .input-sm {
  font: inherit; color: var(--text); background: var(--card);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 13px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}
.input-sm { width: auto; padding: 5px 10px; font-size: 0.84rem; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--brand2); box-shadow: 0 0 0 4px var(--ring);
}
.field textarea { resize: vertical; line-height: 1.6; }

.alert { border-radius: var(--radius-sm); padding: 12px 15px; margin-bottom: 16px; font-weight: 600; font-size: 0.94rem; border: 1px solid var(--border); background: var(--bg2); }
.alert-error { background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.alert-ok { background: color-mix(in srgb, var(--teal) 10%, transparent); border-color: color-mix(in srgb, var(--teal) 40%, transparent); color: var(--teal); }

/* ------------------------------------------------------------ admin */
.admin-page { padding-bottom: 40px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-head .page-title { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px;
}
.stat-n { font-size: 2rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; min-width: 720px; }
.table th {
  text-align: left; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--bg2);
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: color-mix(in srgb, var(--brand2) 4%, transparent); }
.td-title { font-weight: 700; color: var(--text); }
.td-title:hover { color: var(--brand); }
.td-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.row-dim { opacity: 0.62; }
.empty-row { text-align: center; color: var(--muted); padding: 34px !important; }
.inline-form { display: inline-flex; gap: 7px; align-items: center; margin: 0; }
.reset-form { flex-wrap: wrap; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 22px; }
.panel-title { font-size: 1.05rem; margin-bottom: 14px; }
.form-row { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; }
.form-row .field { margin-bottom: 0; flex: 1; min-width: 170px; }
.form-row .btn { flex: none; margin-bottom: 0; }

/* editor */
.editor-grid { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
@media (min-width: 1080px) { .editor-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } }
.editor-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 180px; }
.field-grow { flex: 2 !important; }
.cover-row { display: flex; gap: 8px; }
.cover-row input { flex: 1; }
.cover-thumb { margin-top: 10px; max-height: 130px; border-radius: var(--radius-sm); border: 1px solid var(--border); object-fit: cover; }

.toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tb {
  border: 1px solid var(--border); background: var(--bg2); color: var(--text);
  border-radius: 8px; padding: 5px 11px; font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer;
}
.tb:hover { border-color: var(--brand2); color: var(--brand); }
.hint { margin-top: 8px; }
.hint code { background: var(--bg2); padding: 1px 6px; border-radius: 5px; font-size: 0.85em; }

.editor-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
#upload-status:empty { display: none; }

.preview-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  position: sticky; top: 84px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; overflow: hidden;
}
.preview-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--border); background: var(--bg2); }
.preview-body { padding: 20px 22px; overflow-y: auto; font-size: 0.98rem; }
.preview-body .preview-title h1 { font-size: 1.5rem; }
@media (max-width: 1079px) { .preview-panel { position: static; max-height: 480px; } }

/* mídia */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.media-tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.media-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.media-thumb { aspect-ratio: 4 / 3; background: var(--bg2); display: grid; place-items: center; overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-video-ph { font-size: 2.6rem; text-decoration: none !important; }
.media-info { padding: 12px 14px 14px; }
.media-name { font-weight: 700; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.media-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------ diversos */
code { font-size: 0.9em; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 760px) {
  .header-inner { gap: 10px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .search-form { margin-left: auto; }
  .search-form input { width: 100px; }
  .header-cta { display: none; }
  .user-chip { margin-left: 0; }
}
