/* Linguagem visual no estilo ManyChat: rail estreito de ícones, barra de título
 * branca, canvas branco, cartões muito arredondados com tipografia grande.
 *
 * Reconstruído a partir de capturas reais do app — não é cópia pixel a pixel,
 * mas segue a mesma estrutura e as mesmas proporções. */

:root {
  --bg: #ffffff;
  --bg-2: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --surface-3: #eceef2;
  --line: #e7e9ee;
  --line-2: #dcdfe6;

  --text: #10151f;
  --text-2: #4a5265;
  --muted: #858c9b;

  --accent: #1d7afc;
  --accent-hover: #0b64e0;
  --accent-soft: #e8f1ff;

  --live: #e02f2f;
  --ok: #129d5c;
  --ok-soft: #e6f7ed;
  --warn: #e08c1a;
  --lav: #efeaff;
  --lav-line: #d9cfff;
  --err: #d93025;
  --err-soft: #fdeceb;

  --rail: 64px;
  --shadow-node: 0 2px 14px rgba(16, 24, 40, 0.10);
  --shadow-pop: 0 12px 40px rgba(16, 24, 40, 0.18);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.spacer { flex: 1; }
.center { text-align: center; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font: 12px ui-monospace, Consolas, monospace; }

/* ===================================================================== login */

.login-screen {
  min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(150deg, #10151f 0%, #1d2b45 50%, #1d7afc 140%);
}
.login-card { background: #fff; border-radius: 16px; padding: 34px; width: 100%; max-width: 380px; box-shadow: var(--shadow-pop); }
.login-brand { font-size: 24px; font-weight: 750; letter-spacing: -0.6px; margin-bottom: 24px; }
.login-card label { display: block; margin: 16px 0 0; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.login-card input { width: 100%; margin-top: 6px; padding: 11px 13px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; }
.login-card button.block { width: 100%; margin-top: 22px; }
.login-card button.link { margin-top: 10px; }

.alert { margin-top: 16px; padding: 11px 13px; background: var(--err-soft); border: 1px solid #f3c6c2; color: var(--err); border-radius: 9px; font-size: 13px; }

/* ======================================================================= app */

.app { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }

/* ------------------------------------------------------------------- rail */

.rail {
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0; gap: 6px; position: sticky; top: 0; height: 100vh;
}
.rail-logo {
  width: 30px; height: 30px; display: grid; place-items: center;
  font-weight: 800; font-size: 19px; color: var(--text); margin-bottom: 10px;
  font-family: Georgia, serif;
}
.rail-avatar { position: relative; margin-bottom: 14px; }
.rail-avatar .avatar { width: 32px; height: 32px; }
.rail-avatar .pro {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: 7.5px; font-weight: 800;
  padding: 1px 5px; border-radius: 3px; letter-spacing: 0.3px;
}
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 13px; flex-shrink: 0; }

.rail-nav { display: flex; flex-direction: column; gap: 4px; }
.rail-foot { margin-top: auto; }

.rail-item {
  position: relative; width: 38px; height: 38px; border: none; background: none;
  border-radius: 9px; color: #7c8494; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.rail-item svg { width: 21px; height: 21px; }
.rail-item:hover { background: var(--surface-2); color: var(--text); }
.rail-item.active { background: var(--surface-3); color: var(--text); }

/* tooltip preto, como no original */
.rail-item::after {
  content: attr(data-label);
  position: absolute; left: 46px; top: 50%; transform: translateY(-50%);
  background: #1c2333; color: #fff; padding: 5px 10px; border-radius: 7px;
  font-size: 12.5px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .12s; z-index: 50;
}
.rail-item:hover::after { opacity: 1; }

/* ------------------------------------------------------------------ shell */

.shell { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px; height: 58px; flex-shrink: 0;
  background: #fff; border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -0.3px; }
.topbar select { width: auto; min-width: 130px; padding: 6px 10px; }

.workarea { flex: 1; min-height: 0; background: var(--bg-2); }
.page { padding: 26px; }
.page.with-sub { display: grid; grid-template-columns: 226px 1fr; gap: 0; padding: 0; min-height: calc(100vh - 58px); }

.subnav { border-right: 1px solid var(--line); background: #fff; padding: 18px 12px; }
.subnav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 700; padding: 8px 10px 6px; }
.subnav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border: none; background: none; border-radius: 8px;
  color: var(--text-2); cursor: pointer; text-align: left; font-weight: 500; margin-bottom: 2px;
}
.subnav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.subnav-item:hover { background: var(--surface-2); }
.subnav-item.active { background: var(--surface-3); color: var(--text); font-weight: 600; }
.ch-ig { width: 16px; height: 16px; border-radius: 5px; background: linear-gradient(45deg,#f9ce34,#ee2a7b 50%,#6228d7); flex-shrink: 0; }

.subpage { padding: 26px; min-width: 0; }

.page-header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-header h2 { margin: 0; font-size: 27px; font-weight: 750; letter-spacing: -0.7px; }

/* saudação do painel */
.greet { margin-bottom: 24px; }
.greet h2 { margin: 0 0 6px; font-size: 40px; font-weight: 780; letter-spacing: -1.4px; }
.greet-sub { margin: 0; color: var(--text-2); font-size: 14px; }

/* ---------------------------------------------------------------- cartões */

.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 18px; }
.card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 650; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { margin: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 13px; margin-bottom: 22px; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 17px 18px; }
.metric .value { font-size: 30px; font-weight: 760; letter-spacing: -1px; line-height: 1.1; }
.metric .label { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* ---------------------------------------------------------------- inputs */

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.row input, .row select { flex: 1; min-width: 160px; }

input, select, textarea {
  background: #fff; border: 1px solid var(--line-2); border-radius: 9px;
  padding: 9px 12px; color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: #a3aab8; }
textarea { font-family: inherit; font-size: 13.5px; resize: vertical; line-height: 1.5; }

label { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
label > input, label > select, label > textarea { margin-top: 6px; font-weight: 400; }

button {
  padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line-2);
  background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; font-weight: 550;
}
button:hover { background: var(--surface-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 620; }
button.primary:hover { background: var(--accent-hover); }
button.ghost { background: #fff; }
button.link { background: none; border: none; color: var(--text-2); padding: 6px 8px; }
button.link:hover { color: var(--accent); background: none; }
button.danger { color: var(--err); }
button.danger:hover { background: var(--err-soft); }
button.small { padding: 5px 11px; font-size: 12.5px; }

.btn-link { background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 9px; text-decoration: none; font-weight: 620; }

/* ---------------------------------------------------------------- badges */

.badge { display: inline-block; padding: 3px 9px; border-radius: 5px; font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.badge.live { background: var(--live); color: #fff; }
.badge.draft { background: var(--surface-3); color: var(--muted); }
.badge.stopped { background: #3d4453; color: #fff; }

/* ------------------------------------------------------- lista de fluxos */

.flow-list { display: flex; flex-direction: column; gap: 12px; }
.flow-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; cursor: pointer;
}
.flow-card:hover { border-color: var(--line-2); box-shadow: 0 2px 10px rgba(16,24,40,.06); }
.flow-card-top { display: flex; align-items: center; gap: 11px; }
.flow-card-name { font-size: 15.5px; font-weight: 650; }
.flow-card-sub { display: flex; align-items: center; gap: 8px; margin-top: 9px; color: var(--muted); font-size: 12.5px; }
.flow-card-sub .ig-dot { width: 15px; height: 15px; border-radius: 50%; background: linear-gradient(45deg,#f9ce34,#ee2a7b 50%,#6228d7); flex-shrink: 0; }
.flow-actions { margin-left: auto; display: flex; gap: 6px; }

/* --------------------------------------------------------------- presets */

.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 16px; }
.preset-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; }
.preset-card:hover { border-color: var(--accent); }
.preset-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; margin-bottom: 12px; background: var(--accent-soft); }
.preset-card h4 { margin: 0 0 6px; font-size: 15px; font-weight: 650; }
.preset-card p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; flex: 1; }
.preset-steps { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.preset-steps span { background: var(--surface-2); border-radius: 5px; padding: 2px 7px; font-size: 11px; color: var(--text-2); }

/* ----------------------------------------------------------------- chart */

.chart { display: flex; align-items: flex-end; gap: 4px; height: 165px; padding-top: 8px; }
.bar-group { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-width: 0; }
.bar { border-radius: 4px 4px 0 0; min-height: 2px; }
.bar.in { background: var(--accent); }
.bar.out { background: var(--ok); }
.bar-label { font-size: 10px; color: var(--muted); text-align: center; margin-top: 4px; }

/* ----------------------------------------------------------------- funil */

.funnel-flow { margin-bottom: 18px; }
.funnel-flow > .name { font-weight: 650; font-size: 13px; margin-bottom: 9px; }
.funnel-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 12px; }
.funnel-name { width: 165px; color: var(--text-2); flex-shrink: 0; }
.funnel-track { flex: 1; height: 18px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.funnel-fill { display: block; height: 100%; background: var(--accent); min-width: 2px; border-radius: 5px; }
.funnel-num { width: 100px; text-align: right; color: var(--muted); font-size: 11px; }

/* ------------------------------------------------------------------ chat */

.chat-layout { padding: 0; overflow: hidden; display: grid; grid-template-columns: 330px 1fr; height: calc(100vh - 190px); min-height: 460px; }
@media (max-width: 900px) { .chat-layout { grid-template-columns: 1fr; height: auto; } }
.chat-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-filter { padding: 13px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
#contact-list { overflow-y: auto; flex: 1; }

.contact-row { display: flex; align-items: center; gap: 11px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.contact-row:hover { background: var(--bg-2); }
.contact-row.selected { background: var(--accent-soft); }
.contact-row .avatar { width: 38px; height: 38px; }
.contact-row .who { flex: 1; min-width: 0; }
.contact-row .name { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-row .when { color: var(--muted); font-size: 11.5px; }

.chat-thread { display: flex; flex-direction: column; min-height: 0; background: var(--bg-2); }
.thread { flex: 1; overflow-y: auto; padding: 20px; }
.empty-state { padding-top: 60px; }
.msg { margin-bottom: 9px; padding: 10px 14px; border-radius: 16px; max-width: 76%; white-space: pre-wrap; word-break: break-word; }
.msg.in { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.out { background: var(--accent); color: #fff; margin-left: auto; border-bottom-right-radius: 5px; }
.msg time { display: block; font-size: 10px; opacity: .65; margin-top: 4px; }

/* ================================================================= editor */

.editor { position: fixed; inset: 0; z-index: 30; background: #fff; display: flex; flex-direction: column; }

.editor-header {
  display: flex; align-items: center; gap: 11px; padding: 0 20px; height: 56px;
  background: #fff; border-bottom: 1px solid var(--line); flex-shrink: 0; z-index: 3;
}
.crumb { background: none; border: none; color: var(--text-2); padding: 4px 2px; font-weight: 500; }
.crumb:hover { color: var(--accent); background: none; }
.crumb-sep { color: #c3c8d2; }
.editor-name { background: transparent; border: 1px solid transparent; border-radius: 8px; font-size: 16px; font-weight: 680; padding: 5px 9px; width: 280px; }
.editor-name:hover { background: var(--surface-2); }
.editor-name:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.saved-flag { font-size: 13px; color: var(--muted); }
.saved-flag.ok::before { content: '✓ '; color: var(--ok); font-weight: 700; }

.editor-body { flex: 1; display: grid; grid-template-columns: 1fr 340px; min-height: 0; }

/* --- canvas: BRANCO, como no original --- */

.canvas { position: relative; overflow: auto; background: #fff; }
.viewport { position: relative; width: 4200px; height: 2800px; transform-origin: 0 0; }
.nodes { position: absolute; inset: 0; }
.edges { position: absolute; inset: 0; width: 4200px; height: 2800px; pointer-events: none; overflow: visible; }
.edges path.edge { fill: none; stroke: #9aa3b2; stroke-width: 1.6; pointer-events: stroke; marker-end: url(#seta); }
.edges path.edge:hover { stroke: var(--accent); stroke-width: 2.6; cursor: pointer; }

.canvas-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; }
.canvas-hint {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); color: var(--text-2); padding: 6px 14px;
  border-radius: 999px; font-size: 12.5px; pointer-events: none; z-index: 4;
}

.fab {
  position: absolute; top: 20px; right: 22px; z-index: 5;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); border: none; color: #fff; font-size: 27px; font-weight: 300;
  line-height: 1; box-shadow: 0 6px 20px rgba(29,122,252,.42); cursor: pointer;
}
.fab:hover { background: var(--accent-hover); }

.zoom-controls { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 7px; z-index: 5; }
.zoom-controls button {
  width: 34px; height: 34px; padding: 0; border-radius: 9px; background: #fff;
  border: 1px solid var(--line-2); font-size: 16px; color: var(--text-2);
  box-shadow: 0 1px 4px rgba(16,24,40,.08);
}

/* --- nó --- */

.node {
  position: absolute; width: 300px; background: #fff;
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-node); user-select: none;
}
.node.selected { border: 2px solid var(--accent); }

.node-head { display: flex; align-items: center; gap: 11px; padding: 15px 16px 11px; cursor: grab; }
.node-head:active { cursor: grabbing; }
.node-head .type-tag { margin-left: auto; font-size: 10.5px; color: #bcc2cd; }

.node-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.node-icon.ig { background: linear-gradient(45deg,#f9ce34,#ee2a7b 50%,#6228d7); }
.node-icon.bolt { background: none; color: var(--text); }
.node-icon.bolt svg { width: 24px; height: 24px; }
.node-icon.wait { background: var(--warn); }
.node-icon.condition { background: var(--ok); }
.node-icon.tag { background: #00a5b5; }
.node-icon.delay { background: #7c8494; }
.node-icon.end { background: var(--err); }

.node-titles { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.node-channel { font-size: 11.5px; color: var(--muted); }
.node-action { font-size: 17px; font-weight: 680; color: var(--text); letter-spacing: -.2px; }

.node-body { padding: 0 16px 12px; }

/* bolha da mensagem */
.chat-bubble {
  background: var(--surface-2); border-radius: 12px; padding: 12px 15px;
  font-size: 14px; color: var(--text); white-space: pre-wrap; word-break: break-word; line-height: 1.45;
}
.chat-bubble.empty { color: var(--muted); font-style: italic; }

/* botão da mensagem, com bolinha sólida de conexão */
.btn-chip {
  position: relative; margin-top: 9px; padding: 12px 14px;
  background: var(--surface-2); border-radius: 11px;
  text-align: center; font-size: 14px; font-weight: 600; color: var(--text);
}
.chip-dot {
  position: absolute; right: -7px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px; border-radius: 50%; background: #9aa3b2;
}

/* pill verde do gatilho */
.trigger-pill { display: flex; gap: 11px; align-items: flex-start; background: var(--ok-soft); border-radius: 12px; padding: 13px 14px; }
.trigger-pill-icon { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; margin-top: 1px; display: grid; place-items: center; color: #fff; background: linear-gradient(45deg,#f9ce34,#ee2a7b 50%,#6228d7); }
.trigger-pill-body { min-width: 0; flex: 1; }
.trigger-pill-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; }
.trigger-pill-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* "+ Novo Gatilho" tracejado */
.new-trigger-box {
  margin-top: 11px; border: 1.5px dashed var(--line-2); border-radius: 12px;
  padding: 14px; text-align: center; color: var(--accent); font-weight: 600; font-size: 14px;
}

/* pill lavanda do delay */
.delay-pill { display: flex; align-items: center; gap: 9px; background: var(--lav); border-radius: 11px; padding: 12px 14px; font-size: 14px; color: var(--text); }

.node .keyword-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.node .kw { background: rgba(255,255,255,.8); border-radius: 5px; padding: 2px 7px; font-size: 11.5px; color: var(--text-2); }
.node .kw.exclude { background: var(--err-soft); color: var(--err); }

/* rótulo de saída: "Então" / "Próximo Passo" */
.node-out { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 4px 16px 14px; color: var(--muted); font-size: 14px; }

/* handles */
.handle { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #9aa3b2; cursor: crosshair; z-index: 2; }
.handle:hover { background: var(--accent); }
.handle.in { left: -7px; top: 50%; transform: translateY(-50%); background: #fff; border: 2px solid #9aa3b2; }
.handle.out { right: -7px; }
.handle.armed { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }

.handle-label { position: absolute; right: 18px; font-size: 11px; color: var(--muted); pointer-events: none; white-space: nowrap; }

/* --- menu de passos --- */

.step-menu {
  position: absolute; top: 82px; right: 380px; z-index: 20; width: 290px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-pop); padding: 10px;
}
.step-menu-title { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 700; padding: 6px 8px 8px; }
.step-opt { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: none; background: none; border-radius: 9px; text-align: left; cursor: pointer; }
.step-opt:hover { background: var(--surface-2); }
.step-opt strong { display: block; font-size: 13.5px; font-weight: 620; }
.step-opt em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); }
.si { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; flex-shrink: 0; background: var(--surface-2); }
.si.ig { background: linear-gradient(45deg,#f9ce34,#ee2a7b 50%,#6228d7); }

/* --- propriedades --- */

.properties { background: #fff; border-left: 1px solid var(--line); padding: 20px; overflow-y: auto; }
.properties h3 { margin: 0 0 3px; font-size: 16px; }
.properties .subtitle { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 18px; font-weight: 700; }
.properties label { margin-top: 15px; }
.properties label:first-of-type { margin-top: 0; }
.properties-empty { padding: 50px 8px; text-align: center; color: var(--muted); }

.quick-replies-editor { border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 10px; margin-top: 7px; background: var(--bg-2); }
.quick-reply-row { display: flex; gap: 6px; margin-bottom: 6px; }
.quick-reply-row input { padding: 7px 9px; font-size: 12.5px; }
.quick-reply-row button { padding: 4px 9px; }
.qr-add { width: 100%; font-size: 12.5px; padding: 7px; }

.prop-actions { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 7px; }

.post-picker { margin-top: 7px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--bg-2); max-height: 250px; overflow-y: auto; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.post-thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 2.5px solid transparent; cursor: pointer; background: var(--surface-3); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-thumb.selected { border-color: var(--accent); }
.post-thumb .check { position: absolute; top: 3px; right: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--accent); color: #fff; display: none; place-items: center; font-size: 11px; font-weight: 700; }
.post-thumb.selected .check { display: grid; }
.post-thumb .kind { position: absolute; bottom: 2px; left: 5px; font-size: 9px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.85); text-transform: uppercase; font-weight: 700; }

.editor-issues {
  position: absolute; bottom: 16px; left: 24px; right: 380px; z-index: 10;
  background: #fff; border: 1px solid #f3c6c2; border-left: 4px solid var(--err);
  border-radius: 10px; padding: 13px 16px; font-size: 13px; color: var(--err);
  max-height: 40vh; overflow-y: auto; box-shadow: var(--shadow-node);
}
.editor-issues ul { margin: 5px 0 0; padding-left: 18px; }

/* ---------------------------------------------------------------- contas */

.account-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.account-form .wide { grid-column: 1 / -1; }
.oauth-box { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 12px; background: var(--accent-soft); margin-bottom: 18px; }
.oauth-box .txt { flex: 1; }
.oauth-box .txt strong { display: block; margin-bottom: 2px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 650; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
tr:last-child td { border-bottom: none; }
td.actions { text-align: right; white-space: nowrap; }

/* ----------------------------------------------------------------- toast */

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #10151f; color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 13.5px; z-index: 100; max-width: 90vw; box-shadow: var(--shadow-pop); font-weight: 550;
}
.toast.bad { background: var(--err); }
.toast.good { background: var(--ok); }

.hint { color: var(--muted); font-size: 13px; margin: 0 0 14px; line-height: 1.6; }
.issues li { color: var(--err); margin-bottom: 4px; }

@media (max-width: 860px) {
  .page.with-sub { grid-template-columns: 1fr; }
  .subnav { border-right: none; border-bottom: 1px solid var(--line); display: flex; gap: 6px; overflow-x: auto; }
  .editor-body { grid-template-columns: 1fr; }
  .properties { display: none; }
  .account-form { grid-template-columns: 1fr; }
}
