:root {
  --bg: #15161a;
  --surface: #1d1f24;
  --surface-raised: #24262c;
  --surface-2: #24262c;
  --surface-soft: #292b31;
  --border: #383b43;
  --border-light: #484b54;
  --text: #f4f4f5;
  --muted: #a4a7af;
  --subtle: #747780;
  --accent: #e02424;
  --accent-hover: #f23636;
  --accent-soft: rgba(224, 36, 36, .13);
  --blue: #4c8dff;
  --green: #3bc985;
  --yellow: #f4bd4f;
  --radius: 12px;
  --radius-sm: 10px;
  --preview-width: 360px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 75% -20%, rgba(224, 36, 36, .09), transparent 35rem),
    var(--bg);
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden], .hidden { display: none !important; }
.muted { color: var(--muted); }

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .15em;
}

.topbar, header.header {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(21, 22, 26, .92);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.profile-menu {
  position: relative;
  margin-left: auto;
}
a.brand { color: inherit; text-decoration: none; }
a.brand .brand-mark { transition: filter .15s; }
a.brand:hover .brand-mark { filter: brightness(1.08); }
a.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 14px; }
.brand > div:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: .96rem; }
.brand span { margin-top: 4px; color: var(--muted); font-size: .75rem; }

.view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #191a1f;
}
.view-tab {
  min-height: 30px;
  padding: 5px 12px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: .75rem;
  font-weight: 750;
  cursor: pointer;
}
.view-tab:hover { color: var(--text); }
.view-tab.active { color: white; background: var(--surface-soft); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: white;
  background: linear-gradient(145deg, #ef3838, #a80e18);
  box-shadow: 0 12px 32px rgba(224, 36, 36, .24);
  font-size: 1.6rem;
  font-weight: 900;
}

.brand-mark.small { width: 38px; height: 38px; border-radius: 11px; font-size: 1rem; }

.server-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: .78rem;
}

.storage-state {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #c7c9cf;
  background: var(--surface-soft);
  font-size: .7rem;
  font-weight: 750;
  white-space: nowrap;
}

.storage-state.is-connected {
  color: #34d399;
  border-color: rgba(52, 211, 153, .4);
  background: rgba(52, 211, 153, .08);
}

.profile-menu { position: relative; }
.profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-soft);
  cursor: pointer;
}
.profile-trigger:hover { border-color: #3f4149; }
.profile-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: linear-gradient(145deg, #ef3838, #a80e18);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}
.profile-meta { display: grid; line-height: 1.15; text-align: left; }
.profile-meta strong {
  max-width: 150px;
  overflow: hidden;
  color: var(--text);
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-plan { color: var(--muted); font-size: .68rem; font-weight: 750; }
.profile-plan.is-active { color: #34d399; }
.profile-chevron { width: 15px; height: 15px; color: var(--muted); }
.profile-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 254px;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .45);
}
.profile-panel.hidden { display: none; }
.profile-head {
  display: grid;
  gap: 3px;
  padding: 4px 8px 10px;
  border-bottom: 1px solid var(--border);
}
.profile-head strong {
  overflow: hidden;
  font-size: .82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-usage { margin: 6px 8px; color: var(--muted); font-size: .74rem; line-height: 1.4; }
.profile-action {
  width: 100%;
  display: block;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: .82rem;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.profile-action:hover { background: var(--surface-soft); }
.profile-action.primary {
  color: white;
  background: var(--accent);
  text-align: center;
}
.profile-action.primary:hover { background: #be123c; }
.profile-password { display: grid; gap: 6px; padding: 8px; border-top: 1px solid var(--border); }
.profile-password input { height: 36px; font-size: .8rem; }
.profile-password .profile-action { margin-top: 2px; }
.profile-password .profile-usage { margin: 2px 0 0; }
.profile-password .profile-usage:empty { display: none; }

.server-state i {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(59, 201, 133, .11);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8px var(--preview-width);
  align-items: start;
  width: 100%;
  min-height: calc(100vh - 66px);
  padding: 18px 20px 30px;
}

.content-column { min-width: 0; display: grid; gap: 18px; }

.performance-view { min-height: calc(100vh - 66px); padding: 18px 20px 30px; }
.performance-card { min-width: 0; overflow: hidden; }
.performance-heading { padding: 22px 22px 0; }
.performance-sync-status {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 22px 14px;
  padding: 12px 16px;
  border: 1px solid rgba(224, 36, 36, .35);
  border-radius: var(--radius-sm, 10px);
  background: rgba(224, 36, 36, .08);
  color: var(--text);
  font-size: .8rem;
}
.performance-sync-status.hidden { display: none !important; }
.performance-sync-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  line-height: 1.35;
}
.performance-sync-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(224, 36, 36, .3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.performance-sync-bar {
  position: relative;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}
.performance-sync-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), #ff7b72, transparent);
  animation: sync-slide 1.5s ease-in-out infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes sync-slide {
  0% { left: -40%; }
  100% { left: 100%; }
}
.platform-switches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 22px 18px;
}
.platform-switch-card {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #191b20;
}
.platform-switch-card.enabled { border-color: rgba(224, 36, 36, .35); background: rgba(224, 36, 36, .055); }
.platform-switch-card > div { min-width: 0; display: grid; gap: 4px; }
.platform-switch-card strong { font-size: .82rem; }
.platform-switch-card small { overflow: hidden; color: var(--subtle); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.platform-switch-card .platform-error { color: #ff9f9f; }
.toggle-control { display: inline-flex; grid-template-columns: auto auto; align-items: center; gap: 8px; cursor: pointer; }
.toggle-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-control input + span {
  position: relative;
  width: 38px;
  height: 22px;
  border: 1px solid #555862;
  border-radius: 999px;
  background: #303239;
  transition: background .15s, border-color .15s;
}
.toggle-control input + span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #b9bbc1;
  content: "";
  transition: transform .15s, background .15s;
}
.toggle-control input:checked + span { border-color: var(--accent); background: rgba(224, 36, 36, .28); }
.toggle-control input:checked + span::after { background: var(--accent); transform: translateX(16px); }
.toggle-control input:focus-visible + span { box-shadow: 0 0 0 3px rgba(224, 36, 36, .2); }
.toggle-control input:disabled + span { opacity: .45; cursor: wait; }
.toggle-control b { min-width: 58px; color: var(--muted); font-size: .68rem; }

.metric-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 22px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(15, 16, 20, .22);
}
.metric-card {
  display: grid;
  gap: 5px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-raised);
  /* O cartão é o contêiner de consulta do detalhamento: o layout da linha
     (nome + total + variação) depende da largura DELE, não da janela. Assim a
     mesma regra serve para o celular em duas colunas e para um desktop com o
     painel lateral comendo espaço. */
  container-type: inline-size;
}
.metric-card > span { color: var(--muted); font-size: .72rem; font-weight: 700; }
.metric-card strong { font-size: clamp(1.35rem, 2.3vw, 2rem); letter-spacing: -.035em; }
.metric-card small { color: var(--green); font-size: .67rem; }

/* Detalhamento do total do cartão por rede social. */
.metric-breakdown {
  display: grid;
  gap: 3px;
  margin: 9px 0 0;
  padding: 9px 0 0;
  border-top: 1px solid var(--border);
  list-style: none;
}
.metric-breakdown:empty { margin: 0; padding: 0; border-top: 0; }
.metric-breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 5px;
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
}
.metric-breakdown-name {
  overflow: hidden;
  color: var(--muted);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric-breakdown-value { font-weight: 800; }
.metric-breakdown-delta { color: var(--green); font-size: .6rem; font-weight: 700; }
.metric-breakdown-delta.negative { color: #ff9f9f; }
.performance-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; }
.performance-table-wrap { border-bottom: 0; }
.performance-table th { padding: 0; }
.performance-table td:first-child { min-width: 260px; white-space: normal; }
.performance-table td:first-child strong { display: block; }
.performance-table td:first-child a { color: var(--text); text-decoration: none; }
.performance-table td:first-child a:hover { color: #a9c8ff; }
.performance-table td:first-child small { display: flex; align-items: center; gap: 6px; margin-top: 5px; color: var(--subtle); font-size: .66rem; }
.platform-badge { display: inline-flex; padding: 4px 8px; border: 1px solid var(--border-light); border-radius: 999px; font-size: .68rem; font-weight: 800; }
.platform-badge.instagram { color: #ffadd5; border-color: rgba(255, 87, 160, .35); background: rgba(255, 87, 160, .1); }
.platform-badge.youtube { color: #ff9b9b; border-color: rgba(224, 36, 36, .4); background: var(--accent-soft); }
.platform-badge.tiktok { color: #a7f4ee; border-color: rgba(45, 207, 196, .35); background: rgba(45, 207, 196, .1); }
.platform-badge.facebook { color: #9ec5fe; border-color: rgba(13, 110, 253, .35); background: rgba(13, 110, 253, .1); }
.metric-value { display: inline-flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; font-weight: 800; }
.metric-delta { color: var(--green); font-size: .63rem; }
.metric-delta.negative { color: #ff9f9f; }
.metric-unavailable { color: var(--subtle); font-size: .7rem; font-weight: 500; }

/* ------------------------------------------------------------------ */
/* Gráfico de evolução por rede social                                  */
/* ------------------------------------------------------------------ */
.performance-chart-card {
  display: grid;
  gap: 14px;
  padding: 18px 22px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.performance-chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.performance-chart-head h3 { margin: 0; font-size: 1rem; letter-spacing: -.02em; }
.performance-chart-head p.muted { margin: 4px 0 0; font-size: .74rem; }
.performance-chart-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.performance-chart-segment { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-raised); }
.chart-segment-button {
  padding: 5px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.chart-segment-button:hover { color: var(--text); }
.chart-segment-button.active { background: var(--accent-soft); color: #ffb4b4; }

.performance-chart-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.chart-tab {
  position: relative;
  padding: 9px 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.chart-tab:hover { color: var(--text); }
.chart-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.chart-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 6px; }

.performance-chart-panel { display: grid; gap: 12px; }
.performance-chart-panel:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 8px; }
.performance-chart-legend { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.performance-chart-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.performance-chart-symbols { display: flex; align-items: center; gap: 14px; margin: 0; color: var(--subtle); font-size: .68rem; }
.performance-chart-symbols span { display: inline-flex; align-items: center; gap: 6px; }
.chart-dot-sample { width: 9px; height: 9px; border-radius: 999px; flex: none; }
.chart-dot-sample.reading { background: var(--muted); }
.chart-dot-sample.carried { border: 1.5px solid var(--muted); }
.chart-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--subtle);
  font-size: .73rem;
  font-weight: 700;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.chart-chip:hover { color: var(--text); }
.chart-chip.active { border-color: var(--border-light); background: var(--surface-soft); color: var(--text); }
.chart-chip:not(.active) { opacity: .62; }
.chart-chip-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--chart-color, var(--subtle)); flex: none; }
.chart-chip:not(.active) .chart-chip-dot { background: var(--subtle); }

.performance-chart-stage { position: relative; min-height: 220px; }
.performance-chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; opacity: .55; }
.chart-axis { stroke: var(--border-light); stroke-width: 1; }
.chart-axis-label { fill: var(--subtle); font-size: 10.5px; font-weight: 600; }
.chart-axis-y { text-anchor: end; }
.chart-axis-x { text-anchor: middle; }
.chart-line { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { stroke: var(--surface); stroke-width: 1.5; }
.chart-dot.carried { opacity: .9; }
.chart-guide { stroke: var(--border-light); stroke-width: 1; stroke-dasharray: 2 4; }

.performance-chart-tooltip {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 5px;
  min-width: 132px;
  padding: 9px 11px;
  border: 1px solid var(--border-light);
  border-radius: 9px;
  background: rgba(20, 21, 25, .96);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
  pointer-events: none;
}
.chart-tooltip-date { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .06em; }
.chart-tooltip-flag { padding: 2px 6px; border-radius: 999px; background: var(--accent-soft); color: #ffb4b4; font-size: .6rem; letter-spacing: 0; }
.chart-tooltip-note { color: var(--subtle); font-size: .6rem; font-style: normal; }
.chart-tooltip-row { display: flex; align-items: center; gap: 7px; font-size: .73rem; }
.chart-tooltip-row b { flex: 1; font-weight: 700; }
.chart-tooltip-row span:last-child { font-variant-numeric: tabular-nums; font-weight: 800; }
.performance-chart-hint { margin: 0; font-size: .7rem; }
.performance-chart-stage .empty-state { margin: 0; }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(29, 31, 36, .94);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .14);
}

.editor-card { padding: 22px; }
.queue-card { min-width: 0; overflow: hidden; }

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 19px;
}

.section-heading h2 { margin: 0; font-size: 1.18rem; line-height: 1.25; }
.section-heading .muted { margin: 5px 0 0; font-size: .84rem; }
.queue-heading { padding: 20px 20px 0; }
.queue-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px 15px; }
.queue-search { position: relative; width: min(100%, 560px); }
.queue-search input { padding-right: 38px; }
/* O "x" nativo do type=search só existe em navegadores WebKit (Chrome/Safari);
   no Firefox não há nada. O botão próprio vale para todos, então o nativo sai
   para não aparecerem dois. */
.queue-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-clear { position: absolute; top: 50%; right: 7px; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; transform: translateY(-50%); border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; transition: color .15s, background .15s; }
.search-clear:hover { background: var(--surface-soft); color: var(--text); }
.search-clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-clear svg { width: 14px; height: 14px; }
.series-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid color-mix(in srgb, var(--series-color) 55%, transparent); border-radius: 999px; color: color-mix(in srgb, var(--series-color) 75%, white); background: color-mix(in srgb, var(--series-color) 14%, transparent); font-size: .68rem; font-weight: 800; }
.series-badge::before { width: 7px; height: 7px; border-radius: 50%; background: var(--series-color); content: ""; }

.status-pill, .counter {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid var(--border-light);
  border-radius: 99px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: .72rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-pill.scheduled { color: #a8c7ff; border-color: rgba(76, 141, 255, .35); background: rgba(76, 141, 255, .1); }
.status-pill.published { color: #8de0b7; border-color: rgba(59, 201, 133, .34); background: rgba(59, 201, 133, .1); }
.status-pill.failed, .status-pill.needs_review { color: #ff9f9f; border-color: rgba(224, 36, 36, .4); background: var(--accent-soft); }
.status-pill.cancelled { color: #b3b5bc; }

form { display: grid; gap: 16px; }
.form-grid { display: grid; gap: 14px; }
.two-columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.publishing-options { display: grid; gap: 12px; }
.publishing-options > fieldset { min-width: 100%; }
.account-field { display: grid; gap: 9px; }
.top-account-field {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.account-picker {
  min-height: 112px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 13px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #181a1f;
}
.account-option {
  width: 118px;
  flex: 0 0 118px;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--muted);
  text-align: center;
}
.account-avatar-wrap { position: relative; width: 68px; height: 68px; }
.account-choice {
  width: 68px;
  height: 68px;
  display: block;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 50%;
  outline: none;
  color: var(--text);
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s, opacity .15s;
}
.account-choice:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--border-light); }
.account-choice:focus-visible { box-shadow: 0 0 0 3px rgba(224, 36, 36, .2); }
.account-option.selected .account-choice {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 36, 36, .14);
}
.account-choice:disabled { opacity: .45; cursor: not-allowed; }
.account-avatar {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: white;
  background: linear-gradient(145deg, #424650, #24262c);
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: .04em;
}
.account-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.avatar-edit {
  position: absolute;
  right: -3px;
  bottom: -1px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  padding: 0 0 1px;
  border: 2px solid #181a1f;
  border-radius: 50%;
  color: var(--text);
  background: #41444d;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.avatar-edit:hover { transform: scale(1.08); background: var(--accent); }
.account-name { max-width: 118px; color: #d7d8dc; font-size: .71rem; font-weight: 750; line-height: 1.25; }
.account-option.selected .account-name { color: var(--text); }
.account-unavailable { color: #e38e8e; font-size: .62rem; line-height: 1.2; }
.destination-choices { display: flex; flex-wrap: wrap; gap: 5px 18px; }
.datetime-24h {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto;
  gap: 9px;
}
.next-schedule { white-space: nowrap; }
.time-24h {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #181a1f;
}
.time-24h select { width: 68px; height: 32px; padding: 0 8px; }
.time-24h > span { color: var(--muted); font-weight: 800; }
.time-24h small { margin-left: 2px; color: var(--subtle); font-size: .65rem; font-weight: 750; }
.destination-choices .check-control { margin: 0; }
.option-box {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #181a1f;
}

.destination-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.destination-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 12px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #1d1f25, #17181d);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.destination-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
}
.destination-card:focus-within { border-color: var(--accent); }
.destination-card:has(.destination-card-input:disabled) {
  opacity: .55;
  cursor: not-allowed;
}
.destination-card:has(.destination-card-input:disabled):hover {
  border-color: var(--border);
  box-shadow: none;
}

.destination-card-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
}

.destination-card-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.destination-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .20), 0 4px 14px rgba(0, 0, 0, .32);
}
.destination-card-badge.instagram { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); }
.destination-card-badge.youtube { background: linear-gradient(180deg, #ff4747, #dc0000); }
.destination-card-badge.tiktok {
  background: linear-gradient(145deg, #24262e, #050506);
  border: 1px solid #3a3d46;
}
.destination-card-badge.facebook { background: linear-gradient(180deg, #1877f2, #0d65d9); }

.destination-card-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.destination-card-title b { font-size: .82rem; color: var(--text); font-weight: 700; }
/* Faixas de status do topo do painel. O `.card` não traz padding próprio e
   estas nunca definiram nenhum, então ícone, texto e botão encostavam na borda.
   O valor lateral (20px) segue o cabeçalho da fila; o vertical pequeno evita
   que a segunda linha de texto toque a borda de baixo. */
.subscription-banner,
.trial-banner,
.tiktok-banner {
  padding: 12px 20px;
}
.subscription-banner {
  margin-bottom: 18px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.4);
}
.subscription-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
}
.subscription-banner-icon {
  font-size: 1.8rem;
  flex: none;
}
.subscription-banner-text {
  flex: 1;
}
.subscription-banner-text strong {
  display: block;
  color: #bbf7d0;
  font-size: 1.05rem;
  margin-bottom: 2px;
}
.subscription-banner-text p {
  margin: 0;
  color: #86efac;
  font-size: 0.9rem;
}
/* Aviso do teste grátis: só aparece nos últimos 3 dias ou depois de vencer. */
.trial-banner {
  margin-bottom: 18px;
  background: rgba(244, 189, 79, 0.08);
  border: 1px solid rgba(244, 189, 79, 0.4);
}
.trial-banner.is-expired {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.4);
}
.trial-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.trial-banner-icon {
  font-size: 1.8rem;
  flex: none;
}
.trial-banner-text {
  flex: 1;
  min-width: 200px;
}
.trial-banner-text strong {
  display: block;
  color: #fcd34d;
  font-size: 1.05rem;
  margin-bottom: 2px;
}
.trial-banner.is-expired .trial-banner-text strong {
  color: #fda4af;
}
/* A mensagem usa a mesma família de cor do aviso do TikTok ao lado: cinza
   aqui parecia texto menor, embora o tamanho fosse o mesmo (0.9rem). */
.trial-banner-text p {
  margin: 0;
  color: #fde68a;
  font-size: 0.9rem;
}
.trial-banner.is-expired .trial-banner-text p {
  color: #fecdd3;
}
.tiktok-banner {
  margin-bottom: 18px;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.4);
}
.tiktok-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.tiktok-banner-icon {
  font-size: 1.8rem;
  flex: none;
}
.tiktok-banner-text {
  flex: 1;
  min-width: 200px;
}
/* Mesma estrutura das outras faixas de status (assinatura e teste grátis):
   título em negrito e mensagem abaixo, na mesma família de cor. Sem o título,
   a faixa virava a única sem hierarquia e a linha parecia maior que as vizinhas. */
.tiktok-banner-text strong {
  display: block;
  color: #fcd34d;
  font-size: 1.05rem;
  margin-bottom: 2px;
}
.tiktok-banner-text p {
  margin: 0;
  color: #fde68a;
  font-size: 0.9rem;
}
.tiktok-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.onboarding { margin-bottom: 18px; padding: 16px 20px; }
.onboarding-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.onboarding-head h2 { margin: .1em 0 0; font-size: 1.05rem; }
.onboarding-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.onboarding-steps li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.onboarding-steps .button { margin-left: auto; }
.destination-card-hint {
  justify-self: start;
  color: var(--subtle);
  font-size: .7rem;
  font-weight: 500;
  line-height: 1.35;
}

/* Aviso de direta indisponível: só aparece com a trava de emergência ligada. */
.direct-unavailable {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px dashed var(--border-light);
  border-radius: 8px;
  background: rgba(244, 189, 79, .06);
}
.direct-unavailable small { color: var(--muted); font-size: .7rem; font-weight: 600; flex: 1; min-width: 180px; }

.hint-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: .68rem;
  font-weight: 800;
  cursor: help;
  vertical-align: 1px;
  flex: none;
  user-select: none;
}
.hint-dot:hover { color: var(--text); border-color: var(--accent); }
.hint-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.destination-card-check {
  margin-left: auto;
  flex: none;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--border-light);
  color: transparent;
  font-size: .74rem;
  font-weight: 900;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
}
.destination-card-check::after { content: "✓"; }
.destination-card.selected .destination-card-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* inner controls (feed toggle / TikTok mode / story toggle) sit in a footer */
.destination-card-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.destination-card .toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  color: var(--muted);
}
.destination-card .toggle-control b { min-width: 0; color: var(--muted); font-size: .7rem; font-weight: 600; }
.destination-card .feed-toggle input + span {
  width: 30px;
  height: 17px;
}
.destination-card .feed-toggle input + span::after {
  width: 11px;
  height: 11px;
  top: 2px;
  left: 2px;
}
.destination-card .feed-toggle input:checked + span {
  border-color: var(--accent);
  background: rgba(224, 36, 36, .28);
}
.destination-card .feed-toggle input:checked + span::after {
  background: var(--accent);
  transform: translateX(13px);
}

.tiktok-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #14151a;
}
.tiktok-mode-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
  transition: background .16s, color .16s, box-shadow .16s;
}
.tiktok-mode-option:hover { color: var(--text); }
.tiktok-mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.tiktok-mode-option.selected {
  background: linear-gradient(180deg, rgba(224, 36, 36, .34), rgba(224, 36, 36, .22));
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.tiktok-mode-option:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }

label { display: grid; gap: 7px; color: #d7d8dc; font-size: .78rem; font-weight: 700; }
label small { justify-self: end; color: var(--subtle); font-weight: 500; }
.caption-field { display: grid; gap: 7px; }
.caption-field > label { display: block; }
.caption-field > small { justify-self: end; color: var(--subtle); font-size: .72rem; font-weight: 500; }
.story-field {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
}
.story-field-inner {
  display: grid;
  gap: 10px;
}
.story-toggle b {
  font-size: .78rem;
  color: #d7d8dc;
}
.story-text-wrap {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.story-text-wrap.hidden {
  display: none !important;
}
/* Dentro do card do Facebook, a frase dispensa a caixa própria. */
.destination-card .story-text-wrap {
  margin-top: 2px;
  padding: 0;
  background: transparent;
  border: 0;
}
.story-text-wrap label {
  font-size: .72rem;
  color: var(--muted);
}
.story-text-wrap input {
  padding: 8px 12px;
  font-size: .82rem;
}

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 9px; color: #d7d8dc; font-size: .78rem; font-weight: 700; }

input:not([type="checkbox"]), select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: #181a1f;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

input:not([type="checkbox"]), select { height: 42px; padding: 0 12px; }
textarea { min-height: 260px; resize: vertical; padding: 11px 12px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(224, 36, 36, .1); background: #1b1d22; }
input:disabled, select:disabled, textarea:disabled { color: #999ba3; background: #202126; cursor: not-allowed; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}

.check-control {
  display: inline-flex;
  grid-auto-flow: column;
  grid-template-columns: 18px auto;
  align-items: center;
  justify-content: start;
  gap: 8px;
  margin: 0 15px 7px 0;
  cursor: pointer;
  font-size: .83rem;
  font-weight: 600;
}

.check-control input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.feed-control { margin: 0; }

.file-field input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-picker {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 15px;
  border: 1px dashed #555863;
  border-radius: 9px;
  background: #191b20;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.file-picker:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-picker b { color: var(--text); font-size: .83rem; }
.file-picker em { overflow: hidden; color: var(--muted); font-size: .76rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }

.upload-progress { display: grid; gap: 5px; }
.upload-progress > div { height: 5px; overflow: hidden; border-radius: 10px; background: var(--surface-soft); }
.upload-progress > div span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--accent), #ff6a5e); transition: width .15s; }
.upload-progress small { color: var(--muted); font-size: .72rem; }

.form-error { min-height: 0; margin: 0; color: #ff9898; font-size: .8rem; }
.form-error:empty { display: none; }

/* Aviso não-bloqueante: conta TikTok ausente. Anunciado por role=alert. */
.form-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(244, 189, 79, .5);
  border-radius: 8px;
  color: #ffdc8a;
  background: rgba(244, 189, 79, .1);
  font-size: .78rem;
  font-weight: 600;
}
.form-warning .button { margin-left: auto; }
/* Aviso do teto de rascunhos do TikTok: informa sem assustar — o limite é da
   plataforma, não do plano, e o agendamento continua sendo aceito. */
.form-warning.warn-soft {
  border-color: rgba(244, 189, 79, .3);
  background: rgba(244, 189, 79, .06);
  color: var(--muted);
  font-size: .82rem;
}
.form-actions, .preview-actions { display: flex; justify-content: flex-end; gap: 9px; }

.button {
  min-height: 37px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-soft);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 750;
  cursor: pointer;
  transition: transform .12s, background .15s, border-color .15s;
}

.button:hover:not(:disabled) { border-color: #5a5d66; background: #32343b; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { opacity: .4; cursor: not-allowed; }
.button.primary { border-color: var(--accent); background: var(--accent); }
.button.primary:hover:not(:disabled) { border-color: var(--accent-hover); background: var(--accent-hover); }
.button.secondary { border-color: #4b4e57; background: #303239; }
.button.ghost { border-color: var(--border); background: transparent; }
.button.danger-ghost { border-color: rgba(224, 36, 36, .35); color: #ff9b9b; background: transparent; }
.button.danger { border-color: #b91f2a; color: white; background: #a51622; }
.button.danger:hover:not(:disabled) { border-color: var(--accent-hover); background: #c6202c; }
.button.wide { width: 100%; }

.table-wrap { position: relative; min-height: 190px; overflow: auto; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.table-wrap > table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; min-width: 1200px; }
.queue-table-wrap > .queue-table { width: 100%; min-width: 1200px; }
.queue-table td:nth-child(2) { max-width: 280px; }
.table-wrap thead th:nth-child(1) { width: 52px; }
.table-wrap thead th:nth-child(2) { width: 280px; }
.table-wrap thead th:nth-child(3) { width: 210px; }
.table-wrap thead th:nth-child(4) { width: 120px; }
.table-wrap thead th:nth-child(5) { width: 150px; }
.table-wrap thead th:nth-child(6) { width: 110px; }
.table-wrap thead th:nth-child(7) { width: 96px; }
.table-wrap thead th:nth-child(8) { width: 122px; }
.table-wrap thead th:nth-child(9) { width: 80px; }
.table-wrap thead th:nth-child(10) { width: 180px; }
.table-wrap thead th:nth-child(11) { width: 244px; }
.performance-table-wrap thead th:nth-child(1) { width: 28%; }
.performance-table-wrap thead th:nth-child(2) { width: 9%; }
.performance-table-wrap thead th:nth-child(3) { width: 14%; }
.performance-table-wrap thead th:nth-child(4) { width: 10%; }
.performance-table-wrap thead th:nth-child(5) { width: 8%; }
.performance-table-wrap thead th:nth-child(6) { width: 9%; }
.performance-table-wrap thead th:nth-child(7) { width: 10%; }
.performance-table-wrap thead th:nth-child(8) { width: 12%; }
table { width: 100%; border-collapse: collapse; font-size: .77rem; white-space: nowrap; }
col.status-column { width: 122px; }
col.actions-column { width: 244px; }
thead { position: sticky; z-index: 2; top: 0; background: #24262b; }
th { padding: 0; border-bottom: 1px solid var(--border-light); text-align: left; }
th button { width: 100%; padding: 11px 12px; border: 0; color: #bfc1c7; background: transparent; text-align: left; font-size: .71rem; font-weight: 800; cursor: pointer; }
th button:hover { color: white; background: #303239; }
th button.sorted::after { margin-left: 6px; color: var(--accent); content: "↓"; }
th button.sorted.asc::after { content: "↑"; }
td { max-width: 360px; overflow: hidden; padding: 10px 12px; border-bottom: 1px solid #303239; color: #d5d6da; text-overflow: ellipsis; }
.account-badge { display: inline-flex; align-items: center; gap: 7px; }
.account-avatar.compact { width: 25px; height: 25px; flex: 0 0 25px; font-size: .55rem; }
.status-cell { width: 122px; min-width: 122px; max-width: 122px; }
.actions-cell { width: 244px; min-width: 244px; max-width: 244px; overflow: visible; }
th.actions-cell, td.actions-cell {
  position: sticky;
  z-index: 1;
  right: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
}
th.actions-cell { z-index: 3; padding: 11px 12px; color: #bfc1c7; background: #24262b; font-size: .71rem; font-weight: 800; }
tbody tr:hover td.actions-cell { background: var(--surface-soft); }
tbody tr.selected td.actions-cell { background: #26334a; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.row-actions > span { display: contents; }
.button.compact { min-height: 28px; padding: 5px 8px; border-radius: 6px; font-size: .66rem; }
.button.icon-button { position: relative; width: 30px; min-width: 30px; padding: 0; }
.icon-button svg { width: 15px; height: 15px; stroke-width: 1.8; }
.icon-button[data-tooltip]::after {
  position: absolute;
  z-index: 10;
  right: 50%;
  bottom: calc(100% + 7px);
  padding: 5px 7px;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  color: var(--text);
  background: #101115;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .35);
  content: attr(data-tooltip);
  font-size: .66rem;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 3px);
  transition: opacity .12s, transform .12s;
  white-space: nowrap;
}
/* O balão só existe quando há texto: sem [data-tooltip] o ::after vazio
   aparecia como bolha vazia acima do botão (visível no toque, onde o :hover
   gruda). O :hover do balão vale só com mouse; o teclado usa :focus-visible. */
.icon-button[data-tooltip]:focus-visible::after { opacity: 1; transform: translate(50%, 0); }
@media (hover:hover) {
  .icon-button[data-tooltip]:hover::after { opacity: 1; transform: translate(50%, 0); }
}
tbody tr { cursor: pointer; transition: background .1s; }
tbody tr:hover { background: #292b31; }
tbody tr.selected { background: rgba(76, 141, 255, .16); box-shadow: inset 3px 0 var(--blue); }
tbody tr.selected td { color: #f6f7f8; }
.destination-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.destination-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  color: #c4c6cc;
  background: #303239;
  font-size: .67rem;
  line-height: 1.15;
}
.destination-status b { color: inherit; font-size: .65rem; letter-spacing: .01em; }
.destination-status span { color: #f5f5f6; font-weight: 800; }
.destination-icon { display: inline-flex; color: inherit; }
.destination-icon svg { width: 14px; height: 14px; }
/* Só-ícone na coluna Destinos: círculo com a cor do estado
   (igual à etiqueta da coluna Estado). */
.destination-status.destination-icon-only {
  padding: 5px;
  border-radius: 50%;
}
.destination-status.destination-icon-only .destination-icon svg { width: 15px; height: 15px; }
/* Cores por estado: azul = ainda não publicado, verde = publicado,
   amarelo = atenção/revisão, vermelho = erro. */
.destination-status.pending,
.preview-target-status.pending {
  border-color: rgba(76, 141, 255, .5);
  color: #a9c8ff;
  background: rgba(76, 141, 255, .15);
}
.destination-status.uploading,
.preview-target-status.uploading {
  border-color: rgba(76, 141, 255, .5);
  color: #a9c8ff;
  background: rgba(76, 141, 255, .15);
}
.destination-status.publish_requested,
.preview-target-status.publish_requested {
  border-color: rgba(76, 141, 255, .5);
  color: #a9c8ff;
  background: rgba(76, 141, 255, .15);
}
.destination-status.published,
.preview-target-status.published {
  border-color: rgba(59, 201, 133, .48);
  color: #9be7c0;
  background: rgba(59, 201, 133, .15);
}
.destination-status.failed,
.preview-target-status.failed {
  border-color: rgba(224, 36, 36, .52);
  color: #ffaaa8;
  background: rgba(224, 36, 36, .16);
}
.destination-status.needs_review,
.preview-target-status.needs_review {
  border-color: rgba(244, 189, 79, .55);
  color: #ffe08a;
  background: rgba(244, 189, 79, .15);
}
.destination-status.not_selected,
.preview-target-status.not_selected {
  border-color: var(--border-light);
  color: #aeb0b7;
  background: #303239;
}
.empty-state { display: grid; min-height: 190px; place-items: center; color: var(--muted); font-size: .84rem; }

.panel-resizer { height: calc(100vh - 102px); margin: 0; cursor: col-resize; touch-action: none; }
.panel-resizer::before { display: block; width: 2px; height: 100%; margin: auto; border-radius: 9px; background: var(--border); content: ""; transition: width .15s, background .15s; }
.panel-resizer:hover::before, .panel-resizer.dragging::before { width: 4px; background: var(--accent); }

.preview-panel {
  position: sticky;
  top: 84px;
  height: calc(100vh - 102px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 19px;
  overflow: auto;
}

.preview-panel .section-heading { margin-bottom: 14px; }
.preview-panel h2 { max-width: 245px; font-size: .96rem; }
.video-frame { position: relative; min-height: 0; flex: 1; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #090a0c; }
.video-frame video { width: 100%; height: 100%; max-height: 100%; object-fit: contain; background: #000; }
.video-placeholder { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; padding: 25px; color: var(--subtle); text-align: center; pointer-events: none; }
.video-placeholder p { max-width: 190px; margin: 0; font-size: .78rem; line-height: 1.45; }
.preview-details { display: grid; gap: 0; margin: 14px 0; }
.preview-details div { display: flex; justify-content: space-between; gap: 15px; padding: 8px 0; border-bottom: 1px solid #303239; font-size: .73rem; }
.preview-details dt { color: var(--subtle); }
.preview-details dd { margin: 0; color: #d7d8dc; text-align: right; }
.preview-details .preview-target-status {
  padding: 2px 7px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
}
.preview-actions { flex-wrap: wrap; }

/* Somente a conta administrativa (dona) enxerga estes blocos. */
#app:not(.is-admin) .admin-only { display: none !important; }

/* Navegação do painel: dono, admin e suporte. Suporte não vê admin-only. */
#app:not(.is-admin):not(.is-panel) .panel-only { display: none !important; }

/* Coluna técnica: tentativas só fazem sentido para dono/admin. */
#app:not(.is-admin) .admin-col { display: none !important; }

/* Aviso de perfil gerenciado: só aparece para quem não é admin. */
.restricted-note {
  display: none;
  margin: -6px 0 0;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
}
#app:not(.is-admin) .restricted-note { display: block; }

/* Selo do papel da conta no menu do perfil. */
.profile-head-row { display: flex; align-items: center; gap: 8px; }
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid rgba(245, 158, 11, .45);
  border-radius: 999px;
  color: #fcd34d;
  background: rgba(245, 158, 11, .12);
  font-size: .66rem;
  font-weight: 800;
}

.app-body { display: flex; align-items: stretch; min-height: calc(100vh - 66px); }
.app-main { flex: 1; min-width: 0; }

.side-panel {
  position: sticky;
  z-index: 15;
  top: 66px;
  order: -1;
  width: 232px;
  flex: 0 0 232px;
  height: calc(100vh - 66px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 13px;
  border-right: 1px solid var(--border);
  background: rgba(23, 24, 29, .94);
  backdrop-filter: blur(18px);
  transition: width .18s ease, flex-basis .18s ease;
}
.side-panel.compact { width: 68px; flex: 0 0 68px; padding: 15px 10px; }

.side-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.side-panel-title { color: var(--subtle); font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.side-panel.compact .side-panel-title { display: none; }

.side-toggle {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.side-toggle:hover { color: var(--text); border-color: var(--border-light); background: var(--surface-soft); }
/* Mesmo traço dos ícones do menu; desenho troca com o estado (CSS puro). */
.side-toggle svg { width: 19px; height: 19px; stroke-width: 1.7; }
.side-toggle .icon-expand { display: none; }
.side-panel.compact .side-toggle .icon-collapse { display: none; }
.side-panel.compact .side-toggle .icon-expand { display: block; }

/* No modo compacto o botão centraliza com os ícones do menu. */
.side-panel.compact .side-panel-head { justify-content: center; }
.side-panel.compact .side-toggle { margin-left: 0; }

.side-menu { display: grid; gap: 6px; align-content: start; }
.side-menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-size: .82rem;
  font-weight: 750;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.side-menu-item:hover { color: var(--text); background: var(--surface-soft); }
.side-menu-item.active { color: white; border-color: var(--border-light); background: var(--surface-soft); box-shadow: inset 3px 0 var(--accent); }
.side-menu-item svg { width: 19px; height: 19px; flex: 0 0 19px; stroke-width: 1.7; }
/* Entrelinha fixa: o rótulo quebra igual em <button> (SPA) e <a> (páginas). */
.side-menu-label { line-height: 1.4; }
a.side-menu-item { text-decoration: none; }
.destination-card[hidden] { display: none; }
.side-panel.compact .side-menu-item { justify-content: center; padding: 9px 0; box-shadow: none; }
.side-panel.compact .side-menu-label { display: none; }

.side-panel-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.side-panel-foot span { display: block; overflow: hidden; color: var(--muted); font-size: .72rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.types-card { min-width: 0; overflow: hidden; }
.series-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  align-items: end;
  gap: 12px;
  padding: 0 22px 6px;
}
.series-form label { min-width: 0; }
.series-color-field input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 5px;
  cursor: pointer;
}
.series-form .button { height: 42px; }
.types-table-wrap { margin-top: 10px; }
.types-table td { white-space: nowrap; }
.types-table .actions-cell { width: 200px; min-width: 200px; max-width: 200px; }
.types-table .type-name { display: inline-flex; align-items: center; gap: 9px; color: #ececef; font-weight: 700; }
.types-table .type-dot { width: 11px; height: 11px; flex: 0 0 11px; border-radius: 50%; background: var(--series-color, #747780); }
.types-table .type-key { color: var(--subtle); font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .72rem; }
.types-table .type-edit { display: flex; align-items: center; gap: 7px; }
.types-table .type-edit input:not([type="color"]) { height: 32px; min-width: 130px; }
.types-table .type-edit input[type="color"] { width: 42px; height: 32px; padding: 3px; }
.types-table .type-shared { color: var(--subtle); font-size: .68rem; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 390px); padding: 35px; border: 1px solid var(--border); border-radius: 18px; background: rgba(29, 31, 36, .96); box-shadow: 0 30px 90px rgba(0, 0, 0, .35); }
.login-card .brand-mark { margin-bottom: 25px; }
.login-card h1 { margin: 0; font-size: 1.8rem; }
.login-card > .muted { margin: 7px 0 13px; font-size: .86rem; }
.login-card .check { display: flex; align-items: center; gap: 9px; margin: 2px 0 4px; color: var(--muted); font-size: .8rem; cursor: pointer; }
.login-card .check input { width: 16px; height: 16px; accent-color: var(--accent); }
/* Oferta do teste grátis no cartão de entrada: fica entre o subtítulo e o
   formulário, para não competir com os campos. */
.login-trial { margin: 10px 0 14px; padding: 8px 12px; border-radius: 10px; border: 1px dashed rgba(244, 189, 79, .35); background: rgba(244, 189, 79, .07); color: #fcd34d; font-size: .82rem; font-weight: 600; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; color: var(--muted); font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.button.google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-color: #fff; background: #fff; color: #1f1f1f; font-weight: 650; }
.button.google:hover:not(:disabled) { border-color: #f1f3f4; background: #f1f3f4; }
.button.google svg { width: 18px; height: 18px; flex: none; }

.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 20px; display: grid; gap: 9px; pointer-events: none; }
.toast { max-width: 360px; padding: 12px 15px; border: 1px solid var(--border-light); border-radius: 9px; color: var(--text); background: #292b31; box-shadow: 0 12px 35px rgba(0, 0, 0, .35); font-size: .79rem; animation: toast-in .18s ease-out; }
.toast.error { border-color: rgba(224, 36, 36, .55); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .panel-resizer { display: none; }
  .preview-panel { position: relative; top: auto; height: auto; min-height: 650px; margin-top: 18px; }
  .video-frame { height: 520px; flex: none; }
  .metric-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-panel { width: 190px; flex-basis: 190px; }
}

@media (max-width: 720px) {
  header.header { height: auto; min-height: 62px; padding: 11px 14px; }
  .server-state { display: none; }
  header.header { flex-wrap: wrap; }
  .storage-state { max-width: 175px; overflow: hidden; text-overflow: ellipsis; }
  .profile-meta { display: none; }
  .profile-trigger { padding: 4px 6px; }
  .app-body { flex-direction: column; }
  .side-panel, .side-panel.compact {
    position: static;
    order: -1;
    width: 100%;
    height: auto;
    flex: none;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .side-panel-head, .side-panel-foot { display: none; }
  /* Os itens não cabem lado a lado numa tela estreita: em vez de estourar
     para fora da página (e serem cortados pelo overflow-x do body), o menu
     rola na horizontal com cada item em tamanho natural. */
  .side-menu { display: flex; flex: 1; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
  .side-menu-item, .side-panel.compact .side-menu-item { justify-content: center; width: auto; padding: 9px 8px; flex: none; white-space: nowrap; }
  .side-panel .side-menu-label, .side-panel.compact .side-menu-label { display: inline; }
  .series-form { grid-template-columns: 1fr; padding: 0 17px 6px; }
  .types-table .actions-cell { width: 160px; min-width: 160px; max-width: 160px; }
  .workspace { padding: 12px; }
  .editor-card { padding: 17px; }
  .two-columns { grid-template-columns: 1fr; }
  .datetime-24h { grid-template-columns: 1fr; }
  .time-24h { width: max-content; }
  .form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .form-actions .primary { grid-column: 1 / -1; }
  .preview-panel { min-height: 570px; }
  .video-frame { height: 430px; }
  td { max-width: 250px; }
  .toast-region { right: 12px; bottom: 12px; left: 12px; }
  .queue-toolbar { align-items: stretch; flex-direction: column; }
  .queue-search { width: 100%; }
  .performance-view { padding: 12px; }
  .performance-heading { align-items: stretch; flex-direction: column; padding: 17px 17px 0; }
  .performance-heading .button { width: 100%; }
  .performance-sync-status { margin: 0 17px 14px; }
  .platform-switches { grid-template-columns: 1fr; padding: 0 17px 17px; }
  .platform-switch-card small { white-space: normal; }
  .metric-summary { grid-template-columns: 1fr 1fr; padding: 14px 17px; }
  .metric-card { padding: 12px; }
  /* Em duas colunas o cartão fica estreito: sem apertar o detalhamento, o nome
     da rede viraria "In..." e um nome truncado não diz nada. */
  .metric-breakdown-row { gap: 4px; font-size: .66rem; }
  .metric-breakdown-delta { font-size: .6rem; }
  .performance-toolbar { align-items: stretch; flex-direction: column; padding: 14px 17px; }
  .performance-chart-card { padding: 14px 17px 16px; }
  .performance-chart-head { flex-direction: column; }
  .performance-chart-controls { width: 100%; }
  .performance-chart-segment { flex: 1 1 auto; justify-content: center; }
  .performance-chart-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .chart-tab { white-space: nowrap; }
  .performance-chart-stage { min-height: 190px; }
}

/* Conta TikTok (seguidores e vídeos, escopo user.info.stats): métrica de
   conta ao vivo, fora dos cartões de totais por publicação. */
.tiktok-account-card {
  margin: 0 17px 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface, #1d1f25);
  display: grid;
  gap: 10px;
}
.tiktok-account-card h3 { margin: 2px 0 0; font-size: .95rem; }
.tiktok-account-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.tiktok-account-stat { display: grid; gap: 2px; }
.tiktok-account-stat span { font-size: .72rem; color: var(--muted); }
.tiktok-account-stat strong { font-size: 1.25rem; }
.tiktok-account-hint { margin: 0; font-size: .78rem; }
.tiktok-account-hint.hidden { display: none; }
@media (max-width: 720px) {
  .tiktok-account-card { margin: 0 12px 14px; }
}

/* Cartão estreito não comporta três colunas (rede, total e variação) sem
   cortar o nome da rede — e um nome truncado não diz nada. Abaixo de 200px de
   largura útil a variação desce para a linha de baixo, alinhada à direita sob
   o total, e o nome fica inteiro. É consulta ao próprio cartão (não à janela)
   porque o mesmo cartão estreito aparece em contextos diferentes. */
@container (max-width: 200px) {
  .metric-breakdown-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 1px; }
  .metric-breakdown-delta { grid-column: 2; justify-self: end; }
}

/* Seletor de idioma da barra superior do app. */
.lang-switch { display: inline-flex; align-items: center; }
.lang-switch select {
  appearance: none;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
}
.lang-switch select:hover { border-color: #3f4149; }



.callouts-form {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 0 22px 6px;
}
.callouts-form label {
  min-width: 0;
}
.callouts-form select {
  width: 100%;
  height: 42px;
  padding: 0 10px;
}
.callouts-form input {
  width: 100%;
  height: 42px;
}
.callouts-form .button {
  height: 42px;
  white-space: nowrap;
}
@media (max-width: 800px) {
  .callouts-form {
    grid-template-columns: 1fr;
    padding: 0 17px 6px;
  }
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(4px);
  z-index: 60;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 100%;
  background: #18191e;
  border-left: 1px solid var(--border);
  z-index: 70;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  box-shadow: -12px 0 32px rgba(0, 0, 0, .5);
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.drawer-head h2 {
  font-size: 1.25rem;
  margin: 4px 0 2px;
}
.drawer-head .subhead {
  color: var(--muted);
  font-size: .88rem;
  margin: 0;
}
.manual-publish-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}
.manual-publish-form select,
.manual-publish-form input {
  width: 100%;
  height: 42px;
}
.plan-modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.plan-modal-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.plan-modal-list li span {
  color: var(--muted);
  font-size: 0.85rem;
}
.tiktok-card-settings {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.tiktok-card-settings.hidden {
  display: none;
}
.tiktok-card-settings-title {
  font-size: 0.85rem;
}
.tiktok-account {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tiktok-account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.tiktok-account-names {
  display: grid;
  gap: 2px;
}
/* Perfil básico obtido em /v2/user/info/ (user.info.basic). Fica separado do
   bloco do creator_info, que exige video.publish, para que os dois escopos
   sejam visivelmente distintos na interface. */
.tiktok-basic-profile {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.tiktok-basic-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tiktok-basic-profile b {
  font-size: 0.9rem;
}
.tiktok-basic-profile span.muted {
  font-size: 0.78rem;
}
/* Texto da declaração exigida pela Content Sharing Guidelines do TikTok. */
.tiktok-declaration {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}
.form-hint.hidden {
  display: none;
}
.tiktok-account-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}
.tiktok-subgroup {
  display: grid;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.tiktok-subgroup > b {
  font-size: 0.82rem;
}
/* Limite de duração da conta: vive fora dos subgrupos, por isso precisa do
   próprio espaçamento — e desaparece quando o creator_info não traz o valor. */
#tiktok-max-duration {
  display: block;
  margin-top: 8px;
}
#tiktok-max-duration:empty {
  display: none;
}
.tiktok-promo-options {
  display: grid;
  gap: 8px;
  padding-left: 12px;
}
.toggle-control input:disabled + span {
  opacity: 0.4;
}
.toggle-control input:disabled ~ b {
  opacity: 0.4;
}
.plan-note {
  margin: 8px 0 0;
  font-size: 0.8rem;
}

/* Card IA abaixo do vídeo: selo + cabeçalho + toggle à direita. */
.ai-card {
  padding: 12px 14px;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ai-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ai-card-head > b {
  color: var(--text);
  font-size: .84rem;
  font-weight: 700;
}
.ai-card-toggle {
  margin-left: auto;
  flex: none;
}

.badge-ai {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 6px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: #c4b5fd;
  background: rgba(139, 92, 246, .2);
  border: 1px solid rgba(139, 92, 246, .4);
  border-radius: 4px;
  vertical-align: middle;
  line-height: 1.3;
}

.post-settings-card {
  max-width: 900px;
  margin: 0 auto;
}
.post-settings-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 10px 24px 28px;
}

/* AI Banner */
.settings-ai-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(139, 92, 246, .35);
  background: linear-gradient(135deg, rgba(139, 92, 246, .08), rgba(236, 72, 153, .04), #191b20);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .2);
}
.settings-ai-info {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
}
.ai-badge-logo {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  width: 38px;
  height: 38px;
  font-size: .84rem;
  box-shadow: 0 4px 12px rgba(139, 92, 246, .35);
}
.settings-ai-text {
  flex: 1;
}
.settings-ai-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.settings-ai-title-row h3 {
  font-size: 1.12rem;
  margin: 0;
  color: var(--text);
  font-weight: 700;
}
.settings-ai-banner .field-hint {
  color: var(--muted);
  font-size: .85rem;
  margin: 0;
  line-height: 1.45;
}
.settings-ai-toggle {
  flex: none;
}
.settings-ai-toggle b {
  font-size: .84rem;
  color: var(--text);
  font-weight: 600;
  min-width: 0;
}

/* Platforms Section */
.settings-platforms-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.settings-section-head h3 {
  font-size: 1.1rem;
  margin: 0 0 4px;
  color: var(--text);
  font-weight: 700;
}
.settings-section-head .field-hint {
  color: var(--muted);
  font-size: .85rem;
  margin: 0;
  line-height: 1.45;
}

/* Platforms Cards Grid */
.settings-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
}
.settings-dest-card {
  padding: 16px;
  border-radius: 14px;
  min-height: 125px;
}
.settings-dest-card .settings-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.settings-dest-info {
  flex: 1;
  margin-left: 12px;
}
.settings-dest-info .destination-card-title {
  font-size: .95rem;
}
.settings-main-toggle {
  margin-left: auto;
}
.settings-dest-card .destination-card-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}
.settings-dest-card .destination-card-footer .toggle-control {
  font-size: .82rem;
}
.settings-dest-card .destination-card-footer .toggle-control b {
  font-size: .78rem;
  font-weight: 500;
  color: #c9cacf;
}

.post-settings-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .settings-ai-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .settings-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Card de Data da Publicação (Agendamento + Melhores Horários)
   -------------------------------------------------------------------------- */

.schedule-card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #1c1e24, #15161b);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.schedule-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.schedule-card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.schedule-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(76, 141, 255, 0.12);
  color: #79a8ff;
}

.schedule-card-icon svg {
  width: 16px;
  height: 16px;
}

.schedule-card-title {
  font-size: 0.96rem;
  font-weight: 750;
  color: var(--text);
  letter-spacing: -0.01em;
}

.schedule-tz-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-soft);
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.schedule-card-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 960px) {
  .schedule-card-columns {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

.schedule-col-datetime {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.schedule-col-datetime .datetime-24h {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.schedule-col-datetime .datetime-24h input[type="date"] {
  flex: 1 1 160px;
  min-width: 140px;
}

.schedule-col-datetime .time-24h {
  flex: 0 0 auto;
}

.schedule-col-datetime .next-schedule {
  flex: 0 0 auto;
}

.schedule-col-best-times {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  padding-left: 20px;
}

@media (max-width: 960px) {
  .schedule-col-best-times {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-left: 0;
    padding-top: 16px;
  }
}

/* --------------------------------------------------------------------------
   Widget de Melhores Horários para Postar
   -------------------------------------------------------------------------- */

.best-times-widget,
.best-times-card {
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.best-times-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.best-times-title-group {
  flex: 1;
  min-width: 0;
}

.best-times-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.best-times-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.best-times-icon svg {
  width: 100%;
  height: 100%;
}

.best-times-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.best-times-subtitle {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
}

.best-times-toggle {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.best-times-toggle:hover,
.best-times-toggle:focus-visible {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--border);
}

.best-times-chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.25s ease;
}

.best-times-card.expanded .best-times-chevron,
.best-times-widget.expanded .best-times-chevron {
  transform: rotate(180deg);
}

.best-times-content {
  margin-top: 10px;
}

.best-times-loading,
.best-times-error {
  padding: 10px 0;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.best-times-error {
  color: #ff6b6b;
}

.best-times-compact-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.best-times-compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--surface-soft);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  gap: 10px;
}

.best-times-platform-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  min-width: 80px;
}

.best-times-platform-hours {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  text-align: right;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.best-times-hour-btn {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.best-times-hour-btn:hover {
  background: rgba(76, 141, 255, 0.2);
  border-color: rgba(76, 141, 255, 0.5);
  color: #a8c7ff;
  transform: translateY(-1px);
}

.best-times-hour-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.best-times-platform-hours.insufficient {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.78rem;
}

.best-times-compact-footer {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--subtle);
}

.best-times-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.best-times-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.best-times-tab:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.best-times-tab.active {
  background: var(--surface-soft);
  border-color: var(--border-light);
  color: var(--text);
}

.best-times-empty-state {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
}

.best-times-ranking {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.best-times-rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.best-times-rank-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}

.best-times-rank-details {
  flex: 1;
  min-width: 0;
}

.best-times-rank-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.best-times-hour {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.best-times-badge {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

.best-times-badge.positive {
  background: rgba(59, 201, 133, 0.16);
  color: var(--green);
}

.best-times-badge.negative {
  background: rgba(224, 36, 36, 0.16);
  color: var(--accent);
}

.best-times-badge.neutral {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.best-times-rank-meta {
  margin-top: 3px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.best-times-bullet {
  opacity: 0.5;
}

.best-times-today-section {
  padding: 12px 14px;
  background: var(--surface-soft);
  border-left: 3px solid var(--blue);
  border-radius: 4px;
  margin-bottom: 12px;
}

.best-times-today-title {
  margin: 0 0 4px 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.best-times-today-list {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.best-times-today-hint {
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.best-times-footer {
  font-size: 0.78rem;
  color: var(--subtle);
  margin-top: 10px;
}

@media (max-width: 600px) {
  .best-times-compact-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .best-times-platform-hours {
    text-align: left;
  }
}

/* --------------------------------------------------------------------------
   Tela de Horários de Postagem (posting-times) e Sugestões
   -------------------------------------------------------------------------- */

.posting-times-suggestions-card {
  margin: 0 22px 20px;
  padding: 18px 20px;
  border: 1px solid rgba(225, 29, 72, 0.25);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(225, 29, 72, 0.08), rgba(24, 25, 30, 0.8));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.posting-times-suggestions-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.posting-times-suggestions-head .suggestions-icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
}

.posting-times-suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.posting-times-suggestions-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.posting-times-suggestion-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.posting-times-suggestion-row .platform-col {
  flex: 0 0 110px;
  display: flex;
  align-items: center;
}

.posting-times-suggestion-row .platform-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: capitalize;
}

.posting-times-suggestion-row .hours-col {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.posting-time-suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.posting-time-suggestion-chip.in-grid {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: #cfd0d6;
}

.posting-time-suggestion-chip.add-btn {
  background: rgba(225, 29, 72, 0.1);
  border-color: rgba(225, 29, 72, 0.35);
  color: #ff9baf;
  cursor: pointer;
  transition: all 0.15s ease;
}

.posting-time-suggestion-chip.add-btn:hover {
  background: rgba(225, 29, 72, 0.22);
  border-color: rgba(225, 29, 72, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
}

.posting-time-suggestion-chip.add-btn span:first-child {
  font-weight: 700;
  font-size: 0.9rem;
}

.posting-time-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.95rem;
  font-weight: 600;
}

@media (max-width: 768px) {
  .posting-times-suggestions-card {
    margin: 0 17px 18px;
    padding: 14px 16px;
  }
}

@media (max-width: 640px) {
  .posting-times-suggestion-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .posting-times-suggestion-row .platform-col {
    flex: 0 0 auto;
  }
}

/* Destinos ("Enviar para"): em coluna única no mobile. Os cards têm alturas
   muito desiguais (o do TikTok expande com as configurações) e a grade de 2
   colunas esticava a linha inteira, deixando vazios grandes nos vizinhos e
   espremendo toggles e selects em ~170px. */
@media (max-width: 720px) {
  .destination-cards {
    grid-template-columns: 1fr;
  }
}



