/*
 * YuuHub — interface dos painéis (cliente e MASTER).
 * Linguagem: casca cinza-clara com navegação lateral, conteúdo em painel branco,
 * tipografia compacta, traços finos, preto para ação principal e verde-lima só para destaque.
 * Todas as cores e medidas vêm das variáveis abaixo: para aplicar outro design system, basta trocá-las.
 */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/core/inter-latin.woff2") format("woff2");
}

:root {
  --shell: #f3f3f0;
  --panel: #ffffff;
  --sunken: #f7f7f5;
  --ink: #16171a;
  --ink-2: #3b3d42;
  --muted: #7b7d83;
  --faint: #a9abaf;
  --line: #ebebe7;
  --line-strong: #dcdcd6;

  --lime: #c9f26a;
  --lime-strong: #b4e445;
  --lime-soft: #f2f9dc;
  --lime-line: #d3ea96;
  --lime-ink: #2c4208;

  --ok: #2f7d4f;
  --ok-soft: #e7f4ea;
  --warn: #9a5b00;
  --warn-soft: #fbefd5;
  --warn-line: #f1dba9;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(22, 23, 26, .06);
  --shadow: 0 1px 2px rgba(22, 23, 26, .05), 0 8px 24px rgba(22, 23, 26, .06);
  --shadow-lg: 0 2px 6px rgba(22, 23, 26, .08), 0 24px 60px rgba(22, 23, 26, .18);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --side: 228px;
}

/* Transição suave entre páginas nos navegadores que suportam. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--shell);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
h1 { font-size: 21px; line-height: 1.25; letter-spacing: -.02em; font-weight: 650; margin: 0 0 14px; }
h2 { font-size: 14px; letter-spacing: -.005em; font-weight: 600; margin: 30px 0 10px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
p { margin: 0 0 10px; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: text-decoration-color .15s; }
a:hover { text-decoration-color: currentColor; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--sunken); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); }
.eyebrow { font-size: 13px; color: var(--muted); margin: 0 0 2px; }
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.ico { flex: none; }

/* ------------------------------------------------------------------ casca */
body.has-shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 14px 10px 10px;
  display: flex; flex-direction: column; gap: 14px;
  view-transition-name: side;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 6px 8px 10px; font-weight: 650; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.brand-name { display: inline-flex; }
.logo, .logo-mark { display: block; width: auto; flex: none; }
/* Com a navegação aberta aparece a logo inteira; a marca reduzida fica para a régua de ícones e o celular. */
.brand .brand-mark { display: none; }
body.is-wide .brand .brand-mark { display: inline-grid; }
.brand-mark {
  display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none;
  border-radius: 7px; background: var(--ink); color: var(--lime); font-size: 13px; font-weight: 800;
}
.brand-mark .logo-mark { margin-left: 1px; }
.brand-tag { font-size: 10px; font-weight: 700; letter-spacing: .08em; padding: 2px 6px; border-radius: 5px; background: var(--ink); color: var(--lime); }
.nav { display: grid; gap: 2px; }
.nav a, .side-user a {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.nav a .ico, .side-user .ico { color: var(--muted); transition: color .15s; }
.nav a:hover, .side-user a:hover { background: rgba(22, 23, 26, .05); color: var(--ink); }
.nav a[aria-current], .side-user a[aria-current] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }
.nav a[aria-current] .ico { color: var(--ink); }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.instance-one, .instance-switch {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px; margin: 0;
  background: var(--panel); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.instance-one strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.instance-one small { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.instance-avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 6px; background: var(--lime); color: var(--lime-ink); font-size: 12px; font-weight: 700; }
.instance-switch select { border: 0; padding: 2px 4px; background: transparent; font-weight: 600; box-shadow: none; }
.side-user { display: flex; align-items: center; gap: 4px; }
.side-user a { flex: 1; min-width: 0; }
.side-user a span { overflow: hidden; text-overflow: ellipsis; }
.side-user form { margin: 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(22, 23, 26, .06); color: var(--ink); }

main.page, main.wide { padding: 8px 8px 8px 0; min-width: 0; }
.main-inner { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; min-height: calc(100vh - 16px); }
.page-inner { padding: 26px 32px 56px; }
.page-inner > * { max-width: 1120px; }
main.wide .main-inner { overflow: hidden; }
main.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 480px at 50% 110%, rgba(201, 242, 106, .55), transparent 70%), var(--shell); }
main.center .main-inner { background: none; border: 0; min-height: 0; width: 100%; display: grid; place-items: center; }

/* No editor a navegação vira uma régua de ícones para dar espaço à prévia. */
body.is-wide { --side: 56px; }
body.is-wide .brand-name, body.is-wide .brand-tag, body.is-wide .nav a span, body.is-wide .side-user a span,
body.is-wide .instance-one > span:last-child, body.is-wide .instance-switch { display: none; }
body.is-wide .nav a, body.is-wide .side-user a { justify-content: center; padding: 9px 0; }
body.is-wide .brand { justify-content: center; padding: 4px 0 8px; }
body.is-wide .instance-one { justify-content: center; padding: 6px 0; background: none; box-shadow: none; }
body.is-wide .side-user { flex-direction: column; }
body.is-wide .side-user a { width: 100%; }

/* Entrada suave do conteúdo */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.page-inner > * { animation: rise .32s var(--ease) both; }
.page-inner > *:nth-child(2) { animation-delay: .03s; }
.page-inner > *:nth-child(3) { animation-delay: .06s; }
.page-inner > *:nth-child(4) { animation-delay: .09s; }
.page-inner > *:nth-child(n+5) { animation-delay: .12s; }

/* ------------------------------------------------------------------ estrutura */
.narrow { max-width: 620px !important; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head h1 { margin: 0; }
.head p.muted { margin: 4px 0 0; }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.grid-3 > .card { border: 0; border-radius: 0; box-shadow: none; border-left: 1px solid var(--line); background: none; }
.grid-3 > .card:first-child { border-left: 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.card > h2:first-child { margin-top: 0; }
.card > .table, .card > .table-wrap > .table { margin: -6px 0; }
.card-foot { margin: 16px -20px -18px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--sunken); border-radius: 0 0 var(--radius) var(--radius); }
.card.suggest { background: var(--lime-soft); border-color: var(--lime-line); }

.stat { display: grid; gap: 2px; padding: 16px 20px; }
.stat > span:first-child { color: var(--muted); font-size: 12.5px; }
.stat b { font-size: 28px; line-height: 1.15; letter-spacing: -.03em; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat b small { font-size: 14px; font-weight: 500; letter-spacing: 0; margin-left: 2px; color: var(--ink-2); }
.stat > span:last-child { color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------------------------ formulários */
.field { display: grid; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; line-height: 1.45; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=tel], input:not([type]), select, textarea {
  width: 100%; padding: 8px 10px; font: inherit; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: #c4c4bd; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22, 23, 26, .08); }
input[type=file] { font: inherit; font-size: 13px; }
input[type=checkbox] { accent-color: var(--ink); width: 15px; height: 15px; }
textarea { min-height: 78px; resize: vertical; line-height: 1.5; }
input:disabled, textarea:disabled, select:disabled, input[readonly] { background: var(--sunken); color: var(--muted); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.code-input { font: 600 22px var(--mono); letter-spacing: .3em; text-align: center; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
details > summary { cursor: pointer; padding: 4px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 13px; font: 550 13px var(--font); color: var(--ink);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  text-decoration: none; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .08s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { border-color: #bdbdb6; background: var(--sunken); }
.btn:active { transform: scale(.975); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2a2c31; border-color: #2a2c31; }
.btn.accent { background: var(--lime); border-color: var(--lime-strong); color: var(--lime-ink); }
.btn.accent:hover { background: var(--lime-strong); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: #e2aaa5; background: var(--bad-soft); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: rgba(22, 23, 26, .05); color: var(--ink); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.block { width: 100%; padding: 9px 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.icon { padding: 5px 7px; min-width: 28px; }

/* ------------------------------------------------------------------ tabelas, rótulos, listas */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--sunken); }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.card .table th:first-child, .card .table td:first-child { padding-left: 4px; }
.table td form { display: inline; }
.table a.strong { font-weight: 600; text-decoration: none; }
.table a.strong:hover { text-decoration: underline; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--sunken); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; text-decoration: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.ok::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 9px 28px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.flash { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; background: var(--lime-soft); border: 1px solid var(--lime-line); color: var(--lime-ink); font-weight: 500; animation: drop .3s var(--ease) both; }
.flash.error { background: var(--bad-soft); border-color: #f1c8c4; color: var(--bad); }
.flash.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.empty { text-align: center; padding: 56px 24px; color: var(--muted); border-style: dashed; }
.empty h2 { margin-top: 0; color: var(--ink); font-size: 15px; }
.empty p { max-width: 46ch; margin-left: auto; margin-right: auto; }
.hint { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); }
.secret { width: 100%; min-height: 92px; font: 12px/1.5 var(--mono); word-break: break-all; background: var(--sunken); }
ul.plain { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--ink-2); }
ol.plain { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--ink-2); }

/* ------------------------------------------------------------------ autenticação */
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.auth { width: 100%; max-width: 380px; padding: 28px; border-radius: 16px; box-shadow: var(--shadow-lg); border-color: transparent; animation: pop .4s var(--ease) both; }
.auth h1 { font-size: 19px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 650; margin-bottom: 26px; color: var(--ink); }
.auth-alt { margin-top: 12px; text-align: center; }
.qr { width: 184px; height: 184px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.qr svg { width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------------------ editor */
.editor { display: grid; grid-template-columns: 272px 368px minmax(0, 1fr); height: calc(100vh - 18px); }
.editor-col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.editor-col > header { padding: 0 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 52px; flex: none; }
.editor-col > header h2 { margin: 0; }
.editor-scroll { overflow-y: auto; padding: 12px; flex: 1; scrollbar-width: thin; }
.sections { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.section-item {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 4px 8px;
  padding: 8px; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer;
  transition: background .14s var(--ease), border-color .14s var(--ease), box-shadow .14s var(--ease);
}
.section-item:hover { background: var(--sunken); }
.section-item.selected { background: var(--panel); border-color: var(--ink); box-shadow: var(--shadow-sm); }
.section-item.hidden-section .section-name, .section-item.hidden-section .section-sub { opacity: .45; }
.section-item.sortable-ghost { opacity: .35; }
.section-item.sortable-chosen { box-shadow: var(--shadow); background: var(--panel); }
.handle { cursor: grab; color: var(--faint); font-size: 14px; line-height: 1; text-align: center; user-select: none; }
.handle.locked { cursor: default; font-size: 11px; }
.section-name { font-weight: 550; font-size: 13.5px; }
.section-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-actions { display: none; gap: 4px; grid-column: 2; flex-wrap: wrap; padding-top: 2px; }
.section-item.selected .section-actions { display: flex; animation: fade .2s both; }
.section-actions:empty { display: none !important; }
.section-actions .btn { color: var(--ink-2); font-weight: 500; box-shadow: none; padding: 3px 8px; }
.add-section { margin-top: 12px; display: flex; gap: 6px; }
.page-item { margin-bottom: 8px; background: var(--lime-soft); border-color: var(--lime-line); }
.page-item:hover { background: var(--lime-soft); border-color: var(--lime-strong); }
.page-item.selected { border-color: var(--ink); background: var(--lime-soft); }

.form-fields { display: grid; gap: 15px; animation: fade .22s var(--ease) both; }
.list-field { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; display: grid; gap: 8px; background: var(--sunken); }
.list-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; display: grid; gap: 10px; }
.list-item-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 550; color: var(--muted); }
.media-field { display: flex; gap: 10px; align-items: center; }
.media-thumb { width: 68px; height: 52px; border-radius: 6px; border: 1px solid var(--line); background: var(--sunken) center/cover no-repeat; flex: none; }
.counter { float: right; font-weight: 400; color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--bad); }
.field .err { color: var(--bad); font-size: 12px; font-weight: 500; }

.preview-col { display: flex; flex-direction: column; min-width: 0; background: var(--shell); }
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); min-height: 52px; flex-wrap: wrap; }
.rev { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rev b { color: var(--ink); font-weight: 600; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(201, 242, 106, .9); } 50% { box-shadow: 0 0 0 5px rgba(201, 242, 106, 0); } }
.dirty-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lime-strong); margin-right: 7px; animation: pulse 1.6s infinite; }
.preview-stage { flex: 1; min-height: 0; padding: 14px; display: flex; justify-content: center; }
.preview-stage iframe { width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); transition: width .35s var(--ease); }
.preview-stage.mobile iframe { width: 390px; }
.seg { display: inline-flex; padding: 2px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 6px; font: 550 12.5px var(--font); cursor: pointer; color: var(--muted); transition: background .15s, color .15s, box-shadow .15s; }
.seg button[aria-pressed=true] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }
.errors-box { background: var(--bad-soft); color: var(--bad); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; margin-bottom: 12px; animation: drop .25s var(--ease) both; }
.errors-box ul { margin: 6px 0 0; padding-left: 18px; }

/* Esqueleto de carregamento */
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--sunken) 25%, #ececE7 37%, var(--sunken) 63%) 0 0 / 400% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton + .skeleton { margin-top: 10px; }
.skeleton.w60 { width: 60%; } .skeleton.w40 { width: 40%; } .skeleton.tall { height: 36px; }

/* ------------------------------------------------------------------ modal, mídia, avisos */
.modal-back { position: fixed; inset: 0; background: rgba(22, 23, 26, .32); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 24px; animation: fade .18s both; }
.modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 740px; max-height: 86vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .26s var(--ease) both; }
.modal.sm { max-width: 420px; }
.modal > header { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal > header h2 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px; overflow-y: auto; color: var(--ink-2); }
.modal > footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); text-align: left; padding: 0; font: inherit; cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s; }
button.media-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.media-card .img { aspect-ratio: 4 / 3; background: var(--sunken) center/cover no-repeat; }
.media-card .meta { padding: 8px 10px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; align-items: center; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 10px; font-weight: 500; font-size: 13px; z-index: 60; box-shadow: var(--shadow-lg); animation: toast .28s var(--ease) both; }
.toast.error { background: var(--bad); }

/* ------------------------------------------------------------------ leads e marketing */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { min-width: 150px; }
.lead-contact { display: grid; gap: 1px; }
.lead-contact strong { font-weight: 600; }
.lead-contact a, .lead-contact span { color: var(--muted); font-size: 13px; }
.lead-message { max-width: 320px; color: var(--muted); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.state-grid { display: grid; grid-template-columns: max-content auto auto max-content; gap: 9px 18px; align-items: center; }
.state-grid > span:nth-child(4n) { white-space: nowrap; }
.state-grid .th { font-size: 12px; color: var(--muted); }
.state-grid strong { font-weight: 550; }

/* ------------------------------------------------------------------ telas menores */
@media (max-width: 1180px) {
  .editor { grid-template-columns: 240px minmax(0, 1fr); height: auto; }
  .preview-col { grid-column: 1 / -1; height: 80vh; border-top: 1px solid var(--line); }
  .editor-col { max-height: 70vh; }
}
@media (max-width: 860px) {
  body.has-shell { display: block; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; gap: 8px; overflow-x: auto; }
  .brand { padding: 4px 6px; }
  .brand-name { display: none; }
  .brand .brand-mark { display: inline-grid; }
  .nav { display: flex; gap: 2px; }
  .nav a span { display: none; }
  .nav a { padding: 8px 10px; }
  .side-foot { margin: 0 0 0 auto; display: flex; align-items: center; }
  .instance-one > span:last-child, .side-user a span { display: none; }
  .instance-one { padding: 4px; background: none; box-shadow: none; }
  main.page, main.wide { padding: 0 6px 6px; }
  .page-inner { padding: 18px 16px 40px; }
  .editor { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 1px 0; }
  .kv dd { margin-bottom: 9px; }
  .grid-3 > .card { border-left: 0; border-top: 1px solid var(--line); }
  .grid-3 > .card:first-child { border-top: 0; }
  .state-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; transition: none !important; }
}
