/* Approved editorial palette shared by sites, Telegram and video. */
body.editorial-theme {
  --ed-bg: #0a0a0c;
  --ed-panel: #101013;
  --ed-raised: #19191e;
  --ed-line: #29292f;
  --ed-text: #ededf0;
  --ed-muted: #a2a2ad;
  --ed-accent: #bdd3c8;
  background: var(--ed-bg);
  color: var(--ed-text);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
.editorial-theme aside {
  background: #0e0e11 !important;
  border-color: var(--ed-line) !important;
}
.editorial-theme #main-sidebar nav button {
  justify-content: flex-start;
  gap: 12px;
  text-align: left;
  background: transparent;
  color: var(--ed-muted);
  border: 1px solid transparent;
  border-radius: 8px;
}
.editorial-theme #main-sidebar nav button.ed-selected {
  background: #222227;
  color: var(--ed-text);
  border-color: #38383f;
}
.editorial-theme #main-sidebar nav button i {
  width: 18px;
  flex: 0 0 18px;
  text-align: center;
  color: inherit !important;
}
.editorial-theme .ed-nav-label {
  font-size: 10px;
  color: #85858f;
  letter-spacing: 1.6px;
  padding: 16px 16px 4px;
}
.editorial-theme .ed-legacy-nav {
  display: none !important;
}
.ed-page {
  max-width: 1390px;
  margin: auto;
  color: var(--ed-text);
  font-size: 14px;
  line-height: 1.55;
}
.ed-page button,
.ed-dialog button {
  font: inherit;
  border: 1px solid var(--ed-line, #29292f);
  border-radius: 8px;
  background: transparent;
  padding: 9px 14px;
  color: inherit;
  cursor: pointer;
  min-height: 40px;
}
.ed-page button:not(.ed-primary):hover,
.ed-dialog button:not(.ed-primary):hover {
  background: #222227;
}
.ed-page button:disabled,
.ed-dialog button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ed-page button:not(.ed-primary).active {
  background: #24242a;
  border-color: #666670;
}
.ed-page .ed-primary,
.ed-dialog .ed-primary,
.ep-page .ep-primary {
  background: #bdd3c8;
  color: #18251e;
  border-color: #bdd3c8;
  font-weight: 650;
}
.ed-page .ed-primary:not(:disabled):is(:hover, :focus-visible),
.ed-dialog .ed-primary:not(:disabled):is(:hover, :focus-visible),
.ep-page .ep-primary:not(:disabled):is(:hover, :focus-visible) {
  background: #abc6b8;
  color: #18251e;
  border-color: #abc6b8;
}
.ed-page .ed-primary:not(:disabled):active,
.ed-dialog .ed-primary:not(:disabled):active,
.ep-page .ep-primary:not(:disabled):active {
  background: #9cb9a9;
  color: #18251e;
  border-color: #9cb9a9;
}
.ed-page .ed-danger,
.ed-dialog .ed-danger {
  color: #edb1a3;
}
.ed-page :is(button, a, input, select, textarea):focus-visible,
.ed-dialog :is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid #a1c7b7;
  outline-offset: 3px;
}
.ed-page :is(input, textarea, select),
.ed-dialog :is(input, textarea, select) {
  font: inherit;
  color: var(--ed-text, #ededf0);
  background: #0b0b0e;
  border: 1px solid #3a3a43;
  border-radius: 7px;
  padding: 10px 12px;
  max-width: 100%;
  min-width: 0;
  color-scheme: dark;
}
.ed-page input[type="checkbox"],
.ed-dialog input[type="checkbox"] {
  accent-color: #9db7a9;
  width: 17px;
  height: 17px;
}
.ed-page textarea,
.ed-dialog textarea {
  width: 100%;
  line-height: 1.7;
  min-height: 150px;
}
.ed-page label,
.ed-dialog label {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 13px;
  color: #b6b6c0;
}
.ed-page .ed-field,
.ed-dialog .ed-field {
  display: grid;
  gap: 6px;
}
.ed-field input,
.ed-field select {
  width: 100%;
}
.ed-resources,
.ed-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.ed-resources {
  margin-bottom: 24px;
}
.ed-resources .ed-settings {
  margin-left: auto;
  color: var(--ed-muted);
  font-size: 12px;
}
.ed-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 25px;
}
.ed-modes button {
  text-align: left;
  padding: 17px 19px;
  background: #111115;
}
.ed-modes b {
  font-size: 20px;
  display: block;
}
.ed-modes small {
  display: block;
  color: var(--ed-muted);
  font-size: 12px;
  margin-top: 4px;
}
.ed-toolbar {
  padding: 14px 16px;
  background: var(--ed-panel);
  border: 1px solid var(--ed-line);
  border-radius: 11px;
  margin: 18px 0 22px;
}
.ed-spread {
  justify-content: space-between;
}
.ed-toolbar .ed-row + .ed-row {
  margin-top: 15px;
}
.ed-planbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.ed-planbar .ed-field {
  width: 175px;
}
.ed-planbar .ed-time-field {
  width: 115px;
}
.ed-planbar input,
.ed-planbar button {
  min-height: 44px;
}
.ed-planbar .ed-primary {
  margin-left: auto;
}
.ed-date {
  display: flex;
  align-items: center;
  gap: 15px;
  border-top: 1px solid #3a3a42;
  border-bottom: 1px solid var(--ed-line);
  padding: 15px 0;
  margin: 27px 0 15px;
}
.ed-date strong {
  font-size: 27px;
  letter-spacing: -0.4px;
}
.ed-date span,
.ed-muted {
  color: var(--ed-muted);
}
.ed-date span,
.ed-meta {
  font-size: 12px;
  color: var(--ed-muted);
}
.ed-cards {
  display: grid;
  gap: 12px;
}
.ed-card {
  padding: 20px 22px;
  border: 1px solid var(--ed-line);
  border-radius: 11px;
  background: #0f0f12;
  min-width: 0;
}
.ed-card h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.ed-card p {
  font-size: 13px;
  color: var(--ed-muted);
  overflow-wrap: anywhere;
}
.ed-card .ed-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 16px;
}
.ed-card .ed-actions button {
  font-size: 12px;
}
.ed-timeline {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 22px;
}
.ed-clock {
  padding-right: 20px;
  border-right: 1px solid var(--ed-line);
}
.ed-clock time {
  display: block;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -1px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.ed-clock small {
  display: block;
  font-size: 11px;
  color: var(--ed-muted);
  margin-top: 7px;
}
.ed-badge {
  display: inline-flex;
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid #3b3b43;
  border-radius: 5px;
  color: #b8b8c3;
}
.ed-badge.draft {
  color: #edb1a3;
  border-color: #edb1a334;
  background: #edb1a30c;
}
.ed-badge.preparing {
  color: #e7d59b;
  border-color: #e7d59b34;
  background: #e7d59b0c;
}
.ed-badge.published {
  color: #a1c7b7;
  border-color: #a1c7b734;
}
.ed-badge.failed {
  color: #edb1a3;
}
.ed-filters {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.ed-filters button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 9px 0;
  color: var(--ed-muted);
  font-size: 13px;
}
.ed-filters button.active {
  border-color: #a1c7b7;
  background: none;
  color: var(--ed-text);
}
.ed-filters small {
  margin-left: 6px;
  color: #85858f;
}
.ed-empty {
  padding: 32px;
  text-align: center;
  border: 1px dashed var(--ed-line);
  border-radius: 10px;
  color: var(--ed-muted);
}
.ed-error {
  color: #edb1a3;
  padding: 12px 0;
  font-size: 13px;
  white-space: pre-wrap;
}
.ed-note {
  font-size: 12px;
  color: var(--ed-muted);
  line-height: 1.7;
  margin: 14px 0;
}
.ed-panel {
  background: var(--ed-panel);
  padding: 22px;
  border: 1px solid var(--ed-line);
  border-radius: 11px;
  margin: 18px 0;
}
.ed-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.ed-media {
  display: flex;
  gap: 8px;
  margin: 14px 0;
  flex-wrap: wrap;
}
.ed-media img,
.ed-media video {
  width: 140px;
  max-height: 100px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--ed-line);
}
.ed-dialog {
  background: #131317;
  color: #ededf0;
  border: 1px solid #44444d;
  border-radius: 14px;
  width: min(1100px, calc(100vw - 32px));
  padding: 24px;
  max-height: 90vh;
  overflow: auto;
  color-scheme: dark;
}
.ed-dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(3px);
}
.ed-dialog h2 {
  font-size: 21px;
  font-weight: 650;
}
.ed-dialog .ed-close {
  margin-left: auto;
  border: 0;
  font-size: 23px;
}
.ed-dialog form {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}
.ed-footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
  border-top: 1px solid #29292f;
  padding: 16px 0 0;
  margin-top: 18px;
}
.ed-dialog .ed-native {
  margin-top: 18px;
}
.ed-dialog .ed-native .glass-card {
  background: #0f0f12;
  border-color: #29292f;
  box-shadow: none;
}
.ed-native [id^="post-view-text-"] {
  display: none;
}
.ed-native [id^="post-edit-block-"] {
  display: flex;
}
.ed-views {
  display: flex;
  gap: 6px;
}
.ed-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ed-table .ed-card {
  border-radius: 0;
  border-width: 0 0 1px;
}
.ed-table .ed-card p {
  display: none;
}
.ed-prompt-text {
  min-height: 240px !important;
}
.ed-dialog [hidden],
.ed-page [hidden] {
  display: none !important;
}
/* Keep the existing site workbench and use the same restrained tokens. */
.editorial-theme .ep-modes button {
  border-color: #29292f;
  background: #111115;
}
.editorial-theme .ep-modes button[aria-pressed="true"] {
  background: #222226;
}
.editorial-theme .ep-day-heading {
  border-left: 0;
  background: #101013;
}
.editorial-theme .ep-filter[aria-pressed="true"] {
  border-color: #a1c7b7;
}
.editorial-theme .ep-primary,
.editorial-theme .ep-page #site-editor-workbench #btn-site-draft-publish {
  background: #bdd3c8;
  color: #18251e;
  border-color: #bdd3c8;
}
.editorial-theme .ep-category {
  color: #a2a2ad;
}
.editorial-theme .ep-page input:focus-visible {
  outline-color: #a1c7b7;
}
@media (max-width: 760px) {
  .ed-modes {
    gap: 8px;
  }
  .ed-modes b {
    font-size: 17px;
  }
  .ed-modes button {
    padding: 13px;
  }
  .ed-grid2 {
    grid-template-columns: 1fr;
  }
  .ed-board {
    grid-template-columns: 1fr;
  }
  .ed-timeline {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 14px;
  }
  .ed-clock {
    padding-right: 12px;
  }
  .ed-clock time {
    font-size: 27px;
  }
  .ed-card {
    padding: 18px 16px;
  }
  .ed-card h3 {
    font-size: 16px;
  }
  .ed-date strong {
    font-size: 25px;
  }
  .ed-date {
    flex-wrap: wrap;
    gap: 8px;
  }
  .ed-dialog {
    padding: 18px;
  }
  .ed-resources .ed-settings {
    margin-left: 0;
  }
  .ed-planbar .ed-primary {
    margin-left: 0;
  }
  .ed-planbar .ed-field {
    flex: 1 1 145px;
  }
  .ed-planbar .ed-time-field {
    flex: 1 1 100px;
  }
}
@media (max-width: 440px) {
  .ed-modes {
    grid-template-columns: 1fr;
  }
  .ed-modes b,
  .ed-modes small {
    display: inline;
  }
  .ed-modes small {
    margin-left: 8px;
    font-size: 10px;
  }
  .ed-planbar .ed-primary {
    width: 100%;
  }
  .ed-views button {
    font-size: 11px;
    padding: 8px;
  }
  .ed-dialog .ed-footer button {
    flex: 1;
  }
  .ed-media img,
  .ed-media video {
    width: 100px;
  }
}

body.editorial-theme {
  --bg-deep: #0a0a0c;
  --bg-base: #0a0a0c;
  --accent: #a1c7b7;
  --accent-glow: transparent;
}
.editorial-theme > div.fixed.-z-10 {
  display: none;
}
.editorial-theme .ep-day-heading strong {
  font-size: 27px;
}
.editorial-theme .ed-native :is(.bg-slate-950, .bg-slate-900) {
  background: #101013;
}
.editorial-theme .ed-native [id^="post-edit-block-"] {
  display: flex;
}
.editorial-theme .ed-native [id^="post-view-text-"] {
  display: none;
}
@media (max-width: 760px) {
  .editorial-theme #main-sidebar {
    width: 180px;
  }
  .editorial-theme main > header {
    padding: 12px 16px;
  }
  .editorial-theme .ep-day-heading strong {
    font-size: 25px;
  }
}
@media (max-width: 600px) {
  .editorial-theme #main-sidebar {
    width: 100%;
    height: auto;
    flex-shrink: 0;
    position: static;
    border-right: 0;
  }
  .editorial-theme #main-sidebar > div:first-child {
    padding: 12px 16px;
  }
  .editorial-theme #main-sidebar nav {
    display: flex;
    overflow-x: auto;
    padding: 8px;
    gap: 4px;
    flex: none;
  }
  .editorial-theme #main-sidebar nav .ed-nav-label {
    display: none;
  }
  .editorial-theme #main-sidebar nav button {
    width: auto;
    white-space: nowrap;
    padding: 10px 12px;
    flex-shrink: 0;
    font-size: 12px;
  }
  .editorial-theme #main-sidebar > div:last-child {
    flex-direction: row;
    padding: 6px 8px;
    gap: 2px;
  }
  .editorial-theme #main-sidebar > div:last-child button {
    width: auto;
    padding: 8px;
    font-size: 11px;
  }
  .editorial-theme #main-sidebar > div:last-child #btn-logout {
    margin-left: auto;
  }
  .editorial-theme body {
    overflow: auto;
  }
  .editorial-theme #main-sidebar + main {
    min-height: 0;
  }
  .editorial-theme #app-layout {
    flex-direction: column;
  }
  .editorial-theme .ed-dialog .grid-cols-1 {
    grid-template-columns: 1fr;
  }
  .editorial-theme .ed-dialog .md\:grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

.ed-native textarea,
.ed-native [contenteditable] {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.8;
}
.ed-native .text-xs {
  font-size: 13px;
  line-height: 1.7;
}
.ed-footer {
  position: sticky;
  bottom: -24px;
  background: #131317;
  z-index: 2;
  padding-bottom: 16px;
}
.editorial-theme #main-sidebar {
  width: 228px;
}
.editorial-theme #main-sidebar .font-outfit {
  font-family: inherit;
}
@media (max-width: 600px) {
  .editorial-theme #main-sidebar {
    width: 100%;
  }
  .ed-footer {
    bottom: -18px;
  }
}

.editorial-theme .ep-header {
  display: none;
}

.editorial-theme #main-sidebar > div:last-child button {
  background: transparent;
  color: var(--ed-muted);
  border: 1px solid transparent;
  box-shadow: none;
}
.editorial-theme #main-sidebar > div:last-child button.ed-selected {
  background: #222227;
  color: #ededf0;
  border-color: #38383f;
}
.ed-dialog input[type="time"] {
  font-size: 22px;
}
.ed-dialog input[type="date"] {
  font-size: 18px;
}

/* Holding identity: pastel yellow ticket, original dark lettering. */
.ed-brand { display:flex; flex-direction:column; align-items:flex-start; gap:12px; padding:24px; width:100%; border:0; border-bottom:1px solid #29292f; background:transparent; text-align:left; cursor:pointer; }
.ed-brand img { display:block; width:150px; height:auto; max-width:100%; }
.ed-brand span { color:#b7b7c0; font-size:10px; font-weight:600; letter-spacing:1.25px; line-height:1.5; }
.ed-brand:focus-visible { outline:2px solid #e7d59b; outline-offset:-4px; }

/* Compact source controls, scoped to the collection settings dialog. */
.ed-dialog.ed-dialog--sources { width: min(640px, calc(100vw - 24px)); padding: 20px; }
.ed-dialog--sources .ed-collection-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ed-dialog--sources .ed-interval-field { width: 110px; flex: 0 0 110px; }
.ed-dialog--sources .ed-interval-field input { width: 100%; }
.ed-dialog--sources .ed-source-hint { margin: 0; font-size: 12px; }
.ed-source-list { display: grid; gap: 0; }
.ed-source-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #29292f; font-size: 14px; }
.ed-source-row > span { min-width: 0; overflow-wrap: anywhere; }
.ed-dialog .ed-source-toggle { min-width: 105px; min-height: 44px; flex-shrink: 0; font-size: 12px; }
.ed-dialog .ed-source-toggle[aria-pressed="true"] { background: #a1c7b7; color: #18251e; border-color: #a1c7b7; }
.ed-dialog .ed-source-toggle[aria-pressed="true"]:not(:disabled):hover { background: #b2d4c6; color: #18251e; }
.ed-dialog--sources .ed-footer { margin-top: 0; }

/* SITE editorial workflow: incoming groups and bounded publication calendar. */
.editorial-theme .ep-date-range { display: inline-flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.editorial-theme .ep-date-range label { display: grid; gap: 4px; color: var(--ed-muted); font-size: 11px; }
.editorial-theme .ep-date-range input { min-height: 36px; padding: 7px 9px; }
.editorial-theme .ep-group-period[aria-pressed="true"] { background: #bdd3c820; border-color: #bdd3c880; color: #d9eee3; }
.editorial-theme .ep-incoming-card { background: #111115; }
.editorial-theme .ep-incoming-card .ep-reason { color: #b6b6c0; }
@media (max-width: 480px) {
  .ed-dialog.ed-dialog--sources { padding: 16px; }
  .ed-dialog--sources .ed-collection-controls { align-items: flex-end; gap: 12px; }
}

/* Publication destination review and per-site receipts. */
.site-distribution-summary { margin-top: 12px; padding: 12px 16px; border: 1px solid var(--ed-line, #29292f); border-radius: 8px; background: var(--ed-raised, #19191e); color: var(--ed-text, #ededf0); font-size: 13px; line-height: 1.6; }
.site-distribution-result-list { display: grid; gap: 8px; padding: 0; margin: 12px 0; list-style: none; }
.site-distribution-result { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 3fr); gap: 8px 16px; padding: 12px; border: 1px solid var(--ed-line, #29292f); border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; }
.site-distribution-result[data-result="success"] { border-color: #537465; }
.site-distribution-result[data-result="error"] { border-color: #8a605b; }
@media (max-width: 480px) { .site-distribution-result { grid-template-columns: 1fr; gap: 4px; } }

/* Cross-site confirmation uses the platform's shared dialog and button tokens. */
#site-distribution-dialog { width:min(760px,calc(100vw - 32px)); padding:24px; }
#site-distribution-form { margin:0; gap:20px; }
#site-distribution-dialog .site-distribution-header { display:flex; align-items:flex-start; gap:16px; }
#site-distribution-dialog .site-distribution-header > div { min-width:0; flex:1; }
#site-distribution-dialog h3 { margin:0; font-size:20px; line-height:1.4; font-weight:650; color:var(--ed-text); }
#site-distribution-dialog-message { margin:8px 0 0; color:var(--ed-muted); font-size:13px; line-height:1.6; }
#site-distribution-dialog .ed-close { width:44px; height:44px; min-width:44px; padding:0; line-height:1; }
#site-distribution-dialog-rows > article { border:1px solid var(--ed-line); background:var(--ed-bg); border-radius:10px; padding:16px; }
#site-distribution-dialog h4 { margin:0; color:var(--ed-text); font-size:15px; line-height:1.5; font-weight:600; }
#site-distribution-dialog :is(.text-slate-300,.text-slate-400) { color:var(--ed-muted); }
#site-distribution-dialog [data-site-distribution-open-copy] { color:var(--ed-accent); }
#site-distribution-dialog label { display:block; }
#site-distribution-dialog :is(select,input) { min-height:44px; }
#site-distribution-dialog-status { margin:0; font-size:13px; line-height:1.6; color:var(--ed-muted); }
#site-distribution-dialog-status:empty { display:none; }
#site-distribution-dialog .ed-footer { margin:0; padding-top:16px; }
#site-distribution-dialog .ed-footer button { min-height:44px; font-size:13px; line-height:1.5; }
@media(max-width:520px) {
  #site-distribution-dialog { padding:18px; max-height:calc(100dvh - 24px); }
  #site-distribution-dialog h3 { font-size:18px; }
  #site-distribution-dialog .ed-footer { display:flex; flex-direction:column-reverse; }
  #site-distribution-dialog .ed-footer button { width:100%; white-space:normal; }
}

/* One continuous focus edge for form fields; avoid a second offset outline. */
.editorial-theme .ep-page :is(input, select, textarea):focus,
.ed-page :is(input, select, textarea):focus,
.ed-dialog :is(input, select, textarea):focus {
  border-color: #a1c7b7;
  outline: none;
  box-shadow: 0 0 0 1px #a1c7b7;
}
