/* ══════════════════════════════════════════════
   Agenda de Postagens v6.0
   CSS usa variáveis CSS injetadas via PHP (tema do admin).
   Fallback: paleta padrão ExpoPinda (dark/amber).
══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Lato:wght@400;700&display=swap');

/* ── Tokens base — substituídos inline pelo PHP quando há tema salvo ── */
:root {
  /* Fundos */
  --ap-bg:           #1a1008;
  --ap-bg-2:         #1e1204;
  --ap-bg-3:         #2a1a08;
  --ap-bg-4:         #3a2808;

  /* Célula */
  --ap-cell-bg:      rgba(36,21,6,0.72);
  --ap-cell-bg-alt:  rgba(30,18,4,0.88);

  /* Bordas */
  --ap-border:       rgba(74,52,16,.55);
  --ap-border-soft:  rgba(74,52,16,.28);

  /* Destaque */
  --ap-accent:       #c9a227;
  --ap-accent-hover: #e0b83a;
  --ap-accent-dim:   rgba(201,162,39,.25);
  --ap-accent-bdr:   rgba(201,162,39,.45);

  /* Textos */
  --ap-text:         #e8d9b0;
  --ap-text-muted:   #9a8660;

  /* Textos do cabeçalho e hints — customizáveis individualmente */
  --ap-title-text:   #c9a227;   /* "Agenda de Postagens" */
  --ap-month-text:   #e8d9b0;   /* "JUNHO 2026" */
  --ap-hint-text:    #9a8660;   /* "+ adicionar" */

  /* Elementos específicos customizáveis */
  --ap-dh-bg:        rgba(36,21,6,0.72);   /* fundo cabeçalho dias da semana */
  --ap-dh-text:      #e8d9b0;              /* texto dias da semana */
  --ap-date-text:    #e8d9b0;              /* cor dos números de data */
  --ap-today-bg:     #3a2808;              /* fundo célula hoje */
  --ap-today-num-bg: #c9a227;              /* fundo círculo "hoje" */
  --ap-today-num-tx: #1a1008;              /* texto número hoje */
  --ap-post-text:    #e8d9b0;              /* texto das postagens no modal */

  /* Cores dos tipos de postagem */
  --ap-color-video:  #3b82f6;
  --ap-color-story:  #4a7c3f;
  --ap-color-reel:   #e8607a;
  --ap-color-acao:   #c9a227;
  --ap-color-feriado:#a855f7;

  /* Dimensões */
  --ap-radius:       10px;
  --ap-radius-sm:    6px;
  --ap-shadow:       0 8px 32px rgba(0,0,0,.45), 0 0 0 1px var(--ap-accent-bdr) inset;
  --ap-font-display: 'Playfair Display', Georgia, serif;
  --ap-font-body:    'Lato', system-ui, sans-serif;
}

/* ── Base ── */
#ap-root {
  font-family: var(--ap-font-body);
  color: var(--ap-text);
  padding: 1.5rem 2rem 88px;
  background: var(--ap-bg);
  box-sizing: border-box;
  border-radius: 12px;
}

/* ══ CABEÇALHO ══ */
.ap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 10px;
}
.ap-title {
  font-family: var(--ap-font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--ap-title-text);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.ap-month-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ap-month-text);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.ap-nav { display: flex; gap: 6px; }
.ap-nav-btn {
  background: rgba(0,0,0,.35);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm);
  padding: 6px 14px;
  font-family: var(--ap-font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ap-text);
  line-height: 1.5;
  letter-spacing: .04em;
  transition: background .15s, border-color .15s, color .15s;
}
.ap-nav-btn:hover {
  background: var(--ap-bg-3);
  border-color: var(--ap-accent);
  color: var(--ap-accent);
}
/* Botão "Hoje" — sempre destacado */
#ap-hoje {
  background: var(--ap-accent);
  color: var(--ap-bg);
  border-color: var(--ap-accent);
  font-weight: 700;
}
#ap-hoje:hover {
  background: var(--ap-accent-hover);
  border-color: var(--ap-accent-hover);
  color: var(--ap-bg);
}

/* ══ GRADE ══ */
.ap-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

/* Cabeçalho dias da semana — usa variáveis dedicadas */
.ap-day-header {
  text-align: center;
  font-family: var(--ap-font-body);
  font-size: 11px;
  font-weight: 700;
  color: var(--ap-dh-text);
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 8px 0 10px;
  background: var(--ap-dh-bg);
  border: 1px solid var(--ap-border-soft);
  border-radius: var(--ap-radius-sm);
  margin-bottom: 2px;
  opacity: 0.9;
}

/* ── Célula do dia ── */
.ap-day-cell {
  background: var(--ap-cell-bg);
  border: 1px solid var(--ap-border-soft);
  border-radius: var(--ap-radius);
  padding: 8px;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  position: relative;
}
.ap-day-cell:hover {
  border-color: var(--ap-accent);
  box-shadow: 0 2px 14px var(--ap-accent-dim);
  background: var(--ap-bg-3);
}
.ap-day-cell.ap-today {
  border-color: var(--ap-accent);
  border-width: 2px;
  background: var(--ap-today-bg);
  box-shadow: 0 0 0 2px var(--ap-accent-dim);
}
.ap-day-cell.ap-other-month {
  background: rgba(0,0,0,.3);
  opacity: 0.45;
  border-color: var(--ap-border-soft);
}
.ap-day-cell.ap-drag-over {
  border-color: var(--ap-accent) !important;
  box-shadow: 0 0 0 3px var(--ap-accent-dim) !important;
  background: var(--ap-bg-4) !important;
}

/* Célula com feriado */
.ap-day-cell.ap-has-feriado {
  border-color: rgba(168,85,247,.4);
}

/* ── Número do dia ── */
.ap-day-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--ap-date-text);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
}
.ap-day-num-circle {
  background: var(--ap-today-num-bg);
  color: var(--ap-today-num-tx);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

/* ── Tags de postagem ── */
.ap-tag {
  font-size: 10px;
  border-radius: 4px;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.5;
  word-break: break-word;
  font-weight: 700;
  cursor: grab;
  position: relative;
  transition: opacity .15s, box-shadow .15s;
  user-select: none;
}
.ap-tag:active { cursor: grabbing; }
.ap-tag.ap-publicado {
  opacity: 0.52;
  text-decoration: line-through;
}
.ap-tag.ap-publicado::after {
  content: '✓';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 900;
  color: var(--ap-accent);
  text-decoration: none;
}
.ap-tag-pub-btn {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  padding: 0;
  flex-shrink: 0;
  opacity: .6;
  transition: opacity .15s, background .15s;
  line-height: 1;
}
.ap-tag-pub-btn:hover { opacity: 1; background: rgba(201,162,39,.2); }
.ap-tag.ap-publicado .ap-tag-pub-btn {
  background: var(--ap-accent);
  border-color: var(--ap-accent);
  color: var(--ap-bg);
  opacity: 1;
}

/* Tipos — usam variáveis CSS para customização completa */
.ap-tag-video {
  background: color-mix(in srgb, var(--ap-color-video) 22%, transparent);
  color: color-mix(in srgb, var(--ap-color-video) 80%, #fff);
  border-left: 2.5px solid var(--ap-color-video);
}
.ap-tag-story {
  background: color-mix(in srgb, var(--ap-color-story) 22%, transparent);
  color: color-mix(in srgb, var(--ap-color-story) 80%, #fff);
  border-left: 2.5px solid var(--ap-color-story);
}
.ap-tag-acao {
  background: color-mix(in srgb, var(--ap-color-acao) 20%, transparent);
  color: color-mix(in srgb, var(--ap-color-acao) 85%, #fff);
  border-left: 2.5px solid var(--ap-color-acao);
}
.ap-tag-reel {
  background: color-mix(in srgb, var(--ap-color-reel) 22%, transparent);
  color: color-mix(in srgb, var(--ap-color-reel) 80%, #fff);
  border-left: 2.5px solid var(--ap-color-reel);
}
.ap-tag-feriado {
  background: color-mix(in srgb, var(--ap-color-feriado) 22%, transparent);
  color: color-mix(in srgb, var(--ap-color-feriado) 80%, #fff);
  border-left: 2.5px solid var(--ap-color-feriado);
}

/* Horário */
.ap-tag-hora {
  font-size: 9px;
  color: var(--ap-text-muted);
  padding-left: 2px;
  pointer-events: none;
  opacity: 0.85;
}

/* Hint "adicionar" */
.ap-add-hint {
  margin-top: auto;
  font-size: 10px;
  color: var(--ap-hint-text);
  display: flex;
  align-items: center;
  gap: 3px;
  letter-spacing: .04em;
}
.ap-add-hint::before {
  content: "+";
  font-size: 13px;
  line-height: 1;
  color: var(--ap-hint-text);
  opacity: 0.8;
}

/* ══ LEGENDA RODAPÉ ══ */
.ap-footer-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9000;
  background: var(--ap-bg-2);
  border-top: 2px solid var(--ap-accent);
  padding: 10px 2rem;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.ap-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; flex: 1; }
.ap-leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ap-text);
  letter-spacing: .03em;
}
.ap-leg-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.ap-leg-dot-video   { background: var(--ap-color-video); }
.ap-leg-dot-story   { background: var(--ap-color-story); }
.ap-leg-dot-acao    { background: var(--ap-color-acao); }
.ap-leg-dot-reel    { background: var(--ap-color-reel); }
.ap-leg-dot-feriado { background: var(--ap-color-feriado); }
.ap-hint { font-size: 11px; color: var(--ap-text-muted); margin-left: auto; white-space: nowrap; }

/* Botão PDF */
.ap-btn-pdf {
  background: var(--ap-accent);
  color: var(--ap-bg);
  border: none;
  border-radius: var(--ap-radius-sm);
  padding: 7px 16px;
  font-family: var(--ap-font-body);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: background .15s, opacity .15s;
  flex-shrink: 0;
}
.ap-btn-pdf:hover    { background: var(--ap-accent-hover); }
.ap-btn-pdf:disabled { opacity: 0.6; cursor: wait; }

/* ══ MODAL ══ */
.ap-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ap-modal-box {
  background: #1e1204;
  border: 1.5px solid rgba(201,162,39,.35);
  border-radius: 14px;
  padding: 28px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  border-top: 3px solid #c9a227;
}
.ap-modal-box--sm { max-width: 360px; }
.ap-modal-box::-webkit-scrollbar { width: 4px; }
.ap-modal-box::-webkit-scrollbar-track { background: transparent; }
.ap-modal-box::-webkit-scrollbar-thumb { background: var(--ap-accent-dim); border-radius: 2px; }
.ap-modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  color: var(--ap-text);
  padding: 0;
  transition: color .15s;
}
.ap-modal-close:hover { color: var(--ap-accent); }
.ap-modal-title {
  font-family: var(--ap-font-display);
  font-size: 19px; font-weight: 700;
  margin: 0 0 20px;
  color: #c9a227 !important;
  padding-right: 28px;
  letter-spacing: -0.01em;
}

/* Senha */
.ap-senha-row { display: flex; gap: 8px; }
.ap-senha-row input { flex: 1; }

/* Campos */
.ap-field-label {
  font-size: 10px; font-weight: 700;
  color: #c9a227 !important;
  text-transform: uppercase; letter-spacing: .1em;
  margin: 0 0 8px;
}
.ap-label {
  display: block;
  font-size: 11px; font-weight: 700;
  color: #e8d9b0 !important;
  margin: 14px 0 6px;
  letter-spacing: .06em; text-transform: uppercase;
}
.ap-input,
.ap-select {
  width: 100%;
  border: 1.5px solid rgba(100,80,30,.6);
  border-radius: var(--ap-radius-sm);
  padding: 10px 12px;
  font-family: var(--ap-font-body);
  font-size: 13px;
  /* Cores absolutas — imune a sobrescrita do tema WordPress */
  color: #f0e4c0 !important;
  background: #0f0a03 !important;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-text-fill-color: #f0e4c0;
}
.ap-input::placeholder,
.ap-select::placeholder {
  color: #7a6640 !important;
  -webkit-text-fill-color: #7a6640;
  opacity: 1;
}
.ap-input:focus,
.ap-select:focus {
  border-color: var(--ap-accent);
  border-color: #c9a227;
  box-shadow: 0 0 0 2px rgba(201,162,39,.25);
}
.ap-select option {
  background: #1e1204;
  color: #f0e4c0;
}

/* Divider */
.ap-divider { border: none; border-top: 1px solid var(--ap-border-soft); margin: 18px 0; }

/* Botões */
.ap-btn-primary {
  background: #c9a227;
  color: #1a1008;
  border: none;
  border-radius: var(--ap-radius-sm);
  padding: 9px 20px;
  font-family: var(--ap-font-body);
  font-size: 13px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer;
  transition: background .15s;
}
.ap-btn-primary:hover { background: var(--ap-accent-hover); }
.ap-btn-secondary {
  background: rgba(0,0,0,.3);
  color: var(--ap-text);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm);
  padding: 8px 16px;
  font-family: var(--ap-font-body);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  letter-spacing: .04em;
  transition: border-color .15s, color .15s;
}
.ap-btn-secondary:hover { border-color: var(--ap-accent); color: var(--ap-accent); }
.ap-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Erro */
.ap-erro { font-size: 12px; color: #f87171; margin: 6px 0 0; font-weight: 700; }

/* ── Lista no modal ── */
.ap-post-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--ap-border-soft);
  border-radius: var(--ap-radius-sm);
  margin-bottom: 5px;
  background: rgba(0,0,0,.6);
  cursor: grab;
  transition: border-color .15s, background .15s;
}
.ap-post-item:active { cursor: grabbing; }
.ap-post-item:hover  { border-color: var(--ap-border); background: rgba(0,0,0,.45); }
.ap-drag-handle {
  color: #9a8660 !important;
  font-size: 14px; line-height: 1;
  cursor: grab;
  padding: 0 4px 0 0;
  flex-shrink: 0;
  user-select: none;
  opacity: 0.5;
}
.ap-drag-handle:hover { color: var(--ap-accent); opacity: 1; }
.ap-post-item-left { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.ap-post-item-texto {
  font-size: 13px; font-weight: 700;
  color: #e8d9b0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ap-post-item-hora { font-size: 10px; color: var(--ap-text-muted); flex-shrink: 0; }
.ap-post-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.ap-btn-icon {
  background: rgba(0,0,0,.3);
  border: 1px solid var(--ap-border-soft);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  color: var(--ap-text);
  transition: background .12s, border-color .12s;
}
.ap-btn-icon:hover            { background: rgba(0,0,0,.5); border-color: var(--ap-border); }
.ap-btn-icon.ap-btn-del:hover { background: rgba(200,40,40,.2); color: #f87171; border-color: rgba(248,113,113,.4); }
.ap-btn-icon.ap-btn-pub       { color: var(--ap-text-muted); }
.ap-btn-icon.ap-btn-pub.publicado { color: var(--ap-accent); border-color: var(--ap-accent); background: rgba(201,162,39,.12); }
.ap-btn-icon.ap-btn-dup:hover { background: rgba(201,162,39,.12); color: var(--ap-accent); border-color: var(--ap-accent); }

/* Sortable */
.sortable-ghost  { opacity: .35 !important; }
.sortable-chosen { box-shadow: 0 4px 20px var(--ap-accent-dim) !important; border-color: var(--ap-accent) !important; }

/* Fallback para navegadores sem color-mix (Safari < 16.4) */
@supports not (color: color-mix(in srgb, red, blue)) {
  .ap-tag-video   { background: rgba(59,130,246,.22);  color: #bfdbfe; border-left: 2.5px solid #3b82f6; }
  .ap-tag-story   { background: rgba(52,160,60,.22);   color: #bbf7c0; border-left: 2.5px solid #4a7c3f; }
  .ap-tag-acao    { background: rgba(201,162,39,.20);  color: #fde68a; border-left: 2.5px solid #c9a227; }
  .ap-tag-reel    { background: rgba(232,96,122,.22);  color: #fecdd3; border-left: 2.5px solid #e8607a; }
  .ap-tag-feriado { background: rgba(168,85,247,.22);  color: #e9d5ff; border-left: 2.5px solid #a855f7; }
}


/* ══ MODAL DETALHE (visitante) — fundo claro, texto escuro ══ */
#ap-detail-modal .ap-modal-box {
  max-width: 420px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-top: 4px solid var(--ap-accent);
  box-shadow: 0 20px 60px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.15);
}
#ap-detail-modal .ap-modal-close {
  color: #64748b;
}
#ap-detail-modal .ap-modal-close:hover {
  color: #1e293b;
}
#ap-detail-modal .ap-modal-title {
  color: #1e293b;
  font-size: 20px;
}
.ap-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.ap-detail-tipo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: .04em;
}
/* Imagem da postagem */
.ap-detail-imagem {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 14px;
  display: block;
  object-fit: cover;
  max-height: 280px;
  background: #f1f5f9;
}
.ap-detail-imagem-wrap {
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
}
.ap-detail-imagem-wrap.ratio-916 { aspect-ratio: 9/16; max-height: 300px; }
.ap-detail-imagem-wrap.ratio-34  { aspect-ratio: 3/4;  max-height: 260px; }
.ap-detail-imagem-wrap img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.ap-detail-texto {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.35;
  margin: 0 0 10px;
}
.ap-detail-legenda {
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 14px;
  padding: 10px 14px;
  background: #f8fafc;
  border-left: 3px solid var(--ap-accent);
  border-radius: 0 6px 6px 0;
  white-space: pre-wrap;
}
.ap-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.ap-detail-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}
.ap-detail-meta-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.ap-detail-pub-status {
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-align: center;
  text-transform: uppercase;
}
.ap-detail-pub-status.publicado {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.ap-detail-pub-status.pendente {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde68a;
}
/* Botão "Quero editar" no detalhe */
.ap-detail-edit-btn {
  margin-top: 14px;
  width: 100%;
  background: var(--ap-accent);
  color: #1a1008;
  border: none;
  border-radius: var(--ap-radius-sm);
  padding: 11px 20px;
  font-family: var(--ap-font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: background .15s;
  display: block;
}
.ap-detail-edit-btn:hover { background: var(--ap-accent-hover); }


/* ── Upload de imagem ── */
.ap-upload-area {
  border: 2px dashed var(--ap-border);
  border-radius: var(--ap-radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  overflow: hidden;
  position: relative;
}
.ap-upload-area:hover,
.ap-upload-area:focus-within {
  border-color: var(--ap-accent);
  background: rgba(201,162,39,.04);
}
.ap-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px 12px;
  text-align: center;
}
.ap-upload-icon  { font-size: 28px; line-height: 1; }
.ap-upload-txt   { font-size: 13px; font-weight: 700; color: #e8d9b0 !important; }
.ap-upload-sub   { font-size: 11px; color: #9a8660 !important; }
#ap-upload-preview {
  position: relative;
}
#ap-img-preview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  display: block;
  background: rgba(0,0,0,.3);
}
.ap-img-remove-btn {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0,0,0,.65);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: background .12s;
}
.ap-img-remove-btn:hover { background: rgba(200,40,40,.8); }
/* Textarea legenda */
.ap-textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
  color: #f0e4c0 !important;
  background: #0f0a03 !important;
  -webkit-text-fill-color: #f0e4c0;
}
.ap-textarea::placeholder {
  color: #7a6640 !important;
  -webkit-text-fill-color: #7a6640;
  opacity: 1;
}

/* ══ RESPONSIVO ══ */
@media (max-width: 768px) {
  /* Modal: tela cheia em mobile */
  .ap-overlay { padding: 0; align-items: flex-end; }
  .ap-modal-box {
    border-radius: 20px 20px 0 0;
    max-height: 92dvh;
    max-width: 100%;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 20px 18px 28px;
  }
  #ap-detail-modal .ap-modal-box {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
  }
}
@media (max-width: 640px) {
  #ap-root       { padding: 0.75rem 8px 100px; border-radius: 0; }
  .ap-header     { margin-bottom: 1rem; }
  .ap-title      { font-size: 18px; }
  .ap-month-label { font-size: 11px; }
  .ap-nav-btn    { padding: 7px 10px; font-size: 13px; }
  .ap-week-grid  { gap: 3px; }
  .ap-day-header { font-size: 10px; padding: 6px 0 7px; }
  .ap-day-cell   { min-height: 62px; padding: 4px; gap: 2px; border-radius: 7px; }
  .ap-day-num    { font-size: 11px; }
  /* Tags: faixa colorida compacta no mobile — ícone visível, texto oculto */
  .ap-tag {
    font-size: 0 !important;
    padding: 2px 3px;
    min-height: 7px;
    max-height: 9px;
    gap: 0;
    border-radius: 3px;
    border-left-width: 3px;
  }
  .ap-tag-pub-btn { display: none; }
  .ap-tag-hora    { display: none; }
  .ap-add-hint    { display: none; }
  /* Footer */
  .ap-footer-bar { padding: 8px 12px; gap: 8px; flex-wrap: nowrap; }
  .ap-legend     { gap: 8px; flex-wrap: nowrap; overflow-x: auto; }
  .ap-leg-item   { font-size: 10px; gap: 4px; white-space: nowrap; }
  .ap-hint       { display: none; }
  .ap-btn-pdf    { font-size: 11px; padding: 6px 10px; flex-shrink: 0; }
  /* Modal form */
  .ap-modal-box  { padding: 18px 14px 24px; }
  .ap-modal-title { font-size: 17px; }
  .ap-input, .ap-select { font-size: 16px; } /* evita zoom no iOS */
  .ap-form-actions { flex-direction: column-reverse; gap: 8px; }
  .ap-form-actions button { width: 100%; }
  .ap-btn-primary, .ap-btn-secondary { padding: 12px 16px; font-size: 14px; }
  /* Upload area */
  .ap-upload-placeholder { padding: 16px 10px; }
  .ap-upload-icon { font-size: 24px; }
  /* Post items no modal */
  .ap-post-item  { gap: 6px; padding: 8px 8px; }
  .ap-btn-icon   { padding: 5px 7px; font-size: 12px; }
  /* Detail modal */
  .ap-detail-texto { font-size: 16px; }
}
