/* Painel */
.poster-dialog {
  width: min(1080px, 96vw);
  max-height: 94vh;
  padding: 0;
}

.poster-panel {
  padding: 24px;
  max-height: 90vh;
  overflow: auto;
  overflow-wrap: anywhere;
}

.poster-panel > p {
  line-height: 1.6;
}

.poster-panel button,
.poster-panel input,
.poster-panel select,
.poster-panel textarea {
  font: inherit;
}

.poster-panel button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.poster-panel :focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.poster-feedback {
  min-height: 24px;
  color: #d5d8dc;
}

.poster-help {
  color: #aeb4bd;
  font-size: 12px;
  line-height: 1.6;
}

.poster-panel [hidden] {
  display: none !important;
}

/* Execução e controles sempre visíveis */
.poster-execution {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding: 18px;
  margin: 16px 0;
  border: 1px solid var(--lime);
  border-radius: 12px;
  background: var(--panel-2, #191d23);
}

.poster-execution h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.poster-countdown {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--lime);
}

.poster-execution p {
  margin: 6px 0 0;
}

.poster-execution progress {
  display: block;
  width: 100%;
  height: 10px;
  margin-top: 10px;
  accent-color: var(--lime);
}

.poster-execution-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  max-width: 360px;
}

.poster-execution-controls .btn {
  min-height: 44px;
  white-space: normal;
}

/* Abas e campos */
.poster-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin: 20px 0;
  padding-bottom: 10px;
}

.poster-tabs button {
  padding: 10px 14px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #aeb4bd;
  cursor: pointer;
}

.poster-tabs button[aria-selected=true] {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--lime);
}

.poster-context,
.poster-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.poster-panel label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 12px 0;
  color: #d5d8dc;
  font-size: 13px;
}

.poster-panel input,
.poster-panel textarea,
.poster-panel select {
  width: 100%;
  min-width: 0;
  padding: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: inherit;
}

.poster-panel textarea {
  resize: vertical;
}

.poster-panel .poster-check {
  flex-direction: row;
  align-items: center;
}

.poster-panel .poster-check input {
  width: auto;
}

.poster-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.poster-toolbar label {
  margin: 0;
}

.poster-toolbar .btn,
.poster-toolbar .small-btn {
  white-space: normal;
  height: auto;
  min-height: 40px;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* Grupos, fila e histórico */
.poster-list > article {
  border-top: 1px solid var(--line);
  padding: 20px 0;
}

.poster-list h3 {
  margin: 0;
  font-size: 16px;
}

.poster-list a {
  display: inline-block;
  color: #c8f65b;
  font-size: 12px;
  margin: 8px 0;
  text-underline-offset: 3px;
}

.poster-queue-item header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.poster-status {
  font-size: 12px;
  color: #aeb4bd;
}

.poster-status[data-status=publicado],
.poster-status[data-status=aguardando_admin] {
  color: #c8f65b;
}

.poster-status[data-status=erro] {
  color: #ffb4a8;
}

.poster-status[data-status=publicando] {
  color: #f0ce8c;
}

.poster-queue-item pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  color: #aeb4bd;
}

.poster-queue-item summary {
  cursor: pointer;
  font-size: 12px;
}

.poster-install {
  grid-column: 2 / -1;
  font-size: 12px;
  color: #aeb4bd;
  line-height: 1.6;
}

.poster-install a {
  color: #c8f65b;
}

.poster-install ol {
  padding-left: 20px;
}

/* Responsivo */
@media (max-width: 700px) {
  .poster-execution {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .poster-execution-controls > button {
    flex: 1;
    min-width: 0;
  }

  .poster-execution-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    max-width: none;
  }

  #posterSkipCurrent {
    grid-column: 1 / -1;
    order: 3;
  }
  .poster-panel {
    padding: 18px;
  }

  .poster-context,
  .poster-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .poster-toolbar > button {
    max-width: 100%;
  }

  .poster-tabs button {
    flex: 1 0 40%;
  }
}
