/* Conteúdos: estúdio (no sistema) e apresentação do cliente (link /view).
   A apresentação usa a cor e o fundo de cada página (--cp-accent, --cp-bg). */

/* ---------- Estúdio ---------- */
.content-heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.content-collections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.content-collections > .content-empty {
  grid-column: 1 / -1;
}
.collection-wrap {
  position: relative;
}
.content-collection {
  width: 100%;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.content-collection:hover {
  box-shadow: var(--shadow-pop);
  transform: translateY(-1px);
}
.content-collection > span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 800;
}
.content-collection p {
  color: var(--muted);
  font-size: 13px;
}
.content-collection small {
  margin-top: auto;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  background: var(--subtle);
  font-weight: 700;
}
.collection-wrap > .icon-button {
  position: absolute;
  top: 14px;
  right: 14px;
  opacity: 0;
}
.collection-wrap:hover > .icon-button {
  opacity: 1;
}
.content-edit-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 10px 10px 16px;
  border-radius: var(--r-md);
  background: var(--subtle);
  color: var(--text);
}
.content-studio {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
}
dialog.content-wide-modal {
  width: min(980px, calc(100vw - 32px));
}
.content-setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
}
.setup-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.setup-fields > section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.setup-fields h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.setup-fields h3 b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 12px;
}
.setup-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -4px;
}
.setup-chip {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  background: var(--subtle);
  font-size: 12px;
  font-weight: 600;
}
.setup-chip.selected {
  background: var(--ink);
  color: var(--on-ink);
}
.setup-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.setup-label small {
  color: var(--muted);
  font-weight: 500;
}
.setup-layouts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.setup-layout {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start !important;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
}
.setup-layout input {
  position: absolute;
  opacity: 0;
}
.setup-layout:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.setup-layout small {
  color: var(--muted);
}
.layout-art {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-bottom: 6px;
}
.layout-art.layout-editorial {
  grid-template-columns: repeat(2, 1fr);
}
.layout-art i {
  height: 18px;
  border-radius: 4px;
  background: var(--subtle);
}
.setup-palettes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.setup-palette {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px 0 4px;
  border: 1px solid var(--line-2);
  border-radius: 17px;
  font-size: 12px;
  font-weight: 600;
}
.setup-palette > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.setup-palette i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.setup-palette.selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.setup-more {
  margin-top: 0 !important;
}
.setup-more > *:not(summary) {
  margin-top: 12px;
}
.setup-live {
  position: sticky;
  top: 70px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.setup-live > small {
  color: var(--muted);
  font-weight: 700;
}
.setup-live-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--cp-bg);
  color: #15161a;
}
.setup-live-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--cp-accent);
  color: #fff;
  font-weight: 800;
}
.setup-live-period {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 700;
}
.setup-live-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 6px;
}
.setup-live-grid.layout-editorial {
  grid-template-columns: repeat(2, 1fr);
}
.setup-live-grid i {
  aspect-ratio: 1;
  border-radius: 6px;
  background: color-mix(in srgb, var(--cp-accent) 25%, #fff);
}
.content-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.content-composer > .form-error,
.content-composer > .modal-footer {
  grid-column: 1 / -1;
}
.composer-media {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.composer-drop {
  position: relative;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  border: 2px dashed var(--line-2);
  border-radius: var(--r-lg);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.composer-drop:hover,
.composer-drop.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.composer-drop small {
  color: var(--muted);
}
.composer-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.composer-media.has-files .composer-drop {
  min-height: 110px;
}
.composer-existing,
#pending-post-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.composer-item {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--subtle);
}
.composer-item img,
.composer-item video {
  width: 100%;
  height: 100px;
  object-fit: cover;
}
.composer-item figcaption {
  padding: 4px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.composer-item .icon-button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.9);
}
.pending-pdf {
  display: grid;
  place-items: center;
  height: 100px;
  font-size: 12px;
}
.composer-tip {
  color: var(--muted);
  font-size: 12px;
}
.composer-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.composer-segment,
.composer-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.composer-segment label,
.composer-formats label {
  position: relative;
}
.composer-segment input,
.composer-formats input {
  position: absolute;
  opacity: 0;
}
.composer-segment span,
.composer-formats span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  background: var(--subtle);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.composer-segment input:checked + span,
.composer-formats input:checked + span {
  background: var(--ink);
  color: var(--on-ink);
}
.caption-count {
  color: var(--muted);
}
.caption-count.over {
  color: var(--danger-ink);
}
.composer-visibility,
.legal-check {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--subtle);
  cursor: pointer;
}
.composer-visibility input {
  position: absolute;
  opacity: 0;
}
.composer-visibility > span:last-child {
  display: flex;
  flex-direction: column;
}
.composer-visibility small {
  color: var(--muted);
}
/* Interruptor verde (protótipo do celular). */
.switch {
  position: relative;
  width: 46px;
  height: 28px;
  flex: none;
  border-radius: 14px;
  background: var(--line-2);
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(21, 22, 26, 0.25);
  transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1);
}
input:checked + .switch {
  background: var(--accent);
}
input:checked + .switch::after {
  transform: translateX(18px);
}
input:focus-visible + .switch {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Apresentação do cliente ---------- */
.content-preview {
  --cp-ink: #15161a;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 600px;
  background: var(--cp-bg, #f4f5f7);
  color: var(--cp-ink);
}
.cp-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px 20px;
  border-right: 1px solid rgba(21, 22, 26, 0.08);
}
.cp-monogram {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  background: var(--cp-accent, #15161a);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}
.cp-monogram svg {
  width: 60%;
  height: 60%;
}
.cp-sidebar h2 {
  margin-top: 6px;
  font-size: 20px;
}
.cp-sidebar > p {
  color: rgba(21, 22, 26, 0.6);
}
.cp-period {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  font-weight: 700;
}
.cp-sidebar h3 {
  margin-top: 18px;
  color: rgba(21, 22, 26, 0.5);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.cp-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cp-sidebar nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: var(--r);
  text-align: left;
  color: var(--cp-ink);
}
.cp-sidebar nav button:hover {
  background: rgba(255, 255, 255, 0.55);
}
.cp-sidebar nav b {
  width: 22px;
  color: rgba(21, 22, 26, 0.45);
  font-size: 11px;
}
.cp-nav-thumb {
  width: 34px;
  height: 34px;
  flex: none;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
}
.cp-nav-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cp-sidebar nav span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
}
.cp-sidebar nav small {
  color: rgba(21, 22, 26, 0.5);
  font-weight: 500;
}
.cp-main {
  min-width: 0;
  padding: 28px;
}
.cp-main > header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.cp-main > header small {
  color: rgba(21, 22, 26, 0.5);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.cp-main > header h1 {
  margin: 4px 0;
  font-size: 30px;
}
.cp-main > header p {
  color: rgba(21, 22, 26, 0.7);
}
.cp-awaiting {
  display: inline-flex;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: #fff6e0;
  color: #6b4e00 !important;
  font-size: 13px;
  font-weight: 700;
}
.cp-editor-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 10px;
  background: #15161a;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.cp-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
}
.cp-tabs button {
  min-height: 34px;
  padding: 0 16px;
  border-radius: 10px;
  color: var(--cp-ink);
  font-weight: 600;
}
.cp-tabs .active {
  background: #15161a;
  color: #fff;
}
.cp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.content-preview.editorial .cp-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cp-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  color: var(--cp-ink);
  transition: transform 0.2s;
}
.cp-tile:hover {
  transform: translateY(-2px);
}
.cp-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
}
.cp-media img,
.cp-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cp-text-art {
  padding: 18px;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}
.cp-number,
.cp-format {
  position: absolute;
  top: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  font-weight: 700;
}
.cp-number {
  left: 10px;
}
.cp-format {
  right: 10px;
}
.cp-review-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  background: #fff;
}
.rv-approval {
  background: #fff6e0 !important;
  color: #6b4e00;
}
.rv-changes {
  background: #fdebdd !important;
  color: #9a4a12;
}
.rv-approved {
  background: #e1f6ec !important;
  color: #0e6b4b;
}
.rv-scheduled {
  background: #eee9ff !important;
  color: #4b36a8;
}
.rv-published {
  background: #e2f0fc !important;
  color: #1f5c8f;
}
.cp-post-view .cp-review-badge {
  position: static;
  display: inline-flex;
  margin: 6px 0;
}
.cp-tile-caption {
  display: flex;
  flex-direction: column;
}
.cp-tile-caption small {
  color: rgba(21, 22, 26, 0.55);
}
.cp-add-tile .cp-media {
  border: 2px dashed rgba(21, 22, 26, 0.18);
  background: transparent;
  align-content: center;
  gap: 4px;
}
.cp-add-tile b {
  font-size: 30px;
}
.cp-empty {
  grid-column: 1 / -1;
  color: rgba(21, 22, 26, 0.55);
}
.cp-document {
  padding: 14px;
  font-weight: 700;
}
/* Linha do tempo do processo */
.legal-preview {
  padding: 32px;
  background: var(--cp-bg, #f4f5f7);
  color: #15161a;
}
.legal-preview > header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 20px;
}
.legal-preview > header small {
  color: rgba(21, 22, 26, 0.5);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.case-status {
  padding: 4px 12px;
  border-radius: 10px;
  background: var(--cp-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.legal-file-bank {
  margin: 0 0 20px !important;
  background: rgba(255, 255, 255, 0.7) !important;
  border-color: transparent !important;
}
.legal-file-index {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}
.legal-file-index a {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}
.legal-file-index small {
  color: rgba(21, 22, 26, 0.55);
  font-weight: 500;
}
.legal-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 26px;
}
.legal-timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: rgba(21, 22, 26, 0.12);
}
.legal-timeline article {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.85);
}
.timeline-dot {
  position: absolute;
  left: -24px;
  top: 20px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--cp-bg, #fff);
  background: var(--cp-accent);
}
.legal-timeline time {
  color: rgba(21, 22, 26, 0.55);
  font-size: 12px;
}
.legal-timeline strong {
  color: var(--cp-accent);
  font-size: 13px;
}
.legal-files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.legal-files img,
.legal-files video {
  width: 100%;
  border-radius: var(--r);
}
.legal-timeline article > button {
  align-self: flex-start;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
}
/* Janela da publicação (cliente e estúdio) */
#post-dialog,
dialog.cp-dialog {
  width: min(980px, calc(100vw - 32px));
}
.cp-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 16px;
}
.cp-post-view {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}
.cp-post-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
  background: #15161a;
}
.cp-post-media img,
.cp-post-media video {
  width: 100%;
  max-height: 80dvh;
  object-fit: contain;
}
.cp-post-media .cp-text-art {
  color: #fff;
}
.cp-post-media nav {
  position: absolute;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}
.cp-post-media nav button {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}
.cp-post-view > section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 28px 24px;
}
.cp-post-view > section > small {
  color: var(--muted);
  font-weight: 700;
}
.cp-label {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}
.cp-caption {
  white-space: pre-wrap;
}
.cp-review {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.cp-facets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.cp-facets span {
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: var(--r);
  background: var(--subtle);
  font-size: 12px;
  font-weight: 700;
}
.cp-facets small {
  color: var(--muted);
  font-weight: 500;
}
.fc-approved {
  background: var(--mint) !important;
  color: var(--mint-ink);
}
.fc-changes {
  background: var(--peach) !important;
  color: var(--peach-ink);
}
.cp-review-actions {
  display: flex;
  gap: 8px;
}
.cp-approve,
.cp-change {
  flex: 1;
  min-height: 48px;
  border-radius: 14px;
  font-weight: 700;
}
.cp-approve {
  background: #16a974;
  color: #fff;
}
.cp-change {
  border: 1px solid var(--line-2);
  background: var(--surface);
}
.cp-review-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cp-review-form fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cp-review-form > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.cp-review-error {
  color: var(--danger-ink);
}
.cp-review-note {
  color: var(--muted);
}
.cp-thread article {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 4px 14px 14px 14px;
  background: var(--subtle);
  font-size: 13px;
}
.cp-thread article.client {
  background: var(--lilac);
}
.cp-thread time {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
/* Página do link (view.html) */
body.client-view {
  background: var(--bg);
}
body.client-view #viewer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
}
body.client-view .content-preview,
body.client-view .legal-preview {
  overflow: hidden;
  border-radius: var(--r-xl);
}
.preview-notice {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--r);
  background: var(--sun);
  color: var(--sun-ink);
  font-size: 13px;
  font-weight: 600;
}
.cp-unavailable {
  max-width: 480px;
  margin: 15vh auto;
  padding: 28px;
  border-radius: var(--r-xl);
  background: var(--surface);
  text-align: center;
}

@media (max-width: 900px) {
  .content-setup,
  .content-composer,
  .cp-post-view {
    grid-template-columns: minmax(0, 1fr);
  }
  .setup-live {
    position: static;
  }
  .content-preview {
    grid-template-columns: minmax(0, 1fr);
  }
  .cp-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(21, 22, 26, 0.08);
  }
  .cp-sidebar nav {
    flex-direction: row;
    overflow-x: auto;
  }
  .cp-sidebar nav button {
    flex: none;
  }
  .cp-post-media {
    min-height: 280px;
  }
}
@media (max-width: 600px) {
  .cp-grid,
  .content-preview.editorial .cp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .cp-main,
  .legal-preview {
    padding: 18px;
  }
  .cp-facets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .setup-layouts {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Organização das publicações na página do cliente. */
.setup-sort {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.setup-sort label {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
}
.setup-sort label:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.setup-sort input {
  margin-top: 3px;
  accent-color: var(--ink);
}
.setup-sort strong {
  display: block;
  font-size: 13.5px;
}
.setup-sort small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
@media (max-width: 600px) {
  .setup-sort {
    grid-template-columns: minmax(0, 1fr);
  }
}
.composer-caption[hidden] {
  display: none !important;
}
/* Publicação aberta no link: setas nas laterais da imagem (Instagram),
   contador no canto e pontinhos embaixo. */
.cp-side {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  padding: 0 0 3px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  color: #15161a;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.15s,
    background 0.15s;
}
.cp-side:hover {
  background: #fff;
  transform: scale(1.06);
}
.cp-side.prev {
  left: 12px;
}
.cp-side.next {
  right: 12px;
}
.cp-side[hidden] {
  display: none;
}
.cp-count {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(21, 22, 26, 0.7);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cp-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  display: flex;
  gap: 4px;
  transform: translateX(-50%);
}
.cp-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}
.cp-dots i.on {
  background: #fff;
}
.cp-post-media.is-story img,
.cp-post-media.is-story video {
  max-width: min(100%, 45dvh);
  aspect-ratio: 9 / 16;
  object-fit: cover;
}
/* Comentários do cliente: conversa simples com a equipe. */
.cp-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.cp-chat .cp-label {
  margin: 0;
}
.cp-chat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.cp-chat-list article {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 4px 14px 14px 14px;
  background: var(--subtle);
  font-size: 13px;
}
.cp-chat-list article.client {
  align-self: flex-end;
  border-radius: 14px 4px 14px 14px;
  background: var(--lilac);
}
.cp-chat-list header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
}
.cp-chat-list header span {
  color: var(--muted);
}
.cp-chat-list time {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}
.cp-chat-list p {
  margin: 3px 0 0;
  white-space: pre-wrap;
}
.cp-chat-empty {
  color: var(--muted);
  font-size: 13px;
}
.cp-chat-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.cp-chat-form textarea {
  min-height: 52px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  resize: vertical;
}
.cp-chat-form textarea:focus {
  outline: none;
}
/* O foco passa para o formulário inteiro (auditoria WCAG 2.4.7). */
.cp-chat-form:focus-within {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, var(--ink));
  outline-offset: 2px;
}
.cp-chat-form > div {
  display: flex;
  gap: 8px;
}
.cp-chat-form input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--subtle);
}
.cp-send {
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--on-ink, #fff);
  font-weight: 700;
  cursor: pointer;
}
.cp-chat-form .cp-review-error:empty {
  display: none;
}
.cp-post-view > section > .cp-review-badge {
  align-self: flex-start;
}
.preview-notice {
  display: flex;
  align-items: center;
  gap: 12px;
}
.preview-back {
  flex: none;
  height: 30px;
  padding: 0 12px;
  border: 1px solid currentColor;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.cp-review-actions[hidden],
.cp-review-form[hidden] {
  display: none;
}
.cp-review-form-actions {
  display: flex;
  gap: 8px;
}
.cp-review-form-actions .cp-change {
  flex: 1;
}
.cp-cancel {
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: var(--subtle);
  font-weight: 700;
  cursor: pointer;
}
.cp-note-open {
  width: 100%;
}
.cp-chat .cp-label small {
  color: var(--muted);
  font-weight: 500;
}
.cp-chat-form input[type="hidden"] + .cp-send {
  margin-left: auto;
}
.cp-locked form {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.cp-locked input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
}
.cp-locked .cp-send {
  height: 42px;
}
/* Chave de acesso da página do cliente (Configurar página). */
.setup-key .key-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 6px;
}
.setup-key .key-row input {
  flex: 1 1 180px;
  min-width: 0;
}
.setup-key .key-on {
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--mint);
  color: var(--mint-ink);
  font-size: 11px;
  font-weight: 700;
}
.share-key-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--mint);
  color: var(--mint-ink);
  font-size: 13px;
}

/* ======================================================================
   Página do cliente — nova estrutura (28/10/2026)
   Menu lateral com o calendário do mês, cabeçalho com título em serifa,
   grade 4:5 e post aberto em coluna (imagem centralizada em cima, texto
   embaixo). Cores vêm da página (--cp-accent e --cp-bg).
   ====================================================================== */
.cpx {
  --cpx-ink: color-mix(in srgb, var(--cp-accent, #775568) 55%, #15161a);
  --cpx-soft: color-mix(in srgb, var(--cp-bg, #f1eadd) 88%, #fff);
  --cpx-side: color-mix(in srgb, var(--cp-bg, #f1eadd) 80%, #fff);
  --cpx-line: color-mix(in srgb, var(--cp-accent, #775568) 16%, transparent);
  --cpx-serif:
    "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  position: relative;
  display: grid !important;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100dvh;
  padding: 0 !important;
  border-radius: 0 !important;
  background: var(--cp-bg, #f1eadd);
  color: #1f1a1d;
}
.cpx.side-open {
  grid-template-columns: 0 minmax(0, 1fr);
}
/* Menu lateral */
.cpx-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100dvh;
  overflow: hidden auto;
  padding: 22px 18px;
  border-right: 1px solid var(--cpx-line);
  background: var(--cpx-side);
  transition:
    transform 0.35s var(--ease, ease),
    opacity 0.25s;
}
.cpx.side-open .cpx-side {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}
.cpx-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--cpx-line);
}
.cpx-brand strong {
  display: block;
  font-family: var(--cpx-serif);
  font-size: 16px;
}
.cpx-brand small {
  display: block;
  color: color-mix(in srgb, #1f1a1d 55%, transparent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cpx-mono {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 11px;
  background: var(--cp-accent, #775568);
  color: #fff;
  font-family: var(--cpx-serif);
  font-size: 17px;
  font-weight: 700;
}
.cpx-mono svg {
  width: 70%;
  height: 70%;
  fill: currentColor;
}
.cpx-mono.big {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  font-size: 26px;
}
.cpx-collapse,
.cpx-menu {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--cpx-line);
  border-radius: 50%;
  background: var(--cpx-soft);
  color: #1f1a1d;
  font-size: 15px;
  cursor: pointer;
}
.cpx-client h2 {
  margin: 0;
  font-family: var(--cpx-serif);
  font-size: 23px;
  line-height: 1.15;
}
.cpx-client p {
  margin: 6px 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cpx-client small {
  color: color-mix(in srgb, #1f1a1d 60%, transparent);
  font-size: 12px;
}
.cpx-side h3 {
  margin: 4px 0 -6px;
  color: color-mix(in srgb, #1f1a1d 50%, transparent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.cpx-side nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cpx-side nav button {
  display: grid;
  grid-template-columns: 24px 36px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 7px 6px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.cpx-side nav button:hover,
.cpx-side nav button:focus-visible {
  background: color-mix(in srgb, var(--cp-accent, #775568) 10%, transparent);
}
.cpx-side nav b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--cpx-line);
  border-radius: 50%;
  font-size: 10px;
}
.cpx-thumb {
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 9px;
  background: color-mix(in srgb, var(--cp-accent, #775568) 15%, #fff);
}
.cpx-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cpx-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cpx-name small {
  display: block;
  color: color-mix(in srgb, #1f1a1d 55%, transparent);
  font-size: 11px;
  font-weight: 500;
}
.cpx-type {
  font-size: 12px;
  font-style: normal;
  opacity: 0.6;
}
/* Conteúdo */
.cpx-main {
  min-width: 0;
  max-width: 1040px;
  margin: 0 auto;
  padding: 34px 40px 60px !important;
  width: 100%;
}
.cpx-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--cpx-line);
}
.cpx-head small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}
.cpx-head h1 {
  margin: 2px 0 0;
  font-family: var(--cpx-serif);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.05;
}
.cpx-head .cpx-menu {
  display: none;
  margin: 0;
}
.cpx.side-open .cpx-head .cpx-menu {
  display: grid;
}
.cpx-modes {
  display: flex;
  gap: 6px;
  margin-left: auto;
  padding: 4px;
  border: 1px solid var(--cpx-line);
  border-radius: 99px;
  background: var(--cpx-soft);
}
.cpx-modes button {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}
.cpx-modes .active {
  background: var(--cp-accent, #775568);
  color: #fff;
}
.cpx-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 16px 0 12px;
}
.cpx-intro p {
  max-width: 620px;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  opacity: 0.8;
}
.cpx-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.cpx-bar .cp-tabs {
  margin: 0;
}
.cpx-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}
.cpx-legend i {
  margin-left: 8px;
  font-style: normal;
}
.cpx-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.cpx.editorial .cpx-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.cpx-grid .cp-tile {
  padding: 0;
  border: 0;
  background: none;
}
.cpx-grid .cp-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 6px;
  background: color-mix(in srgb, var(--cp-accent, #775568) 18%, #15161a);
}
.cpx-grid.is-stories .cp-media {
  aspect-ratio: 9 / 16;
}
.cpx-grid .cp-media img,
.cpx-grid .cp-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s var(--ease, ease);
}
.cpx-grid .cp-tile:hover .cp-media img,
.cpx-grid .cp-tile:hover .cp-media video {
  transform: scale(1.04);
}
.cpx-grid .cp-number {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(21, 22, 26, 0.6);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}
.cpx-grid .cpx-type {
  position: absolute;
  top: 7px;
  right: 9px;
  color: #fff;
  font-size: 14px;
  opacity: 0.9;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.cpx-grid .cp-review-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
}
.cpx-grid .cp-text-art {
  padding: 16px;
  color: #fff;
  font-family: var(--cpx-serif);
  font-size: 17px;
  text-align: center;
}
/* Roteiro (só texto) */
.cpx-week h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.cpx-week h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--cpx-line);
}
.cpx-script {
  margin-bottom: 14px;
  padding: 20px 22px;
  border: 1px solid var(--cpx-line);
  border-radius: 18px;
  background: var(--cpx-soft);
}
.cpx-script header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.cpx-day {
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--cp-accent, #775568);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cpx-script header small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}
.cpx-script h3 {
  margin: 12px 0 8px;
  font-family: var(--cpx-serif);
  font-size: 20px;
  line-height: 1.25;
}
.cpx-script-body {
  padding-left: 14px;
  border-left: 2px solid var(--cpx-line);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.cpx-open {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cpx-ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.cpx-scrim {
  display: none;
}
/* Página do link ocupa a tela toda. */
body.client-view #viewer {
  max-width: none;
  padding: 0;
}
body.client-view .content-preview.cpx {
  overflow: visible;
  border-radius: 0;
}
/* Post aberto: coluna única, imagem centralizada em cima e texto embaixo. */
#post-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden auto;
  border: 0;
  border-radius: 22px;
}
#post-dialog .cp-post-view {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
}
#post-dialog .cp-post-media {
  display: grid;
  place-items: center;
  min-height: 0;
  max-height: 68dvh;
  aspect-ratio: 4 / 5;
  background: #15161a;
}
#post-dialog .cp-post-media.is-story {
  aspect-ratio: 9 / 16;
  max-height: 74dvh;
}
#post-dialog .cp-post-media img,
#post-dialog .cp-post-media video {
  width: 100%;
  height: 100%;
  max-height: inherit;
  object-fit: contain;
  object-position: center;
}
#post-dialog .cp-post-view > section {
  padding: 20px 22px 24px;
}
.cp-kicker {
  color: var(--muted);
  font-size: 11px !important;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
#post-dialog h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 22px;
  line-height: 1.25;
}
/* Animações de abertura (só na primeira vez) */
@keyframes cpx-in-left {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
}
@keyframes cpx-in-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}
@keyframes cpx-in-tile {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}
@keyframes cpx-dialog {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
}
.cpx.intro .cpx-side {
  animation: cpx-in-left 0.6s var(--ease, ease) both;
}
.cpx.intro .cpx-side nav button {
  animation: cpx-in-left 0.5s var(--ease, ease) both;
  animation-delay: calc(0.15s + var(--i, 0) * 35ms);
}
.cpx.intro .cpx-head {
  animation: cpx-in-up 0.6s var(--ease, ease) 0.1s both;
}
.cpx.intro .cpx-intro,
.cpx.intro .cpx-bar {
  animation: cpx-in-up 0.6s var(--ease, ease) 0.2s both;
}
.cpx.intro .cpx-grid .cp-tile,
.cpx.intro .cpx-script {
  animation: cpx-in-tile 0.55s var(--ease, ease) both;
  animation-delay: calc(0.25s + var(--i, 0) * 45ms);
}
.cpx:not(.intro) .cpx-grid .cp-tile,
.cpx:not(.intro) .cpx-script {
  animation: cpx-in-up 0.35s var(--ease, ease) both;
}
#post-dialog[open] {
  animation: cpx-dialog 0.32s var(--ease, ease);
}
#post-dialog::backdrop {
  background: rgba(21, 22, 26, 0.55);
  backdrop-filter: blur(3px);
}
@media (prefers-reduced-motion: reduce) {
  .cpx *,
  .cpx,
  #post-dialog[open] {
    animation: none !important;
    transition: none !important;
  }
}
/* Tablet e celular: o menu lateral vira gaveta. */
@media (max-width: 860px) {
  .cpx,
  .cpx.side-open {
    grid-template-columns: minmax(0, 1fr);
  }
  .cpx-side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(320px, 86vw);
    height: 100dvh;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
    transform: translateX(-105%);
    opacity: 1;
    pointer-events: none;
  }
  .cpx.side-open .cpx-side {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
  .cpx.intro .cpx-side {
    animation: none;
  }
  .cpx-scrim {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: block;
    background: rgba(21, 22, 26, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .cpx.side-open .cpx-scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .cpx-head .cpx-menu {
    display: grid;
  }
  .cpx-main {
    padding: 18px 16px 40px !important;
  }
  .cpx-head {
    flex-wrap: wrap;
    gap: 12px;
  }
  .cpx-mono.big {
    width: 44px;
    height: 44px;
    font-size: 21px;
  }
  .cpx-modes {
    width: 100%;
    margin-left: 0;
  }
  .cpx-modes button {
    flex: 1;
    padding: 0 8px;
  }
}
@media (max-width: 600px) {
  .cpx-grid {
    gap: 3px;
  }
  .cpx-grid .cp-number {
    top: 5px;
    left: 5px;
    font-size: 9.5px;
  }
  .cpx-grid .cp-review-badge {
    display: none;
  }
  .cpx-legend {
    display: none;
  }
  .cpx-script {
    padding: 16px;
  }
  #post-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 94dvh;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }
  #post-dialog .cp-post-media {
    max-height: 58dvh;
  }
}
.cpx-script .cp-review-badge {
  position: static;
  margin-left: auto;
}
.cpx-grid .cp-text-art {
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .cpx-grid .cp-text-art {
    padding: 8px;
    font-size: 12px;
  }
  .cpx-grid .cpx-type {
    font-size: 11px;
  }
}
