/* ==========================================================================
   FOCUS IA · AgendaPost — estilos
   Índice: 1. Fontes  2. Variáveis  3. Base  4. Peças comuns  5. Topo
           6. Novo agendamento  7. Cartão de post  8. Rodapé de ações
           9. Janelas (modal) e avisos  10. Agendados  11. Telas pequenas
   ========================================================================== */

/* 1. Fontes (arquivos locais, sem chamada externa) ------------------------- */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/outfit-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* 2. Variáveis -------------------------------------------------------------- */

:root {
  /* Fundos */
  --bg: #0a1411;
  --bg-glow: #16332a;
  --panel: #11231e;
  --card: #162c26;
  --field: #0d1c18;
  --raised: #1f3a33;
  --raised-2: #24413a;
  --cal-card: #24443b;

  /* Linhas */
  --line: #1b312a;
  --line-2: #24413a;
  --line-3: #2c4a41;
  --line-strong: #3a5a50;

  /* Texto */
  --text: #eef4f0;
  --text-2: #b4c6be;
  --text-3: #93a99f;

  /* Destaque */
  --accent: #e4f23a;
  --accent-hover: #f0f97a;
  --accent-ink: #131f0a;

  /* Estados */
  --ok: #7be3a4;
  --ok-bg: #17402b;
  --warn: #ffd166;
  --warn-bg: #3d3011;
  --err: #ff9a8b;
  --err-bg: #4a1f1b;
  --err-line: #7a3a33;
  --err-ink: #2a0f0b;
  --info: #9cd0ff;
  --info-bg: #1d3a52;
  --draft: #c9c2ff;
  --draft-bg: #33304f;
  --muted-bg: #2a3a35;

  /* Redes */
  --ig: #ffb3e6;
  --ig-bg: #4a2440;
  --yt: #ff9a8b;
  --yt-bg: #4a1f1b;
  --tt: #8fe8f2;
  --tt-bg: #173e44;
  --li: #9cd0ff;
  --li-bg: #1d3a52;

  /* Espaços */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 28px;

  /* Raios */
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Tipos */
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Outfit', 'Inter', system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.45);
  --cal-row: 84px;
}

/* 3. Base ------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: radial-gradient(1100px 520px at 18% -8%, var(--bg-glow) 0%, var(--bg) 62%) var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -60px;
  z-index: 50;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--s-3);
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1;
  padding: var(--s-6) var(--s-7);
}

.content:focus {
  outline: none;
}

/* 4. Peças comuns ----------------------------------------------------------- */

.title-xl,
.title-lg,
.title-md,
.title-sm {
  font-family: var(--font-title);
  font-weight: 500;
}

.title-xl { font-size: 26px; }
.title-lg { font-size: 22px; }
.title-md { font-size: 20px; }
.title-sm { font-size: 17px; overflow-wrap: anywhere; }

.muted-sm {
  font-size: 12px;
  color: var(--text-3);
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Botões */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 46px;
  padding: 0 var(--s-5);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--raised);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--raised-2);
}

.btn:disabled {
  border-color: var(--line-2);
  color: var(--text-3);
}

.btn--primary {
  padding: 0 var(--s-7);
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.btn--primary:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.btn--primary:disabled {
  background: var(--raised);
}

.btn--ghost {
  background: transparent;
}

.btn--danger-outline {
  border-color: var(--err);
  background: transparent;
  color: var(--err);
}

.btn--danger-outline:hover:not(:disabled) {
  background: var(--err-bg);
}

.btn--danger {
  border-color: var(--err);
  background: var(--err);
  color: var(--err-ink);
  font-weight: 600;
}

.btn--danger:hover:not(:disabled) {
  background: #ffb3a7;
}

.btn--danger:disabled {
  background: var(--raised);
}

.btn--sm {
  min-height: 44px;
  padding: 0 var(--s-4);
}

.btn--icon {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-color: var(--line-3);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-2);
}

.btn--square {
  min-height: 44px;
  padding: 0 var(--s-4);
  border-color: var(--line-3);
  border-radius: var(--r-md);
  background: var(--panel);
}

/* Etiquetas */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--raised-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.chip--sm { padding: 1px 8px; font-size: 11px; }
.chip--ok { background: var(--ok-bg); color: var(--ok); }
.chip--warn { background: var(--warn-bg); color: var(--warn); }
.chip--err { background: var(--err-bg); color: var(--err); }
.chip--info { background: var(--info-bg); color: var(--info); }
.chip--draft { background: var(--draft-bg); color: var(--draft); }
.chip--muted { background: var(--muted-bg); color: var(--text-2); }

.badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 22px;
  border-radius: 7px;
  background: var(--raised-2);
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
}

.badge--lg { width: 34px; height: 34px; border-radius: var(--r-sm); font-size: 11px; }
.badge--instagram { background: var(--ig-bg); color: var(--ig); }
.badge--youtube { background: var(--yt-bg); color: var(--yt); }
.badge--tiktok { background: var(--tt-bg); color: var(--tt); }
.badge--linkedin { background: var(--li-bg); color: var(--li); }

/* Faixas de aviso */

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3) var(--s-4);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-lg);
}

.banner--error {
  margin: var(--s-4) var(--s-7) 0;
  background: var(--err-bg);
  color: #ffd9d3;
}

.banner--ok {
  background: var(--ok-bg);
  color: #d3f7e1;
}

/* Campos */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}

.field__hint {
  font-size: 12px;
  color: var(--text-3);
}

.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-3);
  border-radius: var(--r-md);
  background: var(--field);
  color: var(--text);
}

textarea.input {
  min-height: 120px;
  resize: vertical;
  line-height: 1.45;
}

.input:disabled {
  opacity: 0.5;
}

.input[aria-invalid='true'] {
  border-color: var(--err);
}

.field-error {
  font-size: 13px;
  color: var(--err);
}

.field-error--missing {
  color: var(--warn);
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.note-warn {
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 12px;
}

.note-err {
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  background: var(--err-bg);
  color: #ffd9d3;
  font-size: 13px;
}

/* Barra de progresso */

.progress {
  flex: 1 1 160px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--raised-2);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--accent);
  transition: width 0.15s linear;
}

/* Esqueleto de carregamento */

.skeleton {
  border-radius: var(--r-md);
  background: var(--raised);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.45; }
}

/* Caixa de estado (vazio, erro) */

.state-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--panel);
  color: var(--text-2);
}

.state-box--error {
  border-color: var(--err-line);
}

/* 5. Topo ------------------------------------------------------------------- */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-7);
  padding: var(--s-4) var(--s-7);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.brand__name {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand__product {
  margin-left: -4px;
  color: var(--text-3);
}

.tabs {
  display: flex;
  gap: var(--s-1);
  padding: var(--s-1);
  border-radius: var(--r-pill);
  background: var(--panel);
}

.tab {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-weight: 500;
}

.tab[aria-selected='true'] {
  background: var(--raised-2);
  color: var(--text);
}

.topbar__status {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}

.conn {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: 13px;
}

.conn__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}

.conn--online .conn__dot { background: var(--ok); }
.conn--offline { border-color: var(--err-line); color: var(--err); }
.conn--offline .conn__dot { background: var(--err); }

/* 6. Novo agendamento ------------------------------------------------------- */

.layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--s-6);
}

.panel {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--panel);
}

.panel__head {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.accounts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 48px;
}

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

.account__user {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.accounts-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-3);
  color: var(--text-2);
}

.accounts-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.accounts-skeleton .skeleton {
  height: 36px;
}

.tz {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.tz__name {
  font-weight: 500;
}

.main-col {
  flex: 999 1 560px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.dropzone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4) var(--s-5);
  padding: 22px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-xl);
  background: var(--field);
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--panel);
}

.dropzone__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--raised);
  color: var(--accent);
}

.dropzone__text {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.dropzone__types {
  font-size: 13px;
  color: var(--text-2);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.selection-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3) var(--s-4);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  background: var(--panel);
}

.selection-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.posts {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.posts:empty {
  display: none;
}

.empty {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--panel);
}

.empty__steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  color: var(--text-2);
}

/* 7. Cartão de post --------------------------------------------------------- */

.card {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-5);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background: var(--card);
}

.card--error {
  border-color: var(--err-line);
}

.card--selected {
  border-color: var(--accent);
}

.card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
}

.card__size {
  font-size: 13px;
  color: var(--text-3);
}

.card__head-right {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
}

.uploads {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.uploads:empty {
  display: none;
}

.upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) 14px;
  padding: var(--s-3) 14px;
  border-radius: var(--r-md);
  background: var(--panel);
}

.upload-row__name {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.upload-row--error {
  background: var(--err-bg);
  color: #ffd9d3;
}

.card__body {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
}

.card__col {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card__col--publish {
  flex-basis: 320px;
}

.thumb-col {
  flex: 0 0 168px;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.thumb {
  position: relative;
  height: 224px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  background: var(--raised);
  color: var(--text);
  overflow: hidden;
}

.thumb img,
.thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb__tag {
  position: relative;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.thumb__tag--corner {
  position: absolute;
  left: var(--s-2);
  bottom: var(--s-2);
}

.thumb-col .btn {
  min-height: 44px;
  padding: 0 var(--s-3);
  font-size: 13px;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

.counter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-1) var(--s-3);
  font-size: 12px;
  color: var(--text-3);
}

.counter {
  color: var(--text-2);
  font-weight: 500;
}

.counter--over {
  color: var(--err);
}

.nets {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nets legend {
  padding: 0;
  margin-bottom: var(--s-1);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}

.net-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  min-height: 48px;
}

.net-row .check {
  flex: 0 0 150px;
}

.net-row.is-blocked .check {
  color: var(--text-3);
}

.net-row__side {
  flex: 1 1 150px;
  min-width: 0;
}

.net-row__note {
  font-size: 12px;
  color: var(--text-3);
}

.net-row__account {
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.net-row .field-error {
  flex: 1 1 100%;
  padding-left: 28px;
}

.datetime {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.datetime .field {
  flex: 1 1 130px;
}

/* Carrossel */

.strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-4);
  padding: var(--s-3);
  border-radius: 14px;
  background: var(--field);
}

.strip__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.strip__item {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  width: 92px;
  cursor: grab;
}

.strip__item.is-dragging {
  opacity: 0.4;
}

.strip__item.is-over .strip__pic {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.strip__pic {
  position: relative;
  height: 104px;
  border-radius: var(--r-sm);
  background: var(--raised);
  overflow: hidden;
}

.strip__pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.strip__num {
  position: absolute;
  left: 6px;
  top: 6px;
  min-width: 22px;
  padding: 1px 4px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.strip__moves {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-1);
}

.strip__move {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line-3);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
}

.strip__move:disabled {
  opacity: 0.35;
}

.strip__side {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
  font-size: 12px;
  color: var(--text-2);
}

/* Opções avançadas */

.adv {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
  border-top: 1px solid var(--line-2);
}

.adv__toggle {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 500;
}

.adv__toggle svg {
  transition: transform 0.15s ease;
}

.adv__toggle[aria-expanded='true'] svg {
  transform: rotate(90deg);
}

.adv__panel {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.adv__group {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: 14px;
  background: var(--field);
}

.adv__group-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 600;
}

.adv__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px var(--s-6);
}

.adv__fields > .field {
  flex: 1 1 260px;
}

.adv__fields > .field--wide {
  flex-basis: 100%;
}

.adv__checks {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.adv__checks .note-warn {
  margin: 0 0 var(--s-1) 28px;
}

.adv__group .input {
  background: var(--bg);
}

/* 8. Rodapé de ações -------------------------------------------------------- */

.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-4);
  padding: 14px var(--s-7);
  border-top: 1px solid var(--line-2);
  background: var(--field);
}

.actionbar__summary {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.actionbar__title {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 500;
}

.actionbar__hint {
  font-size: 12px;
  color: var(--text-2);
}

.actionbar__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 9. Janelas (modal) e avisos ----------------------------------------------- */

.modal {
  width: min(780px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 24px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-modal);
}

.modal--narrow {
  width: min(520px, calc(100vw - 32px));
}

.modal::backdrop {
  background: rgba(5, 11, 9, 0.78);
}

.modal__inner {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  padding: var(--s-7);
}

.modal__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal__desc {
  color: var(--text-2);
}

.modal__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.modal__chips .chip {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.modal__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.modal__foot-hint {
  flex: 1 1 200px;
  font-size: 12px;
  color: var(--text-3);
}

.summary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.summary__item {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  padding: var(--s-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: var(--card);
}

.summary__thumb {
  flex: 0 0 64px;
  height: 84px;
  border-radius: var(--r-sm);
  background: var(--raised);
  overflow: hidden;
}

.summary__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.summary__body {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.summary__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px var(--s-3);
}

.summary__when {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 500;
}

.summary__nets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary__net {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-pill);
  background: var(--field);
  font-size: 13px;
}

.summary__caption {
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toasts {
  position: fixed;
  right: var(--s-4);
  bottom: 96px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  width: min(380px, calc(100vw - 32px));
}

.toast {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--raised);
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.toast__text {
  flex: 1 1 180px;
}

.toast--ok { border-color: var(--ok); }
.toast--error { border-color: var(--err); }

.toast__close {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-2);
  font-size: 18px;
}

/* 10. Agendados ------------------------------------------------------------- */

.sched-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
}

.sched-count {
  color: var(--text-2);
}

.weeknav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.weeknav .btn--icon {
  background: var(--panel);
  color: var(--text);
}

.weeknav__label {
  padding: 0 10px;
  font-weight: 500;
}

.sched-toolbar__right {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.segmented {
  display: flex;
  gap: var(--s-1);
  padding: var(--s-1);
  border-radius: var(--r-pill);
  background: var(--panel);
}

.segmented__btn {
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-weight: 500;
}

.segmented__btn[aria-pressed='true'] {
  background: var(--raised-2);
  color: var(--text);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  margin-bottom: var(--s-4);
}

.filters__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.filters__tz {
  margin-left: auto;
}

.filter {
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text);
  font-weight: 500;
}

.filter[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.sched-panel {
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--panel);
  overflow-x: auto;
}

.sched-note {
  margin-bottom: var(--s-3);
  color: var(--text-2);
}

/* Calendário */

.cal {
  min-width: 1040px;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.cal__head,
.cal__row {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(140px, 1fr));
}

.cal__grid {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #1f382f;
}

/* uma linha por hora: a altura é a da maior célula entre os 7 dias */
.cal__row {
  position: relative;
  min-height: 48px;
  border-top: 1px solid #1f382f;
}

.cal__day {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 4px 6px;
  border-left: 1px solid #1f382f;
}

.cal__hour {
  align-self: start;
  padding-top: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.cal__now {
  position: absolute;
  left: 56px;
  right: 0;
  height: 0;
  border-top: 1px solid var(--accent);
  pointer-events: none;
  z-index: 2;
}

.cal__now::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.cal-card {
  flex: none;
  height: 142px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border: 1px solid #33574c;
  border-radius: 14px;
  background: var(--cal-card);
  overflow: hidden;
}

.cal-card__thumb {
  position: relative;
  flex: none;
  height: 52px;
  border-radius: 9px;
  background: #3f6258;
  overflow: hidden;
}

.cal-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cal-card__thumb .thumb__tag {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 1px 8px;
}

.cal-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 2px;
}

.cal-card__time {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 500;
}

.cal-card__line {
  padding: 0 2px;
  font-size: 12px;
  color: #d5e1db;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-card__line--caption {
  color: var(--text);
}

/* Prévia da mídia: cartão (mesmas medidas) e janela central */

.cal-card--media {
  cursor: pointer;
}

.cal-card--media:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cal-card__thumb .pv-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.modal.pv {
  position: fixed;
  display: flex;
  flex-direction: column;
  width: min(max(50vw, 340px), calc(100vw - 32px));
  height: min(max(50vh, 300px), calc(100vh - 32px));
  max-height: none;
  overflow: hidden;
}

.pv__stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #000;
}

.pv__stage .pv-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pv__meta {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px var(--s-5);
  font-size: 13px;
  color: #d5e1db;
  background: var(--panel);
}

.pv__time {
  font-family: var(--font-title);
  font-weight: 500;
  color: var(--text);
}

.pv__line {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pv__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  opacity: 0.75;
  cursor: pointer;
}

.pv__close:hover,
.pv__close:focus-visible {
  opacity: 1;
  background: rgba(0, 0, 0, 0.7);
}

.pv__close:focus-visible {
  outline: 2px solid var(--accent);
}

/* Tabela */

.table {
  min-width: 1080px;
  display: flex;
  flex-direction: column;
}

.trow {
  display: grid;
  grid-template-columns: minmax(280px, 2.4fr) minmax(210px, 1.5fr) 150px 120px minmax(240px, 1.8fr);
  gap: var(--s-4);
  align-items: center;
  padding: 14px var(--s-1);
  border-top: 1px solid #1f382f;
}

.trow--head {
  padding: var(--s-3) var(--s-1);
  border-top: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.tcell {
  min-width: 0;
}

.tcell--post {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tpost__thumb {
  flex: 0 0 52px;
  height: 64px;
  border-radius: var(--r-sm);
  background: #3f6258;
  overflow: hidden;
}

.tpost__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tpost__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.tpost__caption {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tnets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tnets li {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
}

.tnets span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.twhen {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.twhen__date {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 500;
}

.twhen__time {
  color: var(--text-2);
}

.tcell--action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.tconfirm {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.tlink {
  font-weight: 500;
}

.terror__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--err);
}

.terror__text {
  padding: var(--s-2) 10px;
  border-radius: var(--r-sm);
  background: #2a1512;
  color: #ffc2b8;
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.tinfo {
  font-size: 13px;
  color: var(--text-2);
}

.sched-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.sched-skeleton .skeleton {
  height: 64px;
}

/* Cores de miniatura quando o servidor não manda imagem.
   Ficam no fim da seção para valer sobre o fundo padrão das miniaturas. */
.tone--image { background: #2e6f8e; }
.tone--reel { background: #b4532f; }
.tone--story { background: #7a5aa6; }
.tone--video { background: #a33a4a; }
.tone--document { background: #3f6258; }

/* 11. Telas pequenas -------------------------------------------------------- */

@media (max-width: 720px) {
  .content {
    padding: var(--s-4);
  }

  .topbar {
    padding: var(--s-3) var(--s-4);
    gap: var(--s-3);
  }

  .tabs {
    order: 3;
    flex: 1 1 100%;
  }

  .tab {
    flex: 1;
    padding: 0 var(--s-2);
  }

  .banner--error {
    margin: var(--s-3) var(--s-4) 0;
  }

  .card {
    padding: var(--s-4);
  }

  .thumb-col {
    flex-basis: 100%;
  }

  .thumb {
    height: 168px;
  }

  .net-row .check {
    flex-basis: 100%;
  }

  .net-row .field-error {
    padding-left: 0;
  }

  .actionbar {
    padding: var(--s-3) var(--s-4);
  }

  .actionbar__buttons {
    flex: 1 1 100%;
  }

  .actionbar__buttons .btn {
    flex: 1 1 auto;
    padding: 0 var(--s-3);
  }

  .actionbar__hint {
    display: none;
  }

  .modal__inner {
    padding: var(--s-5);
  }

  .filters__tz {
    margin-left: 0;
  }

  .toasts {
    bottom: 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
